]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/single-malt-grouping-item.cc
release: 1.3.29
[lilypond.git] / lily / single-malt-grouping-item.cc
index 77848e79faec7f323b472c56f5d2499611f6c3d7..54cce299963165a1b0fddc2c48eeed69d9513080 100644 (file)
@@ -3,28 +3,33 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   
  */
 
 #include "single-malt-grouping-item.hh"
-#include "p-col.hh"
+#include "paper-column.hh"
 #include "debug.hh"
 
 Single_malt_grouping_item ::Single_malt_grouping_item()
 {
-  set_elt_property (break_helper_only_scm_sym, SCM_BOOL_T);
-  set_elt_property (transparent_scm_sym, SCM_BOOL_T);
+  set_elt_property ("transparent", SCM_BOOL_T);
+  set_elt_property ("elements", SCM_EOL);
 
   // this is weird! , but needed!
-  set_empty (true);
+  set_empty (X_AXIS);
+  set_empty ( Y_AXIS);
+
 }
 
 void
 Single_malt_grouping_item::add_item (Item* i)
 {
   assert (i);
-  item_l_arr_.push (i);
+  set_elt_property ("elements",
+                   gh_cons (i->self_scm_,
+                            get_elt_property ("elements")));
+
   add_dependency (i);
 }
 
@@ -33,20 +38,27 @@ Single_malt_grouping_item::my_width () const
 {
   Paper_column * pc = column_l ();
   Interval w;
-  for (int i=0; i < item_l_arr_.size (); i++)
+  
+  for (SCM s = get_elt_property ("elements"); gh_pair_p (s); s = gh_cdr (s))
     {
-      Item *il = item_l_arr_[i];
+      SCM elt = gh_car (s);
+      if (!SMOB_IS_TYPE_B(Score_element, elt))
+       continue;
+
+      
+      
+      Item *il = dynamic_cast<Item*> (SMOB_TO_TYPE (Score_element, elt));
       if (pc != il->column_l ())
        {
          /* this shouldn't happen, but let's continue anyway. */
-         programming_error (_("Single_malt_grouping_item: I've been drinking too much"));
+         programming_error (_("Single_malt_grouping_item:  I've been drinking too much"));
          continue;             /*UGH UGH*/ 
        }
 
       Interval iv (il->extent (X_AXIS));
       if (!iv.empty_b ())
        {
-         Real off = il->relative_coordinate (pc->dim_cache_[X_AXIS], X_AXIS);
+         Real off = il->relative_coordinate (pc, X_AXIS);
          w.unite  (iv + off);
        }
     }
@@ -57,24 +69,3 @@ Single_malt_grouping_item::my_width () const
 
 
 
-void
-Single_malt_grouping_item::do_substitute_element_pointer (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_print () const
-{
-#ifndef NDEBUG
-  for (int i=0; i < item_l_arr_.size (); i++)
-    {
-      DOUT << classname (item_l_arr_[i]) << ", ";
-    }
-#endif
-}