2 script-column-engraver.cc -- implement Script_column_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
10 #include "script-column.hh"
11 #include "side-position-interface.hh"
14 Find potentially colliding scripts, and put them in a
15 Script_column, that will fix the collisions. */
16 class Script_column_engraver : public Engraver
19 Link_array<Item> scripts_;
22 TRANSLATOR_DECLARATIONS (Script_column_engraver);
24 virtual void acknowledge_grob (Grob_info);
25 virtual void process_acknowledged_grobs ();
26 virtual void stop_translation_timestep ();
29 Script_column_engraver::Script_column_engraver ()
35 Script_column_engraver::stop_translation_timestep ()
42 Script_column_engraver::acknowledge_grob (Grob_info inf)
44 Item *thing = dynamic_cast<Item *> (inf.grob_);
45 if (thing && Side_position_interface::has_interface (inf.grob_)) // ugh FIXME
47 if (!Item::is_breakable (thing)
48 && Side_position_interface::get_axis (inf.grob_) == Y_AXIS)
50 scripts_.push (thing);
56 Script_column_engraver::process_acknowledged_grobs ()
58 if (!scol_ && scripts_.size () > 1)
60 scol_ = make_item ("ScriptColumn", SCM_EOL);
65 for (int i = 0; i < scripts_.size (); i++)
66 Script_column::add_staff_sided (scol_, scripts_[i]);
71 ADD_TRANSLATOR (Script_column_engraver,
73 /* creats*/ "ScriptColumn",
75 /* acks */ "side-position-interface",