]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.3.68
authorfred <fred>
Tue, 26 Mar 2002 23:24:18 +0000 (23:24 +0000)
committerfred <fred>
Tue, 26 Mar 2002 23:24:18 +0000 (23:24 +0000)
62 files changed:
lily/align-interface.cc
lily/align-note-column-engraver.cc
lily/auto-beam-engraver.cc
lily/axis-group-interface.cc
lily/beam.cc
lily/break-align-item.cc
lily/breathing-sign-engraver.cc
lily/breathing-sign.cc
lily/chord-name-engraver.cc
lily/chord-name.cc
lily/clef-engraver.cc
lily/collision.cc
lily/dot-column-engraver.cc
lily/dot-column.cc
lily/dots.cc
lily/include/align-interface.hh
lily/include/axis-group-interface.hh
lily/include/beam.hh
lily/include/breathing-sign.hh
lily/include/chord-name.hh
lily/include/collision.hh
lily/include/dimension-cache-callback.hh
lily/include/dot-column.hh
lily/include/dots.hh
lily/include/key-item.hh
lily/include/local-key-item.hh
lily/include/rest-collision.hh
lily/include/score-element.hh
lily/include/script-column.hh
lily/include/script.hh
lily/include/separating-group-spanner.hh
lily/include/separating-line-group-engraver.hh
lily/include/separation-item.hh [new file with mode: 0644]
lily/include/side-position-interface.hh
lily/include/span-bar.hh
lily/include/staff-symbol-referencer.hh
lily/include/stem.hh
lily/include/time-signature.hh
lily/key-engraver.cc
lily/key-item.cc
lily/lookup.cc
lily/note-head.cc
lily/note-heads-engraver.cc
lily/rest-collision.cc
lily/rest-engraver.cc
lily/rhythmic-column-engraver.cc
lily/rod.cc
lily/score-element.cc
lily/script-column-engraver.cc
lily/script-column.cc
lily/script-engraver.cc
lily/script.cc
lily/separating-group-spanner.cc
lily/separating-line-group-engraver.cc
lily/separation-item.cc [new file with mode: 0644]
lily/side-position-interface.cc
lily/span-bar.cc
lily/staff-symbol-referencer.cc
lily/stem.cc
lily/text-item.cc
lily/time-signature-engraver.cc
lily/time-signature.cc

index c3779358711f53c0ef277fa3182eb0898b500637..fdeefe5d29458a9f892752d5fa889eee05ab6773 100644 (file)
@@ -18,7 +18,7 @@
   not compute anything, but a side effect of a->do_side_processing ()
   is that the elements are placed correctly.  */
 Real
