X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fslur.cc;h=5f95e5d4d659203dbee12d58aa7d59c3aa69dd47;hb=5d84bfad4626892bcffd05adcced53c8a2329047;hp=0f3f7162a732f99781f2d3c335eb6c1675778974;hpb=e0af94bb8939bc6f4998db6294010baa77139092;p=lilypond.git diff --git a/lily/slur.cc b/lily/slur.cc index 0f3f7162a7..5f95e5d4d6 100644 --- a/lily/slur.cc +++ b/lily/slur.cc @@ -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 (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 (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 (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 (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 (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 (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 &arr - = Grob_array::unsmob (encompass_scm)->array_reference (); - arr = new_encompasses; - } + if (Grob_array *a = unsmob (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 *slur = unsmob (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 *slur = unsmob (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 (smob); vector 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 (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 (smob); + Grob *slur = unsmob (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 (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 non_sep_extras; for (vsize i = 0; i < extras.size (); i++) - if (!Separation_item::has_interface (extras[i])) + if (!has_interface (extras[i])) non_sep_extras.push_back (extras[i]); Grob *common = common_refpoint_of_array (cols, me, Y_AXIS);