X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Finclude%2Flistener.hh;h=fd7a7e2adfa3db21399a025581248ffc1fd74d9a;hb=9f3572d98bb948c9689cd1f75401a029451fa001;hp=562380c5764e6967790431fc9dac8f4c8c1bea50;hpb=04265f11d1f21416ccebd2dcaa1d903dc781b36e;p=lilypond.git diff --git a/lily/include/listener.hh b/lily/include/listener.hh index 562380c576..fd7a7e2adf 100644 --- a/lily/include/listener.hh +++ b/lily/include/listener.hh @@ -63,8 +63,6 @@ class Listener { public: Listener (const void *target, Listener_function_table *type); Listener (Listener const &other); - Listener (); - void listen (SCM ev) const; bool operator == (Listener const &other) const @@ -74,29 +72,29 @@ public: }; DECLARE_UNSMOB (Listener, listener); -#define IMPLEMENT_LISTENER(cl, method) \ -void \ -cl :: method ## _callback (void *self, SCM ev) \ -{ \ - cl *s = (cl *)self; \ - s->method (ev); \ -} \ -void \ -cl :: method ## _mark (void *self) \ -{ \ - cl *s = (cl *)self; \ - scm_gc_mark (s->self_scm ()); \ -} \ -Listener \ -cl :: method ## _listener () const \ -{ \ - static Listener_function_table callbacks; \ - callbacks.listen_callback = &cl::method ## _callback; \ - callbacks.mark_callback = &cl::method ## _mark; \ - return Listener (this, &callbacks); \ +#define IMPLEMENT_LISTENER(cl, method) \ +void \ +cl :: method ## _callback (void *self, SCM ev) \ +{ \ + cl *s = (cl *)self; \ + s->method (ev); \ +} \ +void \ +cl :: method ## _mark (void *self) \ +{ \ + cl *s = (cl *)self; \ + scm_gc_mark (s->self_scm ()); \ +} \ +Listener \ +cl :: method ## _listener () const \ +{ \ + static Listener_function_table callbacks; \ + callbacks.listen_callback = &cl::method ## _callback; \ + callbacks.mark_callback = &cl::method ## _mark; \ + return Listener (this, &callbacks); \ } -#define GET_LISTENER(proc) proc ## _listener () +#define GET_LISTENER(proc) ( proc ## _listener ()) #define DECLARE_LISTENER(name) \ inline void name (SCM); \