-Align_interface::alignment_callback (Score_element const *sc, Axis ax)
+Align_interface::alignment_callback (Score_element *sc, Axis ax)
 {
   Score_element * par = sc->parent_l (ax);
   if (par && par->get_elt_property ("alignment-done") == SCM_UNDEFINED) 
@@ -30,7 +30,7 @@ Align_interface::alignment_callback (Score_element const *sc, Axis ax)
 
 
 Real
-Align_interface::center_on_element (Score_element const *me, Axis a)
+Align_interface::center_on_element (Score_element *me, Axis a)
 {
   Score_element *cent = unsmob_element (me->get_elt_pointer ("group-center-element"));
 
index f346fb9191a36e914465c550327512e29941c502..2ffb4d178a6ea9a10bf23fa760933512f5b2d58a 100644 (file)
@@ -11,7 +11,6 @@
 #include "grace-align-item.hh"
 #include "align-interface.hh"
 #include "note-column.hh"
-#include "local-key-item.hh"
 #include "warn.hh"
 #include "directional-element-interface.hh"
 #include "side-position-interface.hh"
@@ -23,7 +22,7 @@ class Align_note_column_engraver: public Engraver
 {
   Grace_align_item * align_item_p_;
   Note_column * now_column_l_;
-  Local_key_item * accidental_l_;
+  Score_element * accidental_l_;
 
   virtual void process_acknowledged ();
   virtual void do_post_move_processing ();
@@ -74,9 +73,9 @@ Align_note_column_engraver::acknowledge_element (Score_element_info inf)
     {
       now_column_l_ =n;
     }
-  else if (Local_key_item * it = dynamic_cast<Local_key_item*> (inf.elem_l_))
+  else if (to_boolean (inf.elem_l_->get_elt_property ("accidentals-interface")))
     {
-      accidental_l_ = it;
+      accidental_l_ = inf.elem_l_;
     }
 }
 void
index 1d88248b40a21fe50a316334860607a5612d5f30..433f469f67a50ba2f7d206d7099e57c01659c0dd 100644 (file)
@@ -9,9 +9,7 @@
 #include "beaming.hh"
 #include "auto-beam-engraver.hh"
 #include "musical-request.hh"
-#include "bar.hh"
 #include "beam.hh"
-#include "rest.hh"
 #include "stem.hh"
 #include "debug.hh"
 #include "timing-engraver.hh"
@@ -310,7 +308,7 @@ Auto_beam_engraver::acknowledge_element (Score_element_info info)
        {
          end_beam ();
        }
-      else if (Bar *b = dynamic_cast<Bar *> (info.elem_l_))
+      else if (to_boolean (info.elem_l_->get_elt_property ("bar-interface")))
        {
          end_beam ();
        }
index 00c4c8d32c02145beb4878160843d6cbeb8371af..f426b856c95ce2a14839e8e0aa64c217c911acad 100644 (file)
@@ -59,7 +59,7 @@ Axis_group_interface::relative_group_extent (Axis a, Score_element *common, SCM
 }
 
 Interval
-Axis_group_interface::group_extent_callback (Score_element const*me, Axis a)
+Axis_group_interface::group_extent_callback (Score_element *me, Axis a)
 {
   Score_element * common =(Score_element*) me;
 
index 5b50831fca15d6a80e39da9839420cd8e0edc6be..c007e311bf3fde8c773d9d4c39be82cb288bf807 100644 (file)
@@ -857,7 +857,7 @@ Beam::last_visible_stem () const
     rest -> stem -> beam -> interpolate_y_position ()
 */
 Real
-Beam::rest_collision_callback (Score_element const *rest, Axis a )
+Beam::rest_collision_callback (Score_element *rest, Axis a )
 {
   assert (a == Y_AXIS);
 
index bbea713e2bb8d1f711fad9d141242db4371b5c9a..2977cde738abb1a4ae339e96601cb795ddcbc41b 100644 (file)
 
 #include "side-position-interface.hh"
 #include "warn.hh"
-#include "dimension-cache.hh"
 #include "lily-guile.hh"
 #include "break-align-item.hh"
 #include "dimensions.hh"
-#include "paper-score.hh"
 #include "paper-def.hh"
 #include "paper-column.hh"
+
 #include "group-interface.hh"
 #include "align-interface.hh"
 
index 151fbbff79a917432a22d905880da57d64aa2797..1088b39d33378f20393b89d8ae62c6d27255761b 100644 (file)
@@ -36,7 +36,7 @@ protected:
 
 private:
   Breathing_sign_req * breathing_sign_req_l_;
-  Breathing_sign * breathing_sign_p_;
+  Score_element * breathing_sign_p_;
 };
 
 Breathing_sign_engraver::Breathing_sign_engraver()
@@ -63,9 +63,9 @@ Breathing_sign_engraver::do_process_music()
   if(breathing_sign_req_l_)
     {
       SCM b = get_property ("basicBreathingSignProperties");
-      breathing_sign_p_ = new Breathing_sign (b);
-      Staff_symbol_referencer_interface st (breathing_sign_p_);
-      st.set_interface ();
+      breathing_sign_p_ = new Item (b);
+
+      Breathing_sign::set_interface (breathing_sign_p_);
 
       announce_element (Score_element_info (breathing_sign_p_, breathing_sign_req_l_));
     }
index cc743c5a28be79faf0d74f243bc12c716c18c650..73580c0f2c5950f11a4b900b63fce37bba72bb3d 100644 (file)
 #include "direction.hh"
 
 
-Breathing_sign::Breathing_sign (SCM  s)
-  : Item (s)
-{
-}
-
-
 
 MAKE_SCHEME_SCORE_ELEMENT_CALLBACK(Breathing_sign,brew_molecule);
 
@@ -45,20 +39,25 @@ Breathing_sign::brew_molecule (SCM smob)
   return sc->lookup_l()->filledbox(b).create_scheme ();
 }
 
-GLUE_SCORE_ELEMENT(Breathing_sign,after_line_breaking);
-SCM
-Breathing_sign::member_after_line_breaking ()
+Real
+Breathing_sign::offset_callback (Score_element * b, Axis a)
 {
-  Real space = Staff_symbol_referencer_interface (this).staff_space();
-  Direction d = Directional_element_interface (this). get ();
+  Score_element * me = (Score_element*)b;
+  
+  Real space = Staff_symbol_referencer_interface (b).staff_space();
+  Direction d = Directional_element_interface (b). get ();
   if (!d)
     {
       d = UP;
-      Directional_element_interface (this).set (d);
+      Directional_element_interface (me).set (d);
     }
 
-  translate_axis(2.0 * space * d, Y_AXIS);
-
-  return SCM_UNDEFINED;
+  return 2.0 * space * d;
 }
 
+void
+Breathing_sign::set_interface (Score_element *b)
+{
+  Staff_symbol_referencer_interface::set_interface  (b);
+  b->add_offset_callback (Breathing_sign::offset_callback,Y_AXIS); 
+}
index cab0239b3c0921505fd51fcea83300a4eb77e51c..3e82a773508c26e4ab030dd7aa78f0a8b2b82f6e 100644 (file)
@@ -6,8 +6,9 @@
   (c) 1998--2000 Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
-#include "chord-name-engraver.hh"
+#include "engraver.hh"
 #include "chord-name.hh"
+#include "chord.hh"
 #include "musical-request.hh"
 #include "paper-def.hh"
 #include "lookup.hh"
 #include "main.hh"
 #include "dimensions.hh"
 #include "item.hh"
+#include "musical-pitch.hh"
 
+class Chord_name_engraver : public Engraver 
+{
+public:
+  Chord_name_engraver ();
+  VIRTUAL_COPY_CONS (Translator);
+
+protected:
+  virtual void do_pre_move_processing ();
+  virtual void acknowledge_element (Score_element_info i);
+  virtual void do_process_music ();
+  virtual bool do_try_music (Music* m);
+
+private:
+  Array<Musical_pitch> pitch_arr_;
+  Item* chord_name_p_;
+  Tonic_req* tonic_req_;
+  Inversion_req* inversion_req_;
+  Bass_req* bass_req_;
+};
 
 ADD_THIS_TRANSLATOR (Chord_name_engraver);
 
@@ -73,7 +94,7 @@ Chord_name_engraver::do_process_music ()
   if (gh_boolean_p (chord_inversion))
     find_inversion_b = gh_scm2bool (chord_inversion);
 
-  chord_name_p_ = new Chord_name (get_property ("basicChordNameProperties"));
+  chord_name_p_ = new Item (get_property ("basicChordNameProperties"));
   Chord chord = to_chord (pitch_arr_, tonic_req_, inversion_req_, bass_req_,
                          find_inversion_b);
 
index 0d4ff138499a7b2fe91603e5b84df0bfaa033951..bcc0abea3daf24f71318669467d4184c9b461e1d 100644 (file)
@@ -7,14 +7,10 @@
 */
 
 #include "chord-name.hh"
-#include "musical-request.hh"
-#include "warn.hh"
-#include "debug.hh"
 #include "molecule.hh"
 #include "paper-def.hh"
 #include "lookup.hh"
-#include "staff-symbol-referencer.hh"
-
+#include "score-element.hh"
 
 /*
   TODO: move text lookup out of Chord_name
@@ -27,7 +23,7 @@
  */
 
 Molecule
-Chord_name::ly_word2molecule (SCM word, Real* x) const
+Chord_name::ly_word2molecule (Score_element * me, SCM word, Real* x) 
 {
   *x = 0;
 
@@ -43,10 +39,10 @@ Chord_name::ly_word2molecule (SCM word, Real* x) const
       /*
        UGH. Should read from font metric structure.
       */
-      Real ex = lookup_l ()->text ("", "x",
-                                  paper_l ()).extent (Y_AXIS).length ();
-      Real em = lookup_l ()->text ("", "m",
-                                  paper_l ()).extent (X_AXIS).length ();
+      Real ex = me->lookup_l ()->text ("", "x",
+                                  me->paper_l ()).extent (Y_AXIS).length ();
+      Real em = me->lookup_l ()->text ("", "m",
+                                  me->paper_l ()).extent (X_AXIS).length ();
 
       String w = ly_scm2string (word);
 
@@ -90,9 +86,9 @@ Chord_name::ly_word2molecule (SCM word, Real* x) const
       Molecule mol;
       s = scm_assoc (ly_symbol2scm ("font"), options_alist);
       if (s != SCM_BOOL_F && ly_scm2string (gh_cdr (s)) == "feta")
-        mol = paper_l ()->lookup_l (size)->afm_find (w);
+        mol = me->paper_l ()->lookup_l (size)->afm_find (w);
       else
-       mol = paper_l ()->lookup_l (size)->text (style, w, paper_l ());
+       mol = me->paper_l ()->lookup_l (size)->text (style, w, me->paper_l ());
 
       mol.translate (offset);
       return mol;
@@ -106,7 +102,7 @@ Chord_name::ly_word2molecule (SCM word, Real* x) const
   ;; property: align, kern, font (?), size
  */
 Molecule
-Chord_name::ly_text2molecule (SCM text) const
+Chord_name::ly_text2molecule (Score_element * me, SCM text) 
 {
   Molecule mol;
   if (gh_list_p (text))
@@ -114,7 +110,7 @@ Chord_name::ly_text2molecule (SCM text) const
       while (gh_cdr (text) != SCM_EOL)
         {
          Real x;
-         Molecule m = ly_word2molecule (gh_car (text), &x);
+         Molecule m = ly_word2molecule (me, gh_car (text), &x);
          if (!m.empty_b ())
            mol.add_at_edge (X_AXIS, RIGHT, m, x);
          text = gh_cdr (text);
@@ -122,7 +118,7 @@ Chord_name::ly_text2molecule (SCM text) const
       text = gh_car (text);
     }  
   Real x;
-  Molecule m = ly_word2molecule (text, &x);
+  Molecule m = ly_word2molecule (me,text, &x);
   if (!m.empty_b ())
     mol.add_at_edge (X_AXIS, RIGHT, m, x);
   return mol;
@@ -154,11 +150,5 @@ Chord_name::brew_molecule (SCM smob)
                                ly_quote_scm (gh_cons (inversion, bass)),
                                SCM_UNDEFINED));
 
-  return dynamic_cast<Chord_name*> (sc)->
-    ly_text2molecule (text).create_scheme ();
-}
-
-Chord_name::Chord_name (SCM s)
-  : Item (s)
-{
+  return ly_text2molecule (sc, text).create_scheme ();
 }
index def1a6262200431376c7c954fb1d1ea41d993712..4267a357795079486472535bd0bb1248433d26cb 100644 (file)
 #include <ctype.h>
 
 #include "staff-symbol-referencer.hh"
-#include "bar.hh"
-
 #include "debug.hh"
 #include "command-request.hh"
-#include "timing-translator.hh"
-#include "rhythmic-head.hh"
-#include "key-item.hh"
-#include "local-key-item.hh"
 #include "array.hh"
 #include "engraver.hh"
 #include "direction.hh"
@@ -126,22 +120,23 @@ Clef_engraver::set_type (String s)
 void
 Clef_engraver::acknowledge_element (Score_element_info info)
 {
-  if (dynamic_cast<Bar*>(info.elem_l_)
-      && gh_string_p (clef_glyph_))
-    create_clef();
-
-  Item * it_l =dynamic_cast <Item *> (info.elem_l_);
-  if (it_l)
+  Item * item =dynamic_cast <Item *> (info.elem_l_);
+  if (item)
     {
-      if (to_boolean (it_l->get_elt_property("note-head-interface"))
-         || dynamic_cast<Local_key_item*> (it_l))
+      if (to_boolean (info.elem_l_->get_elt_property ("bar-interface"))
+         && gh_string_p (clef_glyph_))
+       create_clef();
+      
+
+      if (to_boolean (item->get_elt_property("note-head-interface"))
+         || to_boolean (item->get_elt_property ("accidentals-interface")))
        {
-         Staff_symbol_referencer_interface si (it_l);
+         Staff_symbol_referencer_interface si (item);
          si.set_position (int (si.position_f ()) + c0_position_i_);
        }
-      else if (Key_item *k = dynamic_cast<Key_item*>(it_l))
+      else if (to_boolean (item->get_elt_property ("key-item-interface")))
        {
-         k->set_elt_property ("c0-position", gh_int2scm (c0_position_i_));
+         item->set_elt_property ("c0-position", gh_int2scm (c0_position_i_));
        }
     } 
 }
@@ -180,8 +175,7 @@ Clef_engraver::create_clef()
       Item *c= new Item ( current_settings_);
       announce_element (Score_element_info (c, clef_req_l_));
 
-      Staff_symbol_referencer_interface si(c);
-      si.set_interface ();
+      Staff_symbol_referencer_interface::set_interface (c);
       
       clef_p_ = c;
     }
index 9cedc344799fd404ccfa8c23f0ec0c5ecb910677..9316fcd2f3a7af2371cc8e62707443eaf7429e36 100644 (file)
@@ -22,7 +22,7 @@ Collision::add_column (Note_column* ncol_l)
 }
 
 Real
