diff options
author | George Hazan <george.hazan@gmail.com> | 2015-06-19 15:58:43 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-06-19 15:58:43 +0000 |
commit | 4a67a2dabbdf4aefbe729779f3be84177bbe9274 (patch) | |
tree | a0caef0ac3ed3942c1f62d2cba6016aa31f6259f /src | |
parent | 9556b03ca5f9cb26b16b414faaaea90559843e0c (diff) |
crutch to return fake langpack ids for scripting
git-svn-id: http://svn.miranda-ng.org/main/trunk@14264 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
-rw-r--r-- | src/mir_app/src/mir_app.def | 2 | ||||
-rw-r--r-- | src/mir_app/src/mir_app64.def | 2 | ||||
-rw-r--r-- | src/mir_app/src/newplugins.cpp | 27 | ||||
-rw-r--r-- | src/mir_core/src/langpack.cpp | 4 |
4 files changed, 19 insertions, 16 deletions
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index e7a09d548a..4f7d8b0cc0 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -128,7 +128,7 @@ ProtoLogW @125 ProtoWindowAdd @126
ProtoWindowRemove @127
Proto_IsProtocolLoaded @128
-GetPluginFakeId @129
+GetPluginLangId @129
Proto_GetAccount @130
Proto_EnumProtocols @131
Proto_EnumAccounts @132
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index 39b2b30b5c..c5fd8c2d4e 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -128,7 +128,7 @@ ProtoLogW @125 ProtoWindowAdd @126
ProtoWindowRemove @127
Proto_IsProtocolLoaded @128
-GetPluginFakeId @129
+GetPluginLangId @129
Proto_GetAccount @130
Proto_EnumProtocols @131
Proto_EnumAccounts @132
diff --git a/src/mir_app/src/newplugins.cpp b/src/mir_app/src/newplugins.cpp index 45117ff4ff..e3263906aa 100644 --- a/src/mir_app/src/newplugins.cpp +++ b/src/mir_app/src/newplugins.cpp @@ -44,6 +44,18 @@ LIST<pluginEntry> /////////////////////////////////////////////////////////////////////////////////////////
+MUUID miid_last = MIID_LAST;
+MUUID miid_chat = MIID_CHAT;
+MUUID miid_srmm = MIID_SRMM;
+MUUID miid_clist = MIID_CLIST;
+MUUID miid_database = MIID_DATABASE;
+MUUID miid_protocol = MIID_PROTOCOL;
+MUUID miid_servicemode = MIID_SERVICEMODE;
+MUUID miid_crypto = MIID_CRYPTO;
+MUUID miid_ssl = MIID_SSL;
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
#define MAX_MIR_VER ULONG_MAX
static BOOL bModuleInitialized = FALSE;
@@ -188,8 +200,11 @@ MIR_APP_DLL(int) GetPluginLangByInstance(HINSTANCE hInstance) return NULL;
}
-EXTERN_C MIR_APP_DLL(int) GetPluginFakeId(const MUUID &uuid, int hLangpack)
+MIR_APP_DLL(int) GetPluginLangId(const MUUID &uuid, int hLangpack)
{
+ if (equalUUID(uuid, miid_last))
+ return --sttFakeID;
+
for (int i = 0; i < pluginList.getCount(); i++) {
pluginEntry *p = pluginList[i];
if (!p->bpi.hInst)
@@ -202,16 +217,6 @@ EXTERN_C MIR_APP_DLL(int) GetPluginFakeId(const MUUID &uuid, int hLangpack) return 0;
}
-MUUID miid_last = MIID_LAST;
-MUUID miid_chat = MIID_CHAT;
-MUUID miid_srmm = MIID_SRMM;
-MUUID miid_clist = MIID_CLIST;
-MUUID miid_database = MIID_DATABASE;
-MUUID miid_protocol = MIID_PROTOCOL;
-MUUID miid_servicemode = MIID_SERVICEMODE;
-MUUID miid_crypto = MIID_CRYPTO;
-MUUID miid_ssl = MIID_SSL;
-
static bool validInterfaceList(MUUID *piface)
{
if (piface == NULL)
diff --git a/src/mir_core/src/langpack.cpp b/src/mir_core/src/langpack.cpp index a153098be7..cfc656afd2 100644 --- a/src/mir_core/src/langpack.cpp +++ b/src/mir_core/src/langpack.cpp @@ -687,12 +687,10 @@ void GetDefaultLang() /////////////////////////////////////////////////////////////////////////////////////////
-EXTERN_C MIR_APP_DLL(int) GetPluginFakeId(const MUUID &uuid, int hLangpack);
-
MIR_CORE_DLL(void) mir_getLP(const PLUGININFOEX *pInfo, int *_hLang)
{
if (_hLang && pInfo)
- *(int*)_hLang = GetPluginFakeId(pInfo->uuid, Langpack_MarkPluginLoaded((PLUGININFOEX*)pInfo));
+ *(int*)_hLang = GetPluginLangId(pInfo->uuid, Langpack_MarkPluginLoaded((PLUGININFOEX*)pInfo));
}
/////////////////////////////////////////////////////////////////////////////////////////
|