2 output-property-engraver.cc -- implement Output_property_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 2000--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
10 #include "engraver.hh"
14 #include "translator.icc"
17 class Output_property_engraver : public Engraver
19 TRANSLATOR_DECLARATIONS (Output_property_engraver);
21 vector<Music*> props_;
22 DECLARE_ACKNOWLEDGER (grob)
24 void stop_translation_timestep ();
25 virtual bool try_music (Music*);
30 Output_property_engraver::try_music (Music* m)
32 if (m->is_mus_type ("layout-instruction"))
35 UGH. Only swallow the output property event in the context
36 it was intended for. This is inelegant but not inefficient.
38 if (context ()->is_alias (m->get_property ("context-type")))
48 Output_property_engraver::acknowledge_grob (Grob_info inf)
50 for (vsize i = props_.size (); i--;)
53 Context *d = inf.context ();
54 SCM proc = o->get_property ("procedure");
56 inf.grob ()->self_scm (),
58 context ()->self_scm ());
63 Output_property_engraver::stop_translation_timestep ()
68 Output_property_engraver::Output_property_engraver ()
72 ADD_ACKNOWLEDGER (Output_property_engraver,grob);
73 ADD_TRANSLATOR (Output_property_engraver,
76 "Apply a procedure to any grob acknowledged. ",