#include "spacing-interface.hh"
#include "staff-symbol-referencer.hh"
#include "paper-book.hh"
-#include "paper-line.hh"
+#include "paper-system.hh"
System::System (SCM s)
: Spanner (s)
if (verbose_global_b)
progress_indication (_f ("Grob count %d", element_count ()));
-
for (SCM s = get_property ("all-elements"); ly_c_pair_p (s); s = ly_cdr (s))
unsmob_grob (ly_car (s))->handle_prebroken_dependencies ();
for (SCM s = get_property ("all-elements"); ly_c_pair_p (s); s = ly_cdr (s))
{
- Grob* sc = unsmob_grob (ly_car (s));
+ Grob *sc = unsmob_grob (ly_car (s));
sc->calculate_dependencies (PRECALCED, PRECALCING, ly_symbol2scm ("before-line-breaking-callback"));
}
- progress_indication ("\n" + _ ("Calculating line breaks...") + " ");
+ progress_indication ("\n");
+ progress_indication (_ ("Calculating line breaks..."));
+ progress_indication (" ");
for (SCM s = get_property ("all-elements"); ly_c_pair_p (s); s = ly_cdr (s))
{
Grob *e = unsmob_grob (ly_car (s));
SCM exprs = SCM_EOL;
SCM *tail = &exprs;
- Real penalty = 0;
for (int i = LAYER_COUNT; i--;)
for (SCM s = all; ly_c_pair_p (s); s = ly_cdr (s))
{
*tail = scm_cons (st.expr (), SCM_EOL);
tail = SCM_CDRLOC(*tail);
- /*
- UGH. back-end should extract this info from the System?
- */
- if (g->original_)
- {
- /*
- Huh ? penalties from all columns are added ??!! --hwn
- */
- if (Item *it = dynamic_cast <Item*> (g))
- {
- Grob *col = it->get_column ();
- SCM s = col->get_property ("page-penalty");
-
- // FIXME; page breaking is not discrete at +-10000
- if (ly_c_number_p (s)) // && fabs (ly_scm2double (s)) < 10000)
- penalty += ly_scm2double (s);
- }
- }
}
+
+
Interval x (extent (this, X_AXIS));
Interval y (extent (this, Y_AXIS));
Stencil sys_stencil (Box (x,y),
scm_cons (ly_symbol2scm ("combine-stencil"),
exprs));
- Paper_line *pl = new Paper_line (sys_stencil, (int) penalty, false);
+ Paper_system *pl = new Paper_system (sys_stencil, false);
+ Item * break_point =this->get_bound(LEFT);
+ pl->penalty_ =
+ robust_scm2double (break_point->get_property ("page-penalty"), 0.0);
+
return scm_gc_unprotect_object (pl->self_scm ());
}