]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/cluster.cc
* lily/pfb.cc (LY_DEFINE): ly:ttf->pfa, new function.
[lilypond.git] / lily / cluster.cc
index 687eaabae3309014ebfd2a98a8b5719ba3d3223b..aec236de96c61cebb8cfa6361e6b0df34a34a6f1 100644 (file)
@@ -3,23 +3,22 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 2002--2004 Juergen Reuter <reuter@ipd.uka.de>
+  (c) 2002--2005 Juergen Reuter <reuter@ipd.uka.de>
 
   Han-Wen Nienhuys <hanwen@cs.uu.nl>
 
 */
 
-#include <stdio.h>
-
 #include "cluster.hh"
+
+#include <cstdio>
+
 #include "spanner.hh"
 #include "item.hh"
 #include "pitch.hh"
 #include "staff-symbol-referencer.hh"
 #include "lookup.hh"
-#include "box.hh"
-#include "interval.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "warn.hh"
 
 
@@ -32,7 +31,7 @@ brew_cluster_piece (Grob *me, Array<Offset> bottom_points, Array<Offset> top_poi
 {
   Real blotdiameter = Staff_symbol_referencer::staff_space (me)/2;
 
-  Real padding =robust_scm2double ( me->get_property ("padding"), 0.0);
+  Real padding = robust_scm2double ( me->get_property ("padding"), 0.0);
 
   Offset vpadding = Offset (0, padding);
   Offset hpadding = Offset (0.5 * blotdiameter, 0);
@@ -41,7 +40,7 @@ brew_cluster_piece (Grob *me, Array<Offset> bottom_points, Array<Offset> top_poi
   SCM shape_scm = me->get_property ("style");
   String shape;
 
-  if (ly_c_symbol_p (shape_scm))
+  if (scm_is_symbol (shape_scm))
     {
       shape = ly_symbol2string (shape_scm);
     }
@@ -125,7 +124,7 @@ brew_cluster_piece (Grob *me, Array<Offset> bottom_points, Array<Offset> top_poi
   return out;
 }
 
-MAKE_SCHEME_CALLBACK (Cluster,print,1);
+MAKE_SCHEME_CALLBACK (Cluster, print, 1);
 SCM
 Cluster::print (SCM smob)
 {
@@ -142,9 +141,9 @@ Cluster::print (SCM smob)
   Item *right_bound = spanner->get_bound (RIGHT);
 
   Grob *commonx = left_bound->common_refpoint (right_bound, X_AXIS);
-  SCM cols  =me->get_property ("columns");
+  SCM cols  = me->get_property ("columns");
 
-  if (!ly_c_pair_p (cols))
+  if (!scm_is_pair (cols))
     {
       me->warning ("junking empty cluster");
       me->suicide ();
@@ -165,9 +164,9 @@ Cluster::print (SCM smob)
     line with the center of the note heads?
     
    */
-  for (SCM s = cols; ly_c_pair_p (s); s = ly_cdr (s))
+  for (SCM s = cols; scm_is_pair (s); s = scm_cdr (s))
     {
-      Grob * col = unsmob_grob (ly_car (s));
+      Grob * col = unsmob_grob (scm_car (s));
       Interval yext = col->extent (commony, Y_AXIS);
 
       Real x = col->relative_coordinate (commonx, X_AXIS) - left_coord;
@@ -186,16 +185,16 @@ Cluster::print (SCM smob)
        {
          Spanner * next = orig->broken_intos_[spanner->get_break_index () + 1];
          SCM cols = next->get_property ("columns");
-         if (ly_c_pair_p (cols))
+         if (scm_is_pair (cols))
            {
              Grob *next_commony = common_refpoint_of_list (cols, next, Y_AXIS);
-             Grob * col = unsmob_grob (ly_car (scm_last_pair (cols)));
+             Grob * col = unsmob_grob (scm_car (scm_last_pair (cols)));
 
              Interval v = col->extent (next_commony, Y_AXIS);
              Real x = right_bound->relative_coordinate (commonx, X_AXIS) - left_coord;
              
-             bottom_points.insert (Offset (x, v[DOWN]),0);
-             top_points.insert (Offset (x, v[UP]),0);
+             bottom_points.insert (Offset (x, v[DOWN]), 0);
+             top_points.insert (Offset (x, v[UP]), 0);
            }
        }
     }
@@ -208,7 +207,7 @@ Cluster::print (SCM smob)
   return out.smobbed_copy ();
 }
 
-ADD_INTERFACE (Cluster,"cluster-interface",
+ADD_INTERFACE (Cluster, "cluster-interface",
               "A graphically drawn musical cluster. " 
               "\n\n"
               "@code{padding} adds to the vertical extent of the shape (top and "
@@ -228,13 +227,13 @@ public:
   static bool has_interface (Grob *);
 };
 
-MAKE_SCHEME_CALLBACK (Cluster_beacon,height,2);
+MAKE_SCHEME_CALLBACK (Cluster_beacon, height, 2);
 SCM
 Cluster_beacon::height (SCM g, SCM)
 {
   Grob *me = unsmob_grob (g);
   Interval v = robust_scm2interval (me->get_property ("positions"),
-                                   Interval (0,0));
+                                   Interval (0, 0));
   return ly_interval2scm (Staff_symbol_referencer::staff_space (me) * 0.5 * v);
 }