+
+SCM
+Spanner::do_derived_mark () const
+{
+ /*
+ We'd be fucked if this is called before spanned_drul_[] is inited. */
+ if (status_ == ORPHAN)
+ return SCM_EOL;
+
+ Direction d = LEFT;
+ do
+ if (spanned_drul_[d])
+ scm_gc_mark (spanned_drul_[d]->self_scm ());
+ while (flip (&d) != LEFT);
+
+ for (int i= broken_intos_.size () ; i--;)
+ scm_gc_mark (broken_intos_[i]->self_scm ());
+
+ return SCM_EOL;
+}
+
+
+/*
+ Set left or right bound to IT.
+
+ Warning: caller should ensure that subsequent calls put in ITems
+ that are left-to-right ordered.
+ */
+void
+add_bound_item (Spanner* sp, Grob*it)
+{
+ if (!sp->get_bound (LEFT))
+ sp->set_bound (LEFT, it);
+ else
+ sp->set_bound (RIGHT, it);
+}
+
+
+MAKE_SCHEME_CALLBACK (Spanner,set_spacing_rods,1);
+SCM
+Spanner::set_spacing_rods (SCM smob)
+{
+ Grob*me = unsmob_grob (smob);
+
+ Rod r;
+ Spanner*sp = dynamic_cast<Spanner*> (me);
+ r.item_l_drul_[LEFT] = sp->get_bound (LEFT);
+ r.item_l_drul_[RIGHT] = sp->get_bound (RIGHT);
+ r.distance_ =
+ robust_scm2double (me->get_property ("minimum-length"), 0);
+
+ r.add_to_cols ();
+ return SCM_UNSPECIFIED;
+}
+
+
+/*
+ Return I such that SP == SP->ORIGINAL_->BROKEN_INTOS_[I].
+ */
+int
+broken_spanner_index (Spanner * sp)
+{
+ Spanner * parent = dynamic_cast<Spanner*> (sp->original_);
+ return parent->broken_intos_.find_index (sp);
+}
+
+
+Spanner*
+unsmob_spanner (SCM s )
+{
+ return dynamic_cast<Spanner*> (unsmob_grob (s));
+}
+
+ADD_INTERFACE (Spanner,
+ "spanner-interface",
+"Some objects are horizontally spanned between objects. For\n"
+"example, slur, beam, tie, etc. These grobs form a subtype called\n"
+"@code{Spanner}. All spanners have two span-points (these must be\n"
+"@code{Item} objects), one on the left and one on the right. The left bound is\n"
+"also the X-reference point of the spanner.\n"
+,
+ "minimum-length");