From 81fe4a0a34e8e07305381e18e449246fef822673 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 18 Jun 2012 11:47:05 +0000 Subject: sync git-svn-id: http://svn.miranda-ng.org/main/trunk@469 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Chat/tools.c | 2 +- plugins/Chat/window.c | 6 +-- plugins/Clist_modern/modern_clui.cpp | 4 +- plugins/Clist_mw/clui.cpp | 2 +- plugins/Clist_nicer/CLUIFrames/groupmenu.cpp | 2 +- plugins/Clist_nicer/SRC/clui.cpp | 2 +- plugins/ExternalAPI/m_toptoolbar.h | 18 +++---- plugins/Scriver/chat/window.c | 2 +- plugins/Scriver/input.c | 4 +- plugins/Scriver/msgdialog.c | 4 +- plugins/Scriver/msgwindow.c | 2 +- plugins/TabSRMM/chat/tools.cpp | 2 +- plugins/TabSRMM/chat/window.cpp | 4 +- plugins/TabSRMM/src/globals.cpp | 6 +-- plugins/TabSRMM/src/msgdialog.cpp | 4 +- protocols/JabberG/jabber.cpp | 4 +- protocols/JabberG/jabber_proxy.cpp | 38 +++++++------ src/modules/clist/clc.cpp | 2 +- src/modules/clist/clisttray.cpp | 2 +- src/modules/clist/clui.cpp | 80 ++++++++++++++-------------- src/modules/findadd/searchresults.cpp | 42 +++++++-------- src/modules/icolib/skin2icons.cpp | 2 +- src/modules/srurl/urldialogs.cpp | 2 +- 23 files changed, 121 insertions(+), 115 deletions(-) diff --git a/plugins/Chat/tools.c b/plugins/Chat/tools.c index 6609a388a0..ef24f40a13 100644 --- a/plugins/Chat/tools.c +++ b/plugins/Chat/tools.c @@ -689,7 +689,7 @@ UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO HMENU hSubMenu = 0; *hMenu = GetSubMenu(g_hMenu, iIndex); - CallService(MS_LANGPACK_TRANSLATEMENU, (WPARAM) *hMenu, 0); + TranslateMenu(*hMenu); gcmi.pszID = si->ptszID; gcmi.pszModule = si->pszModule; gcmi.pszUID = pszUID; diff --git a/plugins/Chat/window.c b/plugins/Chat/window.c index 2021496563..67052b2a35 100644 --- a/plugins/Chat/window.c +++ b/plugins/Chat/window.c @@ -607,7 +607,7 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, HMENU hSubMenu; hSubMenu = GetSubMenu(g_hMenu, 4); - CallService(MS_LANGPACK_TRANSLATEMENU, (WPARAM) hSubMenu, 0); + TranslateMenu(hSubMenu); SendMessage(hwnd, EM_EXGETSEL, 0, (LPARAM) & sel); EnableMenuItem(hSubMenu, ID_MESSAGE_UNDO, SendMessage(hwnd, EM_CANUNDO, 0,0)?MF_ENABLED:MF_GRAYED); @@ -2174,7 +2174,7 @@ LABEL_SHOWWINDOW: ClientToScreen(GetDlgItem(hwndDlg, IDC_TAB), &tci.pt); hSubMenu = GetSubMenu(g_hMenu, 5); - CallService(MS_LANGPACK_TRANSLATEMENU, (WPARAM) hSubMenu, 0); + TranslateMenu(hSubMenu); if (s) { WORD w = DBGetContactSettingWord(s->hContact, s->pszModule, "TabPosition", 0); if ( w == 0) @@ -2352,7 +2352,7 @@ LABEL_SHOWWINDOW: POINT pt; hSubMenu = GetSubMenu(g_hMenu, 2); - CallService(MS_LANGPACK_TRANSLATEMENU, (WPARAM) hSubMenu, 0); + TranslateMenu(hSubMenu); pt.x = (short) LOWORD(((ENLINK *) lParam)->lParam); pt.y = (short) HIWORD(((ENLINK *) lParam)->lParam); ClientToScreen(((NMHDR *) lParam)->hwndFrom, &pt); diff --git a/plugins/Clist_modern/modern_clui.cpp b/plugins/Clist_modern/modern_clui.cpp index 8830f119d6..914c0e240b 100644 --- a/plugins/Clist_modern/modern_clui.cpp +++ b/plugins/Clist_modern/modern_clui.cpp @@ -137,7 +137,7 @@ int CLUI::OnEvent_ContactMenuPreBuild(WPARAM wParam, LPARAM lParam) else { DBVARIANT dbv={0}; - if (ModernGetSettingString(hItem, "ContactPhoto", "File", &dbv)) + if (ModernGetSettingTString(hItem, "ContactPhoto", "File", &dbv)) { has_avatar = 0; } @@ -2264,7 +2264,7 @@ LRESULT CLUI::OnPaint( UINT msg, WPARAM wParam, LPARAM lParam ) LRESULT CLUI::OnCreate( UINT msg, WPARAM wParam, LPARAM lParam ) { - CallService(MS_LANGPACK_TRANSLATEMENU,(WPARAM)GetMenu(m_hWnd),0); + TranslateMenu(GetMenu(m_hWnd)); DrawMenuBar(m_hWnd); CLUIServices_ProtocolStatusChanged(0,0); diff --git a/plugins/Clist_mw/clui.cpp b/plugins/Clist_mw/clui.cpp index f8a820bca6..14079c2ac6 100644 --- a/plugins/Clist_mw/clui.cpp +++ b/plugins/Clist_mw/clui.cpp @@ -537,7 +537,7 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l switch (msg) { case WM_CREATE: - CallService(MS_LANGPACK_TRANSLATEMENU,(WPARAM)GetMenu(hwnd),0); + TranslateMenu(GetMenu(hwnd)); DrawMenuBar(hwnd); showOpts = DBGetContactSettingByte(NULL,"CLUI","SBarShow",1); diff --git a/plugins/Clist_nicer/CLUIFrames/groupmenu.cpp b/plugins/Clist_nicer/CLUIFrames/groupmenu.cpp index 212b2be20e..a784e30883 100644 --- a/plugins/Clist_nicer/CLUIFrames/groupmenu.cpp +++ b/plugins/Clist_nicer/CLUIFrames/groupmenu.cpp @@ -145,7 +145,7 @@ INT_PTR GroupMenuonAddService(WPARAM wParam,LPARAM lParam) { } if (hAppearanceMenuItemProxy==(HANDLE)lParam) { hMenuOldContext = GetSubMenu(LoadMenu(g_hInst, MAKEINTRESOURCE(IDR_CONTEXT)), 3); - CallService(MS_LANGPACK_TRANSLATEMENU, (WPARAM) hMenuOldContext, 0); + TranslateMenu(hMenuOldContext); CheckMenuItem(hMenuOldContext, POPUP_VISIBILITY, MF_BYCOMMAND | (cfg::dat.dwFlags & CLUI_SHOWVISI ? MF_CHECKED : MF_UNCHECKED)); CheckMenuItem(hMenuOldContext, POPUP_FRAME, MF_BYCOMMAND | (cfg::dat.dwFlags & CLUI_FRAME_CLISTSUNKEN ? MF_CHECKED : MF_UNCHECKED)); diff --git a/plugins/Clist_nicer/SRC/clui.cpp b/plugins/Clist_nicer/SRC/clui.cpp index efe6989d81..ed0c228011 100644 --- a/plugins/Clist_nicer/SRC/clui.cpp +++ b/plugins/Clist_nicer/SRC/clui.cpp @@ -908,7 +908,7 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l } transparentFocus = 1; - CallService(MS_LANGPACK_TRANSLATEMENU, (WPARAM) GetMenu(hwnd), 0); + TranslateMenu(GetMenu(hwnd)); PostMessage(hwnd, M_CREATECLC, 0, 0); return FALSE; } diff --git a/plugins/ExternalAPI/m_toptoolbar.h b/plugins/ExternalAPI/m_toptoolbar.h index f67a3f965b..c366c05169 100644 --- a/plugins/ExternalAPI/m_toptoolbar.h +++ b/plugins/ExternalAPI/m_toptoolbar.h @@ -1,23 +1,25 @@ - #ifndef M_TOPTOOLBAR_H #define M_TOPTOOLBAR_H //button flags #define TTBBF_DISABLED 1 -#define TTBBF_VISIBLE 2 +#define TTBBF_VISIBLE 2 #define TTBBF_PUSHED 4 #define TTBBF_SHOWTOOLTIP 8 #define TTBBF_DRAWBORDER 16 #define TTBBF_ISSEPARATOR 32 -#define TTBBF_ISLBUTTON 64 -#define TTBBF_ICONBYHANDLE 128 +#define TTBBF_ISLBUTTON 64 +#define TTBBF_ICONBYHANDLE 128 +#define TTBBF_ISSBUTTON 256 typedef struct { int cbSize; - char *pszServiceUp; - char *pszServiceDown; + char *pszService; DWORD dwFlags; - LPARAM lParamUp; + union { + LPARAM lParamUp; + TCHAR *program; + }; WPARAM wParamUp; LPARAM lParamDown; WPARAM wParamDown; @@ -30,8 +32,6 @@ typedef struct { HICON hIconDn; HANDLE hIconHandleDn; }; - char *tooltipUp; - char *tooltipDn; } TTBButton, * lpTTBButton; diff --git a/plugins/Scriver/chat/window.c b/plugins/Scriver/chat/window.c index cc49d7172c..a1a295e49d 100644 --- a/plugins/Scriver/chat/window.c +++ b/plugins/Scriver/chat/window.c @@ -2123,7 +2123,7 @@ LABEL_SHOWWINDOW: mii.dwTypeData = TranslateTS((toolbarButtons[i].name)); InsertMenuItem(hToolbarMenu, i, TRUE, &mii); } -// CallService(MS_LANGPACK_TRANSLATEMENU, (WPARAM) hToolbarMenu, 0); +// TranslateMenu(hToolbarMenu); pt.x = (short) LOWORD(GetMessagePos()); pt.y = (short) HIWORD(GetMessagePos()); i = TrackPopupMenu(hToolbarMenu, TPM_RETURNCMD, pt.x, pt.y, 0, hwndDlg, NULL); diff --git a/plugins/Scriver/input.c b/plugins/Scriver/input.c index 8f61de3f8d..c941479b60 100644 --- a/plugins/Scriver/input.c +++ b/plugins/Scriver/input.c @@ -39,7 +39,7 @@ void InputAreaContextMenu(HWND hwnd, WPARAM wParam, LPARAM lParam, HANDLE hConta hMenu = LoadMenu(g_hInst, MAKEINTRESOURCE(IDR_CONTEXT)); hSubMenu = GetSubMenu(hMenu, 2); - CallService(MS_LANGPACK_TRANSLATEMENU, (WPARAM) hSubMenu, 0); + TranslateMenu(hSubMenu); SendMessage(hwnd, EM_EXGETSEL, 0, (LPARAM) & sel); if (sel.cpMin == sel.cpMax) { EnableMenuItem(hSubMenu, IDM_CUT, MF_BYCOMMAND | MF_GRAYED); @@ -409,7 +409,7 @@ BOOL HandleLinkClick(HINSTANCE hInstance, HWND hwndDlg, HWND hwndFocus, ENLINK * bOpenLink = FALSE; hMenu = LoadMenu(hInstance, MAKEINTRESOURCE(IDR_CONTEXT)); hSubMenu = GetSubMenu(hMenu, 1); - CallService(MS_LANGPACK_TRANSLATEMENU, (WPARAM) hSubMenu, 0); + TranslateMenu(hSubMenu); pt.x = (short) LOWORD(((ENLINK *) lParam)->lParam); pt.y = (short) HIWORD(((ENLINK *) lParam)->lParam); ClientToScreen(((NMHDR *) lParam)->hwndFrom, &pt); diff --git a/plugins/Scriver/msgdialog.c b/plugins/Scriver/msgdialog.c index 8f17470549..a260fa2034 100644 --- a/plugins/Scriver/msgdialog.c +++ b/plugins/Scriver/msgdialog.c @@ -341,7 +341,7 @@ static LRESULT CALLBACK LogEditSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, CHARRANGE sel, all = { 0, -1 }; hMenu = LoadMenu(g_hInst, MAKEINTRESOURCE(IDR_CONTEXT)); hSubMenu = GetSubMenu(hMenu, 0); - CallService(MS_LANGPACK_TRANSLATEMENU, (WPARAM) hSubMenu, 0); + TranslateMenu(hSubMenu); SendMessage(hwnd, EM_EXGETSEL, 0, (LPARAM) & sel); if (sel.cpMin == sel.cpMax) EnableMenuItem(hSubMenu, IDM_COPY, MF_BYCOMMAND | MF_GRAYED); @@ -1036,7 +1036,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP mii.dwTypeData = TranslateTS((toolbarButtons[i].name)); InsertMenuItem(hToolbarMenu, i, TRUE, &mii); } -// CallService(MS_LANGPACK_TRANSLATEMENU, (WPARAM) hToolbarMenu, 0); +// TranslateMenu(hToolbarMenu); pt.x = (short) LOWORD(GetMessagePos()); pt.y = (short) HIWORD(GetMessagePos()); i = TrackPopupMenu(hToolbarMenu, TPM_RETURNCMD, pt.x, pt.y, 0, hwndDlg, NULL); diff --git a/plugins/Scriver/msgwindow.c b/plugins/Scriver/msgwindow.c index cbbd0a3037..1bda12f9db 100644 --- a/plugins/Scriver/msgwindow.c +++ b/plugins/Scriver/msgwindow.c @@ -702,7 +702,7 @@ INT_PTR CALLBACK DlgProcParentWindow(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR MessageWindowTabData * mwtd = GetChildFromTab(dat->hwndTabs, tabId); hMenu = LoadMenu(g_hInst, MAKEINTRESOURCE(IDR_CONTEXT)); hSubMenu = GetSubMenu(hMenu, 3); - CallService(MS_LANGPACK_TRANSLATEMENU, (WPARAM) hSubMenu, 0); + TranslateMenu(hSubMenu); hUserMenu = (HMENU) SendMessage(mwtd->hwnd, DM_GETCONTEXTMENU, 0, 0); if (hUserMenu != NULL) { InsertMenu(hSubMenu, 0, MF_POPUP | MF_BYPOSITION, (UINT_PTR)hUserMenu, TranslateT("User Menu")); diff --git a/plugins/TabSRMM/chat/tools.cpp b/plugins/TabSRMM/chat/tools.cpp index 30aa3eba9e..3d8d54b381 100644 --- a/plugins/TabSRMM/chat/tools.cpp +++ b/plugins/TabSRMM/chat/tools.cpp @@ -943,7 +943,7 @@ UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO int pos; *hMenu = GetSubMenu(g_hMenu, iIndex); - CallService(MS_LANGPACK_TRANSLATEMENU, (WPARAM) *hMenu, 0); + TranslateMenu(*hMenu); gcmi.pszID = si->ptszID; gcmi.pszModule = si->pszModule; gcmi.pszUID = pszUID; diff --git a/plugins/TabSRMM/chat/window.cpp b/plugins/TabSRMM/chat/window.cpp index eba669e62d..175dc95d35 100644 --- a/plugins/TabSRMM/chat/window.cpp +++ b/plugins/TabSRMM/chat/window.cpp @@ -616,7 +616,7 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, RemoveMenu(hSubMenu, 8, MF_BYPOSITION); RemoveMenu(hSubMenu, 4, MF_BYPOSITION); EnableMenuItem(hSubMenu, IDM_PASTEFORMATTED, MF_BYCOMMAND | ((mi && mi->bBold) ? MF_ENABLED : MF_GRAYED)); - CallService(MS_LANGPACK_TRANSLATEMENU, (WPARAM) hSubMenu, 0); + TranslateMenu(hSubMenu); SendMessage(hwnd, EM_EXGETSEL, 0, (LPARAM) & sel); if (sel.cpMin == sel.cpMax) { @@ -2944,7 +2944,7 @@ LABEL_SHOWWINDOW: POINT pt; hSubMenu = GetSubMenu(g_hMenu, 2); - CallService(MS_LANGPACK_TRANSLATEMENU, (WPARAM) hSubMenu, 0); + TranslateMenu(hSubMenu); pt.x = (short) LOWORD(((ENLINK *) lParam)->lParam); pt.y = (short) HIWORD(((ENLINK *) lParam)->lParam); ClientToScreen(((NMHDR *) lParam)->hwndFrom, &pt); diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp index c924b06675..07a4462386 100644 --- a/plugins/TabSRMM/src/globals.cpp +++ b/plugins/TabSRMM/src/globals.cpp @@ -150,7 +150,7 @@ void CGlobals::reloadSystemStartup() dwThreadID = GetCurrentThreadId(); PluginConfig.g_hMenuContext = LoadMenu(g_hInst, MAKEINTRESOURCE(IDR_TABCONTEXT)); - CallService(MS_LANGPACK_TRANSLATEMENU, (WPARAM)g_hMenuContext, 0); + TranslateMenu(g_hMenuContext); SkinAddNewSoundEx("RecvMsgActive", "Instant messages", "Incoming (Focused Window)"); SkinAddNewSoundEx("RecvMsgInactive", "Instant messages", "Incoming (Unfocused Window)"); @@ -315,7 +315,7 @@ void CGlobals::reloadSettings(bool fReloadSkins) m_FlashOnMTN = M->GetByte(SRMSGMOD, SRMSGSET_SHOWTYPINGWINFLASH, SRMSGDEFSET_SHOWTYPINGWINFLASH); if(m_MenuBar == 0) { m_MenuBar = ::LoadMenu(g_hInst, MAKEINTRESOURCE(IDR_MENUBAR)); - CallService(MS_LANGPACK_TRANSLATEMENU, WPARAM(m_MenuBar), 0); + TranslateMenu(m_MenuBar); } m_ipBackgroundGradient = M->GetDword(FONTMODULE, "ipfieldsbg", 0x62caff); @@ -364,7 +364,7 @@ const HMENU CGlobals::getMenuBar() { if(m_MenuBar == 0) { m_MenuBar = ::LoadMenu(g_hInst, MAKEINTRESOURCE(IDR_MENUBAR)); - CallService(MS_LANGPACK_TRANSLATEMENU, WPARAM(m_MenuBar), 0); + TranslateMenu(m_MenuBar); } return(m_MenuBar); } diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index 9d70e9079e..1116c4139e 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -135,7 +135,7 @@ static void ShowPopupMenu(TWindowData *dat, int idFrom, HWND hwndFrom, POINT pt) CheckMenuItem(hSubMenu, ID_EDITOR_SHOWMESSAGELENGTHINDICATOR, MF_BYCOMMAND | (PluginConfig.m_visualMessageSizeIndicator ? MF_CHECKED : MF_UNCHECKED)); EnableMenuItem(hSubMenu, ID_EDITOR_SHOWMESSAGELENGTHINDICATOR, MF_BYCOMMAND | (dat->pContainer->hwndStatus ? MF_ENABLED : MF_GRAYED)); } - CallService(MS_LANGPACK_TRANSLATEMENU, (WPARAM) hSubMenu, 0); + TranslateMenu(hSubMenu); SendMessage(hwndFrom, EM_EXGETSEL, 0, (LPARAM) & sel); if (sel.cpMin == sel.cpMax) { EnableMenuItem(hSubMenu, IDM_COPY, MF_BYCOMMAND | MF_GRAYED); @@ -2320,7 +2320,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP hMenu = LoadMenu(g_hInst, MAKEINTRESOURCE(IDR_CONTEXT)); hSubMenu = GetSubMenu(hMenu, 1); - CallService(MS_LANGPACK_TRANSLATEMENU, (WPARAM) hSubMenu, 0); + TranslateMenu(hSubMenu); pt.x = (short) LOWORD(((ENLINK *) lParam)->lParam); pt.y = (short) HIWORD(((ENLINK *) lParam)->lParam); ClientToScreen(((NMHDR *) lParam)->hwndFrom, &pt); diff --git a/protocols/JabberG/jabber.cpp b/protocols/JabberG/jabber.cpp index ec417502f0..983ad4daea 100644 --- a/protocols/JabberG/jabber.cpp +++ b/protocols/JabberG/jabber.cpp @@ -2,7 +2,7 @@ Jabber Protocol Plugin for Miranda IM Copyright ( C ) 2002-04 Santithorn Bunchua -Copyright ( C ) 2005-11 George Hazan +Copyright ( C ) 2005-12 George Hazan Copyright ( C ) 2007 Maxim Mluhov This program is free software; you can redistribute it and/or @@ -57,7 +57,7 @@ PLUGININFOEX pluginInfo = { szVersion, "George Hazan, Maxim Mluhov, Victor Pavlychko, Artem Shpynov, Michael Stepura", "ghazan@miranda-im.org", - "(c) 2005-11 George Hazan, Maxim Mluhov, Victor Pavlychko, Artem Shpynov, Michael Stepura", + "(c) 2005-2012 George Hazan, Maxim Mluhov, Victor Pavlychko, Artem Shpynov, Michael Stepura", "http://miranda-im.org", UNICODE_AWARE, 0, diff --git a/protocols/JabberG/jabber_proxy.cpp b/protocols/JabberG/jabber_proxy.cpp index e6f7ef2f7b..c00b0b734c 100644 --- a/protocols/JabberG/jabber_proxy.cpp +++ b/protocols/JabberG/jabber_proxy.cpp @@ -100,25 +100,33 @@ int JabberHttpGatewayBegin( HANDLE /*hConn*/, NETLIBOPENCONNECTION* /*nloc*/ ) return 1; } -#if 0 -int icq_httpGatewayWrapSend( HANDLE hConn, PBYTE buf, int len, int flags, MIRANDASERVICE pfnNetlibSend ) +int JabberHttpGatewayWrapSend( HANDLE hConn, PBYTE buf, int len, int flags, MIRANDASERVICE pfnNetlibSend ) { - icq_packet packet; - int sendResult; + TCHAR* strb = mir_utf8decodeW(( char* )buf ); - packet.wLen = len; - write_httphdr( &packet, HTTP_PACKETTYPE_FLAP ); - packString( &packet, buf, ( WORD )len ); - sendResult = Netlib_Send( hConn, packet.pData, packet.wLen, flags ); - mir_free( packet.pData ); - if ( sendResult <= 0 ) - return sendResult; - if ( sendResult < 14 ) - return 0; - return sendResult - 14; + TCHAR sid[25] = _T(""); + unsigned __int64 rid = 0; + + XmlNode hPayLoad( strb ); + XmlNode body( _T("body")); + HXML hBody = body << XATTRI64( _T("rid"), rid++ ) << XATTR( _T("sid"), sid ) << + XATTR( _T("xmlns"), _T( "http://jabber.org/protocol/httpbind" )); + xmlAddChild( hBody, hPayLoad ); + + TCHAR* str = xi.toString( hBody, NULL ); + + mir_free( strb ); + char* utfStr = mir_utf8encodeT( str ); + NETLIBBUFFER nlb = { utfStr, (int)strlen( utfStr ), flags }; + int result = pfnNetlibSend(( WPARAM )hConn, ( LPARAM )&nlb); + mir_free( utfStr ); + xi.freeMem( str ); + + return result; } -PBYTE icq_httpGatewayUnwrapRecv( NETLIBHTTPREQUEST *nlhr, PBYTE buf, int len, int *outBufLen, void *( *NetlibRealloc )( void *, size_t )) +#if 0 +PBYTE JabberHttpGatewayUnwrapRecv( NETLIBHTTPREQUEST *nlhr, PBYTE buf, int len, int *outBufLen, void *( *NetlibRealloc )( void *, size_t )) { WORD wLen, wType; PBYTE tbuf; diff --git a/src/modules/clist/clc.cpp b/src/modules/clist/clc.cpp index e438e4d7b3..087cc34e30 100644 --- a/src/modules/clist/clc.cpp +++ b/src/modules/clist/clc.cpp @@ -58,7 +58,7 @@ HMENU fnBuildGroupPopupMenu( struct ClcGroup* group ) HMENU hGroupMenu = GetSubMenu(hMenu, 2); RemoveMenu(hMenu, 2, MF_BYPOSITION); DestroyMenu(hMenu); - CallService(MS_LANGPACK_TRANSLATEMENU, (WPARAM) hGroupMenu, 0); + TranslateMenu(hGroupMenu); CheckMenuItem(hGroupMenu, POPUP_GROUPHIDEOFFLINE, group->hideOffline ? MF_CHECKED : MF_UNCHECKED); return hGroupMenu; diff --git a/src/modules/clist/clisttray.cpp b/src/modules/clist/clisttray.cpp index 50707c5de7..8480c6026b 100644 --- a/src/modules/clist/clisttray.cpp +++ b/src/modules/clist/clisttray.cpp @@ -788,7 +788,7 @@ INT_PTR fnTrayIconProcessMessage(WPARAM wParam, LPARAM lParam) POINT pt; HMENU hMainMenu = LoadMenu(cli.hInst, MAKEINTRESOURCE(IDR_CONTEXT)); HMENU hMenu = GetSubMenu(hMainMenu, 0); - CallService(MS_LANGPACK_TRANSLATEMENU, (WPARAM) hMenu, 0); + TranslateMenu(hMenu); ZeroMemory(&mi, sizeof(mi)); mi.cbSize = MENUITEMINFO_V4_SIZE; diff --git a/src/modules/clist/clui.cpp b/src/modules/clist/clui.cpp index d5bceade30..8f128e7c25 100644 --- a/src/modules/clist/clui.cpp +++ b/src/modules/clist/clui.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* - Copyright 2000-2010 Miranda ICQ/IM project, + Copyright 2000-2010 Miranda ICQ/IM project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -11,7 +11,7 @@ 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, + 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. @@ -179,8 +179,8 @@ static INT_PTR MenuItem_DeleteContact(WPARAM wParam, LPARAM lParam) { //see notes about deleting contacts on PF1_SERVERCLIST servers in m_protosvc.h UINT_PTR action; - - if (DBGetContactSettingByte(NULL, "CList", "ConfirmDelete", SETTING_CONFIRMDELETE_DEFAULT) && + + if (DBGetContactSettingByte(NULL, "CList", "ConfirmDelete", SETTING_CONFIRMDELETE_DEFAULT) && !(GetKeyState(VK_SHIFT)&0x8000) ) // Ask user for confirmation, and if the contact should be archived (hidden, not deleted) action = DialogBoxParam(hMirandaInst, MAKEINTRESOURCE(IDD_DELETECONTACT), (HWND) lParam, AskForConfirmationDlgProc, wParam); @@ -205,8 +205,8 @@ static INT_PTR MenuItem_DeleteContact(WPARAM wParam, LPARAM lParam) if (status == ID_STATUS_OFFLINE || (status >= ID_STATUS_CONNECTING && status < ID_STATUS_CONNECTING + MAX_CONNECT_RETRIES)) { // Set a flag so we remember to delete the contact when the protocol goes online the next time DBWriteContactSettingByte((HANDLE) wParam, "CList", "Delete", 1); - MessageBox( NULL, - TranslateT("This contact is on an instant messaging system which stores its contact list on a central server. The contact will be removed from the server and from your contact list when you next connect to that network."), + MessageBox( NULL, + TranslateT("This contact is on an instant messaging system which stores its contact list on a central server. The contact will be removed from the server and from your contact list when you next connect to that network."), TranslateT("Delete Contact"), MB_OK); return 0; } } } @@ -292,7 +292,7 @@ int LoadCLUIModule(void) wndclass.hIconSm = NULL; RegisterClassEx(&wndclass); - wndclass.style = CS_HREDRAW | CS_VREDRAW | ((IsWinVerXPPlus() && + wndclass.style = CS_HREDRAW | CS_VREDRAW | ((IsWinVerXPPlus() && DBGetContactSettingByte(NULL, "CList", "WindowShadow", 0) == 1) ? CS_DROPSHADOW : 0); wndclass.lpfnWndProc = ContactListWndProc; wndclass.cbClsExtra = 0; @@ -304,7 +304,7 @@ int LoadCLUIModule(void) wndclass.lpszMenuName = MAKEINTRESOURCE(IDR_CLISTMENU); wndclass.lpszClassName = _T(MIRANDACLASS); wndclass.hIconSm = LoadSkinIcon(SKINICON_OTHER_MIRANDA); - RegisterClassEx(&wndclass); + RegisterClassEx(&wndclass); if (DBGetContactSettingTString(NULL, "CList", "TitleText", &dbv)) lstrcpyn(titleText, _T(MIRANDANAME), SIZEOF( titleText )); @@ -322,13 +322,13 @@ int LoadCLUIModule(void) Utils_AssertInsideScreen(&pos); cli.hwndContactList = CreateWindowEx( - (DBGetContactSettingByte(NULL, "CList", "ToolWindow", SETTING_TOOLWINDOW_DEFAULT) ? WS_EX_TOOLWINDOW : WS_EX_APPWINDOW), - _T(MIRANDACLASS), - titleText, + (DBGetContactSettingByte(NULL, "CList", "ToolWindow", SETTING_TOOLWINDOW_DEFAULT) ? WS_EX_TOOLWINDOW : WS_EX_APPWINDOW), + _T(MIRANDACLASS), + titleText, WS_POPUPWINDOW | WS_THICKFRAME | WS_CLIPCHILDREN | - (DBGetContactSettingByte(NULL, "CLUI", "ShowCaption", SETTING_SHOWCAPTION_DEFAULT) ? WS_CAPTION | WS_SYSMENU | - (DBGetContactSettingByte(NULL, "CList", "Min2Tray", SETTING_MIN2TRAY_DEFAULT) ? 0 : WS_MINIMIZEBOX) : 0), - pos.left, pos.top, pos.right - pos.left, pos.bottom - pos.top, + (DBGetContactSettingByte(NULL, "CLUI", "ShowCaption", SETTING_SHOWCAPTION_DEFAULT) ? WS_CAPTION | WS_SYSMENU | + (DBGetContactSettingByte(NULL, "CList", "Min2Tray", SETTING_MIN2TRAY_DEFAULT) ? 0 : WS_MINIMIZEBOX) : 0), + pos.left, pos.top, pos.right - pos.left, pos.bottom - pos.top, NULL, NULL, cli.hInst, NULL); if (DBGetContactSettingByte(NULL, "CList", "OnDesktop", 0)) { @@ -350,8 +350,8 @@ int LoadCLUIModule(void) ShowWindow(cli.hwndContactList, SW_SHOW); else if (state == SETTING_STATE_MINIMIZED) ShowWindow(cli.hwndContactList, SW_SHOWMINIMIZED); - SetWindowPos(cli.hwndContactList, - DBGetContactSettingByte(NULL, "CList", "OnTop", SETTING_ONTOP_DEFAULT) ? HWND_TOPMOST : HWND_NOTOPMOST, + SetWindowPos(cli.hwndContactList, + DBGetContactSettingByte(NULL, "CList", "OnTop", SETTING_ONTOP_DEFAULT) ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE); } { @@ -455,12 +455,12 @@ void fnDrawMenuItem(DRAWITEMSTRUCT *dis, HICON hIcon, HICON eventIcon) #define M_CREATECLC (WM_USER+1) LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { - if (msg == uMsgProcessProfile) + if (msg == uMsgProcessProfile) { TCHAR profile[MAX_PATH]; int rc; // wParam = (ATOM)hProfileAtom, lParam = 0 - if (GlobalGetAtomName((ATOM) wParam, profile, SIZEOF(profile))) + if (GlobalGetAtomName((ATOM) wParam, profile, SIZEOF(profile))) { TCHAR *pfd = Utils_ReplaceVarsT(_T("%miranda_userdata%\\%miranda_profilename%.dat")); rc = lstrcmpi(profile, pfd) == 0; @@ -503,7 +503,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM return DefWindowProc(hwnd, msg, wParam, lParam); } case WM_CREATE: - CallService(MS_LANGPACK_TRANSLATEMENU, (WPARAM) GetMenu(hwnd), 0); + TranslateMenu(GetMenu(hwnd)); DrawMenuBar(hwnd); //create the status wnd @@ -527,7 +527,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM return FALSE; case M_CREATECLC: - cli.hwndContactTree = CreateWindow( CLISTCONTROL_CLASS, _T(""), + cli.hwndContactTree = CreateWindow( CLISTCONTROL_CLASS, _T(""), WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | CLS_CONTACTLIST | (DBGetContactSettingByte(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT) ? CLS_USEGROUPS : 0) @@ -584,17 +584,17 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM rcStatus.top = rcStatus.bottom = 0; SetWindowPos(cli.hwndContactTree, NULL, 0, 0, rect.right, rect.bottom - (rcStatus.bottom - rcStatus.top), SWP_NOZORDER); } - if (wParam == SIZE_MINIMIZED) + if (wParam == SIZE_MINIMIZED) { - if ((GetWindowLongPtr(hwnd, GWL_EXSTYLE) & WS_EX_TOOLWINDOW) || - DBGetContactSettingByte(NULL, "CList", "Min2Tray", SETTING_MIN2TRAY_DEFAULT)) + if ((GetWindowLongPtr(hwnd, GWL_EXSTYLE) & WS_EX_TOOLWINDOW) || + DBGetContactSettingByte(NULL, "CList", "Min2Tray", SETTING_MIN2TRAY_DEFAULT)) { ShowWindow(hwnd, SW_HIDE); DBWriteContactSettingByte(NULL, "CList", "State", SETTING_STATE_HIDDEN); } else DBWriteContactSettingByte(NULL, "CList", "State", SETTING_STATE_MINIMIZED); - + if (MySetProcessWorkingSetSize != NULL && DBGetContactSettingByte(NULL, "CList", "DisableWorkingSet", 1)) MySetProcessWorkingSetSize(GetCurrentProcess(), -1, -1); } @@ -711,7 +711,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM thisTick = GetTickCount(); if (thisTick >= startTick + 200) break; - setLayeredWindowAttributes(hwnd, RGB(0, 0, 0), + setLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (BYTE) (sourceAlpha + (destAlpha - sourceAlpha) * (int) (thisTick - startTick) / 200), LWA_ALPHA); } setLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (BYTE) destAlpha, LWA_ALPHA); @@ -741,15 +741,15 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM case SC_MINIMIZE: case SC_CLOSE: - if ((GetWindowLongPtr(hwnd, GWL_EXSTYLE) & WS_EX_TOOLWINDOW) || - DBGetContactSettingByte(NULL, "CList", "Min2Tray", SETTING_MIN2TRAY_DEFAULT)) + if ((GetWindowLongPtr(hwnd, GWL_EXSTYLE) & WS_EX_TOOLWINDOW) || + DBGetContactSettingByte(NULL, "CList", "Min2Tray", SETTING_MIN2TRAY_DEFAULT)) { ShowWindow(hwnd, SW_HIDE); DBWriteContactSettingByte(NULL, "CList", "State", SETTING_STATE_HIDDEN); if (MySetProcessWorkingSetSize != NULL && DBGetContactSettingByte(NULL, "CList", "DisableWorkingSet", 1)) MySetProcessWorkingSetSize(GetCurrentProcess(), -1, -1); - + return 0; } else if (wParam == SC_CLOSE) @@ -813,7 +813,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM if (wParam == SPI_SETWORKAREA && (GetWindowLongPtr(hwnd, GWL_STYLE) & (WS_VISIBLE | WS_MINIMIZE)) == WS_VISIBLE && !CallService(MS_CLIST_DOCKINGISDOCKED, 0, 0)) { - RECT rc; + RECT rc; GetWindowRect(hwnd, &rc); if (Utils_AssertInsideScreen(&rc) == 1) MoveWindow(hwnd, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, TRUE); @@ -882,7 +882,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM maxHeight = DBGetContactSettingByte(NULL, "CLUI", "MaxSizeHeight", 75); GetWindowRect(hwnd, &rcWindow); GetWindowRect(cli.hwndContactTree, &rcTree); - + SystemParametersInfo(SPI_GETWORKAREA, 0, &rcWorkArea, FALSE); if (MyMonitorFromWindow) { @@ -906,7 +906,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM if (rcWindow.bottom > rcWorkArea.bottom) rcWindow.bottom = rcWorkArea.bottom; } - SetWindowPos(hwnd, 0, rcWindow.left, rcWindow.top, rcWindow.right - rcWindow.left, rcWindow.bottom - rcWindow.top, + SetWindowPos(hwnd, 0, rcWindow.left, rcWindow.top, rcWindow.right - rcWindow.left, rcWindow.bottom - rcWindow.top, SWP_NOZORDER | SWP_NOACTIVATE); break; } @@ -953,9 +953,9 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM int mcnt = GetMenuItemCount(hMenu); for (int i=0; ircItem.left; if (showOpts & 1) { HICON hIcon = LoadSkinProtoIcon(szProto, status); - DrawIconEx(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - g_IconHeight) >> 1, hIcon, + DrawIconEx(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - g_IconHeight) >> 1, hIcon, g_IconWidth, g_IconHeight, 0, NULL, DI_NORMAL); IconLib_ReleaseIcon(hIcon, 0); if ( Proto_IsAccountLocked( Proto_GetAccount( szProto ))) { hIcon = LoadSkinnedIcon(SKINICON_OTHER_STATUS_LOCKED); if (hIcon != NULL) { - DrawIconEx(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - g_IconHeight) >> 1, hIcon, + DrawIconEx(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - g_IconHeight) >> 1, hIcon, g_IconWidth, g_IconHeight, 0, NULL, DI_NORMAL); IconLib_ReleaseIcon(hIcon, 0); } diff --git a/src/modules/findadd/searchresults.cpp b/src/modules/findadd/searchresults.cpp index ab5fd3fdf8..81ca1d661a 100644 --- a/src/modules/findadd/searchresults.cpp +++ b/src/modules/findadd/searchresults.cpp @@ -2,8 +2,8 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, -all portions of this codebase are copyrighted to the people +Copyright 2000-2009 Miranda ICQ/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 @@ -11,7 +11,7 @@ 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, +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. @@ -24,12 +24,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "findadd.h" enum { - COLUMNID_PROTO, - COLUMNID_HANDLE, - COLUMNID_NICK, - COLUMNID_FIRST, - COLUMNID_LAST, - COLUMNID_EMAIL, + COLUMNID_PROTO, + COLUMNID_HANDLE, + COLUMNID_NICK, + COLUMNID_FIRST, + COLUMNID_LAST, + COLUMNID_EMAIL, NUM_COLUMNID }; @@ -73,16 +73,16 @@ void LoadColumnSizes(HWND hwndResults, const char *szProto) columnCount = NUM_COLUMNID; colOrdersValid = true; - for (i=0; i < NUM_COLUMNID; i++) + for (i=0; i < NUM_COLUMNID; i++) { LVCOLUMN lvc; - if ( i < columnCount ) + if ( i < columnCount ) { int bNeedsFree = FALSE; lvc.mask = LVCF_TEXT | LVCF_WIDTH; if ( szColumnNames[i] != NULL ) lvc.pszText = TranslateTS( szColumnNames[i] ); - else if ( i == COLUMNID_HANDLE ) + else if ( i == COLUMNID_HANDLE ) { if (szProto) { @@ -96,7 +96,7 @@ void LoadColumnSizes(HWND hwndResults, const char *szProto) mir_snprintf(szSetting, SIZEOF(szSetting), "ColWidth%d", i); lvc.cx = DBGetContactSettingWord(NULL, "FindAdd", szSetting, defaultColumnSizes[i]); ListView_InsertColumn(hwndResults, i, (LPARAM)&lvc); - + if (bNeedsFree) mir_free(lvc.pszText); } @@ -105,7 +105,7 @@ void LoadColumnSizes(HWND hwndResults, const char *szProto) if (columnOrder[i] == -1 || columnOrder[i] >= NUM_COLUMNID) colOrdersValid = false; } - if (colOrdersValid) + if (colOrdersValid) ListView_SetColumnOrderArray(hwndResults, columnCount, columnOrder); dat->iLastColumnSortIndex = DBGetContactSettingByte(NULL, "FindAdd", "SortColumn", COLUMNID_NICK); @@ -159,7 +159,7 @@ int CALLBACK SearchResultsCompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lPa return lstrcmpi(lsr1->psr.email, lsr2->psr.email)*sortMultiplier; } } - else + else { TCHAR szText1[100]; TCHAR szText2[100]; @@ -196,8 +196,8 @@ static void BeginSearchFailed(void * arg) TCHAR buf[128]; if ( arg != NULL ) { const TCHAR* protoName = (TCHAR*)arg; - mir_sntprintf(buf, SIZEOF(buf), - TranslateT("Could not start a search on '%s', there was a problem - is %s connected?"), + mir_sntprintf(buf, SIZEOF(buf), + TranslateT("Could not start a search on '%s', there was a problem - is %s connected?"), protoName, protoName); mir_free((char*)arg); } @@ -267,9 +267,9 @@ void SetStatusBarSearchInfo(HWND hwndStatus, struct FindAddDlgData *dat) lstrcat(str, pa->tszAccountName ); } } else lstrcpy(str, TranslateT("Idle")); - + SendMessage( hwndStatus, SB_SETTEXT, 0, (LPARAM)str ); -} +} struct ProtoResultsSummary { const char *szProto; @@ -360,7 +360,7 @@ void ShowMoreOptionsMenu(HWND hwndDlg, int x, int y) hMenu=LoadMenu(hMirandaInst, MAKEINTRESOURCE(IDR_CONTEXT)); hPopupMenu=GetSubMenu(hMenu, 4); - CallService(MS_LANGPACK_TRANSLATEMENU, (WPARAM)hPopupMenu, 0); + TranslateMenu(hPopupMenu); commandId=TrackPopupMenu(hPopupMenu, TPM_RIGHTBUTTON|TPM_RETURNCMD, x, y, 0, hwndDlg, NULL); switch(commandId) { case IDC_ADD: @@ -389,5 +389,3 @@ void ShowMoreOptionsMenu(HWND hwndDlg, int x, int y) DestroyMenu(hPopupMenu); DestroyMenu(hMenu); } - - diff --git a/src/modules/icolib/skin2icons.cpp b/src/modules/icolib/skin2icons.cpp index 2e328bbb89..2c2776d523 100644 --- a/src/modules/icolib/skin2icons.cpp +++ b/src/modules/icolib/skin2icons.cpp @@ -1031,7 +1031,7 @@ static int OpenPopupMenu(HWND hwndDlg) GetCursorPos(&pt); hMenu = LoadMenu( hMirandaInst, MAKEINTRESOURCE( IDR_ICOLIB_CONTEXT )); hPopup = GetSubMenu( hMenu, 0 ); - CallService( MS_LANGPACK_TRANSLATEMENU, ( WPARAM )hPopup, 0 ); + TranslateMenu(hPopup); cmd = TrackPopupMenu( hPopup, TPM_RIGHTBUTTON|TPM_RETURNCMD, pt.x, pt.y, 0, hwndDlg, NULL ); DestroyMenu( hMenu ); return cmd; diff --git a/src/modules/srurl/urldialogs.cpp b/src/modules/srurl/urldialogs.cpp index 54ef22c5cc..8e6be8347a 100644 --- a/src/modules/srurl/urldialogs.cpp +++ b/src/modules/srurl/urldialogs.cpp @@ -168,7 +168,7 @@ INT_PTR CALLBACK DlgProcUrlRecv(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP hMenu=LoadMenu(hMirandaInst, MAKEINTRESOURCE(IDR_CONTEXT)); hSubMenu=GetSubMenu(hMenu, 6); - CallService(MS_LANGPACK_TRANSLATEMENU, (WPARAM)hSubMenu, 0); + TranslateMenu(hSubMenu); GetWindowRect((HWND)lParam, &rc); GetDlgItemTextA(hwndDlg, IDC_URL, url, SIZEOF(url)); switch(TrackPopupMenu(hSubMenu, TPM_RETURNCMD, rc.left, rc.bottom, 0, hwndDlg, NULL)) { -- cgit v1.2.3