2 axis-group-engraver.cc -- implement Axis_group_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1999--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
9 #include "axis-group-engraver.hh"
11 #include "axis-group-interface.hh"
13 #include "international.hh"
17 #include "translator.icc"
19 Axis_group_engraver::Axis_group_engraver ()
26 Axis_group_engraver::process_music ()
30 staffline_ = get_spanner ();
31 Grob *it = unsmob_grob (get_property ("currentCommandColumn"));
32 staffline_->set_bound (LEFT, it);
37 Axis_group_engraver::get_spanner ()
39 return make_spanner ("VerticalAxisGroup", SCM_EOL);
43 TODO: should we junk minimumVerticalExtent/extraVerticalExtent ?
47 Axis_group_engraver::finalize ()
51 Grob *it = unsmob_grob (get_property ("currentCommandColumn"));
52 staffline_->set_bound (RIGHT, it);
57 Axis_group_engraver::acknowledge_grob (Grob_info i)
59 elts_.push_back (i.grob ());
63 maybe should check if our parent is set, because we now get a
64 cyclic parent relationship if we have two Axis_group_engravers in
67 Axis_group_engraver::process_acknowledged ()
72 for (vsize i = 0; i < elts_.size (); i++)
74 if (!unsmob_grob (elts_[i]->get_object ("axis-group-parent-Y")))
76 if (staffline_->get_parent (Y_AXIS)
77 && staffline_->get_parent (Y_AXIS) == elts_[i])
79 staffline_->warning (_ ("Axis_group_engraver: vertical group already has a parent"));
80 staffline_->warning (_ ("are there two Axis_group_engravers?"));
81 staffline_->warning (_ ("removing this vertical group"));
82 staffline_->suicide ();
86 add_element (elts_[i]);
93 Axis_group_engraver::add_element (Grob *e)
95 Axis_group_interface::add_element (staffline_, e);
98 ADD_ACKNOWLEDGER (Axis_group_engraver, grob);
100 ADD_TRANSLATOR (Axis_group_engraver,
101 /* doc */ "Group all objects created in this context in a VerticalAxisGroup spanner.",
102 /* create */ "VerticalAxisGroup",
104 /* read */ "verticalExtent minimumVerticalExtent extraVerticalExtent",