]> git.donarmstrong.com Git - lilypond.git/commitdiff
make implementation for Class::has_interface automatically. Junk all
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 10 Apr 2002 17:25:36 +0000 (17:25 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 10 Apr 2002 17:25:36 +0000 (17:25 +0000)
other implementations.

83 files changed:
lily/a2-engraver.cc
lily/align-interface.cc
lily/arpeggio.cc
lily/axis-group-engraver.cc
lily/axis-group-interface.cc
lily/bar-line.cc
lily/beam.cc
lily/break-algorithm.cc
lily/break-align-interface.cc
lily/chord-name.cc
lily/clef-engraver.cc
lily/clef.cc
lily/custos.cc
lily/dot-column.cc
lily/extender-engraver.cc
lily/fingering-engraver.cc
lily/gourlay-breaking.cc
lily/grob.cc
lily/hara-kiri-group-spanner.cc
lily/hyphen-engraver.cc
lily/include/break-align-interface.hh
lily/include/chord-name.hh
lily/include/collision.hh
lily/include/dots.hh
lily/include/font-interface.hh
lily/include/grob-interface.hh
lily/include/grob.hh
lily/include/hyphen-spanner.hh
lily/include/item.hh
lily/include/key-item.hh
lily/include/line-of-score.hh
lily/include/line-spanner.hh
lily/include/lyric-extender.hh
lily/include/paper-column.hh
lily/include/percent-repeat-item.hh
lily/include/porrectus.hh
lily/include/script-column.hh
lily/include/side-position-interface.hh
lily/include/spaceable-grob.hh
lily/include/spanner.hh
lily/include/staff-symbol-referencer.hh
lily/include/system.hh [new file with mode: 0644]
lily/include/text-item.hh
lily/include/time-signature.hh
lily/instrument-name-engraver.cc
lily/item.cc
lily/key-engraver.cc
lily/key-signature-interface.cc
lily/local-key-item.cc
lily/lyric-phrasing-engraver.cc
lily/multi-measure-rest.cc
lily/note-column.cc
lily/note-head.cc
lily/note-spacing.cc
lily/paper-score.cc
lily/rest.cc
lily/rhythmic-head.cc
lily/score-engraver.cc
lily/script.cc
lily/self-aligment-interface.cc [new file with mode: 0644]
lily/separating-group-spanner.cc
lily/separation-item.cc
lily/side-position-interface.cc
lily/slur.cc
lily/spaceable-grob.cc
lily/spacing-spanner.cc
lily/span-bar.cc
lily/spanner.cc
lily/staff-spacing.cc
lily/staff-symbol-referencer.cc
lily/staff-symbol.cc
lily/stanza-number-engraver.cc
lily/stem-tremolo.cc
lily/stem.cc
lily/syllable-group.cc
lily/system-start-delimiter.cc
lily/system.cc
lily/text-item.cc
lily/text-spanner.cc
lily/tie-column.cc
lily/tie.cc
lily/tuplet-bracket.cc
lily/voice-devnull-engraver.cc

index a7f1acb4a3870702e49dfe5d555dea2ab552344d..51d1183ec13e78118885c9a6e38360da573acb9e 100644 (file)
@@ -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)
          ))
     {
index 03447301845f620533e005566927ef5138890c01..ef9d932842c1247efb0d0046b14162e790eca5b1 100644 (file)
@@ -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");
index dfd112887bd6ad7b099449f7d5870439db03b56b..73fad5482ed509513bd569fb1107615c47f6f76e 100644 (file)
 #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 
index 8c054c3d67e55cfe23f6ff259597d555365c7ee3..bd2dcf88addcd5ab82c7c8c995e0c76e35c5a8fb 100644 (file)
@@ -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_);
     }
index 895b5597c9a4f19c33f1807b054898d833176b81..10ffa7172a33835cd7af49543c402ee295c3c196 100644 (file)
@@ -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",
index c6fb214fce1ee2e97281ae50829ed3b4d4679d7e..ebae578015a64575d12ceaaef9fe6592bf2efe30 100644 (file)
@@ -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);
index ea36554c28c3fedee4726381f571f393434bc402..706b503eca2e1e812c7f94f87ccab16c1e7ffbb9 100644 (file)
@@ -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");
 
