X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fsystem.cc;h=06ac09e39a224b6b31467474d88e14e54bf1d341;hb=33aea9c0d161f3ed0166bef403b6daf52d74847a;hp=5070f9426cd92506b77d97e3a9f108200f55e1ff;hpb=711cf44d0ab28f3159230c84d63c0b19199408b0;p=lilypond.git diff --git a/lily/system.cc b/lily/system.cc index 5070f9426c..06ac09e39a 100644 --- a/lily/system.cc +++ b/lily/system.cc @@ -3,7 +3,7 @@ source file of the GNU LilyPond music typesetter - (c) 1996--2006 Han-Wen Nienhuys + (c) 1996--2007 Han-Wen Nienhuys */ #include "system.hh" @@ -21,14 +21,13 @@ #include "pointer-group-interface.hh" #include "spacing-interface.hh" #include "staff-symbol-referencer.hh" -#include "tweak-registration.hh" #include "warn.hh" #include "lookup.hh" extern bool debug_skylines; -System::System (System const &src, int count) - : Spanner (src, count) +System::System (System const &src) + : Spanner (src) { all_elements_ = 0; pscore_ = 0; @@ -36,8 +35,8 @@ System::System (System const &src, int count) init_elements (); } -System::System (SCM s, Object_key const *key) - : Spanner (s, key) +System::System (SCM s) + : Spanner (s) { all_elements_ = 0; rank_ = 0; @@ -54,9 +53,9 @@ System::init_elements () } Grob * -System::clone (int index) const +System::clone () const { - return new System (*this, index); + return new System (*this); } int @@ -210,7 +209,7 @@ System::break_into_pieces (vector const &breaking) { for (vsize i = 0; i < breaking.size (); i++) { - System *system = dynamic_cast (clone (broken_intos_.size ())); + System *system = dynamic_cast (clone ()); system->rank_ = broken_intos_.size (); vector c (breaking[i].cols_); @@ -252,21 +251,6 @@ System::add_column (Paper_column *p) Axis_group_interface::add_element (this, p); } -void -apply_tweaks (Grob *g, bool broken) -{ - if (bool (g->original ()) == broken) - { - SCM tweaks = global_registry_->get_tweaks (g); - for (SCM s = tweaks; scm_is_pair (s); s = scm_cdr (s)) - { - SCM proc = scm_caar (s); - SCM rest = scm_cdar (s); - scm_apply_1 (proc, g->self_scm (), rest); - } - } -} - void System::pre_processing () { @@ -286,9 +270,6 @@ System::pre_processing () fixup_refpoints (all_elements_->array ()); - for (vsize i = 0; i < all_elements_->size (); i++) - apply_tweaks (all_elements_->grob (i), false); - for (vsize i = 0; i < all_elements_->size (); i++) { Grob *g = all_elements_->grob (i); @@ -309,7 +290,6 @@ System::post_processing () { Grob *g = all_elements_->grob (i); - apply_tweaks (g, true); (void) g->get_property ("after-line-breaking"); } @@ -467,7 +447,7 @@ System::broken_col_range (Item const *left, Item const *right) const /** Return all columns, but filter out any unused columns , since they might disrupt the spacing problem. */ vector -System::columns () const +System::used_columns () const { extract_grob_set (this, "columns", ro_columns); @@ -489,11 +469,14 @@ System::columns () const return columns; } -Grob* -System::column (int which) const +Paper_column * +System::column (vsize which) const { extract_grob_set (this, "columns", columns); - return columns[which]; + if (which >= columns.size ()) + return 0; + + return dynamic_cast (columns[which]); } Paper_score*