From bcecbced7e1af9d99443a7e823f18328c7943f09 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sat, 29 Mar 2025 11:45:18 +0530 Subject: Add window action router for multi-window --- src/WindowActionRouter.hpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/WindowActionRouter.hpp (limited to 'src/WindowActionRouter.hpp') diff --git a/src/WindowActionRouter.hpp b/src/WindowActionRouter.hpp new file mode 100644 index 0000000..b6cd731 --- /dev/null +++ b/src/WindowActionRouter.hpp @@ -0,0 +1,30 @@ +#pragma once + +#include "widgets/BrowserWindow.hpp" +#include +#include +#include +#include + +using WindowId = uint64_t; +using WindowMap = std::unordered_map; + +class WindowActionRouter : public QWidget { + Q_OBJECT + +public: + static WindowActionRouter *instance() { + static auto *router = new WindowActionRouter; + return router; + } + + void add_window(BrowserWindow *window); + const WindowMap &windows(); + +protected: + WindowActionRouter(); + +private: + WindowMap window_map; + uint64_t last_id = 1; +}; -- cgit v1.3.1