X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Finclude%2Fdispatcher.hh;h=f4fe9156bcde77d5fe72a58029c6db17dc052468;hb=d2762a4f1add2bb04d6fc34d3c7ae03eeb7d500f;hp=b11167121bb93ebf2b1a83f8c3ec7f0349bdbccf;hpb=fc9fdf1b559adff595d3e4869e02bf81b2309c73;p=lilypond.git diff --git a/lily/include/dispatcher.hh b/lily/include/dispatcher.hh index b11167121b..f4fe9156bc 100644 --- a/lily/include/dispatcher.hh +++ b/lily/include/dispatcher.hh @@ -22,9 +22,16 @@ #include "listener.hh" #include "stream-event.hh" +#include "smobs.hh" -class Dispatcher +class Dispatcher : public Smob { +public: + int print_smob (SCM, scm_print_state *); + SCM mark_smob (); + static const char type_p_name_[]; + virtual ~Dispatcher (); +private: /* Hash table. Each event-class maps to a list of listeners. */ SCM listeners_; /* alist of dispatchers that we listen to. Each entry is a @@ -39,15 +46,13 @@ class Dispatcher public: Dispatcher (); void broadcast (Stream_event *ev); - bool is_listened (Stream_event *ev); + bool is_listened_class (SCM); + SCM listened_types (); void add_listener (Listener, SCM event_class); void remove_listener (Listener, SCM event_class); void register_as_listener (Dispatcher *dist); void unregister_as_listener (Dispatcher *dist); -protected: - DECLARE_SMOBS (Dispatcher); }; -DECLARE_UNSMOB (Dispatcher, dispatcher); #endif // DISPATCHER_HH