-Collision::force_shift_callback (Score_element const * c, Axis a)
+Collision::force_shift_callback (Score_element * c, Axis a)
 {
   assert (a == X_AXIS);
   
index d555327c8ef1318bb9132eb1797115271499265d..908851d168da4ae0934c741c08103aae377cfbbf 100644 (file)
@@ -7,10 +7,25 @@
   
  */
 
-#include "dot-column-engraver.hh"
+
 #include "rhythmic-head.hh"
 #include "dot-column.hh"
 #include "side-position-interface.hh"
+#include "engraver.hh"
+
+class Dot_column_engraver : public Engraver
+{
+  Score_element *dotcol_p_ ;
+  Link_array<Rhythmic_head> head_l_arr_;
+public:
+  VIRTUAL_COPY_CONS(Translator);
+  Dot_column_engraver();
+  
+protected:
+  virtual void acknowledge_element (Score_element_info);
+  virtual void do_pre_move_processing ();  
+};
+
 
 Dot_column_engraver::Dot_column_engraver ()
 {
@@ -31,22 +46,21 @@ Dot_column_engraver::do_pre_move_processing ()
 void
 Dot_column_engraver::acknowledge_element (Score_element_info info)
 {
-  Rhythmic_head * h = dynamic_cast<Rhythmic_head*>(info.elem_l_);
-  if (!h)
-      return;
+  Score_element *d = unsmob_element (info.elem_l_->get_elt_pointer ("dot"));
+  if (d)
+    {
+      if (!dotcol_p_)
+       {
+         dotcol_p_ = new Item(get_property ("basicDotColumnProperties"));
 
-  if (!h->dots_l ())
-    return;
+         Dot_column::set_interface (dotcol_p_);
+         Side_position_interface (dotcol_p_).set_axis (X_AXIS);
+         Side_position_interface (dotcol_p_).set_direction (RIGHT);      
+         announce_element (Score_element_info (dotcol_p_, 0));
+       }
 
-  if (!dotcol_p_)
-    {
-      dotcol_p_ = new Dot_column(get_property ("basicDotColumnProperties"));
-      Side_position_interface (dotcol_p_).set_axis (X_AXIS);
-      Side_position_interface (dotcol_p_).set_direction (RIGHT);      
-      announce_element (Score_element_info (dotcol_p_, 0));
+      Dot_column::add_head (dotcol_p_, info.elem_l_);
     }
-
-  dotcol_p_->add_head (h);
 }
 
 
index a725998bcfc69462404eeaef29d9addd9a95bf88..f3ce19ad83713299b1da8145c5e567a6301a0308 100644 (file)
 
 
 void
-Dot_column::add_head (Rhythmic_head *r)
+Dot_column::add_head (Score_element * dc, Score_element *rh)
 {
-  if (!r->dots_l ())
-    return ;
-
-  Side_position_interface (this).add_support (r);
-  Item * d = r->dots_l ();
+  Score_element * d = unsmob_element (rh->get_elt_pointer ("dot"));
   if (d)
     {
-      Pointer_group_interface gi (this, "dots");
+      Side_position_interface (dc).add_support (rh);
+
+      Pointer_group_interface gi (dc, "dots");
       gi.add_element (d);
       
       d->add_offset_callback (force_shift_callback , Y_AXIS);
-      Axis_group_interface (this).add_element (d);
+      Axis_group_interface (dc).add_element (d);
     }
 }
 
@@ -46,14 +44,14 @@ Dot_column::compare (Score_element * const &d1, Score_element * const &d2)
 }
 
 
-Dot_column::Dot_column (SCM s)
-  : Item (s)
+void
+Dot_column::set_interface (Score_element* dc)
 {
-  this->set_elt_pointer  ("dots", SCM_EOL);
-  Directional_element_interface (this).set (RIGHT);
+  dc->set_elt_pointer  ("dots", SCM_EOL);
+  Directional_element_interface (dc).set (RIGHT);
   
-  Axis_group_interface (this).set_interface ();
-  Axis_group_interface (this).set_axes(X_AXIS,X_AXIS);
+  Axis_group_interface (dc).set_interface ();
+  Axis_group_interface (dc).set_axes(X_AXIS,X_AXIS);
 }
 
 /*
@@ -74,7 +72,7 @@ Dot_column::Dot_column (SCM s)
 
 
 Real
-Dot_column::force_shift_callback (Score_element const * dot, Axis a)
+Dot_column::force_shift_callback (Score_element * dot, Axis a)
 {
   assert (a == Y_AXIS);
   Score_element * me = dot->parent_l (X_AXIS);
index 6a037d9f803d83504700db58d2871e042e0a14f8..929aabf96f5b11a9e548ce118b5d2d6b912f554a 100644 (file)
@@ -16,7 +16,7 @@
 
 
 Real
-Dots::quantised_position_callback (Score_element const* me, Axis a)
+Dots::quantised_position_callback (Score_element * me, Axis a)
 {
   assert (a == Y_AXIS);
     
index c9e42d7be1dba7d4cfe71db58a625bec18c7de6e..04b2cca234d3d1ccdabf7ba5326767e86fcd963f 100644 (file)
@@ -38,7 +38,7 @@ struct Align_interface  {
   Score_element * elt_l_;
   
   Align_interface (Score_element const*);
-  static Real alignment_callback (Score_element const*,Axis);
+  static Real alignment_callback (Score_element *,Axis);
   void do_side_processing (Axis a);
   void set_axis (Axis);
   Axis axis () const;
@@ -46,7 +46,7 @@ struct Align_interface  {
   int get_count (Score_element*)const;
   void set_interface ();
   bool has_interface_b ();
-  static Real center_on_element (Score_element const *c, Axis);
+  static Real center_on_element (Score_element *c, Axis);
 };
 
 #endif /* ALIGN_INTERFACE_HH */
index 3d72a99494eae311437be103feaa96d5103f5862..f99d23213350932ec20b21b899c2f619fa64e855 100644 (file)
@@ -31,7 +31,7 @@ struct Axis_group_interface
   Score_element *elt_l_;
   Axis_group_interface (Score_element*);
 
-  static Interval group_extent_callback (Score_element const*,Axis);
+  static Interval group_extent_callback (Score_element *,Axis);
   static Interval relative_group_extent (Axis, Score_element * common, SCM list);
 
   void add_element (Score_element*);
index 9a85134d641b1f1795c17888365f0536f5ca24f2..3efb7c2827377a13963b2bd2e507511ab5943580 100644 (file)
@@ -35,7 +35,7 @@ public:
   int visible_stem_count () const;
   Stem* first_visible_stem () const;
   Stem* last_visible_stem () const;
-  static Real rest_collision_callback (Score_element const*,Axis);
+  static Real rest_collision_callback (Score_element *,Axis);
   Beam (SCM);
   void add_stem (Stem*);
   void set_grouping (Rhythmic_grouping def, Rhythmic_grouping current);
index dd495b1db866198b6b1ebb6d31033dce867b3b84..a3c3bb9be0e4d2fac12097da911e3d9e7f5c2801 100644 (file)
 #ifndef BREATHING_SIGN_HH
 #define BREATHING_SIGN_HH
 
-#include "item.hh"
-#include "parray.hh"
+#include "lily-guile.hh"
 
 /*
   breathing sign (apostrophe within staff, not the comma above staff
   type)
 */
-class Breathing_sign : public Item
+class Breathing_sign
 {
 public:
   static SCM brew_molecule (SCM);
-  
-  VIRTUAL_COPY_CONS(Score_element);
-  Breathing_sign (SCM s);
-public:
-  SCM member_after_line_breaking ();
-  static SCM after_line_breaking (SCM);
-  SCM member_brew_molecule () const;
+  static Real offset_callback (Score_element *, Axis);
+  static void set_interface (Score_element*);
 };
 
 #endif // BREATHING_SIGN_HH
index fae9d217b0a8c67cb07e7b37b7b3779e3ca56f14..b4b55b318ba2012ce633495d55d102f085040ba2 100644 (file)
@@ -9,8 +9,7 @@
 #ifndef CHORD_NAME_HH
 #define CHORD_NAME_HH
 
-#include "chord.hh"
-#include "item.hh"
+#include "lily-guile.hh"
 #include "molecule.hh"
 
 /**
    inversion(optional): musical-pitch
    bass(optional): musical-pitch
  */
-class Chord_name : public Item
+class Chord_name
 {
 public:
   static SCM brew_molecule (SCM);
-  
-  VIRTUAL_COPY_CONS (Score_element);
-  Molecule ly_word2molecule (SCM scm, Real* x) const;
-  Molecule ly_text2molecule (SCM scm) const;
-  Chord_name(SCM s);
-public:
-  SCM member_brew_molecule () const;
-
+  static Molecule ly_word2molecule (Score_element*, SCM scm, Real* x) ;
+  static Molecule ly_text2molecule (Score_element*, SCM scm) ;
 };
 
 #endif // CHORD_NAME_HH
index 6f7ffbb4711be42f89158d5d09d9dcc988f3061a..3e88c982b2cdfbdfd28502e38cae09f40aa65993 100644 (file)
@@ -42,7 +42,7 @@ public:
   Score_element*  elt_l_;
   static SCM automatic_shift (Score_element*);
   static SCM forced_shift (Score_element*);
-  static Real force_shift_callback (Score_element const*, Axis);
+  static Real force_shift_callback (Score_element *, Axis);
   static void do_shifts (Score_element*);
 
   void add_column (Note_column*ncol_l);
index 6c58b1d2e95ee06f4479ce2ec0881e72b86d83cd..b14b0b16aacec62aa987e527d87aa757545a9980 100644 (file)
@@ -11,8 +11,8 @@
 #define DIMENSION_CACHE_CALLBACK_HH
 
 
-typedef Interval (*Dim_cache_callback)(Score_element const *,Axis);
-typedef Real (*Offset_callback)(Score_element const *,Axis);
+typedef Interval (*Dim_cache_callback)(Score_element *,Axis);
+typedef Real (*Offset_callback)(Score_element *,Axis);
 
 #endif /* DIMENSION_CACHE_CALLBACK_HH */
 
index e812875e99da32328b45a0b9064f39c88e173fd6..db18bf572dc8577b71dded790a2364034dbf884c 100644 (file)
 #ifndef DOT_COLUMN_HH
 #define DOT_COLUMN_HH
 
-#include "item.hh"
-
+#include "lily-guile.hh"
 
 /**
   Group dots.  This is needed because, the dots have to be aligned per voice
  */
-class Dot_column : public Item
+class Dot_column               // interface
 {
-  static int compare (Score_element * const&,Score_element * const&);
 public:
-  VIRTUAL_COPY_CONS (Score_element);
-  void add_head (Rhythmic_head*);
-  Dot_column (SCM);
-  
-  static Real force_shift_callback (Score_element const* , Axis);
+  static int compare (Score_element * const&,Score_element * const&);
+  static void add_head (Score_element * dotcol, Score_element* rh );
+  static void set_interface (Score_element*);
+  static Real force_shift_callback (Score_element * , Axis);
   static SCM do_shifts (SCM dotlist);
 };
 #endif // DOT_COLUMN_HH
index 21be4f774761090e2192a6c3018d7eee061edd8b..76189d65f67522b83196e664cc276fa99d74c546 100644 (file)
@@ -27,7 +27,7 @@
 class Dots                     // interface
 {
 public:
-  static Real quantised_position_callback(Score_element const*, Axis);
+  static Real quantised_position_callback(Score_element*, Axis);
   static SCM brew_molecule (SCM);
 };
 
index 756a2b013988a96ebfd95a408ead2dce78511e54..e77703b9a31e33045a1500628e7e1c8baad72e05 100644 (file)
@@ -7,9 +7,8 @@
 #ifndef KEYITEM_HH
 #define KEYITEM_HH
 
-#include "item.hh"
-#include "array.hh"
-
+#include "lily-guile.hh"
+#include "lily-proto.hh"
 
 /**
   A group of  accidentals.
 
   new-accidentals -- list of (pitch, accidental) pairs
  */
-class Key_item :public  Item
+struct Key_item
 {
-  int calculate_position(SCM pair) const;
-
-public:
-  VIRTUAL_COPY_CONS(Score_element);
-  Key_item (SCM);
+  static int calculate_position(Score_element*,SCM pair) ;
+  void set_interface (Score_element*);
   static SCM brew_molecule (SCM);
-  
-
-
-  SCM member_brew_molecule() const;
 };
 
 #endif // KEYITEM_HH
index 0006c857bc16c47e2b0b82bcd59e1b71781ae9ba..01eba650076951905370ba8f72e436415f078b09 100644 (file)
@@ -6,6 +6,8 @@
 
 #ifndef LOCALKEYITEM_HH
 #define LOCALKEYITEM_HH
+
+
 #include "item.hh"
 #include "array.hh"
 #include "musical-pitch.hh"
index 4eaddd45d73e1a52b23a112f79983b63c5b9b535..baf03668b40b2de755b717376991de9e99a5f4c3 100644 (file)
@@ -22,7 +22,7 @@ public:
   Rest_collision(Score_element*);
   void set_interface ();
 
-  static Real force_shift_callback (Score_element const*, Axis);
+  static Real force_shift_callback (Score_element *, Axis);
   static SCM do_shift (Score_element*,SCM);
 };
 #endif // REST_COLLISION_HH
index 32398bb089d909ab9fb9d321f03ce60b109698d5..9ae036d0d56803faa8f1e79291967d1115733c1d 100644 (file)
@@ -14,8 +14,8 @@
 #include "smobs.hh"
 #include "dimension-cache.hh"
 
-typedef Interval (*Extent_callback)(Score_element const *,Axis);
-typedef Real (*Offset_callback)(Score_element const *,Axis);
+typedef Interval (*Extent_callback)(Score_element *,Axis);
+typedef Real (*Offset_callback)(Score_element *,Axis);
 
 #define READONLY_PROPS         // FIXME.
 
@@ -167,9 +167,9 @@ public:
   Molecule get_molecule () const;
   void suicide ();
   
-  static Interval preset_extent (Score_element const*,Axis);
-  static Interval point_dimension_callback (Score_element const*,Axis );
-  static Interval molecule_extent (Score_element const*,Axis);
+  static Interval preset_extent (Score_element *,Axis);
+  static Interval point_dimension_callback (Score_element *,Axis );
+  static Interval molecule_extent (Score_element *,Axis);
 
 protected:
   /**
index 9c580c50833b3699d43b068c5363e73a81e3022c..1e41d86583ce46cfbd2895ff4d3f2658e30d50aa 100644 (file)
 #ifndef Script_COLUMN_HH
 #define Script_COLUMN_HH
 
-#include "item.hh"
+#include "lily-guile.hh"
+#include "lily-proto.hh"
 
-class Script_column : public Item
+class Script_column
 {
 public:
-  Script_column(SCM);
-  void add_staff_sided (Item*);
-
-  SCM member_before_line_breaking ();
+  static void add_staff_sided (Score_element*, Item*);
   static SCM before_line_breaking (SCM);
 };
 
index 4d7bc39cfd0e30b9d85a7fa08631ebe4b80fb715..df31d40d15e094b84bdc41535d92484f417ed0c1 100644 (file)
 */
 class Script : public Item
 {
-  Molecule get_molecule (Direction d) const;
 public:
+  static  Molecule get_molecule (Score_element*,Direction d);
   Script (SCM);
-   static SCM brew_molecule (SCM);
-  
-
-
-  SCM member_before_line_breaking ();
-  static SCM before_line_breaking (SCM);
+  static SCM brew_molecule (SCM);
   SCM member_after_line_breaking ();
   static SCM after_line_breaking (SCM);
-  SCM member_brew_molecule () const;
 };
 
 #endif /* Stem_SCRIPT_HH */
index bfbe26506224c4fd7ecbb9da67a14010ebf029f3..f947eb57ba93554ebb8ac806442fc83fbaf04390 100644 (file)
@@ -15,7 +15,7 @@
 class Separating_group_spanner : public Spanner
 {
 public:
-  void add_spacing_unit (Single_malt_grouping_item*);
+  void add_spacing_unit (Item*);
   Separating_group_spanner(SCM);
 protected:
   VIRTUAL_COPY_CONS(Score_element);
index eccb4b0ee4dce690d552322bce7e2d2aaf10b9a1..6a26cd3194ce78e49a5e42cb8b15017df291a96f 100644 (file)
@@ -9,26 +9,5 @@
 
 #ifndef SEPARATING_LINE_GROUP_GRAV_HH
 #define SEPARATING_LINE_GROUP_GRAV_HH
-
-#include "engraver.hh"
-
-class Separating_line_group_engraver : public Engraver
-{
-protected:
-  Single_malt_grouping_item * break_malt_p_;
-  Single_malt_grouping_item* nobreak_malt_p_;
-  Separating_group_spanner * sep_span_p_;
-  
-  virtual void acknowledge_element (Score_element_info);
-  virtual void do_creation_processing ();
-  virtual void do_removal_processing ();
-  virtual void do_pre_move_processing ();
-public:
-  Separating_line_group_engraver ();
-  VIRTUAL_COPY_CONS (Translator);
-  
-};
-
-
 #endif /* SEPARATING_LINE_GROUP_GRAV_HH */
 
diff --git a/lily/include/separation-item.hh b/lily/include/separation-item.hh
new file mode 100644 (file)
index 0000000..a7bfa6e
--- /dev/null
@@ -0,0 +1,36 @@
+/*   
+  single-malt-grouping-item.hh -- declare Separation_item
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c)  1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  
+ */
+
+#ifndef SINGLE_MALT_GROUPING_ITEM_HH
+#define SINGLE_MALT_GROUPING_ITEM_HH
+
+#include "lily-proto.hh"
+
+/** Calc dimensions for the Separating_group_spanner; this has to be
+   an item to get dependencies correct.  It can't be an element_group
+   since these usually are in a different X_group
+
+   Properties:
+
+
+   elements -- list of items.
+   
+   no-spacing-rods -- read from elements: boolean that makes Separation_item ignore
+     this item
+   
+*/
+struct Separation_item
+{
+  static void set_interface (Score_element*);
+  static Interval my_width (Score_element*) ;
+  static void add_item (Score_element*,Item*);
+};
+
+#endif /* SINGLE_MALT_GROUPING_ITEM_HH */
+
index 8ace8fcad84bcedda5a7899cbf85546d75d2ee52..117fd8caed604b45fb806c36bc8dd87b7d90517a 100644 (file)
@@ -39,11 +39,11 @@ struct Side_position_interface
   Score_element * elt_l_;
 public:
   Side_position_interface (Score_element const*);
-  static Real side_position (Score_element const *, Axis);
-  static Real aligned_on_self (Score_element const *, Axis);
-  static Real aligned_side (Score_element const *, Axis);  
-  static Real quantised_position (Score_element const*, Axis);
-  static Real centered_on_parent (Score_element const*, Axis);
+  static Real side_position (Score_element *, Axis);
+  static Real aligned_on_self (Score_element *, Axis);
+  static Real aligned_side (Score_element *, Axis);  
+  static Real quantised_position (Score_element *, Axis);
+  static Real centered_on_parent (Score_element *, Axis);
   void set_axis (Axis);
   void set_minimum_space (Real);
   void set_padding (Real);
index 9ccb4d65b37e571d17cce28aee606001240e1f89..52079f0a5ac93c4cc61ed1b1bff6f160ca48bf7a 100644 (file)
@@ -31,7 +31,7 @@ public:
   void add_bar (Score_element*);
   void evaluate_empty ();
 
-  static Interval width_callback(Score_element const*, Axis) ;
+  static Interval width_callback(Score_element *, Axis) ;
   
   virtual Real get_bar_size () const;
   SCM member_before_line_breaking ();
index 9734cf17afb7d77378ee67837b99745e85eae328..202f27f0ded4214fe476b2e74e6c122b10c920b3 100644 (file)
 class Staff_symbol_referencer_interface 
 {
 public:
-  Score_element * elt_l_;
+  Score_element * elt_l_;      // junkme.
   Staff_symbol_referencer_interface (Score_element const*);
-  void set_interface ();
-  bool has_interface_b ();
+  static void set_interface (Score_element*);
+  static bool has_interface_b (Score_element*);
   void set_position (Real);
-  static Real callback (Score_element const*, Axis a);
+  static Real callback (Score_element *, Axis a);
 
   /**
      Leading are the lead strips between the sticks (lines) of
index ed0f619d0fdf5d4b77b5e2af18171a07717d6fe1..2897b07d538d090b27bdc3a721cc7984de916576 100644 (file)
@@ -88,12 +88,12 @@ public:
   void position_noteheads();
 
   Real stem_end_position () const;
-  static Real off_callback (Score_element const*, Axis);
+  static Real off_callback (Score_element *, Axis);
   Molecule flag () const;
 
   SCM member_before_line_breaking ();
   static SCM before_line_breaking (SCM);
-  static Interval dim_callback (Score_element const*,Axis);
+  static Interval dim_callback (Score_element *,Axis);
   SCM member_brew_molecule() const;
 
   void set_spacing_hints () ;
index 80a08ac7a61bba9c8b36caf7e1b1dd90b53c9019..f25d12c866863b7cffc7fa5c959500bfbea994f1 100644 (file)
@@ -8,34 +8,20 @@
 #define METER_HH
 
 #include "item.hh"
-#include "array.hh"
-#include "real.hh"
 
 /**
    Print a time_signature sign.
-  TODO:
 
-  C style time_signatures, 2+3+2/8 time_signatures, alla breve.
+   TODO:
+
+   2+3+2/8 time_signatures
   
  */
-class Time_signature: public Item
+struct Time_signature
 {
-  Molecule special_time_signature (String,int,int) const;
-  Molecule time_signature (int, int)const;
-  
-public:
-  SCM member_brew_molecule() const;
-
-  Time_signature (SCM);
- static SCM brew_molecule (SCM);
-  
-
-  /*
-    TODO: make this SCM!
-   */
-  Array<int> args_;
-  
-  VIRTUAL_COPY_CONS(Score_element);
+  static Molecule special_time_signature (Score_element*,String,int,int) ;
+  static Molecule time_signature (Score_element*,int, int);
+  static SCM brew_molecule (SCM);
 };
 #endif // METER_HH
 
index 524d32cffaa013748f05682c0f42d6cc3701b3c1..3d5f48e83ac8dbd564f53f01b4a1d29a3ff704de 100644 (file)
@@ -32,8 +32,8 @@ public:
   VIRTUAL_COPY_CONS(Translator);
 
   Key_change_req * keyreq_l_;
-  Key_item * item_p_;
-  Protected_scm old_accs_;
+  Item * item_p_;
+  Protected_scm old_accs_;     // ugh. -> property
     
 protected:
   virtual void do_creation_processing();
@@ -56,16 +56,15 @@ Key_engraver::create_key (bool def)
 {
   if (!item_p_) 
     {
-      item_p_ = new Key_item ( get_property ("basicKeyProperties"));
-      
+      item_p_ = new Item ( get_property ("basicKeyProperties"));
+
       item_p_->set_elt_property ("c0-position", gh_int2scm (0));
 
       // todo: put this in basic props.
       item_p_->set_elt_property ("old-accidentals", old_accs_);
       item_p_->set_elt_property ("new-accidentals", get_property ("keySignature"));
 
-      Staff_symbol_referencer_interface st (item_p_);
-      st.set_interface ();
+      Staff_symbol_referencer_interface::set_interface (item_p_);
 
       SCM prop = get_property ("keyOctaviation");
       bool multi = to_boolean (prop);
index 77a9e104188d80a4a0fe205d451429205e527693..871abd31ceefa68a39d6e584e238a6530397644c 100644 (file)
@@ -8,20 +8,13 @@
   keyplacement by Mats Bengtsson
 */
 
-#include "group-interface.hh" 
+#include "item.hh"
 #include "key-item.hh"
 #include "molecule.hh"
 #include "paper-def.hh"
 #include "lookup.hh"
 #include "staff-symbol-referencer.hh"
 
-Key_item::Key_item (SCM s)
-  : Item (s)
-{
-  set_elt_property ("c0-position", gh_int2scm (0));
-}
-
-
 /*
   FIXME: too much hardcoding here.
  */
@@ -34,18 +27,18 @@ const int SHARP_TOP_PITCH=4; /*  ais and bis typeset in lower octave */
   the thinking to other parties.
  */
 int
-Key_item::calculate_position(SCM pair) const
+Key_item::calculate_position(Score_element *ki, SCM pair) 
 {
   int p = gh_scm2int (gh_car (pair));
   int a = gh_scm2int (gh_cdr (pair));  
-  
-  if (to_boolean (get_elt_property ("multi-octave")))
+  int c0p = gh_scm2int (ki->get_elt_property ("c0-position"));
+  if (to_boolean (ki->get_elt_property ("multi-octave")))
     {
-      return p + gh_scm2int (get_elt_property ("c0-position"));
+      return p + c0p;
     }
   else {
     // Find the c in the range -4 through 2
-    int from_bottom_pos = gh_scm2int (get_elt_property ("c0-position")) + 4;
+    int from_bottom_pos = c0p + 4;
     from_bottom_pos = from_bottom_pos%7;
     from_bottom_pos = (from_bottom_pos + 7)%7; // Precaution to get positive.
     int c0 = from_bottom_pos - 4;
@@ -78,17 +71,18 @@ Key_item::calculate_position(SCM pair) const
   TODO
   - space the `natural' signs wider
  */
-GLUE_SCORE_ELEMENT(Key_item,brew_molecule);
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACK(Key_item,brew_molecule);
 SCM
-Key_item::member_brew_molecule () const
+Key_item::brew_molecule (SCM smob)
 {
-  Molecule mol;
+  Score_element*me =unsmob_element (smob);
 
-  Staff_symbol_referencer_interface si (this);
+
+  Staff_symbol_referencer_interface si (me);
   Real inter = si.staff_space ()/2.0;
   
-  SCM newas = get_elt_property ("new-accidentals");  
-
+  SCM newas = me->get_elt_property ("new-accidentals");  
+  Molecule mol;
   /*
     SCM lists are stacks, so we work from right to left, ending with
     the cancellation signature.
@@ -96,14 +90,15 @@ Key_item::member_brew_molecule () const
   for (SCM s = newas; gh_pair_p (s); s = gh_cdr (s))
     {
       int a = gh_scm2int (gh_cdar (s));
-      Molecule m = lookup_l ()->afm_find ("accidentals-" + to_str (a));
-      m.translate_axis (calculate_position(gh_car (s)) * inter, Y_AXIS);
+      Molecule m = me->lookup_l ()->afm_find ("accidentals-" + to_str (a));
+      m.translate_axis (calculate_position(me, gh_car (s)) * inter, Y_AXIS);
       mol.add_at_edge (X_AXIS, LEFT, m, 0);
     }
-  
-  if (break_status_dir () != RIGHT)
+
+  Item *it = dynamic_cast<Item*> (me) ;
+  if (it->break_status_dir () != RIGHT)
     {
-      SCM old = get_elt_property ("old-accidentals");
+      SCM old = me->get_elt_property ("old-accidentals");
       /*
        Add half a space between  cancellation and key sig.
 
@@ -112,7 +107,7 @@ Key_item::member_brew_molecule () const
       Interval x(0, inter);
       Interval y(0,0);
 
-      mol.add_at_edge (X_AXIS, LEFT, lookup_l()->blank (Box(x,y)),0);
+      mol.add_at_edge (X_AXIS, LEFT, me->lookup_l()->blank (Box(x,y)),0);
       
       for (; gh_pair_p (old); old = gh_cdr (old))
         {
@@ -127,9 +122,9 @@ Key_item::member_brew_molecule () const
                
          if (found == SCM_EOL || gh_cdr (found) != gh_cdar (old))
            {
-              Molecule m =lookup_l ()->afm_find ("accidentals-0");
+              Molecule m =me->lookup_l ()->afm_find ("accidentals-0");
 
-              m.translate_axis (calculate_position(gh_car(old)) * inter, Y_AXIS);
+              m.translate_axis (calculate_position (me, gh_car (old)) * inter, Y_AXIS);
               mol.add_at_edge (X_AXIS, LEFT, m,0);     
             }
         }
index 61326091ea5dceaf7ce15a701a1b23d4d7fb3880..a139f21ca5941188312067c90e1d797db7dc2a82 100644 (file)
@@ -220,7 +220,7 @@ sanitise_PS_string (String t)
 }
 
 /**
-TODO: move into Text_item
+TODO: move into Text_item. UGH: paper_l argument shoudl be junked.
 */
 Molecule
 Lookup::text (String style, String text, Paper_def *paper_l) 
index c072d2f461b505c0e3a9c03bd761efa85d8f38e5..035b18a3786e74db55a7b46d2c604ded7a16167c 100644 (file)
@@ -16,8 +16,6 @@
 #include "dimension-cache.hh"
 #include "staff-symbol-referencer.hh"
 
-
-
 /*
   build a ledger line for small pieces.
  */
index fa72a59e2f55a6779d4b9f3382854987d849fed5..49524aea218df88ae88af231d0ae1a7415b395e8 100644 (file)
@@ -87,8 +87,8 @@ Note_heads_engraver::do_process_music()
     {
       Rhythmic_head *note_p  = new Rhythmic_head (get_property ("basicNoteHeadProperties"));
       
-      Staff_symbol_referencer_interface si (note_p);
-      si.set_interface ();
+      Staff_symbol_referencer_interface::set_interface (note_p);
+
 
       
       Note_req * note_req_l = note_req_l_arr_[i];
@@ -100,8 +100,7 @@ Note_heads_engraver::do_process_music()
        {
          Item * d = new Item (get_property ("basicDotsProperties"));
 
-         Staff_symbol_referencer_interface sd (d);
-         sd.set_interface ();
+         Staff_symbol_referencer_interface::set_interface (d);
          
          note_p->set_dots (d);
          
@@ -114,7 +113,8 @@ Note_heads_engraver::do_process_music()
          announce_element (Score_element_info (d,0));
          dot_p_arr_.push (d);
        }
-      si.set_position(note_req_l->pitch_.steps ());
+
+      note_p->set_elt_property("staff-position",  gh_int2scm (note_req_l->pitch_.steps ()));
 
       Score_element_info itinf (note_p,note_req_l);
       announce_element (itinf);
index 2a38b27d2ba391b1bf294eb6ba68d5f0609bcfc9..969741809b67e05cbd271fb744fb2709edbc2672 100644 (file)
@@ -20,7 +20,7 @@
 #include "duration.hh"
 
 Real
-Rest_collision::force_shift_callback (Score_element const*them, Axis a)
+Rest_collision::force_shift_callback (Score_element *them, Axis a)
 {
   assert (a == Y_AXIS);
 
index ccc80a3f82de05f2f6fe3916280e4cb485cf3aae..35df3f18ec8af778f710135f9a80ad76ee10a70f 100644 (file)
@@ -65,8 +65,8 @@ Rest_engraver::do_process_music ()
   if (rest_req_l_ && !rest_p_) 
     {
       rest_p_ = new Rhythmic_head (get_property ("basicRestProperties"));
-      Staff_symbol_referencer_interface si (rest_p_);
-      si.set_interface ();
+      Staff_symbol_referencer_interface::set_interface (rest_p_);
+
       
       rest_p_->set_elt_property ("duration-log",
                                 gh_int2scm (rest_req_l_->duration_.durlog_i_)); 
@@ -75,8 +75,8 @@ Rest_engraver::do_process_music ()
        {
          dot_p_ = new Item (get_property ("basicDotsProperties"));
 
-         Staff_symbol_referencer_interface si (dot_p_);
-         si.set_interface ();
+         Staff_symbol_referencer_interface::set_interface (dot_p_);
+
          
          rest_p_->set_dots (dot_p_);
          dot_p_->set_parent (rest_p_, Y_AXIS);
index dba6143faaac850313e3a107105a8368f78beb85..632beeb3af33216b0e34afe08d65fafabfd14f73 100644 (file)
@@ -21,7 +21,7 @@ class Rhythmic_column_engraver :public Engraver
   Link_array<Slur> grace_slur_endings_;
   Stem * stem_l_;
   Note_column *ncol_p_;
-  Dot_column *dotcol_l_;
+  Score_element *dotcol_l_;
 
 protected:
   VIRTUAL_COPY_CONS(Translator);
@@ -67,7 +67,7 @@ Rhythmic_column_engraver::process_acknowledged ()
   if (ncol_p_)
     {
       if (dotcol_l_
-         && !dotcol_l_->parent_l(X_AXIS))
+         && !dotcol_l_->parent_l (X_AXIS))
        {
          ncol_p_->set_dotcol (dotcol_l_);
        }
@@ -108,9 +108,10 @@ Rhythmic_column_engraver::acknowledge_element (Score_element_info i)
     {
       rhead_l_arr_.push (r);
     }
-  else if (Dot_column*d =dynamic_cast<Dot_column *> (item))
+  else if (item
+          && to_boolean (item->get_elt_property ("dot-column-interface")))
     {
-      dotcol_l_ = d;
+      dotcol_l_ = item;
     }
   else if (Slur *s = dynamic_cast<Slur*> (i.elem_l_))
     {
index 90af9edf1b67c577cdbd9ef2f3be5aa970a116d7..7d287f84bad9d942d1734ca85773ba0beb7d33b0 100644 (file)
@@ -10,7 +10,7 @@
 #include "paper-column.hh"
 #include "debug.hh"
 #include "dimensions.hh"
-#include "single-malt-grouping-item.hh"
+#include "separation-item.hh"
 
 
 Rod::Rod ()
index 5e929206f41e8093d5c256f4f06613bd54de4cf9..c79813468c6559b2050c702a27ad84e788fcb161 100644 (file)
@@ -138,14 +138,14 @@ Score_element::set_elt_pointer (const char* k, SCM v)
 
 
 Interval
-Score_element::molecule_extent (Score_element const *s, Axis a )
+Score_element::molecule_extent (Score_element *s, Axis a)
 {
   Molecule m = s->get_molecule ();
   return m.extent(a);
 }
 
 Interval
-Score_element::preset_extent (Score_element const *s , Axis a )
+Score_element::preset_extent (Score_element  *s , Axis a)
 {
   SCM ext = s->get_elt_property ((a == X_AXIS)
                                 ? "extent-X"
@@ -508,7 +508,7 @@ Score_element::get_offset (Axis a) const
 
 
 Interval
-Score_element::point_dimension_callback (Score_element const* , Axis)
+Score_element::point_dimension_callback (Score_element* , Axis)
 {
   return Interval (0,0);
 }
@@ -529,7 +529,7 @@ Score_element::extent (Axis a) const
     }
   else if (!d->valid_b_)
     {
-      d->dim_= (*d->extent_callback_l_ ) (this, a);
+      d->dim_= (*d->extent_callback_l_ ) ((Score_element*)this, a);
       d->valid_b_ = true;
     }
 
index 9fbf4f567d61c8d34da0f808f11e413ed28e16d6..e76d3c41a7ba1dc878b1db9c900a365151c650cf 100644 (file)
@@ -9,15 +9,15 @@
 
 #include "engraver.hh"
 #include "script-column.hh"
+#include "item.hh"
 #include "side-position-interface.hh"
-#include "dimension-cache.hh"
 
 /**
    Find potentially colliding scripts, and put them in a
    Script_column, that will fix the collisions.  */
 class Script_column_engraver : public Engraver
 {
-  Script_column *scol_p_;
+  Score_element *scol_p_;
   Link_array<Item> script_l_arr_;
 
 public:
@@ -73,14 +73,16 @@ Script_column_engraver::process_acknowledged ()
 {
   if (!scol_p_ && script_l_arr_.size () > 1)
     {
-      scol_p_ = new Script_column (SCM_EOL);
+      scol_p_ = new Item (get_property ("basicScriptColumnProperties"));
+      scol_p_->set_elt_pointer ("scripts", SCM_EOL);  
+
       announce_element (Score_element_info (scol_p_, 0));
     }
 
   if (scol_p_)
     {
       for (int i=0; i < script_l_arr_.size (); i++)
-       scol_p_->add_staff_sided (script_l_arr_[i]);
+       Script_column::add_staff_sided (scol_p_, script_l_arr_[i]);
       script_l_arr_.clear ();
     }
 }
index cc8cfcacb0b5d0d22ce005a1e644ef83c96322ee..7d047b97f5772a8cd3adb61882d885da63fa4e39 100644 (file)
 #include "group-interface.hh"
 
 void
-Script_column::add_staff_sided (Item *i)
+Script_column::add_staff_sided (Score_element *me, Item *i)
 {
   SCM p = i->get_elt_property ("script-priority");
   if (!gh_number_p (p))
     return;
-  
 
-  Pointer_group_interface gi (this, "scripts");
+  Pointer_group_interface gi (me, "scripts");
   gi.add_element (i);
   
-  add_dependency (i);
-}
-
-Script_column::Script_column (SCM s)
-  : Item (s)
-{
-  set_elt_pointer ("scripts", SCM_EOL);  
+  me->add_dependency (i);
 }
 
 static int
-staff_side_compare (Item * const &i1,
-                   Item * const &i2)
+staff_side_compare (Score_element * const &i1,
+                   Score_element * const &i2)
 {
   SCM p1 = i1->get_elt_property ("script-priority");
   SCM p2 = i2->get_elt_property ("script-priority");
@@ -41,13 +34,15 @@ staff_side_compare (Item * const &i1,
   return gh_scm2int (p1) - gh_scm2int (p2);
 }
 
-GLUE_SCORE_ELEMENT(Script_column,before_line_breaking);
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACK(Script_column,before_line_breaking);
+
 SCM
-Script_column::member_before_line_breaking ()
+Script_column::before_line_breaking (SCM smob)
 {
-  Drul_array<Link_array<Item> > arrs;
-  Link_array<Item> staff_sided 
-    = Pointer_group_interface__extract_elements (this, (Item*)0, "scripts");
+  Score_element* me = unsmob_element (smob);
+  Drul_array<Link_array<Score_element> > arrs;
+  Link_array<Score_element> staff_sided 
+    = Pointer_group_interface__extract_elements (me, (Score_element*)0, "scripts");
                                     
                                     
   for (int i=0; i < staff_sided.size (); i++)
@@ -58,11 +53,11 @@ Script_column::member_before_line_breaking ()
 
   Direction d = DOWN;
   do {
-    Link_array<Item> &arr(arrs[d]);
+    Link_array<Score_element> &arr(arrs[d]);
     
     arr.sort (staff_side_compare);
 
-    Item * last = 0;
+    Score_element * last = 0;
     for (int i=0; i < arr.size (); i++)
       {
        Side_position_interface s (arr[i]);
index 04f8bf4f8d334d741298474b14bae86da5665316..a12f671bbd1604f465f1c13d754db61f57da0ad0 100644 (file)
@@ -71,6 +71,8 @@ Script_engraver::do_process_music()
        }
       // todo -> use result of articulation-to-scriptdef directly as basic prop list.
       Script *p =new Script (get_property ("basicScriptProperties"));
+
+      p->add_offset_callback (Side_position_interface::centered_on_parent, X_AXIS);
       Side_position_interface stafy (p);
       
       
index 326667e7b44cc99a6d380d756d3bc11bc1922e8b..5ad45f28ca7c23a1c345e19bec6b804696f069e2 100644 (file)
@@ -20,40 +20,29 @@ Script ::Script (SCM s)
 }
 
 Molecule
-Script::get_molecule(Direction d) const
+Script::get_molecule(Score_element * me, Direction d)
 {
-  SCM s = get_elt_property ("molecule");
+  SCM s = me->get_elt_property ("molecule");
   assert (gh_pair_p (s));
 
   SCM key = gh_car  (s);
   if (key == ly_symbol2scm ("feta"))
     {
-      return lookup_l ()->afm_find ("scripts-" +
+      return me->lookup_l ()->afm_find ("scripts-" +
                                    ly_scm2string (index_cell (gh_cdr (s), d)));
     }
   else if (key == ly_symbol2scm ("accordion"))
     {
-      return lookup_l ()->accordion (gh_cdr (s), paper_l()->get_var("interline"));
+      return me->lookup_l ()->accordion (gh_cdr (s), me->paper_l()->get_var("interline"));
     }
-
-  else assert (false);
+  else
+    assert (false);
 
   return Molecule ();
 }
 
 
-GLUE_SCORE_ELEMENT(Script,before_line_breaking);
-SCM
-Script::member_before_line_breaking ()
-{
-  /*
-    center my self on the note head.
-   */
-  Score_element * e = parent_l(X_AXIS);
-  translate_axis (e->extent (X_AXIS).center (), X_AXIS);
 
-  return SCM_UNDEFINED;
-}
 
 GLUE_SCORE_ELEMENT(Script,after_line_breaking);
 SCM
@@ -67,17 +56,18 @@ Script::member_after_line_breaking ()
 }
 
 
-GLUE_SCORE_ELEMENT(Script,brew_molecule);
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACK(Script,brew_molecule);
 
 SCM
-Script::member_brew_molecule () const
+Script::brew_molecule (SCM smob)
 {
+  Score_element *me= unsmob_element (smob);
   Direction dir = DOWN;
-  SCM d = get_elt_property ("direction");
+  SCM d = me->get_elt_property ("direction");
   if (isdir_b (d))
     dir = to_dir (d);
   
-  return get_molecule (dir).create_scheme();
+  return get_molecule (me, dir).create_scheme();
 }
 
 
index 9ce1156d171bccdf9b29d9287e68eed29592a568..d627cb6da150c7e1526bb323bc59fae7bf3ba53d 100644 (file)
@@ -8,19 +8,19 @@
  */
 
 #include "separating-group-spanner.hh"
-#include "single-malt-grouping-item.hh"
+#include "separation-item.hh"
 #include "paper-column.hh"
 #include "paper-def.hh"
 #include "dimensions.hh"
 #include "group-interface.hh"
 
 static Rod
-make_rod (Single_malt_grouping_item *l, Single_malt_grouping_item *r)
+make_rod (Item *l, Item *r)
 {
   Rod rod;
 
-  Interval li (l->my_width ());
-  Interval ri (r->my_width ());
+  Interval li (Separation_item::my_width (l));
+  Interval ri (Separation_item::my_width (r));
 
   rod.item_l_drul_[LEFT] =l;
   rod.item_l_drul_[RIGHT]=r;
@@ -48,17 +48,17 @@ Separating_group_spanner::get_rods () const
       SCM elt = gh_cadr (s);
       SCM next_elt = gh_car (s);
 
-      Single_malt_grouping_item *l = dynamic_cast<Single_malt_grouping_item*> (unsmob_element (elt));
-      Single_malt_grouping_item *r = dynamic_cast<Single_malt_grouping_item*> (unsmob_element ( next_elt));
+      Item *l = dynamic_cast<Item*> (unsmob_element (elt));
+      Item *r = dynamic_cast<Item*> (unsmob_element ( next_elt));
 
       if (!r || !l)
        continue;
       
-      Single_malt_grouping_item *lb
-       = dynamic_cast<Single_malt_grouping_item*>(l->find_prebroken_piece (RIGHT));
+      Item *lb
+       = dynamic_cast<Item*>(l->find_prebroken_piece (RIGHT));
 
-      Single_malt_grouping_item *rb
-       = dynamic_cast<Single_malt_grouping_item*>(r->find_prebroken_piece (LEFT));
+      Item *rb
+       = dynamic_cast<Item*>(r->find_prebroken_piece (LEFT));
       
       a.push (make_rod(l,  r));
       if (lb)
@@ -99,7 +99,7 @@ Separating_group_spanner::get_rods () const
 }
 
 void
-Separating_group_spanner::add_spacing_unit (Single_malt_grouping_item*i)
+Separating_group_spanner::add_spacing_unit (Item*i)
 {
   Pointer_group_interface (this, "elements").add_element (i);
   add_dependency (i);
index a46608d0ab18c928013f5706acdde44f98473830..8b5c2f23273b0db50813f74c035d246b1ac5cc8f 100644 (file)
@@ -7,11 +7,27 @@
   
  */
 
-#include "separating-line-group-engraver.hh"
 #include "separating-group-spanner.hh"
-#include "single-malt-grouping-item.hh"
+#include "separation-item.hh"
 #include "paper-column.hh"
 #include "paper-def.hh"
+#include "engraver.hh"
+
+class Separating_line_group_engraver : public Engraver
+{
+protected:
+  Item * break_malt_p_;
+  Item * nobreak_malt_p_;
+  Separating_group_spanner * sep_span_p_;
+  
+  virtual void acknowledge_element (Score_element_info);
+  virtual void do_creation_processing ();
+  virtual void do_removal_processing ();
+  virtual void do_pre_move_processing ();
+public:
+  Separating_line_group_engraver ();
+  VIRTUAL_COPY_CONS (Translator);
+};
 
 Separating_line_group_engraver::Separating_line_group_engraver ()
 {
@@ -43,20 +59,20 @@ Separating_line_group_engraver::acknowledge_element (Score_element_info i)
   if (it && !it->parent_l (X_AXIS))
     {
       bool ib =it->breakable_b ();
-      Single_malt_grouping_item *&p_ref_ (ib ? break_malt_p_
-                                         : nobreak_malt_p_);
+      Item *&p_ref_ (ib ? break_malt_p_
+                             : nobreak_malt_p_);
 
       if (!p_ref_)
        {
          p_ref_
-           = new Single_malt_grouping_item
+           = new Item
            (get_property ("basicSingleMaltGroupingItemProperties"));
          
          if (ib)
            p_ref_->set_elt_property ("breakable", SCM_BOOL_T);
          announce_element (Score_element_info (p_ref_, 0));
        }
-      p_ref_->add_item (it);
+      Separation_item::add_item (p_ref_,it);
     }
 }
 
diff --git a/lily/separation-item.cc b/lily/separation-item.cc
new file mode 100644 (file)
index 0000000..f51345b
--- /dev/null
@@ -0,0 +1,70 @@
+/*   
+  single-malt-grouping-item.cc --  implement Separation_item
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  
+ */
+
+#include "separation-item.hh"
+#include "paper-column.hh"
+#include "debug.hh"
+#include "group-interface.hh"
+
+void
+Separation_item::set_interface (Score_element*s)
+{
+  s->set_elt_pointer ("elements", SCM_EOL);
+  s->set_extent_callback (0, X_AXIS);
+  s->set_extent_callback (0,  Y_AXIS);
+}
+
+void
+Separation_item::add_item (Score_element*s,Item* i)
+{
+  assert (i);
+  Pointer_group_interface (s).add_element (i);
+  s->add_dependency (i);
+}
+
+Interval
+Separation_item::my_width (Score_element *me)
+{
+  Item *item = dynamic_cast<Item*> (me);
+  Paper_column * pc = item->column_l ();
+  Interval w;
+  
+  for (SCM s =  me->get_elt_pointer ("elements"); gh_pair_p (s); s = gh_cdr (s))
+    {
+      SCM elt = gh_car (s);
+      if (!SMOB_IS_TYPE_B(Score_element, elt))
+       continue;
+      
+      Item *il = dynamic_cast<Item*> (unsmob_element (elt));
+      if (pc != il->column_l ())
+       {
+         /* this shouldn't happen, but let's continue anyway. */
+         programming_error (_("Separation_item:  I've been drinking too much"));
+         continue;             /*UGH UGH*/ 
+       }
+
+      if (to_boolean (il->get_elt_property ("no-spacing-rods")))
+       {
+         continue;
+       }
+
+      Interval iv (il->extent (X_AXIS));
+      if (!iv.empty_b ())
+       {
+         Real off = il->relative_coordinate (pc, X_AXIS);
+         w.unite  (iv + off);
+       }
+    }
+
+  return w;
+ // add this->offset_ ? this-> relative_coordinate ()? 
+}
+
+
+
index 21f8d227dc82a85780690a367e9eb4aefdf00db6..c52646506a7d0da5a91224e79b4dbe9a1fce6c23 100644 (file)
@@ -59,7 +59,7 @@ Side_position_interface::get_direction () const
  */
 
 Real
-Side_position_interface::side_position (Score_element const *cme, Axis axis)
+Side_position_interface::side_position (Score_element *cme, Axis axis)
 {
   Score_element* me = (Score_element*)cme;
   Score_element *common = me->parent_l (axis);
@@ -114,7 +114,7 @@ Side_position_interface::side_position (Score_element const *cme, Axis axis)
   callback that centers the element on itself
  */
 Real
-Side_position_interface::aligned_on_self (Score_element const*elm, Axis ax)
+Side_position_interface::aligned_on_self (Score_element *elm, Axis ax)
 {
   String s ("self-alignment-");
 
@@ -156,14 +156,14 @@ directed_round (Real f, Direction d)
   Callback that quantises in staff-spaces, rounding in the direction
   of the elements "direction" elt property. */
 Real
-Side_position_interface::quantised_position (Score_element const *me, Axis a)
+Side_position_interface::quantised_position (Score_element *me, Axis a)
 {
   Side_position_interface s(me);
   Direction d = s.get_direction ();
-  Staff_symbol_referencer_interface si (me);
 
-  if (si.has_interface_b ())
+  if (Staff_symbol_referencer_interface::has_interface_b (me))
     {
+      Staff_symbol_referencer_interface si (me);
       Real p = si.position_f ();
       Real rp = directed_round (p, d);
 
@@ -183,7 +183,7 @@ Side_position_interface::quantised_position (Score_element const *me, Axis a)
   Position next to support, taking into account my own dimensions and padding.
  */
 Real
-Side_position_interface::aligned_side (Score_element const*me, Axis ax)
+Side_position_interface::aligned_side (Score_element *me, Axis ax)
 {
   Side_position_interface s(me);
   Direction d = s.get_direction ();
@@ -206,7 +206,7 @@ Side_position_interface::aligned_side (Score_element const*me, Axis ax)
   Position centered on parent.
  */
 Real
-Side_position_interface::centered_on_parent (Score_element const* me, Axis a)
+Side_position_interface::centered_on_parent (Score_element * me, Axis a)
 {
   Score_element *him = me->parent_l (a);
 
index 91ab2a0ab291a43a9a41da542c970af3e5a4f682..0012dab45f7931711ff3a0334a002fa5f52629db 100644 (file)
@@ -26,7 +26,7 @@ Span_bar::add_bar (Score_element*b)
 
 
 Interval
-Span_bar::width_callback (Score_element const *se, Axis )
+Span_bar::width_callback (Score_element *se, Axis )
 {
   Span_bar*  s= dynamic_cast<Span_bar*> ((Score_element*)se);
   String gl = ly_scm2string (s->get_elt_property ("glyph"));
@@ -101,7 +101,7 @@ Span_bar::evaluate_empty ()
 Interval
 Span_bar::get_spanned_interval () const
 {
-  return Axis_group_interface::group_extent_callback (this, Y_AXIS);  
+  return Axis_group_interface::group_extent_callback ((Span_bar*)this, Y_AXIS);  
 }
 
 
index ca3c938ed85733ebf423d246035af23056143841..b2ed112f90d2e4d20d2499f5e8a55937943ca895 100644 (file)
@@ -19,19 +19,19 @@ Staff_symbol_referencer_interface::Staff_symbol_referencer_interface (Score_elem
 }
 
 void
-Staff_symbol_referencer_interface::set_interface ()
+Staff_symbol_referencer_interface::set_interface (Score_element * e)
 {
-  if (!gh_number_p (elt_l_->get_elt_property ("staff-position")))
-      elt_l_->set_elt_property ("staff-position", gh_double2scm (0.0));
+  if (!gh_number_p (e->get_elt_property ("staff-position")))
+      e->set_elt_property ("staff-position", gh_double2scm (0.0));
       
-  elt_l_->add_offset_callback (callback, Y_AXIS);
+  e->add_offset_callback (callback, Y_AXIS);
 }
 
 bool
-Staff_symbol_referencer_interface::has_interface_b ()
+Staff_symbol_referencer_interface::has_interface_b (Score_element*e)
 {
-  return unsmob_element (elt_l_->get_elt_pointer ("staff-symbol"))
-    || gh_number_p (elt_l_->get_elt_property ("staff-position"));
+  return unsmob_element (e->get_elt_pointer ("staff-symbol"))
+    || gh_number_p (e->get_elt_property ("staff-position"));
 }
 
 
@@ -91,7 +91,7 @@ Staff_symbol_referencer_interface::position_f () const
   should use offset callback!
  */
 Real
-Staff_symbol_referencer_interface::callback (Score_element const* sc,Axis )
+Staff_symbol_referencer_interface::callback (Score_element * sc,Axis )
 {
   Score_element* me = (Score_element*)sc; // UGH.
   
index 694be6fde2e9667b81c4a75e8edcdeec936dc92d..cbbc19ddec87a9416968d91aa124768db4401046 100644 (file)
@@ -440,7 +440,7 @@ Stem::flag () const
 }
 
 Interval
-Stem::dim_callback (Score_element const *se, Axis ) 
+Stem::dim_callback (Score_element *se, Axis ) 
 {
   Stem * s = dynamic_cast<Stem*> ((Score_element*)se);
   
@@ -498,7 +498,7 @@ Stem::member_brew_molecule () const
 }
 
 Real
-Stem::off_callback (Score_element const* se, Axis)
+Stem::off_callback (Score_element * se, Axis)
 {
   Stem *st = dynamic_cast<Stem*> ((Score_element*)se);
 
index 84a006243daf7f0a90053dc2a229d6c247f48031..931c5b843d49562570b175791c771bf9e893c340 100644 (file)
@@ -1,5 +1,5 @@
 /*   
-  text-item.cc -- implement Item
+  text-item.cc -- implement Text_item
 
   source file of the GNU LilyPond music typesetter
   
index 77f1e75e943d6abe7854924f32e809cb31cb7001..9b44c6ded40fe2ff1ad08a5b2671fca0f0ec2d21 100644 (file)
@@ -6,12 +6,29 @@
   (c)  1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-#include "time-signature-engraver.hh"
 #include "time-signature.hh"
 #include "command-request.hh"
+#include "engraver.hh"
+
 #include "timing-engraver.hh"
 #include "engraver-group-engraver.hh"
 
+
+/**
+  generate time_signatures. 
+  */
+class Time_signature_engraver : public Engraver {
+protected:
+  virtual void do_process_music();
+  virtual void do_pre_move_processing();
+public:
+  VIRTUAL_COPY_CONS(Translator);
+  Item * time_signature_p_;
+
+  Time_signature_engraver();
+};
+
+
 Time_signature_engraver::Time_signature_engraver()
 { 
   time_signature_p_ =0;
@@ -20,6 +37,10 @@ Time_signature_engraver::Time_signature_engraver()
 void
 Time_signature_engraver::do_process_music()
 {
+  /*
+    UGH.
+    this should use properties.
+   */
   Translator * result =
     daddy_grav_l()->get_simple_translator ("Timing_engraver"); // ugh
 
@@ -35,8 +56,7 @@ Time_signature_engraver::do_process_music()
   Time_signature_change_req *req = timing_grav_l->time_signature_req_l();
   if (req)
     {
-      time_signature_p_ = new Time_signature (get_property ("basicTimeSignatureProperties"));
-
+      time_signature_p_ = new Item (get_property ("basicTimeSignatureProperties"));
       time_signature_p_->set_elt_property ("fraction",
                                           gh_cons (gh_int2scm (req->beats_i_),
                                                    gh_int2scm (req->one_beat_i_))); 
index 50c45abd4c4dc0e812ee73779bd0de4a49bfbd6a..95cc942a599e73345363571fa84926126c616a4f 100644 (file)
 #include "paper-def.hh"
 #include "lookup.hh"
 
-Time_signature::Time_signature (SCM s)
-  :  Item (s)
-{
-
-}
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACK(Time_signature,brew_molecule);
 
-// ugh.!
-
-GLUE_SCORE_ELEMENT(Time_signature,brew_molecule);
 SCM
-Time_signature::member_brew_molecule () const
+Time_signature::brew_molecule (SCM smob) 
 {
-  SCM st = get_elt_property ("style");
-
-  SCM frac = get_elt_property ("fraction");
+  Score_element * me = unsmob_element (smob);
+  SCM st = me->get_elt_property ("style");
+  SCM frac = me->get_elt_property ("fraction");
   int n = 4;
   int d = 4;
   if (gh_pair_p (frac))
@@ -42,47 +35,47 @@ Time_signature::member_brew_molecule () const
       String style (ly_scm2string (st));
       if (style[0]=='1')
        {
-         return time_signature (n, 0).create_scheme();
+         return time_signature (me, n, 0).create_scheme();
        }
       else
        {
-         return special_time_signature (style, n, d).create_scheme();
+         return special_time_signature (me, style, n, d).create_scheme();
        }
     }
   else
-    return time_signature (n,d).create_scheme();
+    return time_signature (me, n,d).create_scheme();
 }
 
 Molecule
-Time_signature::special_time_signature (String s, int n, int d) const
+Time_signature::special_time_signature (Score_element*me, String s, int n, int d)
 {
   // First guess: s contains only the signature style
   String symbolname = "timesig-" + s + to_str (n) + "/" + to_str (d);
   
-  Molecule m = lookup_l ()->afm_find (symbolname, false);
+  Molecule m = me->lookup_l ()->afm_find (symbolname, false);
   if (!m.empty_b()) 
     return m;
 
   // Second guess: s contains the full signature name
-  m = lookup_l ()->afm_find ("timesig-"+s, false);
+  m = me->lookup_l ()->afm_find ("timesig-"+s, false);
   if (!m.empty_b ()) 
     return m;
 
   // Resort to default layout with numbers
-  return time_signature (n,d);
+  return time_signature (me, n,d);
 }
 
 
 Molecule
-Time_signature::time_signature (int num, int den) const
+Time_signature::time_signature (Score_element*me,int num, int den)
 {
   String sty = "timesig";
 
   /*
     UGH: need to look at fontsize.
    */
-  Molecule n (lookup_l ()->text (sty, to_str (num), paper_l ()));
-  Molecule d (lookup_l ()->text (sty, to_str (den), paper_l ()));
+  Molecule n (me->lookup_l ()->text (sty, to_str (num), me->paper_l ()));
+  Molecule d (me->lookup_l ()->text (sty, to_str (den), me->paper_l ()));
   n.align_to (X_AXIS, CENTER);
   d.align_to (X_AXIS, CENTER);
   Molecule m;