]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/axis-group-interface.cc
*** empty log message ***
[lilypond.git] / lily / axis-group-interface.cc
index 895b5597c9a4f19c33f1807b054898d833176b81..1efc878a928014cc94c204fc4f4ea2e1348ad31b 100644 (file)
@@ -58,16 +58,11 @@ Axis_group_interface::group_extent_callback (SCM element_smob, SCM scm_axis)
   Grob *me = unsmob_grob (element_smob);
   Axis a = (Axis) gh_scm2int (scm_axis);
 
-  Grob * common = (Grob*) me;
-
-  for (SCM s = me->get_grob_property ("elements"); gh_pair_p (s); s = ly_cdr (s))
-    {
-      Grob * se = unsmob_grob (ly_car (s));
-      common = se->common_refpoint (common, a);
-    }
+  SCM elts = me->get_grob_property ("elements");
+  Grob * common = common_refpoint_of_list (elts, me, a);
 
   Real my_coord = me->relative_coordinate (common, a);
-  Interval r (relative_group_extent (a, common, me->get_grob_property ("elements")));
+  Interval r (relative_group_extent (a, common,elts));
 
   return ly_interval2scm (r - my_coord);
 }
@@ -75,9 +70,8 @@ Axis_group_interface::group_extent_callback (SCM element_smob, SCM scm_axis)
 void
 Axis_group_interface::set_axes (Grob*me,Axis a1, Axis a2)
 {
-  // set_interface () ?
-  SCM sa1= gh_int2scm (a1);
-  SCM sa2 = gh_int2scm (a2);
+  SCM sa1= scm_int2num (a1);
+  SCM sa2 = scm_int2num (a2);
 
   SCM axes = me->get_grob_property ("axes");
   
@@ -92,17 +86,17 @@ Axis_group_interface::set_axes (Grob*me,Axis a1, Axis a2)
     }
 
   if (a1 != X_AXIS && a2 != X_AXIS)
-    me->set_extent_callback (SCM_EOL, X_AXIS);
+    me->set_extent (SCM_EOL, X_AXIS);
   if (a1 != Y_AXIS && a2 != Y_AXIS)
-    me->set_extent_callback (SCM_EOL, Y_AXIS);
+    me->set_extent (SCM_EOL, Y_AXIS);
 
   /*
     why so convoluted ? (fixme/documentme?) 
    */
   if (me->has_extent_callback_b (Grob::molecule_extent_proc, a1))
-    me->set_extent_callback (Axis_group_interface::group_extent_callback_proc,a1);
+    me->set_extent (Axis_group_interface::group_extent_callback_proc,a1);
   if (me->has_extent_callback_b (Grob::molecule_extent_proc, a2))
-    me->set_extent_callback (Axis_group_interface::group_extent_callback_proc,a2);
+    me->set_extent (Axis_group_interface::group_extent_callback_proc,a2);
 }
 
 Link_array<Grob> 
@@ -124,11 +118,6 @@ Axis_group_interface::get_children (Grob*me)
   return childs;
 }
 
-bool
-Axis_group_interface::has_interface (Grob*me)
-{
-  return me && me->has_interface (ly_symbol2scm ("axis-group-interface"));
-}
 
 
 ADD_INTERFACE (Axis_group_interface, "axis-group-interface",