2 vertical-align-grav.cc -- implement Vertical_align_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
8 #include "translator-group.hh"
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_b (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_ =new Spanner (get_property ("VerticalAlignment"));
39 valign_->set_bound (LEFT,unsmob_grob (get_property ("currentCommandColumn")));
40 announce_grob(valign_ , SCM_EOL);
45 Vertical_align_engraver::finalize ()
47 valign_->set_bound (RIGHT,unsmob_grob (get_property ("currentCommandColumn")));
48 typeset_grob (valign_);
54 Vertical_align_engraver::qualifies_b (Grob_info i) const
56 int sz = i.origin_transes ((Translator*)this).size () ;
58 return sz > 1 && Axis_group_interface::has_interface (i.grob_)
59 && !i.grob_->get_parent (Y_AXIS) && Axis_group_interface::axis_b (i.grob_, Y_AXIS);
63 Vertical_align_engraver::acknowledge_grob (Grob_info i)
67 Align_interface::add_element (valign_,i.grob_, get_property ("verticalAlignmentChildCallback"));
72 ENTER_DESCRIPTION(Vertical_align_engraver,
73 /* descr */ "Catch Vertical axis groups and stack them.",
74 /* creats*/ "VerticalAlignment",
76 /* acks */ "axis-group-interface",