diff options
author | George Hazan <george.hazan@gmail.com> | 2015-06-18 21:20:39 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-06-18 21:20:39 +0000 |
commit | ec0e34b4f88ebe03ff12f559e40dda52c51549b7 (patch) | |
tree | 42e8a56fe17d9736527fe79a6345e857842fbf40 /src/mir_core | |
parent | ca702593c60aa89c06633777feb7cf79ad8e751f (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_core')
-rw-r--r-- | src/mir_core/src/langpack.cpp | 47 | ||||
-rw-r--r-- | src/mir_core/src/mir_core.def | 1 | ||||
-rw-r--r-- | src/mir_core/src/mir_core64.def | 1 |
3 files changed, 35 insertions, 14 deletions
diff --git a/src/mir_core/src/langpack.cpp b/src/mir_core/src/langpack.cpp index 1f9ada0823..a153098be7 100644 --- a/src/mir_core/src/langpack.cpp +++ b/src/mir_core/src/langpack.cpp @@ -685,10 +685,43 @@ void GetDefaultLang() db_set_ts(NULL, "Langpack", "Current", _T("default"));
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
+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));
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+MIR_CORE_DLL(void) ReloadLangpack(TCHAR *pszStr)
+{
+ if (pszStr == NULL)
+ pszStr = NEWTSTR_ALLOCA(langPack.tszFileName);
+
+ UnloadLangPackModule();
+ LoadLangPack(pszStr);
+ Langpack_SortDuplicates();
+
+ NotifyEventHooks(hevChanged, 0, 0);
+}
+
+static INT_PTR srvReloadLangpack(WPARAM, LPARAM lParam)
+{
+ ReloadLangpack((TCHAR*)lParam);
+ return 0;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
MIR_CORE_DLL(int) LoadLangPackModule(void)
{
bModuleInitialized = TRUE;
hevChanged = CreateHookableEvent(ME_LANGPACK_CHANGED);
+ CreateServiceFunction(MS_LANGPACK_RELOAD, srvReloadLangpack);
GetDefaultLang();
return 0;
}
@@ -725,17 +758,3 @@ void UnloadLangPackModule() langPack.tszFileName[0] = langPack.tszFullPath[0] = 0;
}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
-MIR_CORE_DLL(void) ReloadLangpack(TCHAR *pszStr)
-{
- if (pszStr == NULL)
- pszStr = NEWTSTR_ALLOCA(langPack.tszFileName);
-
- UnloadLangPackModule();
- LoadLangPack(pszStr);
- Langpack_SortDuplicates();
-
- NotifyEventHooks(hevChanged, 0, 0);
-}
diff --git a/src/mir_core/src/mir_core.def b/src/mir_core/src/mir_core.def index 44fd75942f..f693d41233 100644 --- a/src/mir_core/src/mir_core.def +++ b/src/mir_core/src/mir_core.def @@ -952,3 +952,4 @@ WindowList_Remove @1108 Utils_AssertInsideScreen @1110
Utils_RestoreWindowPosition @1111
Utils_SaveWindowPosition @1112
+mir_getLP @1113
diff --git a/src/mir_core/src/mir_core64.def b/src/mir_core/src/mir_core64.def index 101c8bc390..eadbef2572 100644 --- a/src/mir_core/src/mir_core64.def +++ b/src/mir_core/src/mir_core64.def @@ -952,3 +952,4 @@ WindowList_Remove @1108 Utils_AssertInsideScreen @1110
Utils_RestoreWindowPosition @1111
Utils_SaveWindowPosition @1112
+mir_getLP @1113
|