From: Han-Wen Nienhuys Date: Wed, 10 Apr 2002 17:25:36 +0000 (+0000) Subject: make implementation for Class::has_interface automatically. Junk all X-Git-Tag: release/1.5.52~8 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=bfb10684605084baf1a898be8f42c0e463c5764a;p=lilypond.git make implementation for Class::has_interface automatically. Junk all other implementations. --- diff --git a/lily/a2-engraver.cc b/lily/a2-engraver.cc index a7f1acb4a3..51d1183ec1 100644 --- a/lily/a2-engraver.cc +++ b/lily/a2-engraver.cc @@ -15,6 +15,7 @@ #include "side-position-interface.hh" #include "directional-element-interface.hh" #include "multi-measure-rest.hh" +#include "tie.hh" class A2_engraver : public Engraver { @@ -140,9 +141,7 @@ A2_engraver::acknowledge_grob (Grob_info i) if (!to_boolean (get_property ("noDirection")) && (Stem::has_interface (i.grob_l_) || Slur::has_interface (i.grob_l_) - // || Tie::has_interface (i.grob_l_) - || i.grob_l_->has_interface (ly_symbol2scm ("tie-interface")) - + || Tie::has_interface (i.grob_l_) /* Usually, dynamics are removed by *_devnull_engravers for the second voice. On the one hand, we don't want all dynamics for @@ -150,9 +149,9 @@ A2_engraver::acknowledge_grob (Grob_info i) hand, colliding of scripts may be worse. So, we don't set directions for these when we're playing solo. */ - || (i.grob_l_->has_interface (ly_symbol2scm ("dynamic-interface")) + || (i.grob_l_->internal_has_interface (ly_symbol2scm ("dynamic-interface")) && state_ != SOLO) - || (i.grob_l_->has_interface (ly_symbol2scm ("text-interface")) + || (i.grob_l_->internal_has_interface (ly_symbol2scm ("text-interface")) && state_ != SOLO) )) { diff --git a/lily/align-interface.cc b/lily/align-interface.cc index 0344730184..ef9d932842 100644 --- a/lily/align-interface.cc +++ b/lily/align-interface.cc @@ -276,11 +276,6 @@ Align_interface::set_axis (Grob*me,Axis a) Axis_group_interface::set_axes (me, a,a); } -bool -Align_interface::has_interface (Grob*me) -{ - return me && me->has_interface (ly_symbol2scm ("align-interface")); -} ADD_INTERFACE (Align_interface, "align-interface", @@ -288,7 +283,10 @@ ADD_INTERFACE (Align_interface, "align-interface", "forced-distance stacking-dir align-dir threshold alignment-done center-element elements axes"); - +struct Foobar +{ + bool has_interface (Grob*); +}; ADD_INTERFACE (Foobar, "aligned-interface", "read by align-interface", "minimum-space-pair extra-space"); diff --git a/lily/arpeggio.cc b/lily/arpeggio.cc index dfd112887b..73fad5482e 100644 --- a/lily/arpeggio.cc +++ b/lily/arpeggio.cc @@ -17,11 +17,6 @@ #include "font-interface.hh" #include "lookup.hh" -bool -Arpeggio::has_interface (Grob* me) -{ - return me && me->has_interface (ly_symbol2scm ("arpeggio-interface")); -} MAKE_SCHEME_CALLBACK (Arpeggio, brew_molecule, 1); SCM diff --git a/lily/axis-group-engraver.cc b/lily/axis-group-engraver.cc index 8c054c3d67..bd2dcf88ad 100644 --- a/lily/axis-group-engraver.cc +++ b/lily/axis-group-engraver.cc @@ -155,7 +155,7 @@ Hara_kiri_engraver::acknowledge_grob (Grob_info i) { Axis_group_engraver::acknowledge_grob (i); if (Rhythmic_head::has_interface (i.grob_l_) - || i.grob_l_->has_interface (ly_symbol2scm ("lyric-syllable-interface"))) + || i.grob_l_->internal_has_interface (ly_symbol2scm ("lyric-syllable-interface"))) { Hara_kiri_group_spanner::add_interesting_item (staffline_p_, i.grob_l_); } diff --git a/lily/axis-group-interface.cc b/lily/axis-group-interface.cc index 895b5597c9..10ffa7172a 100644 --- a/lily/axis-group-interface.cc +++ b/lily/axis-group-interface.cc @@ -124,11 +124,6 @@ Axis_group_interface::get_children (Grob*me) return childs; } -bool -Axis_group_interface::has_interface (Grob*me) -{ - return me && me->has_interface (ly_symbol2scm ("axis-group-interface")); -} ADD_INTERFACE (Axis_group_interface, "axis-group-interface", diff --git a/lily/bar-line.cc b/lily/bar-line.cc index c6fb214fce..ebae578015 100644 --- a/lily/bar-line.cc +++ b/lily/bar-line.cc @@ -164,11 +164,6 @@ Bar_line::before_line_breaking (SCM smob) } -bool -Bar_line::has_interface (Grob*m) -{ - return m && m->has_interface (ly_symbol2scm ("bar-line-interface")); -} MAKE_SCHEME_CALLBACK (Bar_line,get_staff_bar_size,1); diff --git a/lily/beam.cc b/lily/beam.cc index ea36554c28..706b503eca 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -349,6 +349,7 @@ Beam::after_line_breaking (SCM smob) if (ly_car (s) != SCM_BOOL_F) return SCM_UNSPECIFIED; + // one wonders if such genericity is necessary --hwn. SCM callbacks = me->get_grob_property ("position-callbacks"); for (SCM i = callbacks; gh_pair_p (i); i = ly_cdr (i)) gh_call1 (ly_car (i), smob); @@ -1357,11 +1358,6 @@ Beam::rest_collision_callback (SCM element_smob, SCM axis) } -bool -Beam::has_interface (Grob *me) -{ - return me->has_interface (ly_symbol2scm ("beam-interface")); -} ADD_INTERFACE (Beam, "beam-interface", @@ -1382,5 +1378,5 @@ the ideal slope, how close the result is to the ideal stems, etc.). We take the best scoring combination. ", - "beam-space concaveness-gap concaveness-threshold dir-function quant-score auto-knee-gap gap chord-tremolo beamed-stem-shorten shorten least-squares-dy direction damping flag-width-function neutral-direction positions thickness"); + "position-callbacks beam-space concaveness-gap concaveness-threshold dir-function quant-score auto-knee-gap gap chord-tremolo beamed-stem-shorten shorten least-squares-dy direction damping flag-width-function neutral-direction positions thickness"); diff --git a/lily/break-algorithm.cc b/lily/break-algorithm.cc index e14cdcdb4a..ce4c075d8c 100644 --- a/lily/break-algorithm.cc +++ b/lily/break-algorithm.cc @@ -10,7 +10,7 @@ #include "break-algorithm.hh" #include "paper-def.hh" #include "debug.hh" -#include "line-of-score.hh" +#include "system.hh" #include "paper-score.hh" #include "paper-column.hh" #include "cpu-timer.hh" diff --git a/lily/break-align-interface.cc b/lily/break-align-interface.cc index fd2ae3e9f5..76fd54a6f3 100644 --- a/lily/break-align-interface.cc +++ b/lily/break-align-interface.cc @@ -58,7 +58,7 @@ Break_align_interface::self_align_callback (SCM element_smob, SCM axis) /* Force break alignment itself to be done first, in the case */ - return Side_position_interface::aligned_on_self (element_smob, axis); + return Self_alignment_interface::aligned_on_self (element_smob, axis); } void @@ -215,7 +215,6 @@ Break_align_interface::do_alignment (Grob *me) } - ADD_INTERFACE (Break_aligned_interface, "break-aligned-interface", "Items that are aligned in prefatory matter. diff --git a/lily/chord-name.cc b/lily/chord-name.cc index e00f05ace9..1180eea826 100644 --- a/lily/chord-name.cc +++ b/lily/chord-name.cc @@ -12,7 +12,7 @@ #include "font-interface.hh" #include "grob.hh" #include "paper-column.hh" -#include "line-of-score.hh" +#include "system.hh" #include "staff-symbol-referencer.hh" #include "text-item.hh" diff --git a/lily/clef-engraver.cc b/lily/clef-engraver.cc index b3ec806aec..a7ad3b39af 100644 --- a/lily/clef-engraver.cc +++ b/lily/clef-engraver.cc @@ -11,7 +11,7 @@ #include #include "translator-group.hh" -#include "key-item.hh" + #include "bar-line.hh" #include "staff-symbol-referencer.hh" #include "debug.hh" diff --git a/lily/clef.cc b/lily/clef.cc index 589ca0856e..943f5e24d4 100644 --- a/lily/clef.cc +++ b/lily/clef.cc @@ -46,11 +46,6 @@ Clef::before_line_breaking (SCM smob) return SCM_UNSPECIFIED; } -bool -Clef::has_interface (Grob* me) -{ - return me->has_interface (ly_symbol2scm ("clef-interface")); -} diff --git a/lily/custos.cc b/lily/custos.cc index 608f0c0379..d4025b188e 100644 --- a/lily/custos.cc +++ b/lily/custos.cc @@ -111,11 +111,6 @@ Custos::brew_molecule (SCM smob) return SCM_EOL; } -bool -Custos::has_interface (Grob*m) -{ - return m && m->has_interface (ly_symbol2scm ("custos-interface")); -} ADD_INTERFACE (Custos, "custos-interface", "A custos is a staff context symbol that appears at the end of a diff --git a/lily/dot-column.cc b/lily/dot-column.cc index f2d5e10e97..2aa564dfa9 100644 --- a/lily/dot-column.cc +++ b/lily/dot-column.cc @@ -124,11 +124,6 @@ Dot_column::do_shifts (SCM l) return SCM_UNSPECIFIED; } -bool -Dot_column::has_interface (Grob*m) -{ - return m && m->has_interface (ly_symbol2scm ("dot-column-interface")); -} void diff --git a/lily/extender-engraver.cc b/lily/extender-engraver.cc index 3d78b8b772..a6bcd2593e 100644 --- a/lily/extender-engraver.cc +++ b/lily/extender-engraver.cc @@ -61,7 +61,7 @@ void Extender_engraver::acknowledge_grob (Grob_info i) { // -> text_item - if (i.grob_l_->has_interface (ly_symbol2scm ("lyric-syllable-interface"))) + if (i.grob_l_->internal_has_interface (ly_symbol2scm ("lyric-syllable-interface"))) { current_lyric_l_ = i.grob_l_; if (extender_p_ diff --git a/lily/fingering-engraver.cc b/lily/fingering-engraver.cc index 8a7bab80b3..90dba98709 100644 --- a/lily/fingering-engraver.cc +++ b/lily/fingering-engraver.cc @@ -183,8 +183,8 @@ Fingering_engraver::make_script (Direction d, Music *r,Axis a, int i) Side_position_interface::set_axis (fingering, a); - fingering->add_offset_callback (Side_position_interface::aligned_on_self_proc, other); - fingering->add_offset_callback (Side_position_interface::centered_on_parent_proc, other); + fingering->add_offset_callback (Self_alignment_interface::aligned_on_self_proc, other); + fingering->add_offset_callback (Self_alignment_interface::centered_on_parent_proc, other); fingering->set_grob_property ("script-priority", gh_int2scm (100 + d* i)); diff --git a/lily/gourlay-breaking.cc b/lily/gourlay-breaking.cc index 492e2c1a4f..798dbaddc5 100644 --- a/lily/gourlay-breaking.cc +++ b/lily/gourlay-breaking.cc @@ -14,7 +14,7 @@ #include "paper-score.hh" #include "paper-def.hh" #include "simple-spacer.hh" -#include "line-of-score.hh" +#include "system.hh" /// How often to print operator pacification marks? const int HAPPY_DOTS_I = 3; diff --git a/lily/grob.cc b/lily/grob.cc index 3202e931c3..598c347ec1 100644 --- a/lily/grob.cc +++ b/lily/grob.cc @@ -21,7 +21,7 @@ #include "grob.hh" #include "debug.hh" #include "spanner.hh" -#include "line-of-score.hh" +#include "system.hh" #include "item.hh" #include "paper-column.hh" #include "molecule.hh" @@ -931,7 +931,7 @@ init_functions () } bool -Grob::has_interface (SCM k) +Grob::internal_has_interface (SCM k) { SCM ifs = get_grob_property ("interfaces"); @@ -946,6 +946,7 @@ ADD_INTERFACE (Grob, "grob-interface", "All grobs support this", "X-offset-callbacks Y-offset-callbacks X-extent-callback molecule cause Y-extent-callback molecule-callback extra-offset +spacing-procedure staff-symbol interfaces dependencies extra-extent-X causes meta layer before-line-breaking-callback after-line-breaking-callback extra-extent-Y minimum-extent-X minimum-extent-Y transparent"); diff --git a/lily/hara-kiri-group-spanner.cc b/lily/hara-kiri-group-spanner.cc index 3ddad25c62..dba478e0a3 100644 --- a/lily/hara-kiri-group-spanner.cc +++ b/lily/hara-kiri-group-spanner.cc @@ -84,11 +84,6 @@ Hara_kiri_group_spanner::add_element (Grob * me, Grob *e) -bool -Hara_kiri_group_spanner::has_interface (Grob*me) -{ - return me->has_interface (ly_symbol2scm ("hara-kiri-group-interface")); -} void Hara_kiri_group_spanner::add_interesting_item (Grob* me,Grob* n) diff --git a/lily/hyphen-engraver.cc b/lily/hyphen-engraver.cc index 1697c82849..b8eabfe33d 100644 --- a/lily/hyphen-engraver.cc +++ b/lily/hyphen-engraver.cc @@ -54,7 +54,7 @@ void Hyphen_engraver::acknowledge_grob (Grob_info i) { // -> text-item - if (i.grob_l_->has_interface (ly_symbol2scm ("lyric-syllable-interface"))) + if (i.grob_l_->internal_has_interface (ly_symbol2scm ("lyric-syllable-interface"))) { current_lyric_l_ = i.grob_l_; if (hyphen_p_ diff --git a/lily/include/break-align-interface.hh b/lily/include/break-align-interface.hh index 6543289a5a..cd0cf144c7 100644 --- a/lily/include/break-align-interface.hh +++ b/lily/include/break-align-interface.hh @@ -24,4 +24,10 @@ public: DECLARE_SCHEME_CALLBACK (self_align_callback, (SCM element, SCM axis)); }; +struct Break_aligned_interface +{ + static bool has_interface (Grob*); +}; + + #endif // BREAK_ALIGN_INTERFACE_HH diff --git a/lily/include/chord-name.hh b/lily/include/chord-name.hh index 3cf2ac1237..69b6a1ef7c 100644 --- a/lily/include/chord-name.hh +++ b/lily/include/chord-name.hh @@ -18,6 +18,7 @@ class Chord_name public: DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM )); DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM )); + static bool has_interface (Grob*); }; #endif // CHORD_NAME_HH diff --git a/lily/include/collision.hh b/lily/include/collision.hh index 068f818e18..5704ca9789 100644 --- a/lily/include/collision.hh +++ b/lily/include/collision.hh @@ -33,5 +33,6 @@ public: DECLARE_SCHEME_CALLBACK (force_shift_callback, (SCM element, SCM axis)); static void do_shifts (Grob*); static void add_column (Grob*me,Grob*ncol_l); + static bool has_interface(Grob*); }; #endif // COLLISION_HH diff --git a/lily/include/dots.hh b/lily/include/dots.hh index 105c61edf4..37f667dff0 100644 --- a/lily/include/dots.hh +++ b/lily/include/dots.hh @@ -20,6 +20,7 @@ class Dots public: DECLARE_SCHEME_CALLBACK (quantised_position_callback, (SCM element, SCM axis)); DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM )); + bool has_interface (Grob*); }; #endif // DOTS_HH diff --git a/lily/include/font-interface.hh b/lily/include/font-interface.hh index d377b4d1ff..176e4c3210 100644 --- a/lily/include/font-interface.hh +++ b/lily/include/font-interface.hh @@ -21,6 +21,7 @@ struct Font_interface static SCM add_style (Grob*, SCM style, SCM alist_chain); static bool wild_compare (SCM field_val, SCM val); DECLARE_SCHEME_CALLBACK (properties_to_font_name, (SCM,SCM)); + static bool has_interface (Grob*); }; #endif /* FONT_INTERFACE_HH */ diff --git a/lily/include/grob-interface.hh b/lily/include/grob-interface.hh index 028c4763f6..11a5acf68d 100644 --- a/lily/include/grob-interface.hh +++ b/lily/include/grob-interface.hh @@ -18,6 +18,10 @@ void add_interface (const char * symbol, SCM ly_add_interface (SCM, SCM, SCM); #define ADD_INTERFACE(cl,a,b,c) \ +bool cl::has_interface(Grob*me)\ +{\ + return me->internal_has_interface (ly_symbol2scm (a));\ +}\ void cl ## _init_ifaces() {\ add_interface(a,b,c);\ }\ diff --git a/lily/include/grob.hh b/lily/include/grob.hh index f94e388712..e15b0ce0ac 100644 --- a/lily/include/grob.hh +++ b/lily/include/grob.hh @@ -125,7 +125,8 @@ public: static SCM ly_set_grob_property (SCM, SCM,SCM); static SCM ly_get_grob_property (SCM, SCM); - bool has_interface (SCM intf); + bool internal_has_interface (SCM intf); + static bool has_interface (Grob*me); virtual void handle_broken_dependencies (); virtual void handle_prebroken_dependencies (); diff --git a/lily/include/hyphen-spanner.hh b/lily/include/hyphen-spanner.hh index ad4870a9d5..f4ed165ccf 100644 --- a/lily/include/hyphen-spanner.hh +++ b/lily/include/hyphen-spanner.hh @@ -15,6 +15,7 @@ public: Spanner* elt_l_; Hyphen_spanner (Spanner*); void set_textitem (Direction, Grob*); + bool has_interface (Grob*); DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM )); }; diff --git a/lily/include/item.hh b/lily/include/item.hh index 77fd2be900..408e73ddeb 100644 --- a/lily/include/item.hh +++ b/lily/include/item.hh @@ -41,6 +41,7 @@ public: virtual System * line_l () const; virtual Paper_column * column_l () const; virtual void handle_prebroken_dependencies (); + static bool has_interface (Grob*); protected: virtual void discretionary_processing (); void copy_breakable_items (); diff --git a/lily/include/key-item.hh b/lily/include/key-item.hh index dd48588463..65296f8106 100644 --- a/lily/include/key-item.hh +++ b/lily/include/key-item.hh @@ -1,22 +1,2 @@ -/* - key-item.hh -- part of GNU LilyPond - (c) 1996--2002 Han-Wen Nienhuys -*/ - -#ifndef KEYITEM_HH -#define KEYITEM_HH - -#include "lily-guile.hh" -#include "lily-proto.hh" - - -struct Key_item -{ - - static void set_interface (Grob*); - static bool has_interface (Grob*); - DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM )); -}; - -#endif // KEYITEM_HH +#error diff --git a/lily/include/line-of-score.hh b/lily/include/line-of-score.hh index 4ff07730ef..65296f8106 100644 --- a/lily/include/line-of-score.hh +++ b/lily/include/line-of-score.hh @@ -1,41 +1,2 @@ -/* - line-of-score.hh -- part of GNU LilyPond - - (c) 1996--2002 Han-Wen Nienhuys -*/ - -#ifndef SCORELINE_HH -#define SCORELINE_HH - -#include "protected-scm.hh" -#include "column-x-positions.hh" -#include "spanner.hh" - -class System : public Spanner -{ -public: - int rank_i_; - void post_processing (bool); - - System (SCM); - /// is #c# contained in #*this#? - bool contains_b (Paper_column const *c) const; - int element_count () const; - - void break_into_pieces (Array const&); - void output_lines (); - - Link_array broken_col_range (Item const*, Item const*) const; - Link_array column_l_arr () const; - - void add_column (Paper_column*); - void typeset_grob (Grob*); - void output_molecule (SCM, Offset); - void output_scheme (SCM); - void pre_processing (); -protected: - VIRTUAL_COPY_CONS (Grob); -}; - -#endif +#error diff --git a/lily/include/line-spanner.hh b/lily/include/line-spanner.hh index 42523311e1..e36481fca5 100644 --- a/lily/include/line-spanner.hh +++ b/lily/include/line-spanner.hh @@ -18,6 +18,7 @@ public: DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM)); static Molecule line_molecule (Grob* me, Real thick, Real dx, Real dy); + static bool has_interface (Grob*); private: static Offset get_broken_offset (Grob *me, Direction dir); diff --git a/lily/include/lyric-extender.hh b/lily/include/lyric-extender.hh index bbab8028a5..5dfd31ee58 100644 --- a/lily/include/lyric-extender.hh +++ b/lily/include/lyric-extender.hh @@ -28,6 +28,7 @@ class Lyric_extender { public: + static bool has_interface (Grob*); static void set_textitem (Spanner*, Direction, Grob*); DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM )); }; diff --git a/lily/include/paper-column.hh b/lily/include/paper-column.hh index ed850c4e24..fbf69636ec 100644 --- a/lily/include/paper-column.hh +++ b/lily/include/paper-column.hh @@ -19,6 +19,7 @@ class Paper_column : public Item public: VIRTUAL_COPY_CONS (Grob); + static bool has_interface (Grob*); int rank_i_; virtual void do_break_processing (); virtual Paper_column *column_l () const; diff --git a/lily/include/percent-repeat-item.hh b/lily/include/percent-repeat-item.hh index 057144c5d7..1a7a499d65 100644 --- a/lily/include/percent-repeat-item.hh +++ b/lily/include/percent-repeat-item.hh @@ -15,6 +15,7 @@ class Percent_repeat_item_interface { public: + static bool has_interface (Grob*); DECLARE_SCHEME_CALLBACK (beat_slash, (SCM )); DECLARE_SCHEME_CALLBACK (double_percent, (SCM )); static Molecule x_percent (Grob*,int,Real,Real ); diff --git a/lily/include/porrectus.hh b/lily/include/porrectus.hh index c2abfbfaaf..453471f66a 100644 --- a/lily/include/porrectus.hh +++ b/lily/include/porrectus.hh @@ -22,6 +22,7 @@ public: static void set_right_head (Grob *, Item *); static Item *get_right_head (Grob *); DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM)); + static bool has_interface (Grob*); private: static Molecule brew_vaticana_molecule (Item *, Real, diff --git a/lily/include/script-column.hh b/lily/include/script-column.hh index 8d759beba8..ff0ed55bc6 100644 --- a/lily/include/script-column.hh +++ b/lily/include/script-column.hh @@ -18,6 +18,8 @@ class Script_column public: static void add_staff_sided (Grob*, Item*); DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM )); + static bool has_interface (Grob*); + }; diff --git a/lily/include/side-position-interface.hh b/lily/include/side-position-interface.hh index cd5f2a1be1..3cfd3730d1 100644 --- a/lily/include/side-position-interface.hh +++ b/lily/include/side-position-interface.hh @@ -23,10 +23,10 @@ struct Side_position_interface public: DECLARE_SCHEME_CALLBACK (aligned_on_support_extents, (SCM element, SCM axis)); DECLARE_SCHEME_CALLBACK (aligned_on_support_refpoints, (SCM element, SCM axis)); - DECLARE_SCHEME_CALLBACK (aligned_on_self, (SCM element, SCM axis)); + DECLARE_SCHEME_CALLBACK (aligned_side, (SCM element, SCM axis)); + DECLARE_SCHEME_CALLBACK (quantised_position, (SCM element, SCM axis)); - DECLARE_SCHEME_CALLBACK (centered_on_parent, (SCM element, SCM axis)); static SCM general_side_position (Grob*, Axis, bool); static void set_axis (Grob*,Axis); @@ -42,5 +42,13 @@ public: }; +struct Self_alignment_interface +{ + static bool has_interface (Grob*); + DECLARE_SCHEME_CALLBACK (aligned_on_self, (SCM element, SCM axis)); +DECLARE_SCHEME_CALLBACK (centered_on_parent, (SCM element, SCM axis)); +}; + + #endif /* SIDE_POSITION_INTERFACE_HH */ diff --git a/lily/include/spaceable-grob.hh b/lily/include/spaceable-grob.hh index 57ed529dea..194f5b7eab 100644 --- a/lily/include/spaceable-grob.hh +++ b/lily/include/spaceable-grob.hh @@ -18,7 +18,7 @@ struct Spaceable_grob /// set a minimum distance static void add_rod (Grob*me, Grob * to, Real distance); static void add_spring (Grob*me,Grob * to, Real dist, Real strength, bool); - + static bool has_interface (Grob*); static void remove_interface (Grob*); static SCM get_minimum_distances (Grob*); static SCM get_ideal_distances (Grob*); diff --git a/lily/include/spanner.hh b/lily/include/spanner.hh index ebf5af6a86..0a5abcfa0f 100644 --- a/lily/include/spanner.hh +++ b/lily/include/spanner.hh @@ -54,6 +54,7 @@ public: static int compare (Spanner * const &,Spanner * const &); virtual Grob* find_broken_piece (System*) const; virtual SCM do_derived_mark (); + static bool has_interface (Grob*); protected: void set_my_columns (); diff --git a/lily/include/staff-symbol-referencer.hh b/lily/include/staff-symbol-referencer.hh index aa4affa2ce..c250e9e0d4 100644 --- a/lily/include/staff-symbol-referencer.hh +++ b/lily/include/staff-symbol-referencer.hh @@ -23,6 +23,7 @@ class Staff_symbol_referencer public: static void set_interface (Grob*); static bool has_interface (Grob*); + static bool ugly_hack (Grob*); static void set_position (Grob*,Real); DECLARE_SCHEME_CALLBACK (callback, (SCM element, SCM axis)); diff --git a/lily/include/system.hh b/lily/include/system.hh new file mode 100644 index 0000000000..7f67f070a8 --- /dev/null +++ b/lily/include/system.hh @@ -0,0 +1,43 @@ + +/* + line-of-score.hh -- part of GNU LilyPond + + (c) 1996--2002 Han-Wen Nienhuys +*/ + +#ifndef SCORELINE_HH +#define SCORELINE_HH + +#include "protected-scm.hh" +#include "column-x-positions.hh" +#include "spanner.hh" + +class System : public Spanner +{ +public: + int rank_i_; + void post_processing (bool); + + System (SCM); + /// is #c# contained in #*this#? + bool contains_b (Paper_column const *c) const; + int element_count () const; + + void break_into_pieces (Array const&); + void output_lines (); + static bool has_interface (Grob*); + + Link_array broken_col_range (Item const*, Item const*) const; + Link_array column_l_arr () const; + + void add_column (Paper_column*); + void typeset_grob (Grob*); + void output_molecule (SCM, Offset); + void output_scheme (SCM); + void pre_processing (); +protected: + VIRTUAL_COPY_CONS (Grob); +}; + +#endif + diff --git a/lily/include/text-item.hh b/lily/include/text-item.hh index 8cd1430ebe..e8479e9d74 100644 --- a/lily/include/text-item.hh +++ b/lily/include/text-item.hh @@ -23,6 +23,9 @@ public: static Molecule string2molecule (Grob *me, SCM text, SCM properties); static Molecule markup_text2molecule (Grob *me, SCM markup_text, SCM properties); + static bool has_interface (Grob*); + + private: static Molecule lookup_character (Grob *me, Font_metric*, SCM char_name); static Molecule lookup_text (Grob *me, Font_metric*, SCM text); diff --git a/lily/include/time-signature.hh b/lily/include/time-signature.hh index 7bd6553252..9c39e9221b 100644 --- a/lily/include/time-signature.hh +++ b/lily/include/time-signature.hh @@ -19,6 +19,7 @@ */ struct Time_signature { + static bool has_interface (Grob*); static Molecule special_time_signature (Grob*,String,int,int) ; static Molecule time_signature (Grob*,int, int); DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM )); diff --git a/lily/instrument-name-engraver.cc b/lily/instrument-name-engraver.cc index 75be1189bc..4bb036166b 100644 --- a/lily/instrument-name-engraver.cc +++ b/lily/instrument-name-engraver.cc @@ -92,7 +92,7 @@ Instrument_name_engraver::acknowledge_grob (Grob_info i) } if (dynamic_cast (i.grob_l_) - && i.grob_l_->has_interface (ly_symbol2scm ("dynamic-interface"))) + && i.grob_l_->internal_has_interface (ly_symbol2scm ("dynamic-interface"))) return; /* diff --git a/lily/item.cc b/lily/item.cc index 7a2f8fb565..da1cbfb437 100644 --- a/lily/item.cc +++ b/lily/item.cc @@ -13,7 +13,7 @@ #include "paper-column.hh" #include "spanner.hh" #include "lily-guile.hh" -#include "line-of-score.hh" +#include "system.hh" #include "group-interface.hh" Item::Item (SCM s) @@ -196,6 +196,8 @@ unsmob_item (SCM s ) return dynamic_cast (unsmob_grob (s)); } + + ADD_INTERFACE(Item, "item-interface", "", diff --git a/lily/key-engraver.cc b/lily/key-engraver.cc index f8387cac5e..d0345c0040 100644 --- a/lily/key-engraver.cc +++ b/lily/key-engraver.cc @@ -6,7 +6,7 @@ (c) 1997--2002 Han-Wen Nienhuys */ -#include "key-item.hh" + #include "command-request.hh" #include "musical-request.hh" #include "item.hh" diff --git a/lily/key-signature-interface.cc b/lily/key-signature-interface.cc index 802a6bf015..9d1ebfcec7 100644 --- a/lily/key-signature-interface.cc +++ b/lily/key-signature-interface.cc @@ -23,6 +23,8 @@ struct Key_signature_interface { DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM )); + + static bool has_interface (Grob*); }; diff --git a/lily/local-key-item.cc b/lily/local-key-item.cc index 5709fb428e..15c2e9ec28 100644 --- a/lily/local-key-item.cc +++ b/lily/local-key-item.cc @@ -244,11 +244,6 @@ Local_key_item::brew_molecule (SCM smob) return mol.smobbed_copy (); } -bool -Local_key_item::has_interface (Grob*m) -{ - return m && m->has_interface (ly_symbol2scm ("accidentals-interface")); -} diff --git a/lily/lyric-phrasing-engraver.cc b/lily/lyric-phrasing-engraver.cc index cc6586d01d..e5d5855b4e 100644 --- a/lily/lyric-phrasing-engraver.cc +++ b/lily/lyric-phrasing-engraver.cc @@ -196,7 +196,7 @@ Lyric_phrasing_engraver::acknowledge_grob (Grob_info i) } /* now try for a lyric */ - if (h->has_interface (ly_symbol2scm ("lyric-syllable-interface"))) { + if (h->internal_has_interface (ly_symbol2scm ("lyric-syllable-interface"))) { /* what's its LyricsVoice context name? */ String voice_context_id; @@ -225,7 +225,7 @@ Lyric_phrasing_engraver::acknowledge_grob (Grob_info i) then ignore it and let the Extender_engraver take care of it (i.e. finish at next lyric). */ - if (h->has_interface (ly_symbol2scm ("lyric-extender-interface"))) { + if (h->internal_has_interface (ly_symbol2scm ("lyric-extender-interface"))) { String voice_context_id = get_context_id (i.origin_trans_l_->daddy_trans_l_, "LyricsVoice"); record_extender (trim_suffix (voice_context_id), h); return; diff --git a/lily/multi-measure-rest.cc b/lily/multi-measure-rest.cc index 2659274f81..579408802d 100644 --- a/lily/multi-measure-rest.cc +++ b/lily/multi-measure-rest.cc @@ -21,11 +21,6 @@ #include "percent-repeat-item.hh" #include "lookup.hh" -bool -Multi_measure_rest::has_interface (Grob*me) -{ - return me->has_interface (ly_symbol2scm ("multi-measure-rest-interface")); -} MAKE_SCHEME_CALLBACK (Multi_measure_rest,percent,1); SCM diff --git a/lily/note-column.cc b/lily/note-column.cc index d35b6da16f..c4dd3bdca7 100644 --- a/lily/note-column.cc +++ b/lily/note-column.cc @@ -126,11 +126,6 @@ Note_column::first_head (Grob*me) return st? Stem::first_head (st): 0; } -bool -Note_column::has_interface (Grob*me) -{ - return me && me->has_interface (ly_symbol2scm ("note-column-interface")); -} /* Return the first Accidentals grob that we find in a note-head. diff --git a/lily/note-head.cc b/lily/note-head.cc index 23f407622f..f77eea73c7 100644 --- a/lily/note-head.cc +++ b/lily/note-head.cc @@ -180,11 +180,6 @@ Note_head::head_extent (Grob *me, Axis a) return internal_brew_molecule (me, false).extent (a); } -bool -Note_head::has_interface (Grob*m) -{ - return m&& m->has_interface (ly_symbol2scm ("note-head-interface")); -} MAKE_SCHEME_CALLBACK (Note_head,brew_ez_molecule,1); diff --git a/lily/note-spacing.cc b/lily/note-spacing.cc index fee2bb8b07..1a1ae4c964 100644 --- a/lily/note-spacing.cc +++ b/lily/note-spacing.cc @@ -18,11 +18,6 @@ #include "separation-item.hh" #include "staff-spacing.hh" -bool -Note_spacing::has_interface (Grob* g) -{ - return g && g->has_interface (ly_symbol2scm ("note-spacing-interface")); -} void Note_spacing::get_spacing (Grob *me, Item* right_col, diff --git a/lily/paper-score.cc b/lily/paper-score.cc index a6f1168049..9193e92c0a 100644 --- a/lily/paper-score.cc +++ b/lily/paper-score.cc @@ -11,7 +11,7 @@ #include "font-metric.hh" #include "spanner.hh" #include "paper-def.hh" -#include "line-of-score.hh" +#include "system.hh" #include "paper-column.hh" #include "paper-score.hh" #include "paper-column.hh" diff --git a/lily/rest.cc b/lily/rest.cc index aee966e1b1..c0bd01d93f 100644 --- a/lily/rest.cc +++ b/lily/rest.cc @@ -115,11 +115,6 @@ Rest::extent_callback (SCM smob, SCM ax) return ly_interval2scm (unsmob_molecule (m)->extent (a)); } -bool -Rest::has_interface (Grob*m) -{ - return m && m->has_interface (ly_symbol2scm ("rest-interface")); -} ADD_INTERFACE (Rest,"rest-interface", diff --git a/lily/rhythmic-head.cc b/lily/rhythmic-head.cc index dd20a029b8..b9bf752f71 100644 --- a/lily/rhythmic-head.cc +++ b/lily/rhythmic-head.cc @@ -50,11 +50,6 @@ Rhythmic_head::set_dots (Grob*me,Item *dot_l) -bool -Rhythmic_head::has_interface (Grob*me) -{ - return me && me->has_interface (ly_symbol2scm ("rhythmic-head-interface")); -} ADD_INTERFACE (Rhythmic_head,"rhythmic-head-interface", diff --git a/lily/score-engraver.cc b/lily/score-engraver.cc index 3d6e5d058b..7d44b9495a 100644 --- a/lily/score-engraver.cc +++ b/lily/score-engraver.cc @@ -8,7 +8,7 @@ #include "debug.hh" -#include "line-of-score.hh" +#include "system.hh" #include "item.hh" #include "score-engraver.hh" #include "paper-score.hh" diff --git a/lily/script.cc b/lily/script.cc index 0280a52d17..63afc99f95 100644 --- a/lily/script.cc +++ b/lily/script.cc @@ -78,12 +78,17 @@ Script::brew_molecule (SCM smob) return get_molecule (me, dir).smobbed_copy (); } -bool -Script::has_interface (Grob*me) + + +struct Text_script { - return me->has_interface (ly_symbol2scm ("script-interface")); -} + static bool has_interface (Grob*); +}; +struct Skript +{ + static bool has_interface (Grob*); +}; ADD_INTERFACE (Text_script,"text-script-interface", "Any text script", diff --git a/lily/self-aligment-interface.cc b/lily/self-aligment-interface.cc new file mode 100644 index 0000000000..dd0c05cc19 --- /dev/null +++ b/lily/self-aligment-interface.cc @@ -0,0 +1,66 @@ +#include "side-position-interface.hh" +#include "warn.hh" + +/* + Position centered on parent. + */ +MAKE_SCHEME_CALLBACK (Self_alignment_interface,centered_on_parent,2); +SCM +Self_alignment_interface::centered_on_parent (SCM element_smob, SCM axis) +{ + Grob *me = unsmob_grob (element_smob); + Axis a = (Axis) gh_scm2int (axis); + Grob *him = me->get_parent (a); + + return gh_double2scm (him->extent (him,a).center ()); +} + + + + +/** + callback that centers the element on itself + + Requires that self-alignment-{X,Y} be set. + */ +MAKE_SCHEME_CALLBACK (Self_alignment_interface,aligned_on_self,2); +SCM +Self_alignment_interface::aligned_on_self (SCM element_smob, SCM axis) +{ + Grob *me = unsmob_grob (element_smob); + Axis a = (Axis) gh_scm2int (axis); + static SCM prop_syms[2]; + + if (!prop_syms[0]) + { + prop_syms[X_AXIS] = ly_symbol2scm ("self-alignment-X"); + prop_syms[Y_AXIS] = ly_symbol2scm ("self-alignment-Y"); + } + + SCM align (me->internal_get_grob_property (prop_syms[a])); + if (gh_number_p (align)) + { + Interval ext (me->extent (me,a)); + + if (ext.empty_b ()) + { + programming_error ("I'm empty. Can't align on self"); + return gh_double2scm (0.0); + } + else + { + return gh_double2scm (- ext.linear_combination (gh_scm2double (align))); + } + } + else if (unsmob_grob (align)) + { + return gh_double2scm (- unsmob_grob (align)->relative_coordinate (me, a)); + } + return gh_double2scm (0.0); +} + + +ADD_INTERFACE (Self_alignment_interface, "self-alignment-interface", + "Position self using some alignment", + "self-alignment-X self-alignment-Y"); + diff --git a/lily/separating-group-spanner.cc b/lily/separating-group-spanner.cc index 580919a04e..992dba8d63 100644 --- a/lily/separating-group-spanner.cc +++ b/lily/separating-group-spanner.cc @@ -135,11 +135,6 @@ Separating_group_spanner::add_spacing_unit (Grob* me ,Item*i) } -bool -Separating_group_spanner::has_interface (Grob*) -{//todo - assert (false); -} diff --git a/lily/separation-item.cc b/lily/separation-item.cc index 81b3df8ced..1e439066b5 100644 --- a/lily/separation-item.cc +++ b/lily/separation-item.cc @@ -12,11 +12,6 @@ #include "debug.hh" #include "group-interface.hh" -bool -Separation_item::has_interface (Grob *g) -{ - return g->has_interface (ly_symbol2scm ("separation-item-interface")); -} void Separation_item::add_item (Grob*s,Item* i) diff --git a/lily/side-position-interface.cc b/lily/side-position-interface.cc index 4ce9df6761..0c923d28e8 100644 --- a/lily/side-position-interface.cc +++ b/lily/side-position-interface.cc @@ -145,43 +145,6 @@ Side_position_interface::aligned_on_support_refpoints (SCM smob, SCM axis) } -/** - callback that centers the element on itself - - Requires that self-alignment-{X,Y} be set. - */ -MAKE_SCHEME_CALLBACK (Side_position_interface,aligned_on_self,2); -SCM -Side_position_interface::aligned_on_self (SCM element_smob, SCM axis) -{ - Grob *me = unsmob_grob (element_smob); - Axis a = (Axis) gh_scm2int (axis); - String s ("self-alignment-"); - - s += (a == X_AXIS) ? "X" : "Y"; - - SCM align (me->get_grob_property (s.ch_C ())); - if (gh_number_p (align)) - { - Interval ext (me->extent (me,a)); - - if (ext.empty_b ()) - { - programming_error ("I'm empty. Can't align on self"); - return gh_double2scm (0.0); - } - else - { - return gh_double2scm (- ext.linear_combination (gh_scm2double (align))); - } - } - else if (unsmob_grob (align)) - { - return gh_double2scm (- unsmob_grob (align)->relative_coordinate (me, a)); - } - return gh_double2scm (0.0); -} - Real @@ -258,21 +221,6 @@ Side_position_interface::aligned_side (SCM element_smob, SCM axis) return gh_double2scm (o); } -/* - Position centered on parent. - */ -MAKE_SCHEME_CALLBACK (Side_position_interface,centered_on_parent,2); -SCM -Side_position_interface::centered_on_parent (SCM element_smob, SCM axis) -{ - Grob *me = unsmob_grob (element_smob); - Axis a = (Axis) gh_scm2int (axis); - Grob *him = me->get_parent (a); - - return gh_double2scm (him->extent (him,a).center ()); -} - - void Side_position_interface::add_staff_support (Grob*me) { @@ -321,11 +269,6 @@ Side_position_interface::set_padding (Grob*me, Real p) me->set_grob_property ("padding", gh_double2scm (p)); } -bool -Side_position_interface::has_interface (Grob*me) -{ - return me->has_interface (ly_symbol2scm ("side-position-interface")); -} bool Side_position_interface::supported_b (Grob*me) diff --git a/lily/slur.cc b/lily/slur.cc index 0678e694fc..e691c606cc 100644 --- a/lily/slur.cc +++ b/lily/slur.cc @@ -681,11 +681,6 @@ Slur::get_curve (Grob*me) } -bool -Slur::has_interface (Grob*me) -{ - return me->has_interface (ly_symbol2scm ("slur-interface")); -} ADD_INTERFACE (Slur,"slur-interface", diff --git a/lily/spaceable-grob.cc b/lily/spaceable-grob.cc index bb6afc11e6..0f80197c4b 100644 --- a/lily/spaceable-grob.cc +++ b/lily/spaceable-grob.cc @@ -82,8 +82,9 @@ Spaceable_grob::remove_interface (Grob*me) } -ADD_INTERFACE (Spaceable,"spaceable-grob-interface", - "An grob (a Paper_column) that takes part in the + +ADD_INTERFACE (Spaceable_grob,"spaceable-grob-interface", + "A grob (a Paper_column) that takes part in the spacing problem. ", "measure-length penalty minimum-distances ideal-distances left-neighbors right-neighbors"); diff --git a/lily/spacing-spanner.cc b/lily/spacing-spanner.cc index 2a86f22ff5..5e48941547 100644 --- a/lily/spacing-spanner.cc +++ b/lily/spacing-spanner.cc @@ -10,7 +10,7 @@ #include #include -#include "line-of-score.hh" +#include "system.hh" #include "paper-def.hh" #include "paper-score.hh" #include "paper-column.hh" @@ -52,6 +52,7 @@ public: static void do_measure (Rational, Grob*me,Link_array *cols); static void musical_column_spacing (Grob*,Item*,Item*, Real, Rational); DECLARE_SCHEME_CALLBACK (set_springs, (SCM )); + static bool has_interface (Grob*); }; /* diff --git a/lily/span-bar.cc b/lily/span-bar.cc index 0279cd2733..0ee31140fa 100644 --- a/lily/span-bar.cc +++ b/lily/span-bar.cc @@ -248,11 +248,6 @@ Span_bar::get_bar_size (SCM smob) } -bool -Span_bar::has_interface (Grob*m) -{ - return m && m->has_interface (ly_symbol2scm ("span-bar-interface")); -} ADD_INTERFACE (Span_bar,"span-bar-interface", "A bar line that spans other barlines (typically used to get cross-staff barlines.", diff --git a/lily/spanner.cc b/lily/spanner.cc index 9e8be73b3b..4dd1dce0a5 100644 --- a/lily/spanner.cc +++ b/lily/spanner.cc @@ -16,7 +16,7 @@ #include "molecule.hh" #include "paper-outputter.hh" #include "paper-column.hh" -#include "line-of-score.hh" +#include "system.hh" #include "group-interface.hh" void diff --git a/lily/staff-spacing.cc b/lily/staff-spacing.cc index fa18624f99..011c2b228a 100644 --- a/lily/staff-spacing.cc +++ b/lily/staff-spacing.cc @@ -19,12 +19,6 @@ #include "note-column.hh" #include "stem.hh" -bool -Staff_spacing::has_interface (Grob* g) -{ - return g && g->has_interface (ly_symbol2scm ("staff-spacing-interface")); -} - /* Insert some more space for the next note, in case it has a stem in the wrong direction diff --git a/lily/staff-symbol-referencer.cc b/lily/staff-symbol-referencer.cc index abb66fa954..2d05d1f11a 100644 --- a/lily/staff-symbol-referencer.cc +++ b/lily/staff-symbol-referencer.cc @@ -160,7 +160,7 @@ compare_position (Grob *const &a, Grob * const &b) - +#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 diff --git a/lily/staff-symbol.cc b/lily/staff-symbol.cc index 61b762fe99..75bb907c14 100644 --- a/lily/staff-symbol.cc +++ b/lily/staff-symbol.cc @@ -95,11 +95,6 @@ Staff_symbol::staff_space (Grob*me) return ss; } -bool -Staff_symbol::has_interface (Grob*m) -{ - return m && m->has_interface (ly_symbol2scm ("staff-symbol-interface")); -} diff --git a/lily/stanza-number-engraver.cc b/lily/stanza-number-engraver.cc index 7c860ce11a..813137bc8e 100644 --- a/lily/stanza-number-engraver.cc +++ b/lily/stanza-number-engraver.cc @@ -48,7 +48,7 @@ Stanza_number_engraver::process_music () if (gh_string_p (s) || gh_pair_p (s)) /* - if (i.grob_l_->has_interface (symbol ("lyric-syllable-interface"))) + if (i.grob_l_->internal_has_interface (symbol ("lyric-syllable-interface"))) Tried catching lyric items to generate stanza numbers, but it spoils lyric spacing. diff --git a/lily/stem-tremolo.cc b/lily/stem-tremolo.cc index 3a18323b32..0c3313d3dc 100644 --- a/lily/stem-tremolo.cc +++ b/lily/stem-tremolo.cc @@ -22,11 +22,6 @@ lengthen stem if necessary */ -bool -Stem_tremolo::has_interface (Grob *me) -{ - return me->has_interface (ly_symbol2scm ("stem-tremolo-interface")); -} MAKE_SCHEME_CALLBACK (Stem_tremolo,dim_callback,2); diff --git a/lily/stem.cc b/lily/stem.cc index ff8a4c4a99..7286daeee0 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -800,12 +800,6 @@ Stem::calc_stem_info (Grob*me) return info; } -bool -Stem::has_interface (Grob*m) -{ - return m && m->has_interface (ly_symbol2scm ("stem-interface")); -} - ADD_INTERFACE (Stem,"stem-interface", "A stem", "adjust-if-on-staffline thickness stem-info beamed-lengths beamed-minimum-lengths lengths beam stem-shorten duration-log beaming neutral-direction stem-end-position support-head heads direction length style no-stem-extend flag-style dir-forced"); diff --git a/lily/syllable-group.cc b/lily/syllable-group.cc index e8973a6824..506f6a466d 100644 --- a/lily/syllable-group.cc +++ b/lily/syllable-group.cc @@ -120,7 +120,7 @@ Syllable_group::set_lyric_align (const char *punc, Grob *default_notehead_l) // centre on notehead ... if we have one. if (notehead_l_) { lyric->set_parent (notehead_l_, X_AXIS); - lyric->add_offset_callback (Side_position_interface::centered_on_parent_proc, X_AXIS); + lyric->add_offset_callback (Self_alignment_interface::centered_on_parent_proc, X_AXIS); // reference is on the right of the notehead; move it left half way, and add translation lyric->translate_axis (group_translation_f_- (notehead_l_->extent (notehead_l_, X_AXIS)).center (), X_AXIS); } @@ -286,7 +286,10 @@ Syllable_group::make_entry () return vi->smobbed_self (); } - +struct Lyric_syllable +{ + static bool has_interface (Grob*); +}; ADD_INTERFACE (Lyric_syllable,"lyric-syllable-interface", "a single piece of lyrics", "word-space alignment ignore-length-mismatch begin-alignment end-alignment"); diff --git a/lily/system-start-delimiter.cc b/lily/system-start-delimiter.cc index b07c6619b1..b19ca86d3b 100644 --- a/lily/system-start-delimiter.cc +++ b/lily/system-start-delimiter.cc @@ -58,11 +58,6 @@ Will not fix it since I'm not sure. } -bool -System_start_delimiter::has_interface (Grob*me) -{ - return me->has_interface (ly_symbol2scm ("system-start-delimiter-interface")); -} Molecule System_start_delimiter::simple_bar (Grob*me,Real h) @@ -185,4 +180,4 @@ System_start_delimiter::staff_brace (Grob*me, Real y) ADD_INTERFACE (System_start_delimiter,"system-start-delimiter-interface", "#'style can be bar-line, bracket or brace", - "bar-line-collapse-height brace-collapse-height bracket-collapse-height thickness arch-height arch-angle arch-thick arch-width bracket-thick glyph"); + "collapse-height thickness arch-height arch-angle arch-thick arch-width bracket-thick glyph"); diff --git a/lily/system.cc b/lily/system.cc index 4608d21a56..dce65a6931 100644 --- a/lily/system.cc +++ b/lily/system.cc @@ -9,7 +9,7 @@ #include "input-smob.hh" #include "axis-group-interface.hh" #include "debug.hh" -#include "line-of-score.hh" +#include "system.hh" #include "main.hh" #include "paper-column.hh" #include "paper-def.hh" @@ -546,4 +546,4 @@ grob has a Line_of_score as both X and Y reference point. The Paper_score contains one grob of this type. Control enters the Grob dependency calculation from this single Line_of_score object.", - "between-system-string spacing-procedure all-elements columns"); + "between-system-string all-elements columns"); diff --git a/lily/text-item.cc b/lily/text-item.cc index 194028ab3f..a63c3784d5 100644 --- a/lily/text-item.cc +++ b/lily/text-item.cc @@ -248,7 +248,6 @@ Text_item::brew_molecule (SCM smob) - ADD_INTERFACE (Text_item,"text-interface", "A scheme markup text", "text align baseline-skip lookup raise kern word-space magnify"); diff --git a/lily/text-spanner.cc b/lily/text-spanner.cc index cb24ad3fb1..2e4acbfa9a 100644 --- a/lily/text-spanner.cc +++ b/lily/text-spanner.cc @@ -40,7 +40,7 @@ Text_spanner::brew_molecule (SCM smob) Grob *me= unsmob_grob (smob); Spanner *spanner = dynamic_cast (me); - if (spanner->has_interface (ly_symbol2scm ("piano-pedal-interface")) ) + if (spanner->internal_has_interface (ly_symbol2scm ("piano-pedal-interface")) ) { setup_pedal_bracket(spanner); } @@ -245,7 +245,7 @@ Text_spanner::setup_pedal_bracket(Spanner *me) height[LEFT] = 0; Grob * textbit = me->get_parent(Y_AXIS); extra_short = padding; - if (textbit->has_interface(ly_symbol2scm("text-interface"))) + if (textbit->internal_has_interface(ly_symbol2scm("text-interface"))) // for plain text, e.g., Sost. Ped. { SCM text = textbit->get_grob_property("text"); @@ -281,13 +281,14 @@ Text_spanner::setup_pedal_bracket(Spanner *me) } - +struct Pianopedal +{ + static bool has_interface (Grob*); +}; ADD_INTERFACE (Pianopedal,"piano-pedal-interface", "", "pedal-type edge-width edge-height shorten-pair text-start left-widen right-widen"); - - ADD_INTERFACE (Text_spanner,"text-spanner-interface", "generic text spanner", "dash-period if-text-padding dash-length edge-height edge-width edge-text shorten-pair type"); diff --git a/lily/tie-column.cc b/lily/tie-column.cc index a2c34f6e62..e364bf7f03 100644 --- a/lily/tie-column.cc +++ b/lily/tie-column.cc @@ -17,11 +17,6 @@ -bool -Tie_column::has_interface (Grob*me) -{ - return me->has_interface (ly_symbol2scm ("tie-column-interface")); -} /* diff --git a/lily/tie.cc b/lily/tie.cc index 9f116b8f60..1086b9a0a8 100644 --- a/lily/tie.cc +++ b/lily/tie.cc @@ -52,11 +52,6 @@ Tie::set_interface (Grob*me) me->set_grob_property ("heads", gh_cons (SCM_EOL, SCM_EOL)); } -bool -Tie::has_interface (Grob*me) -{ - return me->has_interface (ly_symbol2scm ("tie-interface")); -} Grob* Tie::head (Grob*me, Direction d) diff --git a/lily/tuplet-bracket.cc b/lily/tuplet-bracket.cc index 08fa317062..b7cbc2c49b 100644 --- a/lily/tuplet-bracket.cc +++ b/lily/tuplet-bracket.cc @@ -476,16 +476,11 @@ Tuplet_bracket::add_column (Grob*me, Item*n) } -bool -Tuplet_bracket::has_interface (Grob*me) -{ - return me->has_interface (ly_symbol2scm ("tuplet-bracket-interface")); -} ADD_INTERFACE (Tuplet_bracket,"tuplet-bracket-interface", "A bracket with a number in the middle, used for tuplets.", - "note-columns padding gap left-position right-position bracket-visibility number-visibility thickness direction"); + "note-columns edge-width edge-height shorten-pair padding gap left-position right-position bracket-visibility number-visibility thickness direction"); diff --git a/lily/voice-devnull-engraver.cc b/lily/voice-devnull-engraver.cc index d580a91b2f..ef97171b40 100644 --- a/lily/voice-devnull-engraver.cc +++ b/lily/voice-devnull-engraver.cc @@ -95,7 +95,7 @@ Voice_devnull_engraver::acknowledge_grob (Grob_info i) && (to_boolean (get_property ("unison")) || to_boolean (get_property ("unisilence"))))) for (char const **p = junk_interfaces; *p; p++) - if (i.grob_l_->has_interface (ly_symbol2scm (*p))) + if (i.grob_l_->internal_has_interface (ly_symbol2scm (*p))) { /* Ugh, we can suicide them, but they remain living */ i.grob_l_->suicide ();