index e14cdcdb4a852bdaf1a1c677b5a9001c700e83bd..ce4c075d8c33d25e28b2eb68e4c219a1a91c30cb 100644 (file)
@@ -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"
index fd2ae3e9f5fcecc6cbf85080f7a3d1adbfe7cda4..76fd54a6f3bddf8de3e257d6ef1a6829b8f03fcb 100644 (file)
@@ -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.
 
index e00f05ace9879a40b078e66350a9bc2aa72a0dd4..1180eea826895a3803f97b26a70a15317886fb42 100644 (file)
@@ -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"
 
index b3ec806aec538ef1522c3b542702d3998a623f66..a7ad3b39af8185d9a9bb948a6a40e6f9532afd86 100644 (file)
@@ -11,7 +11,7 @@
 #include <ctype.h>
 
 #include "translator-group.hh"
-#include "key-item.hh"
+
 #include "bar-line.hh"
 #include "staff-symbol-referencer.hh"
 #include "debug.hh"
index 589ca0856ec3ec45bf6ffd9419767baea31f13ce..943f5e24d4bb341247f79b14859c501c2818b85b 100644 (file)
@@ -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"));
-}
 
 
 
index 608f0c03795b504be69f413b9c2902b7ac0ecaa7..d4025b188e814f91ca3c63051dd31cebdcdafe5c 100644 (file)
@@ -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
index f2d5e10e97becae3eeac3d2e6c7ecacd12cfd656..2aa564dfa9d3a50f0366522f03601fb0a52d1c0d 100644 (file)
@@ -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
index 3d78b8b772debb9ab94bda39436c368059d51864..a6bcd2593ee6c6dda7ef28afd6590be4023fa5e5 100644 (file)
@@ -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_
index 8a7bab80b3fe36b65d5a316efebc783c642486b4..90dba9870951b7295f562e1a6efc3c2a91a142eb 100644 (file)
@@ -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));
 
index 492e2c1a4ff32bc31fb4bc7a422e8ed5753d7ce1..798dbaddc522cf7e9e5ff473ed5bda6143759681 100644 (file)
@@ -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;
index 3202e931c31417b6644535a1fb60b6d5be81e124..598c347ec14b7f196e0507fee2caca7dbd213415 100644 (file)
@@ -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");
 
index 3ddad25c62abd4fa304d0e8c41a27343579e660a..dba478e0a30e93f2a2b54f276b1c9f49ad65a277 100644 (file)
@@ -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)
index 1697c82849924099fb148b11ae43b2553f7dc3f0..b8eabfe33d28e29b4b4cc93c896d9ed8fe8550ae 100644 (file)
@@ -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_
index 6543289a5a26a56c2d2544394847f76046d14866..cd0cf144c79c1e2c1142d4d2a0095028e822a47c 100644 (file)
@@ -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
index 3cf2ac1237889b0b0d900a42c5eaac6eb326d272..69b6a1ef7c717172a9e0de47cb9a1910cc9fa8e4 100644 (file)
@@ -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
index 068f818e1813ddb73be66c64749c79bff5fd500e..5704ca978974f35119eaba59dec2ea1cbd286d72 100644 (file)
@@ -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
index 105c61edf428ab0cc46b5b4a7b25fdb186b87db0..37f667dff0b6fb732d6f935f99c2fd1461c4803d 100644 (file)
@@ -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
index d377b4d1ff0d82b3576c706405f4fedcbf37cc09..176e4c32104b1a571de4fd5cc49ef665745987b9 100644 (file)
@@ -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 */
index 028c4763f61fa85e8dc8f9656b64331052890fe2..11a5acf68d39c3990fc642405181ab0f99fd0458 100644 (file)
@@ -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);\
 }\
