]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/line-spanner.cc
*** empty log message ***
[lilypond.git] / lily / line-spanner.cc
index f0d9c1dbd11f24af6eb970bc0fc2daa33c49b3d7..fe5dd3e1278d21ef0f7f89b57c5ee03b619f20b0 100644 (file)
@@ -3,16 +3,15 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 2000--2004 Jan Nieuwenhuizen <janneke@gnu.org>
+  (c) 2000--2005 Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
+#include "line-spanner.hh"
+
 #include <math.h>
 
-#include "stencil.hh"
-#include "item.hh"
 #include "spanner.hh"
-#include "line-spanner.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "paper-column.hh"
 #include "staff-symbol-referencer.hh"
 #include "font-interface.hh"
@@ -40,15 +39,15 @@ zigzag_stencil (Grob *me,
   double h = l>w/2 ? sqrt (l*l-w*w/4) : 0;
   
   SCM list = scm_list_n (ly_symbol2scm ("zigzag-line"),
-                     gh_bool2scm (true),
-                     gh_double2scm (w),
-                     gh_double2scm (h),
-                     gh_double2scm (thick),
-                     gh_double2scm (dx),
-                     gh_double2scm (dy),
+                     ly_bool2scm (true),
+                     scm_make_real (w),
+                     scm_make_real (h),
+                     scm_make_real (thick),
+                     scm_make_real (dx),
+                     scm_make_real (dy),
                      SCM_UNDEFINED);
   Box b;
-  b.add_point (Offset (0,0));
+  b.add_point (Offset (0, 0));
   b.add_point (dz);
   b[X_AXIS].widen (thick/2);
   b[Y_AXIS].widen (thick/2);
@@ -98,7 +97,7 @@ Line_spanner::line_stencil (Grob *me,
 {
   Offset dz = to -from ; 
   SCM type = me->get_property ("style");
-  if (gh_symbol_p (type)
+  if (scm_is_symbol (type)
       && (type == ly_symbol2scm ("line")
          || type == ly_symbol2scm ("dashed-line")
          || type == ly_symbol2scm ("dotted-line")
@@ -109,22 +108,22 @@ Line_spanner::line_stencil (Grob *me,
        ? zigzag_stencil (me, from, to)
        : Line_interface::line (me, from, to);
     }
-  else if (gh_symbol_p (type)
+  else if (scm_is_symbol (type)
           && type == ly_symbol2scm ("trill"))
     {
       SCM alist_chain = Font_interface::text_font_alist_chain (me);
-      SCM style_alist = scm_list_n (gh_cons (ly_symbol2scm ("font-encoding"),
-                                            ly_symbol2scm ("music")),
+      SCM style_alist = scm_list_n (scm_cons (ly_symbol2scm ("font-encoding"),
+                                            ly_symbol2scm ("fetaMusic")),
                                    SCM_UNDEFINED);
       
-      Font_metric *fm = select_font (me->get_paper (),
-                                    gh_cons (style_alist,
+      Font_metric *fm = select_font (me->get_layout (),
+                                    scm_cons (style_alist,
                                              alist_chain));
-      Stencil m = fm->find_by_name ("scripts-trill-element");
+      Stencil m = fm->find_by_name ("scripts.trill_element");
       Stencil mol;
 
       do
-       mol.add_at_edge (X_AXIS, RIGHT, m, 0,0);
+       mol.add_at_edge (X_AXIS, RIGHT, m, 0, 0);
       while (m.extent (X_AXIS).length ()
             && mol.extent (X_AXIS).length ()
             + m.extent (X_AXIS).length () < dz[X_AXIS]);
@@ -169,9 +168,12 @@ line_spanner_common_parent (Grob *me)
   routine, via stencil_extent. At this point, the staves aren't
   separated yet, so it doesn't work cross-staff.
 
+  (huh? crossable staves have fixed distance? --hwn)
+  
 */
 
 
+
 MAKE_SCHEME_CALLBACK (Line_spanner, print, 1);
 SCM
 Line_spanner::print (SCM smob) 
@@ -203,7 +205,7 @@ Line_spanner::print (SCM smob)
       /*
        This is hairy. For the normal case, we simply find common
        parents, and draw a line between the bounds. When two note
-       heads are on different lines, there is no common parent
+       heads are on different systems, there is no common parent
        anymore. We have to find the piano-staff object.
       */
       
@@ -272,7 +274,7 @@ Line_spanner::print (SCM smob)
            + bound[RIGHT]->extent (common[X_AXIS], ax).center ()
            - bound[LEFT]->extent (common[X_AXIS], ax).center ();
 
-         my_off[ax] =me->relative_coordinate (common[a], ax);
+         my_off[ax] = me->relative_coordinate (common[a], ax);
          his_off[ax] = bound[LEFT]->relative_coordinate (common[a], ax);
          
        }
@@ -280,7 +282,7 @@ Line_spanner::print (SCM smob)
       ofxy = dxy * (off/dxy.length ());
       dxy -= 2*ofxy;
   
-      Stencil line = line_stencil (me, Offset (0,0),dxy);
+      Stencil line = line_stencil (me, Offset (0, 0), dxy);
 
       line.translate_axis (bound[LEFT]->extent (bound[LEFT], X_AXIS).length ()/2, X_AXIS); 
       line.translate (ofxy - my_off + his_off);