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 *);
Item::do_break_processing ();
}
+
int
Paper_column::rank_i (Grob*me)
{
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);
+}
}
g->suicide ();
}
- else
+ else if (g->live ())
g->do_break_processing ();
}
(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)
. (
(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)