]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/script-interface.cc
Merge branch 'master' of ssh+git://hanwen@git.sv.gnu.org/srv/git/lilypond
[lilypond.git] / lily / script-interface.cc
index de8198533bb044483d7c0b79cadf54d644b15b5d..8e142179b4f2fbc211cc961ac534eb800a497a27 100644 (file)
@@ -3,12 +3,13 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1999--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  (c) 1999--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
 #include "script-interface.hh"
 
 #include "directional-element-interface.hh"
+#include "item.hh"
 #include "warn.hh"
 #include "font-interface.hh"
 #include "side-position-interface.hh"
@@ -64,6 +65,15 @@ Script_interface::calc_direction (SCM smob)
   return scm_from_int (d);
 }
 
+MAKE_SCHEME_CALLBACK (Script_interface, calc_cross_staff, 1);
+SCM
+Script_interface::calc_cross_staff (SCM smob)
+{
+  Grob *me = unsmob_grob (smob);
+  Grob *stem = Note_column::get_stem (me->get_parent (X_AXIS));
+  return scm_from_bool (stem && to_boolean (stem->get_property ("cross-staff")));
+}
+
 MAKE_SCHEME_CALLBACK (Script_interface, print, 1);
 
 SCM
@@ -78,10 +88,10 @@ Script_interface::print (SCM smob)
 
 struct Text_script
 {
-  static bool has_interface (Grob *);
+  DECLARE_GROB_INTERFACE ();
 };
 
-ADD_INTERFACE (Text_script, "text-script-interface",
+ADD_INTERFACE (Text_script,
               "An object that is put above or below a note",
 
               /* properties */
@@ -94,7 +104,7 @@ ADD_INTERFACE (Text_script, "text-script-interface",
 /*
   Hmm. Where should we put add-stem-support ?
 */
-ADD_INTERFACE (Script_interface, "script-interface",
+ADD_INTERFACE (Script_interface,
               "An object that is put above or below a note",
               "add-stem-support "
               "avoid-slur "