]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/single-malt-grouping-item.cc
release: 1.1.18
[lilypond.git] / lily / single-malt-grouping-item.cc
index f6975f77c50d5234c3c7a9a37f6af53241a917d5..bd5101039ab8cf7ce375876678b4f98f8f07228a 100644 (file)
@@ -3,20 +3,22 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 1998 Han-Wen Nienhuys <hanwen@cs.ruu.nl>
+  (c) 1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   
  */
 
 #include "single-malt-grouping-item.hh"
 #include "p-col.hh"
+#include "debug.hh"
 
 Single_malt_grouping_item ::Single_malt_grouping_item()
 {
   transparent_b_ = true;
+  set_empty (true);
 }
 
 void
-Single_malt_grouping_item::add (Item* i)
+Single_malt_grouping_item::add_item (Item* i)
 {
   assert (i);
   item_l_arr_.push (i);
@@ -24,7 +26,7 @@ Single_malt_grouping_item::add (Item* i)
 }
 
 Interval
-Single_malt_grouping_item::do_width () const
+Single_malt_grouping_item::my_width () const
 {
   Paper_column * pc = column_l ();
   Interval w;
@@ -32,19 +34,32 @@ Single_malt_grouping_item::do_width () const
     {
       Item *il = item_l_arr_[i];
       assert (pc == il->column_l ());
-      w.unite  (il->width () + il->relative_coordinate (pc, X_AXIS));
+      w.unite  (il->extent (X_AXIS) + il->relative_coordinate (&pc->dim_cache_[X_AXIS], X_AXIS));
     }
-  
-  return w + (- relative_coordinate (pc, X_AXIS)); // TODO
+
+  return w;
+ // add this->offset_ ? this-> relative_coordinate ()? 
 }
 
-IMPLEMENT_IS_TYPE_B1(Single_malt_grouping_item, Item);
+
+
+void
+Single_malt_grouping_item::do_substitute_dependency (Score_element*o, Score_element*n)
+{
+  if (dynamic_cast <Item *> (o))
+    {
+      item_l_arr_.unordered_substitute (dynamic_cast <Item *> (o),
+                                       dynamic_cast <Item *> (n));
+    }
+}
 
 void
-Single_malt_grouping_item::do_substitute_dependency (Score_elem*o, Score_elem*n)
+Single_malt_grouping_item::do_print () const
 {
-  if (o->item ())
+#ifndef NDEBUG
+  for (int i=0; i < item_l_arr_.size (); i++)
     {
-      item_l_arr_.unordered_substitute (o->item (),  n ? n->item () : 0);
+      DOUT << classname (item_l_arr_[i]) << ", ";
     }
+#endif
 }