diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2016-01-02 16:22:17 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2016-01-02 16:22:17 +0000 |
commit | a2aebf5ed9356abdbd341bf112f2c4b0933fbe3c (patch) | |
tree | fcf5c48a5f5f2969602d5e75d534f10327f22484 /plugins/MirLua/src | |
parent | b544097135831f24da3d6b11211d19e9536005f0 (diff) |
MirLua: time to break backward compatibility
git-svn-id: http://svn.miranda-ng.org/main/trunk@15994 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirLua/src')
-rw-r--r-- | plugins/MirLua/src/m_database.cpp | 162 | ||||
-rw-r--r-- | plugins/MirLua/src/m_message.cpp | 55 | ||||
-rw-r--r-- | plugins/MirLua/src/m_msg_buttonsbar.cpp | 77 | ||||
-rw-r--r-- | plugins/MirLua/src/m_protocols.cpp | 241 | ||||
-rw-r--r-- | plugins/MirLua/src/m_toptoolbar.cpp | 23 | ||||
-rw-r--r-- | plugins/MirLua/src/version.h | 4 |
6 files changed, 34 insertions, 528 deletions
diff --git a/plugins/MirLua/src/m_database.cpp b/plugins/MirLua/src/m_database.cpp index 84169b3cd7..192997920c 100644 --- a/plugins/MirLua/src/m_database.cpp +++ b/plugins/MirLua/src/m_database.cpp @@ -107,54 +107,6 @@ static int lua_GetLastEvent(lua_State *L) return 1;
}
-static int lua_GetEvent(lua_State *L)
-{
- ObsoleteMethod(L, "Use totable(x, \"DBEVENTINFO\") instead");
-
- MEVENT hEvent = luaL_checkinteger(L, 1);
-
- DBEVENTINFO dbei = { sizeof(DBEVENTINFO) };
- dbei.cbBlob = db_event_getBlobSize(hEvent);
- dbei.pBlob = (PBYTE)mir_calloc(dbei.cbBlob);
-
- int res = ::db_event_get(hEvent, &dbei);
- if (res)
- {
- lua_pushnil(L);
- return 1;
- }
-
- lua_newtable(L);
- lua_pushliteral(L, "Module");
- lua_pushstring(L, ptrA(mir_utf8encode(dbei.szModule)));
- lua_settable(L, -3);
- lua_pushliteral(L, "Timestamp");
- lua_pushnumber(L, dbei.timestamp);
- lua_settable(L, -3);
- lua_pushliteral(L, "Type");
- lua_pushinteger(L, dbei.eventType);
- lua_settable(L, -3);
- lua_pushliteral(L, "Flags");
- lua_pushinteger(L, dbei.flags);
- lua_settable(L, -3);
- lua_pushliteral(L, "Length");
- lua_pushnumber(L, dbei.cbBlob);
- lua_settable(L, -3);
- lua_pushliteral(L, "Blob");
- lua_newtable(L);
- for (DWORD i = 0; i < dbei.cbBlob; i++)
- {
- lua_pushinteger(L, i + 1);
- lua_pushinteger(L, dbei.pBlob[i]);
- lua_settable(L, -3);
- }
- lua_settable(L, -3);
-
- mir_free(dbei.pBlob);
-
- return 1;
-}
-
static int lua_EventIterator(lua_State *L)
{
MCONTACT hContact = luaL_checkinteger(L, lua_upvalueindex(1));
@@ -331,47 +283,6 @@ static int lua_Settings(lua_State *L) return 1;
}
-static int lua_EnumSettings(lua_State *L)
-{
- ObsoleteMethod(L, "Use \"for x in db.AllSettings \" instead");
-
- LPCSTR szModule = luaL_checkstring(L, 1);
- MCONTACT hContact = lua_tointeger(L, 2);
-
- if (!lua_isfunction(L, 3))
- {
- lua_pushlightuserdata(L, NULL);
- return 1;
- }
-
- lua_pushvalue(L, 3);
- int ref = luaL_ref(L, LUA_REGISTRYINDEX);
-
- enumDBSettingsParam param = { 0, NULL };
-
- DBCONTACTENUMSETTINGS dbces = { 0 };
- dbces.pfnEnumProc = SettingsEnumProc;
- dbces.szModule = szModule;
- dbces.ofsSettings = 0;
- dbces.lParam = (LPARAM)¶m;
- INT_PTR res = ::CallService(MS_DB_CONTACT_ENUMSETTINGS, hContact, (LPARAM)&dbces);
-
- for (int i = 0; i < param.count; i++)
- {
- lua_rawgeti(L, LUA_REGISTRYINDEX, ref);
- lua_pushstring(L, mir_utf8encode(param.pszSettingName[i]));
- luaM_pcall(L, 1, 0);
-
- mir_free(param.pszSettingName[i]);
- }
- mir_free(param.pszSettingName);
-
- luaL_unref(L, LUA_REGISTRYINDEX, ref);
- lua_pushinteger(L, res);
-
- return 1;
-}
-
static int lua_WriteSetting(lua_State *L)
{
MCONTACT hContact = lua_tointeger(L, 1);
@@ -480,70 +391,6 @@ static int SettingsChangedHookEventObjParam(void *obj, WPARAM wParam, LPARAM lPa return res;
}
-static int lua_OnSettingChanged(lua_State *L)
-{
- ObsoleteMethod(L, "Use m.HookEvent instead");
-
- if (!lua_isfunction(L, 1))
- {
- lua_pushlightuserdata(L, NULL);
- return 1;
- }
-
- lua_pushvalue(L, 1);
- int ref = luaL_ref(L, LUA_REGISTRYINDEX);
-
- HANDLE res = ::HookEventObjParam(ME_DB_CONTACT_SETTINGCHANGED, SettingsChangedHookEventObjParam, L, ref);
- lua_pushlightuserdata(L, res);
-
- CMLua::HookRefs.insert(new HandleRefParam(L, res, ref));
-
- return 1;
-}
-
-static int lua_DecodeDBCONTACTWRITESETTING(lua_State *L)
-{
- ObsoleteMethod(L, "Use totable(x, \"DBCONTACTWRITESETTING\") instead");
-
- DBCONTACTWRITESETTING *pDBCWS = (DBCONTACTWRITESETTING*)lua_tointeger(L, 1);
-
- lua_newtable(L);
- lua_pushliteral(L, "Module");
- lua_pushstring(L, pDBCWS->szModule);
- lua_settable(L, -3);
- lua_pushliteral(L, "Setting");
- lua_pushstring(L, pDBCWS->szSetting);
- lua_settable(L, -3);
- lua_pushliteral(L, "Value");
- switch (pDBCWS->value.type)
- {
- case DBVT_BYTE:
- lua_pushinteger(L, pDBCWS->value.bVal);
- break;
- case DBVT_WORD:
- lua_pushinteger(L, pDBCWS->value.wVal);
- break;
- case DBVT_DWORD:
- lua_pushnumber(L, pDBCWS->value.dVal);
- break;
- case DBVT_ASCIIZ:
- lua_pushstring(L, ptrA(mir_utf8encode(pDBCWS->value.pszVal)));
- break;
- case DBVT_UTF8:
- lua_pushstring(L, pDBCWS->value.pszVal);
- break;
- case DBVT_WCHAR:
- lua_pushstring(L, ptrA(mir_utf8encodeW(pDBCWS->value.pwszVal)));
- break;
- default:
- lua_pushvalue(L, 4);
- return 1;
- }
- lua_settable(L, -3);
-
- return 1;
-}
-
static luaL_Reg databaseApi[] =
{
{ "FindFirstContact", lua_FindFirstContact },
@@ -562,8 +409,6 @@ static luaL_Reg databaseApi[] = { "AllEventsFromEnd", lua_EventsFromEnd },
{ "EventsFromEnd", lua_EventsFromEnd },
- { "GetEvent", lua_GetEvent },
-
{ "WriteContactSetting", lua_WriteSetting },
{ "WriteSetting", lua_WriteSetting },
@@ -571,16 +416,11 @@ static luaL_Reg databaseApi[] = { "GetSetting", lua_GetSetting },
{ "AllSettings", lua_Settings },
{ "Settings", lua_Settings },
- { "EnumSettings", lua_EnumSettings },
{ "DeleteContactSetting", lua_DeleteSetting },
{ "DeleteSetting", lua_DeleteSetting },
{ "DeleteModule", lua_DeleteModule },
- { "OnContactSettingChanged", lua_OnSettingChanged },
- { "OnSettingChanged", lua_OnSettingChanged },
- { "DecodeDBCONTACTWRITESETTING", lua_DecodeDBCONTACTWRITESETTING },
-
{ NULL, NULL }
};
@@ -689,7 +529,7 @@ static int ci__init(lua_State *L) udata = (MCONTACT)lua_touserdata(L, 1);
break;
default:
- const char *msg = lua_pushfstring(L, "hContact expected, got %s", lua_typename(L, lua_type(L, 1))); + const char *msg = lua_pushfstring(L, "hContact expected, got %s", lua_typename(L, lua_type(L, 1)));
luaL_argerror(L, 1, msg);
}
diff --git a/plugins/MirLua/src/m_message.cpp b/plugins/MirLua/src/m_message.cpp index 933160dea1..444963f640 100644 --- a/plugins/MirLua/src/m_message.cpp +++ b/plugins/MirLua/src/m_message.cpp @@ -68,66 +68,11 @@ static int lua_Send(lua_State *L) return 1;
}
-int MsgWindowEventHookEventObjParam(void *obj, WPARAM wParam, LPARAM lParam, LPARAM param)
-{
- lua_State *L = (lua_State*)obj;
-
- int ref = param;
- lua_rawgeti(L, LUA_REGISTRYINDEX, ref);
-
- lua_pushnumber(L, wParam);
-
- MessageWindowEventData *ev = (MessageWindowEventData*)lParam;
-
- lua_newtable(L);
- lua_pushliteral(L, "Module");
- lua_pushstring(L, ptrA(mir_utf8encode(ev->szModule)));
- lua_settable(L, -3);
- lua_pushliteral(L, "Type");
- lua_pushinteger(L, ev->uType);
- lua_settable(L, -3);
- lua_pushliteral(L, "hContact");
- lua_pushinteger(L, ev->hContact);
- lua_settable(L, -3);
- lua_pushliteral(L, "Flags");
- lua_pushinteger(L, ev->uFlags);
- lua_settable(L, -3);
-
- luaM_pcall(L, 2, 1);
-
- int res = (int)lua_tointeger(L, 1);
-
- return res;
-}
-
-static int lua_OnMsgWindowEvent(lua_State *L)
-{
- ObsoleteMethod(L, "Use m.HookEvent instead");
-
- if (!lua_isfunction(L, 1))
- {
- lua_pushlightuserdata(L, NULL);
- return 1;
- }
-
- lua_pushvalue(L, 1);
- int ref = luaL_ref(L, LUA_REGISTRYINDEX);
-
- HANDLE res = ::HookEventObjParam(ME_MSG_WINDOWEVENT, MsgWindowEventHookEventObjParam, L, ref);
- lua_pushlightuserdata(L, res);
-
- CMLua::HookRefs.insert(new HandleRefParam(L, res, ref));
-
- return 1;
-}
-
static luaL_Reg messageApi[] =
{
{ "Paste", lua_Paste },
{ "Send", lua_Send },
- { "OnMsgWindowEvent", lua_OnMsgWindowEvent },
-
{ NULL, NULL }
};
diff --git a/plugins/MirLua/src/m_msg_buttonsbar.cpp b/plugins/MirLua/src/m_msg_buttonsbar.cpp index b4b4e42800..103b0d6624 100644 --- a/plugins/MirLua/src/m_msg_buttonsbar.cpp +++ b/plugins/MirLua/src/m_msg_buttonsbar.cpp @@ -124,89 +124,12 @@ static int lua_RemoveButton(lua_State *L) return 1;
}
-int ButtonPressedHookEventObjParam(void *obj, WPARAM wParam, LPARAM lParam, LPARAM param)
-{
- lua_State *L = (lua_State*)obj;
-
- int ref = param;
- lua_rawgeti(L, LUA_REGISTRYINDEX, ref);
-
- lua_pushnumber(L, wParam);
-
- CustomButtonClickData *bcd = (CustomButtonClickData*)lParam;
-
- lua_newtable(L);
- lua_pushliteral(L, "Module");
- lua_pushstring(L, ptrA(mir_utf8encode(bcd->pszModule)));
- lua_settable(L, -3);
- lua_pushliteral(L, "ButtonID");
- lua_pushinteger(L, bcd->dwButtonId);
- lua_settable(L, -3);
- lua_pushliteral(L, "hContact");
- lua_pushinteger(L, bcd->hContact);
- lua_settable(L, -3);
- lua_pushliteral(L, "Flags");
- lua_pushinteger(L, bcd->flags);
- lua_settable(L, -3);
-
- luaM_pcall(L, 2, 1);
-
- int res = (int)lua_tointeger(L, 1);
-
- return res;
-}
-
-static int lua_OnMsgToolBarButtonPressed(lua_State *L)
-{
- ObsoleteMethod(L, "Use m.HookEvent instead");
-
- if (!lua_isfunction(L, 1))
- {
- lua_pushlightuserdata(L, NULL);
- return 1;
- }
-
- lua_pushvalue(L, 1);
- int ref = luaL_ref(L, LUA_REGISTRYINDEX);
-
- HANDLE res = ::HookEventObjParam(ME_MSG_BUTTONPRESSED, ButtonPressedHookEventObjParam, L, ref);
- lua_pushlightuserdata(L, res);
-
- CMLua::HookRefs.insert(new HandleRefParam(L, res, ref));
-
- return 1;
-}
-
-static int lua_DecodeCustomButtonClickData(lua_State *L)
-{
- CustomButtonClickData *bcd = (CustomButtonClickData*)lua_tointeger(L, 1);
-
- lua_newtable(L);
- lua_pushliteral(L, "Module");
- lua_pushstring(L, ptrA(mir_utf8encode(bcd->pszModule)));
- lua_settable(L, -3);
- lua_pushliteral(L, "ButtonID");
- lua_pushinteger(L, bcd->dwButtonId);
- lua_settable(L, -3);
- lua_pushliteral(L, "hContact");
- lua_pushinteger(L, bcd->hContact);
- lua_settable(L, -3);
- lua_pushliteral(L, "Flags");
- lua_pushinteger(L, bcd->flags);
- lua_settable(L, -3);
-
- return 1;
-}
-
static luaL_Reg msgbuttinsbarApi[] =
{
{ "AddButton", lua_AddButton },
{ "ModifyButton", lua_ModifyButton },
{ "RemoveButton", lua_RemoveButton },
- { "OnMsgToolBarButtonPressed", lua_OnMsgToolBarButtonPressed },
- { "DecodeCustomButtonClickData", lua_DecodeCustomButtonClickData },
-
{ NULL, NULL }
};
diff --git a/plugins/MirLua/src/m_protocols.cpp b/plugins/MirLua/src/m_protocols.cpp index d9ab3022ca..f17d598b8d 100644 --- a/plugins/MirLua/src/m_protocols.cpp +++ b/plugins/MirLua/src/m_protocols.cpp @@ -2,22 +2,21 @@ HANDLE hRecvMessage = NULL;
-static void MapToTable(lua_State *L, const PROTOCOLDESCRIPTOR* pd)
-{
- lua_newtable(L);
- lua_pushliteral(L, "Name");
- lua_pushstring(L, ptrA(mir_utf8encode(pd->szName)));
- lua_settable(L, -3);
- lua_pushliteral(L, "Type");
- lua_pushinteger(L, pd->type);
- lua_settable(L, -3);
-}
-
static int lua_GetProtocol(lua_State *L)
{
- const char *name = luaL_checkstring(L, 1);
+ const char *name = NULL;
+
+ switch (lua_type(L, 1))
+ {
+ case LUA_TNUMBER:
+ name = GetContactProto(lua_tonumber(L, 1));
+ break;
+ case LUA_TSTRING:
+ name = lua_tostring(L, 1);
+ break;
+ }
- PROTOCOLDESCRIPTOR *pd = ::Proto_IsProtocolLoaded(ptrA(mir_utf8decodeA(name)));
+ PROTOCOLDESCRIPTOR *pd = Proto_IsProtocolLoaded(name);
if (pd)
MT<PROTOCOLDESCRIPTOR>::Set(L, pd);
else
@@ -58,67 +57,23 @@ static int lua_Protocols(lua_State *L) return 1;
}
-static int lua_EnumProtos(lua_State *L)
-{
- ObsoleteMethod(L, "Use \"for x in protos.AllProtos \" instead");
-
- if (!lua_isfunction(L, 1))
- {
- lua_pushlightuserdata(L, NULL);
- return 1;
- }
-
- lua_pushvalue(L, 1);
- int ref = luaL_ref(L, LUA_REGISTRYINDEX);
+/***********************************************/
- int count;
- PROTOCOLDESCRIPTOR** protos;
- Proto_EnumProtocols(&count, &protos);
+static int lua_GetAccount(lua_State *L)
+{
+ const char *name = NULL;
- for (int i = 0; i < count; i++)
+ switch (lua_type(L, 1))
{
- lua_rawgeti(L, LUA_REGISTRYINDEX, ref);
- MapToTable(L, protos[i]);
- luaM_pcall(L, 1, 0);
+ case LUA_TNUMBER:
+ name = GetContactProto(lua_tonumber(L, 1));
+ break;
+ case LUA_TSTRING:
+ name = lua_tostring(L, 1);
+ break;
}
- luaL_unref(L, LUA_REGISTRYINDEX, ref);
- lua_pushinteger(L, count);
-
- return 1;
-}
-
-static void MapToTable(lua_State *L, const PROTOACCOUNT* pa)
-{
- lua_newtable(L);
- lua_pushliteral(L, "ModuleName");
- lua_pushstring(L, ptrA(mir_utf8encode(pa->szModuleName)));
- lua_settable(L, -3);
- lua_pushliteral(L, "AccountName");
- lua_pushstring(L, ptrA(mir_utf8encodeT(pa->tszAccountName)));
- lua_settable(L, -3);
- lua_pushliteral(L, "ProtoName");
- lua_pushstring(L, ptrA(mir_utf8encode(pa->szProtoName)));
- lua_settable(L, -3);
- lua_pushliteral(L, "IsEnabled");
- lua_pushboolean(L, pa->bIsEnabled);
- lua_settable(L, -3);
- lua_pushliteral(L, "IsVisible");
- lua_pushboolean(L, pa->bIsVisible);
- lua_settable(L, -3);
- lua_pushliteral(L, "IsVirtual");
- lua_pushboolean(L, pa->bIsVirtual);
- lua_settable(L, -3);
- lua_pushliteral(L, "IsOldProto");
- lua_pushboolean(L, pa->bOldProto);
- lua_settable(L, -3);
-}
-
-static int lua_GetAccount(lua_State *L)
-{
- ptrA moduleName(mir_utf8decodeA(luaL_checkstring(L, 1)));
-
- PROTOACCOUNT* pa = ::Proto_GetAccount(moduleName);
+ PROTOACCOUNT* pa = Proto_GetAccount(name);
if (pa)
MT<PROTOACCOUNT>::Set(L, pa);
else
@@ -159,142 +114,7 @@ static int lua_Accounts(lua_State *L) return 1;
}
-static int lua_EnumAccounts(lua_State *L)
-{
- ObsoleteMethod(L, "Use \"for x in protos.AllAccounts \" instead");
-
- if (!lua_isfunction(L, 1))
- {
- lua_pushlightuserdata(L, NULL);
- return 1;
- }
-
- lua_pushvalue(L, 1);
- int ref = luaL_ref(L, LUA_REGISTRYINDEX);
-
- int count;
- PROTOACCOUNT** accounts;
- Proto_EnumAccounts(&count, &accounts);
-
- for (int i = 0; i < count; i++)
- {
- lua_rawgeti(L, LUA_REGISTRYINDEX, ref);
- MapToTable(L, accounts[i]);
- luaM_pcall(L, 1, 0);
- }
-
- luaL_unref(L, LUA_REGISTRYINDEX, ref);
- lua_pushinteger(L, count);
-
- return 1;
-}
-
-int ProtoAckHookEventObjParam(void *obj, WPARAM wParam, LPARAM lParam, LPARAM param)
-{
- lua_State *L = (lua_State*)obj;
-
- int ref = param;
- lua_rawgeti(L, LUA_REGISTRYINDEX, ref);
-
- lua_pushnumber(L, wParam);
-
- ACKDATA *ack = (ACKDATA*)lParam;
-
- lua_newtable(L);
- lua_pushliteral(L, "Module");
- lua_pushstring(L, ptrA(mir_utf8encode(ack->szModule)));
- lua_settable(L, -3);
- lua_pushliteral(L, "hContact");
- lua_pushinteger(L, ack->hContact);
- lua_settable(L, -3);
- lua_pushliteral(L, "Type");
- lua_pushinteger(L, ack->type);
- lua_settable(L, -3);
- lua_pushliteral(L, "Result");
- lua_pushinteger(L, ack->result);
- lua_settable(L, -3);
- lua_pushliteral(L, "hProcess");
- lua_pushlightuserdata(L, ack->hProcess);
- lua_settable(L, -3);
- lua_pushliteral(L, "lParam");
- lua_pushnumber(L, ack->lParam);
- lua_settable(L, -3);
-
- luaM_pcall(L, 2, 1);
-
- int res = (int)lua_tointeger(L, 1);
-
- return res;
-}
-
-static int lua_OnProtoAck(lua_State *L)
-{
- ObsoleteMethod(L, "Use m.HookEvent instead");
-
- if (!lua_isfunction(L, 1))
- {
- lua_pushlightuserdata(L, NULL);
- return 1;
- }
-
- lua_pushvalue(L, 1);
- int ref = luaL_ref(L, LUA_REGISTRYINDEX);
-
- HANDLE res = ::HookEventObjParam(ME_PROTO_ACK, ProtoAckHookEventObjParam, L, ref);
- lua_pushlightuserdata(L, res);
-
- CMLua::HookRefs.insert(new HandleRefParam(L, res, ref));
-
- return 1;
-}
-
-int RecvMessageHookEventObjParam(void *obj, WPARAM wParam, LPARAM lParam, LPARAM param)
-{
- lua_State *L = (lua_State*)obj;
-
- int ref = param;
- lua_rawgeti(L, LUA_REGISTRYINDEX, ref);
-
- lua_pushnumber(L, wParam);
-
- CCSDATA *ccs = (CCSDATA*)lParam;
- PROTORECVEVENT *pre = (PROTORECVEVENT*)ccs->lParam;
-
- lua_newtable(L);
- lua_pushliteral(L, "hContact");
- lua_pushinteger(L, ccs->hContact);
- lua_settable(L, -3);
- lua_pushliteral(L, "Message");
- lua_pushstring(L, pre->szMessage);
- lua_settable(L, -3);
-
- luaM_pcall(L, 2, 1);
-
- int res = (int)lua_tointeger(L, 1);
-
- return res;
-}
-
-static int lua_OnReceiveMessage(lua_State *L)
-{
- ObsoleteMethod(L, "Use m.HookEvent instead");
-
- if (!lua_isfunction(L, 1))
- {
- lua_pushlightuserdata(L, NULL);
- return 1;
- }
-
- lua_pushvalue(L, 1);
- int ref = luaL_ref(L, LUA_REGISTRYINDEX);
-
- HANDLE res = ::HookEventObjParam(MODULE PSR_MESSAGE, RecvMessageHookEventObjParam, L, ref);
- lua_pushlightuserdata(L, res);
-
- CMLua::HookRefs.insert(new HandleRefParam(L, res, ref));
-
- return 1;
-}
+/***********************************************/
INT_PTR FilterRecvMessage(WPARAM wParam, LPARAM lParam)
{
@@ -303,6 +123,8 @@ INT_PTR FilterRecvMessage(WPARAM wParam, LPARAM lParam) return Proto_ChainRecv(wParam, (CCSDATA*)lParam);
}
+/***********************************************/
+
static luaL_Reg protocolsApi[] =
{
{ "GetProto", lua_GetProtocol },
@@ -310,19 +132,16 @@ static luaL_Reg protocolsApi[] = { "AllProtos", lua_Protocols },
{ "AllProtocols", lua_Protocols },
{ "Protocols", lua_Protocols },
- { "EnumProtos", lua_EnumProtos },
{ "GetAccount", lua_GetAccount },
{ "AllAccounts", lua_Accounts },
{ "Accounts", lua_Accounts },
- { "EnumAccounts", lua_EnumAccounts },
-
- { "OnProtoAck", lua_OnProtoAck },
- { "OnReceiveMessage", lua_OnReceiveMessage },
{ NULL, NULL }
};
+/***********************************************/
+
#define MT_CCSDATA "CCSDATA"
static int ccs__init(lua_State *L)
@@ -367,6 +186,8 @@ static luaL_Reg ccsMeta[] = { NULL, NULL }
};
+/***********************************************/
+
LUAMOD_API int luaopen_m_protocols(lua_State *L)
{
luaL_newlib(L, protocolsApi);
diff --git a/plugins/MirLua/src/m_toptoolbar.cpp b/plugins/MirLua/src/m_toptoolbar.cpp index b990dcf8e0..f53f728774 100644 --- a/plugins/MirLua/src/m_toptoolbar.cpp +++ b/plugins/MirLua/src/m_toptoolbar.cpp @@ -114,34 +114,11 @@ static int lua_RemoveButton(lua_State *L) return 1;
}
-static int lua_OnTopToolBarLoaded(lua_State *L)
-{
- ObsoleteMethod(L, "Use m.HookEvent instead");
-
- if (!lua_isfunction(L, 1))
- {
- lua_pushlightuserdata(L, NULL);
- return 1;
- }
-
- lua_pushvalue(L, 1);
- int ref = luaL_ref(L, LUA_REGISTRYINDEX);
-
- HANDLE res = ::HookEventObjParam(ME_TTB_MODULELOADED, CMLua::HookEventObjParam, L, ref);
- lua_pushlightuserdata(L, res);
-
- CMLua::HookRefs.insert(new HandleRefParam(L, res, ref));
-
- return 1;
-}
-
static luaL_Reg toptoolbarApi[] =
{
{ "AddButton", lua_AddButton },
{ "RemoveButton", lua_RemoveButton },
- { "OnTopToolBarLoaded", lua_OnTopToolBarLoaded },
-
{ NULL, NULL }
};
diff --git a/plugins/MirLua/src/version.h b/plugins/MirLua/src/version.h index d9b5285e08..349cf71ead 100644 --- a/plugins/MirLua/src/version.h +++ b/plugins/MirLua/src/version.h @@ -1,7 +1,7 @@ #define __MAJOR_VERSION 0
#define __MINOR_VERSION 11
-#define __RELEASE_NUM 5
-#define __BUILD_NUM 1
+#define __RELEASE_NUM 6
+#define __BUILD_NUM 0
#include <stdver.h>
|