]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.3.56
authorfred <fred>
Tue, 26 Mar 2002 23:22:25 +0000 (23:22 +0000)
committerfred <fred>
Tue, 26 Mar 2002 23:22:25 +0000 (23:22 +0000)
82 files changed:
CHANGES
input/bugs/bug1.ly [new file with mode: 0644]
lily/axis-group-engraver.cc
lily/axis-group-interface.cc
lily/bar.cc
lily/beam.cc
lily/bezier.cc
lily/breathing-sign.cc
lily/chord-name-engraver.cc
lily/chord-name.cc
lily/chord-tremolo-engraver.cc
lily/chord.cc
lily/clef-engraver.cc
lily/clef-item.cc
lily/crescendo.cc
lily/dots.cc
lily/dynamic-engraver.cc
lily/hara-kiri-vertical-group-spanner.cc
lily/hyphen-spanner.cc
lily/include/bar.hh
lily/include/beam.hh
lily/include/breathing-sign.hh
lily/include/chord-name.hh
lily/include/crescendo.hh
lily/include/dots.hh
lily/include/extender-spanner.hh
lily/include/hyphen-spanner.hh
lily/include/key-item.hh
lily/include/local-key-item.hh
lily/include/molecule.hh
lily/include/multi-measure-rest.hh
lily/include/note-head.hh
lily/include/rest.hh
lily/include/score-element.hh
lily/include/script.hh
lily/include/slur.hh
lily/include/spanner.hh
lily/include/staff-symbol.hh
lily/include/stem-tremolo.hh
lily/include/stem.hh
lily/include/sustain-pedal.hh
lily/include/system-start-delimiter.hh
lily/include/text-item.hh
lily/include/tie.hh
lily/include/time-signature.hh
lily/include/tuplet-spanner.hh
lily/include/volta-spanner.hh
lily/item.cc
lily/key-item.cc
lily/line-number-engraver.cc
lily/line-of-score.cc
lily/local-key-item.cc
lily/lyric-extender.cc [new file with mode: 0644]
lily/molecule.cc
lily/multi-measure-rest.cc
lily/note-head.cc
lily/note-heads-engraver.cc
lily/repeat-engraver.cc
lily/rest-collision.cc
lily/rest-engraver.cc
lily/rest.cc
lily/score-element.cc
lily/script-engraver.cc
lily/script.cc
lily/slur-engraver.cc
lily/slur.cc
lily/spacing-spanner.cc
lily/span-bar.cc
lily/spanner.cc
lily/staff-symbol.cc
lily/stem-engraver.cc
lily/stem-tremolo.cc
lily/stem.cc
lily/system-start-delimiter.cc
lily/text-item.cc
lily/tie-column.cc
lily/tie-engraver.cc
lily/tie.cc
lily/time-signature.cc
lily/tuplet-engraver.cc
lily/tuplet-spanner.cc
lily/volta-spanner.cc

diff --git a/CHANGES b/CHANGES
index 6495aaa3aae0c230951b4b0b0b90355d99635aca..e449b6cabd150febf3125f0c336ab40436c5dd1c 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,9 @@
+1.3.55.hwn1
+===========
+
+* Molecules are now generated via callbacks exclusively; most calls to
+set_elt_property ("transparent) have been replaced by suicide().
+
 1.3.54.hwn2
 ===========
 
diff --git a/input/bugs/bug1.ly b/input/bugs/bug1.ly
new file mode 100644 (file)
index 0000000..124fa81
--- /dev/null
@@ -0,0 +1,5 @@
+\score {
+  \notes \relative c'' {
+    c4 <d4 \context Staff = "another" e4> f
+  }
+}
index 2038f51e8a393908068f2b13457a873ad85c88aa..52fc80484a3bf0fd22c2c4b01b982149ea328833 100644 (file)
@@ -31,7 +31,7 @@ Axis_group_engraver::do_creation_processing ()
 Spanner*
 Axis_group_engraver::get_spanner_p () const
 {
-  return new Spanner (SCM_EOL);
+  return new Spanner (get_property ("basicVerticalAxisGroupProperties"));
 }
 
 void
index fc9e5fe128304501e39ad60fa2ac8608dd1b6380..00c4c8d32c02145beb4878160843d6cbeb8371af 100644 (file)
@@ -81,7 +81,7 @@ Axis_group_interface::set_interface ()
   if (!has_interface_b ())
     {
       elt_l_->set_elt_pointer ("elements", SCM_EOL);
-      elt_l_->set_elt_property ("transparent", SCM_BOOL_T); //  junk this?
+
 
       Group_interface (elt_l_, "interfaces").add_thing (ly_symbol2scm ("Axis_group"));
     }
index ec2b812b3e8066eeebc3561cbd7c21c074e87869..80c964c1a5c5a95caeb3bc9e257638c5d1194f5e 100644 (file)
@@ -44,6 +44,7 @@ Bar::do_brew_molecule () const
   return Molecule ();
 }
 
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(Bar);
 
 Molecule
 Bar::compound_barline (String str, Real h) const
@@ -144,8 +145,9 @@ Bar::before_line_breaking ()
   
   if (!gh_string_p (g))
     {
-      set_elt_property ("transparent", SCM_BOOL_T);
-      set_extent_callback (0, X_AXIS);      
+      set_elt_property ("molecule-callback", SCM_BOOL_T);
+      set_extent_callback (0, X_AXIS);
+      // leave y_extent for spanbar? 
     }
   else if (! gh_equal_p  (g, orig))
     set_elt_property ("glyph", g);
index 108f543bc6a022b2f488b5aaacebf8a5f4a62eb3..e131cbc17c176f47794847a9f7f1af67b28e4dd4 100644 (file)
@@ -88,7 +88,7 @@ Beam::before_line_breaking ()
   if (visible_stem_count () < 2)
     {
       warning (_ ("beam has less than two stems"));
-      //      set_elt_property ("transparent", SCM_BOOL_T);
+
     }
 
   if (!directional_element (this).get ())
@@ -719,6 +719,7 @@ Beam::stem_beams (Stem *here, Stem *next, Stem *prev) const
   return leftbeams;
 }
 
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS (Beam);
 
 Molecule 
 Beam::do_brew_molecule () const
index 3e1e875a6de16a3b767a62fa2bdb0e7db5a4c1c6..02f2f055e38bbd83f4518640c9e1155787abc199 100644 (file)
@@ -153,6 +153,9 @@ Bezier::solve_point (Axis ax, Real coordinate) const
   return filter_solutions (sol);
 }
 
+/**
+   Compute the bounding box dimensions in direction of A.
+ */
 Interval
 Bezier::extent (Axis a)const
 {
@@ -171,6 +174,10 @@ Bezier::extent (Axis a)const
   return iv;
 }
 
