]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/include/translator.icc
Run `make grand-replace'.
[lilypond.git] / lily / include / translator.icc
index 904e3c127c60bcef5c85cda95dd8d7421bd2009c..775f5b9370b899c74e4114de68ada02ee5a7667e 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 2005--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  (c) 2005--2008 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
 #ifndef TRANSLATOR_ICC
 #include "std-vector.hh"
 #include "translator.hh"
 
+/*
+  TODO: derive "foo-bar-interface" from Foo_bar classname.
+ */
+
 /**
    A macro to automate administration of translators.
 */
@@ -32,7 +36,7 @@
   }                                                                    \
   ADD_GLOBAL_CTOR (_ ## T ## _adder);
 
-#define ADD_TRANSLATOR(classname, desc, grobs, accepted, read, write)  \
+#define ADD_TRANSLATOR(classname, desc, grobs, read, write)            \
   Drul_array< vector<Acknowledge_information> > classname::acknowledge_static_array_drul_;     \
   IMPLEMENT_FETCH_PRECOMPUTABLE_METHODS (classname);                   \
   ADD_THIS_TRANSLATOR (classname);                                     \
   SCM                                                                  \
   classname::static_translator_description () const                    \
   {                                                                    \
-    SCM static_properties = SCM_EOL;                                   \
-    /*  static_properties = acons (name , gh_str02scm (Translator::name (self_scm ())),        \
-       static_properties_);                                            \
-    */                                                                 \
-    static_properties = scm_acons (ly_symbol2scm ("grobs-created"),    \
-                                  parse_symbol_list (grobs), static_properties); \
-                                                                       \
-    static_properties = scm_acons (ly_symbol2scm ("description"),      \
-                                  scm_makfrom0str (desc), static_properties); \
-                                                                       \
-    static_properties = scm_acons (ly_symbol2scm ("events-accepted"),  \
-                                  parse_symbol_list (accepted), static_properties); \
-                                                                       \
-    static_properties = scm_acons (ly_symbol2scm ("properties-read"),  \
-                                  parse_symbol_list (read), static_properties); \
-                                                                       \
-    static_properties = scm_acons (ly_symbol2scm ("properties-written"), \
-                                  parse_symbol_list (write), static_properties); \
-                                                                       \
-    return static_properties;                                          \
+    return Translator::static_translator_description (grobs, desc, listener_list_, read, write); \
   }
 
 #define IMPLEMENT_FETCH_PRECOMPUTABLE_METHODS(T)                       \
@@ -149,10 +134,4 @@ cl::_listen_scm_ ## m (SCM sev)                            \
   listen_ ## m (ev);                                   \
 }
 
-/*
-  This helper is only meaningful inside listen_* methods.
-*/
-extern bool internal_event_assignment (Stream_event **old_ev, Stream_event *new_ev, const char *function);
-#define ASSIGN_EVENT_ONCE(o,n) internal_event_assignment (&o, n, __FUNCTION__)
-
 #endif /* TRANSLATOR_ICC */