X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fsingle-malt-grouping-item.cc;h=54cce299963165a1b0fddc2c48eeed69d9513080;hb=ffe548cfbb3c3b37c8969f49b5aba04ef998d080;hp=77848e79faec7f323b472c56f5d2499611f6c3d7;hpb=b1aa7f76f1ad7606699fc797161a583df7367013;p=lilypond.git diff --git a/lily/single-malt-grouping-item.cc b/lily/single-malt-grouping-item.cc index 77848e79fa..54cce29996 100644 --- a/lily/single-malt-grouping-item.cc +++ b/lily/single-malt-grouping-item.cc @@ -3,28 +3,33 @@ source file of the GNU LilyPond music typesetter - (c) 1998--1999 Han-Wen Nienhuys + (c) 1998--2000 Han-Wen Nienhuys */ #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 (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 (o)) - { - item_l_arr_.unordered_substitute (dynamic_cast (o), - dynamic_cast (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 -}