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

index 357b76bcb22c84a6903a323790d16d9417b29c77..844fbaa414235668827743a0405a179a969084fa 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 d7351d648aebf3ce7583876bb1bf8a6bac9ea2b3..a976cae9142ea62ffa24a2631e9fa2403f2614c0 100644 (file)
@@ -185,13 +185,25 @@ Rest::generic_extent_callback (Grob *me, Axis a)
   SCM m = brew_internal_stencil (me, a != X_AXIS);
   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, "rest-interface",
               "A rest symbol.",
 
               /* properties */
                  
-              "style "
               "direction "
-              "minimum-distance");
+              "minimum-distance "
+              "style "
+              );
 
index 70750b7746c37fa9185654e9aca147b03fffdba4..f39343b90449ab74bff7fd19703645a2564e1b00 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))