summaryrefslogtreecommitdiff
path: root/src/mir_app
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-06-18 21:20:39 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-06-18 21:20:39 +0000
commitec0e34b4f88ebe03ff12f559e40dda52c51549b7 (patch)
tree42e8a56fe17d9736527fe79a6345e857842fbf40 /src/mir_app
parentca702593c60aa89c06633777feb7cf79ad8e751f (diff)
langpack services module destroyed from mir_app
the only survived service moved to mir_core git-svn-id: http://svn.miranda-ng.org/main/trunk@14250 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/mir_app')
-rw-r--r--src/mir_app/src/lpopts.cpp2
-rw-r--r--src/mir_app/src/lpservices.cpp113
-rw-r--r--src/mir_app/src/mir_app.def1
-rw-r--r--src/mir_app/src/mir_app64.def1
-rw-r--r--src/mir_app/src/miranda.h1
-rw-r--r--src/mir_app/src/modules.cpp3
-rw-r--r--src/mir_app/src/newplugins.cpp2
7 files changed, 5 insertions, 118 deletions
diff --git a/src/mir_app/src/lpopts.cpp b/src/mir_app/src/lpopts.cpp
index fac4b383e2..a0f8812d41 100644
--- a/src/mir_app/src/lpopts.cpp
+++ b/src/mir_app/src/lpopts.cpp
@@ -60,7 +60,7 @@ static void DisplayPackInfo(HWND hwndDlg, const LANGPACK_INFO *pack)
SYSTEMTIME stFileDate;
TCHAR szDate[128]; szDate[0] = 0;
if (FileTimeToSystemTime(&pack->ftFileDate, &stFileDate))
- GetDateFormat((LCID)CallService(MS_LANGPACK_GETLOCALE, 0, 0), DATE_SHORTDATE, &stFileDate, NULL, szDate, SIZEOF(szDate));
+ GetDateFormat(Langpack_GetDefaultLocale(), DATE_SHORTDATE, &stFileDate, NULL, szDate, SIZEOF(szDate));
SetDlgItemText(hwndDlg, IDC_LANGDATE, szDate);
/* general */
diff --git a/src/mir_app/src/lpservices.cpp b/src/mir_app/src/lpservices.cpp
deleted file mode 100644
index ce01393140..0000000000
--- a/src/mir_app/src/lpservices.cpp
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
-
-Miranda NG: the free IM client for Microsoft* Windows*
-
-Copyright (ñ) 2012-15 Miranda NG project (http://miranda-ng.org),
-Copyright (c) 2000-12 Miranda IM project,
-all portions of this codebase are copyrighted to the people
-listed in contributors.txt.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#include "stdafx.h"
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
-static INT_PTR srvTranslateString(WPARAM wParam, LPARAM lParam)
-{
- if (wParam & LANG_UNICODE)
- return (INT_PTR)TranslateW_LP((const WCHAR*)lParam, wParam);
- return (INT_PTR)TranslateA_LP((const char *)lParam, wParam);
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
-static INT_PTR srvTranslateMenu(WPARAM wParam, LPARAM lParam)
-{
- TranslateMenu_LP((HMENU)wParam, lParam);
- return 0;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
-static INT_PTR srvRegisterLP(WPARAM wParam, LPARAM lParam)
-{
- PLUGININFOEX* ppi = (PLUGININFOEX*)lParam;
- if (wParam && ppi)
- *(int*)wParam = GetPluginFakeId(ppi->uuid, Langpack_MarkPluginLoaded(ppi));
- return 0;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
-static INT_PTR srvGetDefaultCodePage(WPARAM, LPARAM)
-{
- return Langpack_GetDefaultCodePage();
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
-static INT_PTR srvGetDefaultLocale(WPARAM, LPARAM)
-{
- return Langpack_GetDefaultLocale();
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
-static INT_PTR srvPcharToTchar(WPARAM wParam, LPARAM lParam)
-{
- char *pszStr = (char*)lParam;
- if (pszStr == NULL)
- return NULL;
-
- int len = (int)mir_strlen(pszStr);
- TCHAR *result = (TCHAR*)alloca((len+1)*sizeof(TCHAR));
- MultiByteToWideChar(Langpack_GetDefaultCodePage(), 0, pszStr, -1, result, len);
- result[len] = 0;
- return (INT_PTR)mir_wstrdup(TranslateW_LP(result, wParam));
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
-static INT_PTR srvReloadLangpack(WPARAM, LPARAM lParam)
-{
- ReloadLangpack((TCHAR*)lParam);
- return 0;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
-static INT_PTR srvGetPluginLangpack(WPARAM, LPARAM lParam)
-{
- return GetPluginLangByInstance((HINSTANCE)lParam);
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
-int LoadLangpackModule(void)
-{
- LoadLangPackModule();
-
- CreateServiceFunction(MS_LANGPACK_TRANSLATESTRING, srvTranslateString);
- CreateServiceFunction(MS_LANGPACK_TRANSLATEMENU, srvTranslateMenu);
- CreateServiceFunction(MS_LANGPACK_GETCODEPAGE, srvGetDefaultCodePage);
- CreateServiceFunction(MS_LANGPACK_GETLOCALE, srvGetDefaultLocale);
- CreateServiceFunction(MS_LANGPACK_PCHARTOTCHAR, srvPcharToTchar);
- CreateServiceFunction(MS_LANGPACK_REGISTER, srvRegisterLP);
- CreateServiceFunction(MS_LANGPACK_RELOAD, srvReloadLangpack);
- CreateServiceFunction(MS_LANGPACK_LOOKUPHANDLE, srvGetPluginLangpack);
- return 0;
-}
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def
index fbbeedf608..6eb3303181 100644
--- a/src/mir_app/src/mir_app.def
+++ b/src/mir_app/src/mir_app.def
@@ -128,3 +128,4 @@ ProtoLogW @125
ProtoWindowAdd @126
ProtoWindowRemove @127
Proto_IsProtocolLoaded @128
+GetPluginFakeId @129
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def
index d0ef1f280d..4bd307a4ff 100644
--- a/src/mir_app/src/mir_app64.def
+++ b/src/mir_app/src/mir_app64.def
@@ -128,3 +128,4 @@ ProtoLogW @125
ProtoWindowAdd @126
ProtoWindowRemove @127
Proto_IsProtocolLoaded @128
+GetPluginFakeId @129
diff --git a/src/mir_app/src/miranda.h b/src/mir_app/src/miranda.h
index ecd60c2211..a1fad48c77 100644
--- a/src/mir_app/src/miranda.h
+++ b/src/mir_app/src/miranda.h
@@ -77,7 +77,6 @@ extern TCHAR mirandabootini[MAX_PATH];
/**** newplugins.cpp *******************************************************************/
char* GetPluginNameByInstance(HINSTANCE hInstance);
-int GetPluginFakeId(const MUUID &uuid, int hLangpack);
int LoadStdPlugins(void);
/**** path.cpp *************************************************************************/
diff --git a/src/mir_app/src/modules.cpp b/src/mir_app/src/modules.cpp
index 0c7e748552..e277f09260 100644
--- a/src/mir_app/src/modules.cpp
+++ b/src/mir_app/src/modules.cpp
@@ -34,7 +34,6 @@ int LoadNewPluginsModuleInfos(void); // core: preloading plugins
int LoadNewPluginsModule(void); // core: N.O. plugins
int LoadNetlibModule(void); // core: network
int LoadSslModule(void);
-int LoadLangpackModule(void); // core: translation
int LoadProtocolsModule(void); // core: protocol manager
int LoadAccountsModule(void); // core: account manager
int LoadIgnoreModule(void); // protocol filter: ignore
@@ -90,7 +89,7 @@ int LoadDefaultModules(void)
{
// load order is very important for these
if (LoadSystemModule()) return 1;
- if (LoadLangpackModule()) return 1; // langpack will be a system module in the new order so this is moved here
+ if (LoadLangPackModule()) return 1; // langpack will be a system module in the new order so this is moved here
if (CheckRestart()) return 1;
if (LoadUtilsModule()) return 1; //order not important for this, but no dependencies and no point in pluginising
if (LoadIcoTabsModule()) return 1;
diff --git a/src/mir_app/src/newplugins.cpp b/src/mir_app/src/newplugins.cpp
index f6ae881f7a..45117ff4ff 100644
--- a/src/mir_app/src/newplugins.cpp
+++ b/src/mir_app/src/newplugins.cpp
@@ -188,7 +188,7 @@ MIR_APP_DLL(int) GetPluginLangByInstance(HINSTANCE hInstance)
return NULL;
}
-int GetPluginFakeId(const MUUID &uuid, int hLangpack)
+EXTERN_C MIR_APP_DLL(int) GetPluginFakeId(const MUUID &uuid, int hLangpack)
{
for (int i = 0; i < pluginList.getCount(); i++) {
pluginEntry *p = pluginList[i];