]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/axis-group-engraver.cc
release: 1.3.40
[lilypond.git] / lily / axis-group-engraver.cc
index 50b76990e5ddc5ab8b3e6662aeec3e4cc2654451..d6f881d6fc2d26ad0483d784965cd51a8882ff69 100644 (file)
@@ -7,9 +7,11 @@
  */
 
 #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 ()
 {
@@ -20,19 +22,31 @@ void
 Axis_group_engraver::do_creation_processing ()
 {
   staffline_p_ = get_spanner_p ();
-  axis_group (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;
@@ -51,8 +65,9 @@ Axis_group_engraver::process_acknowledged ()
   for (int i=0; i < elts_.size (); i++)
     {
       Score_element *par = elts_[i]->parent_l (Y_AXIS);
-      if (!par || !axis_group (par).has_interface_b ())
-       axis_group (staffline_p_).add_element (elts_[i]);
+
+      if (!par || !Axis_group_interface (par).has_interface_b ())
+       Axis_group_interface (staffline_p_).add_element (elts_[i]);
     }
   elts_.clear ();
 }