]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.3.44
authorfred <fred>
Tue, 26 Mar 2002 23:10:40 +0000 (23:10 +0000)
committerfred <fred>
Tue, 26 Mar 2002 23:10:40 +0000 (23:10 +0000)
37 files changed:
flower/polynomial.cc
input/test/repeat-unfold.ly
lily/axis-group-engraver.cc
lily/axis-group-interface.cc
lily/bar.cc
lily/beam.cc
lily/break-algorithm.cc
lily/clef-item.cc
lily/dots.cc
lily/gourlay-breaking.cc
lily/hara-kiri-vertical-group-spanner.cc
lily/include/audio-column.hh
lily/include/beam.hh
lily/include/break-algorithm.hh
lily/include/gourlay-breaking.hh
lily/include/line-of-score.hh
lily/include/paper-column.hh
lily/include/paper-outputter.hh
lily/include/paper-score.hh
lily/include/score-element.hh
lily/item.cc
lily/line-of-score.cc
lily/paper-outputter.cc
lily/paper-score.cc
lily/rest-collision.cc
lily/score-element.cc
lily/score-engraver.cc
lily/single-malt-grouping-item.cc
lily/spacing-spanner.cc
lily/span-bar-engraver.cc
lily/span-bar.cc
lily/stem.cc
lily/system-start-delimiter.cc
lily/text-engraver.cc
lily/tie-column.cc
lily/tie.cc
lily/vertical-align-engraver.cc

index d43cb9e2a70038a27ee615eb24d762b0e9c16ef6..4e7fd944c78b4731c3cde7d74abee41dbdafbf0b 100644 (file)
@@ -90,7 +90,9 @@ Polynomial::clean()
        coefs_[i] = 0.0;
     }
 
-  while (degree () > 0 && fabs (coefs_.top ()) < FUDGE * fabs (coefs_.top (1)))
+  while (degree () > 0 &&
+        (fabs (coefs_.top ()) < FUDGE * fabs (coefs_.top (1)))
+        || !coefs_.top ())
     coefs_.pop ();
 }
 
index 95faea394ea44defcd2dd2ac03fd917c71859d50..8d62f8991c8e789ff7df0541a9c7793112c9d0e6 100644 (file)
@@ -1,5 +1,7 @@
 
