]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/stencil-integral.cc
Merge remote branch 'origin/master' into release/unstable
[lilypond.git] / lily / stencil-integral.cc
index 654ecdd5ab268e8b79cb3af289074158db8c169a..91f1333867c4d03652d264b57a481b2d67884458 100644 (file)
@@ -692,7 +692,7 @@ void
 make_named_glyph_boxes (vector<Box> &boxes, vector<Drul_array<Offset> > &buildings, PangoMatrix trans, SCM expr)
 {
   SCM fm_scm = scm_car (expr);
-  Font_metric *fm = unsmob_metrics (fm_scm);
+  Font_metric *fm = Font_metric::unsmob (fm_scm);
   expr = scm_cdr (expr);
   SCM glyph = scm_car (expr);
   string glyph_s = ly_scm2string (glyph);
@@ -731,7 +731,7 @@ void
 make_glyph_string_boxes (vector<Box> &boxes, vector<Drul_array<Offset> > &buildings, PangoMatrix trans, SCM expr)
 {
   SCM fm_scm = scm_car (expr);
-  Font_metric *fm = unsmob_metrics (fm_scm);
+  Font_metric *fm = Font_metric::unsmob (fm_scm);
   expr = scm_cdr (expr);
   expr = scm_cdr (expr); // font-name
   expr = scm_cdr (expr); // size
@@ -953,6 +953,8 @@ stencil_traverser (PangoMatrix trans, SCM expr)
     return stencil_traverser (trans, scm_caddr (expr));
   else if (scm_car (expr) == ly_symbol2scm ("color"))
     return stencil_traverser (trans, scm_caddr (expr));
+  else if (scm_car (expr) == ly_symbol2scm ("transparent-stencil"))
+    return stencil_traverser (trans, scm_cadr (expr));
   else if (scm_car (expr) == ly_symbol2scm ("id"))
     return stencil_traverser (trans, scm_caddr (expr));
   else
@@ -993,19 +995,19 @@ MAKE_SCHEME_CALLBACK (Grob, pure_simple_vertical_skylines_from_extents, 3);
 SCM
 Grob::pure_simple_vertical_skylines_from_extents (SCM smob, SCM begscm, SCM endscm)
 {
-  Grob *me = unsmob_grob (smob);
+  Grob *me = Grob::unsmob (smob);
   int beg = robust_scm2int (begscm, 0);
   int end = robust_scm2int (endscm, INT_MAX);
-  // We cannot measure the width of a spanner before line breaking,
-  // so we assume that the width is infinite.
-  return maybe_pure_internal_simple_skylines_from_extents (me, X_AXIS, true, beg, end, dynamic_cast<Spanner *> (me), false);
+  // We cannot measure the widths before line breaking,
+  // so we assume that the width is infinite: pass ignore_x=true
+  return maybe_pure_internal_simple_skylines_from_extents (me, X_AXIS, true, beg, end, true, false);
 }
 
 MAKE_SCHEME_CALLBACK (Grob, simple_vertical_skylines_from_extents, 1);
 SCM
 Grob::simple_vertical_skylines_from_extents (SCM smob)
 {
-  Grob *me = unsmob_grob (smob);
+  Grob *me = Grob::unsmob (smob);
   return maybe_pure_internal_simple_skylines_from_extents (me, X_AXIS, false, 0, 0, false, false);
 }
 
@@ -1013,7 +1015,7 @@ MAKE_SCHEME_CALLBACK (Grob, pure_simple_horizontal_skylines_from_extents, 3);
 SCM
 Grob::pure_simple_horizontal_skylines_from_extents (SCM smob, SCM begscm, SCM endscm)
 {
-  Grob *me = unsmob_grob (smob);
+  Grob *me = Grob::unsmob (smob);
   int beg = robust_scm2int (begscm, 0);
   int end = robust_scm2int (endscm, INT_MAX);
   // If the grob is cross staff, we cannot measure its Y-extent before
@@ -1026,7 +1028,7 @@ MAKE_SCHEME_CALLBACK (Grob, simple_horizontal_skylines_from_extents, 1);
 SCM
 Grob::simple_horizontal_skylines_from_extents (SCM smob)
 {
-  Grob *me = unsmob_grob (smob);
+  Grob *me = Grob::unsmob (smob);
   // See comment in function above.
   return maybe_pure_internal_simple_skylines_from_extents (me, Y_AXIS, false, 0, 0, false, to_boolean (me->get_property ("cross-staff")));
 }
@@ -1034,7 +1036,7 @@ Grob::simple_horizontal_skylines_from_extents (SCM smob)
 SCM
 Stencil::skylines_from_stencil (SCM sten, Real pad, Axis a)
 {
-  Stencil *s = unsmob_stencil (sten);
+  Stencil *s = Stencil::unsmob (sten);
   if (!s)
     return Skyline_pair ().smobbed_copy ();
 
@@ -1056,7 +1058,6 @@ Stencil::skylines_from_stencil (SCM sten, Real pad, Axis a)
   for (DOWN_and_UP (d))
     out[d] = out[d].padded (pad);
 
-  out.deholify ();
   return out.smobbed_copy ();
 }
 
@@ -1064,7 +1065,7 @@ MAKE_SCHEME_CALLBACK (Grob, vertical_skylines_from_stencil, 1);
 SCM
 Grob::vertical_skylines_from_stencil (SCM smob)
 {
-  Grob *me = unsmob_grob (smob);
+  Grob *me = Grob::unsmob (smob);
 
   Real pad = robust_scm2double (me->get_property ("skyline-horizontal-padding"), 0.0);
   SCM out = Stencil::skylines_from_stencil (me->get_property ("stencil"), pad, X_AXIS);
@@ -1076,7 +1077,7 @@ MAKE_SCHEME_CALLBACK (Grob, horizontal_skylines_from_stencil, 1);
 SCM
 Grob::horizontal_skylines_from_stencil (SCM smob)
 {
-  Grob *me = unsmob_grob (smob);
+  Grob *me = Grob::unsmob (smob);
 
   Real pad = robust_scm2double (me->get_property ("skyline-vertical-padding"), 0.0);
   SCM out = Stencil::skylines_from_stencil (me->get_property ("stencil"), pad, Y_AXIS);
@@ -1138,7 +1139,7 @@ MAKE_SCHEME_CALLBACK (Grob, vertical_skylines_from_element_stencils, 1);
 SCM
 Grob::vertical_skylines_from_element_stencils (SCM smob)
 {
-  Grob *me = unsmob_grob (smob);
+  Grob *me = Grob::unsmob (smob);
   return internal_skylines_from_element_stencils (me, X_AXIS, false, 0, INT_MAX);
 }
 
@@ -1146,7 +1147,7 @@ MAKE_SCHEME_CALLBACK (Grob, horizontal_skylines_from_element_stencils, 1);
 SCM
 Grob::horizontal_skylines_from_element_stencils (SCM smob)
 {
-  Grob *me = unsmob_grob (smob);
+  Grob *me = Grob::unsmob (smob);
   return internal_skylines_from_element_stencils (me, Y_AXIS, false, 0, INT_MAX);
 }
 
@@ -1154,7 +1155,7 @@ MAKE_SCHEME_CALLBACK (Grob, pure_vertical_skylines_from_element_stencils, 3);
 SCM
 Grob::pure_vertical_skylines_from_element_stencils (SCM smob, SCM beg_scm, SCM end_scm)
 {
-  Grob *me = unsmob_grob (smob);
+  Grob *me = Grob::unsmob (smob);
   int beg = robust_scm2int (beg_scm, 0);
   int end = robust_scm2int (end_scm, 0);
   return internal_skylines_from_element_stencils (me, X_AXIS, true, beg, end);
@@ -1164,7 +1165,7 @@ MAKE_SCHEME_CALLBACK (Grob, pure_horizontal_skylines_from_element_stencils, 3);
 SCM
 Grob::pure_horizontal_skylines_from_element_stencils (SCM smob, SCM beg_scm, SCM end_scm)
 {
-  Grob *me = unsmob_grob (smob);
+  Grob *me = Grob::unsmob (smob);
   int beg = robust_scm2int (beg_scm, 0);
   int end = robust_scm2int (end_scm, 0);
   return internal_skylines_from_element_stencils (me, Y_AXIS, true, beg, end);