From 6b1d49e607da16853d1a0f460dbe756538e4790c Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sun, 9 Mar 2025 22:09:09 +0530 Subject: Add lua integration for command input (web.open, web.tabopen) --- include/widgets/BrowserManager.hpp | 5 +++++ include/widgets/MainWindow.hpp | 2 ++ 2 files changed, 7 insertions(+) (limited to 'include/widgets') diff --git a/include/widgets/BrowserManager.hpp b/include/widgets/BrowserManager.hpp index 84d6f6a..8cf265d 100644 --- a/include/widgets/BrowserManager.hpp +++ b/include/widgets/BrowserManager.hpp @@ -5,6 +5,8 @@ #include #include +enum OpenType { OpenUrl, OpenUrlInTab, OpenUrlInBgTab, OpenUrlInWindow }; + class BrowserManager : public QWidget { Q_OBJECT @@ -20,6 +22,9 @@ public: QWebEngineView *createNewWebView(QUrl url = BrowserManager::NewtabURL, bool focus = false); + void openUrl(QUrl url = BrowserManager::NewtabURL, + OpenType openType = OpenType::OpenUrl); + std::vector webViewUrls(); u_int32_t currentWebViewIndex(); u_int32_t webViewCount(); diff --git a/include/widgets/MainWindow.hpp b/include/widgets/MainWindow.hpp index 8ba0ed9..15e2889 100644 --- a/include/widgets/MainWindow.hpp +++ b/include/widgets/MainWindow.hpp @@ -4,6 +4,7 @@ #include #include +#include "LuaRuntime.hpp" #include "widgets/BrowserManager.hpp" #include "widgets/CommandInput.hpp" @@ -21,4 +22,5 @@ protected: private: BrowserManager *browserManager; CommandInput *commandInput; + LuaRuntime *luaRuntime; }; -- cgit v1.3.1