index f94e3887125b8f48310fa2781c741e4d2f9e3f09..e15b0ce0acd23fdf69da5d9f00b1dcb1196e69a6 100644 (file)
@@ -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 ();
index ad4870a9d540ad8cdba1a2adf2e117ac3d0a77dd..f4ed165ccf8d92e0a6116bf3eacfe05b118c91f0 100644 (file)
@@ -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 ));
 };
 
index 77fd2be90008b9364314c26ecd6061e4b5964962..408e73ddebbc0834e3c5fe29c04d89493e0b8b81 100644 (file)
@@ -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 ();
index dd4858846359eaf2ac9105d6ef953d02e43383b6..65296f81060baccd891380179b283fc7515acef0 100644 (file)
@@ -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
index 4ff07730ef9732d625d7858517d8625b5f090a10..65296f81060baccd891380179b283fc7515acef0 100644 (file)
@@ -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<Column_x_positions> const&);
-  void output_lines ();
-
-  Link_array<Item> broken_col_range (Item const*, Item const*) const;
-  Link_array<Grob> 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
index 42523311e1cec982a5fbc16f592b398214c15ca8..e36481fca5632ee710eba5609ef2a39419eb15f3 100644 (file)
@@ -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);
index bbab8028a5806d60f5a0e5e8aeea13f88b13c127..5dfd31ee58db683756978228673ed16806b15091 100644 (file)
@@ -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 ));
 };
index ed850c4e247ac5d87ffb2ec9ce042328769d84e1..fbf69636ec490eed11aa919e480e9ef00ad9d5a3 100644 (file)
@@ -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;
index 057144c5d7eafdcfa2c2f34b831534612a8800b4..1a7a499d6569202f3aca89cb1c0f9c341a25245d 100644 (file)
@@ -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 );
index c2abfbfaaf8a5f4647255680e02d0b9147f518d4..453471f66a40611397be7443698c792f47f972d6 100644 (file)
@@ -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,
index 8d759beba832f52c00a5f9a9da8e9296bdf7c100..ff0ed55bc6cd043480df252952f618bb4562d3f4 100644 (file)
@@ -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*);
+
 };
 
 
index cd5f2a1be1b82cd68350befc4fd06f5523d67659..3cfd3730d17d26f9a384aa0ce9cea2802a31f1d5 100644 (file)
@@ -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 */
 
index 57ed529deae763dc5b7f7b7bb82c45206ff02940..194f5b7eab95e0f2b70f1b69781cd524f582c40a 100644 (file)
@@ -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*);
index ebf5af6a8629e56940ef7a841532cdd4928c7f41..0a5abcfa0fe676ba1da3dd6720c43f568e60e54f 100644 (file)
@@ -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 ();
 
index aa4affa2ce7de8cc57781c157854318ea81af376..c250e9e0d42c442e30fe0e536afda9c55f3f95ff 100644 (file)
@@ -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 (file)
index 0000000..7f67f07
--- /dev/null
@@ -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<Column_x_positions> const&);
+  void output_lines ();
+  static bool has_interface (Grob*);
+  
+  Link_array<Item> broken_col_range (Item const*, Item const*) const;
+  Link_array<Grob> 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
+
index 8cd1430ebe1b46c4d96aebaefe8ca9ff028bee95..e8479e9d748003c28d779a7825891275d8333add 100644 (file)
@@ -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);
index 7bd6553252046dd409cef1d5ca4454ce139601bf..9c39e9221b7a4a6af5320365e0fb5103e33b75ed 100644 (file)
@@ -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 ));
index 75be1189bc2f8f6982bee492c0a8fab0278cc9e0..4bb036166b0c8c1b79dea32aa5a9cbd67215c2bb 100644 (file)
@@ -92,7 +92,7 @@ Instrument_name_engraver::acknowledge_grob (Grob_info i)
     }
 
   if (dynamic_cast<Spanner*> (i.grob_l_)
-      && i.grob_l_->has_interface (ly_symbol2scm ("dynamic-interface")))
+      && i.grob_l_->internal_has_interface (ly_symbol2scm ("dynamic-interface")))
     return;
 
   /*
index 7a2f8fb565c8407931fdb04879cf5abb89904e36..da1cbfb4377d34e7f59c16991774c47a23b5df13 100644 (file)
@@ -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<Item*> (unsmob_grob (s));
 }
 
+
+
 ADD_INTERFACE(Item,
              "item-interface",
              "",
index f8387cac5eb52a4316252e3265c37ae37f5401b4..d0345c0040b81e16e98cdf6e79cadb1ffbbcb466 100644 (file)
@@ -6,7 +6,7 @@
   (c)  1997--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   */
 