-\score { \notes\relative c'' {
+\score {
+
+  \context Voice \notes\relative c'' {
 \repeat unfold 3 { c^"3x 0a" d }
 % less alts than body
 \repeat unfold 4 { c^"4x 0a" d } \alternative { e f }
index 5da70fe929da72be8d6637c603c72b1ec9de48c0..a674757cbe542aea56c4035dd3ad80c9e700091b 100644 (file)
@@ -77,7 +77,8 @@ Axis_group_engraver::process_acknowledged ()
     {
       Score_element *par = elts_[i]->parent_l (Y_AXIS);
 
-      if (!par || !Axis_group_interface (par).has_interface_b ())
+      if ((!par || !Axis_group_interface (par).has_interface_b ())
+         && ! elts_[i]->empty_b (Y_AXIS))
        Axis_group_interface (staffline_p_).add_element (elts_[i]);
     }
   elts_.clear ();
index c22bbeedb0e31d5a56437ffd77a10f31c7ba6dda..a9d868a3a94e9f11f05d40e7331d46d131866ceb 100644 (file)
@@ -25,6 +25,8 @@ Axis_group_interface (Score_element*s)
 void
 Axis_group_interface::add_element (Score_element *e)
 {
+
+  // ugh. used_b_ should be junked.
   elt_l_->used_b_ = true;
   e->used_b_ = true;
 
@@ -37,7 +39,6 @@ Axis_group_interface::add_element (Score_element *e)
     }
 
   Group_interface (elt_l_).add_element (e);
-
   elt_l_->add_dependency (e);
 }
 
@@ -106,9 +107,9 @@ Axis_group_interface::set_axes (Axis a1, Axis a2)
   elt_l_->set_elt_property ("axes", ax);
 
   if (a1 != X_AXIS && a2 != X_AXIS)
-    elt_l_->set_empty (X_AXIS);
+    elt_l_->set_extent_callback (0, X_AXIS);
   if (a1 != Y_AXIS && a2 != Y_AXIS)
-    elt_l_->set_empty (Y_AXIS);
+    elt_l_->set_extent_callback (0, Y_AXIS);
   
   elt_l_->dim_cache_[a1]->set_extent_callback (Axis_group_interface::group_extent_callback);
   elt_l_->dim_cache_[a2]->set_extent_callback (Axis_group_interface::group_extent_callback);
@@ -137,7 +138,7 @@ bool
 Axis_group_interface::has_interface_b ()
 {
   SCM memq = scm_memq (ly_symbol2scm ("Axis_group"),
-             elt_l_->get_elt_property ("interfaces"));
+                      elt_l_->get_elt_property ("interfaces"));
   
   return (memq != SCM_BOOL_F);
 }
index 299c5e9b3d073124c3727e4d7ab45e701ead1400..99f65c026ecabd64f111efc1d4efdeed0ca5a658 100644 (file)
@@ -144,7 +144,7 @@ Bar::before_line_breaking ()
   if (!gh_string_p (g))
     {
       set_elt_property ("transparent", SCM_BOOL_T);
-      set_empty (X_AXIS);      
+      set_extent_callback (0, X_AXIS);      
     }
   else
     set_elt_property ("glyph", g);
index 39edb511db4ed6f24c6b9871f49b26d2d09cbd6f..027a08d70f0499b37ee6b50296c2fe31d8260470 100644 (file)
     * less hairy code
     * move paper vars to scm
 
+
+    remove *-hs variables.
+    
 */
 
 
 #include <math.h>              // tanh.
-
 #include "directional-element-interface.hh"
 #include "beaming.hh"
 #include "dimensions.hh"
 #include "staff-symbol-referencer.hh"
 #include "cross-staff.hh"
 
-
 Beam::Beam ()
 {
   Group_interface g (this, "stems");
   g.set_interface ();
+
+  set_elt_property ("height", gh_int2scm (0)); // ugh.
+  set_elt_property ("y-position" ,gh_int2scm (0));
 }
 
 void
@@ -269,7 +273,7 @@ Beam::after_line_breaking ()
 {
   /* first, calculate y, dy */
   Real y, dy;
-  calc_position_and_height (&y, &dy);
+  calc_default_position_and_height (&y, &dy);
   if (visible_stem_count ())
     {
       if (suspect_slope_b (y, dy))
@@ -337,9 +341,10 @@ Beam::after_line_breaking ()
   See Documentation/tex/fonts.doc
  */
 void
-Beam::calc_position_and_height (Real* y, Real* dy) const
+Beam::calc_default_position_and_height (Real* y, Real* dy) const
 {
-  *y = *dy = 0;
+  *y = 0;
+  *dy = 0;  
   if (visible_stem_count () <= 1)
     return;
 
index 84a57b811a00cf49d4bebfc03f9ea54800d1412c..3337bff317a95f570e15a14b6314022e3f34377f 100644 (file)
 #include "cpu-timer.hh"
 #include "command-request.hh"
 #include "simple-spacer.hh"
-
-
-
+#include "group-interface.hh"
 
 
 Array<int>
 Break_algorithm::find_break_indices () const
 {
-  Link_array<Paper_column> all (pscore_l_->col_l_arr_);
+  Link_array<Paper_column> all = pscore_l_->line_l_->column_l_arr ();
+  
+                                        
   Array<int> retval;
 
   for (int i=0; i < all.size (); i++)
@@ -42,7 +42,8 @@ Break_algorithm::find_break_indices () const
 Link_array<Paper_column>
 Break_algorithm::find_breaks () const
 {
-  Link_array<Paper_column> all (pscore_l_->col_l_arr_);
+  Link_array<Paper_column> all = pscore_l_->line_l_->column_l_arr ();
+    
   Link_array<Paper_column> retval;
 
   for (int i=0; i < all.size (); i++)
@@ -94,22 +95,6 @@ Break_algorithm::set_pscore (Paper_score*s)
 {
   pscore_l_ = s;
   linewidth_f_ = s->paper_l_->get_var("linewidth");
-  do_set_pscore ();
-}
-
-
-
-void
-Break_algorithm::problem_OK () const
-{
-  if (pscore_l_->col_l_arr_.empty ())
-    error (_("score does not have any columns"));
-  OK ();
-}
-
-void
-Break_algorithm::OK () const
-{
 }
 
 Array<Column_x_positions>
@@ -120,8 +105,3 @@ Break_algorithm::solve () const
   return h;
 }
 
-void
-Break_algorithm::do_set_pscore ()
-{
-
-}
index a7c9661293e0217f613360c72ec8096ac3343d8b..af14a41828c35d82ab9509bc4b608b1ec8e6d5fa 100644 (file)
@@ -6,7 +6,7 @@
   (c)  1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-#include <ctype.h>
+
 #include "clef-item.hh"
 #include "string.hh"
 #include "molecule.hh"
@@ -17,6 +17,7 @@
 #include "dimension-cache.hh"
 #include "side-position-interface.hh"
 #include "warn.hh"
+#include "line-of-score.hh"
 
 void
 Clef_item::before_line_breaking ()
@@ -46,7 +47,7 @@ Clef_item::before_line_breaking ()
   if (style == "transparent")  // UGH. JUNKME
     {
       set_elt_property ("transparent", SCM_BOOL_T);
-      set_empty (X_AXIS);
+      set_extent_callback (0, X_AXIS);
     }
 }
 
@@ -65,7 +66,7 @@ Clef_item::do_add_processing ()
          Side_position_interface spi (g);
          spi.set_axis (Y_AXIS);
          
-         pscore_l_->typeset_element (g);
+         pscore_l_->line_l_->typeset_element (g);
       
          spi.add_support (this);
          g->set_elt_property ("text", ly_str02scm ( "8"));
index 7846e2d36769d29204309e970d07b1d6c1054d48..5fa59bdd50ea3f5384c90556d9e1639b70148cf3 100644 (file)
@@ -25,8 +25,8 @@ Dots::after_line_breaking ()
   if (!gh_number_p (d) || !gh_scm2int (d))
     {
       set_elt_property ("transparent", SCM_BOOL_T);
-      set_empty (X_AXIS);
-      set_empty (Y_AXIS);
+      set_extent_callback (0, X_AXIS);
+      set_extent_callback (0, Y_AXIS);
     }
   else
     {
index beb260f3f5eb1cba2658cb0a7222a4d5223d3f6f..0425c8a118cdc97c3d56b0c11a9f79a53775932a 100644 (file)
@@ -14,8 +14,7 @@
 #include "paper-score.hh"
 #include "paper-def.hh"
 #include "simple-spacer.hh"
-
-#include "killing-cons.tcc"
+#include "line-of-score.hh"
 
 /// How often to print operator pacification marks?
 const int HAPPY_DOTS_I = 3;
@@ -47,12 +46,17 @@ struct Break_node {
 
 /**
   This algorithms is adapted from the OSU Tech report on breaking lines.
+
+  this function is longish, but not very complicated.
+  
  */
 Array<Column_x_positions>
 Gourlay_breaking::do_solve () const
 {
   Array<Break_node> optimal_paths;
-  Link_array<Paper_column> all = pscore_l_->col_l_arr_ ;
+  Link_array<Paper_column> all =
+    pscore_l_->line_l_->column_l_arr ();
+  
   Array<int> breaks = find_break_indices ();
   
   optimal_paths.set_size (breaks.size ());
@@ -163,14 +167,8 @@ Gourlay_breaking::do_solve () const
 Gourlay_breaking::Gourlay_breaking ()
 {
   energy_bound_f_ = infinity_f;
-  max_measures_i_ = INT_MAX;
 }
 
-void
-Gourlay_breaking::do_set_pscore ()
-{
-  max_measures_i_ =int (rint (pscore_l_->paper_l_->get_var ("gourlay_maxmeasures")));
-}
 
 
 /*
index 9f09ea2d90efc8ee2f035a40a68cc10a44bb50b2..12d5093c079185a83059eb16c3d325b3d9824071 100644 (file)
@@ -42,12 +42,12 @@ 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_empty (X_AXIS);
-      s->set_empty (Y_AXIS);
+      s->set_extent_callback (0, X_AXIS);
+      s->set_extent_callback (0, Y_AXIS);
 
     }
-  set_empty (X_AXIS);
-  set_empty (Y_AXIS);  
+  set_extent_callback (0, X_AXIS);
+  set_extent_callback (0, Y_AXIS);  
 }
 
 
index 8b6791933e6ff291bab880e691845806bd3c3800..5b6f8d4d8a63740ddb276c74e155cb2b39da38dd 100644 (file)
 
 class Audio_column : public Audio_element  { 
 public:
-    Audio_column (Moment at_mom);
+  Audio_column (Moment at_mom);
 
-    void add_audio_item (Audio_item* i_l);
-    Moment at_mom() const;
-    void print() const;
+  void add_audio_item (Audio_item* i_l);
+  Moment at_mom() const;
+  void print() const;
 
-    Link_array<Audio_item> audio_item_l_arr_;
-    Performance * performance_l_;
+  Link_array<Audio_item> audio_item_l_arr_;
+  Performance * performance_l_;
 
 private:
-    Audio_column (Audio_column const&);
+  Audio_column (Audio_column const&);
 
-    Moment at_mom_;
+  Moment at_mom_;
 };
 
 
index 54f6d04bdcb86fcf31c9ea38694a00297ae209a6..768d07aaa75c311e71c229467b122fe6a115f417 100644 (file)
@@ -56,7 +56,7 @@ private:
   void auto_knees ();
   bool auto_knee (String gap_str, bool interstaff_b);
   void set_stem_shorten ();
-  void calc_position_and_height (Real* y, Real* dy) const;
+  void calc_default_position_and_height (Real* y, Real* dy) const;
   bool suspect_slope_b (Real y, Real dy) const;
   Real calc_slope_damping_f (Real dy) const;
   Real calc_stem_y_f (Stem* s, Real y, Real dy) const;
index 99bba1a2c5ba0de0c0d1210fb05c9bbdeff332b0..00da3940ce7a0df67eb45a3007e8fde4723e0b86 100644 (file)
@@ -44,16 +44,12 @@ protected:
   Simple_spacer* generate_spacing_problem (Link_array<Paper_column>, Interval) const;
 
   virtual Array<Column_x_positions> do_solve() const=0;
-  virtual void do_set_pscore();
 
 public:
   Simple_spacer* (*get_line_spacer)();
   Break_algorithm();
   void set_pscore (Paper_score*);
 
-  /// check if the spacing/breaking problem is well-stated
-  void problem_OK() const;
-  void OK() const;
   Array<Column_x_positions> solve() const;
 };
 
index 9f002950767651d0843a569522366ab262c33126..6baa4780d7f9c214c46fe8c7a17b245ea62308c1 100644 (file)
@@ -19,9 +19,6 @@ struct Gourlay_breaking : public Break_algorithm
 {
   Real energy_bound_f_ ;
     
-    /// maximum number of measures in a line
-  int max_measures_i_;
-  void do_set_pscore();
   Array<Column_x_positions> do_solve() const;
   Gourlay_breaking();
   Real combine_demerits (Column_x_positions const&,Column_x_positions const&) const;
index f9031a2f5097789b12d68e99f579405aa26a1d54..1e81b087f96b8384908afcef52e16dcac2d645f7 100644 (file)
@@ -7,6 +7,7 @@
 #ifndef SCORELINE_HH
 #define SCORELINE_HH
 
+#include "protected-scm.hh" 
 #include "column-x-positions.hh"
 #include "spanner.hh"
 
@@ -30,7 +31,8 @@ public:
   void output_all ();
 
   int rank_i_;
-  
+
+  Protected_scm output_;
   Line_of_score();
     
   /// is #c# contained in #*this#?
@@ -39,10 +41,18 @@ public:
   static int compare (Line_of_score* const &,Line_of_score* const &);
 
   void break_into_pieces (Array<Column_x_positions> const&);
-  void output_lines ();
-  void output_line (bool last_line);
-  void add_column (Paper_column*);
+
+  SCM output_lines ();
+
+
+  Link_array<Item> broken_col_range (Item const*, Item const*) const;
+  Link_array<Paper_column> column_l_arr () const;
   
+  void add_column (Paper_column*);
+  void typeset_element (Score_element*);
+  void output_molecule (SCM, Offset);
+  void output_scheme (SCM);
+  void pre_processing ();
 protected:
   VIRTUAL_COPY_CONS(Score_element);
 };
index e0510bc7f8c6070b99d0a0a44fb45bc2565d0f6c..796781a2b232ac096aad21531d5c092409f90ea3 100644 (file)
@@ -31,6 +31,11 @@ class Paper_column : public Item
 { 
 public:
   VIRTUAL_COPY_CONS(Score_element);
+
+  /*
+    ugh.
+   */
+  
   Drul_array<Array<Column_rod> > minimal_dists_arr_drul_;
   Drul_array<Array<Column_spring> > spring_arr_drul_;
 
@@ -41,11 +46,9 @@ public:
   virtual Paper_column * column_l () const;
   virtual Line_of_score *line_l () const;
 
-
   /// if lines are broken then this column is in #line#
   Line_of_score *line_l_;
 
-
   /// which  one (left =0)
   int rank_i() const;
 
@@ -65,10 +68,6 @@ private:
   int rank_i_;
 
 };
-
-
-// #include "compare.hh"
-// INSTANTIATE_COMPARE(Paper_column &, Paper_column::compare);
      
 #endif // P_COL_HH
 
index 3a1d343c2772229d486e4bc0e032e2e874f6f91d..73ad6aecf0ea1849737b8436a382db2ad2398700 100644 (file)
 #include "lily-guile.hh"
 #include "protected-scm.hh"
 
-// huh?
-#ifdef __powerpc__
-#include "protected-scm.hh"
-#endif
-
 /**
   Abstract interface for a Score_element to output itself.
  */
@@ -40,13 +35,8 @@ public:
   void output_font_def (int i, String str);
   void output_font_switch (int i);
   void output_header ();
-  void output_molecule (SCM expr, Offset, char const *);
   void output_comment (String s);
   void output_scheme (SCM scm);
-
-  void start_line (Real height);
-  void stop_line ();
-  void stop_last_line ();
 };
 
 #endif // PAPER_OUTPUTTER_HH
index e6d757fcfbebce8e7833e9e0bfd34a1c92a44b6f..bca0642c61434a4c111c93d0a2768710f7ccc5ae 100644 (file)
@@ -15,6 +15,7 @@
 #include "lily-proto.hh"
 #include "music-output.hh"
 #include "lily-guile.hh"
+#include "protected-scm.hh"
 
 /** all stuff which goes onto paper. notes, signs, symbols in a score
      #Paper_score# contains the items, the columns.
@@ -27,23 +28,11 @@ class Paper_score : public Music_output
 public:
   Paper_def *paper_l_;
 
-  /// the columns, ordered left to right
-  /*
-    UGH. MOVE INTO LINE_OF_SCORE ?!
-   */
-  Link_array<Paper_column> col_l_arr_;
-
   Paper_outputter *outputter_l_;  
   Line_of_score * line_l_;
   
   Paper_score ();
 
-  void fixup_refpoints ();
-
-
-  /// add to bottom of pcols
-  void add_column (Paper_column*);
-
   /**
     @return index of argument.
     */
@@ -52,16 +41,8 @@ public:
   Link_array<Item> broken_col_range (Item const*,Item const*) const;
     
     
-  /* STANDARD ROUTINES */
-  void print() const;
-  
-  void typeset_element (Score_element*);
-  void typeset_broken_spanner (Spanner*);
-  /// add a Spanner
-  void typeset_unbroken_spanner (Spanner*);
-  
+  void typeset_line (Line_of_score*);
     
-  virtual ~Paper_score();
 protected:
     /* MAIN ROUTINES */
   virtual void process();
@@ -69,7 +50,6 @@ protected:
 private:
   /// before calc_breaking
   void preprocess();
-
   void calc_idealspacing();
   /// calculate where the lines are to be broken, and use results
   Array<Column_x_positions> calc_breaking();
index f1818787357d269bb82003ab37f08a720ebb28e0..768152545e7e6fb88dbfc43c7db7fc1a86e1772f 100644 (file)
@@ -151,6 +151,10 @@ public:
 
   /// do calculations before determining horizontal spacing
   virtual void before_line_breaking ();
+  /// do calculations after determining horizontal spacing
+  virtual void after_line_breaking ();
+  virtual void output_processing ();
+  
 
   static Interval preset_extent (Dimension_cache const*);
   static Interval molecule_extent (Dimension_cache const*);
@@ -162,8 +166,6 @@ protected:
     be handled by GUILE gc.  */
   virtual ~Score_element ();
   
-  virtual void output_processing ();
-  
   /// do printing of derived info.
   virtual void do_print () const;
   /// generate the molecule    
@@ -171,14 +173,13 @@ protected:
   ///executed directly after the item is added to the Paper_score
   virtual void do_add_processing ();
 
-  /// do calculations after determining horizontal spacing
-  virtual void after_line_breaking ();
     
   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);  
-  
+
   virtual void handle_broken_dependencies ();
   virtual void handle_prebroken_dependencies ();
 
@@ -200,6 +201,7 @@ public:
   char const * name () const;
   /**
      Set empty in direction A.
+     JUNKME
    */
   void set_empty (Axis a);
   bool empty_b (Axis a) const;
@@ -221,6 +223,8 @@ public:
 
   bool has_offset_callback_b (Offset_cache_callback, Axis)const;
   void add_offset_callback (Offset_cache_callback, Axis);
+  void set_extent_callback (Dim_cache_callback , Axis);
+  
   /**
      Set the  parent refpoint of THIS to E
    */
index 0458144c3513ced1cc671d0b7526889ae7eccf20..1f7950658cc49cd7189e752c99d02fb8de26a6b8 100644 (file)
@@ -13,6 +13,7 @@
 #include "paper-column.hh"
 #include "spanner.hh"
 #include "lily-guile.hh"
+#include "line-of-score.hh"
 
 Item::Item ()
 {
@@ -57,7 +58,7 @@ Item::copy_breakable_items()
     {
       Score_element * dolly = clone();
       Item * item_p = dynamic_cast<Item*>(dolly);
-      pscore_l_->typeset_element (item_p);
+      pscore_l_->line_l_->typeset_element (item_p);
       new_copies[i] =item_p;
     }
   while (flip(&i) != LEFT);
@@ -84,8 +85,8 @@ Item::try_visibility_lambda ()
 
       if (empty)
        {
-         set_empty (X_AXIS);
-         set_empty ( Y_AXIS);
+         set_extent_callback (0, X_AXIS);
+         set_extent_callback (0,  Y_AXIS);
        }
       if (trans)
        set_elt_property ("transparent", SCM_BOOL_T);
index 4d8f3b74290d2a3ade1d4694fcea5fc9394c3ae3..b87c716dd086aaa5a41ff215da1ebb28e5377943 100644 (file)
 #include "paper-score.hh"
 #include "string.hh"
 #include "warn.hh"
-
+#include "dimensions.hh"
 
 Line_of_score::Line_of_score()
 {
   set_elt_property ("columns", SCM_EOL);
+  set_elt_property ("all-elements", SCM_EOL);
+
   Axis_group_interface (this).set_interface ();
   Axis_group_interface (this).set_axes (Y_AXIS,X_AXIS);
 }
 
 
-
 void
+Line_of_score::typeset_element (Score_element * elem_p)
+{
+  elem_p->pscore_l_ = pscore_l_;
+  Group_interface (this, "all-elements").add_element (elem_p);
+  scm_unprotect_object (elem_p->self_scm_);
+}
+
+SCM
 Line_of_score::output_lines ()
 {
+  for (SCM s = get_elt_property ("all-elements");
+       gh_pair_p (s); s = gh_cdr (s))
+    {
+      unsmob_element (gh_car (s))->do_break_processing ();
+    }
+
+  for (SCM s = get_elt_property ("all-elements");
+       gh_pair_p (s); s = gh_cdr (s))
+    {
+      unsmob_element (gh_car (s))->handle_broken_dependencies ();
+    }
+  handle_broken_dependencies ();
+  
   for (int i=0; i < broken_into_l_arr_.size (); i++)
     {
       Line_of_score *line_l = dynamic_cast<Line_of_score*> (broken_into_l_arr_[i]);
@@ -37,9 +59,16 @@ Line_of_score::output_lines ()
       progress_indication ("[");
       line_l->post_processing ();
       progress_indication (to_str (i));
-      line_l->output_line (i + 1 == broken_into_l_arr_.size ());
       progress_indication ("]");
     }
+
+  SCM list = SCM_EOL; 
+  for (int i=broken_into_l_arr_.size (); i--;)
+    {
+      Line_of_score * l =  dynamic_cast<Line_of_score*> (broken_into_l_arr_[i]);
+      list = gh_cons (gh_cdr (l->output_), list);
+    }
+  return list;
 }
 
 // const?
@@ -51,7 +80,8 @@ Line_of_score::break_into_pieces (Array<Column_x_positions> const &breaking)
       Line_of_score *line_l = dynamic_cast <Line_of_score*> (clone());
       line_l->rank_i_ = i;
       Link_array<Paper_column> c (breaking[i].cols_);
-      pscore_l_->typeset_element (line_l);
+      pscore_l_->typeset_line (line_l);
+      
       line_l->set_bound(LEFT,c[0]);
       line_l->set_bound(RIGHT,c.top ());
       for (int j=0; j < c.size(); j++)
@@ -64,30 +94,66 @@ Line_of_score::break_into_pieces (Array<Column_x_positions> const &breaking)
     }
 }
 
+
 void
-Line_of_score::add_column (Paper_column*p)
+Line_of_score::output_molecule (SCM expr, Offset o)
 {
-  set_elt_property ("columns",
-                   gh_cons (p->self_scm_, get_elt_property ("columns")));
-  Axis_group_interface (this).add_element (p);
+  SCM offset_sym = ly_symbol2scm ("translate-molecule");
+  SCM combine_sym = ly_symbol2scm ("combine-molecule");
+enter:
+
+  if (!gh_pair_p (expr))
+    return;
+  
+  SCM head =gh_car (expr);
+  if (head == offset_sym)
+    {
+      o += ly_scm2offset (gh_cadr (expr));
+      expr = gh_caddr (expr);
+      goto enter;
+    }
+  else if (head == combine_sym)
+    {
+      output_molecule (gh_cadr (expr), o);
+      expr = gh_caddr (expr);
+      goto enter;              // tail recursion
+    }
+  else
+    {
+      output_scheme (gh_list (ly_symbol2scm ("placebox"),
+                             gh_double2scm (o[X_AXIS]),
+                             gh_double2scm (o[Y_AXIS]),
+                             expr,
+                             SCM_UNDEFINED));
+    }
 }
 
+void
+Line_of_score::output_scheme (SCM s)
+{
+  gh_set_cdr_x (output_, gh_cons (s, gh_cdr (output_)));
+}
 
 void
-Line_of_score::output_line (bool last_line)
+Line_of_score::add_column (Paper_column*p)
 {
-  Interval i(extent(Y_AXIS));
-  if (i.empty_b())
-    programming_error ("Huh?  Empty Line_of_score?");
-  else
-    translate_axis (- i[MAX], Y_AXIS);
-  
-  pscore_l_->outputter_l_->start_line (i.length ());
-  output_all ();
-  if (last_line)
-    pscore_l_->outputter_l_->stop_last_line();
-  else
-    pscore_l_->outputter_l_->stop_line ();
+  SCM cs = get_elt_property ("columns");
+  Score_element * prev =  gh_pair_p (cs) ? unsmob_element (gh_car (cs)) : 0;
+  int rank = prev ? dynamic_cast<Paper_column*> (prev)->rank_i () + 1 : 0; 
+
+  p->set_rank (rank);
+  set_elt_property ("columns",  gh_cons (p->self_scm_, cs));
+
+  Axis_group_interface (this).add_element (p);
+  typeset_element (p);
+}
+
+Link_array<Paper_column>
+Line_of_score::column_l_arr ()const
+{
+  return Group_interface__extract_elements (this,
+                                           (Paper_column*) 0, "columns");
+
 }
 
 int
@@ -96,10 +162,75 @@ Line_of_score::compare (Line_of_score* const &p1,Line_of_score* const &p2)
   return p1->rank_i_ - p2->rank_i_;
 }
 
+
+void
+fixup_refpoints (SCM s)
+{
+  for (; gh_pair_p (s); s = gh_cdr (s))
+    {
+      Score_element * se = unsmob_element (gh_car (s));
+      if (se)
+       {
+         se->fixup_refpoint ();
+         if (!dynamic_cast<Line_of_score*> (se) && !se->parent_l (Y_AXIS))
+           {
+             programming_error ("No parent!");
+           }
+       }
+    }
+}
+
+
+void
+Line_of_score::pre_processing ()
+{
+  for (SCM s = get_elt_property ("all-elements"); gh_pair_p (s); s = gh_cdr (s))
+    unsmob_element (gh_car (s))->do_breakable_col_processing ();
+  
+  fixup_refpoints (get_elt_property ("all-elements"));
+  
+  for (SCM s = get_elt_property ("all-elements"); gh_pair_p (s); s = gh_cdr (s))
+    {
+      Score_element* sc = unsmob_element (gh_car (s));
+      sc->calculate_dependencies (PRECALCED, PRECALCING, &Score_element::before_line_breaking);
+    }
+  
+  progress_indication ("\n" + _ ("Calculating column positions...") + " " );
+  for (SCM s = get_elt_property ("all-elements"); gh_pair_p (s); s = gh_cdr (s))
+    unsmob_element (gh_car (s))->do_space_processing ();
+}
+
 void
 Line_of_score::post_processing ()
 {
-  calculate_dependencies (POSTCALCED, POSTCALCING, &Score_element::after_line_breaking);
+  fixup_refpoints (get_elt_property ("all-elements"));
+  for (SCM s = get_elt_property ("all-elements");
+       gh_pair_p (s); s = gh_cdr (s))
+    {
+      Score_element* sc = unsmob_element (gh_car (s));
+      sc->calculate_dependencies (POSTCALCED, POSTCALCING, &Score_element::after_line_breaking);
+    }
+
+  Interval i(extent(Y_AXIS));
+  if (i.empty_b())
+    programming_error ("Huh?  Empty Line_of_score?");
+  else
+    translate_axis (- i[MAX], Y_AXIS);
+
+  Real height = i.length ();
+  if (height > 50 CM)
+    {
+      programming_error ("Improbable system height");
+      height = 50 CM;
+    }
+
+  output_ = gh_cons (SCM_EOL, SCM_EOL);
+  output_scheme (gh_list (ly_symbol2scm ("stop-line"), SCM_UNDEFINED));
+  for (SCM s = get_elt_property ("all-elements"); gh_pair_p (s); s = gh_cdr (s))
+    unsmob_element (gh_car (s))->output_processing ();
+  output_scheme (gh_list (ly_symbol2scm ("start-line"),
+                         gh_double2scm (height),
+                         SCM_UNDEFINED));
 }
 
 void
@@ -108,6 +239,34 @@ Line_of_score::output_all ()
   calculate_dependencies (BREWED, BREWING, &Score_element::output_processing);
 }
 
+Link_array<Item> 
+Line_of_score::broken_col_range (Item const*l, Item const*r) const
+{
+  Link_array<Item> ret;
+
+  l = l->column_l ();
+  r = r->column_l ();
+  SCM s = get_elt_property ("columns");
+
+  while (gh_car (s) != r->self_scm_)
+    s = gh_cdr  (s);
+    
+
+  s = gh_cdr (s);
+  
+  while (gh_car (s) != l->self_scm_)
+    {
+      Paper_column *c
+       = dynamic_cast<Paper_column*> (unsmob_element (gh_car (s)));
+      if (c->breakable_b () && !c->line_l_)
+       ret.push (c);
+
+      s = gh_cdr  (s);
+    }
+
+  ret.reverse ();
+  return ret;
+}
 
 
 
index 584347bae9318192f19b171c8a1d51f059f2c645..1d5ee856a146145126139434ce169658dac2ba5f 100644 (file)
 #include "lily-version.hh"
 
 
+/*
+  Ugh, this is messy.
+ */
+
 Paper_outputter::Paper_outputter ()
 {
   molecules_ = gh_cons (SCM_EOL, SCM_EOL);
@@ -75,46 +79,7 @@ Paper_outputter::output_header ()
   output_scheme (scm);
 }
 
-void
-Paper_outputter::output_molecule (SCM expr, Offset o, char const *nm)
-{
-#if 0
-  if (flower_dstream)
-    {
-      output_comment (nm);
-    }
-#endif
-  
-  SCM offset_sym = ly_symbol2scm ("translate-molecule");
-  SCM combine_sym = ly_symbol2scm ("combine-molecule");
-enter:
-
-  if (!gh_pair_p (expr))
-    return;
-  
-  SCM head =gh_car (expr);
-  if (head == offset_sym)
-    {
-      o += ly_scm2offset (gh_cadr (expr));
-      expr = gh_caddr (expr);
-      goto enter;
-    }
-  else if (head == combine_sym)
-    {
-      output_molecule (gh_cadr (expr), o, nm);
-      expr = gh_caddr (expr);
-      goto enter;              // tail recursion
-    }
-  else
-    {
-      output_scheme (gh_list (ly_symbol2scm ("placebox"),
-                             gh_double2scm (o[X_AXIS]),
-                             gh_double2scm (o[Y_AXIS]),
-                             expr,
-                             SCM_UNDEFINED));
 
-    }
-}
 
 void
 Paper_outputter::output_comment (String str)
@@ -251,19 +216,7 @@ Paper_outputter::output_version ()
   output_String_def ( "LilyPondVersion", version_str ());
 }
 
-void
-Paper_outputter::start_line (Real height)
-{
-  if (height > 50 CM)
-    {
-      programming_error ("Improbable system height");
-      height = 50 CM;
-    }
-  SCM scm = gh_list (ly_symbol2scm ("start-line"),
-                    gh_double2scm (height),
-                    SCM_UNDEFINED);
-  output_scheme (scm);
-}
+
 
 void
 Paper_outputter::output_font_def (int i, String str)
@@ -316,20 +269,5 @@ Paper_outputter::output_int_def (String k, int v)
 
 
 
-void
-Paper_outputter::stop_line ()
-{
-  SCM scm = gh_list (ly_symbol2scm ("stop-line"), SCM_UNDEFINED);
-  output_scheme (scm);
-}
-
-void
-Paper_outputter::stop_last_line ()
-{
-  SCM scm = gh_list (ly_symbol2scm ("stop-last-line"), SCM_UNDEFINED);
-  output_scheme (scm);
-  scm = gh_list (ly_symbol2scm ("end-output"), SCM_UNDEFINED);
-  output_scheme (scm);
-}
 
 
index 247b5fecad48cc0d1b4c9cf2231d0e6cf4a2fd26..941cfe71abcbc3d1ee38f12796f1ef98432462f1 100644 (file)
@@ -27,68 +27,22 @@ Paper_score::Paper_score ()
 {
   paper_l_ =0;
   outputter_l_ =0;
-  Line_of_score * line_p = new Line_of_score;
-  line_p->pscore_l_ = this;
-  element_smob_list_ = scm_protect_object (gh_cons (line_p->self_scm_, SCM_EOL));
-  line_l_ = line_p;
-}
-
-Paper_score::Paper_score (Paper_score const &s)
-  : Music_output (s)
-{
-  assert (false);
-}
-
-Paper_score::~Paper_score ()
-{
-  scm_unprotect_object (element_smob_list_);
+  line_l_ = new Line_of_score;
+  element_smob_list_ = SCM_EOL;
+  typeset_line (line_l_);
 }
 
 void
-Paper_score::typeset_element (Score_element * elem_p)
+Paper_score::typeset_line (Line_of_score *l)
 {
-  elem_p->pscore_l_ = this;
-
-  gh_set_cdr_x(element_smob_list_,
-              gh_cons (elem_p->self_scm_, gh_cdr (element_smob_list_)));
-  elem_p->set_elt_property ("full-name",
-                           gh_str02scm((char*)elem_p->name()));
-  
-  scm_unprotect_object (elem_p->self_scm_);
-}
-
-void
-Paper_score::add_column (Paper_column *p)
-{
-  p->set_rank (col_l_arr_.size ());
-  col_l_arr_.push (p);
-  typeset_element(p);
+  line_l_->pscore_l_ = this;
+  element_smob_list_ = gh_cons (l->self_scm_, element_smob_list_);
 }
 
-void
-Paper_score::print () const
-{
-#ifndef NPRINT
-  if (!flower_dstream)
-    return ;
-
-  DEBUG_OUT << "Paper_score { ";
-  DEBUG_OUT << "\n elements: ";
-
-  for (SCM p = gh_cdr (element_smob_list_);
-       p != SCM_EOL;
-       p = gh_cdr(p))
-    gh_display (gh_car (p));
-  DEBUG_OUT << "}\n";
-#endif
-}
-
-int
-Paper_score::find_col_idx (Paper_column const *c) const
+Paper_score::Paper_score (Paper_score const &s)
+  : Music_output (s)
 {
-  Paper_column const *what = c;
-
-  return col_l_arr_.find_i ((Paper_column*)what);
+  assert (false);
 }
 
 Array<Column_x_positions>
@@ -107,45 +61,28 @@ Paper_score::calc_breaking ()
 
 
 
+/*
+  urg. clean me
+ */
 void
 Paper_score::process ()
 {
-  print ();
   progress_indication (_ ("Preprocessing elements...") + " ");
 
-
   /*
     Be sure to set breakability on first & last column.
    */
-  col_l_arr_[0]->set_elt_property ("breakable", SCM_BOOL_T);
-  col_l_arr_.top ()->set_elt_property ("breakable", SCM_BOOL_T);
-
-  for (SCM s = element_smob_list_; gh_pair_p (s); s = gh_cdr (s))
-    unsmob_element (gh_car (s))->do_breakable_col_processing ();
-
-  fixup_refpoints ();
-
-  for (SCM s = element_smob_list_; gh_pair_p (s); s = gh_cdr (s))
-    {
-      Score_element* sc = unsmob_element (gh_car (s));
-      sc->calculate_dependencies (PRECALCED, PRECALCING, &Score_element::before_line_breaking);
-    }
-
-  progress_indication ("\n" + _ ("Calculating column positions...") + " " );
-  for (SCM s = element_smob_list_; gh_pair_p (s); s = gh_cdr (s))
-    unsmob_element (gh_car (s))->do_space_processing ();
+  Link_array<Paper_column> pc (line_l_->column_l_arr ());
+  
+  pc[0]->set_elt_property ("breakable", SCM_BOOL_T);
+  pc.top ()->set_elt_property ("breakable", SCM_BOOL_T);
 
+  line_l_->pre_processing ();
   Array<Column_x_positions> breaking = calc_breaking ();
   line_l_->break_into_pieces (breaking);
 
-  for (SCM s = element_smob_list_; gh_pair_p (s); s = gh_cdr (s))
-    {
-      unsmob_element (gh_car (s))->do_break_processing ();
-    }
-  for (SCM s = element_smob_list_; gh_pair_p (s); s = gh_cdr (s))
-    {
-      unsmob_element (gh_car (s))->handle_broken_dependencies ();
-    }
+  SCM lines =   line_l_->output_lines ();
   
   outputter_l_ = new Paper_outputter ;
   outputter_l_->output_header ();
@@ -161,38 +98,28 @@ Paper_score::process ()
 
   if (paper_l_->scope_p_)
     outputter_l_->output_scope (paper_l_->scope_p_, "mudelapaper");
-  
-  SCM scm = gh_list (ly_symbol2scm ("experimental-on"), SCM_UNDEFINED);
-  outputter_l_->output_scheme (scm);
+
+  SCM scm;
+  if(experimental_features_global_b)
+    {
+      SCM scm = gh_list (ly_symbol2scm ("experimental-on"), SCM_UNDEFINED);
+      outputter_l_->output_scheme (scm);
+    }
   scm = gh_list (ly_symbol2scm ("header-end"), SCM_UNDEFINED);
   outputter_l_->output_scheme (scm);
+  
+  SCM font_names = ly_quote_scm (all_fonts_global_p->font_descriptions ());  
+  outputter_l_->output_scheme (gh_list (ly_symbol2scm ("define-fonts"),
+                                       font_names,
+                                       SCM_UNDEFINED));
+  
+  for (SCM i = lines ; gh_pair_p (i); i = gh_cdr (i))
+    for (SCM j = gh_car (i) ; gh_pair_p (j); j = gh_cdr (j))
+      outputter_l_->output_scheme (gh_car (j));
 
+  scm = gh_list (ly_symbol2scm ("end-output"), SCM_UNDEFINED);
+  outputter_l_->output_scheme (scm);
 
-  /*
-    This is tricky: we have to put the font definitions before the
-    actual output, but we don't know all fonts in advanced: generating
-    the output might trigger loading of a new font.  So we store the
-    place to insert the font definitions, generate the output and then
-    insert the definitions
-    
-   */
-  SCM before_output = outputter_l_->last_cons_;
-  fixup_refpoints ();
-
-  /*
-    TODO: change this, so that each element ouputs its molecules into
-    its line, and then output all lines one by one; then we can do
-    
-    foreach element: output
-  */
-  line_l_->output_lines ();
-
-  SCM font_names = ly_quote_scm (all_fonts_global_p->font_descriptions ());
-  gh_set_cdr_x (before_output,
-               gh_cons  (gh_list (ly_symbol2scm ("define-fonts"),
-                                  font_names,
-                                  SCM_UNDEFINED),
-                         gh_cdr (before_output)));
   
   Paper_stream* psp = paper_l_->paper_stream_p ();
   outputter_l_->dump_onto (psp);
@@ -201,52 +128,4 @@ Paper_score::process ()
   delete outputter_l_;
   outputter_l_ = 0;
   delete psp;
-  
-}
-
-Link_array<Item>
-Paper_score::broken_col_range (Item const*l, Item const*r) const
-{
-  Link_array<Item> ret;
-
-  l = l->column_l ();
-  r = r->column_l ();
-  
-  int  start = l
-    ? find_col_idx (dynamic_cast<Paper_column*> ((Item*)l))+1
-    : 0;
-
-  int stop = r
-    ? find_col_idx (dynamic_cast<Paper_column*>((Item*)r))
-    : col_l_arr_.size ();
-
-  while (start < stop)
-    {
-      Paper_column *c = col_l_arr_[start];
-      if (c->breakable_b () && !c->line_l_)
-       ret.push (c);
-      start++;
-    }
-
-  return ret;
-}
-
-
-void
-Paper_score::fixup_refpoints ()
-{
-  for (SCM s = element_smob_list_; gh_pair_p (s); s = gh_cdr (s))
-    {
-      SCM e = gh_car (s);
-      if (SMOB_IS_TYPE_B(Score_element, e))
-       {
-         Score_element * se = unsmob_element (e);
-         se->fixup_refpoint ();
-             
-         if (!dynamic_cast<Line_of_score*> (se) && !se->parent_l (Y_AXIS))
-           {
-             programming_error ("No parent!");
-           }
-       }
-    }
 }
index f551d0d2532fcd0e67da33ce147daf818e2760f9..df842f8f33cbdf5c273f687f9df7fd14adbd2617 100644 (file)
@@ -193,7 +193,7 @@ Rest_collision::Rest_collision()
   set_elt_property ("rests", SCM_EOL);
   set_elt_property ("notes", SCM_EOL);
   set_elt_property ("transparent", SCM_BOOL_T);
-  set_empty (X_AXIS);
-  set_empty (Y_AXIS);
+  set_extent_callback (0, X_AXIS);
+  set_extent_callback (0, Y_AXIS);
 }
 
