]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/script-column.cc
*** empty log message ***
[lilypond.git] / lily / script-column.cc
index b84c18de3edc5659d71e14bf05d9a577400986f1..79e058c4acc7b2ef5fac9c8376cd370d272abb20 100644 (file)
@@ -3,10 +3,12 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 1999--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   
  */
+
 #include "script-column.hh"
+
 #include "side-position-interface.hh"
 #include "warn.hh"
 #include "group-interface.hh"
@@ -15,7 +17,7 @@ void
 Script_column::add_staff_sided (Grob *me, Item *i)
 {
   SCM p = i->get_property ("script-priority");
-  if (!is_number (p))
+  if (!scm_is_number (p))
     return;
 
   Pointer_group_interface::add_grob (me, ly_symbol2scm ("scripts"),i);
@@ -23,7 +25,7 @@ Script_column::add_staff_sided (Grob *me, Item *i)
   me->add_dependency (i);
 }
 
-LY_DEFINE (grob_script_priority_less, "ly:grob-script-priority-less",
+LY_DEFINE (ly_grob_script_priority_less, "ly:grob-script-priority-less",
          2, 0, 0, (SCM a, SCM b),
          "Compare two grobs by script priority. For internal use.")
 {
@@ -33,7 +35,7 @@ LY_DEFINE (grob_script_priority_less, "ly:grob-script-priority-less",
   SCM p1 = i1->get_property ("script-priority");
   SCM p2 = i2->get_property ("script-priority");
 
-  return ly_scm2int (p1) < ly_scm2int (p2) ? SCM_BOOL_T : SCM_BOOL_F;
+  return scm_to_int (p1) < scm_to_int (p2) ? SCM_BOOL_T : SCM_BOOL_F;
 }
 
 MAKE_SCHEME_CALLBACK (Script_column, before_line_breaking, 1);
@@ -44,10 +46,13 @@ Script_column::before_line_breaking (SCM smob)
   Drul_array<SCM> scripts (SCM_EOL, SCM_EOL);
   Link_array<Grob> staff_sided;
   
-  for (SCM s = me->get_property ("scripts"); is_pair (s); s = ly_cdr (s))
+  for (SCM s = me->get_property ("scripts"); scm_is_pair (s); s = scm_cdr (s))
     {
-      Grob *sc = unsmob_grob (ly_car (s));
+      Grob *sc = unsmob_grob (scm_car (s));
 
+      /*
+       Don't want to consider scripts horizontally next to notes.
+       */
       if (!sc->has_offset_callback (Side_position_interface::aligned_side_proc,
                                    X_AXIS))
        staff_sided.push (sc);
@@ -71,12 +76,12 @@ Script_column::before_line_breaking (SCM smob)
   do
     {
       SCM ss = scm_reverse_x (scripts[d], SCM_EOL);
-      ss = scm_stable_sort_x (ss, grob_script_priority_less_proc);
+      ss = scm_stable_sort_x (ss, ly_grob_script_priority_less_proc);
       
       Grob * last = 0;
-      for (SCM s = ss; is_pair (s); s = ly_cdr (s))
+      for (SCM s = ss; scm_is_pair (s); s = scm_cdr (s))
        {
-         Grob *g = unsmob_grob (ly_car (s));
+         Grob *g = unsmob_grob (scm_car (s));
          if (last)
            Side_position_interface::add_support (g,last);