+MAKE_SCHEME_CALLBACK (Axis_group_interface, calc_pure_staff_staff_spacing, 3)
+SCM
+Axis_group_interface::calc_pure_staff_staff_spacing (SCM smob, SCM start, SCM end)
+{
+ return calc_maybe_pure_staff_staff_spacing (unsmob_grob (smob),
+ true,
+ scm_to_int (start),
+ scm_to_int (end));
+}
+
+MAKE_SCHEME_CALLBACK (Axis_group_interface, calc_staff_staff_spacing, 1)
+SCM
+Axis_group_interface::calc_staff_staff_spacing (SCM smob)
+{
+ return calc_maybe_pure_staff_staff_spacing (unsmob_grob (smob),
+ false,
+ 0,
+ INT_MAX);
+}
+
+SCM
+Axis_group_interface::calc_maybe_pure_staff_staff_spacing (Grob *me, bool pure, int start, int end)
+{
+ Grob *grouper = unsmob_grob (me->get_object ("staff-grouper"));
+
+ if (grouper)
+ {
+ bool within_group = Staff_grouper_interface::maybe_pure_within_group (grouper, me, pure, start, end);
+ if (within_group)
+ return grouper->get_maybe_pure_property ("staff-staff-spacing", pure, start, end);
+ else
+ return grouper->get_maybe_pure_property ("staffgroup-staff-spacing", pure, start, end);
+ }
+ return me->get_maybe_pure_property ("default-staff-staff-spacing", pure, start, end);
+}
+
+Real
+Axis_group_interface::minimum_distance (Grob *g1, Grob *g2, Axis a)
+{
+ SCM sym = ly_symbol2scm ((a == Y_AXIS) ? "vertical-skylines" : "horizontal-skylines");
+
+ Skyline_pair *s1 = Skyline_pair::unsmob (g1->get_property (sym));
+ Skyline_pair *s2 = Skyline_pair::unsmob (g2->get_property (sym));
+ if (s1 && s2)
+ return (*s1)[DOWN].distance ((*s2)[UP]);
+ return 0;
+}
+