Skip to content

Commit 8ca8445

Browse files
committed
Refactor EventEmitter to use typed events
EventEmitter is now a template class requiring a base event type, enforcing compile-time type safety for emitted events and listeners. Updated DisplayManager, KeyboardMonitor, Menu, MenuItem, TrayIcon, and WindowManager to inherit from EventEmitter with their respective event types. Refactored event classes (MenuEvent, TrayIconEvent, etc.) to provide a common base for related events. Removed the old untyped event_emitter.cpp implementation and updated platform-specific code to use typed events.
1 parent 2d08dd5 commit 8ca8445

14 files changed

+277
-231
lines changed

src/display_manager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ namespace nativeapi {
3535
* Display primary = manager.GetPrimary();
3636
* @endcode
3737
*/
38-
class DisplayManager : public EventEmitter {
38+
class DisplayManager : public EventEmitter<DisplayEvent> {
3939
public:
4040
/**
4141
* Get the singleton instance of DisplayManager

src/foundation/event_emitter.cpp

Lines changed: 0 additions & 182 deletions
This file was deleted.

0 commit comments

Comments
 (0)