index 868cc82aff2461811d857e80a75081e766575713..adede15101459055bd2fb31ff965e027a0e1eb97 100644 (file)
@@ -260,10 +260,9 @@ Score_element::calculate_dependencies (int final, int busy,
 void
 Score_element::output_processing () 
 {
-  if (to_boolean  (get_elt_property ("transparent")))
+  if (to_boolean (get_elt_property ("transparent")))
     return;
 
-  
   Molecule m (do_brew_molecule ());
   Offset o (relative_coordinate (0, X_AXIS), relative_coordinate (0, Y_AXIS));
 
@@ -275,7 +274,7 @@ Score_element::output_processing ()
       o[Y_AXIS] += il * gh_scm2double (gh_cdr (s));      
     }
   
-  pscore_l_->outputter_l_->output_molecule (m.expr_, o, classname(this));
+  line_l ()->output_molecule (m.expr_, o);
 }
 
 /*
@@ -499,12 +498,6 @@ Score_element::common_refpoint (Score_element const* s, Axis a) const
   return  dim ? dim->element_l () : 0;
 }
 
-void
-Score_element::set_empty (Axis a)
-{
-  dim_cache_[a]->extent_callback_l_ =0;
-}
-
 bool
 Score_element::empty_b (Axis a)const
 {
@@ -523,7 +516,6 @@ Score_element::extent (Axis a) const
   SCM extra = get_elt_property (a == X_AXIS ? "extra-extent-X"
                                : "extra-extent-Y");
 
-
   /*
     signs ?
    */