-#include "key-item.hh"
+
 #include "command-request.hh"
 #include "musical-request.hh"
 #include "item.hh"
index 802a6bf015657e20661e2a260fb49348d40dcf43..9d1ebfcec77c0bd7eddf7637f2ac9660756e1878 100644 (file)
@@ -23,6 +23,8 @@
 struct Key_signature_interface
 {
   DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM ));
+
+  static bool has_interface (Grob*);
 };
 
 
index 5709fb428e3ef1b35e0e482a931ea18ec3b23667..15c2e9ec28397df40bdaee2f8415c0ab4b6f58c5 100644 (file)
@@ -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"));
-}
 
 
 
index cc6586d01d02d7c653704dfa112c2629e44fb269..e5d5855b4e4c1e84b333c3a137f1f4f72959e797 100644 (file)
@@ -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;
index 2659274f816605161cfbf9b9af7e0d7164971542..579408802d33e14b98a794aec369fabd279fa076 100644 (file)
 #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
index d35b6da16f67ade0181924527947d0be94cfa1b8..c4dd3bdca7c4ddbc19dbc9a3dde7bdc67d6dc1e9 100644 (file)
@@ -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. 
index 23f407622f1e4044055c34bb0f6a7a346660f1b4..f77eea73c77d58dfc4ec1c6a14dbfcd1552ce33f 100644 (file)
@@ -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);
index fee2bb8b0703286822e2f4626b24651743eca54c..1a1ae4c964293915a6be3e609c49abc492e069d7 100644 (file)
 #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,
index a6f1168049d46dd06a76ae816d97f61c065bf7dc..9193e92c0abc692ecca8227c7186f3f8a32d2a6d 100644 (file)
@@ -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"
index aee966e1b1e8911aea54a691fa6bf4c6cd82316f..c0bd01d93ff9001eaa357cfb3d8ded50812608db 100644 (file)
@@ -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",
index dd20a029b86bd6df0fbd166f7aaa2765b4b3d857..b9bf752f71c5a50a0371df10b1912972aba055ce 100644 (file)
@@ -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",
index 3d6e5d058ba29d54a0e96320f27d4d6a1a3ab16c..7d44b9495ac0309fa90dfc518c3710b3a294e992 100644 (file)
@@ -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"
index 0280a52d17a980fa1557ac2793afb34f674cdc5f..63afc99f95ce74cddc7476d77de2497075c187df 100644 (file)
@@ -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 (file)
index 0000000..dd0c05c
--- /dev/null
@@ -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");
+
index 580919a04ebd3a1c551cfbf2326b9192fed1026b..992dba8d63b8dbaac975fcd252e310eee4c9e3bd 100644 (file)
@@ -135,11 +135,6 @@ Separating_group_spanner::add_spacing_unit (Grob* me ,Item*i)
 }
 
 
-bool
-Separating_group_spanner::has_interface (Grob*)
-{//todo
-  assert (false);
-}
 
 
 
index 81b3df8ced18cc06c91df83d2d15a9d75b82d71e..1e439066b530e75d82401b4ce94c03657ff247f5 100644 (file)
 #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)
index 4ce9df6761ae4118309790159514c86e2d3fb6fc..0c923d28e8c8d718c4be1a28fd07e7ea8707065d 100644 (file)
@@ -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) 
index 0678e694fce133246ff58592c4ff185f6db8597a..e691c606cc607de60d1e2edfb16617732a27bda0 100644 (file)
@@ -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",
index bb6afc11e6721cbceed36953f7b7be0ea5933a24..0f80197c4b7379be32b7b1e6cf6c86bd086c31a2 100644 (file)
@@ -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");
index 2a86f22ff574a018a15bda50a0cbe41dfce5ea2d..5e48941547d3a43869b5e65c23a090d85ceb0905 100644 (file)
@@ -10,7 +10,7 @@
 #include <math.h>
 #include <stdio.h>
 
