]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/spacing-spanner.cc
* lily/include/lily-guile.hh: many new ly_ functions. Thanks to
[lilypond.git] / lily / spacing-spanner.cc
index 21780b9a762cb00b2f4c9970cd954e3740127124..a41b721a78c7be31296fa11f3684a2a23725179d 100644 (file)
@@ -96,11 +96,11 @@ loose_column (Grob *l, Grob *c, Grob *r)
     such a borderline case.)
     
   */  
-  if (!gh_pair_p (lns) || !gh_pair_p (rns))
+  if (!ly_pair_p (lns) || !ly_pair_p (rns))
     return false;
 
-  Item * l_neighbor = dynamic_cast<Item*>  (unsmob_grob (gh_car (lns)));
-  Item * r_neighbor = dynamic_cast<Item*>  (unsmob_grob (gh_car (rns)));
+  Item * l_neighbor = dynamic_cast<Item*>  (unsmob_grob (ly_car (lns)));
+  Item * r_neighbor = dynamic_cast<Item*>  (unsmob_grob (ly_car (rns)));
 
   if (!l_neighbor || !r_neighbor)
     return false;
@@ -133,15 +133,15 @@ loose_column (Grob *l, Grob *c, Grob *r)
 
     in any case, we don't want to move bar lines.
    */