@@ -541,7 +533,6 @@ Score_element::extent (Axis a) const
     {
       ext.unite (Interval (s * gh_scm2double (gh_car (extra)),
                           s * gh_scm2double (gh_cdr (extra))));
-
     }
   
   return ext;
@@ -590,6 +581,13 @@ Score_element::has_offset_callback_b (Offset_cache_callback cb, Axis a)const
   return false;
 }
 
+void
+Score_element::set_extent_callback (Dim_cache_callback dc, Axis a)
+{
+  dim_cache_[a]->extent_callback_l_ = dc ;
+}
+
+                                   
 void
 Score_element::set_parent (Score_element *g, Axis a)
 {
index bb6f6424270ec2fabfa6d32eebd590ed395382a5..7b7dbe428a6f19fbc025a72f76272120b9cb9847 100644 (file)
@@ -92,7 +92,7 @@ void
 Score_engraver::announce_element (Score_element_info info)
 {
   announce_info_arr_.push (info);
-  pscore_p_->typeset_element (info.elem_l_);
+  pscore_p_->line_l_->typeset_element (info.elem_l_);
 }
 
 /* All elements are propagated to the top upon announcement. If
@@ -185,8 +185,8 @@ Score_engraver::set_columns (Paper_column *new_command_l,
        {
          if ((*current[i])->linked_b()) 
            {
-             pscore_p_->add_column ((*current[i]));
              scoreline_l_->add_column ((*current[i]));
+             
            }
          else
            {
index 54cce299963165a1b0fddc2c48eeed69d9513080..b03d4c59beb48e0061f8a80cf839bedff701dbdb 100644 (file)
@@ -17,8 +17,8 @@ Single_malt_grouping_item ::Single_malt_grouping_item()
   set_elt_property ("elements", SCM_EOL);
 
   // this is weird! , but needed!
-  set_empty (X_AXIS);
-  set_empty ( Y_AXIS);
+  set_extent_callback (0, X_AXIS);
+  set_extent_callback (0,  Y_AXIS);
 
 }
 
index edd41f5ae64c523bce7c85f3cad4473445814659..712ff4dd4dfd3be922ec3b4b0a845a76f5904e66 100644 (file)
@@ -18,8 +18,8 @@
 
 Spacing_spanner::Spacing_spanner ()
 {
-  set_empty (X_AXIS);
-  set_empty (Y_AXIS);  
+  set_extent_callback (0, X_AXIS);
+  set_extent_callback (0, Y_AXIS);  
   set_elt_property ("transparent", SCM_BOOL_T);
 }
 
index e8d771e263953601f8b78d7ce5e691bb84713a38..10d2c345a853de9d7f374b92fc8883ca15c117d8 100644 (file)
@@ -60,6 +60,7 @@ Span_bar_engraver::acknowledge_element (Score_element_info i)
        {
          spanbar_p_ = get_span_bar_p();
          spanbar_p_->set_parent (bar_l_arr_[0], Y_AXIS);
+         spanbar_p_->set_parent (bar_l_arr_[0], X_AXIS);
 
          /*
            UGH. UGH UUHGK GUHG G
index 494a90b2ffdb997ba050d27d1ac1e7fb157b540c..13e2491f9700bc57b6246811689638b187ad38f7 100644 (file)
@@ -59,38 +59,38 @@ void
 Span_bar::evaluate_empty ()
 { 
   if (!gh_pair_p (get_elt_property ("elements")))
-  {
-    set_elt_property ("transparent", SCM_BOOL_T);
-    set_empty (X_AXIS);
-    set_empty (Y_AXIS);   
-  }
+    {
+      set_elt_property ("transparent", SCM_BOOL_T);
+      set_extent_callback (0, X_AXIS);
+      set_extent_callback (0, Y_AXIS);   
+    }
   
   SCM gl = get_elt_property ("glyph");
   if (!gh_string_p (gl))
     {
       set_elt_property ("transparent", SCM_BOOL_T);
-      set_empty (X_AXIS);
-      set_empty (Y_AXIS);   
+      set_extent_callback (0, X_AXIS);
+      set_extent_callback (0, Y_AXIS);   
     }
   else {
     String type_str = ly_scm2string (gl);
     if (type_str == "|:") 
-    {
-      type_str= ".|";
-    }
-  else if (type_str== ":|")
-    {
-      type_str= "|.";
-    }
-  else if (type_str== ":|:")
-    {
-      type_str= ".|.";
-    }
+      {
+       type_str= ".|";
+      }
+    else if (type_str== ":|")
+      {
+       type_str= "|.";
+      }
+    else if (type_str== ":|:")
+      {
+       type_str= ".|.";
+      }
   }
 
   /*
     uhh. should do something with type_str ?!!
-   */
+  */
 }
 
 Interval
