pl->set_property ("page-break-penalty", right_bound->get_property ("page-break-penalty"));
pl->set_property ("page-turn-penalty", right_bound->get_property ("page-turn-penalty"));
+ if (right_bound->original () == dynamic_cast<System*> (original ())->get_bound (RIGHT))
+ pl->set_property ("last-in-score", SCM_BOOL_T);
+
Interval staff_refpoints;
if (Grob *align = get_vertical_alignment ())
{
return pure ? get_pure_bound (d, start, end) : get_bound (d);
}
+enum {
+ SPACEABLE_STAVES,
+ NONSPACEABLE_STAVES,
+ ALL_STAVES
+};
+
+static SCM
+get_maybe_spaceable_staves (SCM smob, int filter)
+{
+ System *me = dynamic_cast<System*> (unsmob_grob (smob));
+ Grob *align = me->get_vertical_alignment ();
+ SCM ret = SCM_EOL;
+
+ if (align)
+ {
+ SCM *tail = &ret;
+ extract_grob_set (align, "elements", staves);
+
+ for (vsize i = 0; i < staves.size (); ++i)
+ {
+ bool spaceable = Page_layout_problem::is_spaceable (staves[i]);
+ if (staves[i]->is_live () &&
+ ((filter == ALL_STAVES)
+ || (filter == SPACEABLE_STAVES && spaceable)
+ || (filter == NONSPACEABLE_STAVES && !spaceable)))
+ {
+ *tail = scm_cons (staves[i]->self_scm (), SCM_EOL);
+ tail = SCM_CDRLOC (*tail);
+ }
+ }
+ }
+
+ return ret;
+}
+
+MAKE_SCHEME_CALLBACK (System, get_staves, 1)
+SCM
+System::get_staves (SCM smob)
+{
+ return get_maybe_spaceable_staves (smob, ALL_STAVES);
+}
+
+MAKE_SCHEME_CALLBACK (System, get_spaceable_staves, 1)
+SCM
+System::get_spaceable_staves (SCM smob)
+{
+ return get_maybe_spaceable_staves (smob, SPACEABLE_STAVES);
+}
+
+MAKE_SCHEME_CALLBACK (System, get_nonspaceable_staves, 1)
+SCM
+System::get_nonspaceable_staves (SCM smob)
+{
+ return get_maybe_spaceable_staves (smob, NONSPACEABLE_STAVES);
+}
+
+
ADD_INTERFACE (System,
"This is the top-level object: Each object in a score"
" ultimately has a @code{System} object as its X and"