source file of the GNU LilyPond music typesetter
- (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1999--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "axis-group-engraver.hh"
-#include "axis-group-spanner.hh"
+#include "spanner.hh"
#include "paper-column.hh"
+#include "axis-group-interface.hh"
+#include "dimension-cache.hh"
+#include "engraver-group-engraver.hh"
Axis_group_engraver::Axis_group_engraver ()
{
Axis_group_engraver::do_creation_processing ()
{
staffline_p_ = get_spanner_p ();
- staffline_p_->set_axes (Y_AXIS, Y_AXIS);
+ Axis_group_interface (staffline_p_).set_interface ();
+ Axis_group_interface (staffline_p_).set_axes (Y_AXIS, Y_AXIS);
staffline_p_->set_bound(LEFT,get_staff_info().command_pcol_l ());
announce_element (Score_element_info (staffline_p_, 0));
}
-Axis_group_spanner*
+Spanner*
Axis_group_engraver::get_spanner_p () const
{
- return new Axis_group_spanner;
+ return new Spanner;
}
+
void
Axis_group_engraver::do_removal_processing ()
{
+ String name = daddy_grav_l ()->type_str_ + "VerticalExtent";
+ SCM dims = get_property (name);
+
+ if (gh_pair_p (dims) && gh_number_p (gh_car (dims))
+ && gh_number_p (gh_cdr (dims)))
+ {
+ staffline_p_->dim_cache_[Y_AXIS]->set_extent_callback (&Score_element::preset_extent);
+ staffline_p_->set_elt_property ("extent-Y", dims);
+ }
+
staffline_p_->set_bound(RIGHT,get_staff_info().command_pcol_l ());
typeset_element (staffline_p_);
staffline_p_ = 0;
/* UGH UGH UGH */
for (int i=0; i < elts_.size (); i++)
{
- if (!elts_[i]->parent_l (Y_AXIS))
- staffline_p_->add_element (elts_[i]);
- else
- if (
- // elts_[i]->get_elt_property ("Axis_group_element::add_extra_element") == SCM_UNDEFINED &&
- ! dynamic_cast<Axis_group_element*> (elts_[i]->parent_l (Y_AXIS)))
-
- {
- staffline_p_->add_element (elts_[i]);
- }
+ Score_element *par = elts_[i]->parent_l (Y_AXIS);
+
+ if (!par || !Axis_group_interface (par).has_interface_b ())
+ Axis_group_interface (staffline_p_).add_element (elts_[i]);
}
elts_.clear ();
}