@@ -103,19 +103,22 @@ Span_bar::get_spanned_interval () const
 Real
 Span_bar::get_bar_size () const
 {
-   Interval iv (get_spanned_interval ());
-   if (iv.empty_b ())
-     {
-       programming_error("Huh? My children deflated (FIXME)");
-       iv = Interval (0,0);
-     }
-   return iv.length ();
+  Interval iv (get_spanned_interval ());
+  if (iv.empty_b ())
+    {
+      programming_error("Huh? My children deflated (FIXME)");
+      iv = Interval (0,0);
+    }
+  return iv.length ();
 }
 
 Span_bar::Span_bar ()
 {
   group (this).set_interface ();
   dim_cache_[X_AXIS]->set_extent_callback (width_callback);
-  dim_cache_[Y_AXIS]->set_extent_callback (Axis_group_interface::group_extent_callback);  
+  
+  // dim_cache_[Y_AXIS]->set_extent_callback (Axis_group_interface::group_extent_callback);
+
+  dim_cache_[Y_AXIS]->set_extent_callback (0);
 }
 
index 54f9c0e9cd921613052652da736474064c3a745f..22344c6099bad318a42127d60c679cabc8ff9867 100644 (file)
@@ -385,8 +385,8 @@ Stem::before_line_breaking ()
   if (invisible_b ())
     {
       set_elt_property ("transparent", SCM_BOOL_T);
-      set_empty (Y_AXIS);      
-      set_empty (X_AXIS);      
+      set_extent_callback (0, Y_AXIS);      
+      set_extent_callback (0, X_AXIS);      
     }
 
   set_spacing_hints ();
