]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/slur.cc
Issue 5167/6: Changes: show \markup xxx = ... \etc assignments
[lilypond.git] / lily / slur.cc
index 0f3f7162a732f99781f2d3c335eb6c1675778974..5f95e5d4d659203dbee12d58aa7d59c3aa69dd47 100644 (file)
@@ -47,7 +47,7 @@ MAKE_SCHEME_CALLBACK (Slur, calc_direction, 1)
 SCM
 Slur::calc_direction (SCM smob)
 {
-  Grob *me = Grob::unsmob (smob);
+  Grob *me = unsmob<Grob> (smob);
   extract_grob_set (me, "note-columns", encompasses);
 
   if (encompasses.empty ())
@@ -81,7 +81,7 @@ Slur::pure_height (SCM smob, SCM start_scm, SCM end_scm)
     -- adding extra height for scripts that avoid slurs on the inside
     -- adding extra height for the "bulge" in a slur above a note head
   */
-  Grob *me = Grob::unsmob (smob);
+  Grob *me = unsmob<Grob> (smob);
   int start = scm_to_int (start_scm);
   int end = scm_to_int (end_scm);
   Direction dir = get_grob_direction (me);
@@ -99,7 +99,7 @@ Slur::pure_height (SCM smob, SCM start_scm, SCM end_scm)
 
   for (vsize i = 0; i < encompasses.size (); i++)
     {
-      Interval d = encompasses[i]->pure_height (parent, start, end);
+      Interval d = encompasses[i]->pure_y_extent (parent, start, end);
       if (!d.is_empty ())
         {
           for (DOWN_and_UP (downup))
@@ -133,7 +133,7 @@ MAKE_SCHEME_CALLBACK (Slur, height, 1);
 SCM
 Slur::height (SCM smob)
 {
-  Grob *me = Grob::unsmob (smob);
+  Grob *me = unsmob<Grob> (smob);
 
   // FIXME uncached
   Stencil *m = me->get_stencil ();
@@ -145,7 +145,7 @@ MAKE_SCHEME_CALLBACK (Slur, print, 1);
 SCM
 Slur::print (SCM smob)
 {
-  Grob *me = Grob::unsmob (smob);
+  Grob *me = unsmob<Grob> (smob);
   extract_grob_set (me, "note-columns", encompasses);
   if (encompasses.empty ())
     {
@@ -179,7 +179,7 @@ Slur::print (SCM smob)
         properties = scm_cons (scm_acons (ly_symbol2scm ("font-size"), scm_from_int (-6), SCM_EOL),
                                properties);
 
-      Stencil tm = *Stencil::unsmob (Text_interface::interpret_markup
+      Stencil tm = *unsmob<Stencil> (Text_interface::interpret_markup
                                     (me->layout ()->self_scm (), properties,
                                      annotation));
       a.add_at_edge (Y_AXIS, get_grob_direction (me), tm, 1.0);
@@ -204,7 +204,7 @@ Slur::replace_breakable_encompass_objects (Grob *me)
     {
       Grob *g = extra_objects[i];
 
-      if (Separation_item::has_interface (g))
+      if (has_interface<Separation_item> (g))
         {
           extract_grob_set (g, "elements", breakables);
           for (vsize j = 0; j < breakables.size (); j++)
@@ -219,13 +219,8 @@ Slur::replace_breakable_encompass_objects (Grob *me)
         new_encompasses.push_back (g);
     }
 
-  SCM encompass_scm = me->get_object ("encompass-objects");
-  if (Grob_array::is_smob (encompass_scm))
-    {
-      vector<Grob *> &arr
-        = Grob_array::unsmob (encompass_scm)->array_reference ();
-      arr = new_encompasses;
-    }
+  if (Grob_array *a = unsmob<Grob_array> (me->get_object ("encompass-objects")))
+    a->set_array (new_encompasses);
 }
 
 Bezier
@@ -259,8 +254,8 @@ Slur::pure_outside_slur_callback (SCM grob, SCM start_scm, SCM end_scm, SCM offs
 {
   int start = robust_scm2int (start_scm, 0);
   int end = robust_scm2int (end_scm, 0);
-  Grob *script = Grob::unsmob (grob);
-  Grob *slur = Grob::unsmob (script->get_object ("slur"));
+  Grob *script = unsmob<Grob> (grob);
+  Grob *slur = unsmob<Grob> (script->get_object ("slur"));
   if (!slur)
     return offset_scm;
 
@@ -271,15 +266,15 @@ Slur::pure_outside_slur_callback (SCM grob, SCM start_scm, SCM end_scm, SCM offs
 
   Real offset = robust_scm2double (offset_scm, 0.0);
   Direction dir = get_grob_direction (script);
-  return scm_from_double (offset + dir * slur->pure_height (slur, start, end).length () / 4);
+  return scm_from_double (offset + dir * slur->pure_y_extent (slur, start, end).length () / 4);
 }
 
 MAKE_SCHEME_CALLBACK_WITH_OPTARGS (Slur, outside_slur_callback, 2, 1, "");
 SCM
 Slur::outside_slur_callback (SCM grob, SCM offset_scm)
 {
-  Grob *script = Grob::unsmob (grob);
-  Grob *slur = Grob::unsmob (script->get_object ("slur"));
+  Grob *script = unsmob<Grob> (grob);
+  Grob *slur = unsmob<Grob> (script->get_object ("slur"));
 
   if (!slur)
     return offset_scm;
@@ -371,7 +366,7 @@ MAKE_SCHEME_CALLBACK (Slur, vertical_skylines, 1);
 SCM
 Slur::vertical_skylines (SCM smob)
 {
-  Grob *me = Grob::unsmob (smob);
+  Grob *me = unsmob<Grob> (smob);
   vector<Box> boxes;
 
   if (!me)
@@ -409,7 +404,7 @@ Slur::auxiliary_acknowledge_extra_object (Grob_info const &info,
   else
     slur = slurs[0];
 
-  if (Tie::has_interface (e)
+  if (has_interface<Tie> (e)
       || scm_is_eq (avoid, ly_symbol2scm ("inside")))
     {
       for (vsize i = slurs.size (); i--;)
@@ -450,8 +445,8 @@ Slur::outside_slur_cross_staff (SCM smob, SCM previous)
   if (to_boolean (previous))
     return previous;
 
-  Grob *me = Grob::unsmob (smob);
-  Grob *slur = Grob::unsmob (me->get_object ("slur"));
+  Grob *me = unsmob<Grob> (smob);
+  Grob *slur = unsmob<Grob> (me->get_object ("slur"));
 
   if (!slur)
     return SCM_BOOL_F;
@@ -462,7 +457,7 @@ MAKE_SCHEME_CALLBACK (Slur, calc_cross_staff, 1)
 SCM
 Slur::calc_cross_staff (SCM smob)
 {
-  Grob *me = Grob::unsmob (smob);
+  Grob *me = unsmob<Grob> (smob);
 
   extract_grob_set (me, "note-columns", cols);
   extract_grob_set (me, "encompass-objects", extras);
@@ -478,7 +473,7 @@ Slur::calc_cross_staff (SCM smob)
      so we can ignore them here */
   vector<Grob *> non_sep_extras;
   for (vsize i = 0; i < extras.size (); i++)
-    if (!Separation_item::has_interface (extras[i]))
+    if (!has_interface<Separation_item> (extras[i]))
       non_sep_extras.push_back (extras[i]);
 
   Grob *common = common_refpoint_of_array (cols, me, Y_AXIS);