]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/lookup.cc
* scm/output-ps.scm (lily-traced-cm-fonts): substitution for lily
[lilypond.git] / lily / lookup.cc
index 1783f95467c40024f04cc64c5b79405b6978da3d..0f7d9b8d767c47ac2d6c51b262afa085a0c417c6 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c)  1997--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c)  1997--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 
   Jan Nieuwenhuizen <janneke@gnu.org>
 
@@ -83,13 +83,13 @@ Lookup::dashed_slur (Bezier b, Real thick, Real dash)
 Molecule
 Lookup::line (Real th, Offset f, Offset t)
 {
-  SCM at = (scm_list_n (ly_symbol2scm ("draw-line"),
+  SCM at = scm_list_n (ly_symbol2scm ("draw-line"),
                        gh_double2scm (th), 
                        gh_double2scm (f[X_AXIS]),
                        gh_double2scm (f[Y_AXIS]),
                        gh_double2scm (t[X_AXIS]),
                        gh_double2scm (t[Y_AXIS]),
-                       SCM_UNDEFINED));
+                       SCM_UNDEFINED);
 
   Box box;
   box.add_point (f);
@@ -101,11 +101,28 @@ Lookup::line (Real th, Offset f, Offset t)
   return Molecule (box, at);
 }
 
+Molecule
+Lookup::horizontal_line (Interval w, Real th)
+{
+  SCM at = scm_list_n (ly_symbol2scm ("horizontal-line"),
+                      gh_double2scm (w[LEFT]), 
+                      gh_double2scm (w[RIGHT]),
+                      gh_double2scm (th),
+                      SCM_UNDEFINED);
+
+
+  Box box ;
+  box[X_AXIS] = w;
+  box[Y_AXIS] = Interval (-th/2,th/2);
+
+  return Molecule (box, at);
+}
+
 
 Molecule
 Lookup::blank (Box b) 
 {
-  return Molecule (b, SCM_EOL);
+  return Molecule (b, scm_makfrom0str (""));
 }
 
 Molecule
@@ -173,6 +190,26 @@ Lookup::roundfilledbox (Box b, Real blotdiameter)
   return Molecule (b,at);
 }
 
+LY_DEFINE(ly_round_filled_box, "ly:round-filled-box",
+         2, 0,0,
+         (SCM b, SCM blot),
+         "Make a box with rounded corners. B is a pair of number-pairs, and BLOT a number")
+{
+  SCM_ASSERT_TYPE(gh_number_p (blot), blot, SCM_ARG2, __FUNCTION__, "number") ;
+  SCM_ASSERT_TYPE(gh_pair_p (b), b, SCM_ARG4, __FUNCTION__, "pair") ;
+
+  SCM_ASSERT_TYPE(ly_number_pair_p (gh_car (b)), gh_car (b), SCM_ARG1, __FUNCTION__, "number-pair") ;
+  SCM_ASSERT_TYPE(ly_number_pair_p (gh_cdr (b)), gh_cdr (b), SCM_ARG1, __FUNCTION__, "number-pair") ;
+
+  Interval x (ly_scm2interval (gh_car (b)));
+  Interval y (ly_scm2interval (gh_cdr (b)));
+  
+  return Lookup::roundfilledbox (Box (x,y),
+                                gh_scm2double (blot)).smobbed_copy();
+  
+}
+         
+
 /*
  * Create Molecule that represents a filled polygon with round edges.
  *
@@ -297,7 +334,7 @@ Lookup::round_filled_polygon (Array<Offset> points, Real blotdiameter)
       box.add_point (points[i]);
     }
   SCM polygon_scm = scm_list_n (ly_symbol2scm ("polygon"),
-                               ly_quote_scm (ly_quote_scm (shrinked_points_scm)),
+                               ly_quote_scm (shrinked_points_scm),
                                gh_double2scm (blotdiameter),
                                SCM_UNDEFINED);