+void
+Staff_spacing::get_spacing_params (Grob *me, Real * space, Real * fixed)
+{
+ *space = 1.0;
+ *fixed = 1.0;
+
+ Grob * separation_item=0;
+ Item * me_item = dynamic_cast<Item*> (me);
+
+ for (SCM s = me->get_grob_property ("left-items");
+ gh_pair_p (s); s = gh_cdr(s))
+ {
+ Grob * cand = unsmob_grob(gh_car (s));
+ if (cand && Separation_item::has_interface (cand))
+ separation_item = cand ;
+ }
+
+ // printf ("doing col %d\n" , Paper_column::rank_i(left_col));
+
+ if (!separation_item)
+ {
+ programming_error ("no sep item");
+ return;
+ }
+
+ Interval last_ext;
+ Grob *last_grob = extremal_break_aligned_grob (separation_item, RIGHT,
+ &last_ext);
+ if (!last_grob)
+ {
+ programming_error ("empty break column? --fixme");
+ return ;
+ }
+
+ *fixed = last_ext[RIGHT];
+ *space = *fixed + 1.0;
+
+ SCM alist = last_grob->get_grob_property ("space-alist");
+ if (!scm_list_p (alist))
+ return ;
+
+
+ SCM space_def = scm_sloppy_assq (ly_symbol2scm ("first-note"), alist);
+ if (me_item->break_status_dir () == CENTER)
+ {
+ SCM nndef = scm_sloppy_assq (ly_symbol2scm ("next-note"), alist);
+ if (gh_pair_p (nndef ))
+ space_def = nndef;
+ }
+
+ if (!gh_pair_p (space_def))
+ {
+ programming_error ("Unknown prefatory spacing. ");
+ return;
+ }
+
+ space_def = gh_cdr (space_def);
+ Real distance = gh_scm2double (gh_cdr (space_def));
+ SCM type = gh_car (space_def) ;
+
+ *fixed = last_ext[RIGHT];
+ if (type == ly_symbol2scm ("extra-space"))
+ *space = *fixed + distance;
+ else if (type == ly_symbol2scm("minimum-space"))
+ *space = last_ext[LEFT] + (last_ext.length () >? distance);
+
+
+ *space += next_notes_correction (me, last_grob);
+}
+
+
+ADD_INTERFACE (Staff_spacing,"staff-spacing-interface",
+ "",
+ "stem-spacing-correction left-items right-items");