+ Grob *me = unsmob_grob (smobbed_me);
+ SCM first_elt = me->get_property ("elements");
+
+ /* compute common refpoint of elements */
+ Grob *refp = me;
+ for (SCM elts = first_elt; scm_is_pair (elts); elts = scm_cdr (elts))
+ {
+ SCM smobbed_staff_bar = scm_car (elts);
+ Grob *staff_bar = unsmob_grob (smobbed_staff_bar);
+ refp = staff_bar->common_refpoint (refp, Y_AXIS);
+ }
+
+ Span_bar::evaluate_glyph (me);
+ SCM glyph = me->get_property ("glyph");
+
+ /* glyph may not be a string, when ME is killed by Hara Kiri in
+ between. */
+ if (!scm_is_string (glyph))
+ return SCM_EOL;
+
+ String glyph_string = ly_scm2string (glyph);
+
+ /* compose span_bar_mol */
+ Stencil span_bar_mol;
+
+ Interval prev_extent;
+ for (SCM elts = first_elt; scm_is_pair (elts); elts = scm_cdr (elts))
+ {
+ SCM smobbed_staff_bar = scm_car (elts);
+ Grob *staff_bar = unsmob_grob (smobbed_staff_bar);
+ Interval ext = staff_bar->extent (refp, Y_AXIS);
+ if (ext.is_empty ())
+ continue;
+
+ if (!prev_extent.is_empty ())
+ {
+ Interval l (prev_extent [UP],
+ ext[DOWN]);
+
+ if (l.is_empty ())
+ {
+ /* There is overlap between the bar lines. Do nothing. */
+ }
+ else
+ {
+ Stencil interbar = Bar_line::compound_barline (staff_bar,
+ glyph_string,
+ l.length ());
+ interbar.translate_axis (l.center (), Y_AXIS);
+ span_bar_mol.add_stencil (interbar);
+ }
+ }
+ prev_extent = ext;
+ }
+
+ span_bar_mol.translate_axis (- me->relative_coordinate (refp, Y_AXIS),
+ Y_AXIS);
+
+ return span_bar_mol.smobbed_copy ();
+}
+
+MAKE_SCHEME_CALLBACK (Span_bar,width_callback,2);
+SCM
+Span_bar::width_callback (SCM element_smob, SCM scm_axis)
+{
+ Grob *se = unsmob_grob (element_smob);
+ Axis a = (Axis) scm_to_int (scm_axis);
+ assert (a == X_AXIS);
+ String gl = ly_scm2string (se->get_property ("glyph"));