diff options
| author | Yuqian Yang <crupest@crupest.life> | 2025-11-25 17:15:16 +0800 |
|---|---|---|
| committer | Yuqian Yang <crupest@crupest.life> | 2025-11-25 17:15:16 +0800 |
| commit | 376d5bfe0f3b9658cbf2d4ca9b00c0600341ee85 (patch) | |
| tree | 9a4326fbc15a164631c950d37551df372888f6b3 /include/cru/base/Event.h | |
| parent | eb280d0ed73c7b3a410c94f4eb995b23cccb9e6a (diff) | |
| download | cru-376d5bfe0f3b9658cbf2d4ca9b00c0600341ee85.tar.gz cru-376d5bfe0f3b9658cbf2d4ca9b00c0600341ee85.tar.bz2 cru-376d5bfe0f3b9658cbf2d4ca9b00c0600341ee85.zip | |
Clean code. Clean events of native window.
Diffstat (limited to 'include/cru/base/Event.h')
| -rw-r--r-- | include/cru/base/Event.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/cru/base/Event.h b/include/cru/base/Event.h index bdaf3ea6..71c0ac6b 100644 --- a/include/cru/base/Event.h +++ b/include/cru/base/Event.h @@ -141,6 +141,13 @@ class Event : public EventBase, public IEvent<TEventArgs> { public: \ ::cru::IEvent<arg_type>* name##Event() { return &name##Event_; } +#define CRU_DEFINE_EVENT_OVERRIDE(name, arg_type) \ + private: \ + ::cru::Event<arg_type> name##Event_; \ + \ + public: \ + ::cru::IEvent<arg_type>* name##Event() override { return &name##Event_; } + namespace details { struct EventHandlerRevokerCaller { void operator()(const EventHandlerRevoker& revoker) { revoker(); } |
