X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fstaff-symbol-referencer.cc;h=2d05d1f11a7f975c641c64bce0c525ca6e928284;hb=7cb049f7f3705e414c2a49c7cf14f43a51914c48;hp=13cf324351f2e5018b50c8c8af524e6340677dc5;hpb=fc3e875d6bf06f0680e897faffdcab36ad975a03;p=lilypond.git diff --git a/lily/staff-symbol-referencer.cc b/lily/staff-symbol-referencer.cc index 13cf324351..2d05d1f11a 100644 --- a/lily/staff-symbol-referencer.cc +++ b/lily/staff-symbol-referencer.cc @@ -3,7 +3,7 @@ source file of the GNU LilyPond music typesetter - (c) 1999--2001 Han-Wen Nienhuys + (c) 1999--2002 Han-Wen Nienhuys */ #include @@ -53,11 +53,9 @@ Staff_symbol_referencer::staff_space (Grob*me) if (st) return Staff_symbol::staff_space (st); - return 1.0; } - Real Staff_symbol_referencer::position_f (Grob*me) { @@ -99,10 +97,9 @@ Staff_symbol_referencer::callback (SCM element_smob, SCM) { Real space = Staff_symbol_referencer::staff_space (me); off = gh_scm2double (pos) * space/2.0; + me->set_grob_property ("staff-position", gh_double2scm (0.0)); } - me->set_grob_property ("staff-position", gh_double2scm (0.0)); - return gh_double2scm (off); } @@ -161,12 +158,12 @@ compare_position (Grob *const &a, Grob * const &b) } -void -Staff_symbol_referencer::set_interface (Grob * e) -{ - if (!gh_number_p (e->get_grob_property ("staff-position"))) - e->set_grob_property ("staff-position", gh_double2scm (0.0)); - e->add_offset_callback (Staff_symbol_referencer::callback_proc, Y_AXIS); -} +#define has_interface ugly_hack +ADD_INTERFACE (Staff_symbol_referencer,"staff-symbol-referencer-interface", + "Object whose Y position is meaning with reference to a staff +symbol. Objects that have this interface should include +Staff_symbol_referencer::callback in their Y-offset-callback. +", + "staff-position");