aboutsummaryrefslogtreecommitdiff
path: root/src/LuaRuntime.hpp
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2025-03-20 22:10:57 +0530
committerAkshay Nair <phenax5@gmail.com>2025-03-20 22:10:57 +0530
commitfdeb33d34a97d062a120f72da919f81d7b1d45bf (patch)
tree91165d5e3e718d4008bf73259f45d1705965f4b0 /src/LuaRuntime.hpp
parent9e3474b5d8ee4afdd9c03cfb4a151ffebfca36b7 (diff)
downloadnull-browser-fdeb33d34a97d062a120f72da919f81d7b1d45bf.tar.gz
null-browser-fdeb33d34a97d062a120f72da919f81d7b1d45bf.zip
Move header files to src
Diffstat (limited to 'src/LuaRuntime.hpp')
-rw-r--r--src/LuaRuntime.hpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/LuaRuntime.hpp b/src/LuaRuntime.hpp
new file mode 100644
index 0000000..5bfc82c
--- /dev/null
+++ b/src/LuaRuntime.hpp
@@ -0,0 +1,29 @@
+#pragma once
+#include <QtCore>
+#include <lua.hpp>
+
+#include "widgets/WebViewStack.hpp"
+
+class LuaRuntime : public QObject {
+ Q_OBJECT
+
+public:
+ static LuaRuntime *instance() {
+ static LuaRuntime inst;
+ return &inst;
+ }
+
+ void evaluate(QString code);
+
+signals:
+ void urlOpened(QString url, OpenType openType);
+
+protected:
+ LuaRuntime();
+ ~LuaRuntime();
+ static int lua_onUrlOpen(lua_State *state);
+ static int lua_onUrlTabOpen(lua_State *state);
+
+private:
+ lua_State *state;
+};