]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/spanner.cc
* GNUmakefile.in (short-examples):
[lilypond.git] / lily / spanner.cc
index 8f9cdd2412d75487fa328e2d3c25fdb900e8d9cb..e45c74f7e2bf4c45b41dd935f00ccfa327f2fce4 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1996--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 1996--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 #include <math.h>
 #include <libc-extension.hh>
@@ -16,8 +16,7 @@
 #include "molecule.hh"
 #include "paper-outputter.hh"
 #include "paper-column.hh"
-#include "line-of-score.hh"
-#include "break-align-item.hh"
+#include "system.hh"
 #include "group-interface.hh"
 
 void
@@ -173,9 +172,9 @@ Spanner::set_bound (Direction d, Grob*s)
   spanned_drul_[d] =i;
 
   /**
-     We check for Line_of_score to prevent the column -> line_of_score
+     We check for System to prevent the column -> line_of_score
      -> column -> line_of_score -> etc situation */
-  if (d== LEFT && !dynamic_cast<Line_of_score*> (this))
+  if (d== LEFT && !dynamic_cast<System*> (this))
     {
       set_parent (i, X_AXIS);
     }
@@ -199,6 +198,9 @@ Spanner::Spanner (SCM s)
 {
   spanned_drul_[LEFT]=0;
   spanned_drul_[RIGHT]=0;
+  Group_interface::add_thing (this, ly_symbol2scm ("interfaces"), ly_symbol2scm ("spanner-interface"));
+                    
+  
 }
 
 Spanner::Spanner (Spanner const &s)
@@ -219,7 +221,7 @@ Spanner::spanner_length () const
   return r-l;
 }
 
-Line_of_score *
+System *
 Spanner::line_l () const
 {
   if (!spanned_drul_[LEFT] || !spanned_drul_[RIGHT])
@@ -231,7 +233,7 @@ Spanner::line_l () const
 
 
 Grob*
-Spanner::find_broken_piece (Line_of_score*l) const
+Spanner::find_broken_piece (System*l) const
 {
   int idx = binsearch_link_array (broken_into_l_arr_, (Spanner*)l, Spanner::compare);
   
@@ -302,8 +304,15 @@ Spanner::do_derived_mark ()
   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, Item*it)
+add_bound_item (Spanner* sp, Grob*it)
 {
   if (!sp->get_bound (LEFT))
     sp->set_bound (LEFT, it);
@@ -406,3 +415,8 @@ unsmob_spanner (SCM s )
 {
   return dynamic_cast<Spanner*> (unsmob_grob (s));
 }
+
+ADD_INTERFACE(Spanner,
+             "spanner-interface",
+             "",
+             "minimum-length");