X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Falign-interface.cc;h=31707ec3270874f273fb60ff1bc5bf9f154bd7d3;hb=f817c9010f8016d5e9c19ec3b167e7d485538eb3;hp=e11671ca51e9a6e2aa4c7c23643fa1be2960ee28;hpb=faaee71fb44c8e1040239797aad336f4e46c2c21;p=lilypond.git diff --git a/lily/align-interface.cc b/lily/align-interface.cc index e11671ca51..31707ec327 100644 --- a/lily/align-interface.cc +++ b/lily/align-interface.cc @@ -8,8 +8,7 @@ */ #include "align-interface.hh" -#include "grob.hh" -#include "group-interface.hh" + #include "axis-group-interface.hh" #include "hara-kiri-group-spanner.hh" #include "output-def.hh" @@ -52,7 +51,7 @@ Align_interface::align_to_fixed_distance (Grob *me , Axis a) SCM d = me->get_property ("stacking-dir"); - Direction stacking_dir = ly_c_number_p (d) ? to_dir (d) : CENTER; + Direction stacking_dir = scm_is_number (d) ? to_dir (d) : CENTER; if (!stacking_dir) stacking_dir = DOWN; @@ -61,13 +60,13 @@ Align_interface::align_to_fixed_distance (Grob *me , Axis a) Link_array elems = Pointer_group_interface__extract_grobs (me, (Grob*) 0, "elements"); - Real where_f=0; + Real where_f = 0; Interval v; v.set_empty (); Array translates; - for (int j= elems.size (); j--; ) + for (int j = elems.size (); j--; ) { /* This is not very elegant, in that we need special support for @@ -86,7 +85,7 @@ Align_interface::align_to_fixed_distance (Grob *me , Axis a) elems.del (j); } - for (int j =0; j < elems.size (); j++) + for (int j = 0; j < elems.size (); j++) { where_f += stacking_dir * dy; translates.push (where_f); @@ -124,7 +123,7 @@ Align_interface::align_elements_to_extents (Grob * me, Axis a) SCM d = me->get_property ("stacking-dir"); - Direction stacking_dir = ly_c_number_p (d) ? to_dir (d) : CENTER; + Direction stacking_dir = scm_is_number (d) ? to_dir (d) : CENTER; if (!stacking_dir) stacking_dir = DOWN; @@ -136,12 +135,12 @@ Align_interface::align_elements_to_extents (Grob * me, Axis a) Link_array elems; Link_array all_grobs = Pointer_group_interface__extract_grobs (me, (Grob*) 0, "elements"); - for (int i=0; i < all_grobs.size (); i++) + for (int i = 0; i < all_grobs.size (); i++) { Interval y = all_grobs[i]->extent (me, a); if (!y.is_empty ()) { - Grob *e =dynamic_cast (all_grobs[i]); + Grob *e = dynamic_cast (all_grobs[i]); elems.push (e); dims.push (y); @@ -167,9 +166,9 @@ Align_interface::align_elements_to_extents (Grob * me, Axis a) Array translates ; Interval total; - Real where_f=0; + Real where_f = 0; - for (int j=0 ; j < elems.size (); j++) + for (int j = 0 ; j < elems.size (); j++) { Real dy = - dims[j][-stacking_dir]; if (j) @@ -199,8 +198,8 @@ Align_interface::align_elements_to_extents (Grob * me, Axis a) Array all_translates; if (translates.size ()) { - int i =0; - int j =0; + int i = 0; + int j = 0; Real w = translates[0]; while (j < all_grobs.size ()) { @@ -217,7 +216,7 @@ Align_interface::align_elements_to_extents (Grob * me, Axis a) FIXME: uncommenting freaks out the Y-alignment of line-of-score. */ - if (ly_c_number_p (align)) + if (scm_is_number (align)) center_offset = total.linear_combination (scm_to_double (align)); for (int j = 0 ; j < all_grobs.size (); j++) @@ -227,7 +226,7 @@ Align_interface::align_elements_to_extents (Grob * me, Axis a) Axis Align_interface::axis (Grob*me) { - return Axis (scm_to_int (ly_car (me->get_property ("axes")))); + return Axis (scm_to_int (scm_car (me->get_property ("axes")))); } void @@ -254,7 +253,7 @@ find_fixed_alignment_parent (Grob *g) { while (g) { - if (ly_c_number_p (g->get_property ("forced-distance"))) + if (scm_is_number (g->get_property ("forced-distance"))) return g; g = g->get_parent (Y_AXIS);