From: Jan Nieuwenhuizen Date: Sun, 29 Aug 2010 18:51:49 +0000 (+0200) Subject: Metronome mark: check for interface rather than grob name in non-break-aligned. X-Git-Tag: release/2.13.32-1~19 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=19b37df119ff6ca84421d984fe1d33112ad08299;p=lilypond.git Metronome mark: check for interface rather than grob name in non-break-aligned. This remove the usage of grob_name so so we can easily swap in and out implementations of formatting behavior. --- diff --git a/lily/metronome-engraver.cc b/lily/metronome-engraver.cc index 7eaf3145ad..aed027544c 100644 --- a/lily/metronome-engraver.cc +++ b/lily/metronome-engraver.cc @@ -99,24 +99,17 @@ Metronome_mark_engraver::acknowledge_break_aligned (Grob_info info) } } -SCM -grob_name_scm (Grob *g) -{ - SCM name_pair = scm_assq (ly_symbol2scm ("name"), g->get_property ("meta")); - return (scm_is_pair (name_pair) - ? ly_camel_case_2_lisp_identifier (scm_cdr (name_pair)) - : SCM_EOL); -} - void Metronome_mark_engraver::acknowledge_grob (Grob_info info) { Grob *g = info.grob (); - if (text_ - && safe_is_member (grob_name_scm (g), - text_->get_property ("non-break-align-symbols"))) - text_->set_parent (g, X_AXIS); + if (text_) + for (SCM s = text_->get_property ("non-break-align-symbols"); + scm_is_pair (s); + s = scm_cdr (s)) + if (g->internal_has_interface (scm_car (s))) + text_->set_parent (g, X_AXIS); } void diff --git a/scm/define-grob-properties.scm b/scm/define-grob-properties.scm index d4ee62b815..4202b26b96 100644 --- a/scm/define-grob-properties.scm +++ b/scm/define-grob-properties.scm @@ -608,7 +608,7 @@ staff is crucial for @var{padding}). @code{VerticalAlignment}; rather, place it using its own @code{Y-offset} callback.") (non-break-align-symbols ,list? "A list of symbols that determine -which NON-break-aligned grobs to align this to.") +which NON-break-aligned interfaces to align this to.") (no-ledgers ,boolean? "If set, don't draw ledger lines on this object.") (no-stem-extend ,boolean? "If set, notes with ledger lines do not diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm index 38bd6eb630..71a167d80a 100644 --- a/scm/define-grobs.scm +++ b/scm/define-grobs.scm @@ -1171,7 +1171,7 @@ (list ly:self-alignment-interface::x-aligned-on-self))))) (self-alignment-X . ,LEFT) (break-align-symbols . (key-signature time-signature)) - (non-break-align-symbols . (multi-measure-rest)) + (non-break-align-symbols . (multi-measure-rest-interface)) (non-musical . #t) (meta . ((class . Item) (interfaces . (break-alignable-interface