-#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<Grob> *cols);
   static void musical_column_spacing (Grob*,Item*,Item*, Real, Rational); 
   DECLARE_SCHEME_CALLBACK (set_springs, (SCM ));
+  static bool has_interface (Grob*);
 };
 
 /*
index 0279cd273330a92fb6d4aa81d7aee1a631ea57ed..0ee31140fac93d11e7d408f70f468ab429b59a01 100644 (file)
@@ -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.",
index 9e8be73b3b211918542e1a7c1ba62e237af6a4f1..4dd1dce0a53886dd85b3e7b9ffa0988f7a84b3d3 100644 (file)
@@ -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
index fa18624f99e717d169306692d0a1dc8a2e38889e..011c2b228aba1884c61a3c8cb559cc6069ac6b31 100644 (file)
 #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
index abb66fa954cb6a1100bb17a6af73d6c5aa00af9f..2d05d1f11a7f975c641c64bce0c525ca6e928284 100644 (file)
@@ -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
index 61b762fe99baef933d60a337b5981d36bb2374c0..75bb907c140514249a99f57a561e2f84b9d3d714 100644 (file)
@@ -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"));
-}
 
 
 
index 7c860ce11a70f9ae0bbba8e4ef69cbf3ee67a0cb..813137bc8ef63663d88a5b93ae12d206f44e2cc5 100644 (file)
@@ -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.
index 3a18323b3252de7669107affe8a92e08ec004070..0c3313d3dcbb6e4e96e59e795e95c021d16efa61 100644 (file)
     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);
 
index ff8a4c4a99cba4ad70506413670d5a6e0aebe898..7286daeee03a00bc04897dda09b7462e2afa6381 100644 (file)
@@ -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");
index e8973a68242b519f8beb51d28eb994d343add6c7..506f6a466dc548f9563f7ef91514377f932c6f0e 100644 (file)
@@ -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");
index b07c6619b1e3d28d85a4026be337ff3836d18b05..b19ca86d3bf20b327b6e869aa726c60e32d4de47 100644 (file)
@@ -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");
index 4608d21a562e3a3a62d84a1d0f514433ccf03aec..dce65a693192f8420dc14a2da9cd169721070d00 100644 (file)
@@ -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");
index 194028ab3f4dd24d001843ff4de0cecfa2a35f6f..a63c3784d5000ca9424c1339abb7e7904e5cf079 100644 (file)
@@ -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");
index cb24ad3fb13c7187c48bcbf7b1789c001aff794b..2e4acbfa9ac51de05083e10ced2316719edc4ab8 100644 (file)
@@ -40,7 +40,7 @@ Text_spanner::brew_molecule (SCM smob)
   Grob *me= unsmob_grob (smob);
   Spanner *spanner = dynamic_cast<Spanner*> (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");
index a2c34f6e62ff686d565b1a73d7b4f7b8b8d689da..e364bf7f03299582d7394b9b869d70903e5c7577 100644 (file)
 
 
 
-bool
-Tie_column::has_interface (Grob*me)
-{
-  return  me->has_interface (ly_symbol2scm ("tie-column-interface"));
-}
 
 
 /*
index 9f116b8f6036a6773f17efeac82b3df026e7570d..1086b9a0a8837d7b7887ecb39f9a859749cbbac6 100644 (file)
@@ -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) 
index 08fa3170629f81082fb26cdc008b783598cb6567..b7cbc2c49b03f0ca4f5bf5018c6413135c3fe696 100644 (file)
@@ -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");
 
index d580a91b2fdb46067f6edea91900004cfc3612fd..ef97171b40868ac7e8b755a9f071f3bf965d59fe 100644 (file)
@@ -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 ();