]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/item.cc
* input/mozart-hrn3-defs.ly (startGraceContext): Customize grace init.
[lilypond.git] / lily / item.cc
index 6fae06efb950b74d174e430202b8a601ffec3969..abae1689a6ad828a82430caa84b59435ad395cff 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c)  1997--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c)  1997--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
 
 #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"));
+                    
 }
 
 /**
@@ -40,21 +43,21 @@ Item::breakable_b (Grob*me)
   if (!dynamic_cast<Item*> (me))
     programming_error ("only items can be breakable.");
   
-  Item * i  =dynamic_cast<Item*> (me->parent_l (X_AXIS));
+  Item * i  =dynamic_cast<Item*> (me->get_parent (X_AXIS));
   return (i) ?  Item::breakable_b (i) : to_boolean (me->get_grob_property ("breakable"));
 }
 
 Paper_column *
 Item::column_l () const
 {
-  Item *parent = dynamic_cast<Item*> (parent_l (X_AXIS));
+  Item *parent = dynamic_cast<Item*> (get_parent (X_AXIS));
   return parent ? parent->column_l () : 0;
 }
 
-Line_of_score *
+System *
 Item::line_l () const
 {
-  Grob *g = parent_l (X_AXIS);
+  Grob *g = get_parent (X_AXIS);
   return g ?  g->line_l () : 0;
 }
 
@@ -97,7 +100,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);
@@ -169,11 +172,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);
     }
 }
 
@@ -186,3 +189,16 @@ Item::do_derived_mark ()
     scm_gc_mark (broken_to_drul_[RIGHT]->self_scm ());
   return SCM_EOL;
 }
+
+Item*
+unsmob_item (SCM s )
+{
+  return dynamic_cast<Item*> (unsmob_grob (s));
+}
+
+
+
+ADD_INTERFACE(Item,
+             "item-interface",
+             "",
+             "no-spacing-rods visibility-lambda breakable")