]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/item.cc
mutopia move
[lilypond.git] / lily / item.cc
index e92ac8ac90afbffcb934c820e656808513545b60..9c8a004fde23c0d5ec384004427437c8c9104663 100644 (file)
@@ -8,17 +8,19 @@
 
 
 #include "paper-score.hh"
-#include "debug.hh"
+#include "warn.hh"
 #include "item.hh"
 #include "paper-column.hh"
 #include "spanner.hh"
 #include "lily-guile.hh"
-#include "line-of-score.hh"
+#include "system.hh"
+#include "group-interface.hh"
 
 Item::Item (SCM s)
   : Grob (s)
 {
   broken_to_drul_[LEFT] = broken_to_drul_[RIGHT]=0;
+  Group_interface::add_thing (this, ly_symbol2scm ("interfaces"), ly_symbol2scm ("item-interface"));
 }
 
 /**
@@ -38,7 +40,7 @@ Item::breakable_b (Grob*me)
     return false;
 
   if (!dynamic_cast<Item*> (me))
-    programming_error ("only items can be breakable.");
+    me->programming_error ("only items can be breakable.");
   
   Item * i  =dynamic_cast<Item*> (me->get_parent (X_AXIS));
   return (i) ?  Item::breakable_b (i) : to_boolean (me->get_grob_property ("breakable"));
@@ -51,7 +53,7 @@ Item::column_l () const
   return parent ? parent->column_l () : 0;
 }
 
-Line_of_score *
+System *
 Item::line_l () const
 {
   Grob *g = get_parent (X_AXIS);
@@ -97,7 +99,7 @@ Item::discretionary_processing ()
 }
 
 Grob*
-Item::find_broken_piece (Line_of_score*l) const
+Item::find_broken_piece (System*l) const
 {
   if (line_l () == l) 
     return (Item*) (this);
@@ -140,12 +142,7 @@ Item::break_status_dir () const
 void
 Item::handle_prebroken_dependencies ()
 {
-  if (original_l_)
-    {
-      mutable_property_alist_
-       = handle_broken_grobs(original_l_->mutable_property_alist_,
-                              gh_int2scm (break_status_dir ()));
-    }
+  Grob::handle_prebroken_dependencies ();
   
   /*
     Can't do this earlier, because try_visibility_lambda () might set
@@ -153,11 +150,10 @@ Item::handle_prebroken_dependencies ()
 
     TODO:
 
-    handle visibility-lambda the item itself iso. breakstatusdir, so
-    the function can do more complicated things.
-    
+    give the item to break-visibility itself, so the function can do
+    more complicated things.
   */
-  SCM vis = get_grob_property ("visibility-lambda");
+  SCM vis = get_grob_property ("break-visibility");
   if (gh_procedure_p (vis))
     {
       SCM args = scm_list_n (gh_int2scm (break_status_dir ()), SCM_UNDEFINED);
@@ -169,11 +165,11 @@ Item::handle_prebroken_dependencies ()
        suicide ();
       else if (empty)
        {
-         set_extent_callback (SCM_EOL, X_AXIS);
-         set_extent_callback (SCM_EOL, Y_AXIS);
+         set_extent (SCM_EOL, X_AXIS);
+         set_extent (SCM_EOL, Y_AXIS);
        }
       else if (trans)
-       set_grob_property ("molecule-callback", SCM_BOOL_T);
+       set_grob_property ("molecule-callback", SCM_EOL);
     }
 }
 
@@ -192,3 +188,17 @@ unsmob_item (SCM s )
 {
   return dynamic_cast<Item*> (unsmob_grob (s));
 }
+
+
+
+ADD_INTERFACE(Item,
+             "item-interface",
+             "
+
+Grobs can be distinguished in their role in the horizontal spacing.
+Many grobs define constraints on the spacing by their sizes. For
+example, note heads, clefs, stems, and all other symbols with a fixed
+shape.  These grobs form a subtype called @code{Item}.
+
+",
+             "no-spacing-rods break-visibility breakable")