2 vertical-align-grav.cc -- implement Vertical_align_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
9 #include "paper-column.hh"
10 #include "align-interface.hh"
11 #include "span-bar.hh"
12 #include "axis-group-interface.hh"
13 #include "engraver.hh"
16 class Vertical_align_engraver : public Engraver
19 bool qualifies (Grob_info) const;
21 TRANSLATOR_DECLARATIONS (Vertical_align_engraver);
23 virtual void acknowledge_grob (Grob_info);
24 virtual void process_music ();
25 virtual void finalize ();
28 Vertical_align_engraver::Vertical_align_engraver ()
34 Vertical_align_engraver::process_music ()
38 valign_ =make_spanner ("VerticalAlignment", SCM_EOL);
39 valign_->set_bound (LEFT,unsmob_grob (get_property ("currentCommandColumn")));
45 Vertical_align_engraver::finalize ()
49 valign_->set_bound (RIGHT,unsmob_grob (get_property ("currentCommandColumn")));
55 Vertical_align_engraver::qualifies (Grob_info i) const
57 int sz = i.origin_contexts ((Translator*)this).size () ;
59 return sz > 0 && Axis_group_interface::has_interface (i.grob_)
60 && !i.grob_->get_parent (Y_AXIS) && Axis_group_interface::has_axis (i.grob_, Y_AXIS);
64 Vertical_align_engraver::acknowledge_grob (Grob_info i)
68 Align_interface::add_element (valign_,i.grob_, get_property ("verticalAlignmentChildCallback"));
73 ENTER_DESCRIPTION (Vertical_align_engraver,
74 /* descr */ "Catch Vertical axis groups and stack them.",
75 /* creats*/ "VerticalAlignment",
77 /* acks */ "axis-group-interface",