summaryrefslogtreecommitdiff
path: root/plugins/MirLua/src
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/MirLua/src')
-rw-r--r--plugins/MirLua/src/m_core.cpp2
-rw-r--r--plugins/MirLua/src/m_genmenu.cpp2
-rw-r--r--plugins/MirLua/src/m_icolib.cpp8
-rw-r--r--plugins/MirLua/src/m_options.cpp12
-rw-r--r--plugins/MirLua/src/main.cpp4
-rw-r--r--plugins/MirLua/src/mlua.cpp2
-rw-r--r--plugins/MirLua/src/mlua_icons.cpp14
-rw-r--r--plugins/MirLua/src/mlua_options.cpp14
-rw-r--r--plugins/MirLua/src/mlua_script.cpp12
-rw-r--r--plugins/MirLua/src/mlua_script.h10
-rw-r--r--plugins/MirLua/src/mlua_script_loader.cpp8
-rw-r--r--plugins/MirLua/src/mlua_script_loader.h2
12 files changed, 45 insertions, 45 deletions
diff --git a/plugins/MirLua/src/m_core.cpp b/plugins/MirLua/src/m_core.cpp
index 4c2b6e7a38..27d4cc7714 100644
--- a/plugins/MirLua/src/m_core.cpp
+++ b/plugins/MirLua/src/m_core.cpp
@@ -296,7 +296,7 @@ static int core_Parse(lua_State *L)
static int core_GetFullPath(lua_State *L)
{
- TCHAR path[MAX_PATH];
+ wchar_t path[MAX_PATH];
GetModuleFileName(NULL, path, MAX_PATH);
lua_pushstring(L, ptrA(mir_utf8encodeT(path)));
diff --git a/plugins/MirLua/src/m_genmenu.cpp b/plugins/MirLua/src/m_genmenu.cpp
index 64540804a0..78ed5343d6 100644
--- a/plugins/MirLua/src/m_genmenu.cpp
+++ b/plugins/MirLua/src/m_genmenu.cpp
@@ -18,7 +18,7 @@ void MakeMenuItem(lua_State *L, CMenuItem &mi)
lua_pop(L, 1);
lua_getfield(L, -1, "Name");
- mi.name.t = mir_utf8decodeT(luaL_checkstring(L, -1));
+ mi.name.w = mir_utf8decodeT(luaL_checkstring(L, -1));
lua_pop(L, 1);
lua_getfield(L, -1, "Position");
diff --git a/plugins/MirLua/src/m_icolib.cpp b/plugins/MirLua/src/m_icolib.cpp
index 019d1ccf25..8827cc749c 100644
--- a/plugins/MirLua/src/m_icolib.cpp
+++ b/plugins/MirLua/src/m_icolib.cpp
@@ -9,16 +9,16 @@ static int icolib_AddIcon(lua_State *L)
if (filePath == NULL)
{
- filePath = (TCHAR*)mir_calloc(MAX_PATH + 1);
+ filePath = (wchar_t*)mir_calloc(MAX_PATH + 1);
GetModuleFileName(g_hInstance, filePath, MAX_PATH);
}
SKINICONDESC si = { 0 };
si.flags = SIDF_ALL_TCHAR;
si.pszName = mir_utf8decodeA(name);
- si.description.t = description;
- si.section.t = section;
- si.defaultFile.t = filePath;
+ si.description.w = description;
+ si.section.w = section;
+ si.defaultFile.w = filePath;
si.hDefaultIcon = GetIcon(IDI_SCRIPT);
int hScriptLangpack = CMLuaScript::GetScriptIdFromEnviroment(L);
diff --git a/plugins/MirLua/src/m_options.cpp b/plugins/MirLua/src/m_options.cpp
index 149403ee44..d67106d247 100644
--- a/plugins/MirLua/src/m_options.cpp
+++ b/plugins/MirLua/src/m_options.cpp
@@ -54,15 +54,15 @@ void MakeOptionDialogPage(lua_State *L, OPTIONSDIALOGPAGE &odp)
odp.flags |= ODPF_TCHAR;
lua_getfield(L, -1, "Group");
- odp.ptszGroup = mir_utf8decodeT(lua_tostring(L, -1));
+ odp.pwszGroup = mir_utf8decodeT(lua_tostring(L, -1));
lua_pop(L, 1);
lua_getfield(L, -1, "Title");
- odp.ptszTitle = mir_utf8decodeT(luaL_checkstring(L, -1));
+ odp.pwszTitle = mir_utf8decodeT(luaL_checkstring(L, -1));
lua_pop(L, 1);
lua_getfield(L, -1, "Tab");
- odp.ptszTab = mir_utf8decodeT(lua_tostring(L, -1));
+ odp.pwszTab = mir_utf8decodeT(lua_tostring(L, -1));
lua_pop(L, 1);
int onInitDialogRef = LUA_NOREF;
@@ -95,9 +95,9 @@ int opt_AddPage(lua_State *L)
INT_PTR res = Options_AddPage(wParam, &odp);
lua_pushboolean(L, !res);
- mir_free(odp.ptszGroup);
- mir_free(odp.ptszTitle);
- mir_free(odp.ptszTab);
+ mir_free(odp.pwszGroup);
+ mir_free(odp.pwszTitle);
+ mir_free(odp.pwszTab);
return 1;
}
diff --git a/plugins/MirLua/src/main.cpp b/plugins/MirLua/src/main.cpp
index 49b50190fd..ce2d3aa589 100644
--- a/plugins/MirLua/src/main.cpp
+++ b/plugins/MirLua/src/main.cpp
@@ -62,8 +62,8 @@ extern "C" int __declspec(dllexport) Load(void)
NETLIBUSER nlu = { 0 };
nlu.cbSize = sizeof(nlu);
- nlu.flags = NUF_NOOPTIONS | NUF_UNICODE;
- nlu.ptszDescriptiveName = _T(MODULE);
+ nlu.flags = NUF_NOOPTIONS;
+ nlu.szDescriptiveName = MODULE;
nlu.szSettingsModule = MODULE;
hNetlib = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
diff --git a/plugins/MirLua/src/mlua.cpp b/plugins/MirLua/src/mlua.cpp
index 2c67f32f3e..5386f364d1 100644
--- a/plugins/MirLua/src/mlua.cpp
+++ b/plugins/MirLua/src/mlua.cpp
@@ -23,7 +23,7 @@ CMLua::~CMLua()
void CMLua::SetPaths()
{
- TCHAR path[MAX_PATH];
+ wchar_t path[MAX_PATH];
lua_getglobal(L, "package");
diff --git a/plugins/MirLua/src/mlua_icons.cpp b/plugins/MirLua/src/mlua_icons.cpp
index 175e5c62e8..92bcd1dcd5 100644
--- a/plugins/MirLua/src/mlua_icons.cpp
+++ b/plugins/MirLua/src/mlua_icons.cpp
@@ -1,17 +1,17 @@
#include "stdafx.h"
-IconItemT Icons[] =
+IconItem Icons[] =
{
- { LPGENT("Script"), "script", IDI_SCRIPT },
- { LPGENT("Loaded"), "loaded", IDI_LOADED },
- { LPGENT("Failed"), "failed", IDI_FAILED },
- { LPGENT("Open"), "open", IDI_OPEN },
- { LPGENT("Reload"), "reload", IDI_RELOAD },
+ { LPGEN("Script"), "script", IDI_SCRIPT },
+ { LPGEN("Loaded"), "loaded", IDI_LOADED },
+ { LPGEN("Failed"), "failed", IDI_FAILED },
+ { LPGEN("Open"), "open", IDI_OPEN },
+ { LPGEN("Reload"), "reload", IDI_RELOAD },
};
void InitIcons()
{
- Icon_RegisterT(g_hInstance, LPGENT(MODULE), Icons, _countof(Icons), MODULE);
+ Icon_Register(g_hInstance, MODULE, Icons, _countof(Icons), MODULE);
}
HICON GetIcon(int iconId)
diff --git a/plugins/MirLua/src/mlua_options.cpp b/plugins/MirLua/src/mlua_options.cpp
index 6714d7ebed..cc902165d6 100644
--- a/plugins/MirLua/src/mlua_options.cpp
+++ b/plugins/MirLua/src/mlua_options.cpp
@@ -37,7 +37,7 @@ void CMLuaOptions::LoadScripts()
for (int i = 0; i < g_mLua->Scripts.getCount(); i++)
{
CMLuaScript *script = g_mLua->Scripts[i];
- TCHAR *fileName = NEWTSTR_ALLOCA(script->GetFileName());
+ wchar_t *fileName = NEWWSTR_ALLOCA(script->GetFileName());
int iIcon = script->GetStatus() - 1;
int iItem = m_scripts.AddItem(fileName, iIcon, (LPARAM)script);
if (db_get_b(NULL, MODULE, _T2A(fileName), 1))
@@ -59,7 +59,7 @@ void CMLuaOptions::OnInitDialog()
ImageList_AddIcon(hImageList, GetIcon(IDI_OPEN));
ImageList_AddIcon(hImageList, GetIcon(IDI_RELOAD));
- TCHAR scriptDir[MAX_PATH], relativeScriptDir[MAX_PATH], header[MAX_PATH + 100];
+ wchar_t scriptDir[MAX_PATH], relativeScriptDir[MAX_PATH], header[MAX_PATH + 100];
FoldersGetCustomPathT(g_hScriptsFolder, scriptDir, _countof(scriptDir), VARST(MIRLUA_PATHT));
PathToRelativeT(scriptDir, relativeScriptDir, NULL);
mir_sntprintf(header, L"%s (%s)", TranslateT("Common scripts"), relativeScriptDir);
@@ -78,7 +78,7 @@ void CMLuaOptions::OnApply()
int count = m_scripts.GetItemCount();
for (int iItem = 0; iItem < count; iItem++)
{
- TCHAR fileName[MAX_PATH];
+ wchar_t fileName[MAX_PATH];
m_scripts.GetItemText(iItem, 0, fileName, _countof(fileName));
if (!m_scripts.GetCheckState(iItem))
db_set_b(NULL, MODULE, _T2A(fileName), 0);
@@ -115,7 +115,7 @@ void CMLuaOptions::OnScriptListClick(CCtrlListView::TEventInfo *evt)
LVITEM lvi = { 0 };
lvi.iItem = evt->nmlvia->iItem;
if (lvi.iItem == -1) return;
- lvi.pszText = (LPTSTR)mir_calloc(MAX_PATH * sizeof(TCHAR));
+ lvi.pszText = (LPTSTR)mir_calloc(MAX_PATH * sizeof(wchar_t));
lvi.cchTextMax = MAX_PATH;
lvi.mask = LVIF_GROUPID | LVIF_TEXT | LVIF_PARAM;
evt->treeviewctrl->GetItem(&lvi);
@@ -161,9 +161,9 @@ int CMLuaOptions::OnOptionsInit(WPARAM wParam, LPARAM)
OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = g_hInstance;
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE;
- odp.ptszGroup = LPGENT("Services");
- odp.ptszTitle = L"Lua";
- odp.ptszTab = LPGENT("Scripts");
+ odp.pwszGroup = LPGENW("Services");
+ odp.pwszTitle = L"Lua";
+ odp.pwszTab = LPGENW("Scripts");
odp.pDialog = CMLuaOptions::CreateOptionsPage();
Options_AddPage(wParam, &odp);
diff --git a/plugins/MirLua/src/mlua_script.cpp b/plugins/MirLua/src/mlua_script.cpp
index d36f93b7a8..b84c3d978e 100644
--- a/plugins/MirLua/src/mlua_script.cpp
+++ b/plugins/MirLua/src/mlua_script.cpp
@@ -2,17 +2,17 @@
#define SCRIPT "Script"
-CMLuaScript::CMLuaScript(lua_State *L, const TCHAR *path)
+CMLuaScript::CMLuaScript(lua_State *L, const wchar_t *path)
: L(L), status(None), unloadRef(LUA_NOREF)
{
mir_tstrcpy(filePath, path);
- fileName = _tcsrchr(filePath, '\\') + 1;
- TCHAR *dot = _tcsrchr(fileName, '.');
+ fileName = wcsrchr(filePath, '\\') + 1;
+ wchar_t *dot = wcsrchr(fileName, '.');
size_t length = mir_tstrlen(fileName) - mir_tstrlen(dot) + 1;
- ptrT name((TCHAR*)mir_calloc(sizeof(TCHAR) * (length + 1)));
+ ptrT name((wchar_t*)mir_calloc(sizeof(wchar_t) * (length + 1)));
mir_tstrncpy(name, fileName, length);
moduleName = mir_utf8encodeT(name);
@@ -76,12 +76,12 @@ const char* CMLuaScript::GetModuleName() const
return moduleName;
}
-const TCHAR* CMLuaScript::GetFilePath() const
+const wchar_t* CMLuaScript::GetFilePath() const
{
return filePath;
}
-const TCHAR* CMLuaScript::GetFileName() const
+const wchar_t* CMLuaScript::GetFileName() const
{
return fileName;
}
diff --git a/plugins/MirLua/src/mlua_script.h b/plugins/MirLua/src/mlua_script.h
index c466e16c20..042e78dadf 100644
--- a/plugins/MirLua/src/mlua_script.h
+++ b/plugins/MirLua/src/mlua_script.h
@@ -17,13 +17,13 @@ private:
int id;
int unloadRef;
char *moduleName;
- TCHAR *fileName;
- TCHAR filePath[MAX_PATH];
+ wchar_t *fileName;
+ wchar_t filePath[MAX_PATH];
Status status;
public:
- CMLuaScript(lua_State *L, const TCHAR *path);
+ CMLuaScript(lua_State *L, const wchar_t *path);
~CMLuaScript();
static CMLuaScript* GetScriptFromEnviroment(lua_State *L);
@@ -34,8 +34,8 @@ public:
const char* GetModuleName() const;
- const TCHAR* GetFilePath() const;
- const TCHAR* GetFileName() const;
+ const wchar_t* GetFilePath() const;
+ const wchar_t* GetFileName() const;
const Status GetStatus() const;
diff --git a/plugins/MirLua/src/mlua_script_loader.cpp b/plugins/MirLua/src/mlua_script_loader.cpp
index f95fdbfc78..a8efa32320 100644
--- a/plugins/MirLua/src/mlua_script_loader.cpp
+++ b/plugins/MirLua/src/mlua_script_loader.cpp
@@ -4,9 +4,9 @@ CMLuaScriptLoader::CMLuaScriptLoader(lua_State *L) : L(L)
{
}
-void CMLuaScriptLoader::LoadScript(const TCHAR *scriptDir, const TCHAR *file)
+void CMLuaScriptLoader::LoadScript(const wchar_t *scriptDir, const wchar_t *file)
{
- TCHAR fullPath[MAX_PATH], path[MAX_PATH];
+ wchar_t fullPath[MAX_PATH], path[MAX_PATH];
mir_sntprintf(fullPath, L"%s\\%s", scriptDir, file);
PathToRelativeT(fullPath, path);
@@ -25,12 +25,12 @@ void CMLuaScriptLoader::LoadScript(const TCHAR *scriptDir, const TCHAR *file)
void CMLuaScriptLoader::LoadScripts()
{
- TCHAR scriptDir[MAX_PATH];
+ wchar_t scriptDir[MAX_PATH];
FoldersGetCustomPathT(g_hScriptsFolder, scriptDir, _countof(scriptDir), VARST(MIRLUA_PATHT));
Log(L"Loading scripts from %s", scriptDir);
- TCHAR searchMask[MAX_PATH];
+ wchar_t searchMask[MAX_PATH];
mir_sntprintf(searchMask, L"%s\\%s", scriptDir, L"*.lua");
WIN32_FIND_DATA fd;
diff --git a/plugins/MirLua/src/mlua_script_loader.h b/plugins/MirLua/src/mlua_script_loader.h
index 949f870fac..e455793adf 100644
--- a/plugins/MirLua/src/mlua_script_loader.h
+++ b/plugins/MirLua/src/mlua_script_loader.h
@@ -8,7 +8,7 @@ private:
CMLuaScriptLoader(lua_State *L);
- void LoadScript(const TCHAR *scriptDir, const TCHAR *file);
+ void LoadScript(const wchar_t *scriptDir, const wchar_t *file);
void LoadScripts();
public: