summaryrefslogtreecommitdiff
path: root/plugins/MirLua/src/mlua.h
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-07-06 12:38:11 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-07-06 12:38:11 +0000
commit044f684c197b7dc71556b2c26415cdc694ba51a3 (patch)
treeea540f29fbde157f45a15fe1003738a818f22919 /plugins/MirLua/src/mlua.h
parente4d6b6be1f71fd5c8b02ef10d4c130fb5673b76e (diff)
MirLua:
- fixed correct hooks/services cleanup on reload - added functions OnScriptLoaded and OnScriptUnload to m git-svn-id: http://svn.miranda-ng.org/main/trunk@14498 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirLua/src/mlua.h')
-rw-r--r--plugins/MirLua/src/mlua.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/plugins/MirLua/src/mlua.h b/plugins/MirLua/src/mlua.h
index c792c32780..5d771d8ea9 100644
--- a/plugins/MirLua/src/mlua.h
+++ b/plugins/MirLua/src/mlua.h
@@ -1,20 +1,43 @@
#ifndef _LUA_CORE_H_
#define _LUA_CORE_H_
+struct HandleRefParam
+{
+ HANDLE h;
+ int ref;
+ lua_State *L;
+ HandleRefParam(HANDLE h) : L(NULL), h(h), ref(0) { }
+ HandleRefParam(lua_State *L, HANDLE h, int ref = 0) : L(L), h(h), ref(ref) { }
+};
+
class CMLua
{
private:
lua_State *L;
+ HANDLE hLoadedEvent;
+ HANDLE hUnloadEvent;
+
+ static void KillModuleEventHooks();
+ static void KillModuleServices();
void Load();
void Unload();
public:
+ static LIST<void> Hooks;
+ static LIST<void> Events;
+ static LIST<void> Services;
+ static LIST<void> HookRefs;
+ static LIST<void> ServiceRefs;
+
CMLua();
~CMLua();
void Reload();
+ static int OnScriptLoaded(lua_State *L);
+ static int OnScriptUnload(lua_State *L);
+
static int HookEventObjParam(void *obj, WPARAM wParam, LPARAM lParam, LPARAM param);
};