From: fred Date: Wed, 27 Mar 2002 00:57:45 +0000 (+0000) Subject: lilypond-1.3.138 X-Git-Tag: release/1.5.59~863 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=25d8447b64cb37f33071863327903f4971359ee4;p=lilypond.git lilypond-1.3.138 --- diff --git a/input/les-nereides.ly b/input/les-nereides.ly index 1ec8d19574..dc4e04f823 100644 --- a/input/les-nereides.ly +++ b/input/les-nereides.ly @@ -25,8 +25,8 @@ cpp -P -traditional -o l-fake.ly -DFAKE_GRACE les-nereides.ly #(define (make-text-checker text) (lambda (elt) ;; huh, string-match undefined? - ;; (string-match text (ly-get-elt-property elt 'text)) - (equal? text (ly-get-elt-property elt 'text)) + ;; (string-match text (ly-get-grob-property elt 'text)) + (equal? text (ly-get-grob-property elt 'text)) )) diff --git a/input/tricks/move-specific-text.ly b/input/tricks/move-specific-text.ly index 572a34c58b..2fe4a71523 100644 --- a/input/tricks/move-specific-text.ly +++ b/input/tricks/move-specific-text.ly @@ -1,6 +1,6 @@ #(define (make-text-checker text) - (lambda (grob) (equal? text (ly-get-elt-property grob 'text)))) + (lambda (grob) (equal? text (ly-get-grob-property grob 'text)))) \score { \notes\relative c''' { diff --git a/lily/grob.cc b/lily/grob.cc index f151def2e2..98f0601722 100644 --- a/lily/grob.cc +++ b/lily/grob.cc @@ -868,8 +868,8 @@ init_functions () { interfaces_sym = scm_permanent_object (ly_symbol2scm ("interfaces")); - scm_make_gsubr ("ly-get-elt-property", 2, 0, 0, (Scheme_function_unknown)ly_get_grob_property); - scm_make_gsubr ("ly-set-elt-property", 3, 0, 0, (Scheme_function_unknown)ly_set_grob_property); + scm_make_gsubr ("ly-get-grob-property", 2, 0, 0, (Scheme_function_unknown)ly_get_grob_property); + scm_make_gsubr ("ly-set-grob-property", 3, 0, 0, (Scheme_function_unknown)ly_set_grob_property); scm_make_gsubr ("ly-get-spanner-bound", 2 , 0, 0, (Scheme_function_unknown) spanner_get_bound); } diff --git a/lily/include/translator-def.hh b/lily/include/translator-def.hh index d9c6d9643e..77082e268d 100644 --- a/lily/include/translator-def.hh +++ b/lily/include/translator-def.hh @@ -31,6 +31,7 @@ private: SCM property_ops_; public: SCM type_name_; + SCM type_aliases_; SCM translator_group_type_; SCM modify_definition (SCM, SCM, bool); diff --git a/lily/translator-def.cc b/lily/translator-def.cc index 917a31d7f0..6150a66d11 100644 --- a/lily/translator-def.cc +++ b/lily/translator-def.cc @@ -31,6 +31,8 @@ SCM Translator_def::mark_smob (SCM smob) { Translator_def* me = (Translator_def*) SCM_CELL_WORD_1 (smob); + + scm_gc_mark (me->type_aliases_); scm_gc_mark (me->consists_name_list_); scm_gc_mark (me->accepts_name_list_); scm_gc_mark (me->end_consists_name_list_); @@ -53,6 +55,7 @@ ADD_SCM_INIT_FUNC (transdef, foo_init); Translator_def::Translator_def () { + type_aliases_ = SCM_EOL; translator_group_type_ = SCM_EOL; accepts_name_list_ = SCM_EOL; consists_name_list_ = SCM_EOL; @@ -71,7 +74,7 @@ Translator_def::Translator_def (Translator_def const & s) end_consists_name_list_ = scm_list_copy (s.end_consists_name_list_); accepts_name_list_ = scm_list_copy (s.accepts_name_list_); property_ops_ = scm_list_copy (s.property_ops_); - + type_aliases_ = s.type_aliases_; translator_group_type_ = s.translator_group_type_; type_name_ = s.type_name_; } @@ -177,12 +180,21 @@ Translator_def::path_to_acceptable_translator (SCM type_str, Music_output_def* o Link_array best_result; for (int i=0; i < accepted_arr.size (); i++) - if (scm_equal_p (accepted_arr[i]->type_name_, type_str) == SCM_BOOL_T) - { - best_result.push (accepted_arr[i]); - return best_result; - } + { + bool found =false; + if (scm_equal_p (accepted_arr[i]->type_name_, type_str) == SCM_BOOL_T) + found = true; + + for (SCM s = accepted_arr[i]->type_aliases_; !found && gh_pair_p (s); s = gh_cdr (s)) + found = found || (gh_equal_p (gh_car (s), type_str)); + if (found) + { + best_result.push (accepted_arr[i]); + return best_result; + } + } + int best_depth= INT_MAX; for (int i=0; i < accepted_arr.size (); i++) { diff --git a/scm/beam.scm b/scm/beam.scm index 3fa8fc33ce..f7afad28fc 100644 --- a/scm/beam.scm +++ b/scm/beam.scm @@ -39,7 +39,7 @@ ;; which should be 1 (== 1 interline) (define (mean a b) (* 0.5 (+ a b))) (define (default-beam-dy-quants beam stafflinethick) - (let ((thick (ly-get-elt-property beam 'thickness)) + (let ((thick (ly-get-grob-property beam 'thickness)) ) (list 0 (mean thick stafflinethick) (+ thick stafflinethick) 1) @@ -52,7 +52,7 @@ (define (default-beam-y-quants beam multiplicity dy staff-line) (let* ((beam-straddle 0) - (thick (ly-get-elt-property beam 'thickness)) + (thick (ly-get-grob-property beam 'thickness)) (beam-sit (/ (+ thick staff-line) 2)) (beam-hang (- 1 (/ (- thick staff-line) 2))) (quants (list beam-hang)) @@ -67,7 +67,7 @@ (define (beam-traditional-y-quants beam multiplicity dy staff-line) (let* ((beam-straddle 0) - (thick (ly-get-elt-property beam 'thickness)) + (thick (ly-get-grob-property beam 'thickness)) (beam-sit (/ (+ thick staff-line) 2)) (beam-hang (- 1 (/ (- thick staff-line) 2))) (quants '()) diff --git a/scm/c++.scm b/scm/c++.scm index b995d72b30..045002d357 100644 --- a/scm/c++.scm +++ b/scm/c++.scm @@ -101,8 +101,8 @@ (define (make-type-checker symbol) (lambda (elt) ;;(display symbol) - ;;(eq? #t (ly-get-elt-property elt symbol)) - (not (eq? #f (memq symbol (ly-get-elt-property elt 'interfaces)))))) + ;;(eq? #t (ly-get-grob-property elt symbol)) + (not (eq? #f (memq symbol (ly-get-grob-property elt 'interfaces)))))) (define (index-cell cell dir) diff --git a/scm/slur.scm b/scm/slur.scm index c15dd9bf33..abfa9e2a89 100644 --- a/scm/slur.scm +++ b/scm/slur.scm @@ -7,13 +7,13 @@ ;;; (define (attached-to-stem slur dir) - (let* ((note-columns (ly-get-elt-property slur 'note-columns)) + (let* ((note-columns (ly-get-grob-property slur 'note-columns)) (col (if (= dir 1) (car note-columns) (car (reverse note-columns)))) - (stem (ly-get-elt-property col 'stem))) + (stem (ly-get-grob-property col 'stem))) (and (eq? col (ly-get-spanner-bound slur dir)) stem - (ly-get-elt-property stem 'heads)))) + (ly-get-grob-property stem 'heads)))) ;; Slur-extremity-rules is a list of rules. Each rule is a pair @@ -37,7 +37,7 @@ ;; urg: don't crash on a slur without note-columns (cons (lambda (slur dir) - (< (length (ly-get-elt-property slur 'note-columns)) 1)) 'head) + (< (length (ly-get-grob-property slur 'note-columns)) 1)) 'head) ;; (cons (lambda (slur dir) (begin (display "before loose-end") (newline))#f) #f) (cons (lambda (slur dir) (not (attached-to-stem slur dir))) 'loose-end) @@ -46,12 +46,12 @@ (cons (lambda (slur dir) ;; urg, code dup - (let* ((note-columns (ly-get-elt-property slur 'note-columns)) + (let* ((note-columns (ly-get-grob-property slur 'note-columns)) (col (if (= dir 1) (car note-columns) (car (reverse note-columns)))) - (stem (ly-get-elt-property col 'stem))) + (stem (ly-get-grob-property col 'stem))) (and stem - (not (= (ly-get-elt-property slur 'direction) - (ly-get-elt-property stem 'direction)))))) 'head) + (not (= (ly-get-grob-property slur 'direction) + (ly-get-grob-property stem 'direction)))))) 'head) ;; (cons (lambda (slur dir) (begin (display "before stem") (newline))#f) #f) @@ -60,13 +60,13 @@ (and (attached-to-stem slur dir) ;; and got beam ;; urg, code dup - (let* ((note-columns (ly-get-elt-property slur 'note-columns)) + (let* ((note-columns (ly-get-grob-property slur 'note-columns)) (col (if (= dir 1) (car note-columns) (car (reverse note-columns)))) - (stem (ly-get-elt-property col 'stem))) + (stem (ly-get-grob-property col 'stem))) (and stem - (ly-get-elt-property stem 'beam) + (ly-get-grob-property stem 'beam) ;; and beam on same side as slur - (let ((beaming (ly-get-elt-property stem 'beaming))) + (let ((beaming (ly-get-grob-property stem 'beaming))) ;; (display "beaming (") (display dir) (display "): ") (write beaming) (newline) (if (pair? beaming) (>= (if (= dir -1) (cdr beaming) (car beaming)) diff --git a/scripts/convert-ly.py b/scripts/convert-ly.py index c37c2b6ab1..d5d8162396 100644 --- a/scripts/convert-ly.py +++ b/scripts/convert-ly.py @@ -677,6 +677,14 @@ if 1: conversions.append (((1,3,122), conv, 'drarnChords -> chordChanges, \\musicalpitch -> \\pitch')) +if 1: + def conv (str): + str = re.sub ('ly-([sg])et-elt-property', 'ly-\\1et-grob-property', str) + return str + + conversions.append (((1,3,136), conv, 'ly-X-elt-property -> ly-X-grob-property')) + + ############################