*/
void
-chain_offset_callback (Grob *g, SCM proc, Axis a)
+chain_callback (Grob *g, SCM proc, SCM sym)
{
- SCM data = g->get_property_data (axis_offset_symbol (a));
+ SCM data = g->get_property_data (sym);
if (ly_is_procedure (data))
data = ly_make_simple_closure (scm_list_1 (data));
data = SCM_UNDEFINED;
SCM expr = scm_list_2 (proc, data);
- g->set_property (axis_offset_symbol (a),
+ g->set_property (sym,
// twice: one as a wrapper for grob property routines,
// once for the actual delayed binding.
ly_make_simple_closure (ly_make_simple_closure (expr)));
}
+
+void
+chain_offset_callback (Grob *g, SCM proc, Axis a)
+{
+ chain_callback (g, proc, axis_offset_symbol (a));
+}
/* offset/extent callbacks. */
void add_offset_callback (Grob *g, SCM proc, Axis a);
void chain_offset_callback (Grob *g, SCM proc, Axis a);
+void chain_callback (Grob *g, SCM proc, SCM sym);
SCM axis_offset_symbol (Axis a);
SCM axis_parent_positioning (Axis a);
DECLARE_SCHEME_CALLBACK (height, (SCM));
DECLARE_SCHEME_CALLBACK (outside_slur_callback, (SCM, SCM));
DECLARE_SCHEME_CALLBACK (pure_outside_slur_callback, (SCM, SCM, SCM, SCM));
+ DECLARE_SCHEME_CALLBACK (outside_slur_cross_staff, (SCM, SCM));
DECLARE_SCHEME_CALLBACK (calc_cross_staff, (SCM));
DECLARE_GROB_INTERFACE();
static Bezier get_curve (Grob *me);
if (slur)
{
chain_offset_callback (e, outside_slur_callback_proc, Y_AXIS);
+ chain_callback (e, outside_slur_cross_staff_proc, ly_symbol2scm("cross-staff"));
e->set_object ("slur", slur->self_scm ());
}
}
e->name().c_str ()));
}
+/*
+ A callback that will be chained together with the original cross-staff
+ value of a grob that is placed 'outside or 'around a slur. This just says
+ that any grob becomes cross-staff if it is placed 'outside or 'around a
+ cross-staff slur.
+*/
+MAKE_SCHEME_CALLBACK (Slur, outside_slur_cross_staff, 2)
+SCM
+Slur::outside_slur_cross_staff (SCM smob, SCM previous)
+{
+ if (previous == SCM_BOOL_T)
+ return previous;
+
+ Grob *me = unsmob_grob (smob);
+ Grob *slur = unsmob_grob (me->get_object ("slur"));
+
+ if (!slur)
+ return SCM_BOOL_F;
+ return slur->get_property ("cross-staff");
+}
+
MAKE_SCHEME_CALLBACK (Slur, calc_cross_staff, 1)
SCM
Slur::calc_cross_staff (SCM smob)