Add macro to convert shared pointers to event listeners.