index bc942774434830452eb5a34b5f4944898b12f918..130a6328fc9e50f5ef3c5e950a578eb4e8940bb9 100644 (file)
@@ -41,7 +41,8 @@ System_start_delimiter::staff_bracket (Real height) const
 
 System_start_delimiter::System_start_delimiter ()
 {
-  set_empty (Y_AXIS);
+  set_extent_callback (0, Y_AXIS);
+  Group_interface (this).set_interface();
 }
 
 Molecule
@@ -64,8 +65,8 @@ System_start_delimiter::do_brew_molecule ()const
     {
       System_start_delimiter * me = (System_start_delimiter*)this;
       me->set_elt_property ("transparent", SCM_BOOL_T);
-      me->set_empty (X_AXIS);
-      me->set_empty (Y_AXIS);
+      me->set_extent_callback (0, X_AXIS);
+      me->set_extent_callback (0, Y_AXIS);
       return m;
     }
 
index 97b7a18a24055e383eb235b569e815ef8afe3dbb..0f222daab1bd2f1d6022c20729ed0fe437647a96 100644 (file)
@@ -104,7 +104,7 @@ Text_engraver::do_process_music ()
       
       SCM empty = get_property ("textNonEmpty");
       if (!to_boolean (empty))
-       text->set_empty (X_AXIS);
+       text->set_extent_callback (0, X_AXIS);
 
       announce_element (Score_element_info (text, r));
       texts_.push (text);
