]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/include/translator.hh
Issue 5024: Rework the Preinit framework into something simpler
[lilypond.git] / lily / include / translator.hh
index dd0659bf50866ec4a9e03e86565deffc0299f7dd..09ab16865815e322e02ecd476540555d4ee81101 100644 (file)
@@ -26,6 +26,7 @@
 #include "callback.hh"
 #include "input.hh"             // for error reporting
 #include "smobs.hh"
+#include "stream-event.hh"
 #include "std-vector.hh"
 #include "protected-scm.hh"
 
 
 #define DECLARE_TRANSLATOR_CALLBACKS(NAME)                              \
   template <void (NAME::*mf)()>                                         \
-  static SCM method_finder () { return method_find_base<NAME, mf> (); } \
+  static SCM method_finder ()                                           \
+  {                                                                     \
+    return Callback0_wrapper::make_smob<NAME, mf> ();                   \
+  }                                                                     \
+  template <void (NAME::*mf)(Stream_event *)>                           \
+  static SCM method_finder ()                                           \
+  {                                                                     \
+    return Callback_wrapper::make_smob<trampoline<NAME, mf> > ();       \
+  }                                                                     \
+  template <void (NAME::*mf)(Grob_info)>                                \
+  static SCM method_finder () {                                         \
+    return Callback2_wrapper::make_smob<trampoline <NAME, mf> > ();     \
+  }                                                                     \
   /* end #define */
 
 /*
@@ -146,10 +159,6 @@ protected:                      // should be private.
     return SCM_UNSPECIFIED;
   }
 
-  template <class T, void (T::*mf)()>
-  static SCM
-  method_find_base () { return Callback0_wrapper::make_smob<T, mf> (); }
-
   // Fallback for non-overriden callbacks for which &T::x degrades to
   // &Translator::x
   template <void (Translator::*)()>