2 script-column-engraver.cc -- implement Script_column_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1999--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
10 #include "script-column.hh"
11 #include "side-position-interface.hh"
13 #include "translator.icc"
16 Find potentially colliding scripts, and put them in a
17 Script_column, that will fix the collisions. */
18 class Script_column_engraver : public Engraver
21 vector<Item*> scripts_;
24 TRANSLATOR_DECLARATIONS (Script_column_engraver);
26 DECLARE_ACKNOWLEDGER (side_position);
27 void process_acknowledged ();
28 void stop_translation_timestep ();
31 Script_column_engraver::Script_column_engraver ()
37 Script_column_engraver::stop_translation_timestep ()
41 for (vsize i = 0; i < scripts_.size (); i++)
42 if (Side_position_interface::get_axis (scripts_[i]) == Y_AXIS)
43 Script_column::add_staff_sided (scol_, scripts_[i]);
51 Script_column_engraver::acknowledge_side_position (Grob_info inf)
53 Item *thing = dynamic_cast<Item *> (inf.grob ());
56 if (!Item::is_non_musical (thing))
57 scripts_.push_back (thing);
62 Script_column_engraver::process_acknowledged ()
64 if (!scol_ && scripts_.size () > 1)
65 scol_ = make_item ("ScriptColumn", SCM_EOL);
68 ADD_ACKNOWLEDGER (Script_column_engraver, side_position);
69 ADD_TRANSLATOR (Script_column_engraver,
71 /* create */ "ScriptColumn",