-  for (SCM e = c->get_property ("elements"); gh_pair_p (e); e = gh_cdr (e))
+  for (SCM e = c->get_property ("elements"); ly_pair_p (e); e = ly_cdr (e))
     {
-      Grob * g = unsmob_grob (gh_car (e));
+      Grob * g = unsmob_grob (ly_car (e));
       if (g && Break_align_interface::has_interface (g))
        {
-         for (SCM s = g->get_property ("elements"); gh_pair_p (s);
-              s = gh_cdr (s))
+         for (SCM s = g->get_property ("elements"); ly_pair_p (s);
+              s = ly_cdr (s))
            {
-             Grob *h = unsmob_grob (gh_car (s));
+             Grob *h = unsmob_grob (ly_car (s));
 
              /*
                ugh. -- fix staff-bar name? 
@@ -177,17 +177,17 @@ Spacing_spanner::prune_loose_columns (Grob*me,Link_array<Grob> *cols, Rational s
       if (loose_column (cols->elem (i-1), c, cols->elem (i+1)))
        {
          SCM lns = c->get_property ("left-neighbors");
-         lns = gh_pair_p (lns) ? gh_car (lns) : SCM_BOOL_F;
+         lns = ly_pair_p (lns) ? ly_car (lns) : SCM_BOOL_F;
 
          SCM rns = c->get_property ("right-neighbors");
-         rns = gh_pair_p (rns) ? gh_car (rns) : SCM_BOOL_F;
+         rns = ly_pair_p (rns) ? ly_car (rns) : SCM_BOOL_F;
 
          /*
            Either object can be non existent, if the score ends
            prematurely.
           */
-         rns = gh_car (unsmob_grob (rns)->get_property ("right-items"));
-         c->set_property ("between-cols", gh_cons (lns,
+         rns = ly_car (unsmob_grob (rns)->get_property ("right-items"));
+         c->set_property ("between-cols", scm_cons (lns,
                                                         rns));
 
          /*
@@ -206,9 +206,9 @@ Spacing_spanner::prune_loose_columns (Grob*me,Link_array<Grob> *cols, Rational s
              Item *rc = dynamic_cast<Item*> (d == LEFT  ? c : next_door[RIGHT]);
 
              for (SCM s = lc->get_property ("spacing-wishes");
-                  gh_pair_p (s); s = gh_cdr (s))
+                  ly_pair_p (s); s = ly_cdr (s))
                {
-                 Grob *sp = unsmob_grob (gh_car (s));
+                 Grob *sp = unsmob_grob (ly_car (s));
                  if (Note_spacing::left_column (sp) != lc
                      || Note_spacing::right_column (sp) != rc)
                    continue;
@@ -273,9 +273,9 @@ Spacing_spanner::set_explicit_neighbor_columns (Link_array<Grob> cols)
 
 
       SCM wishes=  cols[i]->get_property ("spacing-wishes");
-      for (SCM s =wishes; gh_pair_p (s); s = gh_cdr (s))
+      for (SCM s =wishes; ly_pair_p (s); s = ly_cdr (s))
        {
-         Item * wish = dynamic_cast<Item*> (unsmob_grob (gh_car (s)));
+         Item * wish = dynamic_cast<Item*> (unsmob_grob (ly_car (s)));
 
          Item * lc = wish->get_column ();
          Grob * right = Note_spacing::right_column (wish);
@@ -297,7 +297,7 @@ Spacing_spanner::set_explicit_neighbor_columns (Link_array<Grob> cols)
                right_neighbors  =SCM_EOL;
              
              min_rank = right_rank;
-             right_neighbors = gh_cons (wish->self_scm (), right_neighbors);
+             right_neighbors = scm_cons (wish->self_scm (), right_neighbors);
            }
 
          /*
@@ -305,10 +305,10 @@ Spacing_spanner::set_explicit_neighbor_columns (Link_array<Grob> cols)
           */
          int maxrank = 0;
          SCM left_neighs = rc->get_property ("left-neighbors");
-         if (gh_pair_p (left_neighs)
-             && unsmob_grob (gh_car (left_neighs)))
+         if (ly_pair_p (left_neighs)
+             && unsmob_grob (ly_car (left_neighs)))
            {
-             Item * it = dynamic_cast<Item*> (unsmob_grob (gh_car (left_neighs)));
+             Item * it = dynamic_cast<Item*> (unsmob_grob (ly_car (left_neighs)));
              maxrank = Paper_column::get_rank (it->get_column ());
            }
 
@@ -317,12 +317,12 @@ Spacing_spanner::set_explicit_neighbor_columns (Link_array<Grob> cols)
              if (left_rank > maxrank)
                left_neighs = SCM_EOL;
 
-             left_neighs = gh_cons (wish->self_scm (), left_neighs);
+             left_neighs = scm_cons (wish->self_scm (), left_neighs);
              rc->set_property ("left-neighbors", right_neighbors);
            }
        }
 
-      if (gh_pair_p (right_neighbors))
+      if (ly_pair_p (right_neighbors))
        {
          cols[i]->set_property ("right-neighbors", right_neighbors);
        }
@@ -348,15 +348,15 @@ Spacing_spanner::set_implicit_neighbor_columns (Link_array<Grob> cols)
        sloppy with typnig left/right-neighbors should take list, but paper-column found instead.
        */
       SCM ln = cols[i] ->get_property ("left-neighbors");
-      if (!gh_pair_p (ln) && i ) 
+      if (!ly_pair_p (ln) && i ) 
        {
-         cols[i]->set_property ("left-neighbors", gh_cons (cols[i-1]->self_scm (), SCM_EOL));
+         cols[i]->set_property ("left-neighbors", scm_cons (cols[i-1]->self_scm (), SCM_EOL));
        }
 
       SCM rn = cols[i] ->get_property ("right-neighbors");
-      if (!gh_pair_p (rn) && i < cols.size () - 1) 
+      if (!ly_pair_p (rn) && i < cols.size () - 1) 
        {
-         cols[i]->set_property ("right-neighbors", gh_cons (cols[i + 1]->self_scm (), SCM_EOL));
+         cols[i]->set_property ("right-neighbors", scm_cons (cols[i + 1]->self_scm (), SCM_EOL));
        }
     }
 }
@@ -569,9 +569,9 @@ Spacing_spanner::musical_column_spacing (Grob *me, Item * lc, Item *rc, Real inc
     happens after the current note (this is set in the grob
     property SPACING-SEQUENCE.
   */
-  for (SCM s = seq; gh_pair_p (s); s = ly_cdr (s))
+  for (SCM s = seq; ly_pair_p (s); s = ly_cdr (s))
     {
-      Grob * wish = unsmob_grob (gh_car (s));
+      Grob * wish = unsmob_grob (ly_car (s));
 
       Item *wish_rcol = Note_spacing::right_column (wish);
       if (Note_spacing::left_column (wish) != lc
@@ -733,9 +733,9 @@ Spacing_spanner::breakable_column_spacing (Grob*me, Item* l, Item *r,Moment shor
   if (dt == Moment (0,0))
     {
       for (SCM s = l->get_property ("spacing-wishes");
-          gh_pair_p (s); s = gh_cdr (s))
+          ly_pair_p (s); s = ly_cdr (s))
        {
-         Item * spacing_grob = dynamic_cast<Item*> (unsmob_grob (gh_car (s)));
+         Item * spacing_grob = dynamic_cast<Item*> (unsmob_grob (ly_car (s)));
 
          if (!spacing_grob || !Staff_spacing::has_interface (spacing_grob))
            continue;