diff options
author | David Kastrup <dak@gnu.org> | 2012-04-28 13:00:46 +0200 |
---|---|---|
committer | David Kastrup <dak@gnu.org> | 2012-05-02 04:31:13 +0200 |
commit | ae2db5b21bf232f5145f3a3e091689c8fc7247e9 (patch) | |
tree | b3139939dcc1a188b4ea424b7a664b0aa6d79877 /input | |
parent | c8e0c11cd618db0ad8af087da74a704b284add35 (diff) |
Make EventClass hierarchy a property of Global context
Diffstat (limited to 'input')
-rw-r--r-- | input/regression/scheme-text-spanner.ly | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/input/regression/scheme-text-spanner.ly b/input/regression/scheme-text-spanner.ly index c0204d55c7..00cf863bd6 100644 --- a/input/regression/scheme-text-spanner.ly +++ b/input/regression/scheme-text-spanner.ly @@ -6,11 +6,27 @@ and grob creation methods to create a fully functional text spanner in scheme." } -#(define-event-class 'scheme-text-span-event - '(scheme-text-span-event - span-event - music-event - StreamEvent)) +#(define my-grob-descriptions '()) + +#(define my-event-classes (ly:make-context-mod)) + +defineEventClass = +#(define-void-function (parser location class parent) + (symbol? symbol?) + (ly:add-context-mod + my-event-classes + `(apply + ,(lambda (context class parent) + (ly:context-set-property! + context + 'EventClasses + (event-class-cons + class + parent + (ly:context-property context 'EventClasses '())))) + ,class ,parent))) + +\defineEventClass #'scheme-text-span-event #'span-event #(define (add-grob-definition grob-name grob-entry) (let* ((meta-entry (assoc-get 'meta grob-entry)) @@ -33,9 +49,9 @@ in scheme." (set! meta-entry (assoc-set! meta-entry 'interfaces ifaces-entry)) (set! grob-entry (assoc-set! grob-entry 'meta meta-entry)) - (set! all-grob-descriptions + (set! my-grob-descriptions (cons (cons grob-name grob-entry) - all-grob-descriptions)))) + my-grob-descriptions)))) #(add-grob-definition 'SchemeTextSpanner @@ -181,7 +197,8 @@ schemeTextSpannerEnd = \layout { \context { \Global - \grobdescriptions #all-grob-descriptions + \grobdescriptions #my-grob-descriptions + #my-event-classes } \context { \Voice |