]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/align-interface.cc
Doc: Included/compile.itexi - CG 4.2 - Updated notes on reqs for compiling
[lilypond.git] / lily / align-interface.cc
index d187326922ed0b8dede64c4d479f25c9faf2b68e..d5f2140d6295712d2f2b98f9c01e4358dd599aae 100644 (file)
 #include "system.hh"
 #include "warn.hh"
 
+using std::vector;
+
 MAKE_SCHEME_CALLBACK (Align_interface, align_to_minimum_distances, 1);
 SCM
 Align_interface::align_to_minimum_distances (SCM smob)
 {
-  Grob *me = Grob::unsmob (smob);
+  Grob *me = unsmob<Grob> (smob);
 
   me->set_property ("positioning-done", SCM_BOOL_T);
 
@@ -52,7 +54,7 @@ MAKE_SCHEME_CALLBACK (Align_interface, align_to_ideal_distances, 1);
 SCM
 Align_interface::align_to_ideal_distances (SCM smob)
 {
-  Grob *me = Grob::unsmob (smob);
+  Grob *me = unsmob<Grob> (smob);
 
   me->set_property ("positioning-done", SCM_BOOL_T);
 
@@ -76,7 +78,7 @@ get_skylines (Grob *g,
 
   if (!pure)
     {
-      Skyline_pair *skys = Skyline_pair::unsmob (g->get_property (a == Y_AXIS
+      Skyline_pair *skys = unsmob<Skyline_pair> (g->get_property (a == Y_AXIS
                                                                   ? "vertical-skylines"
                                                                   : "horizontal-skylines"));
       if (skys)
@@ -93,7 +95,7 @@ get_skylines (Grob *g,
   else
     {
       assert (a == Y_AXIS);
-      Interval extent = g->pure_height (g, start, end);
+      Interval extent = g->pure_y_extent (g, start, end);
 
       // This is a hack to get better accuracy on the pure-height of VerticalAlignment.
       // It's quite common for a treble clef to be the highest element of one system
@@ -106,7 +108,7 @@ get_skylines (Grob *g,
       // of the system. This way, the tall treble clefs are only compared with the treble
       // clefs of the other staff and they will be ignored if the staff above is, for example,
       // lyrics.
-      if (Axis_group_interface::has_interface (g))
+      if (has_interface<Axis_group_interface> (g))
         {
           extent = Axis_group_interface::rest_of_line_pure_height (g, start, end);
           Interval begin_of_line_extent = Axis_group_interface::begin_of_line_pure_height (g, start);
@@ -179,7 +181,7 @@ Align_interface::internal_get_minimum_translations (Grob *me,
       SCM fv = ly_assoc_get (scm_cons (scm_from_int (start), scm_from_int (end)),
                              me->get_property ("minimum-translations-alist"),
                              SCM_EOL);
-      if (fv != SCM_EOL)
+      if (!scm_is_null (fv))
         return ly_scm2floatvector (fv);
     }
 
@@ -232,11 +234,11 @@ Align_interface::internal_get_minimum_translations (Grob *me,
 
           Real spec_distance = 0;
           if (Page_layout_problem::read_spacing_spec (spec, &spec_distance, ly_symbol2scm ("minimum-distance")))
-            dy = max (dy, spec_distance);
+            dy = std::max (dy, spec_distance);
           // Consider the likely final spacing when estimating distance between staves of the full score
           if (INT_MAX == end && 0 == start
               && Page_layout_problem::read_spacing_spec (spec, &spec_distance, ly_symbol2scm ("basic-distance")))
-            dy = max (dy, spec_distance);
+            dy = std::max (dy, spec_distance);
 
           if (include_fixed_spacing && Page_layout_problem::is_spaceable (elems[j]) && last_spaceable_element)
             {
@@ -248,21 +250,21 @@ Align_interface::internal_get_minimum_translations (Grob *me,
               Page_layout_problem::read_spacing_spec (spec,
                                                       &spaceable_padding,
                                                       ly_symbol2scm ("padding"));
-              dy = max (dy, (last_spaceable_skyline.distance (skyline[-stacking_dir])
+              dy = std::max (dy, (last_spaceable_skyline.distance (skyline[-stacking_dir])
                              + stacking_dir * (last_spaceable_element_pos - where) + spaceable_padding));
 
               Real spaceable_min_distance = 0;
               if (Page_layout_problem::read_spacing_spec (spec,
                                                           &spaceable_min_distance,
                                                           ly_symbol2scm ("minimum-distance")))
-                dy = max (dy, spaceable_min_distance + stacking_dir * (last_spaceable_element_pos - where));
+                dy = std::max (dy, spaceable_min_distance + stacking_dir * (last_spaceable_element_pos - where));
 
-              dy = max (dy, Page_layout_problem::get_fixed_spacing (last_spaceable_element, elems[j], spaceable_count,
+              dy = std::max (dy, Page_layout_problem::get_fixed_spacing (last_spaceable_element, elems[j], spaceable_count,
                                                                     pure, start, end));
             }
         }
 
-      dy = max (0.0, dy);
+      dy = std::max (0.0, dy);
       down_skyline.raise (-stacking_dir * dy);
       down_skyline.merge (skyline[stacking_dir]);
       where += stacking_dir * dy;
@@ -353,11 +355,11 @@ void
 Align_interface::set_ordered (Grob *me)
 {
   SCM ga_scm = me->get_object ("elements");
-  Grob_array *ga = Grob_array::unsmob (ga_scm);
+  Grob_array *ga = unsmob<Grob_array> (ga_scm);
   if (!ga)
     {
       ga_scm = Grob_array::make_array ();
-      ga = Grob_array::unsmob (ga_scm);
+      ga = unsmob<Grob_array> (ga_scm);
       me->set_object ("elements", ga_scm);
     }