]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/side-position-interface.cc
(LY_DEFINE): ly_kpathsea_expand_variable. New
[lilypond.git] / lily / side-position-interface.cc
index e4dfd913a1d373f07cadb15266aadeba75a2a6e9..54ff667d6ebc9dccdd1ebd80c02deadd2d9f4d31 100644 (file)
@@ -54,7 +54,7 @@ SCM
 Side_position_interface::aligned_on_support_extents (SCM element_smob, SCM axis)
 {
   Grob *me = unsmob_grob (element_smob);
-  Axis a = (Axis) gh_scm2int (axis);
+  Axis a = (Axis) scm_to_int (axis);
 
   return general_side_position (me, a, true);
 }
@@ -73,7 +73,7 @@ Side_position_interface::general_side_position (Grob * me, Axis a, bool use_exte
   Grob * st = Staff_symbol_referencer::get_staff_symbol (me);
   bool include_staff = (st
                        && a == Y_AXIS
-                       && gh_number_p (me->get_property ("staff-padding")));
+                       && scm_is_number (me->get_property ("staff-padding")));
 
   Interval dim;
   if (include_staff)
@@ -121,7 +121,7 @@ Side_position_interface::general_side_position (Grob * me, Axis a, bool use_exte
 
   
   
-  return gh_double2scm (total_off);
+  return scm_make_real (total_off);
 }
 
 /*
@@ -132,7 +132,7 @@ SCM
 Side_position_interface::aligned_on_support_refpoints (SCM smob, SCM axis)
 {
   Grob *me = unsmob_grob (smob);
-  Axis a = (Axis) gh_scm2int (axis);
+  Axis a = (Axis) scm_to_int (axis);
 
   return general_side_position (me, a, false); 
 }
@@ -184,9 +184,9 @@ Side_position_interface::quantised_position (SCM element_smob, SCM)
          rp += d;
        }
       
-      return gh_double2scm ((rp - p) * Staff_symbol_referencer::staff_space (me) / 2.0);
+      return scm_make_real ((rp - p) * Staff_symbol_referencer::staff_space (me) / 2.0);
     }
-  return gh_double2scm (0.0);
+  return scm_make_real (0.0);
 }
 
 /*
@@ -197,11 +197,11 @@ SCM
 Side_position_interface::aligned_side (SCM element_smob, SCM axis)
 {
   Grob *me = unsmob_grob (element_smob);
-  Axis a = (Axis) gh_scm2int (axis);
+  Axis a = (Axis) scm_to_int (axis);
   
   Direction d = Side_position_interface::get_direction (me);
   
-  Real o = gh_scm2double (aligned_on_support_extents (element_smob,axis));
+  Real o = scm_to_double (aligned_on_support_extents (element_smob,axis));
 
   Interval iv =  me->extent (me, a);
 
@@ -222,21 +222,20 @@ Side_position_interface::aligned_side (SCM element_smob, SCM axis)
  */
   Grob * st = Staff_symbol_referencer::get_staff_symbol (me);
   if (st && a == Y_AXIS
-      && gh_number_p (me->get_property ("staff-padding")))
+      && scm_is_number (me->get_property ("staff-padding")))
     {
       Real padding=
       Staff_symbol_referencer::staff_space (me)
-      * gh_scm2double (me->get_property ("staff-padding"));
+      * scm_to_double (me->get_property ("staff-padding"));
   
       Grob *common = me->common_refpoint (st, Y_AXIS);
       
       Interval staff_size = st->extent (common, Y_AXIS);
-      Interval me_ext = me->extent (common, a);
       Real diff =  d*staff_size[d] + padding - d*(o + iv[-d]);
       o += (d*  (diff >? 0));
     }
       
-  return gh_double2scm (o);
+  return scm_make_real (o);
 }
 
 
@@ -246,8 +245,6 @@ Side_position_interface::set_axis (Grob*me, Axis a)
   me->add_offset_callback (Side_position_interface::aligned_side_proc, a);
 }
 
-
-
 // ugh. doesn't catch all variants. 
 Axis
 Side_position_interface::get_axis (Grob*me)
@@ -255,14 +252,11 @@ Side_position_interface::get_axis (Grob*me)
   if (me->has_offset_callback (Side_position_interface::aligned_side_proc, X_AXIS)
       || me->has_offset_callback (Side_position_interface::aligned_side_proc , X_AXIS))
     return X_AXIS;
-
   
   return Y_AXIS;
 }
 
 
-
-
 ADD_INTERFACE (Side_position_interface,"side-position-interface",
               "Position a victim object (this one) next to other objects (the "
               "support).   The property @code{direction} signifies where to put the  "