From: Dan Eble Date: Sat, 8 Aug 2015 00:21:50 +0000 (-0400) Subject: Issue 4541 (2/2) Clean up... X-Git-Tag: release/2.19.26-1~48 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=8920247a80a350aaab540166ab7a4937f45786a6;p=lilypond.git Issue 4541 (2/2) Clean up... * Use has_interface (grob) * Remove DECLARE_GROB_INTERFACE() Edits to grob-interface.hh are manual and the rest is the result of the following script. for FILE in $(git grep -lw DECLARE_GROB_INTERFACE lily) do sed -i "/^ *DECLARE_GROB_INTERFACE ();.*$/d" $FILE done for FILE in $(git grep -lw "has_interface" lily) do if [ $FILE == lily/include/grob-interface.hh ] ; then continue ; fi sed -i "s/\\([_a-zA-Z]\\+\\)::has_interface\\>/has_interface<\\1>/g s/\\([_a-zA-Z]\\+\\) && has_interface<\\([_a-zA-Z]\\+\\)> (\\1)/has_interface<\\2> (\\1)/g" $FILE done --- diff --git a/lily/accidental-placement.cc b/lily/accidental-placement.cc index 32eb54fac7..f8a0967954 100644 --- a/lily/accidental-placement.cc +++ b/lily/accidental-placement.cc @@ -313,7 +313,7 @@ extract_heads_and_stems (vector const &apes) Grob *head = acc->get_parent (Y_AXIS); Grob *col = head->get_parent (X_AXIS); - if (Note_column::has_interface (col)) + if (has_interface (col)) note_cols.push_back (col); else ret.push_back (head); @@ -327,7 +327,7 @@ extract_heads_and_stems (vector const &apes) for (vsize i = note_cols.size (); i--;) { Grob *c = note_cols[i]->get_parent (X_AXIS); - if (Note_collision_interface::has_interface (c)) + if (has_interface (c)) { extract_grob_set (c, "elements", columns); concat (note_cols, columns); diff --git a/lily/align-interface.cc b/lily/align-interface.cc index 0c140235dc..80a9dd3c08 100644 --- a/lily/align-interface.cc +++ b/lily/align-interface.cc @@ -106,7 +106,7 @@ get_skylines (Grob *g, // of the system. This way, the tall treble clefs are only compared with the treble // clefs of the other staff and they will be ignored if the staff above is, for example, // lyrics. - if (Axis_group_interface::has_interface (g)) + if (has_interface (g)) { extent = Axis_group_interface::rest_of_line_pure_height (g, start, end); Interval begin_of_line_extent = Axis_group_interface::begin_of_line_pure_height (g, start); diff --git a/lily/axis-group-interface.cc b/lily/axis-group-interface.cc index 09f6ab471b..c9c56858a1 100644 --- a/lily/axis-group-interface.cc +++ b/lily/axis-group-interface.cc @@ -101,7 +101,7 @@ Axis_group_interface::relative_maybe_bound_group_extent (vector const &e Grob *se = elts[i]; if (!to_boolean (se->get_property ("cross-staff"))) { - Interval dims = (bound && Axis_group_interface::has_interface (se) + Interval dims = (bound && has_interface (se) ? generic_bound_extent (se, common, a) : se->extent (common, a)); if (!dims.is_empty ()) @@ -330,7 +330,7 @@ Axis_group_interface::relative_pure_height (Grob *me, int start, int end) reasonably safe to assume that if our parent is a VerticalAlignment, we can assume additivity and cache things nicely. */ Grob *p = me->get_parent (Y_AXIS); - if (p && Align_interface::has_interface (p)) + if (has_interface (p)) return Axis_group_interface::sum_partial_pure_heights (me, start, end); Grob *common = unsmob (me->get_object ("pure-Y-common")); @@ -344,7 +344,7 @@ Axis_group_interface::relative_pure_height (Grob *me, int start, int end) if (rank_span[LEFT] <= end && rank_span[RIGHT] >= start && g->pure_is_visible (start, end) && !(to_boolean (g->get_property ("cross-staff")) - && Stem::has_interface (g))) + && has_interface (g))) { Interval dims = g->pure_y_extent (common, start, end); if (!dims.is_empty ()) @@ -443,7 +443,7 @@ Axis_group_interface::generic_group_extent (Grob *me, Axis a) /* trigger the callback to do skyline-spacing on the children */ if (a == Y_AXIS) for (vsize i = 0; i < elts.size (); i++) - if (!(Stem::has_interface (elts[i]) + if (!(has_interface (elts[i]) && to_boolean (elts[i]->get_property ("cross-staff")))) (void) elts[i]->get_property ("vertical-skylines"); @@ -535,7 +535,7 @@ Axis_group_interface::calc_pure_y_common (SCM smob) extract_grob_set (me, "pure-relevant-grobs", elts); Grob *common = common_refpoint_of_array (elts, me, Y_AXIS); - if (common != me && Align_interface::has_interface (common)) + if (common != me && has_interface (common)) { me->programming_error("My pure_y_common is a VerticalAlignment," " which might contain several staves."); @@ -599,7 +599,7 @@ Axis_group_interface::get_children (Grob *me, vector *found) { found->push_back (me); - if (!Axis_group_interface::has_interface (me)) + if (!has_interface (me)) return; extract_grob_set (me, "elements", elements); diff --git a/lily/balloon.cc b/lily/balloon.cc index 7e8067a577..d8519f6e39 100644 --- a/lily/balloon.cc +++ b/lily/balloon.cc @@ -33,7 +33,6 @@ class Balloon_interface public: DECLARE_SCHEME_CALLBACK (print, (SCM)); DECLARE_SCHEME_CALLBACK (print_spanner, (SCM)); - DECLARE_GROB_INTERFACE (); static SCM internal_balloon_print (Grob *me, Grob *p, Offset off); }; diff --git a/lily/beam-collision-engraver.cc b/lily/beam-collision-engraver.cc index bb8e42e1cf..151ffacf16 100644 --- a/lily/beam-collision-engraver.cc +++ b/lily/beam-collision-engraver.cc @@ -115,12 +115,12 @@ Beam_collision_engraver::finalize () if ((covered_grob_spanned_rank[RIGHT] >= beam_spanned_rank_[LEFT]) && !(to_boolean (beam_grob->get_property ("collision-voice-only")) && (covered_grob_context != beam_context)) - && !(Beam::has_interface (covered_grob) + && !(has_interface (covered_grob) && (covered_grob_spanned_rank[LEFT] <= beam_spanned_rank_[LEFT])) && covered_grob_has_interface (covered_grob, beam_grob)) { // Do not consider note heads attached to the beam. - if (Stem::has_interface (covered_grob)) + if (has_interface (covered_grob)) if (unsmob (covered_grob->get_object ("beam"))) continue; diff --git a/lily/beam-quanting.cc b/lily/beam-quanting.cc index 856d8be0b6..f3505772f1 100644 --- a/lily/beam-quanting.cc +++ b/lily/beam-quanting.cc @@ -305,7 +305,7 @@ void Beam_scoring_problem::init_instance_variables (Grob *me, Drul_array y edge_dirs_ = Drul_array (stem_infos_[0].dir_, stem_infos_.back ().dir_); - is_xstaff_ = Align_interface::has_interface (common[Y_AXIS]); + is_xstaff_ = has_interface (common[Y_AXIS]); is_knee_ |= dirs_found[DOWN] && dirs_found[UP]; staff_radius_ = Staff_symbol_referencer::staff_radius (beams[i]); @@ -343,7 +343,7 @@ void Beam_scoring_problem::init_instance_variables (Grob *me, Drul_array y if (!collisions[j]->is_live ()) continue; - if (Beam::has_interface (collisions[j]) && Beam::is_cross_staff (collisions[j])) + if (has_interface (collisions[j]) && Beam::is_cross_staff (collisions[j])) continue; Box b; @@ -364,7 +364,7 @@ void Beam_scoring_problem::init_instance_variables (Grob *me, Drul_array y add_collision (b[X_AXIS][d], b[Y_AXIS], width_factor); Grob *stem = unsmob (collisions[j]->get_object ("stem")); - if (stem && Stem::has_interface (stem) && Stem::is_normal_stem (stem)) + if (has_interface (stem) && Stem::is_normal_stem (stem)) { colliding_stems.insert (stem); } diff --git a/lily/beam.cc b/lily/beam.cc index c18c3d8430..206f6e9f4d 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -1232,7 +1232,7 @@ Beam::rest_collision_callback (SCM smob, SCM prev_offset) return scm_from_double (0.0); Grob *beam = unsmob (stem->get_object ("beam")); if (!beam - || !Beam::has_interface (beam) + || !has_interface (beam) || !Beam::normal_stem_count (beam)) return scm_from_double (0.0); diff --git a/lily/break-alignment-interface.cc b/lily/break-alignment-interface.cc index 58cb488d6b..e2a546f6a6 100644 --- a/lily/break-alignment-interface.cc +++ b/lily/break-alignment-interface.cc @@ -263,7 +263,7 @@ Break_alignable_interface::self_align_callback (SCM grob) { Grob *me = unsmob (grob); Item *alignment = dynamic_cast (me->get_parent (X_AXIS)); - if (!Break_alignment_interface::has_interface (alignment)) + if (!has_interface (alignment)) return scm_from_int (0); SCM symbol_list = me->get_property ("break-align-symbols"); diff --git a/lily/clef-modifier.cc b/lily/clef-modifier.cc index 4c24dd356e..c6ce950fc0 100644 --- a/lily/clef-modifier.cc +++ b/lily/clef-modifier.cc @@ -22,7 +22,6 @@ struct Clef_modifier { DECLARE_SCHEME_CALLBACK (calc_parent_alignment, (SCM)); - DECLARE_GROB_INTERFACE (); }; MAKE_SCHEME_CALLBACK (Clef_modifier, calc_parent_alignment, 1) diff --git a/lily/cluster-engraver.cc b/lily/cluster-engraver.cc index 8af3137f90..bb5ed0dc54 100644 --- a/lily/cluster-engraver.cc +++ b/lily/cluster-engraver.cc @@ -135,7 +135,7 @@ Cluster_spanner_engraver::stop_translation_timestep () void Cluster_spanner_engraver::acknowledge_note_column (Grob_info info) { - if (!beacon_ && Note_column::has_interface (info.grob ())) + if (!beacon_ && has_interface (info.grob ())) { finished_spanner_ = spanner_; spanner_ = 0; diff --git a/lily/cluster.cc b/lily/cluster.cc index 694da482a5..9c160fd8cc 100644 --- a/lily/cluster.cc +++ b/lily/cluster.cc @@ -228,7 +228,6 @@ struct Cluster_beacon { public: DECLARE_SCHEME_CALLBACK (height, (SCM)); - DECLARE_GROB_INTERFACE (); }; MAKE_SCHEME_CALLBACK (Cluster_beacon, height, 1); diff --git a/lily/collision-engraver.cc b/lily/collision-engraver.cc index d2cf95e1e8..35f8015a68 100644 --- a/lily/collision-engraver.cc +++ b/lily/collision-engraver.cc @@ -51,7 +51,7 @@ Collision_engraver::process_acknowledged () void Collision_engraver::acknowledge_note_column (Grob_info i) { - if (Note_column::has_interface (i.grob ())) + if (has_interface (i.grob ())) { /*should check Y axis? */ if (Note_column::has_rests (i.grob ()) || i.grob ()->get_parent (X_AXIS)) diff --git a/lily/dot-column.cc b/lily/dot-column.cc index b8f1663b10..7ac3140141 100644 --- a/lily/dot-column.cc +++ b/lily/dot-column.cc @@ -95,12 +95,12 @@ Dot_column::calc_positioning_done (SCM smob) Rest collisions should wait after line breaking. */ Interval y; - if (Rest::has_interface (s)) + if (has_interface (s)) { base_x.unite (s->extent (commonx, X_AXIS)); continue; } - else if (Stem::has_interface (s)) + else if (has_interface (s)) { Real y1 = Stem::head_positions (s)[-get_grob_direction (s)]; Real y2 = y1 + get_grob_direction (s) * 7; @@ -110,7 +110,7 @@ Dot_column::calc_positioning_done (SCM smob) stems.insert (s); } - else if (Note_head::has_interface (s)) + else if (has_interface (s)) y = Interval (-1.1, 1.1); else { @@ -200,7 +200,7 @@ Dot_column::calc_positioning_done (SCM smob) Grob *note = dots[i]->get_parent (Y_AXIS); if (note) { - if (Note_head::has_interface (note)) + if (has_interface (note)) dp.dir_ = to_dir (dp.dot_->get_property ("direction")); dp.x_extent_ = note->extent (commonx, X_AXIS); @@ -252,7 +252,7 @@ Dot_column::add_head (Grob *me, Grob *head) // correct X-offset of the dots for horizontal collision avoidance. // The translation here is undone in calc_positioning_done, where we // do the X-offset properly. - if (Rest::has_interface (head)) + if (has_interface (head)) d->translate_axis (head->extent (head, X_AXIS).length (), X_AXIS); else d->set_property ("X-offset", Grob::x_parent_positioning_proc); diff --git a/lily/dynamic-align-engraver.cc b/lily/dynamic-align-engraver.cc index 4a443dec5c..0abb39a7f2 100644 --- a/lily/dynamic-align-engraver.cc +++ b/lily/dynamic-align-engraver.cc @@ -80,7 +80,7 @@ Dynamic_align_engraver::create_line_spanner (Grob *cause) void Dynamic_align_engraver::acknowledge_end_dynamic (Grob_info info) { - if (Spanner::has_interface (info.grob ())) + if (has_interface (info.grob ())) ended_.push_back (info.spanner ()); /* If the break flag is set, store the current spanner and let new dynamics @@ -141,7 +141,7 @@ Dynamic_align_engraver::acknowledge_dynamic (Grob_info info) } create_line_spanner (info.grob ()); - if (Spanner::has_interface (info.grob ())) + if (has_interface (info.grob ())) { started_.push_back (info.spanner ()); current_dynamic_spanner_ = info.spanner (); diff --git a/lily/dynamic-engraver.cc b/lily/dynamic-engraver.cc index 4b51d90414..edfd35fcb5 100644 --- a/lily/dynamic-engraver.cc +++ b/lily/dynamic-engraver.cc @@ -179,11 +179,11 @@ Dynamic_engraver::process_music () } if (finished_spanner_) { - if (Hairpin::has_interface (finished_spanner_)) + if (has_interface (finished_spanner_)) Pointer_group_interface::add_grob (finished_spanner_, ly_symbol2scm ("adjacent-spanners"), current_spanner_); - if (Hairpin::has_interface (current_spanner_)) + if (has_interface (current_spanner_)) Pointer_group_interface::add_grob (current_spanner_, ly_symbol2scm ("adjacent-spanners"), finished_spanner_); diff --git a/lily/enclosing-bracket.cc b/lily/enclosing-bracket.cc index 57593649d3..dd551e3841 100644 --- a/lily/enclosing-bracket.cc +++ b/lily/enclosing-bracket.cc @@ -26,7 +26,6 @@ struct Enclosing_bracket { - DECLARE_GROB_INTERFACE (); public: DECLARE_SCHEME_CALLBACK (print, (SCM)); diff --git a/lily/figured-bass-continuation.cc b/lily/figured-bass-continuation.cc index 371c4d24ba..bb84bb3c3e 100644 --- a/lily/figured-bass-continuation.cc +++ b/lily/figured-bass-continuation.cc @@ -30,7 +30,6 @@ struct Figured_bass_continuation { - DECLARE_GROB_INTERFACE (); public: DECLARE_SCHEME_CALLBACK (print, (SCM)); diff --git a/lily/flag.cc b/lily/flag.cc index 7333bf299f..4b90be8be0 100644 --- a/lily/flag.cc +++ b/lily/flag.cc @@ -38,7 +38,6 @@ public: DECLARE_SCHEME_CALLBACK (calc_y_offset, (SCM)); DECLARE_SCHEME_CALLBACK (pure_calc_y_offset, (SCM, SCM, SCM)); DECLARE_SCHEME_CALLBACK (calc_x_offset, (SCM)); - DECLARE_GROB_INTERFACE (); static SCM internal_calc_y_offset (SCM smob, bool pure); }; diff --git a/lily/grob.cc b/lily/grob.cc index 83b78edac4..f7bf31f286 100644 --- a/lily/grob.cc +++ b/lily/grob.cc @@ -391,7 +391,7 @@ Grob::pure_relative_y_coordinate (Grob const *refp, int start, int end) if (Grob *p = get_parent (Y_AXIS)) { Real trans = 0; - if (Align_interface::has_interface (p) && !dim_cache_[Y_AXIS].offset_) + if (has_interface (p) && !dim_cache_[Y_AXIS].offset_) trans = Align_interface::get_pure_child_y_translation (p, this, start, end); return off + trans + p->pure_relative_y_coordinate (refp, start, end); @@ -638,7 +638,7 @@ get_maybe_root_vertical_alignment (Grob *g, Grob *maybe) { if (!g) return maybe; - if (Align_interface::has_interface (g)) + if (has_interface (g)) return get_maybe_root_vertical_alignment (g->get_parent (Y_AXIS), g); return get_maybe_root_vertical_alignment (g->get_parent (Y_AXIS), maybe); @@ -657,8 +657,8 @@ Grob::get_vertical_axis_group (Grob *g) return 0; if (!g->get_parent (Y_AXIS)) return 0; - if (Axis_group_interface::has_interface (g) - && Align_interface::has_interface (g->get_parent (Y_AXIS))) + if (has_interface (g) + && has_interface (g->get_parent (Y_AXIS))) return g; return get_vertical_axis_group (g->get_parent (Y_AXIS)); @@ -965,11 +965,11 @@ robust_relative_extent (Grob *me, Grob *refpoint, Axis a) bool Grob::check_cross_staff (Grob *commony) { - if (Align_interface::has_interface (commony)) + if (has_interface (commony)) return true; for (Grob *g = this; g && g != commony; g = g->get_parent (Y_AXIS)) - if (Align_interface::has_interface (g)) + if (has_interface (g)) return true; return false; diff --git a/lily/hairpin.cc b/lily/hairpin.cc index a083062e39..01d8fd93de 100644 --- a/lily/hairpin.cc +++ b/lily/hairpin.cc @@ -185,7 +185,7 @@ Hairpin::print (SCM smob) } else { - if (Text_interface::has_interface (b)) + if (has_interface (b)) { if (!e.is_empty ()) x_points[d] = e[-d] - d * padding; @@ -214,7 +214,7 @@ Hairpin::print (SCM smob) if (neighbor_found) { - if (Hairpin::has_interface (adjacent)) + if (has_interface (adjacent)) { /* Handle back-to-back hairpins with a circle in the middle @@ -237,7 +237,7 @@ Hairpin::print (SCM smob) else { if (d == RIGHT // end at the left edge of a rest - && Note_column::has_interface (b) + && has_interface (b) && Note_column::has_rests (b)) x_points[d] = e[-d]; else diff --git a/lily/include/accidental-interface.hh b/lily/include/accidental-interface.hh index f5c36c5583..ef5e07ea66 100644 --- a/lily/include/accidental-interface.hh +++ b/lily/include/accidental-interface.hh @@ -34,7 +34,6 @@ public: DECLARE_SCHEME_CALLBACK (height, (SCM)); DECLARE_SCHEME_CALLBACK (remove_tied, (SCM)); - DECLARE_GROB_INTERFACE (); static SCM get_stencil (Grob *me); }; diff --git a/lily/include/accidental-placement.hh b/lily/include/accidental-placement.hh index bb47efdb0a..4c362cbd93 100644 --- a/lily/include/accidental-placement.hh +++ b/lily/include/accidental-placement.hh @@ -35,7 +35,6 @@ public: vector *real_acc); DECLARE_SCHEME_CALLBACK (calc_positioning_done, (SCM)); - DECLARE_GROB_INTERFACE (); }; #endif /* ACCIDENTAL_PLACEMENT_HH */ diff --git a/lily/include/align-interface.hh b/lily/include/align-interface.hh index 66548410f4..612c31c0d5 100644 --- a/lily/include/align-interface.hh +++ b/lily/include/align-interface.hh @@ -40,7 +40,6 @@ public: static void add_element (Grob *, Grob *); static int get_count (Grob *, Grob *); - DECLARE_GROB_INTERFACE (); static Real get_pure_child_y_translation (Grob *, Grob *child, int start, int end); diff --git a/lily/include/arpeggio.hh b/lily/include/arpeggio.hh index 6a59b56000..4624529098 100644 --- a/lily/include/arpeggio.hh +++ b/lily/include/arpeggio.hh @@ -34,7 +34,6 @@ public: DECLARE_SCHEME_CALLBACK (brew_chord_slur, (SCM)); DECLARE_SCHEME_CALLBACK (width, (SCM)); DECLARE_SCHEME_CALLBACK (pure_height, (SCM, SCM, SCM)); - DECLARE_GROB_INTERFACE (); }; #endif /* ARPEGGIO_HH */ diff --git a/lily/include/axis-group-interface.hh b/lily/include/axis-group-interface.hh index 1987d9289b..5e5152d237 100644 --- a/lily/include/axis-group-interface.hh +++ b/lily/include/axis-group-interface.hh @@ -69,7 +69,6 @@ class Axis_group_interface static SCM calc_common (Grob *, Axis); static Real minimum_distance (Grob *, Grob *, Axis); static SCM calc_maybe_pure_staff_staff_spacing (Grob *, bool, int, int); - DECLARE_GROB_INTERFACE (); }; #endif /* AXIS_GROUP_INTERFACE_HH */ diff --git a/lily/include/bar-line.hh b/lily/include/bar-line.hh index 1a157f3c44..ef3739faf0 100644 --- a/lily/include/bar-line.hh +++ b/lily/include/bar-line.hh @@ -26,7 +26,6 @@ class Bar_line { public: - DECLARE_GROB_INTERFACE (); static bool non_empty_barline (Grob *me); }; diff --git a/lily/include/beam.hh b/lily/include/beam.hh index afa3a805ab..6dbdf4b23f 100644 --- a/lily/include/beam.hh +++ b/lily/include/beam.hh @@ -57,7 +57,6 @@ public: static int normal_stem_count (Grob *); static Grob *first_normal_stem (Grob *); static Grob *last_normal_stem (Grob *); - DECLARE_GROB_INTERFACE (); static void add_stem (Grob *, Grob *); static bool is_cross_staff (Grob *); static bool is_knee (Grob *); diff --git a/lily/include/break-align-interface.hh b/lily/include/break-align-interface.hh index 5eba16efee..cbb7f00c74 100644 --- a/lily/include/break-align-interface.hh +++ b/lily/include/break-align-interface.hh @@ -27,7 +27,6 @@ class Break_alignment_interface { public: static vector ordered_elements (Grob *me); - DECLARE_GROB_INTERFACE (); static void add_element (Grob *me, Grob *add); static SCM break_align_order (Item *me); DECLARE_SCHEME_CALLBACK (calc_positioning_done, (SCM element)); @@ -38,13 +37,11 @@ struct Break_aligned_interface DECLARE_SCHEME_CALLBACK (calc_average_anchor, (SCM)); DECLARE_SCHEME_CALLBACK (calc_extent_aligned_anchor, (SCM)); DECLARE_SCHEME_CALLBACK (calc_break_visibility, (SCM)); - DECLARE_GROB_INTERFACE (); }; struct Break_alignable_interface { DECLARE_SCHEME_CALLBACK (self_align_callback, (SCM element)); - DECLARE_GROB_INTERFACE (); }; #endif // BREAK_ALIGN_INTERFACE_HH diff --git a/lily/include/breathing-sign.hh b/lily/include/breathing-sign.hh index 5718bf2473..84b33cd1b3 100644 --- a/lily/include/breathing-sign.hh +++ b/lily/include/breathing-sign.hh @@ -27,7 +27,6 @@ public: DECLARE_SCHEME_CALLBACK (finalis, (SCM)); DECLARE_SCHEME_CALLBACK (offset_callback, (SCM element)); - DECLARE_GROB_INTERFACE (); }; #endif // BREATHING_SIGN_HH diff --git a/lily/include/chord-name.hh b/lily/include/chord-name.hh index 5a289e223f..0df71f2fb4 100644 --- a/lily/include/chord-name.hh +++ b/lily/include/chord-name.hh @@ -27,7 +27,6 @@ class Chord_name { public: DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM)); - DECLARE_GROB_INTERFACE (); }; #endif // CHORD_NAME_HH diff --git a/lily/include/clef.hh b/lily/include/clef.hh index 240086ce8b..8e3d10c0d3 100644 --- a/lily/include/clef.hh +++ b/lily/include/clef.hh @@ -27,7 +27,6 @@ struct Clef { DECLARE_SCHEME_CALLBACK (calc_glyph_name, (SCM)); DECLARE_SCHEME_CALLBACK (print, (SCM)); - DECLARE_GROB_INTERFACE (); }; #endif /* CLEF_HH */ diff --git a/lily/include/cluster.hh b/lily/include/cluster.hh index b9d6cf0e07..81aec746f9 100644 --- a/lily/include/cluster.hh +++ b/lily/include/cluster.hh @@ -28,7 +28,6 @@ class Cluster public: DECLARE_SCHEME_CALLBACK (print, (SCM)); DECLARE_SCHEME_CALLBACK (calc_cross_staff, (SCM)); - DECLARE_GROB_INTERFACE (); }; #endif // CLUSTER_HH diff --git a/lily/include/custos.hh b/lily/include/custos.hh index fcb9e9e146..ddf38b0b8a 100644 --- a/lily/include/custos.hh +++ b/lily/include/custos.hh @@ -26,7 +26,6 @@ struct Custos { DECLARE_SCHEME_CALLBACK (print, (SCM)); - DECLARE_GROB_INTERFACE (); private: static void add_streepjes (Grob *me, int pos, int interspaces, Stencil *custos_); diff --git a/lily/include/dot-column.hh b/lily/include/dot-column.hh index a816f426ae..6c975b1c56 100644 --- a/lily/include/dot-column.hh +++ b/lily/include/dot-column.hh @@ -34,7 +34,6 @@ public: static int compare (Grob *const &, Grob *const &); static void add_head (Grob *dotcol, Grob *rh); - DECLARE_GROB_INTERFACE (); DECLARE_SCHEME_CALLBACK (side_position, (SCM)); DECLARE_SCHEME_CALLBACK (calc_positioning_done, (SCM)); }; diff --git a/lily/include/dots.hh b/lily/include/dots.hh index fdd0673af9..7e1a1f6b52 100644 --- a/lily/include/dots.hh +++ b/lily/include/dots.hh @@ -27,7 +27,6 @@ class Dots { public: DECLARE_SCHEME_CALLBACK (print, (SCM)); - DECLARE_GROB_INTERFACE (); }; #endif // DOTS_HH diff --git a/lily/include/fingering-column.hh b/lily/include/fingering-column.hh index e7d47c0b43..f422da99eb 100644 --- a/lily/include/fingering-column.hh +++ b/lily/include/fingering-column.hh @@ -28,7 +28,6 @@ struct Fingering_column { static void add_fingering (Grob *, Grob *); DECLARE_SCHEME_CALLBACK (calc_positioning_done, (SCM)); - DECLARE_GROB_INTERFACE (); static void do_x_positioning (Grob *me); static void do_y_positioning (Grob *me); }; diff --git a/lily/include/font-interface.hh b/lily/include/font-interface.hh index 96b6b0b8d9..43fd271dd6 100644 --- a/lily/include/font-interface.hh +++ b/lily/include/font-interface.hh @@ -28,7 +28,6 @@ struct Font_interface static SCM text_font_alist_chain (Grob *); static SCM music_font_alist_chain (Grob *); static Font_metric *get_default_font (Grob *); - DECLARE_GROB_INTERFACE (); }; #endif /* FONT_INTERFACE_HH */ diff --git a/lily/include/gregorian-ligature.hh b/lily/include/gregorian-ligature.hh index b0cfd7afda..0089434163 100644 --- a/lily/include/gregorian-ligature.hh +++ b/lily/include/gregorian-ligature.hh @@ -27,7 +27,6 @@ class Grob; class Gregorian_ligature { public: - DECLARE_GROB_INTERFACE (); static string prefixes_to_str (Grob *); }; diff --git a/lily/include/grid-line-interface.hh b/lily/include/grid-line-interface.hh index 75ed7a7cdf..2a4760a717 100644 --- a/lily/include/grid-line-interface.hh +++ b/lily/include/grid-line-interface.hh @@ -29,13 +29,11 @@ public: static void add_grid_point (Grob *me, Grob *b); DECLARE_SCHEME_CALLBACK (print, (SCM)); DECLARE_SCHEME_CALLBACK (width, (SCM)); - DECLARE_GROB_INTERFACE (); }; class Grid_point_interface { public: - DECLARE_GROB_INTERFACE (); }; #endif /* GRID_LINE_INTERFACE_HH */ diff --git a/lily/include/grob-interface.hh b/lily/include/grob-interface.hh index 8590373a0a..9c3eadb4b0 100644 --- a/lily/include/grob-interface.hh +++ b/lily/include/grob-interface.hh @@ -24,20 +24,11 @@ class Grob; -// TODO: remove DECLARE_GROB_INTERFACE -#define DECLARE_GROB_INTERFACE() \ - static bool has_interface (Grob *g) - -// TODO: remove cl::has_interface and use ::has_interface directly #define ADD_INTERFACE(cl, b, c) \ Grob_interface cl ## _interface_initializer; \ template <> char const *Grob_interface::cxx_name_ (#cl); \ template <> char const *Grob_interface::description_ (b); \ - template <> char const *Grob_interface::variables_ (c); \ - bool cl::has_interface (Grob *me) \ - { \ - return ::has_interface (me); \ - } + template <> char const *Grob_interface::variables_ (c); SCM add_interface (char const *cxx_name, char const *descr, diff --git a/lily/include/grob.hh b/lily/include/grob.hh index 5ef3722766..db51e02e73 100644 --- a/lily/include/grob.hh +++ b/lily/include/grob.hh @@ -137,7 +137,6 @@ public: /* interfaces */ bool internal_has_interface (SCM intf); - DECLARE_GROB_INTERFACE (); /* offsets */ void translate_axis (Real, Axis); diff --git a/lily/include/hairpin.hh b/lily/include/hairpin.hh index 8807bc8cc8..a2e2f8bf9e 100644 --- a/lily/include/hairpin.hh +++ b/lily/include/hairpin.hh @@ -30,7 +30,6 @@ public: DECLARE_SCHEME_CALLBACK (print, (SCM)); DECLARE_SCHEME_CALLBACK (broken_bound_padding, (SCM)); DECLARE_SCHEME_CALLBACK (pure_height, (SCM, SCM, SCM)); - DECLARE_GROB_INTERFACE (); }; #endif // HAIRPIN_HH diff --git a/lily/include/hara-kiri-group-spanner.hh b/lily/include/hara-kiri-group-spanner.hh index b8ccba5bee..ad5c1d64a2 100644 --- a/lily/include/hara-kiri-group-spanner.hh +++ b/lily/include/hara-kiri-group-spanner.hh @@ -31,7 +31,6 @@ public: DECLARE_SCHEME_CALLBACK (calc_skylines, (SCM smob)); DECLARE_SCHEME_CALLBACK (pure_height, (SCM smob, SCM start, SCM end)); DECLARE_SCHEME_CALLBACK (force_hara_kiri_in_y_parent_callback, (SCM)); - DECLARE_GROB_INTERFACE (); static bool request_suicide (Grob *me, int start, int end); static bool request_suicide_alone (Grob *me, int start, int end); static void consider_suicide (Grob *me); diff --git a/lily/include/horizontal-bracket.hh b/lily/include/horizontal-bracket.hh index e2fbb22b09..3a1692fc11 100644 --- a/lily/include/horizontal-bracket.hh +++ b/lily/include/horizontal-bracket.hh @@ -31,7 +31,6 @@ struct Horizontal_bracket static Stencil make_enclosing_bracket (Grob *me, Grob *refpoint, vector grobs, Axis a, Direction dir); - DECLARE_GROB_INTERFACE (); }; #endif /* HORIZONTAL_BRACKET_HH */ diff --git a/lily/include/item.hh b/lily/include/item.hh index e987d89bca..07f1261a52 100644 --- a/lily/include/item.hh +++ b/lily/include/item.hh @@ -54,7 +54,6 @@ public: virtual Interval_t spanned_rank_interval () const; virtual Interval pure_y_extent (Grob *ref, int start, int end); virtual void cache_pure_height (Interval height); - DECLARE_GROB_INTERFACE (); protected: virtual void discretionary_processing (); void copy_breakable_items (); diff --git a/lily/include/kievan-ligature.hh b/lily/include/kievan-ligature.hh index a74387a89b..d3d425a515 100644 --- a/lily/include/kievan-ligature.hh +++ b/lily/include/kievan-ligature.hh @@ -26,7 +26,6 @@ struct Kievan_ligature { DECLARE_SCHEME_CALLBACK (print, (SCM)); - DECLARE_GROB_INTERFACE (); }; #endif /* KIEVAN_LIGATURE_HH */ diff --git a/lily/include/line-interface.hh b/lily/include/line-interface.hh index f45aca5b22..b805f7262a 100644 --- a/lily/include/line-interface.hh +++ b/lily/include/line-interface.hh @@ -26,7 +26,6 @@ struct Line_interface { static Stencil line (Grob *me, Offset from, Offset to); - DECLARE_GROB_INTERFACE (); static Stencil make_zigzag_line (Grob *me, Offset from, Offset to); diff --git a/lily/include/lyric-extender.hh b/lily/include/lyric-extender.hh index 88135421e4..8ae8c97553 100644 --- a/lily/include/lyric-extender.hh +++ b/lily/include/lyric-extender.hh @@ -27,7 +27,6 @@ class Lyric_extender { public: - DECLARE_GROB_INTERFACE (); DECLARE_SCHEME_CALLBACK (print, (SCM)); }; diff --git a/lily/include/lyric-hyphen.hh b/lily/include/lyric-hyphen.hh index 95418bc36a..fb03c6df51 100644 --- a/lily/include/lyric-hyphen.hh +++ b/lily/include/lyric-hyphen.hh @@ -27,7 +27,6 @@ struct Lyric_hyphen { public: DECLARE_SCHEME_CALLBACK (set_spacing_rods, (SCM)); - DECLARE_GROB_INTERFACE (); DECLARE_SCHEME_CALLBACK (print, (SCM)); }; diff --git a/lily/include/measure-grouping-spanner.hh b/lily/include/measure-grouping-spanner.hh index 44eb334b17..0e67f22822 100644 --- a/lily/include/measure-grouping-spanner.hh +++ b/lily/include/measure-grouping-spanner.hh @@ -28,7 +28,6 @@ class Measure_grouping public: DECLARE_SCHEME_CALLBACK (print, (SCM)); - DECLARE_GROB_INTERFACE (); }; #endif /* MEASURE_GROUPING_SPANNER_HH */ diff --git a/lily/include/melody-spanner.hh b/lily/include/melody-spanner.hh index 4609a4c90d..6ce6a2733b 100644 --- a/lily/include/melody-spanner.hh +++ b/lily/include/melody-spanner.hh @@ -26,7 +26,6 @@ class Melody_spanner { public: - DECLARE_GROB_INTERFACE (); static void add_stem (Grob *, Grob *); DECLARE_SCHEME_CALLBACK (calc_neutral_stem_direction, (SCM)); }; diff --git a/lily/include/mensural-ligature.hh b/lily/include/mensural-ligature.hh index 97b8e2e216..3e4e46a641 100644 --- a/lily/include/mensural-ligature.hh +++ b/lily/include/mensural-ligature.hh @@ -45,7 +45,6 @@ struct Mensural_ligature { DECLARE_SCHEME_CALLBACK (brew_ligature_primitive, (SCM)); DECLARE_SCHEME_CALLBACK (print, (SCM)); - DECLARE_GROB_INTERFACE (); }; #endif /* MENSURAL_LIGATURE_HH */ diff --git a/lily/include/multi-measure-rest.hh b/lily/include/multi-measure-rest.hh index bf3c7083a7..f4d379ade4 100644 --- a/lily/include/multi-measure-rest.hh +++ b/lily/include/multi-measure-rest.hh @@ -26,7 +26,6 @@ class Multi_measure_rest { public: - DECLARE_GROB_INTERFACE (); DECLARE_SCHEME_CALLBACK (print, (SCM)); DECLARE_SCHEME_CALLBACK (height, (SCM)); DECLARE_SCHEME_CALLBACK (percent, (SCM)); diff --git a/lily/include/note-collision.hh b/lily/include/note-collision.hh index fcdece0a59..ad2ed5345d 100644 --- a/lily/include/note-collision.hh +++ b/lily/include/note-collision.hh @@ -44,6 +44,5 @@ public: static Drul_array > get_clash_groups (Grob *me); DECLARE_SCHEME_CALLBACK (calc_positioning_done, (SCM smob)); static void add_column (Grob *me, Grob *ncol); - DECLARE_GROB_INTERFACE (); }; #endif // COLLISION_HH diff --git a/lily/include/note-column.hh b/lily/include/note-column.hh index cd09b076af..1cf08545bf 100644 --- a/lily/include/note-column.hh +++ b/lily/include/note-column.hh @@ -43,7 +43,6 @@ public: static bool has_rests (Grob *me); static Grob *dot_column (Grob *me); static Interval cross_staff_extent (Grob *me, Grob *refp); - DECLARE_GROB_INTERFACE (); static Item *get_stem (Grob *); static Item *get_flag (Grob *); diff --git a/lily/include/note-head.hh b/lily/include/note-head.hh index d14fbcfe77..1e167d58b2 100644 --- a/lily/include/note-head.hh +++ b/lily/include/note-head.hh @@ -30,7 +30,6 @@ public: DECLARE_SCHEME_CALLBACK (stem_x_shift, (SCM)); DECLARE_SCHEME_CALLBACK (calc_stem_attachment, (SCM)); DECLARE_SCHEME_CALLBACK (include_ledger_line_height, (SCM)); - DECLARE_GROB_INTERFACE (); static Real stem_attachment_coordinate (Grob *, Axis a); static int get_balltype (Grob *); diff --git a/lily/include/note-spacing.hh b/lily/include/note-spacing.hh index 7fde934f51..df063b382e 100644 --- a/lily/include/note-spacing.hh +++ b/lily/include/note-spacing.hh @@ -27,7 +27,6 @@ class Note_spacing { public: - DECLARE_GROB_INTERFACE (); static Spring get_spacing (Grob *me, Item *, Spring, Real); static void stem_dir_correction (Grob *me, Item *next_col, Real incr, diff --git a/lily/include/paper-column.hh b/lily/include/paper-column.hh index 03c503f9a8..f1cb01e740 100644 --- a/lily/include/paper-column.hh +++ b/lily/include/paper-column.hh @@ -50,7 +50,6 @@ public: DECLARE_SCHEME_CALLBACK (print, (SCM)); DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM)); - DECLARE_GROB_INTERFACE (); static int get_rank (Grob const *); static bool is_musical (Grob *); static Moment when_mom (Grob *); diff --git a/lily/include/percent-repeat-item.hh b/lily/include/percent-repeat-item.hh index 448b811034..85b1cdb446 100644 --- a/lily/include/percent-repeat-item.hh +++ b/lily/include/percent-repeat-item.hh @@ -26,7 +26,6 @@ class Percent_repeat_item_interface { public: - DECLARE_GROB_INTERFACE (); DECLARE_SCHEME_CALLBACK (beat_slash, (SCM)); DECLARE_SCHEME_CALLBACK (double_percent, (SCM)); static Stencil x_percent (Grob *, int); diff --git a/lily/include/pure-from-neighbor-interface.hh b/lily/include/pure-from-neighbor-interface.hh index ec53a97f47..f125d217e4 100644 --- a/lily/include/pure-from-neighbor-interface.hh +++ b/lily/include/pure-from-neighbor-interface.hh @@ -27,7 +27,6 @@ class Pure_from_neighbor_interface { public: DECLARE_SCHEME_CALLBACK (calc_pure_relevant_grobs, (SCM)); - DECLARE_GROB_INTERFACE (); }; diff --git a/lily/include/rest-collision.hh b/lily/include/rest-collision.hh index b9cfc17b8e..3946f9b933 100644 --- a/lily/include/rest-collision.hh +++ b/lily/include/rest-collision.hh @@ -28,7 +28,6 @@ class Rest_collision public: static void add_column (Grob *me, Grob *); - DECLARE_GROB_INTERFACE (); DECLARE_SCHEME_CALLBACK (calc_positioning_done, (SCM element)); DECLARE_SCHEME_CALLBACK (force_shift_callback_rest, (SCM element, SCM off)); static SCM do_shift (Grob *); diff --git a/lily/include/rest.hh b/lily/include/rest.hh index 548e031e55..644aa1450c 100644 --- a/lily/include/rest.hh +++ b/lily/include/rest.hh @@ -29,7 +29,6 @@ class Rest public: DECLARE_SCHEME_CALLBACK (y_offset_callback, (SCM)); DECLARE_SCHEME_CALLBACK (calc_cross_staff, (SCM)); - DECLARE_GROB_INTERFACE (); static string glyph_name (Grob *, int durlog, const string &style, bool, Real); static Real staff_position_internal (Grob *, int /* duration_log */, int /* dir */); diff --git a/lily/include/rhythmic-head.hh b/lily/include/rhythmic-head.hh index e7cb7cfc4a..17eecd4f22 100644 --- a/lily/include/rhythmic-head.hh +++ b/lily/include/rhythmic-head.hh @@ -32,7 +32,6 @@ public: static Item *get_dots (Grob *); static int dot_count (Grob *); DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM)); - DECLARE_GROB_INTERFACE (); }; #endif // RHYTHMIC_HEAD_HH diff --git a/lily/include/script-column.hh b/lily/include/script-column.hh index 51f2eb9206..fe4816eae1 100644 --- a/lily/include/script-column.hh +++ b/lily/include/script-column.hh @@ -30,7 +30,6 @@ public: static void add_side_positioned (Grob *, Grob *); DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM)); DECLARE_SCHEME_CALLBACK (row_before_line_breaking, (SCM)); - DECLARE_GROB_INTERFACE (); static void order_grobs (vector grobs); }; diff --git a/lily/include/script-interface.hh b/lily/include/script-interface.hh index 2839010b0d..9154aea6cc 100644 --- a/lily/include/script-interface.hh +++ b/lily/include/script-interface.hh @@ -34,7 +34,6 @@ public: static Stencil get_stencil (Grob *, Direction d); static Direction get_direction (Grob *); - DECLARE_GROB_INTERFACE (); DECLARE_SCHEME_CALLBACK (print, (SCM)); DECLARE_SCHEME_CALLBACK (calc_direction, (SCM)); DECLARE_SCHEME_CALLBACK (calc_positioning_done, (SCM)); diff --git a/lily/include/self-alignment-interface.hh b/lily/include/self-alignment-interface.hh index ffdfb82501..4cf683fd36 100644 --- a/lily/include/self-alignment-interface.hh +++ b/lily/include/self-alignment-interface.hh @@ -25,7 +25,6 @@ struct Self_alignment_interface { - DECLARE_GROB_INTERFACE (); static SCM aligned_on_self (Grob *me, Axis a, bool pure, int start, int end); static SCM centered_on_object (Grob *me, Axis a); diff --git a/lily/include/semi-tie-column.hh b/lily/include/semi-tie-column.hh index 7ad63e80d1..e02b57a11e 100644 --- a/lily/include/semi-tie-column.hh +++ b/lily/include/semi-tie-column.hh @@ -26,7 +26,6 @@ struct Semi_tie_column { - DECLARE_GROB_INTERFACE (); DECLARE_SCHEME_CALLBACK (calc_positioning_done, (SCM)); DECLARE_SCHEME_CALLBACK (calc_head_direction, (SCM)); diff --git a/lily/include/semi-tie.hh b/lily/include/semi-tie.hh index 97a3dcbe04..1e8db8bdb8 100644 --- a/lily/include/semi-tie.hh +++ b/lily/include/semi-tie.hh @@ -25,7 +25,6 @@ struct Semi_tie { - DECLARE_GROB_INTERFACE (); DECLARE_SCHEME_CALLBACK (calc_control_points, (SCM)); static bool less (Grob *s1, Grob *s2); diff --git a/lily/include/separation-item.hh b/lily/include/separation-item.hh index f78fd0d6a9..81ea523fe2 100644 --- a/lily/include/separation-item.hh +++ b/lily/include/separation-item.hh @@ -27,7 +27,6 @@ struct Separation_item { - DECLARE_GROB_INTERFACE (); DECLARE_SCHEME_CALLBACK (calc_skylines, (SCM)); DECLARE_SCHEME_CALLBACK (print, (SCM)); diff --git a/lily/include/side-position-interface.hh b/lily/include/side-position-interface.hh index c98189f087..c0330e795d 100644 --- a/lily/include/side-position-interface.hh +++ b/lily/include/side-position-interface.hh @@ -42,7 +42,6 @@ public: static Axis get_axis (Grob *); static void set_axis (Grob *, Axis); - DECLARE_GROB_INTERFACE (); static void add_support (Grob *, Grob *); static void recursive_add_support (Grob *, Grob *); static void add_staff_support (Grob *); diff --git a/lily/include/slur.hh b/lily/include/slur.hh index 000c07dce8..ae85ac24d3 100644 --- a/lily/include/slur.hh +++ b/lily/include/slur.hh @@ -41,7 +41,6 @@ public: DECLARE_SCHEME_CALLBACK (pure_outside_slur_callback, (SCM, SCM, SCM, SCM)); DECLARE_SCHEME_CALLBACK (outside_slur_cross_staff, (SCM, SCM)); DECLARE_SCHEME_CALLBACK (calc_cross_staff, (SCM)); - DECLARE_GROB_INTERFACE (); static Bezier get_curve (Grob *me); }; diff --git a/lily/include/spaceable-grob.hh b/lily/include/spaceable-grob.hh index ba219c28a9..5c6427e658 100644 --- a/lily/include/spaceable-grob.hh +++ b/lily/include/spaceable-grob.hh @@ -31,7 +31,6 @@ struct Spaceable_grob static void add_spring (Grob *me, Grob *to, Spring sp); static Spring get_spring (Grob *me, Grob *other); - DECLARE_GROB_INTERFACE (); static SCM get_minimum_distances (Grob *); static SCM get_ideal_distances (Grob *); }; diff --git a/lily/include/spacing-interface.hh b/lily/include/spacing-interface.hh index 2ade005a22..ddfe2efb1c 100644 --- a/lily/include/spacing-interface.hh +++ b/lily/include/spacing-interface.hh @@ -32,7 +32,6 @@ struct Spacing_interface static Drul_array skylines (Grob *me, Grob *right_col); static Grob *extremal_break_aligned_grob (Grob *me, Direction, Direction, Interval *); - DECLARE_GROB_INTERFACE (); }; #endif /* SPACING_INTERFACE_HH */ diff --git a/lily/include/spacing-spanner.hh b/lily/include/spacing-spanner.hh index 61ed8dc4ac..fcfba90417 100644 --- a/lily/include/spacing-spanner.hh +++ b/lily/include/spacing-spanner.hh @@ -50,7 +50,6 @@ public: DECLARE_SCHEME_CALLBACK (set_springs, (SCM)); DECLARE_SCHEME_CALLBACK (calc_common_shortest_duration, (SCM)); - DECLARE_GROB_INTERFACE (); }; #endif /* SPACING_SPANNER_HH */ diff --git a/lily/include/spanner.hh b/lily/include/spanner.hh index 7ee27abcb1..79032dfb30 100644 --- a/lily/include/spanner.hh +++ b/lily/include/spanner.hh @@ -76,7 +76,6 @@ public: static bool less (Spanner *const &, Spanner *const &); virtual Grob *find_broken_piece (System *) const; virtual void derived_mark () const; - DECLARE_GROB_INTERFACE (); virtual System *get_system () const; SCM get_cached_pure_property (SCM sym, int start, int end); diff --git a/lily/include/staff-grouper-interface.hh b/lily/include/staff-grouper-interface.hh index 3ad0ccf568..0e00d4280f 100644 --- a/lily/include/staff-grouper-interface.hh +++ b/lily/include/staff-grouper-interface.hh @@ -25,7 +25,6 @@ class Staff_grouper_interface { public: - DECLARE_GROB_INTERFACE (); static bool maybe_pure_within_group (Grob *, Grob *child, bool, int, int); }; diff --git a/lily/include/staff-spacing.hh b/lily/include/staff-spacing.hh index 521be99d19..11a81a998e 100644 --- a/lily/include/staff-spacing.hh +++ b/lily/include/staff-spacing.hh @@ -30,7 +30,6 @@ class Staff_spacing static Real next_notes_correction (Grob *, Grob *); public: - DECLARE_GROB_INTERFACE (); static Spring get_spacing (Grob *, Grob *, Real); static Interval bar_y_positions (Grob *); }; diff --git a/lily/include/staff-symbol-referencer.hh b/lily/include/staff-symbol-referencer.hh index 3c5f55b836..64d41014d7 100644 --- a/lily/include/staff-symbol-referencer.hh +++ b/lily/include/staff-symbol-referencer.hh @@ -30,7 +30,6 @@ class Staff_symbol_referencer { public: - DECLARE_GROB_INTERFACE (); static bool ugly_hack (Grob *); static void set_position (Grob *, Real); static void pure_set_position (Grob *, Real); diff --git a/lily/include/staff-symbol.hh b/lily/include/staff-symbol.hh index 19e826d3d0..9454ebe7f4 100644 --- a/lily/include/staff-symbol.hh +++ b/lily/include/staff-symbol.hh @@ -40,6 +40,5 @@ public: static Interval line_span (Grob *); DECLARE_SCHEME_CALLBACK (print, (SCM)); DECLARE_SCHEME_CALLBACK (height, (SCM)); - DECLARE_GROB_INTERFACE (); }; #endif // STAFF_SYMBOL_HH diff --git a/lily/include/stem-tremolo.hh b/lily/include/stem-tremolo.hh index 2495bb695a..ead984dc38 100644 --- a/lily/include/stem-tremolo.hh +++ b/lily/include/stem-tremolo.hh @@ -27,7 +27,6 @@ class Stem_tremolo { public: - DECLARE_GROB_INTERFACE (); DECLARE_SCHEME_CALLBACK (calc_slope, (SCM)); DECLARE_SCHEME_CALLBACK (calc_width, (SCM)); DECLARE_SCHEME_CALLBACK (calc_y_offset, (SCM)); diff --git a/lily/include/stem.hh b/lily/include/stem.hh index 0aeb83ee6a..7c4612552a 100644 --- a/lily/include/stem.hh +++ b/lily/include/stem.hh @@ -58,7 +58,6 @@ public: static Real internal_calc_stem_end_position (Grob *, bool); static Real internal_calc_stem_begin_position (Grob *, bool); - DECLARE_GROB_INTERFACE (); static void set_spacing_hints (Grob *); static Grob *flag (Grob *); diff --git a/lily/include/system-start-delimiter.hh b/lily/include/system-start-delimiter.hh index 3e1848c530..bf1fd0d28c 100644 --- a/lily/include/system-start-delimiter.hh +++ b/lily/include/system-start-delimiter.hh @@ -31,7 +31,6 @@ class System_start_delimiter public: DECLARE_SCHEME_CALLBACK (print, (SCM)); - DECLARE_GROB_INTERFACE (); static void try_collapse (Grob *); static Stencil staff_bracket (Grob *, Real); static Stencil old_staff_bracket (Grob *, Real); diff --git a/lily/include/system.hh b/lily/include/system.hh index 84b39bd02f..4e402ffeca 100644 --- a/lily/include/system.hh +++ b/lily/include/system.hh @@ -74,7 +74,6 @@ public: int spanner_count () const; void break_into_pieces (vector const &); - DECLARE_GROB_INTERFACE (); vector broken_col_range (Item const *, Item const *) const; vector used_columns () const; diff --git a/lily/include/text-interface.hh b/lily/include/text-interface.hh index f8f86d6f33..c653495be8 100644 --- a/lily/include/text-interface.hh +++ b/lily/include/text-interface.hh @@ -30,7 +30,6 @@ public: DECLARE_SCHEME_CALLBACK (print, (SCM)); DECLARE_SCHEME_CALLBACK (interpret_markup, (SCM, SCM, SCM)); DECLARE_SCHEME_CALLBACK (interpret_string, (SCM, SCM, SCM)); - DECLARE_GROB_INTERFACE (); static bool is_markup (SCM); static bool is_markup_list (SCM); }; diff --git a/lily/include/tie-column.hh b/lily/include/tie-column.hh index 0485cd0bcf..025cf8433a 100644 --- a/lily/include/tie-column.hh +++ b/lily/include/tie-column.hh @@ -26,7 +26,6 @@ class Tie_column { public: - DECLARE_GROB_INTERFACE (); static void add_tie (Grob *me, Spanner *); DECLARE_SCHEME_CALLBACK (calc_positioning_done, (SCM)); DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM)); diff --git a/lily/include/tie.hh b/lily/include/tie.hh index 186c0a4d38..e92ca61947 100644 --- a/lily/include/tie.hh +++ b/lily/include/tie.hh @@ -28,7 +28,6 @@ class Tie { public: static void set_head (Spanner *, Direction, Grob *head); - DECLARE_GROB_INTERFACE (); static Item *head (Spanner *, Direction); static int get_column_rank (Spanner *, Direction); static int get_position (Spanner *); diff --git a/lily/include/tuplet-bracket.hh b/lily/include/tuplet-bracket.hh index 72daae4da9..1e41154fbf 100644 --- a/lily/include/tuplet-bracket.hh +++ b/lily/include/tuplet-bracket.hh @@ -34,7 +34,6 @@ public: DECLARE_SCHEME_CALLBACK (calc_connect_to_neighbors, (SCM smob)); DECLARE_SCHEME_CALLBACK (calc_cross_staff, (SCM)); - DECLARE_GROB_INTERFACE (); static Grob *get_common_x (Spanner *); static void add_tuplet_bracket (Grob *me, Grob *smaller_bracket); static void get_bounds (Grob *, Grob **, Grob **); diff --git a/lily/include/tuplet-number.hh b/lily/include/tuplet-number.hh index 9780beefb2..24ba77a377 100644 --- a/lily/include/tuplet-number.hh +++ b/lily/include/tuplet-number.hh @@ -30,7 +30,6 @@ struct Tuplet_number DECLARE_SCHEME_CALLBACK (calc_x_offset, (SCM)); DECLARE_SCHEME_CALLBACK (calc_y_offset, (SCM)); DECLARE_SCHEME_CALLBACK (calc_cross_staff, (SCM)); - DECLARE_GROB_INTERFACE (); static Real calc_offset (Spanner *me, Axis a); // not used diff --git a/lily/include/vaticana-ligature.hh b/lily/include/vaticana-ligature.hh index 912b54dece..25e994753f 100644 --- a/lily/include/vaticana-ligature.hh +++ b/lily/include/vaticana-ligature.hh @@ -27,7 +27,6 @@ struct Vaticana_ligature { DECLARE_SCHEME_CALLBACK (brew_ligature_primitive, (SCM)); DECLARE_SCHEME_CALLBACK (print, (SCM)); - DECLARE_GROB_INTERFACE (); }; /* diff --git a/lily/include/volta-bracket.hh b/lily/include/volta-bracket.hh index 1a934d4a4a..ffde225d2f 100644 --- a/lily/include/volta-bracket.hh +++ b/lily/include/volta-bracket.hh @@ -26,7 +26,6 @@ class Volta_bracket_interface { public: - DECLARE_GROB_INTERFACE (); DECLARE_SCHEME_CALLBACK (print, (SCM)); static void modify_edge_height (Spanner *); static void add_bar (Grob *me, Item *bar); diff --git a/lily/instrument-name-engraver.cc b/lily/instrument-name-engraver.cc index 8b1a4c3003..d339fbce61 100644 --- a/lily/instrument-name-engraver.cc +++ b/lily/instrument-name-engraver.cc @@ -133,7 +133,7 @@ Instrument_name_engraver::acknowledge_axis_group (Grob_info info) && !info.grob ()->internal_has_interface (ly_symbol2scm ("dynamic-interface")) && !info.grob ()->internal_has_interface (ly_symbol2scm ("piano-pedal-interface")) && !info.grob ()->internal_has_interface (ly_symbol2scm ("volta-interface")) - && (!Align_interface::has_interface (info.grob ()))) + && (!has_interface (info.grob ()))) { if (Page_layout_problem::is_spaceable (info.grob ())) axis_groups_.push_back (info.grob ()); diff --git a/lily/key-signature-interface.cc b/lily/key-signature-interface.cc index 56af49da39..3249a736c3 100644 --- a/lily/key-signature-interface.cc +++ b/lily/key-signature-interface.cc @@ -32,7 +32,6 @@ struct Key_signature_interface { DECLARE_SCHEME_CALLBACK (print, (SCM)); - DECLARE_GROB_INTERFACE (); }; /* diff --git a/lily/ledger-line-spanner.cc b/lily/ledger-line-spanner.cc index 5cb5462351..b0e8fee3c2 100644 --- a/lily/ledger-line-spanner.cc +++ b/lily/ledger-line-spanner.cc @@ -32,7 +32,6 @@ struct Ledger_line_spanner { DECLARE_SCHEME_CALLBACK (print, (SCM)); DECLARE_SCHEME_CALLBACK (set_spacing_rods, (SCM)); - DECLARE_GROB_INTERFACE (); }; static void @@ -339,7 +338,6 @@ ADD_INTERFACE (Ledger_line_spanner, struct Ledgered_interface { - DECLARE_GROB_INTERFACE (); }; ADD_INTERFACE (Ledgered_interface, diff --git a/lily/line-spanner.cc b/lily/line-spanner.cc index be20f25d98..925e578e35 100644 --- a/lily/line-spanner.cc +++ b/lily/line-spanner.cc @@ -43,12 +43,11 @@ public: DECLARE_SCHEME_CALLBACK (calc_left_bound_info_and_text, (SCM)); DECLARE_SCHEME_CALLBACK (calc_right_bound_info, (SCM)); DECLARE_SCHEME_CALLBACK (calc_bound_info, (SCM, Direction)); - DECLARE_GROB_INTERFACE (); }; Spanner *parent_spanner (Grob *g) { - if (Spanner::has_interface (g)) + if (has_interface (g)) return dynamic_cast (g); return parent_spanner (g->get_parent (Y_AXIS)); } @@ -110,7 +109,7 @@ Line_spanner::calc_bound_info (SCM smob, Direction dir) ? columns[0] : columns.back (); } - Real x_coord = (Paper_column::has_interface (bound_grob) + Real x_coord = (has_interface (bound_grob) ? Axis_group_interface::generic_bound_extent (bound_grob, commonx, X_AXIS) : robust_relative_extent (bound_grob, commonx, X_AXIS)).linear_combination (attach); diff --git a/lily/lyric-engraver.cc b/lily/lyric-engraver.cc index bc576bf3cc..cdee61517e 100644 --- a/lily/lyric-engraver.cc +++ b/lily/lyric-engraver.cc @@ -158,7 +158,7 @@ get_current_note_head (Context *voice) // here. Not with this mechanism. if ((*end_mom == end_from_now) && dynamic_cast (g) - && Note_head::has_interface (g)) + && has_interface (g)) { return g; } diff --git a/lily/note-collision.cc b/lily/note-collision.cc index 0ef6b7b4e0..f98cb5a3a0 100644 --- a/lily/note-collision.cc +++ b/lily/note-collision.cc @@ -309,14 +309,14 @@ check_meshing_chords (Grob *me, { Grob *d = unsmob (head_up->get_object ("dot")); Grob *parent = d->get_parent (X_AXIS); - if (Dot_column::has_interface (parent)) + if (has_interface (parent)) Side_position_interface::add_support (parent, head_down); } else if (Rhythmic_head::dot_count (head_down)) { Grob *d = unsmob (head_down->get_object ("dot")); Grob *parent = d->get_parent (X_AXIS); - if (Dot_column::has_interface (parent)) + if (has_interface (parent)) { Grob *stem = unsmob (head_up->get_object ("stem")); // Loop over all heads on an up-pointing-stem to see if dots @@ -433,7 +433,7 @@ Note_collision_interface::get_clash_groups (Grob *me) for (vsize i = 0; i < elements.size (); i++) { Grob *se = elements[i]; - if (Note_column::has_interface (se)) + if (has_interface (se)) { if (!Note_column::dir (se)) se->programming_error ("note-column has no direction"); diff --git a/lily/note-column.cc b/lily/note-column.cc index a5da30a8c7..1d79fee652 100644 --- a/lily/note-column.cc +++ b/lily/note-column.cc @@ -98,7 +98,7 @@ Direction Note_column::dir (Grob *me) { Grob *stem = unsmob (me->get_object ("stem")); - if (stem && Stem::has_interface (stem)) + if (has_interface (stem)) return get_grob_direction (stem); else { @@ -107,7 +107,7 @@ Note_column::dir (Grob *me) return (Direction)sign (head_positions_interval (me).center ()); } - if (Note_column::has_interface (me)) + if (has_interface (me)) programming_error ("Note_column without heads and stem"); else programming_error ("dir() given grob without Note_column interface"); @@ -131,7 +131,7 @@ void Note_column::add_head (Grob *me, Grob *h) { bool both = false; - if (Rest::has_interface (h)) + if (has_interface (h)) { extract_grob_set (me, "note-heads", heads); if (heads.size ()) @@ -139,7 +139,7 @@ Note_column::add_head (Grob *me, Grob *h) else me->set_object ("rest", h->self_scm ()); } - else if (Note_head::has_interface (h)) + else if (has_interface (h)) { if (unsmob (me->get_object ("rest"))) both = true; @@ -205,7 +205,7 @@ Note_column::accidentals (Grob *me) if (!acc) return 0; - if (Accidental_placement::has_interface (acc->get_parent (X_AXIS))) + if (has_interface (acc->get_parent (X_AXIS))) return acc->get_parent (X_AXIS); /* compatibility. */ diff --git a/lily/note-spacing.cc b/lily/note-spacing.cc index 91859fb6ec..a894be2539 100644 --- a/lily/note-spacing.cc +++ b/lily/note-spacing.cc @@ -228,7 +228,7 @@ Note_spacing::stem_dir_correction (Grob *me, Item *rcolumn, for (vsize i = 0; i < items.size (); i++) { Item *it = dynamic_cast (items[i]); - if (!Note_column::has_interface (it)) + if (!has_interface (it)) continue; if (d == RIGHT && it->get_column () != rcolumn) continue; diff --git a/lily/ottava-bracket.cc b/lily/ottava-bracket.cc index 5e962a6bb3..63a9d3ebca 100644 --- a/lily/ottava-bracket.cc +++ b/lily/ottava-bracket.cc @@ -35,7 +35,6 @@ struct Ottava_bracket { DECLARE_SCHEME_CALLBACK (print, (SCM)); - DECLARE_GROB_INTERFACE (); }; /* @@ -61,7 +60,7 @@ Ottava_bracket::print (SCM smob) Item *b = me->get_bound (d); broken[d] = (b->break_status_dir () != CENTER); - if (Note_column::has_interface (b)) + if (has_interface (b)) { extract_grob_set (b, "note-heads", heads); common = common_refpoint_of_array (heads, common, X_AXIS); @@ -94,7 +93,7 @@ Ottava_bracket::print (SCM smob) Item *b = me->get_bound (d); Interval ext; - if (Note_column::has_interface (b)) + if (has_interface (b)) { extract_grob_set (b, "note-heads", heads); for (vsize i = 0; i < heads.size (); i++) diff --git a/lily/page-layout-problem.cc b/lily/page-layout-problem.cc index 3f4fca05f1..8f1951223c 100644 --- a/lily/page-layout-problem.cc +++ b/lily/page-layout-problem.cc @@ -1232,7 +1232,7 @@ Page_layout_problem::filter_dead_elements (vector const &input) vector output; for (vsize i = 0; i < input.size (); ++i) { - if (Hara_kiri_group_spanner::has_interface (input[i])) + if (has_interface (input[i])) Hara_kiri_group_spanner::consider_suicide (input[i]); if (input[i]->is_live ()) diff --git a/lily/paper-column-engraver.cc b/lily/paper-column-engraver.cc index 334861844c..7c44f173d7 100644 --- a/lily/paper-column-engraver.cc +++ b/lily/paper-column-engraver.cc @@ -241,10 +241,10 @@ Paper_column_engraver::stop_translation_timestep () if (!unsmob (elem->get_object ("axis-group-parent-X"))) elem->set_object ("axis-group-parent-X", col->self_scm ()); - if (Accidental_placement::has_interface (elem) - || Arpeggio::has_interface (elem)) + if (has_interface (elem) + || has_interface (elem)) Separation_item::add_conditional_item (col, elem); - else if (!Accidental_interface::has_interface (elem)) + else if (!has_interface (elem)) Separation_item::add_item (col, elem); } items_.clear (); diff --git a/lily/paper-column.cc b/lily/paper-column.cc index d907acdf24..3ea5a89f05 100644 --- a/lily/paper-column.cc +++ b/lily/paper-column.cc @@ -203,7 +203,7 @@ Paper_column::break_align_width (Grob *me, SCM align_syms) (me, ly_symbol2scm ("elements"), (scm_is_eq (align_sym, ly_symbol2scm ("staff-bar")) ? Bar_line::non_empty_barline - : Break_alignment_interface::has_interface)); + : has_interface)); else { extract_grob_set (me, "elements", elts); @@ -440,7 +440,7 @@ Paper_column::is_extraneous_column_from_ligature (Grob *me) bool has_notehead = false; for (vsize i = 0; i < elts.size (); i++) { - if (Rhythmic_head::has_interface (elts[i])) + if (has_interface (elts[i])) { has_notehead = true; if (dynamic_cast (elts[i])->get_column () == me) diff --git a/lily/piano-pedal-bracket.cc b/lily/piano-pedal-bracket.cc index f58a130f75..b47e5e3b6d 100644 --- a/lily/piano-pedal-bracket.cc +++ b/lily/piano-pedal-bracket.cc @@ -26,7 +26,6 @@ struct Piano_pedal_bracket { DECLARE_SCHEME_CALLBACK (print, (SCM)); - DECLARE_GROB_INTERFACE (); }; MAKE_SCHEME_CALLBACK (Piano_pedal_bracket, print, 1); diff --git a/lily/pure-from-neighbor-engraver.cc b/lily/pure-from-neighbor-engraver.cc index 7061a92684..e073785006 100644 --- a/lily/pure-from-neighbor-engraver.cc +++ b/lily/pure-from-neighbor-engraver.cc @@ -46,7 +46,7 @@ Pure_from_neighbor_engraver::Pure_from_neighbor_engraver () void Pure_from_neighbor_engraver::acknowledge_item (Grob_info i) { - if (!Pure_from_neighbor_interface::has_interface (i.item ())) + if (!has_interface (i.item ())) pure_relevants_.push_back (i.item ()); } diff --git a/lily/rest-collision-engraver.cc b/lily/rest-collision-engraver.cc index 20e7eb9fc7..e261502201 100644 --- a/lily/rest-collision-engraver.cc +++ b/lily/rest-collision-engraver.cc @@ -62,7 +62,7 @@ Rest_collision_engraver::process_acknowledged () if (!g || !m) continue; - if (Rhythmic_head::has_interface (g) && (*m) > now) + if (has_interface (g) && (*m) > now) { Grob *column = g->get_parent (X_AXIS); if (!column) @@ -70,7 +70,7 @@ Rest_collision_engraver::process_acknowledged () // Only include rests that start now. Include notes that started any time. Paper_column *paper_column = dynamic_cast (column)->get_column (); - if (!Rest::has_interface (g) || !paper_column || Paper_column::when_mom (paper_column) == now) + if (!has_interface (g) || !paper_column || Paper_column::when_mom (paper_column) == now) { columns.insert (column); rest_count += Note_column::has_rests (column); diff --git a/lily/rest-collision.cc b/lily/rest-collision.cc index 300dcfc3c4..536ced40e5 100644 --- a/lily/rest-collision.cc +++ b/lily/rest-collision.cc @@ -52,7 +52,7 @@ Rest_collision::force_shift_callback_rest (SCM rest, SCM offset) if (scm_is_number (offset)) rest_grob->translate_axis (scm_to_double (offset), Y_AXIS); - if (Note_column::has_interface (parent) && Note_column::has_rests (parent)) + if (has_interface (parent) && Note_column::has_rests (parent)) { Grob *collision = unsmob (parent->get_object ("rest-collision")); @@ -109,7 +109,7 @@ Rest_collision::calc_positioning_done (SCM smob) for (vsize i = 0; i < elts.size (); i++) { Grob *e = elts[i]; - if (Note_column::has_interface (e)) + if (has_interface (e)) { if (unsmob (e->get_object ("rest"))) rests.push_back (e); diff --git a/lily/script-column.cc b/lily/script-column.cc index 3a288dac72..94aa8908e7 100644 --- a/lily/script-column.cc +++ b/lily/script-column.cc @@ -72,8 +72,8 @@ Script_column::row_before_line_breaking (SCM smob) /* Don't want to consider scripts horizontally next to notes. */ - if (Accidental_placement::has_interface (sc) - || Arpeggio::has_interface (sc)) + if (has_interface (sc) + || has_interface (sc)) { affect_all_grobs.push_back (sc); } diff --git a/lily/script-interface.cc b/lily/script-interface.cc index eaba157f34..24fe4dc082 100644 --- a/lily/script-interface.cc +++ b/lily/script-interface.cc @@ -131,7 +131,6 @@ Script_interface::print (SCM smob) struct Text_script { - DECLARE_GROB_INTERFACE (); }; ADD_INTERFACE (Text_script, diff --git a/lily/script-row-engraver.cc b/lily/script-row-engraver.cc index dc81f38b7f..35b5038020 100644 --- a/lily/script-row-engraver.cc +++ b/lily/script-row-engraver.cc @@ -56,7 +56,7 @@ Script_row_engraver::stop_translation_timestep () if (script_row_) { for (vsize i = 0; i < scripts_.size (); i++) - if (Accidental_placement::has_interface (scripts_[i]) + if (has_interface (scripts_[i]) || Side_position_interface::get_axis (scripts_[i]) == X_AXIS) Script_column::add_side_positioned (script_row_, scripts_[i]); } diff --git a/lily/self-alignment-interface.cc b/lily/self-alignment-interface.cc index 49b4125364..512f970e0e 100644 --- a/lily/self-alignment-interface.cc +++ b/lily/self-alignment-interface.cc @@ -104,7 +104,7 @@ Self_alignment_interface::aligned_on_parent (Grob *me, Axis a) { Grob *him = me->get_parent (a); Interval he; - if (Paper_column::has_interface (him)) + if (has_interface (him)) /* PaperColumn extents aren't reliable (they depend on size and alignment of PaperColumn's children), so we align on NoteColumn instead. @@ -115,7 +115,7 @@ Self_alignment_interface::aligned_on_parent (Grob *me, Axis a) else { if (to_boolean (me->get_property ("X-align-on-main-noteheads")) - && Note_column::has_interface (him)) + && has_interface (him)) he = Note_column::calc_main_extent(him); else he = him->extent (him, a); diff --git a/lily/semi-tie.cc b/lily/semi-tie.cc index 049cd029d6..0669c277f7 100644 --- a/lily/semi-tie.cc +++ b/lily/semi-tie.cc @@ -60,7 +60,7 @@ Semi_tie::calc_control_points (SCM smob) (void) me->get_property ("direction"); Grob *yparent = me->get_parent (Y_AXIS); - if (Semi_tie_column::has_interface (yparent)) + if (has_interface (yparent)) { /* trigger positioning. */ yparent->get_property ("positioning-done"); diff --git a/lily/separating-line-group-engraver.cc b/lily/separating-line-group-engraver.cc index 5355f5cc43..08069afda8 100644 --- a/lily/separating-line-group-engraver.cc +++ b/lily/separating-line-group-engraver.cc @@ -78,7 +78,7 @@ Separating_line_group_engraver::acknowledge_item (Grob_info i) { Item *it = i.item (); - if (Note_spacing::has_interface (it)) + if (has_interface (it)) { current_spacings_.note_spacings_.push_back (it); return; diff --git a/lily/separation-item.cc b/lily/separation-item.cc index 01490fa1a0..e29b8a9129 100644 --- a/lily/separation-item.cc +++ b/lily/separation-item.cc @@ -129,7 +129,7 @@ Separation_item::boxes (Grob *me, Grob *left) vector other_elts; // for now only arpeggios for (vsize i = 0; i < read_only_elts.size (); i++) { - if (Accidental_placement::has_interface (read_only_elts[i])) + if (has_interface (read_only_elts[i])) accidental_elts.push_back (read_only_elts[i]); else other_elts.push_back (read_only_elts[i]); @@ -153,8 +153,8 @@ Separation_item::boxes (Grob *me, Grob *left) bounds all of them). However, we can't exclude an axis-group that adds to its childrens' stencil. Currently, this is just TrillPitchGroup; hence the check for note-head-interface. */ - if (Axis_group_interface::has_interface (il) - && !Note_head::has_interface (il)) + if (has_interface (il) + && !has_interface (il)) continue; Interval y (il->pure_y_extent (ycommon, 0, very_large)); diff --git a/lily/side-position-interface.cc b/lily/side-position-interface.cc index 08ac17285d..16e2929a66 100644 --- a/lily/side-position-interface.cc +++ b/lily/side-position-interface.cc @@ -65,7 +65,7 @@ get_support_set (Grob *me) for (vsize i = 0; i < proto_support.size (); i++) { - if (Accidental_placement::has_interface (proto_support[i])) + if (has_interface (proto_support[i])) { Grob *accs = proto_support[i]; for (SCM acs = accs->get_object ("accidental-grobs"); scm_is_pair (acs); @@ -252,7 +252,7 @@ Side_position_interface::aligned_side (Grob *me, Axis a, bool pure, int start, i continue; // so 'me' may not move in response to 'e' if (a == Y_AXIS - && Stem::has_interface (e)) + && has_interface (e)) { // If called as 'pure' we may not force a stem to set its direction, if (pure && !is_direction (e->get_property_data ("direction"))) @@ -283,7 +283,7 @@ Side_position_interface::aligned_side (Grob *me, Axis a, bool pure, int start, i : e->maybe_pure_coordinate (common[Y_AXIS], Y_AXIS, pure, start, end); Skyline_pair copy = *unsmob (sp); if (a == Y_AXIS - && Stem::has_interface (e) + && has_interface (e) && to_boolean (me->get_maybe_pure_property ("add-stem-support", pure, start, end))) copy[dir].set_minimum_height (copy[dir].max_height ()); copy.shift (a == X_AXIS ? yc : xc); @@ -381,7 +381,7 @@ Side_position_interface::aligned_side (Grob *me, Axis a, bool pure, int start, i staff_span.widen (1); if (staff_span.contains (position) /* If we are between notehead and staff, quantize for ledger lines. */ - || (Note_head::has_interface (head) + || (has_interface (head) && dir * position < 0)) { total_off += (rounded - position) * 0.5 * ss; diff --git a/lily/slur-configuration.cc b/lily/slur-configuration.cc index 8e1db97d84..dc453a9729 100644 --- a/lily/slur-configuration.cc +++ b/lily/slur-configuration.cc @@ -334,7 +334,7 @@ Slur_configuration::score_extra_encompass (Slur_score_state const &state) // we find forbidden attachments vector forbidden_attachments; for (vsize i = 0; i < state.extra_encompass_infos_.size (); i++) - if (Tie::has_interface (state.extra_encompass_infos_[i].grob_)) + if (has_interface (state.extra_encompass_infos_[i].grob_)) { Grob *t = state.extra_encompass_infos_[i].grob_; Grob *common_x = Grob::get_vertical_axis_group (t); diff --git a/lily/slur-scoring.cc b/lily/slur-scoring.cc index cca56781aa..edd45f6427 100644 --- a/lily/slur-scoring.cc +++ b/lily/slur-scoring.cc @@ -161,7 +161,7 @@ Slur_score_state::get_bound_info () const for (LEFT_and_RIGHT (d)) { extremes[d].bound_ = slur_->get_bound (d); - if (Note_column::has_interface (extremes[d].bound_)) + if (has_interface (extremes[d].bound_)) { extremes[d].note_column_ = extremes[d].bound_; extremes[d].stem_ = Note_column::get_stem (extremes[d].note_column_); @@ -285,7 +285,7 @@ Slur_score_state::fill (Grob *me) ly_symbol2scm ("inside")) && minmax (dir_, encompass_place, y_place) == encompass_place && (!extra_encompass_infos_[i].grob_->internal_has_interface (ly_symbol2scm ("key-signature-interface")) - && !Clef::has_interface (extra_encompass_infos_[i].grob_) + && !has_interface (extra_encompass_infos_[i].grob_) && !extra_encompass_infos_[i].grob_->internal_has_interface (ly_symbol2scm ("time-signature-interface")))) { for (LEFT_and_RIGHT (d)) @@ -627,7 +627,7 @@ Slur_score_state::generate_avoid_offsets () const extract_grob_set (slur_, "encompass-objects", extra_encompasses); for (vsize i = 0; i < extra_encompasses.size (); i++) { - if (Slur::has_interface (extra_encompasses[i])) + if (has_interface (extra_encompasses[i])) { Grob *small_slur = extra_encompasses[i]; Bezier b = Slur::get_curve (small_slur); @@ -756,7 +756,7 @@ Slur_score_state::get_extra_encompass_infos () const vector collision_infos; for (vsize i = encompasses.size (); i--;) { - if (Slur::has_interface (encompasses[i])) + if (has_interface (encompasses[i])) { Spanner *small_slur = dynamic_cast (encompasses[i]); Bezier b = Slur::get_curve (small_slur); @@ -797,12 +797,12 @@ Slur_score_state::get_extra_encompass_infos () const Grob *g = encompasses [i]; Interval xe = g->extent (common_[X_AXIS], X_AXIS); Interval ye = g->extent (common_[Y_AXIS], Y_AXIS); - if (Dots::has_interface (g)) + if (has_interface (g)) ye.widen (0.2); Real xp = 0.0; Real penalty = parameters_.extra_object_collision_penalty_; - if (Accidental_interface::has_interface (g)) + if (has_interface (g)) { penalty = parameters_.accidental_collision_; diff --git a/lily/slur.cc b/lily/slur.cc index 39059a59b6..a11a30258e 100644 --- a/lily/slur.cc +++ b/lily/slur.cc @@ -204,7 +204,7 @@ Slur::replace_breakable_encompass_objects (Grob *me) { Grob *g = extra_objects[i]; - if (Separation_item::has_interface (g)) + if (has_interface (g)) { extract_grob_set (g, "elements", breakables); for (vsize j = 0; j < breakables.size (); j++) @@ -409,7 +409,7 @@ Slur::auxiliary_acknowledge_extra_object (Grob_info const &info, else slur = slurs[0]; - if (Tie::has_interface (e) + if (has_interface (e) || scm_is_eq (avoid, ly_symbol2scm ("inside"))) { for (vsize i = slurs.size (); i--;) @@ -478,7 +478,7 @@ Slur::calc_cross_staff (SCM smob) so we can ignore them here */ vector non_sep_extras; for (vsize i = 0; i < extras.size (); i++) - if (!Separation_item::has_interface (extras[i])) + if (!has_interface (extras[i])) non_sep_extras.push_back (extras[i]); Grob *common = common_refpoint_of_array (cols, me, Y_AXIS); diff --git a/lily/spacing-determine-loose-columns.cc b/lily/spacing-determine-loose-columns.cc index c7990558dd..4be23042ad 100644 --- a/lily/spacing-determine-loose-columns.cc +++ b/lily/spacing-determine-loose-columns.cc @@ -108,7 +108,7 @@ is_loose_column (Grob *l, Grob *col, Grob *r, Spacing_options const *options) for (vsize i = elts.size (); i--;) { Grob *g = elts[i]; - if (g && Break_alignment_interface::has_interface (g)) + if (has_interface (g)) { extract_grob_set (g, "elements", gelts); for (vsize j = gelts.size (); j--;) @@ -150,7 +150,7 @@ Spacing_spanner::set_distances_for_loose_col (Grob *me, Grob *c, || Spacing_interface::right_column (sp) != rc) continue; - if (Note_spacing::has_interface (sp)) + if (has_interface (sp)) { /* The note spacing should be taken from the musical @@ -161,7 +161,7 @@ Spacing_spanner::set_distances_for_loose_col (Grob *me, Grob *c, dists[d] = max (dists[d], spring.min_distance ()); } - else if (Staff_spacing::has_interface (sp)) + else if (has_interface (sp)) { Spring spring = Staff_spacing::get_spacing (sp, rc, 0.0); diff --git a/lily/spacing-interface.cc b/lily/spacing-interface.cc index 1ade62b0e5..030d02e727 100644 --- a/lily/spacing-interface.cc +++ b/lily/spacing-interface.cc @@ -64,7 +64,7 @@ Spacing_interface::skylines (Grob *me, Grob *right_col) if (Item *piece = g->find_prebroken_piece (break_dirs[d])) g = piece; - if (g && Separation_item::has_interface (g) && g->get_column () == columns[d]) + if (has_interface (g) && g->get_column () == columns[d]) { SCM sky_scm = g->get_property ("horizontal-skylines"); Skyline_pair *sky = unsmob (sky_scm); @@ -144,9 +144,9 @@ get_note_columns (vector const &elts) for (vsize i = 0; i < elts.size (); i++) { - if (Note_column::has_interface (elts[i])) + if (has_interface (elts[i])) ret.push_back (dynamic_cast (elts[i])); - else if (Separation_item::has_interface (elts[i])) + else if (has_interface (elts[i])) { extract_grob_set (elts[i], "elements", more_elts); vector ncs = get_note_columns (more_elts); diff --git a/lily/spacing-loose-columns.cc b/lily/spacing-loose-columns.cc index c3846e694d..15f77f34a0 100644 --- a/lily/spacing-loose-columns.cc +++ b/lily/spacing-loose-columns.cc @@ -155,7 +155,7 @@ set_loose_columns (System *which, Column_x_positions const *posns) { Spring spring = Spacing_spanner::note_spacing (spacing, loose_col, next_col, &options); - if (Note_spacing::has_interface (spacing)) + if (has_interface (spacing)) spring = Note_spacing::get_spacing (spacing, next_col, spring, options.increment_); diff --git a/lily/spacing-spanner.cc b/lily/spacing-spanner.cc index f6f532125a..cc353bc365 100644 --- a/lily/spacing-spanner.cc +++ b/lily/spacing-spanner.cc @@ -351,7 +351,7 @@ Spacing_spanner::musical_column_spacing (Grob *me, /* This is probably a waste of time in the case of polyphonic music. */ - if (found_matching_column && Note_spacing::has_interface (wish)) + if (found_matching_column && has_interface (wish)) { Real inc = options->increment_; Grob *gsp = unsmob (left_col->get_object ("grace-spacing")); @@ -489,7 +489,7 @@ Spacing_spanner::breakable_column_spacing (Grob *me, Item *l, Item *r, { Item *spacing_grob = dynamic_cast (wishes[i]); - if (!spacing_grob || !Staff_spacing::has_interface (spacing_grob)) + if (!spacing_grob || !has_interface (spacing_grob)) continue; /* diff --git a/lily/staff-spacing.cc b/lily/staff-spacing.cc index 11fb185a87..c8e51f56f8 100644 --- a/lily/staff-spacing.cc +++ b/lily/staff-spacing.cc @@ -44,7 +44,7 @@ using namespace std; Real Staff_spacing::optical_correction (Grob *me, Grob *g, Interval bar_height) { - if (!g || !Note_column::has_interface (g)) + if (!g || !has_interface (g)) return 0; Grob *stem = Note_column::get_stem (g); diff --git a/lily/staff-symbol-referencer.cc b/lily/staff-symbol-referencer.cc index 2f245fda9b..09b3d2856e 100644 --- a/lily/staff-symbol-referencer.cc +++ b/lily/staff-symbol-referencer.cc @@ -48,7 +48,7 @@ Staff_symbol_referencer::on_staff_line (Grob *me, int pos) Grob * Staff_symbol_referencer::get_staff_symbol (Grob *me) { - if (Staff_symbol::has_interface (me)) + if (has_interface (me)) return me; SCM st = me->get_object ("staff-symbol"); diff --git a/lily/stem-tremolo.cc b/lily/stem-tremolo.cc index 75d25f43cf..5f71607a37 100644 --- a/lily/stem-tremolo.cc +++ b/lily/stem-tremolo.cc @@ -261,7 +261,7 @@ Stem_tremolo::calc_direction (SCM smob) */ Grob *maybe_nc = stem->get_parent (X_AXIS)->get_parent (X_AXIS); bool whole_note = Stem::duration_log (stem) <= 0; - if (whole_note && Note_collision_interface::has_interface (maybe_nc)) + if (whole_note && has_interface (maybe_nc)) { Drul_array avoid_me (false, false); vector all_nhps = Note_collision_interface::note_head_positions (maybe_nc); diff --git a/lily/stem.cc b/lily/stem.cc index 2fad60d105..9cb84f57fa 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -266,9 +266,9 @@ Stem::add_head (Grob *me, Grob *n) { n->set_object ("stem", me->self_scm ()); - if (Note_head::has_interface (n)) + if (has_interface (n)) Pointer_group_interface::add_grob (me, ly_symbol2scm ("note-heads"), n); - else if (Rest::has_interface (n)) + else if (has_interface (n)) Pointer_group_interface::add_grob (me, ly_symbol2scm ("rests"), n); } diff --git a/lily/system.cc b/lily/system.cc index a511a32b67..4a18ab52b7 100644 --- a/lily/system.cc +++ b/lily/system.cc @@ -414,7 +414,7 @@ System::vertical_skyline_elements (SCM smob) vector vertical_skyline_grobs; extract_grob_set (me_grob, "elements", my_elts); for (vsize i = 0; i < my_elts.size (); i++) - if (System_start_delimiter::has_interface (my_elts[i])) + if (has_interface (my_elts[i])) vertical_skyline_grobs.push_back (my_elts[i]); System *me = dynamic_cast (me_grob); @@ -429,7 +429,7 @@ System::vertical_skyline_elements (SCM smob) extract_grob_set (align, "elements", elts); for (vsize i = 0; i < elts.size (); i++) - if (Hara_kiri_group_spanner::has_interface (elts[i])) + if (has_interface (elts[i])) vertical_skyline_grobs.push_back (elts[i]); SCM grobs_scm = Grob_array::make_array (); @@ -763,7 +763,7 @@ System::get_vertical_alignment (SCM smob) extract_grob_set (me, "elements", elts); Grob *ret = 0; for (vsize i = 0; i < elts.size (); i++) - if (Align_interface::has_interface (elts[i])) + if (has_interface (elts[i])) { if (ret) me->programming_error ("found multiple vertical alignments in this system"); @@ -792,7 +792,7 @@ System::get_extremal_staff (Direction dir, Interval const &iv) vsize end = (dir == UP) ? elts.size () : VPOS; for (vsize i = start; i != end; i += dir) { - if (Hara_kiri_group_spanner::has_interface (elts[i])) + if (has_interface (elts[i])) Hara_kiri_group_spanner::consider_suicide (elts[i]); Interval intersection = elts[i]->extent (this, X_AXIS); @@ -822,7 +822,7 @@ System::get_neighboring_staff (Direction dir, Grob *vertical_axis_group, Interva if (elts[i] == vertical_axis_group) return out; - if (Hara_kiri_group_spanner::has_interface (elts[i])) + if (has_interface (elts[i])) Hara_kiri_group_spanner::consider_suicide (elts[i]); bounds.intersect (elts[i]->spanned_rank_interval ()); @@ -917,7 +917,7 @@ System::calc_pure_relevant_grobs (SCM smob) for (vsize i = 0; i < elts.size (); ++i) { - if (!Axis_group_interface::has_interface (elts[i])) + if (!has_interface (elts[i])) { relevant_grobs.push_back (elts[i]); diff --git a/lily/tie-column.cc b/lily/tie-column.cc index 8a0ef24139..5f111a8581 100644 --- a/lily/tie-column.cc +++ b/lily/tie-column.cc @@ -40,7 +40,7 @@ Tie_column::add_tie (Grob *tc, Spanner *tie) Spanner *me = dynamic_cast (tc); if (tie->get_parent (Y_AXIS) - && Tie_column::has_interface (tie->get_parent (Y_AXIS))) + && has_interface (tie->get_parent (Y_AXIS))) return; if (!me->get_bound (LEFT) diff --git a/lily/tie-formatting-problem.cc b/lily/tie-formatting-problem.cc index ad08638ebb..905718469c 100644 --- a/lily/tie-formatting-problem.cc +++ b/lily/tie-formatting-problem.cc @@ -99,7 +99,7 @@ Tie_formatting_problem::set_column_chord_outline (vector bounds, for (vsize i = 0; i < bounds.size (); i++) { Grob *head = bounds[i]; - if (!Note_head::has_interface (head)) + if (!has_interface (head)) continue; if (!stem) diff --git a/lily/tie.cc b/lily/tie.cc index ae81317e39..849e859eb5 100644 --- a/lily/tie.cc +++ b/lily/tie.cc @@ -64,7 +64,7 @@ Item * Tie::head (Spanner *me, Direction d) { Item *it = me->get_bound (d); - return Note_head::has_interface (it) ? it : 0; + return has_interface (it) ? it : 0; } int @@ -146,8 +146,8 @@ Tie::calc_direction (SCM smob) // types. It might be clearer to use a template. Grob *me = unsmob (smob); Grob *yparent = me->get_parent (Y_AXIS); - if ((Tie_column::has_interface (yparent) - || Semi_tie_column::has_interface (yparent)) + if ((has_interface (yparent) + || has_interface (yparent)) && unsmob (yparent->get_object ("ties")) // && unsmob (yparent->get_object ("ties"))->size () > 1 ) @@ -209,8 +209,8 @@ Tie::calc_control_points (SCM smob) Spanner *me = LY_ASSERT_SMOB(Spanner, smob, 1); Grob *yparent = me->get_parent (Y_AXIS); - if ((Tie_column::has_interface (yparent) - || Semi_tie_column::has_interface (yparent)) + if ((has_interface (yparent) + || has_interface (yparent)) && unsmob (yparent->get_object ("ties"))) { extract_grob_set (yparent, "ties", ties); diff --git a/lily/tuplet-bracket.cc b/lily/tuplet-bracket.cc index a1ad69c72a..17e1194de8 100644 --- a/lily/tuplet-bracket.cc +++ b/lily/tuplet-bracket.cc @@ -64,7 +64,7 @@ get_x_bound_item (Grob *me_grob, Direction hdir, Direction my_dir) { Spanner *me = dynamic_cast (me_grob); Item *g = me->get_bound (hdir); - if (Note_column::has_interface (g) + if (has_interface (g) && Note_column::get_stem (g) && Note_column::dir (g) == my_dir) g = Note_column::get_stem (g); diff --git a/lily/tuplet-number.cc b/lily/tuplet-number.cc index c8781ca14d..4d879ade4c 100644 --- a/lily/tuplet-number.cc +++ b/lily/tuplet-number.cc @@ -272,7 +272,7 @@ Tuplet_number::calc_x_offset (SCM smob) for (LEFT_and_RIGHT (d)) { - if (Note_column::has_interface (bounds[d]) + if (has_interface (bounds[d]) && Note_column::get_stem (bounds[d])) bounds[d] = Note_column::get_stem (bounds[d]); bound_poss[d] = Axis_group_interface::generic_bound_extent (bounds[d], commonx, X_AXIS)[-d]; diff --git a/lily/vertical-align-engraver.cc b/lily/vertical-align-engraver.cc index d28d0d74a3..6a47809fd7 100644 --- a/lily/vertical-align-engraver.cc +++ b/lily/vertical-align-engraver.cc @@ -120,7 +120,7 @@ Vertical_align_engraver::qualifies (Grob_info i) const { int sz = i.origin_contexts ((Translator *)this).size (); - return sz > 0 && Axis_group_interface::has_interface (i.grob ()) + return sz > 0 && has_interface (i.grob ()) && !i.grob ()->get_parent (Y_AXIS) && !to_boolean (i.grob ()->get_property ("no-alignment")) && Axis_group_interface::has_axis (i.grob (), Y_AXIS);