]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/stem.cc
* lily/ledger-line-spanner.cc (print): swap linear_combination
[lilypond.git] / lily / stem.cc
index 4f364607ca28f9dbd0a76b3f73a87b32407dd6ea..c7242f4af40541bcc083008c8f46907eb5cb6be9 100644 (file)
@@ -40,7 +40,7 @@ Stem::set_beaming (Grob *me, int beam_count, Direction d)
 {
   SCM pair = me->get_property ("beaming");
 
-  if (!ly_c_pair_p (pair))
+  if (!scm_is_pair (pair))
     {
       pair = scm_cons (SCM_EOL, SCM_EOL);
       me->set_property ("beaming", pair);
@@ -56,7 +56,7 @@ int
 Stem::get_beaming (Grob *me, Direction d)
 {
   SCM pair = me->get_property ("beaming");
-  if (!ly_c_pair_p (pair))
+  if (!scm_is_pair (pair))
     return 0;
 
   SCM lst = index_get_cell (pair, d);
@@ -135,7 +135,7 @@ Stem::support_head (Grob *me)
 {
   if (head_count (me) == 1)
     /* UGH. */
-    return unsmob_grob (ly_car (me->get_property ("note-heads")));
+    return unsmob_grob (scm_car (me->get_property ("note-heads")));
   return first_head (me);
 }
 
@@ -182,10 +182,10 @@ Stem::extremal_heads (Grob *me)
   Drul_array<Grob *> exthead;
   exthead[LEFT] = exthead[RIGHT] =0;
 
-  for (SCM s = me->get_property ("note-heads"); ly_c_pair_p (s);
-       s = ly_cdr (s))
+  for (SCM s = me->get_property ("note-heads"); scm_is_pair (s);
+       s = scm_cdr (s))
     {
-      Grob *n = unsmob_grob (ly_car (s));
+      Grob *n = unsmob_grob (scm_car (s));
       int p = Staff_symbol_referencer::get_rounded_position (n);
 
       Direction d = LEFT;
@@ -212,10 +212,10 @@ Array<int>
 Stem::note_head_positions (Grob *me)
 {
   Array<int> ps ;
-  for (SCM s = me->get_property ("note-heads"); ly_c_pair_p (s);
-       s = ly_cdr (s))
+  for (SCM s = me->get_property ("note-heads"); scm_is_pair (s);
+       s = scm_cdr (s))
     {
-      Grob *n = unsmob_grob (ly_car (s));
+      Grob *n = unsmob_grob (scm_car (s));
       int p = Staff_symbol_referencer::get_rounded_position (n);
 
       ps.push (p);
@@ -276,7 +276,7 @@ Stem::get_default_stem_end_position (Grob *me)
   else
     {
       s = me->get_property ("lengths");
-      if (ly_c_pair_p (s))
+      if (scm_is_pair (s))
        length = 2 * scm_to_double (robust_list_ref (durlog - 2, s));
     }
 
@@ -295,7 +295,7 @@ Stem::get_default_stem_end_position (Grob *me)
   if (dir && dir * hp[dir] >= 0)
     {
       SCM sshorten = me->get_property ("stem-shorten");
-      SCM scm_shorten = ly_c_pair_p (sshorten) ?
+      SCM scm_shorten = scm_is_pair (sshorten) ?
        robust_list_ref ((duration_log (me) - 2) >? 0, sshorten): SCM_EOL;
       Real shorten = 2* robust_scm2double (scm_shorten,0);
 
@@ -401,10 +401,9 @@ Stem::position_noteheads (Grob *me)
   Real thick = thickness (me);
 
   Grob *hed = support_head (me);
-  Real w = Note_head::head_extent (hed, X_AXIS)[dir];
+  Real w = hed->extent (hed, X_AXIS)[dir];
   for (int i = 0; i < heads.size (); i++)
-    heads[i]->translate_axis (w - Note_head::head_extent (heads[i],
-                                                         X_AXIS)[dir],
+    heads[i]->translate_axis (w - heads[i]->extent (heads[i], X_AXIS)[dir],
                              X_AXIS);
 
   bool parity = true;
@@ -422,7 +421,7 @@ Stem::position_noteheads (Grob *me)
        {
          if (parity)
            {
-             Real ell = Note_head::head_extent (heads[i], X_AXIS).length ();
+             Real ell = heads[i]->extent (heads[i], X_AXIS).length ();
 
              Direction d = get_direction (me);
              /*
@@ -658,7 +657,7 @@ Stem::print (SCM smob)
       /*
        must not take ledgers into account.
        */
-      Interval head_height = Note_head::head_extent (hed,Y_AXIS);
+      Interval head_height = hed->extent (hed,Y_AXIS);
       Real y_attach = Note_head::stem_attachment_coordinate (hed, Y_AXIS);
 
       y_attach = head_height.linear_combination (y_attach);
@@ -669,7 +668,7 @@ Stem::print (SCM smob)
   // URG
   Real stem_width = thickness (me);
   Real blot =
-       me->get_paper ()->get_dimension (ly_symbol2scm ("blotdiameter"));
+       me->get_layout ()->get_dimension (ly_symbol2scm ("blotdiameter"));
 
   Box b = Box (Interval (-stem_width/2, stem_width/2),
               Interval (stem_y[DOWN]*dy, stem_y[UP]*dy));
@@ -701,7 +700,7 @@ Stem::off_callback (SCM element_smob, SCM)
   if (head_count (me))
     if (Grob *f = first_head (me))
       {
-       Interval head_wid = Note_head::head_extent (f, X_AXIS);
+       Interval head_wid = f->extent (f, X_AXIS);
        Real attach = 0.0;
        
        if (is_invisible (me))
@@ -735,7 +734,7 @@ Stem::get_stem_info (Grob *me)
 {
   /* Return cached info if available */
   SCM scm_info = me->get_property ("stem-info");
-  if (!ly_c_pair_p (scm_info))
+  if (!scm_is_pair (scm_info))
     {
       calc_stem_info (me);
       scm_info = me->get_property ("stem-info");
@@ -743,8 +742,8 @@ Stem::get_stem_info (Grob *me)
 
   Stem_info si;
   si.dir_ = get_grob_direction (me);
-  si.ideal_y_ = scm_to_double (ly_car (scm_info));
-  si.shortest_y_ = scm_to_double (ly_cadr (scm_info));
+  si.ideal_y_ = scm_to_double (scm_car (scm_info));
+  si.shortest_y_ = scm_to_double (scm_cadr (scm_info));
   return si;
 }
 
@@ -866,8 +865,8 @@ Slice
 Stem::beam_multiplicity (Grob *stem)
 {
   SCM beaming= stem->get_property ("beaming");
-  Slice le = int_list_to_slice (ly_car (beaming));
-  Slice ri = int_list_to_slice (ly_cdr (beaming));
+  Slice le = int_list_to_slice (scm_car (beaming));
+  Slice ri = int_list_to_slice (scm_cdr (beaming));
   le.unite (ri);
   return le;
 }