]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/include/grob-interface.hh
Run `make grand-replace'.
[lilypond.git] / lily / include / grob-interface.hh
index 3f4bcfdbe186d701634a444ba77e2f49c7919ec3..f9fd7a48fbd179fd46f2111d05b3d0013892cda6 100644 (file)
@@ -1,37 +1,39 @@
-/*   
-  interface.hh -- declare Interface 
+/*
+  interface.hh -- declare Interface
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 2002--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
- */
+  (c) 2002--2008 Han-Wen Nienhuys <hanwen@xs4all.nl>
+*/
 
 #ifndef INTERFACE_HH
 #define INTERFACE_HH
 
-#include <libguile.h> /* SCM */
-
-
-
-#define ADD_INTERFACE(cl, a, b, c) \
-bool cl::has_interface(Grob*me)\
-{\
-  return me->internal_has_interface (ly_symbol2scm (a));\
-}\
-void cl ## _init_ifaces() {\
-  add_interface(a, b, c);\
-}\
-ADD_SCM_INIT_FUNC(cl ## ifaces, cl ## _init_ifaces);\
-
-
-
-void add_interface (const char * symbol,
-                   const char * descr,
-                   const char * vars);
-
-SCM ly_add_interface (SCM, SCM, SCM); 
-SCM ly_all_grob_interfaces();
+#include "lily-guile.hh"
+
+#define DECLARE_GROB_INTERFACE() \
+  static SCM interface_symbol_;           \
+  static bool has_interface (Grob*)
+
+#define ADD_INTERFACE(cl, b, c)                                \
+  SCM cl::interface_symbol_; \
+  bool cl::has_interface (Grob *me)                            \
+  {                                                            \
+    return me->internal_has_interface (interface_symbol_);     \
+  }                                                            \
+  void cl ## _init_ifaces ()                                   \
+  {                                                            \
+    cl::interface_symbol_ = add_interface (#cl, b, c);         \
+  }                                                            \
+  ADD_SCM_INIT_FUNC (cl ## ifaces, cl ## _init_ifaces);
+
+SCM add_interface (char const *cxx_name,
+                   char const *descr,
+                   char const *vars);
+
+SCM ly_add_interface (SCM, SCM, SCM);
+void internal_add_interface (SCM, SCM, SCM);
+SCM ly_all_grob_interfaces ();
 
 #endif /* INTERFACE_HH */