]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/include/scheme-engraver.hh
Issue 4997/2: Use Preinit class in Scheme_engraver
[lilypond.git] / lily / include / scheme-engraver.hh
index 3cd691578fa5b4b2b83f1ac9ecf5b0007dd979de..2eb2f30379d9b339833a65608b1b351f4311c250 100644 (file)
 
 #include "engraver.hh"
 
-class Scheme_engraver : public Engraver
+class Scheme_engraver : public Preinit<Scheme_engraver>, public Engraver
 {
-  void init_from_scheme (SCM definition);
 public:
   TRANSLATOR_FAMILY_DECLARATIONS (Scheme_engraver);
+  void pre_init ();
   Scheme_engraver (SCM definition);
 
 protected:
   ~Scheme_engraver ();
 
-  void stop_translation_timestep ();
-  void start_translation_timestep ();
-  void process_music ();
-  void process_acknowledged ();
-
   virtual void initialize ();
   virtual void finalize ();
   virtual void derived_mark () const;
@@ -46,29 +41,28 @@ protected:
   virtual bool must_be_last () const;
 
 private:
-  void acknowledge_grob_by_hash (Grob_info info, SCM iface_function_hash);
-  void init_acknowledgers (SCM alist, SCM *hash);
+  virtual SCM get_acknowledger (SCM sym, Direction start_end)
+  {
+    return generic_get_acknowledger
+      (sym, interface_acknowledger_hash_[start_end]);
+  }
 
-  DECLARE_ACKNOWLEDGER (grob);
-  DECLARE_END_ACKNOWLEDGER (grob);
+  SCM init_acknowledgers (SCM alist);
+  // For now no description.  In future, something derived from the
+  // definition might make sense.
+  SCM translator_description () const { return SCM_EOL; }
 
   bool must_be_last_;
 
-  SCM acknowledge_grob_function_;
-  SCM stop_translation_timestep_function_;
-  SCM start_translation_timestep_function_;
-  SCM process_music_function_;
-  SCM process_acknowledged_function_;
   SCM initialize_function_;
   SCM finalize_function_;
+  SCM precomputable_methods_ [TRANSLATOR_METHOD_PRECOMPUTE_COUNT];
 
   // hashq table of interface-symbol -> scheme-function
-  SCM interface_acknowledger_hash_;
-  SCM interface_end_acknowledger_hash_;
+  Drul_array<SCM> interface_acknowledger_hash_;
 
   // Alist of listened-symbol . scheme-function
   SCM per_instance_listeners_;
 };
 
 #endif /* SCHEME_ENGRAVER_HH */
-