#(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))
))
#(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''' {
{
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);
}
SCM property_ops_;
public:
SCM type_name_;
+ SCM type_aliases_;
SCM translator_group_type_;
SCM modify_definition (SCM, SCM, bool);
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_);
Translator_def::Translator_def ()
{
+ type_aliases_ = SCM_EOL;
translator_group_type_ = SCM_EOL;
accepts_name_list_ = SCM_EOL;
consists_name_list_ = SCM_EOL;
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_;
}
Link_array<Translator_def> 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++)
{
;; 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)
(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))
(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 '())
(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)
;;;
(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
;; 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)
(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)
(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))
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'))
+
+
############################