2 axis-group-engraver.cc -- implement Axis_group_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1999--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
9 #include "axis-group-engraver.hh"
11 #include "paper-column.hh"
12 #include "axis-group-interface.hh"
13 #include "dimension-cache.hh"
14 #include "engraver-group-engraver.hh"
16 Axis_group_engraver::Axis_group_engraver ()
22 Axis_group_engraver::do_creation_processing ()
24 staffline_p_ = get_spanner_p ();
25 Axis_group_interface (staffline_p_).set_interface ();
26 Axis_group_interface (staffline_p_).set_axes (Y_AXIS, Y_AXIS);
27 staffline_p_->set_bound(LEFT,get_staff_info().command_pcol_l ());
28 announce_element (Score_element_info (staffline_p_, 0));
32 Axis_group_engraver::get_spanner_p () const
38 Axis_group_engraver::do_removal_processing ()
40 String name = daddy_grav_l ()->type_str_ + "VerticalExtent";
41 SCM dims = get_property (name);
43 if (gh_pair_p (dims) && gh_number_p (gh_car (dims))
44 && gh_number_p (gh_cdr (dims)))
46 staffline_p_->dim_cache_[Y_AXIS]->set_extent_callback (&Score_element::preset_extent);
47 staffline_p_->set_elt_property ("extent-Y", dims);
50 staffline_p_->set_bound(RIGHT,get_staff_info().command_pcol_l ());
51 typeset_element (staffline_p_);
56 Axis_group_engraver::acknowledge_element (Score_element_info i)
58 elts_.push (i.elem_l_);
62 Axis_group_engraver::process_acknowledged ()
65 for (int i=0; i < elts_.size (); i++)
67 Score_element *par = elts_[i]->parent_l (Y_AXIS);
69 if (!par || !Axis_group_interface (par).has_interface_b ())
70 Axis_group_interface (staffline_p_).add_element (elts_[i]);
75 ADD_THIS_TRANSLATOR(Axis_group_engraver);