lilypond-1.3.33
authorfred <fred>
Tue, 26 Mar 2002 22:46:56 +0000 (22:46 +0000)
committerfred <fred>
Tue, 26 Mar 2002 22:46:56 +0000 (22:46 +0000)
lily/include/atom.hh
lily/include/axis-align-item.hh
lily/include/axis-align-spanner.hh
lily/include/axis-group-element.hh
lily/include/axis-group-item.hh
lily/include/axis-group-spanner.hh
lily/include/line-of-score.hh
lily/include/super-element.hh
lily/spanner.cc

index 576dc45e1a626f286538836e36fcd3887cd9a45f..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,17 +0,0 @@
-/*
-  atom.hh -- declare Atom
-
-  source file of the GNU LilyPond music typesetter
-
-  (c)  1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-#ifndef ATOM_HH
-#define ATOM_HH
-
-#include "lily-proto.hh"
-
-#include "lily-guile.hh"
-
-
-#endif
index b6a0ab5231572f4d8c6211b06be70628c45c3e5c..bcea4e18d9b1f7201759c0403ac784cf3e6a2cc8 100644 (file)
 #include "align-element.hh"
 #include "axis-group-item.hh"
 
-class Axis_align_item : public virtual Align_element,
-                       public virtual Axis_group_item
+/*
+  UGH. FIXME: multiple inheritance.
+ */
+class Axis_align_item : public virtual Align_element, public virtual Axis_group_item
 {
 public:
   Axis_align_item ();
index 9fdb72194d27fb408c19a8175bbf3367009788aa..0352968aeea63a2760a979d05b4757c29e1eb64e 100644 (file)
 #include "align-element.hh"
 #include "axis-group-spanner.hh"
 
-class Axis_align_spanner : public virtual Align_element,
-                          public virtual Axis_group_spanner
+/*
+  FIXME: multiple inheritance
+ */
+class Axis_align_spanner : public virtual Align_element, public virtual Axis_group_spanner
 {
 public:
   VIRTUAL_COPY_CONS(Score_element);
index 969fd7b73688e42930f534f9df8ed3ffc19a661f..83acd188b107da2bbdac94971965b176eff504b2 100644 (file)
@@ -16,7 +16,9 @@
 /** 
   Treat a group of elements a unity in either or both axis sense .
   This is a wrapper around Axis_group_administration
-  */
+
+  FIXME: remove this class, and make interface of it, so we can remove multiple inheritance.
+*/
 class Axis_group_element : public virtual Score_element
 {
   /// modify fields of E for removal.
index 06561d0301bd9ed4570f61fabf4842e0dbe7d409..0f88cc78bb23d94e64aee7147191ff5b0b27abb5 100644 (file)
@@ -16,9 +16,7 @@
 /**
   A grouping item. Its special support is in do_breakable_col_processing().
  */
-
-class Axis_group_item : public virtual Axis_group_element,
-                       public virtual Item
+class Axis_group_item : public virtual Axis_group_element, public virtual Item
 {
 public:
   VIRTUAL_COPY_CONS(Score_element);
index a88d9c3dad5d04bee7d36c833923046024757eb0..d421973f5058d361958dc8c487184e068144fad5 100644 (file)
 #include "spanner.hh"
 #include "axis-group-element.hh"
 
-/** An element which groups a line in a certain direction. The most
-  useful example of this is the Vertical_group_spanner */
+/**
+   An element which groups a line in a certain direction. The most
+   useful example of this is the Vertical_group_spanner
+*/
 class Axis_group_spanner : public virtual Axis_group_element,
                           public virtual Spanner
 
index 1c65a78ebce9bbb257034789a114bf15b7f15a91..994a50b20d7fb42550602f1b944bd454312699cc 100644 (file)
@@ -11,7 +11,7 @@
 #include "axis-group-spanner.hh"
 #include "super-element.hh"
 
-/// the columns of a score that form one line.
+/// the columns of a score that form one line. FIXME: multiple inheritance
 class Line_of_score : public Axis_group_spanner, public Super_element
 {
 public:
index c27d1bd963375d8fd98fbabef3403ebb36712365..8c574bb68330911343baddd4fa1b28ec29320763 100644 (file)
   dependency graph, and calls the appropriate
   Score_element::do_XXX_processing function on each Score_element it encounters.
   
-  
-  */
+
+  FIXME: remove this class, to eliminate multiple inheritance. Merge
+  with Line_of_score ?  */
 class Super_element : public virtual Score_element {
 public:
   void space_processing ();
   void pre_processing();
   void breakable_col_processing();
-  void break_processing();
   void post_processing();
   void output_all ();
 };
index 7d0ca15fdd2635b27c47641b2c2231f1c5c6ddf6..2bc8b98ab4f2339455216a157c00898796411884 100644 (file)
@@ -32,38 +32,58 @@ Spanner::do_break_processing()
   if  (left == right)
     {
       warning (_ ("Left spanpoint is right spanpoint"));
-      return;
-    }
-  
-  Link_array<Item> break_points = pscore_l_->broken_col_range (left,right);
-
-  break_points.insert (left,0);
-  break_points.push (right);
 
-  for (int i=1; i < break_points.size(); i++) 
-    {
-      Drul_array<Item*> bounds;
-      bounds[LEFT] = break_points[i-1];
-      bounds[RIGHT] = break_points[i];
+      /*
+       FIXME: this is broken.
+       */
+      /*
+       If we have a spanner spanning one column, we must break it
+       anyway because it might provide a parent for another item.  */
       Direction d = LEFT;
       do
        {
-         Item *&pc_l = bounds[d] ;
-         if (!pc_l->line_l())
-           pc_l =  pc_l->find_broken_piece(- d);
-         
-         assert (pc_l);
+         Item* bound = left->find_broken_piece (d);
+         Spanner * span_p = dynamic_cast<Spanner*>( clone ());
+         span_p->set_bound (LEFT, bound);
+         span_p->set_bound (RIGHT, bound);
+
+         assert (span_p->line_l ()); 
+         pscore_l_->typeset_element (span_p);
+         broken_into_l_arr_.push (span_p);
        }
       while ((flip(&d))!= LEFT);
+    }
+  else
+    {
+      Link_array<Item> break_points = pscore_l_->broken_col_range (left,right);
 
-      Spanner *span_p = dynamic_cast<Spanner*>(clone ());
-      span_p->set_bounds(LEFT,bounds[LEFT]);
-      span_p->set_bounds(RIGHT,bounds[RIGHT]);
+      break_points.insert (left,0);
+      break_points.push (right);
+
+      for (int i=1; i < break_points.size(); i++) 
+       {
+         Drul_array<Item*> bounds;
+         bounds[LEFT] = break_points[i-1];
+         bounds[RIGHT] = break_points[i];
+         Direction d = LEFT;
+         do
+           {
+             Item *&pc_l = bounds[d] ;
+             if (!pc_l->line_l())
+               pc_l =  pc_l->find_broken_piece(- d);
+         
+             assert (pc_l);
+           }
+         while ((flip(&d))!= LEFT);
+
+         Spanner *span_p = dynamic_cast<Spanner*>(clone ());
+         span_p->set_bound(LEFT,bounds[LEFT]);
+         span_p->set_bound(RIGHT,bounds[RIGHT]);
       
-      pscore_l_->typeset_element (span_p);
-      broken_into_l_arr_.push (span_p);
+         pscore_l_->typeset_element (span_p);
+         broken_into_l_arr_.push (span_p);
+       }
     }
-
   broken_into_l_arr_.sort (Spanner::compare);
 }
 
@@ -74,13 +94,20 @@ Spanner::set_my_columns()
   do 
     {
       if (!spanned_drul_[i]->line_l())
-       set_bounds(i,spanned_drul_[i]->find_broken_piece((Direction) -i));
+       set_bound(i,spanned_drul_[i]->find_broken_piece((Direction) -i));
     } 
   while (flip(&i) != LEFT);
 }       
 
+
+Item*
+Spanner::get_bound (Direction d) const
+{
+  return spanned_drul_ [d];
+}
+
 void
-Spanner::set_bounds(Direction d, Item*i)
+Spanner::set_bound(Direction d, Item*i)
 {
   spanned_drul_[d] =i;
   if (i)