+/**
+   Flip around axis A
+ */
+
 void
 Bezier::flip (Axis a)
 {
index d1473eb2143d1da87358fc6b32cfb850f8c741c7..887033422973394ca52a64c992701a06ff946e73 100644 (file)
@@ -26,6 +26,10 @@ Breathing_sign::Breathing_sign (SCM  s)
 {
 }
 
+
+
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(Breathing_sign);
+
 Molecule 
 Breathing_sign::do_brew_molecule () const
 {
index b074cd8b753c7885aa7ba11188abafa5c07f6594..b33e0f04ded517c4416c6f88b1e6e6c6da443522 100644 (file)
@@ -73,7 +73,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 (SCM_EOL);
+  chord_name_p_ = new Chord_name (get_property ("basicChordNameProperties"));
   Chord chord = to_chord (pitch_arr_, tonic_req_, inversion_req_, bass_req_,
                          find_inversion_b);
 
index e8500f9c6c8bc4fb8cb5aaab230a35de92c5635e..90b81c57fdd53b72e2498ceefcf89fd2e9d96e6c 100644 (file)
@@ -137,6 +137,8 @@ Chord_name::ly_text2molecule (SCM text) const
   return mol;
 }
 
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(Chord_name);
+
 Molecule 
 Chord_name::do_brew_molecule () const
 {
index 4148b2bb6262982e3c5ae7af5105a4320c065235..86707e1d8fc067b8635837d0cbeb20757c00bea5 100644 (file)
@@ -90,7 +90,7 @@ Chord_tremolo_engraver::do_process_music ()
 {
   if (repeat_ && !beam_p_)
     {
-      beam_p_ = new Beam (SCM_EOL);
+      beam_p_ = new Beam (get_property ("basicBeamProperties"));
       beam_p_->set_elt_property ("chord-tremolo", SCM_BOOL_T);
 
 
index cd4e3e0d876187b2122d50fcf837b39207cc60b6..330ac1b41708a28809c3a068c7205ca1893960e2 100644 (file)
@@ -14,7 +14,6 @@
 #include "paper-def.hh"
 #include "lookup.hh"
 
-
 /*
   construct from parser output
 */
index cfc26a629cd78c7a8726a1c35fbe448edc9a6aa8..e333906625a61c4a493466ab03dfeef0be0fb60f 100644 (file)
@@ -108,7 +108,6 @@ Clef_engraver::set_type (String s)
 
   c0_position_i_ -= (int) octave_dir_ * 7;
 
-
   current_settings_ = gh_cons (gh_cons (ly_symbol2scm ("glyph"), clef_glyph_), basic_properties_);
   current_settings_ =
     gh_cons (gh_cons (ly_symbol2scm ("c0-position"),
@@ -193,7 +192,7 @@ Clef_engraver::create_clef()
       clef_p_ = c;
     }
   Staff_symbol_referencer_interface si(clef_p_);
-  clef_p_->set_elt_property ("glyph", clef_glyph_);
+
   si.set_position (clef_position_i_);
   if (octave_dir_)
     {
index ce7c057be4238778ba2e8f4c7aa0303125fbe727..770694061d82b7744002573d4a77a0a3eac2fbdf 100644 (file)
@@ -16,6 +16,12 @@ Clef_item::Clef_item (SCM s)
   : Item (s)
 {}
 
+
+/*
+FIXME: should use symbol.
+
+FIXME: this should be schemified.
+*/
 void
 Clef_item::before_line_breaking ()
 {
@@ -26,9 +32,6 @@ Clef_item::before_line_breaking ()
 
   SCM glyph = get_elt_property ("glyph");
   
-  /*
-    FIXME: should use symbol.
-   */
   if (gh_string_p (glyph))
     {
       String s = ly_scm2string (glyph);
@@ -36,21 +39,23 @@ Clef_item::before_line_breaking ()
       /*
        FIXME: should use fontsize property to set clef changes.
        */
-      if (break_status_dir() != RIGHT && style != "fullSizeChanges")
+      if (get_elt_property ("non-default") &&
+         break_status_dir() != RIGHT && style != "fullSizeChanges")
        {
          s += "_change";
+         set_elt_property ("glyph", ly_str02scm (s.ch_C()));     
        }
-      s = "clefs-" +  s;
-      set_elt_property ("glyph", ly_str02scm (s.ch_C()));
     }
   else
     {
-      set_elt_property ("transparent", SCM_BOOL_T);
+      suicide ();
+      return;
     }
-  
+
+  // ugh. 
   if (style == "transparent")  // UGH. JUNKME
     {
-      set_elt_property ("transparent", SCM_BOOL_T);
+      set_elt_property ("molecule-callback", SCM_BOOL_T);
       set_extent_callback (0, X_AXIS);
     }
 }
index fd390e0826cbea3ebcfcb1dd9f82e00bbdd7db14..d119ca9a04cf818ae9e70b370e11c56517aafd5a 100644 (file)
@@ -24,6 +24,7 @@ Crescendo::Crescendo (SCM s)
 
 
 
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(Crescendo)
 Molecule 
 Crescendo::do_brew_molecule () const
 {
@@ -36,7 +37,7 @@ Crescendo::do_brew_molecule () const
   if (!isdir_b (dir) || !gh_pair_p (dyns))
     {
       Crescendo * me = (Crescendo*)this;
-      me->set_elt_property ("transparent", SCM_BOOL_T);
+      me->suicide ();
       Molecule m;
       
       return m;
index a658d838e72d986e9fab7ff073c8a0afa1262772..ebc5c366a0b508c5343eea6c8811c59545f08422 100644 (file)
@@ -23,13 +23,7 @@ void
 Dots::after_line_breaking ()
 {
   SCM d= get_elt_property ("dot-count");
-  if (!gh_number_p (d) || !gh_scm2int (d))
-    {
-      set_elt_property ("transparent", SCM_BOOL_T);
-      set_extent_callback (0, X_AXIS);
-      set_extent_callback (0, Y_AXIS);
-    }
-  else
+  if (gh_number_p (d) && gh_scm2int (d))
     {
       if (!directional_element (this).get ())
        directional_element (this).set (UP);
@@ -41,23 +35,28 @@ Dots::after_line_breaking ()
     }
 }
 
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(Dots);
 Molecule  
 Dots::do_brew_molecule () const
 {
   Molecule mol (lookup_l ()->blank (Box (Interval (0,0),
                                         Interval (0,0))));
-  Molecule d = lookup_l ()->afm_find (String ("dots-dot"));
 
-  Real dw = d.extent (X_AXIS).length ();
-  d.translate_axis (-dw, X_AXIS);
+  SCM c = get_elt_property ("dot-count");
+  if (!gh_number_p (c))
+    {
+      Molecule d = lookup_l ()->afm_find (String ("dots-dot"));
+
+      Real dw = d.extent (X_AXIS).length ();
+      d.translate_axis (-dw, X_AXIS);
 
 
-  for (int i = gh_scm2int (get_elt_property ("dot-count")); i--; )
-    {
-      d.translate_axis (2*dw,X_AXIS);
-      mol.add_molecule (d);
+      for (int i = gh_scm2int (c); i--; )
+       {
+         d.translate_axis (2*dw,X_AXIS);
+         mol.add_molecule (d);
+       }
     }
-
   return mol;
 }
 
index 15592c6c786f74876b095574b6a1b74d17882bc1..273aa105688c435fa9221f1b7b6643d7f96cb2fc 100644 (file)
@@ -48,7 +48,6 @@ public:
 Dynamic_line_spanner::Dynamic_line_spanner (SCM s)
   : Spanner (s)
 {
-  set_elt_property ("transparent", SCM_BOOL_T);
   Side_position_interface (this).set_axis (Y_AXIS);
   Axis_group_interface (this).set_interface ();
   Axis_group_interface (this).set_axes (X_AXIS, Y_AXIS);
@@ -304,7 +303,7 @@ Dynamic_engraver::do_process_music ()
       else
        {
          span_start_req_l_ = span_req_l_drul_[START];
-         cresc_p_  = new Crescendo (SCM_EOL);
+         cresc_p_  = new Crescendo (get_property ("basicCrescendoProperties"));
          cresc_p_->set_elt_property
            ("grow-direction",
             gh_int2scm ((span_req_l_drul_[START]->span_type_str_ == "crescendo")
index d028ed5ef9cb7891e96d842192548cb7d6d442f5..c01b068cba500797673005e8e059cb4c166f422f 100644 (file)
@@ -40,10 +40,7 @@ Hara_kiri_group_spanner::after_line_breaking ()
 
       if ( line_l () != s->line_l ())
        programming_error ("Killing other children too");
-      s->set_elt_property ("transparent", SCM_BOOL_T);
-      s->set_extent_callback (0, X_AXIS);
-      s->set_extent_callback (0, Y_AXIS);
-
+      s->suicide ();
     }
   set_extent_callback (0, X_AXIS);
   set_extent_callback (0, Y_AXIS);  
index d0b58fc3bd81eba817dbe3c1d480115561990cf0..a4ddc8c75014625cba86337adae040b8a93142bc 100644 (file)
@@ -30,6 +30,7 @@ Hyphen_spanner::Hyphen_spanner (SCM s)
   set_extent_callback (Score_element::point_dimension_callback,Y_AXIS);
 }
 
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(Hyphen_spanner)
 Molecule 
 Hyphen_spanner::do_brew_molecule () const
 {
index f770c3aac29ff38d034a40861c462d405d7ad891..6673cea6f95c96e1090b0eb1981056869872f1e3 100644 (file)
@@ -18,6 +18,8 @@ public:
 
   Molecule compound_barline (String, Real height) const;
   Molecule simple_barline (Real wid, Real height) const;      
+  static SCM scheme_molecule (SCM);
+  
 
 protected:
   virtual void before_line_breaking ();
index 27a19a1769e030c1a16b3a44bc2342eb9b940be9..99eac088af3a3482a4090bb07614e468c337f40b 100644 (file)
@@ -26,6 +26,8 @@
 class Beam : public Spanner
 {
 public:
+  static SCM scheme_molecule (SCM);
+  
 
   int stem_count () const;
   Stem* stem (int) const;
index fb212868b535e97e41409fd66458eab56441465b..a2b0181d2b6bc0f4b3224bab07bfd3d8a9154112 100644 (file)
@@ -20,6 +20,8 @@
 class Breathing_sign : public Item
 {
 public:
+  static SCM scheme_molecule (SCM);
+  
   VIRTUAL_COPY_CONS(Score_element);
   Breathing_sign (SCM s);
 protected:
@@ -27,6 +29,4 @@ protected:
   virtual Molecule do_brew_molecule () const;
 };
 
-
-
 #endif // BREATHING_SIGN_HH
index 2f77bb4b1d9ccc9ac6479b6b5e367a3f5160c6cd..f2c930c031c256804d014efb2fe818c54ddf0132 100644 (file)
@@ -22,7 +22,9 @@
 class Chord_name : public Item
 {
 public:
-  VIRTUAL_COPY_CONS (Score_element);
+   static SCM scheme_molecule (SCM);
+  
+VIRTUAL_COPY_CONS (Score_element);
   Molecule ly_word2molecule (SCM scm) const;
   Molecule ly_text2molecule (SCM scm) const;
   Chord_name(SCM s);
index b5a46c84336a4eddbbe5f65dbe56aabc2af820d5..e43f005e61bea9b50554a1b7145c03fb6035d063 100644 (file)
@@ -18,7 +18,9 @@
  */
 class Crescendo : public Spanner {
 public:
-  Crescendo(SCM);
+   static SCM scheme_molecule (SCM);
+  
+Crescendo(SCM);
 protected:
   VIRTUAL_COPY_CONS(Score_element);
   virtual Molecule do_brew_molecule() const;
index e1bf806390d2d00d481630777b1678d28185f04f..8f33241c68ec1e8f944b2b84ed7d9d3c50249040 100644 (file)
@@ -29,7 +29,9 @@ protected:
   virtual Molecule do_brew_molecule () const;
   virtual void after_line_breaking ();
 public:
+   static SCM scheme_molecule (SCM);
   
+
   Dots (SCM);
 };
 
index 862318e7eadb92016e4ecbb41e3b8245b716e678..b921217dbee55b02d0e7da9118fd660229280728 100644 (file)
   extend beond, lasting the whole duration of the melissima
   (as in MUP, urg).
   */
-class Extender_spanner : public Spanner
+class Lyric_extender : public Spanner
 {
 public:
-  Extender_spanner (SCM);
+  Lyric_extender (SCM);
   void set_textitem (Direction, Item*);
+ static SCM scheme_molecule (SCM);
+  
 
 protected:
   virtual Molecule do_brew_molecule () const;
index 24c1ab7299341db65e37a79142f07179858204fb..1270bce805216b477eb6cddab271db9afefba284 100644 (file)
@@ -23,6 +23,8 @@ class Hyphen_spanner : public Spanner
 public:
   Hyphen_spanner (SCM);
   void set_textitem (Direction, Item*);
+ static SCM scheme_molecule (SCM);
+  
 
 protected:
   virtual Molecule do_brew_molecule () const;
index b8430c427215794739abb7edb30569aeb29e9153..2c7f396ab4396954563ea6d623b5c0872ec25baa 100644 (file)
@@ -31,6 +31,8 @@ public:
   Key_item (SCM);
   void add (int pitch, int acc);
   void add_old (int pitch, int acc);
+ static SCM scheme_molecule (SCM);
+  
 
 protected:
   virtual Molecule do_brew_molecule() const;
index db072f0dfe115eb0f6434453a5830eaa67c6692f..ca368dc30a8960acd0e4442a1de854e9c09ce5da 100644 (file)
@@ -41,7 +41,9 @@ class Local_key_item : public Item
   Molecule accidental (int,bool,bool) const;
 public:
   Local_key_item (SCM );
-  void add_pitch (Musical_pitch, bool cautionary, bool natural);
+   static SCM scheme_molecule (SCM);
+  
+void add_pitch (Musical_pitch, bool cautionary, bool natural);
 protected:
   virtual void before_line_breaking ();
   virtual Molecule do_brew_molecule() const;
index d9cd2bb11aecdd26a6adc05ab21a7e163153e3c1..b8153c72a09e96d65ea15338814706af3df5fd41 100644 (file)
@@ -71,11 +71,16 @@ public:
   void translate_axis (Real,Axis);
   
   Interval extent (Axis) const;
+  /**
+     codify THIS into a Scheme expression.
+   */
+  SCM create_scheme () const;
   bool empty_b() const;
 };
 
 SCM fontify_atom (Font_metric*, SCM atom);
 
+Molecule create_molecule (SCM scheme_molecule);
 
 
 
index 0258c9a7ee12e409e4ac1d52d217976c0d2e622a..eba41029b21b69c4430904264e94a2a03d35bac3 100644 (file)
@@ -17,6 +17,8 @@ class Multi_measure_rest : public Spanner
 {
 public:
   Multi_measure_rest (SCM);
+ static SCM scheme_molecule (SCM);
+  
 
   void add_column (Item*);
   Molecule compound_rest (int)const;
index 85442c0b004ba7f984b12ed4a29e1684cc3e9e42..0ce36022fc912f775b3b28be1cad57bd1b62b1ed 100644 (file)
@@ -23,6 +23,8 @@ class Note_head : public Rhythmic_head
 {
 public:
   static int compare (Note_head * const &a, Note_head *const &b) ;
+ static SCM scheme_molecule (SCM);
+  
 
   Molecule ledger_line (Interval) const;
   Note_head (SCM);
index cb62ce38833653216825e53cf00b248e9a31378f..0b0ebef383c9e18f94b4aa375e2c9a5b66bf0177 100644 (file)
@@ -25,6 +25,8 @@ protected:
   virtual void after_line_breaking ();
   virtual Molecule do_brew_molecule () const;
 public:
-  Rest (SCM s);
+   static SCM scheme_molecule (SCM);
+  
+Rest (SCM s);
 };
 #endif // REST_HH
index 16a0d8b39adedb1bb6332e5d64c3b1fc7a3d271e..276fe75e3e0666bb74c99ecaa54adf837d34daaf 100644 (file)
@@ -162,7 +162,7 @@ public:
   /// generate rods & springs
   virtual void do_space_processing ();
   virtual void discretionary_processing ();
-
+  virtual void do_derived_mark ();
   /// do calculations before determining horizontal spacing
   virtual void before_line_breaking ();
   /// do calculations after determining horizontal spacing
@@ -182,17 +182,16 @@ protected:
     be handled by GUILE gc.  */
   virtual ~Score_element ();
   
-  /// generate the molecule    
-  virtual Molecule do_brew_molecule () const;
   ///executed directly after the item is added to the Paper_score
   virtual void do_add_processing ();
-    
+  virtual Molecule do_brew_molecule ()const;
+  
   static Interval dim_cache_callback (Dimension_cache const*);
   
 public:
   static SCM ly_set_elt_property (SCM, SCM,SCM);
   static SCM ly_get_elt_property (SCM, SCM);  
-
+  static SCM scheme_molecule (SCM);
   virtual void handle_broken_dependencies ();
   virtual void handle_prebroken_dependencies ();
 
@@ -246,6 +245,23 @@ public:
 
 Score_element * unsmob_element (SCM);
 
+#define MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(TYPE)                              \
+SCM                                                            \
+TYPE::scheme_molecule (SCM smob)                               \
+{                                                              \
+  TYPE * b = dynamic_cast<TYPE*> (unsmob_element (smob));      \
+  return b ?  b->do_brew_molecule ().create_scheme () : SCM_EOL; \
+}                                                              \
+                                                               \
+void                                                           \
+TYPE ## __init_functions ()                                    \
+{                                                              \
+  scm_make_gsubr (#TYPE "::scheme_molecule", 1, 0, 0,          \
+  (SCM(*)(...))TYPE::scheme_molecule);                                 \
+}                                                              \
+                                                               \
+ADD_SCM_INIT_FUNC(TYPE ## _molecule, TYPE ## __init_functions);        \
+
 
 
 #endif // STAFFELEM_HH
index 4d8441584d809ec609625cacabcd5d692bb23506..0204e811120f6318855f94d5e8eec0c385ba7476 100644 (file)
@@ -23,7 +23,9 @@ class Script : public Item
   Molecule get_molecule (Direction d) const;
 public:
   Script (SCM);
+   static SCM scheme_molecule (SCM);
   
+
 protected:
   virtual void before_line_breaking ();
   virtual void after_line_breaking ();
index 3ab1dff6bd31f4a39c1fdd73128d0aa6a7153913..a44f1f4bd4af75c69b4f62db8f3ee8cc1d9bc7a1 100644 (file)
@@ -20,6 +20,8 @@ public:
   VIRTUAL_COPY_CONS(Score_element);
 
   void add_column (Note_column*);
+ static SCM scheme_molecule (SCM);
+  
 
 
 protected:
index b3e894804de62e362478470bcc11de7f4930d5ae..34339a18f96db4c95ce4027bc1f002c32e763748 100644 (file)
@@ -49,6 +49,7 @@ public:
   virtual Array<Rod> get_rods () const;
   virtual Array<Spring> get_springs () const;  
   virtual Score_element* find_broken_piece (Line_of_score*) const;
+  virtual void do_derived_mark ();
 protected:
   void set_my_columns ();
   VIRTUAL_COPY_CONS(Score_element);
index 676886c7ec0c81066a2984851d04c359c5032751..4ed5b22af03a22fc684ae4bd0e244818ae703b90 100644 (file)
@@ -22,7 +22,9 @@ public:
   int steps_i() const;
   int line_count () const;
   Staff_symbol (SCM s);
+   static SCM scheme_molecule (SCM);
   
+
 protected:
   VIRTUAL_COPY_CONS(Score_element);
   virtual Molecule do_brew_molecule() const;
index 11c1c93af87f5011791f4baeb454de4e225d2a37..ec2e7b4426e195a64533442863c6f5a012400792 100644 (file)
@@ -20,7 +20,9 @@ protected:
 
   static Interval dim_callback (Score_element*, Axis);
 public:
-  Stem_tremolo (SCM);
+   static SCM scheme_molecule (SCM);
+  
+Stem_tremolo (SCM);
   void set_stem (Stem *);
 };
 
index 8ae9771fca07820c7abc424c4edb80d8bfd43cc8..44d054f011458588aa7dacacc5b9a98ee2dbdf16 100644 (file)
 class Stem : public Item
 {
 public:
+ static SCM scheme_molecule (SCM);
+  
+
+
   /// log of the duration. Eg. 4 -> 16th note -> 2 flags
   int flag_i () const;
 
@@ -83,10 +87,8 @@ protected:
   Real get_default_stem_end_position () const;
   void position_noteheads();
 
-
   Real stem_end_position () const;
   static Real off_callback (Score_element const*, Axis);
-protected:
   Molecule flag () const;
 
   virtual void before_line_breaking();
index 9f17f20361a0f8c330688760108e035350e8e96d..505723c316da01b92260623e9b6fc1b220ea11a8 100644 (file)
@@ -31,7 +31,9 @@
 class Sustain_pedal : public Item
 {
 public:
-  VIRTUAL_COPY_CONS (Score_element);
+   static SCM scheme_molecule (SCM);
+  
+VIRTUAL_COPY_CONS (Score_element);
   Sustain_pedal (SCM);
 protected:
   virtual Molecule do_brew_molecule () const;
index d84acd97d0d0b5ae53a917e42fe4b73043e6575c..b3f545daf773afbb7907272470a84671457899d5 100644 (file)
@@ -19,7 +19,9 @@ class System_start_delimiter : public Spanner
 {
 public:
   System_start_delimiter (SCM);
-  VIRTUAL_COPY_CONS (Score_element);
+   static SCM scheme_molecule (SCM);
+  
+VIRTUAL_COPY_CONS (Score_element);
 protected:
   virtual void after_line_breaking();
   virtual  Molecule do_brew_molecule () const;
index 818a5a3139e77fd337b8532ca6a57979e4c982d7..d70347307a86ebcb914673b2b8c96435d33ec420 100644 (file)
@@ -19,7 +19,9 @@ class Text_item : public Item
 {
 public:
   VIRTUAL_COPY_CONS (Score_element);
-  Text_item (SCM s);
+   static SCM scheme_molecule (SCM);
+  
+Text_item (SCM s);
 protected:
   virtual Molecule do_brew_molecule () const;
 };
index 7de2697cfaf26d80b410c6e440588ffaa5ff2b56..71e0e86c879c2e85117265bcebec24b4ca62ec74 100644 (file)
@@ -25,7 +25,9 @@ public:
 
   Note_head* head (Direction) const;
   Real position_f () const;
+   static SCM scheme_molecule (SCM);
   
+
   virtual Direction get_default_dir() const;
 
 protected:
index 6744bff15e525b15df5aea7ae0483cf207ee77ff..ac4a49f237c289dcb1153527a03f64a83bb0bdbc 100644 (file)
@@ -27,6 +27,8 @@ protected:
   virtual Molecule do_brew_molecule() const;
 public:
   Time_signature (SCM);
+ static SCM scheme_molecule (SCM);
+  
 
   /*
     TODO: make this SCM!
index 51789988b6d7da57cc79c609460b000caec08bc9..e7390afbf2c1d47fcf52e8dd1b5ec97763b4182a 100644 (file)
@@ -21,7 +21,9 @@ class Tuplet_spanner : public Spanner
 {
 public:
   Tuplet_spanner (SCM);
+  static SCM scheme_molecule (SCM);
+  
+
   void add_column (Note_column*);
   void add_beam (Beam*);
 protected:
index a1f9b0ebfef62eab5422deb2ebf81c0dd6c9ca65..a9a05605da444787de446aa8d5ce22f3a5352018 100644 (file)
@@ -17,7 +17,7 @@ class Volta_spanner : public Spanner
 {
 public:
   Volta_spanner (SCM);
+  static SCM scheme_molecule (SCM);
   void add_column (Note_column*);
   void add_bar (Bar*);
  
index ea8fde5d84395babf682f9f4f2e8aa31f45494d7..f601a947ddf9567c396cfec46402c48752b065c5 100644 (file)
@@ -17,7 +17,6 @@
 
 Item::Item (SCM s)
   : Score_element (s)
-
 {
   broken_to_drul_[LEFT] = broken_to_drul_[RIGHT]=0;
 }
@@ -155,13 +154,16 @@ Item::handle_prebroken_dependencies ()
       SCM result = gh_apply (vis, args);
       bool trans = gh_scm2bool (gh_car (result));
       bool empty = gh_scm2bool (gh_cdr (result));
-
-      if (empty)
+      
+      if (empty && trans)
+       suicide ();
+      else if (empty)
        {
          set_extent_callback (0, X_AXIS);
          set_extent_callback (0,  Y_AXIS);
        }
-      if (trans)
-       set_elt_property ("transparent", SCM_BOOL_T);
+      else if (trans)
+       set_elt_property ("molecule-callback", SCM_BOOL_T);
     }
 }
+
index c9b74955b7cf6901fb61ae0b470ccd49413e1a01..5b179e57471838f492b413fdfc63c5f32a6aa79b 100644 (file)
@@ -86,8 +86,9 @@ Key_item::calculate_position(SCM pair) const
 
  */
 
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(Key_item)
 Molecule 
-Key_item::do_brew_molecule() const
+Key_item::do_brew_molecule () const
 {
   Molecule mol;
 
index afde3217cdd75e665b64ed64c6bc8cd2b46b352d..7a9e48a6f1dd8eead9f814e25d16f0861c9755e0 100644 (file)
@@ -36,7 +36,7 @@ Line_number_engraver::process_acknowledged ()
 {
   if (!text_item_p_ && interesting_.size ())
     {
-      text_item_p_ = new Text_item (SCM_EOL);
+      text_item_p_ = new Text_item (get_property ("basicTextProperties") );
       Side_position_interface si (text_item_p_);
       si.set_axis (Y_AXIS);
       text_item_p_->set_parent (interesting_[0].elem_l_, Y_AXIS);
index 2ca094bab979f352e4112d875523e229f0112438..1c8f59d34cf5692784c09edc4a2e74d5c852ed16 100644 (file)
@@ -324,13 +324,13 @@ Line_of_score::broken_col_range (Item const*l, Item const*r) const
   r = r->column_l ();
   SCM s = get_elt_pointer ("columns");
 
-  while (gh_car (s) != r->self_scm_)
+  while (gh_pair_p (s) && gh_car (s) != r->self_scm_)
     s = gh_cdr  (s);
     
-
-  s = gh_cdr (s);
+  if (gh_pair_p (s))
+    s = gh_cdr (s);
   
-  while (gh_car (s) != l->self_scm_)
+  while (gh_pair_p (s) && gh_car (s) != l->self_scm_)
     {
       Paper_column *c
        = dynamic_cast<Paper_column*> (unsmob_element (gh_car (s)));
index e730ad4ea08321f1f3365dc36ab35ea9b606b47c..4b77e00fd3e3fa82bf6778d8f52e01692dde5839 100644 (file)
@@ -61,8 +61,9 @@ Local_key_item::accidental (int j, bool cautionary, bool natural) const
 /*
   UGH. clean me up
  */
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(Local_key_item)
 Molecule 
-Local_key_item::do_brew_molecule() const
+Local_key_item::do_brew_molecule () const
 {
   Molecule mol;
   Staff_symbol_referencer_interface si (this);
diff --git a/lily/lyric-extender.cc b/lily/lyric-extender.cc
new file mode 100644 (file)
index 0000000..879fa63
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+  lyric-extender.cc -- implement Lyric_extender
+  source file of the GNU LilyPond music typesetter
+
+  (c)  1998--2000 Jan Nieuwenhuizen <janneke@gnu.org>
+*/
+
+/*
+  TODO: too complicated implementation.  Why the dx_drul?.
+ */
+
+#
+#include "dimension-cache.hh"
+#include "box.hh"
+#include "debug.hh"
+#include "lookup.hh"
+#include "molecule.hh"
+#include "paper-column.hh"
+#include "paper-def.hh"
+#include "extender-spanner.hh"
+
+Lyric_extender::Lyric_extender (SCM s)
+  : Spanner (s)
+
+{
+  dx_f_drul_[LEFT] = dx_f_drul_[RIGHT] = 0.0;
+  set_extent_callback (Score_element::point_dimension_callback, Y_AXIS);
+}
+
+
+
+
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(Lyric_extender)
+Molecule 
+Lyric_extender::do_brew_molecule () const
+{
+  Molecule  mol;
+
+  Real w = spanner_length ();
+  
+  w += (dx_f_drul_[RIGHT] - dx_f_drul_[LEFT]);
+  Real h = paper_l ()->get_var ("extender_height");
+  Molecule a = lookup_l ()->filledbox ( Box (Interval (0,w), Interval (0,h)));
+  a.translate (Offset (dx_f_drul_[LEFT], 0));
+
+  mol.add_molecule (a);
+
+  return mol;
+}
+
+
+
+void
+Lyric_extender::after_line_breaking ()
+{
+  // UGH
+  Real gap = paper_l ()->get_var ("interline");
+
+  Direction d = LEFT;
+  do
+    {
+      Item* t = get_bound (d)
+       ? get_bound (d) : get_bound ((Direction)-d);
+      if (d == LEFT)
+        dx_f_drul_[d] += t->extent (X_AXIS).length ();
+      else
+       dx_f_drul_[d] -= d * gap / 2;
+    }
+  while (flip(&d) != LEFT);
+}
+
+  
+void
+Lyric_extender::set_textitem (Direction d, Item* textitem_l)
+{
+  set_bound (d, textitem_l);
+  add_dependency (textitem_l);
+}
+
+
index 538edc4f9ba6f4f093ceed124df0c448be3f3407..0eec7dd813f25836ac2bcd8a8a7729d13259aee5 100644 (file)
@@ -133,3 +133,29 @@ Molecule::get_expr () const
 {
   return expr_;
 }
+
+Molecule
+create_molecule (SCM scm_mol)
+{
+  if (!gh_pair_p (scm_mol))
+    return Molecule ();
+
+  SCM exp = gh_car (scm_mol);
+  scm_mol = gh_cdr (scm_mol);
+  Box b ;
+  if (gh_pair_p (scm_mol))
+    {
+      Interval i1 = ly_scm2interval (gh_car (scm_mol));
+      Interval i2 = ly_scm2interval (gh_cdr (scm_mol));  
+      b = Box (i1,i2);
+    }
+  return Molecule (b, exp);
+}
+
+SCM
+Molecule::create_scheme () const
+{
+  return gh_cons (expr_,
+                 gh_cons (ly_interval2scm (dim_[X_AXIS]),
+                          ly_interval2scm (dim_[Y_AXIS])));
+}
index cd770d0d0418095cb021582e0c45d5c43dcc675b..eb12c9f9b21bc89b03ab0c1112f02c9c46fb8a65 100644 (file)
@@ -31,6 +31,7 @@ Multi_measure_rest::Multi_measure_rest (SCM s)
    [TODO]                                      17
  * variable-sized multi-measure rest symbol: |====| ??
 */
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(Multi_measure_rest)
 Molecule 
 Multi_measure_rest::do_brew_molecule () const
 {
@@ -155,7 +156,10 @@ void
 Multi_measure_rest::after_line_breaking ()
 {
   if (!gh_pair_p (get_elt_pointer ("columns")))
-    set_elt_property ("transparent", SCM_BOOL_T);
+    {
+      suicide ();
+    }
+     
 }
 
 
index d5fa47e7ff3bda9dcd057dbde2319d9221ee72bb..4f8934ab376d463608241169ba969e9adaee7650 100644 (file)
@@ -71,6 +71,7 @@ Note_head::before_line_breaking ()
 
 
 
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(Note_head);
 
 Molecule 
 Note_head::do_brew_molecule() const 
index 3090a6d111d33f7df1e8d8256acf417e36e321b7..431c637b84b3bbda3e27693717b63cd77848ded8 100644 (file)
@@ -60,7 +60,7 @@ Note_heads_engraver::do_process_music()
   
   for (int i=0; i < note_req_l_arr_.size (); i++)
     {
-      Note_head *note_p  = new Note_head (SCM_EOL);
+      Note_head *note_p  = new Note_head (get_property ("basicNoteHeadProperties"));
       
       Staff_symbol_referencer_interface si (note_p);
       si.set_interface ();
@@ -73,7 +73,7 @@ Note_heads_engraver::do_process_music()
 
       if (note_req_l->duration_.dots_i_)
        {
-         Dots * d = new Dots (SCM_EOL);
+         Dots * d = new Dots (get_property ("basicDotsProperties"));
 
          Staff_symbol_referencer_interface sd (d);
          sd.set_interface ();
index 8c838c3474595393bdabdd03a7a056855d9c6b36..72572c389133c552b97745f263ba1bb717edde79 100644 (file)
@@ -180,7 +180,7 @@ Repeat_engraver::do_process_music ()
          else
            {
              assert (!volta_span_p_);
-             volta_span_p_ = new Volta_spanner (SCM_EOL);
+             volta_span_p_ = new Volta_spanner (get_property ("basicVoltaSpannerProperties"));
              announce_element (Score_element_info (volta_span_p_,0));
              volta_span_p_->set_elt_property ("text",
                                               ly_str02scm (t.ch_C()));
index 34d39fbe3b49cac69308ea5efd4b7d5bd2c5ad9b..f5be97061c97cfda84d0da7690e0965a5fe141b3 100644 (file)
@@ -48,6 +48,9 @@ rhythmic_head2mom (Rhythmic_head* r)
   return to_duration (r->balltype_i (), r->dot_count ()).length_mom ();
 }
 
+/*
+  ugh
+ */
 static Rhythmic_head*
 col2rhythmic_head (Note_column* c)
 {
@@ -109,7 +112,7 @@ Rest_collision::before_line_breaking ()
          display_count = gh_scm2int (s);
          for (; i > display_count; i--)
            col2rhythmic_head (rest_l_arr[i-1])
-             ->set_elt_property ("transparent", SCM_BOOL_T);
+             ->set_elt_property ("molecule-callback", SCM_BOOL_T);
        }
       else
        display_count = rest_l_arr.size ();
index 37b3e6ee1f9402cc795fb666f339a94d3a0d5b72..aefefc453ad74eb089bf4244ed2e8577f4ce3d92 100644 (file)
@@ -10,6 +10,7 @@
 #include "musical-request.hh"
 #include "dots.hh"
 #include "rest.hh"
+
 /*
   Should merge with Note_head_engraver
  */
@@ -46,7 +47,7 @@ Rest_engraver::do_process_music ()
 {
   if (rest_req_l_ && !rest_p_) 
     {
-      rest_p_ = new Rest (SCM_EOL);
+      rest_p_ = new Rest (get_property ("basicRestProperties"));
       Staff_symbol_referencer_interface si (rest_p_);
       si.set_interface ();
       
@@ -55,7 +56,7 @@ Rest_engraver::do_process_music ()
       
       if (rest_req_l_->duration_.dots_i_)
        {
-         dot_p_ = new Dots (SCM_EOL);
+         dot_p_ = new Dots (get_property ("basicDotsProperties"));
 
          Staff_symbol_referencer_interface si (dot_p_);
          si.set_interface ();
index b01d47896d9d1ae4779c6365c57ba9ba59878167..5270a355e3caecb03d949bb18fc0cc5745cfaeda 100644 (file)
@@ -36,6 +36,7 @@ Rest::after_line_breaking ()
 }
 
 
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(Rest)
 Molecule 
 Rest::do_brew_molecule () const
 {
index ea3ac9cbac2957a8bc493a66570fadd88610d143..327cffe7878452edd61548e0a2603e99dd127485 100644 (file)
@@ -153,7 +153,6 @@ Score_element::set_elt_property (String k, SCM val)
   property_alist_ = gh_cons (gh_cons (sym, val), property_alist_);
 }
 
-
 void
 Score_element::set_elt_pointer (const char* k, SCM v)
 {
@@ -165,7 +164,7 @@ Score_element::set_elt_pointer (const char* k, SCM v)
 Interval
 Score_element::molecule_extent (Score_element const *s, Axis a )
 {
-  Molecule m = s->do_brew_molecule();
+  Molecule m = s->get_molecule ();
   return m.extent(a);
 }
 
@@ -253,10 +252,11 @@ Score_element::calculate_dependencies (int final, int busy,
 Molecule
 Score_element::get_molecule ()  const
 {
-  if (to_boolean (get_elt_property ("transparent")))
-    return Molecule ();
+  SCM proc = get_elt_property ("molecule-callback");
+  if (gh_procedure_p (proc)) 
+    return create_molecule (gh_apply (proc, gh_list (this->self_scm_, SCM_UNDEFINED)));
 
-  return do_brew_molecule ();
+  return Molecule ();
 }
 
 
@@ -292,17 +292,19 @@ Score_element::do_add_processing()
 }
 
 
-/*
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(Score_element)
+
+  /*
   ugh.
  */  
+
 Molecule 
-Score_element::do_brew_molecule() const
+Score_element::do_brew_molecule () const
 {
   SCM glyph = get_elt_property ("glyph");
   if (gh_string_p (glyph))
     {
       return lookup_l ()->afm_find (String (ly_scm2string (glyph)));
-      
     }
   else
     {
@@ -471,15 +473,18 @@ Score_element::suicide ()
   pointer_alist_ = SCM_EOL;
   set_extent_callback (0, Y_AXIS);
   set_extent_callback (0, X_AXIS);
-}
 
+  for (int a= X_AXIS; a <= Y_AXIS; a++)
+    {
+      dim_cache_[a].off_callbacks_.clear ();
+    }
+}
 
 void
 Score_element::handle_prebroken_dependencies()
 {
 }
 
-
 Score_element*
 Score_element::find_broken_piece (Line_of_score*) const
 {
@@ -720,6 +725,13 @@ Score_element::mark_smob (SCM ses)
       return SCM_EOL;
     }
   scm_gc_mark (s->pointer_alist_);
+
+  s->do_derived_mark ();
+  if (s->parent_l (Y_AXIS))
+    scm_gc_mark (s->parent_l (Y_AXIS)->self_scm_);
+  if (s->parent_l (X_AXIS))
+    scm_gc_mark (s->parent_l (X_AXIS)->self_scm_);
+
   return s->property_alist_;
 }
 
@@ -738,6 +750,11 @@ Score_element::print_smob (SCM s, SCM port, scm_print_state *)
   return 1;
 }
 
+void
+Score_element::do_derived_mark ()
+{
+}
+
 void
 Score_element::do_smobify_self ()
 {
index 7136ba6841659969a4b35b69de1446793777f4de..d53c47648f418e72eb6610a4a8e95b6dfcb91693 100644 (file)
@@ -71,7 +71,7 @@ Script_engraver::do_process_music()
          continue;
        }
       // todo -> use result of articulation-to-scriptdef directly as basic prop list.
-      Script *p =new Script (SCM_EOL);
+      Script *p =new Script (get_property ("basicScriptProperties"));
       Side_position_interface stafy (p);
       
       
index 20c799cd9649ea7e5ecd0a07339be390c0107bf9..6c51f6ac5e33ee339d7241847dec25fddc2402f1 100644 (file)
@@ -60,6 +60,7 @@ Script::after_line_breaking ()
   i.set_direction (d);
 }
 
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(Script)
 Molecule 
 Script::do_brew_molecule () const
 {
index 89edf59ca959950c3668ea54b9432c1bbfa107ae..ccb3a9a360d8da1cff028dc15833897f604279c9 100644 (file)
@@ -106,7 +106,7 @@ Slur_engraver::do_process_music()
        {
          // push a new slur onto stack.
          //(use temp. array to wait for all slur STOPs)
-         Slur * s_p =new Slur (SCM_EOL);
+         Slur * s_p =new Slur (get_property ("basicSlurProperties"));
          
          requests_arr_.push (slur_req_l);
          start_slur_l_arr_.push (s_p);
index f15b9a3bb8ef6144fcee18bc1217df81087fcd3a..118bae506c2f3998a1457942e1906a752a89fe0c 100644 (file)
@@ -30,8 +30,6 @@
 #include "group-interface.hh"
 #include "staff-symbol-referencer.hh"
 
-
-
 class Slur_bezier_bow : public Bezier_bow
 {
 public:
@@ -362,9 +360,7 @@ Slur::set_extremities ()
 
   if (!encompass_arr.size ())
     {
-      set_elt_property ("transparent", SCM_BOOL_T);
-      set_extent_callback (0, X_AXIS);
-      set_extent_callback (0, Y_AXIS);
+      suicide();
       return;
     }
 
@@ -607,6 +603,8 @@ Slur::get_rods () const
 
 
 
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(Slur);
+
 /*
   Ugh should have dash-length + dash-period
  */
index d9de35e5f34e7edf87deb5009901cd4de2437109..827213d9fd089b1046a4a5d2f614c6576a89fa6a 100644 (file)
@@ -21,7 +21,6 @@ Spacing_spanner::Spacing_spanner (SCM s)
 {
   set_extent_callback (0, X_AXIS);
   set_extent_callback (0, Y_AXIS);  
-  set_elt_property ("transparent", SCM_BOOL_T);
 }
 
 /*
index 741d7c00f0d450484d5267eaeab1890e1e7ae1e8..da89393ba6c1f20e807f265a34734ed479f4484b 100644 (file)
@@ -60,17 +60,14 @@ Span_bar::evaluate_empty ()
 { 
   if (!gh_pair_p (get_elt_pointer ("elements")))
     {
-      set_elt_property ("transparent", SCM_BOOL_T);
-      set_extent_callback (0, X_AXIS);
-      set_extent_callback (0, Y_AXIS);   
+      suicide ();
     }
   
   SCM gl = get_elt_property ("glyph");
   if (!gh_string_p (gl))
     {
-      set_elt_property ("transparent", SCM_BOOL_T);
-      set_extent_callback (0, X_AXIS);
-      set_extent_callback (0, Y_AXIS);   
+      suicide ();
+      return ; 
     }
   else {
     String type_str = ly_scm2string (gl);
index 01ae90892ce657273cf1a7b27f4932a6ec114c78..336042209077112c45155c043bb71bdfb994aa33 100644 (file)
@@ -142,7 +142,7 @@ Spanner::spanned_rank_iv ()
     {
       iv[LEFT] = spanned_drul_[LEFT]->column_l ()->rank_i ();
     }
-  if ( spanned_drul_[RIGHT])
+  if (spanned_drul_[RIGHT])
     {
       iv[RIGHT] = spanned_drul_[RIGHT]->column_l ()->rank_i ();
     }
@@ -295,3 +295,14 @@ Spanner::get_broken_left_end_align () const
 
   return 0.0;
 }
+
+void
+Spanner::do_derived_mark ()
+{
+  Direction d = LEFT;
+  do
+    if (spanned_drul_[d])
+      scm_gc_mark (spanned_drul_[d]->self_scm_);
+  while (flip (&d) != LEFT);
+}
+
index 50399d33b5eeb7bd272e1fa6d3c60d6423e824b2..b791b707fd91feb4310321e66b4202e93f6a183c 100644 (file)
@@ -15,8 +15,9 @@
 
 
 
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(Staff_symbol)
 Molecule 
-Staff_symbol::do_brew_molecule() const
+Staff_symbol::do_brew_molecule () const
 {
   Score_element * common
     = get_bound (LEFT)->common_refpoint (get_bound (RIGHT), X_AXIS);
index d4d92a7a4f4e4d759fe379820a1003ade62611c2..207fda4489dd34b07222296199403229efa11fc2 100644 (file)
@@ -76,7 +76,7 @@ Stem_engraver::acknowledge_element(Score_element_info i)
       int duration_log = r->duration_.durlog_i_;      
       if (!stem_p_) 
        {
-         stem_p_ = new Stem (SCM_EOL);
+         stem_p_ = new Stem (get_property ("basicStemProperties"));
          Staff_symbol_referencer_interface st(stem_p_);
          st.set_interface ();
          
index 4a23d14c3595c413112ae56317a2c49efb857726..ee39f337ad9d4200f86ecc67a1d558abcc461fde 100644 (file)
@@ -48,6 +48,7 @@ Stem_tremolo::dim_callback (Score_element * se, Axis )
 }
 
 
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(Stem_tremolo)
 Molecule 
 Stem_tremolo::do_brew_molecule () const
 {
index 583d777c5c9a16137821ffff5057620628d7a6d0..6c111feee18050b85a78676aee9ad67fdacc05cf 100644 (file)
@@ -385,11 +385,10 @@ Stem::before_line_breaking ()
 
   if (invisible_b ())
     {
-      set_elt_property ("transparent", SCM_BOOL_T);
-      set_extent_callback (0, Y_AXIS);      
-      set_extent_callback (0, X_AXIS);      
+      remove_elt_property ("molecule-callback");
+      // suicide();
     }
-
+  
   set_spacing_hints ();
 }
 
@@ -454,8 +453,9 @@ Stem::dim_callback (Score_element const *se, Axis )
 }
 
 
-const Real ANGLE = 20* (2.0*M_PI/360.0); // ugh!
+const Real ANGLE = 20* (2.0*M_PI/360.0); // ugh! Should be settable.
 
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(Stem)
 Molecule 
 Stem::do_brew_molecule () const
 {
index aeb2bfd9c18b547c79648b87566738848cd143aa..197761591904aa882c4cf6adb7de913feb0398c6 100644 (file)
@@ -59,12 +59,11 @@ System_start_delimiter::after_line_breaking ()
   
   if (scm_ilength (get_elt_pointer ("elements")) <=  1 && gl == ly_symbol2scm ("bar-line"))
     {
-      set_elt_property ("transparent", SCM_BOOL_T);
-      set_extent_callback (0, X_AXIS);
-      set_extent_callback (0, Y_AXIS);
+      suicide ();
     }
 }
 
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(System_start_delimiter);
 Molecule
 System_start_delimiter::do_brew_molecule ()const
 {
@@ -76,9 +75,7 @@ System_start_delimiter::do_brew_molecule ()const
   if (gh_number_p (s) && l < gh_scm2double (s))
     {
       System_start_delimiter * me = (System_start_delimiter*)this;
-      me->set_elt_property ("transparent", SCM_BOOL_T);
-      me->set_extent_callback (0, X_AXIS);
-      me->set_extent_callback (0, Y_AXIS);
+      me->suicide ();
       return m;
     }
 
index 9e3be5ce81ac7d5bd9150d20eabc4e9e558c8e30..35e5aa5c3dfca2e8242ea7c5f6d14183118374e2 100644 (file)
@@ -20,6 +20,8 @@ Text_item::Text_item (SCM s)
   
 }
 
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(Text_item)
+
 Molecule 
 Text_item::do_brew_molecule () const
 {
index 146e94d3a107f66c795b2a48b5525684614e6ce3..5ef23866d270f7c4712c79d523f593cf51c07a41 100644 (file)
@@ -19,7 +19,6 @@ Tie_column::Tie_column (SCM s)
   set_elt_pointer ("ties", SCM_EOL);
   set_extent_callback (0, X_AXIS);
   set_extent_callback (0, Y_AXIS);  
-  set_elt_property ("transparent", SCM_BOOL_T);
 }
 
 void
index b507048eed0e0b39e5b8cdb954887b730521f123..6d07edd4532458478b203a3c6352f15ec96ca607 100644 (file)
@@ -162,7 +162,7 @@ Tie_engraver::process_acknowledged ()
            }
        }
 
-
+      SCM basic = get_property ("basicTieProperties");
       SCM sparse = get_property ("sparseTies");
       if (to_boolean (sparse))
        {
@@ -173,7 +173,7 @@ Tie_engraver::process_acknowledged ()
          
          SCM pair = gh_list_ref (head_list, gh_int2scm (i/2));
          
-         Tie * p = new Tie (SCM_EOL);
+         Tie * p = new Tie (basic);
          p->set_head (LEFT, dynamic_cast<Item*> (unsmob_element (gh_car (pair))));
          p->set_head (RIGHT, dynamic_cast<Item*> (unsmob_element (gh_cdr (pair))));
          
@@ -182,7 +182,7 @@ Tie_engraver::process_acknowledged ()
        }
       else for (SCM s = head_list; gh_pair_p (s); s = gh_cdr (s))
        {
-         Tie * p = new Tie (SCM_EOL);
+         Tie * p = new Tie (basic);
          p->set_head (LEFT, dynamic_cast<Item*> (unsmob_element (gh_caar (s))));
          p->set_head (RIGHT, dynamic_cast<Item*> (unsmob_element (gh_cdar (s))));
          
@@ -196,7 +196,7 @@ Tie_engraver::process_acknowledged ()
        }
       else if (tie_p_arr_.size () > 1 && !tie_column_p_)
        {
-         tie_column_p_ = new Tie_column (SCM_EOL);
+         tie_column_p_ = new Tie_column (get_property ("basicTieColumnProperties"));
          for (int i = tie_p_arr_.size (); i--; )
            tie_column_p_->add_tie (tie_p_arr_ [i]);
          announce_element (Score_element_info (tie_column_p_, 0));
index daf09ecdab02b3edc1f04437dcf145fc96c30a92..90debb307901e5d70d1c30b79aa4c230155b5b9e 100644 (file)
@@ -98,9 +98,7 @@ Tie::after_line_breaking ()
   if (!head (LEFT) && !head (RIGHT))
     {
       programming_error ("Tie without heads.");
-      set_elt_property ("transparent", SCM_BOOL_T);
-      set_extent_callback (0, X_AXIS);
-      set_extent_callback (0, Y_AXIS);
+      suicide ();
       return;
     }
 
@@ -192,6 +190,7 @@ Tie::get_rods () const
 
 
 
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(Tie)
 Molecule 
 Tie::do_brew_molecule () const
 {
index 15d419a94f5a8eb104e133c2ac1f66c5cbf3b8be..bbefb9dcfaf3e1f6dd7ad7a3b7017648e76e2e0d 100644 (file)
@@ -20,6 +20,7 @@ Time_signature::Time_signature (SCM s)
 }
 
 // ugh.!
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(Time_signature)
 Molecule 
 Time_signature::do_brew_molecule () const
 {
index 04918610d339c1f3651c1d53a7752e0d1086404c..b5f224b51c0cc0bc0ced3276f9625c5b2f263d2c 100644 (file)
@@ -73,7 +73,7 @@ Tuplet_engraver::do_process_music ()
       if (i < started_span_p_arr_.size () && started_span_p_arr_[i])
        continue;
 
-      Tuplet_spanner* glep = new Tuplet_spanner (SCM_EOL);
+      Tuplet_spanner* glep = new Tuplet_spanner (get_property ("basicTupletSpannerProperties"));
       if (i >= started_span_p_arr_.size ())
        started_span_p_arr_.push (glep);
       else
index 70ad67dd4efa425d7af531451c3b696aed687a3b..fbb5f04872a2530f174f15d54cba86bb181de47a 100644 (file)
@@ -35,6 +35,7 @@ Tuplet_spanner::Tuplet_spanner (SCM s)
 /*
   TODO. 
  */
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(Tuplet_spanner)
 Molecule 
 Tuplet_spanner::do_brew_molecule () const
 {
@@ -207,9 +208,7 @@ Tuplet_spanner::after_line_breaking ()
 
   if (!column_arr.size ())
     {
-      set_elt_property ("transparent", SCM_BOOL_T);
-      set_extent_callback (0, X_AXIS);
-      set_extent_callback (0, Y_AXIS);
+      suicide ();
     }
 
   Direction d = directional_element (this).get ();
index 0ad6860ade0ee05dabe787e277f65e3c103e4277..4f4880a716233f43d406632cba35c8ef5df45cf9 100644 (file)
@@ -41,6 +41,7 @@ Volta_spanner::Volta_spanner (SCM s)
   
   
 */
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(Volta_spanner)
 Molecule 
 Volta_spanner::do_brew_molecule () const
 {