index 78d6b487c3134d555e4b375d4adc588e1b31c77f..78f398d1e0c4d996fbbcc212aaef65c1c81e357b 100644 (file)
@@ -16,8 +16,8 @@
 Tie_column::Tie_column ()
 {
   set_elt_property ("ties", SCM_EOL);
-  set_empty (X_AXIS);
-  set_empty (Y_AXIS);  
+  set_extent_callback (0, X_AXIS);
+  set_extent_callback (0, Y_AXIS);  
   set_elt_property ("transparent", SCM_BOOL_T);
 }
 
index 6735059d29813a65e99e66a4ea10ae094925b8f8..2b0e032b7c835688d4df01b1657a31a3829841dd 100644 (file)
@@ -98,8 +98,8 @@ Tie::after_line_breaking ()
     {
       programming_error ("Tie without heads.");
       set_elt_property ("transparent", SCM_BOOL_T);
-      set_empty (X_AXIS);
-      set_empty (Y_AXIS);
+      set_extent_callback (0, X_AXIS);
+      set_extent_callback (0, Y_AXIS);
       return;
     }
 
index d16bdd161b87edccb3d8800df4a022401257fce2..9718a8a53b51b7d4d3e825c90ad2310e7905e0e8 100644 (file)
@@ -86,21 +86,6 @@ Vertical_align_engraver::acknowledge_element (Score_element_info i)
     {
       Align_interface(valign_p_).add_element (i.elem_l_);
     }
-
-#if 1                          // 
-  /*
-    should junk this, but (crossstaff?) Beam doesn't have a clue yet
-    ...  */
-  
-  /*
-     Add make sure spanbars (whose size depends on vertical alignment)
-     depend on the vertical alignment element
-   */
-  else if (dynamic_cast<Span_bar*>(i.elem_l_) && i.origin_trans_l_arr (this).size ())
-    {
-      i.elem_l_->add_dependency (valign_p_);
-    }
-#endif
 }