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/LuaRuntime.hpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 include/LuaRuntime.hpp (limited to 'include/LuaRuntime.hpp') diff --git a/include/LuaRuntime.hpp b/include/LuaRuntime.hpp new file mode 100644 index 0000000..85bb1ae --- /dev/null +++ b/include/LuaRuntime.hpp @@ -0,0 +1,31 @@ +#pragma once +#include +#include + +#include "widgets/BrowserManager.hpp" + +class LuaRuntime : public QObject { + Q_OBJECT + +public: + static LuaRuntime *instance() { + static LuaRuntime inst; + return &inst; + } + + void evaluate(const char *code); + +protected: + LuaRuntime(); + ~LuaRuntime(); + +signals: + void urlOpenned(QString url, OpenType openType); + +protected: + static int lua_onUrlOpen(lua_State *state); + static int lua_onUrlTabOpen(lua_State *state); + +private: + lua_State *state; +}; -- cgit v1.3.1