From: Han-Wen Nienhuys Date: Wed, 2 Nov 2005 13:28:30 +0000 (+0000) Subject: (assertBeamQuant): use make-simple-closure. X-Git-Tag: release/2.7.15~5 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=9ce70a9e297d35e2165e8cc7ed0b65bc51a86df6;p=lilypond.git (assertBeamQuant): use make-simple-closure. --- diff --git a/ChangeLog b/ChangeLog index 25a8e1d623..dca5cf32e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2005-11-02 Han-Wen Nienhuys + + * ly/spanners-init.ly (assertBeamQuant): use make-simple-closure. + 2005-11-02 Jan Nieuwenhuizen * lily/main.cc (setup_paths)[__MINGW32__]: Do not assume argv0 is @@ -9,7 +13,9 @@ 2005-11-02 Han-Wen Nienhuys - * scm/define-grobs.scm: purge self-[XY]-offset varialbes, replace + * Documentation/topdocs/NEWS.tely (Top): document new backend design. + + * scm/define-grobs.scm: purge self-[XY]-offset variables, replace with simple-closure. * lily/self-aligment-interface.cc (set_align_self): new function diff --git a/Documentation/topdocs/NEWS.tely b/Documentation/topdocs/NEWS.tely index 705a4f551c..5b5257d0bf 100644 --- a/Documentation/topdocs/NEWS.tely +++ b/Documentation/topdocs/NEWS.tely @@ -46,6 +46,41 @@ This document is also available in @uref{NEWS.pdf,PDF}. @itemize @bullet +@item +Each grob property may also be a ``grob closure.'' This means that it +is possible to combine functions. For example, the @code{Y-offset} of +a @code{InstrumentName} grob is defined to be + +@verbatim +,(ly:make-simple-closure + `(,+ + ,(ly:make-simple-closure (list Self_alignment_interface::y_aligned_on_self)) + ,(ly:make-simple-closure (list Side_position_interface::y_aligned_on_support_refpoints))) +@end verbatim + +@noindent +During execution, the @code{Y-offset} of an @code{InstrumentName} is computed +as + +@example +(+ (Self_alignment_interface::y_aligned_on_self @var{grob}) + (Self_alignment_interface::y_aligned_on_support_refpoints @var{grob})) +@end example + + +@item +Calculation of extent and offset of grob is now controlled via the +@code{X-extent}, @code{Y-extent}, @code{X-offset} and @code{Y-offset} +properties, for example + +@verbatim +\override TextScript #'Y-offset = #-6 +@end verbatim + +@noindent +hard codes @code{TextScript} grobs to be 6 spaces below their Y-parent +grobs. + @item Each grob property can be a procedure. If this is the case, it is assumed to be a routine that calculates said property. This is a diff --git a/ly/spanners-init.ly b/ly/spanners-init.ly index 56d0272bd5..59765d075e 100644 --- a/ly/spanners-init.ly +++ b/ly/spanners-init.ly @@ -97,12 +97,20 @@ sostenutoUp = #(make-span-event 'SostenutoEvent STOP) assertBeamQuant = #(def-music-function (parser location l r) (pair? pair?) (make-grob-property-override 'Beam 'positions - (apply ly:make-callback-chain (check-quant-callbacks l r)))) + (ly:make-simple-closure + (ly:make-simple-closure + (append + (list chain-grob-member-functions `(,cons 0 0)) + (check-quant-callbacks l r)))))) % for regression testing purposes. assertBeamSlope = #(def-music-function (parser location comp) (procedure?) (make-grob-property-override 'Beam 'positions - (apply ly:make-callback-chain (check-slope-callbacks comp)))) - + (ly:make-simple-closure + (ly:make-simple-closure + (append + (list chain-grob-member-functions `(,cons 0 0)) + (check-slope-callbacks comp)))))) +