aboutsummaryrefslogtreecommitdiff
path: root/src/events/Event.hpp
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2025-05-01 23:41:54 +0530
committerAkshay Nair <phenax5@gmail.com>2025-05-02 16:21:45 +0530
commit9c812753e2b1f01b2e0c85be9904ff7694f0e6ec (patch)
treef308228c63fc8eeb526c901e80746d8da633b352 /src/events/Event.hpp
parentf0faa92246c1f5fc58546051ace2d047869447df (diff)
downloadnull-browser-9c812753e2b1f01b2e0c85be9904ff7694f0e6ec.tar.gz
null-browser-9c812753e2b1f01b2e0c85be9904ff7694f0e6ec.zip
Implement NotificationReceived event
Diffstat (limited to '')
-rw-r--r--src/events/Event.hpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/events/Event.hpp b/src/events/Event.hpp
index a0853d6..11f1141 100644
--- a/src/events/Event.hpp
+++ b/src/events/Event.hpp
@@ -8,6 +8,15 @@
lua_push##TYPE(state, VALUE); \
lua_settable(state, -3);
+// Not a huge fan but looks nice
+#define SET_FIELD_CLOSURE_WITH_SELF(NAME, CLOSURE) \
+ lua_pushstring(state, NAME); \
+ lua_pushlightuserdata(state, (void *)this); \
+ lua_pushcclosure(state, CLOSURE, 1); \
+ lua_settable(state, -3);
+
+#define GET_CLOSURE_SELF(TYPE) static_cast<TYPE>(lua_touserdata(state, lua_upvalueindex(1)));
+
class Event {
public:
QString kind = "-";