]> git.donarmstrong.com Git - lilypond.git/commitdiff
add Rest::pure_height.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 3 Jan 2007 15:31:30 +0000 (16:31 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 3 Jan 2007 15:31:30 +0000 (16:31 +0100)
lily/include/rest.hh
lily/rest.cc
scm/define-grobs.scm

index 20107120b7c411bef2f4fa8bbbb4441cf04140db..5399c203fd88efff4161efe82e3d935d4f2bb520 100644 (file)
@@ -25,5 +25,6 @@ public:
   DECLARE_SCHEME_CALLBACK (print, (SCM));
   DECLARE_SCHEME_CALLBACK (width, (SCM));
   DECLARE_SCHEME_CALLBACK (height, (SCM));
+  DECLARE_SCHEME_CALLBACK (pure_height, (SCM, SCM, SCM));
 };
 #endif // REST_HH
index e3543e4cb9545f2bef8eee0b2ce1b8b48fcf5afa..64a3eb87cdb01bf4bbacbd739d7106523f983e69 100644 (file)
@@ -187,12 +187,25 @@ Rest::generic_extent_callback (Grob *me, Axis a)
   return ly_interval2scm (unsmob_stencil (m)->extent (a));
 }
 
+MAKE_SCHEME_CALLBACK (Rest, pure_height, 3);
+SCM
+Rest::pure_height (SCM smob, SCM start, SCM end)
+{
+  (void) start;
+  (void) end;
+  
+  Grob *me = unsmob_grob (smob);
+  SCM m = brew_internal_stencil (me, false);
+  return ly_interval2scm (unsmob_stencil (m)->extent (Y_AXIS));
+}
+
 ADD_INTERFACE (Rest,
               "A rest symbol.",
 
               /* properties */
                  
-              "style "
               "direction "
-              "minimum-distance");
+              "minimum-distance "
+              "style "
+              );
 
index d6265e851bc5580ecb76ba25777cbecf8d93334e..5e17ff84b98490fb8826790d0ddf88dcbdfa314f 100644 (file)
        (self-alignment-X . 0)
        (self-alignment-Y . 0)
        (script-priority . 100)
-
-       (after-line-breaking . ,(lambda (grob)
-                                 (display (list
-                                           (ly:grob-extent grob (ly:grob-parent grob X) X)
-                                           " " 
-                                           (ly:grob-relative-coordinate grob (ly:grob-parent grob X) X) "\n")))) 
-                                           
        (stencil . ,ly:text-interface::print)
        (direction . ,ly:script-interface::calc-direction)
        (text . ,fingering::calc-text) 
   (list
    `(,ly:slur::outside-slur-callback . ,ly:slur::pure-outside-slur-callback)
    `(,ly:stem::height . ,ly:stem::pure-height)
+   `(,ly:rest::height . ,ly:rest::pure-height)
    `(,ly:grob::stencil-height . ,pure-stencil-height)
    `(,ly:side-position-interface::y-aligned-side . ,ly:side-position-interface::pure-y-aligned-side)
    `(,ly:axis-group-interface::height . ,ly:axis-group-interface::pure-height)
 
 (define pure-functions
   (list
-   ly:rest::height
    ly:staff-symbol-referencer::callback
    ly:staff-symbol::height))