aboutsummaryrefslogtreecommitdiff
path: root/src/WindowActionRouter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/WindowActionRouter.cpp')
-rw-r--r--src/WindowActionRouter.cpp30
1 files changed, 0 insertions, 30 deletions
diff --git a/src/WindowActionRouter.cpp b/src/WindowActionRouter.cpp
index e1d0664..8c80290 100644
--- a/src/WindowActionRouter.cpp
+++ b/src/WindowActionRouter.cpp
@@ -1,6 +1,5 @@
#include <QWidget>
#include <QtCore>
-#include <string>
#include <unordered_map>
#include "LuaRuntime.hpp"
@@ -10,35 +9,6 @@
#include "widgets/BrowserWindow.hpp"
#include "widgets/WebViewStack.hpp"
-void WindowActionRouter::dispatch_event(BrowserEvent *event) {
- auto &runtime = LuaRuntime::instance();
-
- runtime.queue_task([this, event]() {
- std::unordered_map<QString, std::vector<EventHandlerRequest>> event_map;
- {
- const std::lock_guard<std::mutex> lock(events_mutex);
- event_map = events;
- }
-
- if (!event_map.contains(event->kind))
- return;
-
- for (auto &event_handler : event_map.at(event->kind)) {
- // TODO: Pattern filter
- event_handler.handler(event);
- }
- });
-}
-
-void WindowActionRouter::register_event(const EventHandlerRequest &event) {
- const std::lock_guard<std::mutex> lock(events_mutex);
- for (const auto &event_name : event.event_names) {
- if (!events.contains(event_name))
- events.insert({event_name, {}});
- events.at(event_name).emplace_back(event);
- }
-}
-
void WindowActionRouter::initialize() {
auto &runtime = LuaRuntime::instance();