diff --git a/Libraries/LibCore/CEvent.h b/Libraries/LibCore/CEvent.h index 9d262c4a76..6238cc59a4 100644 --- a/Libraries/LibCore/CEvent.h +++ b/Libraries/LibCore/CEvent.h @@ -17,6 +17,7 @@ public: DeferredInvoke, ChildAdded, ChildRemoved, + Custom, }; CEvent() {} @@ -72,3 +73,22 @@ public: private: WeakPtr m_child; }; + +class CCustomEvent : public CEvent { +public: + CCustomEvent(int custom_type, void* data = nullptr) + : CEvent(CEvent::Type::Custom) + , m_custom_type(custom_type) + , m_data(data) + { + } + ~CCustomEvent() {} + + int custom_type() const { return m_custom_type; } + void* data() { return m_data; } + const void* data() const { return m_data; } + +private: + int m_custom_type { 0 }; + void* m_data { nullptr }; +};