From 96727d6e63ca927f3c7b68d4baa4fe672a4dcd0b Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Wed, 2 Apr 2025 20:49:49 +0530 Subject: Add events system for lua runtime to dispatch and register events --- src/WindowActionRouter.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/WindowActionRouter.hpp') diff --git a/src/WindowActionRouter.hpp b/src/WindowActionRouter.hpp index 384c76c..62aa65d 100644 --- a/src/WindowActionRouter.hpp +++ b/src/WindowActionRouter.hpp @@ -4,7 +4,11 @@ #include #include #include +#include +#include +#include +#include "events.hpp" #include "widgets/BrowserWindow.hpp" #include "widgets/WebViewStack.hpp" @@ -33,6 +37,9 @@ public: WebViewId fetch_current_tab_id(WindowId win_id = 0); QList fetch_webview_data_list(WindowId win_id = 0); + void dispatch_event(BrowserEvent &event); + void register_event(const EventHandlerRequest &event); + protected: WindowActionRouter() = default; @@ -42,4 +49,7 @@ protected: private: WindowMap window_map; uint64_t last_id = 1; + + std::mutex events_mutex; + std::unordered_map> events; }; -- cgit v1.3.1