X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=inline;f=lily%2Finclude%2Fscheme-engraver.hh;h=79e01a7e1de3a243cce7674c8966fb88e090309b;hb=HEAD;hp=ec3d0756d973ab093f1e98c2293650683d0dfe7c;hpb=c054eb280fd9953596eb164f67b0f9d5555c5a32;p=lilypond.git diff --git a/lily/include/scheme-engraver.hh b/lily/include/scheme-engraver.hh index ec3d0756d9..79e01a7e1d 100644 --- a/lily/include/scheme-engraver.hh +++ b/lily/include/scheme-engraver.hh @@ -24,56 +24,44 @@ #include "engraver.hh" -class Scheme_engraver : public Engraver +struct Preinit_Scheme_engraver { + SCM initialize_function_; + SCM finalize_function_; + SCM precomputable_methods_ [TRANSLATOR_METHOD_PRECOMPUTE_COUNT]; + + // hashq table of interface-symbol -> scheme-function + Drul_array interface_acknowledger_hash_; + + // Alist of listened-symbol . scheme-function + SCM per_instance_listeners_; + Preinit_Scheme_engraver (); +}; + +class Scheme_engraver : Preinit_Scheme_engraver, public Engraver { public: - void init_from_scheme (SCM definition); - TRANSLATOR_DECLARATIONS_NO_LISTENER (Scheme_engraver); - - static Listener get_listener (void *generic_arg, SCM event); + TRANSLATOR_FAMILY_DECLARATIONS (Scheme_engraver); + Scheme_engraver (SCM definition, Context *c); 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; - virtual translator_listener_record *get_listener_list () const; + virtual SCM get_listener_list () const; 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); 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_; - - // hashq table of interface-symbol -> scheme-function - SCM interface_acknowledger_hash_; - SCM interface_end_acknowledger_hash_; - - // Alist of listened-symbol . scheme-function - SCM listeners_alist_; - - // We dont use this, but need it for the documentation boilerplate. - static translator_listener_record *listener_list_; - translator_listener_record *per_instance_listeners_; }; #endif /* SCHEME_ENGRAVER_HH */ -