From: Han-Wen Nienhuys Date: Wed, 10 Jul 2002 13:34:13 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: release/1.5.67~13 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=4ed25cecb67a112bc07147a3b9d32e9a68d41729;p=lilypond.git *** empty log message *** --- diff --git a/lily/include/paper-column.hh b/lily/include/paper-column.hh index fbf69636ec..f2c94744ed 100644 --- a/lily/include/paper-column.hh +++ b/lily/include/paper-column.hh @@ -24,13 +24,14 @@ public: virtual void do_break_processing (); virtual Paper_column *column_l () const; virtual System *line_l () const; - + /// if lines are broken then this column is in #line# System *line_l_; static int rank_i (Grob*); DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM)); + DECLARE_SCHEME_CALLBACK(before_line_breaking, (SCM)); Paper_column (SCM); static bool musical_b (Grob *); diff --git a/lily/paper-column.cc b/lily/paper-column.cc index e68395807d..2abeff483e 100644 --- a/lily/paper-column.cc +++ b/lily/paper-column.cc @@ -48,6 +48,7 @@ Paper_column::do_break_processing () Item::do_break_processing (); } + int Paper_column::rank_i (Grob*me) { @@ -132,3 +133,37 @@ Paper_column::brew_molecule (SCM p) return t.smobbed_copy (); } +/* + This is all too hairy. We use bounded-by-me to make sure that some + columns are kept "alive". Unfortunately, when spanners are suicided, + this falls apart again. (sigh.) + + THIS IS BROKEN KLUDGE. WE SHOULD INVENT SOMETHING BETTER. + */ +MAKE_SCHEME_CALLBACK(Paper_column,before_line_breaking,1); +SCM +Paper_column::before_line_breaking (SCM grob) +{ + Grob *me = unsmob_grob (grob); + + SCM c = me->get_grob_property ("bounded-by-me"); + SCM *ptrptr = &c; + + while (gh_pair_p (c)) + { + Grob * g = unsmob_grob (gh_car (c)); + + if (!g || !g->live ()) + { + *ptrptr = gh_cdr (c); + } + else + { + ptrptr = SCM_CDRLOC (c); + } + + c = gh_cdr (c); + } + + me->set_grob_property ("bounded-by-me", c); +} diff --git a/lily/system.cc b/lily/system.cc index f9fe1f4edd..af5fecc44e 100644 --- a/lily/system.cc +++ b/lily/system.cc @@ -73,7 +73,7 @@ System::output_lines () } g->suicide (); } - else + else if (g->live ()) g->do_break_processing (); } diff --git a/scm/grob-description.scm b/scm/grob-description.scm index 7c5cb8dfdf..13276d505f 100644 --- a/scm/grob-description.scm +++ b/scm/grob-description.scm @@ -577,6 +577,7 @@ (PaperColumn . ( (axes . (0)) + (before-line-breaking-callback . ,Paper_column::before_line_breaking) (X-extent-callback . ,Axis_group_interface::group_extent_callback) ; (molecule-callback . ,Paper_column::brew_molecule) (font-name . "cmr8") (Y-extent-callback . #f) @@ -610,7 +611,7 @@ . ( (axes . (0)) (X-extent-callback . ,Axis_group_interface::group_extent_callback) - + (before-line-breaking-callback . ,Paper_column::before_line_breaking) ;; debugging stuff: print column number. ; (molecule-callback . ,Paper_column::brew_molecule) (font-name . "cmr8") (Y-extent-callback . #f)