]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/multi-measure-rest.cc
* scm/lily.scm (ly:all-stencil-expressions):
[lilypond.git] / lily / multi-measure-rest.cc
index ad45fbc197f141a916d82ba7101beb06fe4a2a81..49b6c7b63179b15ab7b78413b71881c467bbe5f4 100644 (file)
@@ -9,7 +9,7 @@
 
 #include "multi-measure-rest.hh"
 #include "warn.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "paper-column.hh" // urg
 #include "font-interface.hh"
 #include "rest.hh"
@@ -87,7 +87,7 @@ Multi_measure_rest::print (SCM smob)
     }
   while ((flip (&d)) != LEFT);
 
-  Real space = sp_iv.length();
+  Real space = sp_iv.length ();
 
   Real rx  = sp->get_bound (LEFT)->relative_coordinate (0, X_AXIS);
   /*
@@ -101,10 +101,10 @@ Multi_measure_rest::print (SCM smob)
   mol.add_stencil (symbol_stencil (me, space));
 
   int measures = 0;
-  SCM m (me->get_grob_property ("measure-count"));
-  if (gh_number_p (m))
+  SCM m (me->get_property ("measure-count"));
+  if (ly_c_number_p (m))
     {
-      measures = gh_scm2int (m);
+      measures = ly_scm2int (m);
     }
 
   mol.translate_axis (x_off, X_AXIS);
@@ -117,17 +117,17 @@ Stencil
 Multi_measure_rest::symbol_stencil (Grob *me, Real space)
 {
   int measures = 0;
-  SCM m (me->get_grob_property ("measure-count"));
-  if (gh_number_p (m))
+  SCM m (me->get_property ("measure-count"));
+  if (ly_c_number_p (m))
     {
-      measures = gh_scm2int (m);
+      measures = ly_scm2int (m);
     }
   if (measures <= 0)
-    return Stencil();
+    return Stencil ();
   
 
-  SCM limit = me->get_grob_property ("expand-limit");
-  if (measures > gh_scm2int (limit))
+  SCM limit = me->get_property ("expand-limit");
+  if (measures > ly_scm2int (limit))
     {
       Real padding = 0.15;  
       Stencil s =  big_rest (me, (1.0 - 2*padding) * space);
@@ -135,16 +135,16 @@ Multi_measure_rest::symbol_stencil (Grob *me, Real space)
       return s;
     }
 
-  SCM alist_chain = Font_interface::font_alist_chain (me);
+  SCM alist_chain = Font_interface::text_font_alist_chain (me);
 
   Real staff_space = Staff_symbol_referencer::staff_space (me);
   Font_metric *musfont
     = select_font (me->get_paper (), alist_chain);
 
-  SCM sml = me->get_grob_property ("use-breve-rest");
+  SCM sml = me->get_property ("use-breve-rest");
   if (measures == 1)
     {
-      if (sml == SCM_BOOL_T)
+      if (to_boolean (sml))
        {
          Stencil s = musfont->find_by_name (Rest::glyph_name (me, -1, ""));
 
@@ -180,15 +180,15 @@ Multi_measure_rest::symbol_stencil (Grob *me, Real space)
 Stencil
 Multi_measure_rest::big_rest (Grob *me, Real width)
 {
-  Real thick_thick =robust_scm2double (me->get_grob_property ("thick-thickness"), 1.0);
-  Real hair_thick = robust_scm2double (me->get_grob_property ("hair-thickness"), .1);
+  Real thick_thick =robust_scm2double (me->get_property ("thick-thickness"), 1.0);
+  Real hair_thick = robust_scm2double (me->get_property ("hair-thickness"), .1);
 
 
   Real ss = Staff_symbol_referencer::staff_space (me);
-  Real slt = me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness"));
+  Real slt = me->get_paper ()->get_dimension (ly_symbol2scm ("linethickness"));
   Real y = slt * thick_thick/2 * ss;
   Real ythick = hair_thick * slt * ss;
-  Box b(Interval (0,  0 >? (width - 2 * ythick)), Interval (-y, y));
+  Box b (Interval (0,  0 >? (width - 2 * ythick)), Interval (-y, y));
   
   Real blot = width ? (.8 * (y <? ythick)) : 0.0;
   
@@ -219,7 +219,7 @@ Multi_measure_rest::church_rest (Grob*me, Font_metric *musfont, int measures,
   int count = 0;
   Real symbols_width = 0.0;
 
-  SCM sml = me->get_grob_property ("use-breve-rest");
+  SCM sml = me->get_property ("use-breve-rest");
 
   while (l)
     {
@@ -239,7 +239,7 @@ Multi_measure_rest::church_rest (Grob*me, Font_metric *musfont, int measures,
 
          Stencil r (musfont->find_by_name ("rests-" + to_string (k)));
          symbols_width += r.extent (X_AXIS).length ();
-         mols = gh_cons (r.smobbed_copy (), mols);
+         mols = scm_cons (r.smobbed_copy (), mols);
        }
        else
        {
@@ -267,7 +267,7 @@ Multi_measure_rest::church_rest (Grob*me, Font_metric *musfont, int measures,
              r.translate_axis (staff_space, Y_AXIS);
            }
          symbols_width += r.extent (X_AXIS).length ();
-         mols = gh_cons (r.smobbed_copy (), mols);
+         mols = scm_cons (r.smobbed_copy (), mols);
        }
       count ++;
     }
@@ -282,9 +282,9 @@ Multi_measure_rest::church_rest (Grob*me, Font_metric *musfont, int measures,
     }
   
   Stencil mol; 
-  for (SCM  s = mols; gh_pair_p (s); s = gh_cdr(s))
+  for (SCM  s = mols; ly_c_pair_p (s); s = ly_cdr (s))
     {
-      mol.add_at_edge (X_AXIS, LEFT, *unsmob_stencil (gh_car (s)), inner_padding, 0);
+      mol.add_at_edge (X_AXIS, LEFT, *unsmob_stencil (ly_car (s)), inner_padding, 0);
     }
   mol.align_to (X_AXIS, LEFT);
   mol.translate_axis (outer_padding_factor *  inner_padding, X_AXIS);
@@ -317,13 +317,16 @@ Multi_measure_rest::set_spacing_rods (SCM smob)
   Item * lb = l->find_prebroken_piece (RIGHT);
   Item * rb = r->find_prebroken_piece (LEFT);      
   
-  Item* combinations[4][2]={{l,r}, {lb,r}, {l,rb},{lb,rb}};
+  Item* combinations[4][2] = {{l,r},
+                             {lb,r},
+                             {l,rb},
+                             {lb,rb}};
 
   Real sym_width = symbol_stencil (me, 0.0).extent (X_AXIS).length ();
   
   for (int i=0; i < 4; i++)
     {
-      Item * l =  combinations[i][0];
+      Item *l = combinations[i][0];
       Item *r = combinations[i][1];
 
       if (!l || !r)
@@ -337,8 +340,8 @@ Multi_measure_rest::set_spacing_rods (SCM smob)
       rod.distance_ = l->extent (l, X_AXIS)[BIGGER] - r->extent (r, X_AXIS)[SMALLER]
        + sym_width  + 2.0;                     // 2.0 = magic!
   
-      Real minlen  = robust_scm2double (me->get_grob_property ("minimum-length"), 0.0);
-      rod.distance_ = max(rod.distance_,
+      Real minlen  = robust_scm2double (me->get_property ("minimum-length"), 0.0);
+      rod.distance_ = max (rod.distance_,
                          minlen);
       rod.add_to_cols ();
     }