aboutsummaryrefslogtreecommitdiff
path: root/src/events/Event.hpp
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2025-05-01 22:38:12 +0530
committerAkshay Nair <phenax5@gmail.com>2025-05-02 16:21:23 +0530
commitf0faa92246c1f5fc58546051ace2d047869447df (patch)
tree68ac05f65ca59915d5459b9957fe874e616fc2be /src/events/Event.hpp
parent86496d0ce96f2e57f3f301c08488b6421321b3c9 (diff)
downloadnull-browser-f0faa92246c1f5fc58546051ace2d047869447df.tar.gz
null-browser-f0faa92246c1f5fc58546051ace2d047869447df.zip
Refactor events into separate files
Diffstat (limited to 'src/events/Event.hpp')
-rw-r--r--src/events/Event.hpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/events/Event.hpp b/src/events/Event.hpp
new file mode 100644
index 0000000..a0853d6
--- /dev/null
+++ b/src/events/Event.hpp
@@ -0,0 +1,19 @@
+#pragma once
+
+#include <QtCore>
+#include <lua.hpp>
+
+#define SET_FIELD(NAME, TYPE, VALUE) \
+ lua_pushstring(state, NAME); \
+ lua_push##TYPE(state, VALUE); \
+ lua_settable(state, -3);
+
+class Event {
+public:
+ QString kind = "-";
+
+ virtual void lua_push(lua_State *state) const {
+ lua_newtable(state);
+ SET_FIELD("type", string, kind.toStdString().c_str())
+ };
+};