diff options
| author | Akshay Nair <phenax5@gmail.com> | 2025-05-01 23:41:54 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2025-05-02 16:21:45 +0530 |
| commit | 9c812753e2b1f01b2e0c85be9904ff7694f0e6ec (patch) | |
| tree | f308228c63fc8eeb526c901e80746d8da633b352 /src/events/Event.hpp | |
| parent | f0faa92246c1f5fc58546051ace2d047869447df (diff) | |
| download | null-browser-9c812753e2b1f01b2e0c85be9904ff7694f0e6ec.tar.gz null-browser-9c812753e2b1f01b2e0c85be9904ff7694f0e6ec.zip | |
Implement NotificationReceived event
Diffstat (limited to 'src/events/Event.hpp')
| -rw-r--r-- | src/events/Event.hpp | 9 |
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 = "-"; |
