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");
39 valign_->set_bound (LEFT,unsmob_grob (get_property ("currentCommandColumn")));
40 announce_grob (valign_ , SCM_EOL);
45 Vertical_align_engraver::finalize ()
49 valign_->set_bound (RIGHT,unsmob_grob (get_property ("currentCommandColumn")));
50 typeset_grob (valign_);
56 Vertical_align_engraver::qualifies (Grob_info i) const
58 int sz = i.origin_contexts ((Translator*)this).size () ;
60 return sz > 0 && Axis_group_interface::has_interface (i.grob_)
61 && !i.grob_->get_parent (Y_AXIS) && Axis_group_interface::has_axis (i.grob_, Y_AXIS);
65 Vertical_align_engraver::acknowledge_grob (Grob_info i)
69 Align_interface::add_element (valign_,i.grob_, get_property ("verticalAlignmentChildCallback"));
74 ENTER_DESCRIPTION (Vertical_align_engraver,
75 /* descr */ "Catch Vertical axis groups and stack them.",
76 /* creats*/ "VerticalAlignment",
78 /* acks */ "axis-group-interface",