summaryrefslogtreecommitdiff
path: root/plugins/MirLua/src/m_icolib.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2016-01-07 10:42:38 +0000
committerAlexander Lantsev <aunsane@gmail.com>2016-01-07 10:42:38 +0000
commit6a6a1d097e043dba142d5cdc485e6b4dbe67e12a (patch)
tree8b4700b62e3569fcc0906bf75bf79894dd1623e0 /plugins/MirLua/src/m_icolib.cpp
parent2742e2cfa0b0c32cbfc30e551f9ffaca29aa8aa9 (diff)
MirLua:
- added script cache on load - refactoring git-svn-id: http://svn.miranda-ng.org/main/trunk@16044 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirLua/src/m_icolib.cpp')
-rw-r--r--plugins/MirLua/src/m_icolib.cpp23
1 files changed, 10 insertions, 13 deletions
diff --git a/plugins/MirLua/src/m_icolib.cpp b/plugins/MirLua/src/m_icolib.cpp
index eea44838d4..de5195341d 100644
--- a/plugins/MirLua/src/m_icolib.cpp
+++ b/plugins/MirLua/src/m_icolib.cpp
@@ -1,6 +1,6 @@
#include "stdafx.h"
-static int lua_AddIcon(lua_State *L)
+static int icolib_AddIcon(lua_State *L)
{
const char *name = luaL_checkstring(L, 1);
ptrT description(mir_utf8decodeT(luaL_checkstring(L, 2)));
@@ -21,40 +21,37 @@ static int lua_AddIcon(lua_State *L)
si.defaultFile.t = filePath;
si.hDefaultIcon = GetIcon(IDI_SCRIPT);
- HANDLE res = ::IcoLib_AddIcon(&si, hScriptsLangpack);
+ HANDLE res = IcoLib_AddIcon(&si, g_mLua->GetHLangpack());
lua_pushlightuserdata(L, res);
return 1;
}
-static int lua_GetIcon(lua_State *L)
+static int icolib_GetIcon(lua_State *L)
{
const char *name = luaL_checkstring(L, 1);
- HANDLE res = ::IcoLib_GetIconHandle(name);
+ HANDLE res = IcoLib_GetIconHandle(name);
lua_pushlightuserdata(L, res);
return 1;
}
-static int lua_RemoveIcon(lua_State *L)
+static int icolib_RemoveIcon(lua_State *L)
{
if (lua_isuserdata(L, 1))
- ::IcoLib_RemoveIconByHandle(lua_touserdata(L, 1));
+ IcoLib_RemoveIconByHandle(lua_touserdata(L, 1));
else if (lua_isstring(L, 1))
- ::IcoLib_RemoveIcon(luaL_checkstring(L, 1));
+ IcoLib_RemoveIcon(luaL_checkstring(L, 1));
return 0;
}
static luaL_Reg icolibApi[] =
{
- { "AddIcon", lua_AddIcon },
- { "Add", lua_AddIcon },
- { "GetIcon", lua_GetIcon },
- { "Get", lua_GetIcon },
- { "RemoveIcon", lua_RemoveIcon },
- { "Remove", lua_RemoveIcon },
+ { "AddIcon", icolib_AddIcon },
+ { "GetIcon", icolib_GetIcon },
+ { "RemoveIcon", icolib_RemoveIcon },
{ NULL, NULL }
};