2 single-malt-grouping-item.cc -- implement Single_malt_grouping_item
4 source file of the GNU LilyPond music typesetter
6 (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
10 #include "single-malt-grouping-item.hh"
11 #include "paper-column.hh"
14 Single_malt_grouping_item ::Single_malt_grouping_item()
16 set_elt_property ("transparent", SCM_BOOL_T);
17 set_elt_property ("elements", SCM_EOL);
19 // this is weird! , but needed!
26 Single_malt_grouping_item::add_item (Item* i)
29 set_elt_property ("elements",
30 gh_cons (i->self_scm_,
31 get_elt_property ("elements")));
37 Single_malt_grouping_item::my_width () const
39 Paper_column * pc = column_l ();
42 for (SCM s = get_elt_property ("elements"); gh_pair_p (s); s = gh_cdr (s))
45 if (!SMOB_IS_TYPE_B(Score_element, elt))
50 Item *il = dynamic_cast<Item*> (SMOB_TO_TYPE (Score_element, elt));
51 if (pc != il->column_l ())
53 /* this shouldn't happen, but let's continue anyway. */
54 programming_error (_("Single_malt_grouping_item: I've been drinking too much"));
58 Interval iv (il->extent (X_AXIS));
61 Real off = il->relative_coordinate (pc, X_AXIS);
67 // add this->offset_ ? this-> relative_coordinate ()?