diff options
Diffstat (limited to 'plugins')
29 files changed, 57 insertions, 97 deletions
diff --git a/plugins/AssocMgr/src/assoclist.cpp b/plugins/AssocMgr/src/assoclist.cpp index 2e7dcffe9c..a86a3542c1 100644 --- a/plugins/AssocMgr/src/assoclist.cpp +++ b/plugins/AssocMgr/src/assoclist.cpp @@ -696,7 +696,7 @@ static INT_PTR CALLBACK AssocListOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wPara }
}
/* sort items (before moving to groups) */
- ListView_SortItems(hwndList, ListViewSortDesc, (LPARAM)CallService(MS_LANGPACK_GETLOCALE, 0, 0));
+ ListView_SortItems(hwndList, ListViewSortDesc, Langpack_GetDefaultLocale());
/* groups */
if(ListView_EnableGroupView(hwndList, TRUE) == 1) { /* returns 0 on pre WinXP or if commctls6 are disabled */
LVGROUP lvg;
diff --git a/plugins/AssocMgr/src/test.cpp b/plugins/AssocMgr/src/test.cpp index 8b3593e89d..11f10513fe 100644 --- a/plugins/AssocMgr/src/test.cpp +++ b/plugins/AssocMgr/src/test.cpp @@ -803,16 +803,6 @@ int JabberLinksUninit() // -----------------------------------------
-/*
-static HANDLE hServiceTest;
-static int TestingService(WPARAM wParam, LPARAM lParam)
-{
- UNREFERENCED_PARAMETER(wParam);
- MessageBoxEx(NULL, (TCHAR*)lParam, TranslateT("Testing Service"), MB_OK | MB_SETFOREGROUND | MB_TOPMOST | MB_TASKMODAL, LANGIDFROMLCID((LCID)CallService(MS_LANGPACK_GETLOCALE, 0, 0)));
- return 0;
-}
-*/
-
void InitTest(void)
{
#ifdef AIM_SUPPORT_TEST
diff --git a/plugins/AssocMgr/src/utils.cpp b/plugins/AssocMgr/src/utils.cpp index 993f0bbaa9..0c76880e29 100644 --- a/plugins/AssocMgr/src/utils.cpp +++ b/plugins/AssocMgr/src/utils.cpp @@ -30,7 +30,7 @@ WCHAR* a2u(const char *pszAnsi,BOOL fMirCp) WCHAR *psz;
if(pszAnsi==NULL) return NULL;
- codepage=fMirCp?CallService(MS_LANGPACK_GETCODEPAGE,0,0):CP_ACP;
+ codepage = fMirCp ? Langpack_GetDefaultCodePage() : CP_ACP;
cch=MultiByteToWideChar(codepage,0,pszAnsi,-1,NULL,0);
if (!cch) return NULL;
@@ -50,7 +50,7 @@ char* u2a(const WCHAR *pszUnicode,BOOL fMirCp) DWORD flags;
if(pszUnicode==NULL) return NULL;
- codepage=fMirCp?CallService(MS_LANGPACK_GETCODEPAGE,0,0):CP_ACP;
+ codepage = fMirCp ? Langpack_GetDefaultCodePage() : CP_ACP;
/* without WC_COMPOSITECHECK some characters might get out strange (see MS blog) */
cch=WideCharToMultiByte(codepage,flags=WC_COMPOSITECHECK,pszUnicode,-1,NULL,0,NULL,NULL);
if (!cch) cch=WideCharToMultiByte(codepage,flags=0,pszUnicode,-1,NULL,0,NULL,NULL);
@@ -158,13 +158,15 @@ void ShowInfoMessage(BYTE flags,const char *pszTitle,const char *pszTextFmt,...) return; /* success */
}
- mbp=(MSGBOXPARAMSA*)mir_calloc(sizeof(*mbp));
- if(mbp==NULL) return;
- mbp->cbSize=sizeof(*mbp);
- mbp->lpszCaption=mir_strdup(pszTitle);
- mbp->lpszText=mir_strdup(szText);
- mbp->dwStyle=MB_OK|MB_SETFOREGROUND|MB_TASKMODAL;
- mbp->dwLanguageId=LANGIDFROMLCID((LCID)CallService(MS_LANGPACK_GETLOCALE,0,0));
+ mbp = (MSGBOXPARAMSA*)mir_calloc(sizeof(*mbp));
+ if(mbp == NULL)
+ return;
+
+ mbp->cbSize = sizeof(*mbp);
+ mbp->lpszCaption = mir_strdup(pszTitle);
+ mbp->lpszText = mir_strdup(szText);
+ mbp->dwStyle = MB_OK | MB_SETFOREGROUND | MB_TASKMODAL;
+ mbp->dwLanguageId = LANGIDFROMLCID(Langpack_GetDefaultLocale());
switch(flags&NIIF_ICON_MASK) {
case NIIF_INFO: mbp->dwStyle|=MB_ICONINFORMATION; break;
case NIIF_WARNING: mbp->dwStyle|=MB_ICONWARNING; break;
@@ -177,8 +179,8 @@ void ShowInfoMessage(BYTE flags,const char *pszTitle,const char *pszTextFmt,...) char* GetWinErrorDescription(DWORD dwLastError)
{
char *buf=NULL;
- DWORD flags=FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM;
- if (!FormatMessageA(flags,NULL,dwLastError,LANGIDFROMLCID((LCID)CallService(MS_LANGPACK_GETLOCALE,0,0)),(char*)&buf,0,NULL))
+ DWORD flags = FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM;
+ if (!FormatMessageA(flags,NULL,dwLastError, LANGIDFROMLCID(Langpack_GetDefaultLocale()),(char*)&buf,0,NULL))
if(GetLastError()==ERROR_RESOURCE_LANG_NOT_FOUND)
FormatMessageA(flags,NULL,dwLastError,0,(char*)&buf,0,NULL);
return buf;
diff --git a/plugins/AutoShutdown/src/settingsdlg.cpp b/plugins/AutoShutdown/src/settingsdlg.cpp index bb221fbaa6..4b0ada0354 100644 --- a/plugins/AutoShutdown/src/settingsdlg.cpp +++ b/plugins/AutoShutdown/src/settingsdlg.cpp @@ -72,7 +72,7 @@ static INT_PTR CALLBACK SettingsDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR LCID locale;
hwndSettingsDlg=hwndDlg;
TranslateDialogDefault(hwndDlg);
- locale=CallService(MS_LANGPACK_GETLOCALE,0,0);
+ locale = Langpack_GetDefaultLocale();
SendDlgItemMessage(hwndDlg,IDC_ICON_HEADER,STM_SETIMAGE,IMAGE_ICON,(LPARAM)IcoLib_GetIcon("AutoShutdown_Header"));
{
HFONT hBoldFont;
diff --git a/plugins/AutoShutdown/src/utils.cpp b/plugins/AutoShutdown/src/utils.cpp index 0eaed524a2..489605c69e 100644 --- a/plugins/AutoShutdown/src/utils.cpp +++ b/plugins/AutoShutdown/src/utils.cpp @@ -31,7 +31,7 @@ char* u2a(const WCHAR *pszUnicode) DWORD flags;
if (pszUnicode==NULL) return NULL;
- codepage=CallService(MS_LANGPACK_GETCODEPAGE,0,0);
+ codepage = Langpack_GetDefaultCodePage();
/* without WC_COMPOSITECHECK some characters might get out strange (see MS blog) */
cch=WideCharToMultiByte(codepage,flags=WC_COMPOSITECHECK,pszUnicode,-1,NULL,0,NULL,NULL);
if (!cch) cch=WideCharToMultiByte(codepage,flags=0,pszUnicode,-1,NULL,0,NULL,NULL);
@@ -97,11 +97,11 @@ void ShowInfoMessage(BYTE flags,const char *pszTitle,const char *pszTextFmt,...) mbp=(MSGBOXPARAMSA*)mir_calloc(sizeof(*mbp));
if (mbp==NULL) return;
- mbp->cbSize=sizeof(*mbp);
- mbp->lpszCaption=mir_strdup(pszTitle);
- mbp->lpszText=mir_strdup(szText);
- mbp->dwStyle=MB_OK|MB_SETFOREGROUND|MB_TASKMODAL;
- mbp->dwLanguageId=LANGIDFROMLCID((LCID)CallService(MS_LANGPACK_GETLOCALE,0,0));
+ mbp->cbSize = sizeof(*mbp);
+ mbp->lpszCaption = mir_strdup(pszTitle);
+ mbp->lpszText = mir_strdup(szText);
+ mbp->dwStyle = MB_OK|MB_SETFOREGROUND|MB_TASKMODAL;
+ mbp->dwLanguageId = LANGIDFROMLCID(Langpack_GetDefaultLocale());
switch(flags&NIIF_ICON_MASK) {
case NIIF_INFO: mbp->dwStyle|=MB_ICONINFORMATION; break;
case NIIF_WARNING: mbp->dwStyle|=MB_ICONWARNING; break;
@@ -115,7 +115,7 @@ char* GetWinErrorDescription(DWORD dwLastError) {
char *buf=NULL;
DWORD flags=FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM;
- if (!FormatMessageA(flags,NULL,dwLastError,LANGIDFROMLCID((LCID)CallService(MS_LANGPACK_GETLOCALE,0,0)),(char*)&buf,0,NULL))
+ if (!FormatMessageA(flags,NULL,dwLastError,LANGIDFROMLCID(Langpack_GetDefaultLocale()),(char*)&buf,0,NULL))
if (GetLastError()==ERROR_RESOURCE_LANG_NOT_FOUND)
FormatMessageA(flags,NULL,dwLastError,0,(char*)&buf,0,NULL);
return buf;
@@ -170,7 +170,7 @@ BOOL GetFormatedCountdown(TCHAR *pszOut,int nSize,time_t countdown) if (pfnGetDurationFormat != NULL) {
SYSTEMTIME st;
LCID locale;
- locale=(LCID)CallService(MS_LANGPACK_GETLOCALE,0,0);
+ locale=Langpack_GetDefaultLocale();
if (TimeStampToSystemTime(countdown,&st))
if (pfnGetDurationFormat(locale,0,&st,0,NULL,pszOut,nSize))
return TRUE;
@@ -185,7 +185,7 @@ BOOL GetFormatedDateTime(TCHAR *pszOut,int nSize,time_t timestamp,BOOL fShowDate {
SYSTEMTIME st,stNow;
LCID locale;
- locale=(LCID)CallService(MS_LANGPACK_GETLOCALE,0,0);
+ locale=Langpack_GetDefaultLocale();
GetLocalTime(&stNow);
TimeStampToSystemTime(timestamp,&st);
/* today: no need to show the date */
diff --git a/plugins/Clist_modern/src/modern_contact.cpp b/plugins/Clist_modern/src/modern_contact.cpp index 383500629d..8cd7237eb1 100644 --- a/plugins/Clist_modern/src/modern_contact.cpp +++ b/plugins/Clist_modern/src/modern_contact.cpp @@ -130,7 +130,7 @@ int CompareContacts2(const ClcContact *contact1, const ClcContact *contact2, int if (by == SORTBY_NAME_LOCALE) {
//name
static int LocaleId = -1;
- if (LocaleId == -1) LocaleId = CallService(MS_LANGPACK_GETLOCALE, 0, 0);
+ if (LocaleId == -1) LocaleId = Langpack_GetDefaultLocale();
return (CompareString(LocaleId, NORM_IGNORECASE, SAFETSTRING(namea), -1, SAFETSTRING(nameb), -1)) - 2;
}
if (by == SORTBY_LASTMSG) {
diff --git a/plugins/Clist_nicer/src/init.cpp b/plugins/Clist_nicer/src/init.cpp index aedaa410f6..4545f578bb 100644 --- a/plugins/Clist_nicer/src/init.cpp +++ b/plugins/Clist_nicer/src/init.cpp @@ -170,7 +170,7 @@ extern "C" int __declspec(dllexport) CListInitialise() cfg::dat.bShowXStatusOnSbar = cfg::getByte("CLUI", "xstatus_sbar", 0);
cfg::dat.bLayeredHack = cfg::getByte("CLUI", "layeredhack", 1);
cfg::dat.bFirstRun = cfg::getByte("CLUI", "firstrun", 1);
- cfg::dat.langPackCP = CallService(MS_LANGPACK_GETCODEPAGE, 0, 0);
+ cfg::dat.langPackCP = Langpack_GetDefaultCodePage();
cfg::dat.realTimeSaving = cfg::getByte("CLUI", "save_pos_always", 0);
DWORD sortOrder = cfg::getDword("CList", "SortOrder", SORTBY_NAME);
diff --git a/plugins/Db3x_mmap/src/dbintf.cpp b/plugins/Db3x_mmap/src/dbintf.cpp index db90cd1db1..ee14dd7a17 100644 --- a/plugins/Db3x_mmap/src/dbintf.cpp +++ b/plugins/Db3x_mmap/src/dbintf.cpp @@ -61,7 +61,7 @@ CDb3Mmap::CDb3Mmap(const TCHAR *tszFileName, int iMode) : GetSystemInfo(&sinf);
m_ChunkSize = sinf.dwAllocationGranularity;
- m_codePage = CallService(MS_LANGPACK_GETCODEPAGE, 0, 0);
+ m_codePage = Langpack_GetDefaultCodePage();
m_hModHeap = HeapCreate(0, 0, 0);
}
diff --git a/plugins/FingerprintNG/src/fingerprint.cpp b/plugins/FingerprintNG/src/fingerprint.cpp index 32c13cf652..79e8ca314f 100644 --- a/plugins/FingerprintNG/src/fingerprint.cpp +++ b/plugins/FingerprintNG/src/fingerprint.cpp @@ -940,7 +940,7 @@ static int OnSrmmWindowEvent(WPARAM, LPARAM lParam) int OnModulesLoaded(WPARAM, LPARAM) { - g_LPCodePage = CallService(MS_LANGPACK_GETCODEPAGE, 0, 0); + g_LPCodePage = Langpack_GetDefaultCodePage(); //Hook necessary events HookEvent(ME_SKIN2_ICONSCHANGED, OnIconsChanged); diff --git a/plugins/Folders/src/commonheaders.h b/plugins/Folders/src/commonheaders.h index c7117b2a97..ef29b5545c 100644 --- a/plugins/Folders/src/commonheaders.h +++ b/plugins/Folders/src/commonheaders.h @@ -37,6 +37,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <m_system_cpp.h>
#include <m_options.h>
#include <m_string.h>
+#include <m_langpack.h>
#include <m_variables.h>
#include <m_folders.h>
diff --git a/plugins/GmailNotifier/src/main.cpp b/plugins/GmailNotifier/src/main.cpp index 131d7b65b9..82ebf9e18a 100644 --- a/plugins/GmailNotifier/src/main.cpp +++ b/plugins/GmailNotifier/src/main.cpp @@ -87,6 +87,8 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) extern "C" int __declspec(dllexport) Load()
{
+ mir_getLP(&pluginInfoEx);
+
SkinAddNewSoundEx("Gmail", LPGEN("Other"), LPGEN("Gmail: New thread(s)"));
HookEvent(ME_CLIST_DOUBLECLICKED, OpenBrowser);
diff --git a/plugins/HistoryPlusPlus/historypp.dpr b/plugins/HistoryPlusPlus/historypp.dpr index d9aa22378e..ca12e3596a 100644 --- a/plugins/HistoryPlusPlus/historypp.dpr +++ b/plugins/HistoryPlusPlus/historypp.dpr @@ -162,7 +162,7 @@ begin Langpack_Register();
// Getting langpack codepage for ansi translation
- hppCodepage := CallService(MS_LANGPACK_GETCODEPAGE, 0, 0);
+ hppCodepage := Langpack_GetDefaultCodePage;
if hppCodepage = CP_ACP then
hppCodepage := GetACP();
// Checking the version of richedit is available, need 2.0+
diff --git a/plugins/HistoryStats/src/mu_common.cpp b/plugins/HistoryStats/src/mu_common.cpp index 39be7c8bd0..4587d81ff8 100644 --- a/plugins/HistoryStats/src/mu_common.cpp +++ b/plugins/HistoryStats/src/mu_common.cpp @@ -159,29 +159,6 @@ namespace mu }
/*
- * langpack
- */
-
- namespace langpack
- {
- const TCHAR* translateString(const TCHAR* szEnglish)
- {
- return reinterpret_cast<const TCHAR*>(CallService(MS_LANGPACK_TRANSLATESTRING, LANG_UNICODE, reinterpret_cast<LPARAM>(szEnglish)));
- }
-
- UINT getCodePage()
- {
- static UINT CodePage = -1;
-
- if (CodePage == -1) {
- CodePage = ServiceExists(MS_LANGPACK_GETCODEPAGE) ? CallService(MS_LANGPACK_GETCODEPAGE, 0, 0) : CP_ACP;
- }
-
- return CodePage;
- }
- }
-
- /*
* opt
*/
diff --git a/plugins/HistorySweeperLight/src/options.cpp b/plugins/HistorySweeperLight/src/options.cpp index 99ace4861e..87dc659185 100644 --- a/plugins/HistorySweeperLight/src/options.cpp +++ b/plugins/HistorySweeperLight/src/options.cpp @@ -119,15 +119,13 @@ void LoadSettings(HWND hwndDlg) SendDlgItemMessage(hwndDlg, IDC_SSKEEP, CB_RESETCONTENT, 0, 0);
for (i = 0; i < SIZEOF(time_stamp_strings); i++) {
- TCHAR* ptszTimeStr = (TCHAR*)CallService(MS_LANGPACK_PCHARTOTCHAR, 0, (LPARAM)time_stamp_strings[i]);
+ ptrT ptszTimeStr(Langpack_PcharToTchar(time_stamp_strings[i]));
SendDlgItemMessage(hwndDlg, IDC_SSOLDER, CB_ADDSTRING, 0, (LPARAM)ptszTimeStr);
- mir_free(ptszTimeStr);
}
for (i = 0; i < SIZEOF(keep_strings); i++) {
- TCHAR* ptszTimeStr = (TCHAR*)CallService(MS_LANGPACK_PCHARTOTCHAR, 0, (LPARAM)keep_strings[i]);
+ ptrT ptszTimeStr(Langpack_PcharToTchar(keep_strings[i]));
SendDlgItemMessage(hwndDlg, IDC_SSKEEP, CB_ADDSTRING, 0, (LPARAM)ptszTimeStr);
- mir_free(ptszTimeStr);
}
SendDlgItemMessage(hwndDlg, IDC_SSOLDER, CB_SETCURSEL, db_get_b(NULL, ModuleName, "StartupShutdownOlder", 0), 0);
diff --git a/plugins/ImportTXT/importtxt.dpr b/plugins/ImportTXT/importtxt.dpr index 31b8af8238..869953b556 100644 --- a/plugins/ImportTXT/importtxt.dpr +++ b/plugins/ImportTXT/importtxt.dpr @@ -116,7 +116,7 @@ function Load(): int; cdecl; var
mi: TCListMenuItem;
begin
- cp := CallService(MS_LANGPACK_GETCODEPAGE, 0, 0);
+ cp := Langpack_GetDefaultCodePage;
SrvITxt := CreateServiceFunction(IMPORT_TXT_SERVICE, @ContactMenuCommand);
SrvIWiz := CreateServiceFunction(IMPORT_WIZ_SERVICE, @MainMenuCommand);
FillChar(mi, sizeof(mi), 0);
diff --git a/plugins/Msg_Export/src/options.cpp b/plugins/Msg_Export/src/options.cpp index a0d5f2af53..160d36df35 100755 --- a/plugins/Msg_Export/src/options.cpp +++ b/plugins/Msg_Export/src/options.cpp @@ -1008,7 +1008,7 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar ClientToScreen(hMapUser, &pt);
}
- CallService(MS_LANGPACK_TRANSLATEMENU, (WPARAM)hMenu, 0);
+ TranslateMenu(hMenu);
TrackPopupMenu(hMenu, TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt.x, pt.y, 0, hwndDlg, NULL);
DestroyMenu(hMainMenu);
diff --git a/plugins/NotesAndReminders/src/notes.cpp b/plugins/NotesAndReminders/src/notes.cpp index 5b9500ced6..e3cfb87c52 100644 --- a/plugins/NotesAndReminders/src/notes.cpp +++ b/plugins/NotesAndReminders/src/notes.cpp @@ -1031,10 +1031,9 @@ static BOOL DoContextMenu(HWND AhWnd,WPARAM wParam,LPARAM lParam) InsertMenu(hFg, i, MF_BYPOSITION|MF_OWNERDRAW, IDM_COLORPRESET_FG+i, TranslateTS(clrPresets[i].szName)); } - CallService(MS_LANGPACK_TRANSLATEMENU,(DWORD)FhMenu,0); + TranslateMenu(FhMenu); TrackPopupMenu(FhMenu,TPM_LEFTALIGN | TPM_RIGHTBUTTON,LOWORD(lParam),HIWORD(lParam),0,AhWnd,0); DestroyMenu(hMenuLoad); - return TRUE; } @@ -1864,10 +1863,9 @@ static BOOL DoListContextMenu(HWND AhWnd,WPARAM wParam,LPARAM lParam,STICKYNOTE CheckMenuItem(FhMenu, IDM_TOGGLEONTOP, MF_CHECKED|MF_BYCOMMAND); } - CallService(MS_LANGPACK_TRANSLATEMENU,(DWORD)FhMenu,0); + TranslateMenu(FhMenu); TrackPopupMenu(FhMenu,TPM_LEFTALIGN | TPM_RIGHTBUTTON,LOWORD(lParam),HIWORD(lParam),0,AhWnd,0); DestroyMenu(hMenuLoad); - return TRUE; } diff --git a/plugins/NotesAndReminders/src/reminders.cpp b/plugins/NotesAndReminders/src/reminders.cpp index 28ca688fe7..be97aea7cb 100644 --- a/plugins/NotesAndReminders/src/reminders.cpp +++ b/plugins/NotesAndReminders/src/reminders.cpp @@ -2354,7 +2354,7 @@ static BOOL DoListContextMenu(HWND AhWnd,WPARAM wParam,LPARAM lParam,REMINDERDAT if (!pReminder)
EnableMenuItem(FhMenu, IDM_DELETEREMINDER, MF_GRAYED|MF_BYCOMMAND);
- CallService(MS_LANGPACK_TRANSLATEMENU,(DWORD)FhMenu,0);
+ TranslateMenu(FhMenu);
TrackPopupMenu(FhMenu,TPM_LEFTALIGN | TPM_RIGHTBUTTON,LOWORD(lParam),HIWORD(lParam),0,AhWnd,0);
DestroyMenu(hMenuLoad);
return TRUE;
diff --git a/plugins/SimpleStatusMsg/src/msgbox.cpp b/plugins/SimpleStatusMsg/src/msgbox.cpp index 27ec537e27..9bbd4adc5c 100644 --- a/plugins/SimpleStatusMsg/src/msgbox.cpp +++ b/plugins/SimpleStatusMsg/src/msgbox.cpp @@ -792,7 +792,7 @@ void ChangeDlgStatus(HWND hwndDlg, struct MsgBoxData *msgbox_data, int iStatus) char buff1[128]; CallService(MS_SS_GETPROFILENAME, iStatus - 40083, (LPARAM)buff1); - MultiByteToWideChar(CallService(MS_LANGPACK_GETCODEPAGE, 0, 0), 0, buff1, -1, buff, 128); + MultiByteToWideChar(Langpack_GetDefaultCodePage(), 0, buff1, -1, buff, 128); mir_sntprintf(szTitle, TranslateT("%s message (%s)"), (TCHAR *)buff, szProtoName); } diff --git a/plugins/SmileyAdd/src/services.cpp b/plugins/SmileyAdd/src/services.cpp index f0e6b79e0d..4af2b720d4 100644 --- a/plugins/SmileyAdd/src/services.cpp +++ b/plugins/SmileyAdd/src/services.cpp @@ -236,10 +236,7 @@ INT_PTR RegisterPack(WPARAM, LPARAM lParam) if (IsBadStringPtrA(smre->name, 50) || IsBadStringPtrA(smre->dispname, 50)) return FALSE;
- unsigned lpcp = (unsigned)CallService(MS_LANGPACK_GETCODEPAGE, 0, 0);
- if (lpcp == CALLSERVICE_NOTFOUND) lpcp = CP_ACP;
-
-
+ unsigned lpcp = Langpack_GetDefaultCodePage();
CMString nmd(A2W_SM(smre->dispname, lpcp));
diff --git a/plugins/SmileyAdd/src/smileys.cpp b/plugins/SmileyAdd/src/smileys.cpp index 67b39b5945..63b79d169b 100644 --- a/plugins/SmileyAdd/src/smileys.cpp +++ b/plugins/SmileyAdd/src/smileys.cpp @@ -977,9 +977,7 @@ void SmileyCategoryListType::AddAllProtocolsAsCategory(void) const CMString& defaultFile = GetSmileyCategory(tname)->GetFilename();
-
- unsigned lpcp = (unsigned)CallService(MS_LANGPACK_GETCODEPAGE, 0, 0);
- if (lpcp == CALLSERVICE_NOTFOUND) lpcp = CP_ACP;
+ unsigned lpcp = Langpack_GetDefaultCodePage();
PROTOCOLDESCRIPTOR **proto;
int protoCount = 0;
diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp index ea7cd59b22..d20513e72f 100644 --- a/plugins/TabSRMM/src/globals.cpp +++ b/plugins/TabSRMM/src/globals.cpp @@ -186,7 +186,7 @@ void CGlobals::reloadSettings(bool fReloadSkins) m_bIdleDetect = M.GetBool("dimIconsForIdleContacts", true);
m_smcxicon = m_smcyicon = 16;
m_PasteAndSend = M.GetByte("pasteandsend", 1);
- m_LangPackCP = ServiceExists(MS_LANGPACK_GETCODEPAGE) ? CallService(MS_LANGPACK_GETCODEPAGE, 0, 0) : CP_ACP;
+ m_LangPackCP = Langpack_GetDefaultCodePage();
m_visualMessageSizeIndicator = M.GetByte("msgsizebar", 0);
m_autoSplit = M.GetByte("autosplit", 0);
m_FlashOnMTN = M.GetByte(SRMSGMOD, SRMSGSET_SHOWTYPINGWINFLASH, SRMSGDEFSET_SHOWTYPINGWINFLASH);
diff --git a/plugins/TipperYM/src/tipper.cpp b/plugins/TipperYM/src/tipper.cpp index 4c832427aa..a8c6e68194 100644 --- a/plugins/TipperYM/src/tipper.cpp +++ b/plugins/TipperYM/src/tipper.cpp @@ -301,8 +301,7 @@ extern "C" int __declspec(dllexport) Load(void) mir_getCLI();
mir_getTMI(&tmi);
- if (ServiceExists(MS_LANGPACK_GETCODEPAGE))
- iCodePage = CallService(MS_LANGPACK_GETCODEPAGE, 0, 0);
+ iCodePage = Langpack_GetDefaultCodePage();
InitTranslations();
InitMessagePump();
diff --git a/plugins/TopToolBar/src/toolbar.cpp b/plugins/TopToolBar/src/toolbar.cpp index d93abb0494..d9b21dad72 100644 --- a/plugins/TopToolBar/src/toolbar.cpp +++ b/plugins/TopToolBar/src/toolbar.cpp @@ -564,7 +564,7 @@ int OnPluginLoad(WPARAM, LPARAM lParam) int OnPluginUnload(WPARAM, LPARAM lParam)
{
- int hLangpack = CallService(MS_LANGPACK_LOOKUPHANDLE, 0, lParam);
+ int hLangpack = GetPluginLangByInstance((HINSTANCE)lParam);
if (hLangpack) {
bool bNeedUpdate = false;
mir_cslock lck(csButtonsHook);
diff --git a/plugins/UserInfoEx/src/svc_constants.cpp b/plugins/UserInfoEx/src/svc_constants.cpp index 3f76ed0d40..12cd47c49d 100644 --- a/plugins/UserInfoEx/src/svc_constants.cpp +++ b/plugins/UserInfoEx/src/svc_constants.cpp @@ -270,15 +270,13 @@ static int __cdecl ListSortProc(const LPIDSTRLIST p1, const LPIDSTRLIST p2) static void SvcConstantsTranslateList(LPIDSTRLIST pList, UINT nListCount/*, SortedList *pSorted*/)
{
- if (!pList[0].ptszTranslated)
- {
+ if (!pList[0].ptszTranslated) {
for (UINT i = 0; i < nListCount; i++)
- {
- pList[i].ptszTranslated = (LPTSTR)CallService(MS_LANGPACK_PCHARTOTCHAR, 0, (LPARAM)pList[i].pszText);
- }
+ pList[i].ptszTranslated = Langpack_PcharToTchar(pList[i].pszText);
+
// Ignore last item, if it is a "Other" item.
if (!mir_strcmp(pList[nListCount-1].pszText, LPGEN("Other"))) nListCount--;
-
+
// Sort list according translated text and ignore first item.
qsort(pList+1, nListCount-1, sizeof(pList[0]),
(int (*)(const void*, const void*))ListSortProc);
@@ -309,7 +307,7 @@ INT_PTR GetCountryList(LPUINT pnListSize, LPIDSTRLIST *pList) for (UINT i = 0; i < MyCountriesCount; i++) {
MyCountries[i].nID = country[i].id;
MyCountries[i].pszText = country[i].szName;
- MyCountries[i].ptszTranslated = (LPTSTR)CallService(MS_LANGPACK_PCHARTOTCHAR, 0, (LPARAM)country[i].szName);
+ MyCountries[i].ptszTranslated = Langpack_PcharToTchar(country[i].szName);
}
// Sort list according translated text and ignore first item.
qsort(MyCountries+1, MyCountriesCount-1, sizeof(MyCountries[0]),
diff --git a/plugins/Utils.pas/mircontacts.pas b/plugins/Utils.pas/mircontacts.pas index a0b971e008..78c68501ee 100644 --- a/plugins/Utils.pas/mircontacts.pas +++ b/plugins/Utils.pas/mircontacts.pas @@ -124,7 +124,7 @@ begin AnsiToWide(GetContactID(hContact, Proto), Result);
if (Result = nil) or (Result^ = #0) then
- AnsiToWide(Translate(Proto), Result, CallService(MS_LANGPACK_GETCODEPAGE, 0, 0));
+ AnsiToWide(Translate(Proto), Result, Langpack_GetDefaultCodePage);
end;
end;
end;
@@ -155,7 +155,7 @@ begin DBVT_ASCIIZ: StrDup(Result, dbv.szVal.a);
DBVT_UTF8,
DBVT_WCHAR: begin
- cp := CallService(MS_LANGPACK_GETCODEPAGE, 0, 0);
+ cp := Langpack_GetDefaultCodePage;
if dbv._type = DBVT_UTF8 then
UTF8ToAnsi(dbv.szVal.a, Result, cp)
else // dbv._type = DBVT_WCHAR then
@@ -174,7 +174,7 @@ begin if Proto = nil then
Proto := GetContactProto(hContact);
if Proto = nil then
- Result := CallService(MS_LANGPACK_GETCODEPAGE, 0, 0)
+ Result := Langpack_GetDefaultCodePage
else
begin
Result := DBReadWord(hContact, Proto, 'AnsiCodePage', $FFFF);
@@ -622,7 +622,7 @@ begin DBVT_WORD : p:=IntToStr(buf1,ldbv.wVal);
DBVT_DWORD : p:=IntToStr(buf1,ldbv.dVal);
DBVT_UTF8 : UTF8ToWide(ldbv.szVal.A,p);
- DBVT_ASCIIZ : AnsiToWide(ldbv.szVal.A,p,CallService(MS_LANGPACK_GETCODEPAGE,0,0));
+ DBVT_ASCIIZ : AnsiToWide(ldbv.szVal.A,p,Langpack_GetDefaultCodePage);
DBVT_WCHAR : p:=ldbv.szVal.W;
DBVT_BLOB : p:='blob';
end;
diff --git a/plugins/Utils.pas/mirutils.pas b/plugins/Utils.pas/mirutils.pas index ab7a275a48..16d92a3cec 100644 --- a/plugins/Utils.pas/mirutils.pas +++ b/plugins/Utils.pas/mirutils.pas @@ -132,7 +132,7 @@ const function MirandaCP:integer;
begin
if MirCP<0 then
- MirCP:=CallService(MS_LANGPACK_GETCODEPAGE,0,0);
+ MirCP:=Langpack_GetDefaultCodePage;
result:=MirCP;
end;
diff --git a/plugins/YAMN/src/browser/mailbrowser.cpp b/plugins/YAMN/src/browser/mailbrowser.cpp index 8513616923..590dc5a25b 100644 --- a/plugins/YAMN/src/browser/mailbrowser.cpp +++ b/plugins/YAMN/src/browser/mailbrowser.cpp @@ -1134,7 +1134,7 @@ ULONGLONG MimeDateToFileTime(char *datein) void FileTimeToLocalizedDateTime(LONGLONG filetime, WCHAR *dateout, int lendateout) { - int localeID = CallService(MS_LANGPACK_GETLOCALE, 0, 0); + int localeID = Langpack_GetDefaultLocale(); //int localeID = MAKELCID(LANG_URDU, SORT_DEFAULT); if (localeID == CALLSERVICE_NOTFOUND) localeID = LOCALE_USER_DEFAULT; if (filetime > MAXFILETIME) filetime = MAXFILETIME; diff --git a/plugins/YahooGroups/src/YahooGroups.cpp b/plugins/YahooGroups/src/YahooGroups.cpp index f867404140..00177c628a 100644 --- a/plugins/YahooGroups/src/YahooGroups.cpp +++ b/plugins/YahooGroups/src/YahooGroups.cpp @@ -50,7 +50,7 @@ extern "C" int __declspec(dllexport) Load() mir_getLP(&pluginInfo);
LogInit();
- currentCodePage = (UINT) CallService(MS_LANGPACK_GETCODEPAGE, 0, 0);
+ currentCodePage = Langpack_GetDefaultCodePage();
InitServices();
|