- Item *il = unsmob_item (elt);
- if (pc != il->column_l ())
- {
- /* this shouldn't happen, but let's continue anyway. */
- programming_error (_ ("Separation_item: I've been drinking too much"));
- continue; /*UGH UGH*/
- }
+ rod.item_drul_ = items;
+
+ rod.distance_ = dist;
+ rod.add_to_cols ();
+ }
+}
+
+bool
+Separation_item::set_distance (Drul_array<Item *> items,
+ Real padding)
+{
+ set_skyline_distance (items, padding);
+ return true;
+}
+
+/*
+ Return the width of ME given that we are considering the object on
+ the LEFT.
+*/
+Skyline
+Separation_item::conditional_skyline (Grob *me, Grob *left)
+{
+ vector<Box> bs = boxes (me, left);
+ return Skyline (bs, 0.1, Y_AXIS, LEFT);
+}
+
+
+MAKE_SCHEME_CALLBACK(Separation_item,calc_skylines,1);
+SCM
+Separation_item::calc_skylines (SCM smob)
+{
+ Item *me = unsmob_item (smob);
+ vector<Box> bs = boxes (me, 0);
+ /* todo: the horizon_padding is somewhat arbitrary */
+ return Skyline_pair (bs, 0.1, Y_AXIS).smobbed_copy ();
+}
+
+/* if left is non-NULL, get the boxes corresponding to the
+ conditional-elements (conditioned on the grob LEFT). This
+ sounds more general than it is: conditional-elements are
+ always accidentals attached to a tied note.
+*/
+vector<Box>
+Separation_item::boxes (Grob *me, Grob *left)
+{
+ Item *item = dynamic_cast<Item *> (me);
+
+ int very_large = INT_MAX;
+ Paper_column *pc = item->get_column ();
+ vector<Box> out;
+ extract_grob_set (me, left ? "conditional-elements" : "elements", read_only_elts);
+ vector<Grob*> elts;
+
+ if (left)
+ elts = Accidental_placement::get_break_reminder_accidentals (read_only_elts, left);
+ else
+ elts = read_only_elts;