From f8a2931aff174ded0a69b7b5933dd27337cbb134 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 26 Jan 2013 21:04:38 +0000 Subject: SKINICON_OTHER_FRAME for all plugins git-svn-id: http://svn.miranda-ng.org/main/trunk@3297 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/AutoShutdown/src/frame.cpp | 46 ++-- plugins/BASS_interface/src/Main.cpp | 6 +- .../Clist_modern/src/hdr/modern_commonheaders.h | 2 - plugins/Clist_modern/src/modern_clcopts.cpp | 6 +- plugins/Clist_modern/src/modern_clistevents.cpp | 2 +- plugins/Clist_modern/src/modern_clisttray.cpp | 134 +++++------- plugins/Clist_modern/src/modern_clui.cpp | 9 +- plugins/Clist_modern/src/modern_cluiframes.cpp | 4 +- plugins/Clist_modern/src/modern_framesmenu.cpp | 188 +++++++--------- plugins/Clist_modern/src/modern_groupmenu.cpp | 66 ++---- plugins/Clist_modern/src/modern_statusbar.cpp | 2 +- plugins/Clist_modern/src/modern_toolbar.cpp | 2 +- plugins/Clist_modern/src/modern_viewmodebar.cpp | 2 +- plugins/Clist_mw/clist_mw_11.vcxproj.filters | 9 +- plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp | 127 +++++------ plugins/Clist_mw/src/CLUIFrames/statusbar.cpp | 2 +- plugins/Clist_mw/src/clui.cpp | 2 +- plugins/Clist_nicer/src/clui.cpp | 2 +- plugins/MyDetails/src/frame.cpp | 236 ++++++++++----------- plugins/Ping/src/pingthread.cpp | 128 +++++------ plugins/TopToolBar/src/toolbarwnd.cpp | 2 +- plugins/Weather/src/weather_mwin.cpp | 40 ++-- 22 files changed, 433 insertions(+), 584 deletions(-) (limited to 'plugins') diff --git a/plugins/AutoShutdown/src/frame.cpp b/plugins/AutoShutdown/src/frame.cpp index 33f0d53260..e6fb90a317 100644 --- a/plugins/AutoShutdown/src/frame.cpp +++ b/plugins/AutoShutdown/src/frame.cpp @@ -33,9 +33,9 @@ static HANDLE hHookModulesLoaded; #define FRAMEELEMENT_BAR 1 #define FRAMEELEMENT_BKGRND 2 #define FRAMEELEMENT_TEXT 3 -static COLORREF GetDefaultColor(BYTE id) -{ - switch(id) { +static COLORREF GetDefaultColor(BYTE id) +{ + switch(id) { case FRAMEELEMENT_BAR: return RGB(250,0,0); /* same color as used on header icon */ case FRAMEELEMENT_BKGRND: @@ -46,8 +46,8 @@ static COLORREF GetDefaultColor(BYTE id) return 0; /* never happens */ } -static LOGFONT* GetDefaultFont(LOGFONT *lf) -{ +static LOGFONT* GetDefaultFont(LOGFONT *lf) +{ NONCLIENTMETRICS ncm; ZeroMemory(&ncm,sizeof(ncm)); ncm.cbSize=sizeof(ncm); @@ -56,7 +56,7 @@ static LOGFONT* GetDefaultFont(LOGFONT *lf) return lf; } return (LOGFONT*)NULL; -} +} static HICON SetFrameTitleIcon(WORD hFrame,HICON hNewIcon) { @@ -67,8 +67,8 @@ static HICON SetFrameTitleIcon(WORD hFrame,HICON hNewIcon) return hPrevIcon; } -static LRESULT CALLBACK ProgressBarSubclassProc(HWND hwndProgress,UINT msg,WPARAM wParam,LPARAM lParam) -{ +static LRESULT CALLBACK ProgressBarSubclassProc(HWND hwndProgress,UINT msg,WPARAM wParam,LPARAM lParam) +{ switch(msg) { case WM_ERASEBKGND: return TRUE; @@ -76,8 +76,8 @@ static LRESULT CALLBACK ProgressBarSubclassProc(HWND hwndProgress,UINT msg,WPARA case WM_LBUTTONDBLCLK: return SendMessage(GetParent(hwndProgress),msg,wParam,lParam); } - return CallWindowProc((WNDPROC)GetWindowLongPtr(hwndProgress, GWLP_USERDATA), hwndProgress, msg, wParam, lParam); -} + return CallWindowProc((WNDPROC)GetWindowLongPtr(hwndProgress, GWLP_USERDATA), hwndProgress, msg, wParam, lParam); +} /************************* Window Class *******************************/ @@ -118,7 +118,7 @@ struct CountdownFrameWndData { /* sizeof=57, max cbClsExtra=40 on Win32 */ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame,UINT msg,WPARAM wParam,LPARAM lParam) { struct CountdownFrameWndData *dat=(struct CountdownFrameWndData*)GetWindowLongPtr(hwndFrame, GWLP_USERDATA); - + switch(msg) { case WM_NCCREATE: /* init window data */ dat=(struct CountdownFrameWndData*)mir_calloc(sizeof(*dat)); @@ -138,7 +138,7 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame,UINT msg,WPARAM wParam,LPARA GetSystemMetrics(SM_CYICON), hwndFrame, NULL, - params->hInstance, + params->hInstance, NULL); dat->hwndProgress=CreateWindowEx(WS_EX_NOPARENTNOTIFY, PROGRESS_CLASS, @@ -149,7 +149,7 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame,UINT msg,WPARAM wParam,LPARA (GetSystemMetrics(SM_CXICON)/2)-5, hwndFrame, NULL, - params->hInstance, + params->hInstance, NULL); if(dat->hwndProgress==NULL) return -1; /* creation failed, calls WM_DESTROY */ SendMessage(dat->hwndProgress,PBM_SETSTEP,(WPARAM)1,0); @@ -164,7 +164,7 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame,UINT msg,WPARAM wParam,LPARA (GetSystemMetrics(SM_CXICON)/2), hwndFrame, NULL, - params->hInstance, + params->hInstance, NULL); dat->hwndTime=CreateWindowEx(WS_EX_NOPARENTNOTIFY, _T("Static"), @@ -176,7 +176,7 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame,UINT msg,WPARAM wParam,LPARA (GetSystemMetrics(SM_CXICON)/2), hwndFrame, NULL, - params->hInstance, + params->hInstance, NULL); if(dat->hwndTime==NULL) return -1; /* creation failed, calls WM_DESTROY */ /* create tooltips */ @@ -185,7 +185,7 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame,UINT msg,WPARAM wParam,LPARA dat->hwndToolTip=CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, NULL, - WS_POPUP|TTS_ALWAYSTIP|TTS_NOPREFIX, + WS_POPUP|TTS_ALWAYSTIP|TTS_NOPREFIX, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, hwndFrame, @@ -233,7 +233,7 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame,UINT msg,WPARAM wParam,LPARA UnhookEvent(dat->hHookFontsChanged); UnhookEvent(dat->hHookIconsChanged); /* other childs are destroyed automatically */ - if(dat->hwndToolTip!=NULL) DestroyWindow(dat->hwndToolTip); + if(dat->hwndToolTip!=NULL) DestroyWindow(dat->hwndToolTip); hIcon=(HICON)SendMessage(dat->hwndIcon,STM_SETIMAGE,IMAGE_ICON,0); Skin_ReleaseIcon(hIcon); /* does NULL check */ break; @@ -244,7 +244,7 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame,UINT msg,WPARAM wParam,LPARA if(dat->hbrBackground!=NULL) DeleteObject(dat->hbrBackground); mir_free(dat); SetWindowLongPtr(hwndFrame, GWLP_USERDATA, (LONG)NULL); - break; + break; case WM_SIZE: { RECT rc; LONG width,height; @@ -272,7 +272,7 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame,UINT msg,WPARAM wParam,LPARA clrBar=GetDefaultColor(FRAMEELEMENT_BAR); if(FontService_GetColor(TranslateT("Automatic Shutdown"),TranslateT("Background"),&dat->clrBackground)) dat->clrBackground=GetDefaultColor(FRAMEELEMENT_BKGRND); - if(dat->hbrBackground!=NULL) DeleteObject(dat->hbrBackground); + if(dat->hbrBackground!=NULL) DeleteObject(dat->hbrBackground); dat->hbrBackground=CreateSolidBrush(dat->clrBackground); SendMessage(dat->hwndProgress,PBM_SETBARCOLOR,0,(LPARAM)clrBar); SendMessage(dat->hwndProgress,PBM_SETBKCOLOR,0,(LPARAM)dat->clrBackground); @@ -417,7 +417,7 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame,UINT msg,WPARAM wParam,LPARA RECT rc; /* position in middle above rect */ if(!GetWindowRect(hwndFrame, &rc)) return 0; - pt.x=rc.left+((int)(rc.right-rc.left)/2); + pt.x=rc.left+((int)(rc.right-rc.left)/2); pt.y=rc.top+((int)(rc.bottom-rc.top)/2); } hContextMenu=CreatePopupMenu(); @@ -513,7 +513,7 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame,UINT msg,WPARAM wParam,LPARA } break; } - return DefWindowProc(hwndFrame,msg,wParam,lParam); + return DefWindowProc(hwndFrame,msg,wParam,lParam); } /************************* Show Frame *********************************/ @@ -534,9 +534,7 @@ void ShowCountdownFrame(WORD fTimeFlags) if(hwndCountdownFrame==NULL) return; if(ServiceExists(MS_CLIST_FRAMES_ADDFRAME)) { - CLISTFrame clf; - ZeroMemory(&clf,sizeof(clf)); - clf.cbSize=sizeof(clf); + CLISTFrame clf = { sizeof(clf) }; clf.hIcon=Skin_GetIcon("AutoShutdown_Active"); /* CListFrames does not make a copy */ clf.align=alBottom; clf.height=GetSystemMetrics(SM_CYICON); diff --git a/plugins/BASS_interface/src/Main.cpp b/plugins/BASS_interface/src/Main.cpp index 944a03d893..bc4c0db1ca 100644 --- a/plugins/BASS_interface/src/Main.cpp +++ b/plugins/BASS_interface/src/Main.cpp @@ -451,7 +451,7 @@ void CreateFrame() wndclass.lpszClassName = _T("BassInterfaceFrame"); RegisterClass(&wndclass); - hwnd_plugin = CreateWindow(_T("BassInterfaceFrame"), TranslateT("Bass Interface"), + hwnd_plugin = CreateWindow(_T("BassInterfaceFrame"), TranslateT("Bass Interface"), WS_CHILD | WS_CLIPCHILDREN, 0, 0, 10, 10, (HWND)CallService(MS_CLUI_GETHWND, 0, 0), NULL, hInst, NULL); CLISTFrame Frame = {sizeof(CLISTFrame)}; @@ -460,7 +460,7 @@ void CreateFrame() Frame.align = alBottom; Frame.Flags = F_TCHAR | F_VISIBLE | F_SHOWTB | F_SHOWTBTIP; Frame.height = 22; - Frame.hIcon = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA); + Frame.hIcon = LoadSkinnedIcon(SKINICON_OTHER_FRAME); frame_id = (HANDLE)CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&Frame, 0); ColourIDT colourid = {0}; @@ -578,7 +578,7 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam) int OnSettingChanged(WPARAM wParam, LPARAM lParam) { - if (wParam != 0 || lParam == NULL) + if (wParam != 0 || lParam == NULL) return 0; DBCONTACTWRITESETTING *dbcws=(DBCONTACTWRITESETTING*)lParam; diff --git a/plugins/Clist_modern/src/hdr/modern_commonheaders.h b/plugins/Clist_modern/src/hdr/modern_commonheaders.h index c8aa087968..c085350474 100644 --- a/plugins/Clist_modern/src/hdr/modern_commonheaders.h +++ b/plugins/Clist_modern/src/hdr/modern_commonheaders.h @@ -255,8 +255,6 @@ HWND WINAPI MyGetAncestor( HWND, UINT ); typedef BOOL (WINAPI *pfnGetMenuBarInfo)( HWND, LONG, LONG, PMENUBARINFO ); extern pfnGetMenuBarInfo fnGetMenuBarInfo; -void FreeAndNil( void **p ); - extern SortedList *clistCache; HICON LoadSmallIcon(HINSTANCE hInstance, LPCTSTR lpIconName); diff --git a/plugins/Clist_modern/src/modern_clcopts.cpp b/plugins/Clist_modern/src/modern_clcopts.cpp index c735ab547c..a2d7680a54 100644 --- a/plugins/Clist_modern/src/modern_clcopts.cpp +++ b/plugins/Clist_modern/src/modern_clcopts.cpp @@ -2028,10 +2028,8 @@ int ModernOptInit(WPARAM wParam,LPARAM lParam) MODERNOPT_CTRL_LAST }; - MODERNOPTOBJECT obj = {0}; - - obj.cbSize = sizeof(obj); - obj.dwFlags = MODEROPT_FLG_TCHAR|MODEROPT_FLG_NORESIZE; + MODERNOPTOBJECT obj = { sizeof(obj) }; + obj.dwFlags = MODEROPT_FLG_TCHAR | MODEROPT_FLG_NORESIZE; obj.hIcon = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA); obj.hInstance = g_hInst; obj.iSection = MODERNOPT_PAGE_CLIST; diff --git a/plugins/Clist_modern/src/modern_clistevents.cpp b/plugins/Clist_modern/src/modern_clistevents.cpp index f15f7f0045..016a1a5304 100644 --- a/plugins/Clist_modern/src/modern_clistevents.cpp +++ b/plugins/Clist_modern/src/modern_clistevents.cpp @@ -429,7 +429,7 @@ int EventArea_Create(HWND hCluiWnd) CLISTFrame Frame = { sizeof(CLISTFrame) }; Frame.hWnd = g_CluiData.hwndEventFrame; Frame.align = alBottom; - Frame.hIcon = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA); + Frame.hIcon = LoadSkinnedIcon(SKINICON_OTHER_FRAME); Frame.Flags = (db_get_b(NULL,"CLUI","ShowEventArea",SETTING_SHOWEVENTAREAFRAME_DEFAULT)?F_VISIBLE:0)|F_LOCKED|F_NOBORDER|F_NO_SUBCONTAINER|F_TCHAR; Frame.height = h; Frame.tname = _T("EventArea"); //do not translate diff --git a/plugins/Clist_modern/src/modern_clisttray.cpp b/plugins/Clist_modern/src/modern_clisttray.cpp index 03414ab7f9..9e8c143ece 100644 --- a/plugins/Clist_modern/src/modern_clisttray.cpp +++ b/plugins/Clist_modern/src/modern_clisttray.cpp @@ -590,12 +590,10 @@ INT_PTR TrayMenuExecService(WPARAM wParam,LPARAM lParam) { INT_PTR FreeOwnerDataTrayMenu (WPARAM wParam,LPARAM lParam) { - - lpTrayMenuExecParam mmep; - mmep = (lpTrayMenuExecParam)lParam; - if (mmep != NULL){ - FreeAndNil((void**)&mmep->szServiceName); - FreeAndNil((void**)&mmep); + lpTrayMenuExecParam mmep = (lpTrayMenuExecParam)lParam; + if (mmep != NULL) { + mir_free(mmep->szServiceName); + mir_free(mmep); } return 0; @@ -603,9 +601,6 @@ INT_PTR FreeOwnerDataTrayMenu (WPARAM wParam,LPARAM lParam) void InitTrayMenus(void) { - TMenuParam tmp; - OptParam op; - CreateServiceFunction("CLISTMENUSTRAY/ExecService",TrayMenuExecService); CreateServiceFunction("CLISTMENUSTRAY/FreeOwnerDataTrayMenu",FreeOwnerDataTrayMenu); CreateServiceFunction("CLISTMENUSTRAY/TrayMenuonAddService",TrayMenuonAddService); @@ -614,16 +609,14 @@ void InitTrayMenus(void) CreateServiceFunction(MS_CLIST_REMOVETRAYMENUITEM,RemoveTrayMenuItem); CreateServiceFunction(MS_CLIST_MENUBUILDTRAY,BuildTrayMenu); - //Tray menu - memset(&tmp,0,sizeof(tmp)); - tmp.cbSize = sizeof(tmp); + TMenuParam tmp = { sizeof(tmp) }; tmp.CheckService = NULL; tmp.ExecService = "CLISTMENUSTRAY/ExecService"; tmp.name = "TrayMenu"; hTrayMenuObject = (HANDLE)CallService(MO_CREATENEWMENUOBJECT,0,(LPARAM)&tmp); - + OptParam op; op.Handle = hTrayMenuObject; op.Setting = OPT_USERDEFINEDITEMS; op.Value = TRUE; @@ -639,77 +632,50 @@ void InitTrayMenus(void) op.Value = (INT_PTR)"CLISTMENUSTRAY/TrayMenuonAddService"; CallService(MO_SETOPTIONSMENUOBJECT,0,(LPARAM)&op); - { - //add exit command to menu - CLISTMENUITEM mi = { sizeof(mi) }; - mi.position = 900000; - mi.pszService = "CloseAction"; - mi.pszName = LPGEN("E&xit"); - mi.flags = CMIF_ICONFROMICOLIB; - mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_EXIT); - AddTrayMenuItem(0,(LPARAM)&mi); - DestroyIcon_protect(mi.hIcon); - - memset(&mi,0,sizeof(mi)); - mi.cbSize = sizeof(mi); - mi.position = 100000; - mi.pszService = MS_CLIST_SHOWHIDE; - mi.pszName = LPGEN("&Hide/Show"); - mi.flags = CMIF_ICONFROMICOLIB; - mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_SHOWHIDE); - hTrayHideShowMainMenuItem = (HANDLE)AddTrayMenuItem(0,(LPARAM)&mi); - DestroyIcon_protect(mi.hIcon); - - memset(&mi,0,sizeof(mi)); - mi.cbSize = sizeof(mi); - mi.position = 200000; - mi.flags = CMIF_ICONFROMICOLIB; - mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_FINDUSER); - mi.pszService = "FindAdd/FindAddCommand"; - mi.pszName = LPGEN("&Find/Add Contacts..."); - AddTrayMenuItem(0,(LPARAM)&mi); - DestroyIcon_protect(mi.hIcon); - - memset(&mi,0,sizeof(mi)); - mi.cbSize = sizeof(mi); - mi.position = 300000; - mi.flags = CMIF_ICONFROMICOLIB; // eternity #004 - mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_MAINMENU); // eternity #004 - mi.pszService = "FakeService_1"; - mi.pszName = LPGEN("&Main Menu"); - hTrayMainMenuItemProxy = (HANDLE)AddTrayMenuItem(0,(LPARAM)&mi); - DestroyIcon_protect(mi.hIcon); // eternity #004 - - memset(&mi,0,sizeof(mi)); - mi.cbSize = sizeof(mi); - mi.position = 300100; - mi.pszService = "FakeService_2"; - mi.flags = CMIF_ICONFROMICOLIB; // eternity #004 - mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_STATUS); // eternity #004 - mi.pszName = LPGEN("&Status"); - hTrayStatusMenuItemProxy = (HANDLE)AddTrayMenuItem(0,(LPARAM)&mi); - DestroyIcon_protect(mi.hIcon); // eternity #004 - - memset(&mi,0,sizeof(mi)); - mi.cbSize = sizeof(mi); - mi.position = 400000; - mi.flags = CMIF_ICONFROMICOLIB; - mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_OPTIONS); - mi.pszService = "Options/OptionsCommand"; - mi.pszName = LPGEN("&Options..."); - AddTrayMenuItem(0,(LPARAM)&mi); - DestroyIcon_protect(mi.hIcon); - - memset(&mi,0,sizeof(mi)); - mi.cbSize = sizeof(mi); - mi.position = 500000; - mi.flags = CMIF_ICONFROMICOLIB; - mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_MIRANDA); - mi.pszService = "Help/AboutCommand"; - mi.pszName = LPGEN("&About"); - AddTrayMenuItem(0,(LPARAM)&mi); - DestroyIcon_protect(mi.hIcon); - } + //add exit command to menu + CLISTMENUITEM mi = { sizeof(mi) }; + mi.position = 900000; + mi.pszService = "CloseAction"; + mi.pszName = LPGEN("E&xit"); + mi.flags = CMIF_ICONFROMICOLIB; + mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_EXIT); + AddTrayMenuItem(0,(LPARAM)&mi); + + mi.position = 100000; + mi.pszService = MS_CLIST_SHOWHIDE; + mi.pszName = LPGEN("&Hide/Show"); + mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_SHOWHIDE); + hTrayHideShowMainMenuItem = (HANDLE)AddTrayMenuItem(0,(LPARAM)&mi); + + mi.position = 200000; + mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_FINDUSER); + mi.pszService = "FindAdd/FindAddCommand"; + mi.pszName = LPGEN("&Find/Add Contacts..."); + AddTrayMenuItem(0,(LPARAM)&mi); + + mi.position = 300000; + mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_MAINMENU); // eternity #004 + mi.pszService = "FakeService_1"; + mi.pszName = LPGEN("&Main Menu"); + hTrayMainMenuItemProxy = (HANDLE)AddTrayMenuItem(0,(LPARAM)&mi); + + mi.position = 300100; + mi.pszService = "FakeService_2"; + mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_STATUS); // eternity #004 + mi.pszName = LPGEN("&Status"); + hTrayStatusMenuItemProxy = (HANDLE)AddTrayMenuItem(0,(LPARAM)&mi); + + mi.position = 400000; + mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_OPTIONS); + mi.pszService = "Options/OptionsCommand"; + mi.pszName = LPGEN("&Options..."); + AddTrayMenuItem(0,(LPARAM)&mi); + + mi.position = 500000; + mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_MIRANDA); + mi.pszService = "Help/AboutCommand"; + mi.pszName = LPGEN("&About"); + AddTrayMenuItem(0,(LPARAM)&mi); hMainMenu = (HMENU)CallService(MS_CLIST_MENUGETMAIN,0,0); hStatusMenu = (HMENU)CallService(MS_CLIST_MENUGETSTATUS,0,0); diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp index 622a997a4f..4e188a182b 100644 --- a/plugins/Clist_modern/src/modern_clui.cpp +++ b/plugins/Clist_modern/src/modern_clui.cpp @@ -287,7 +287,7 @@ HRESULT CLUI::RegisterAvatarMenu() CLISTMENUITEM mi = { sizeof(mi) }; CreateServiceFunction("CList/ShowContactAvatar",CLUI::Service_Menu_ShowContactAvatar); mi.position = 2000150000; - mi.hIcon = LoadSmallIcon(g_hInst,MAKEINTRESOURCE(IDI_SHOW_AVATAR)); + mi.hIcon = LoadSmallIcon(g_hInst, MAKEINTRESOURCE(IDI_SHOW_AVATAR)); mi.pszName = LPGEN("Show Contact &Avatar"); mi.pszService = "CList/ShowContactAvatar"; hShowAvatarMenuItem = Menu_AddContactMenuItem(&mi); @@ -295,14 +295,13 @@ HRESULT CLUI::RegisterAvatarMenu() CreateServiceFunction("CList/HideContactAvatar",CLUI::Service_Menu_HideContactAvatar); mi.position = 2000150001; - mi.hIcon = LoadSmallIcon(g_hInst,MAKEINTRESOURCE(IDI_HIDE_AVATAR)); + mi.hIcon = LoadSmallIcon(g_hInst, MAKEINTRESOURCE(IDI_HIDE_AVATAR)); mi.pszName = LPGEN("Hide Contact &Avatar"); mi.pszService = "CList/HideContactAvatar"; hHideAvatarMenuItem = Menu_AddContactMenuItem(&mi); DestroyIcon_protect(mi.hIcon); HookEvent(ME_CLIST_PREBUILDCONTACTMENU, CLUI::OnEvent_ContactMenuPreBuild); - return S_OK; } @@ -372,8 +371,8 @@ HRESULT CLUI::CreateCLC() Frame.hWnd = ClcWnd(); Frame.align = alClient; - Frame.hIcon = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA); - Frame.Flags = F_VISIBLE|/*F_SHOWTB|*/F_SHOWTBTIP|F_NO_SUBCONTAINER|F_TCHAR; + Frame.hIcon = LoadSkinnedIcon(SKINICON_OTHER_FRAME); + Frame.Flags = F_VISIBLE | F_SHOWTBTIP | F_NO_SUBCONTAINER | F_TCHAR; Frame.tname = LPGENT("My Contacts"); Frame.TBtname = TranslateT("My Contacts"); hFrameContactTree = (HWND)CallService(MS_CLIST_FRAMES_ADDFRAME,(WPARAM)&Frame,0); diff --git a/plugins/Clist_modern/src/modern_cluiframes.cpp b/plugins/Clist_modern/src/modern_cluiframes.cpp index ee1fc86397..70bc97ec4b 100644 --- a/plugins/Clist_modern/src/modern_cluiframes.cpp +++ b/plugins/Clist_modern/src/modern_cluiframes.cpp @@ -1744,11 +1744,11 @@ static int CLUIFramesLoadMainMenu() // create root menu CLISTMENUITEM mi = { sizeof(mi) }; mi.flags = CMIF_ICONFROMICOLIB | CMIF_ROOTHANDLE; - mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_MIRANDA); + mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_FRAME); mi.position = 3000090000; mi.pszName = LPGEN("Frames"); _hmiRoot = Menu_AddMainMenuItem(&mi); - DestroyIcon_protect(mi.hIcon); + // create frames menu int separator = 3000200000; for (int i=0; i < g_nFramesCount; i++) { diff --git a/plugins/Clist_modern/src/modern_framesmenu.cpp b/plugins/Clist_modern/src/modern_framesmenu.cpp index dba4a3eb30..bb46b58083 100644 --- a/plugins/Clist_modern/src/modern_framesmenu.cpp +++ b/plugins/Clist_modern/src/modern_framesmenu.cpp @@ -1,7 +1,7 @@ #include "hdr/modern_commonheaders.h" #include "hdr/modern_commonprototypes.h" -// == == == == == == == == == == == == == Frames +//========================== Frames HANDLE hFrameMenuObject; //contactmenu exec param(ownerdata) @@ -13,20 +13,11 @@ typedef struct{ } FrameMenuExecParam,*lpFrameMenuExecParam; -void FreeAndNil( void **p ) +static INT_PTR AddContextFrameMenuItem(WPARAM wParam, LPARAM lParam) { - if ( p == NULL ) - return; - - if ( *p != NULL ) { - mir_free( *p ); - *p = NULL; -} } + CLISTMENUITEM *mi = (CLISTMENUITEM*)lParam; -static INT_PTR AddContextFrameMenuItem(WPARAM wParam,LPARAM lParam) -{ TMO_MenuItem tmi; - CLISTMENUITEM *mi = (CLISTMENUITEM*)lParam; if ( !pcli->pfnConvertMenu(mi, &tmi)) return NULL; @@ -41,21 +32,20 @@ static INT_PTR AddContextFrameMenuItem(WPARAM wParam,LPARAM lParam) fmep->Frameid = mi->popupPosition; fmep->param1 = (INT_PTR)mi->pszContactOwner; tmi.ownerdata = fmep; - - return CallService(MO_ADDNEWMENUITEM,(WPARAM)hFrameMenuObject,(LPARAM)&tmi); + return CallService(MO_ADDNEWMENUITEM, (WPARAM)hFrameMenuObject, (LPARAM)&tmi); } -static INT_PTR RemoveContextFrameMenuItem(WPARAM wParam,LPARAM lParam) +static INT_PTR RemoveContextFrameMenuItem(WPARAM wParam, LPARAM lParam) { - lpFrameMenuExecParam fmep = (lpFrameMenuExecParam)CallService(MO_MENUITEMGETOWNERDATA,wParam,lParam); - if (fmep != NULL){ + lpFrameMenuExecParam fmep = (lpFrameMenuExecParam)CallService(MO_MENUITEMGETOWNERDATA, wParam, lParam); + if (fmep != NULL) { if (fmep->szServiceName != NULL) mir_free(fmep->szServiceName); mir_free(fmep); } if (lParam != 1) - CallService(MO_REMOVEMENUITEM,wParam,0); + CallService(MO_REMOVEMENUITEM, wParam, 0); return 0; } @@ -63,40 +53,40 @@ static INT_PTR RemoveContextFrameMenuItem(WPARAM wParam,LPARAM lParam) //called with: //wparam - ownerdata //lparam - lparam from winproc -INT_PTR FrameMenuExecService(WPARAM wParam,LPARAM lParam) { +INT_PTR FrameMenuExecService(WPARAM wParam, LPARAM lParam) +{ lpFrameMenuExecParam fmep = (lpFrameMenuExecParam)wParam; - if (fmep == NULL){return(-1);}; - CallService(fmep->szServiceName,lParam,fmep->param1); + if (fmep ==NULL) + return -1; + CallService(fmep->szServiceName, lParam, fmep->param1); return 0; -}; +} //true - ok,false ignore -INT_PTR FrameMenuCheckService(WPARAM wParam,LPARAM lParam) { - +INT_PTR FrameMenuCheckService(WPARAM wParam, LPARAM lParam) +{ PCheckProcParam pcpp = (PCheckProcParam)wParam; - lpFrameMenuExecParam fmep; - TMO_MenuItem mi; + if (pcpp == NULL) + return FALSE; - if (pcpp == NULL){return(FALSE);}; - if (CallService(MO_GETMENUITEM,(WPARAM)pcpp->MenuItemHandle,(LPARAM)&mi) == 0) - { - fmep = (lpFrameMenuExecParam)mi.ownerdata; - if (fmep != NULL) - { + TMO_MenuItem mi; + if ( CallService(MO_GETMENUITEM, (WPARAM)pcpp->MenuItemHandle, (LPARAM)&mi) == 0) { + lpFrameMenuExecParam fmep = (lpFrameMenuExecParam)mi.ownerdata; + if (fmep != NULL) { //pcpp->wParam - frameid - if (((WPARAM)fmep->Frameid == pcpp->wParam) || fmep->Frameid == -1) return(TRUE); - }; - - }; - return(FALSE); -}; + if (((WPARAM)fmep->Frameid == pcpp->wParam) || fmep->Frameid == -1) + return TRUE; + } + } + return FALSE; +} -static INT_PTR ContextFrameMenuNotify(WPARAM wParam,LPARAM lParam) +static INT_PTR ContextFrameMenuNotify(WPARAM wParam, LPARAM lParam) { - NotifyEventHooks(g_CluiData.hEventPreBuildFrameMenu,wParam,lParam); + NotifyEventHooks(g_CluiData.hEventPreBuildFrameMenu, wParam, lParam); return 0; -}; +} static INT_PTR BuildContextFrameMenu(WPARAM wParam,LPARAM lParam) { @@ -106,81 +96,62 @@ static INT_PTR BuildContextFrameMenu(WPARAM wParam,LPARAM lParam) param.lParam = lParam; HMENU hMenu = CreatePopupMenu(); - //NotifyEventHooks(hPreBuildFrameMenuEvent,wParam,-1); - ContextFrameMenuNotify(wParam,-1); - CallService(MO_BUILDMENU,(WPARAM)hMenu,(LPARAM)¶m); + ContextFrameMenuNotify(wParam, -1); + CallService(MO_BUILDMENU, (WPARAM)hMenu, (LPARAM)¶m); return (INT_PTR)hMenu; } -// == == == == == == == == == == == == == Frames end +//========================== Frames end bool InternalGenMenuModule = FALSE; -int MeasureItemProxy(WPARAM wParam,LPARAM lParam) { - - int val; - if (InternalGenMenuModule) - { - - val = CallService(MS_INT_MENUMEASUREITEM,wParam,lParam); - if (val) return(val); - }; - return CallService(MS_CLIST_MENUMEASUREITEM,wParam,lParam); - - -}; - - -int DrawItemProxy(WPARAM wParam,LPARAM lParam) { - if (InternalGenMenuModule) - { - int val; - val = CallService(MS_INT_MENUDRAWITEM,wParam,lParam); - if (val) return(val); +int MeasureItemProxy(WPARAM wParam, LPARAM lParam) +{ + if (InternalGenMenuModule) { + int val = CallService(MS_INT_MENUMEASUREITEM, wParam, lParam); + if (val) + return val; } - return CallService(MS_CLIST_MENUDRAWITEM,wParam,lParam); - -}; - - + return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam); +} -int ProcessCommandProxy(WPARAM wParam,LPARAM lParam) { - if (InternalGenMenuModule) - { - int val; - val = CallService(MS_INT_MENUPROCESSCOMMAND,wParam,lParam); - if (val) return(val); - }; +int DrawItemProxy(WPARAM wParam, LPARAM lParam) +{ + if (InternalGenMenuModule) { + int val = CallService(MS_INT_MENUDRAWITEM, wParam, lParam); + if (val) + return val; + } + return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam); +} +int ProcessCommandProxy(WPARAM wParam, LPARAM lParam) +{ + if (InternalGenMenuModule) { + int val = CallService(MS_INT_MENUPROCESSCOMMAND, wParam, lParam); + if (val) + return val; + } return CallService(MS_CLIST_MENUPROCESSCOMMAND,wParam,lParam); +} -}; - -int ModifyMenuItemProxy(WPARAM wParam,LPARAM lParam) { - if (InternalGenMenuModule) - { - int val; - val = CallService(MS_INT_MODIFYMENUITEM,wParam,lParam); - if (val) return(val); - }; - +int ModifyMenuItemProxy(WPARAM wParam, LPARAM lParam) +{ + if (InternalGenMenuModule) { + int val = CallService(MS_INT_MODIFYMENUITEM, wParam, lParam); + if (val) + return val; + } return CallService(MS_CLIST_MODIFYMENUITEM,wParam,lParam); - -}; - +} int InitFramesMenus(void) { - TMenuParam tmp; - - if ( !ServiceExists(MO_REMOVEMENUOBJECT)) - { - - InitCustomMenus(); + if ( !ServiceExists(MO_REMOVEMENUOBJECT)) { + InitCustomMenus(); InternalGenMenuModule = TRUE; - }; + } - if ( ServiceExists(MO_REMOVEMENUOBJECT)) - { + if ( ServiceExists(MO_REMOVEMENUOBJECT)) { CreateServiceFunction("FrameMenuExecService",FrameMenuExecService); CreateServiceFunction("FrameMenuCheckService",FrameMenuCheckService); @@ -188,27 +159,18 @@ int InitFramesMenus(void) CreateServiceFunction("CList/AddContextFrameMenuItem",AddContextFrameMenuItem); CreateServiceFunction(MS_CLIST_MENUBUILDFRAMECONTEXT,BuildContextFrameMenu); CreateServiceFunction(MS_CLIST_FRAMEMENUNOTIFY,ContextFrameMenuNotify); - //frame menu object - memset(&tmp,0,sizeof(tmp)); - tmp.cbSize = sizeof(tmp); + TMenuParam tmp = { sizeof(tmp) }; tmp.CheckService = "FrameMenuCheckService"; tmp.ExecService = "FrameMenuExecService"; tmp.name = "FrameMenu"; - hFrameMenuObject = (HANDLE)CallService(MO_CREATENEWMENUOBJECT,0,(LPARAM)&tmp); + hFrameMenuObject = (HANDLE)CallService(MO_CREATENEWMENUOBJECT, 0, (LPARAM)&tmp); } return 0; } + int UnitFramesMenu() { - - /* - if ( ServiceExists(MO_REMOVEMENUOBJECT)) - { - CallService(MO_REMOVEMENUOBJECT,hFrameMenuObject,0); - if (InternalGenMenuModule){UnitGenMenu();}; - }; - */ return 0; -}; +} diff --git a/plugins/Clist_modern/src/modern_groupmenu.cpp b/plugins/Clist_modern/src/modern_groupmenu.cpp index 454459ff0b..4b265c382d 100644 --- a/plugins/Clist_modern/src/modern_groupmenu.cpp +++ b/plugins/Clist_modern/src/modern_groupmenu.cpp @@ -160,11 +160,10 @@ INT_PTR GroupMenuExecService(WPARAM wParam,LPARAM lParam) INT_PTR FreeOwnerDataGroupMenu (WPARAM wParam,LPARAM lParam) { - lpGroupMenuExecParam mmep; - mmep = (lpGroupMenuExecParam)lParam; - if (mmep != NULL){ - FreeAndNil((void **)&mmep->szServiceName); - FreeAndNil((void **)&mmep); + lpGroupMenuExecParam mmep = (lpGroupMenuExecParam)lParam; + if (mmep != NULL) { + mir_free(mmep->szServiceName); + mir_free(mmep); } return 0; @@ -298,70 +297,44 @@ void GroupMenus_Init(void) mi.pszName = LPGEN("E&xit"); mi.flags = CMIF_ICONFROMICOLIB; AddGroupMenuItem(0,(LPARAM)&mi); - DestroyIcon_protect(mi.hIcon); - memset(&mi,0,sizeof(mi)); - mi.cbSize = sizeof(mi); mi.position = 500; mi.pszService = MS_CLIST_SHOWHIDE; mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_SHOWHIDE); mi.pszName = LPGEN("&Hide/Show"); - mi.flags = CMIF_ICONFROMICOLIB; hHideShowMainMenuItem = (HANDLE)AddGroupMenuItem(0,(LPARAM)&mi); - DestroyIcon_protect(mi.hIcon); - memset(&mi,0,sizeof(mi)); - mi.cbSize = sizeof(mi); mi.position = 200000; - mi.flags = CMIF_ICONFROMICOLIB; mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_FINDUSER); mi.pszService = "FindAdd/FindAddCommand"; mi.pszName = LPGEN("&Find/Add Contacts..."); AddGroupMenuItem(0,(LPARAM)&mi); - DestroyIcon_protect(mi.hIcon); - memset(&mi,0,sizeof(mi)); - mi.cbSize = sizeof(mi); mi.position = 300000; mi.pszService = ""; mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_MAINMENU); // eternity #004 mi.pszName = LPGEN("&Main Menu"); - mi.flags = CMIF_ICONFROMICOLIB; // eternity #004 hGroupMainMenuItemProxy = (HANDLE)AddGroupMenuItem(0,(LPARAM)&mi); - DestroyIcon_protect(mi.hIcon); // eternity #004 - memset(&mi,0,sizeof(mi)); - mi.cbSize = sizeof(mi); mi.position = 300100; mi.pszService = ""; mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_STATUS); // eternity #004 mi.pszName = LPGEN("&Status"); - mi.flags = CMIF_ICONFROMICOLIB; // eternity #004 hGroupStatusMenuItemProxy = (HANDLE)AddGroupMenuItem(0,(LPARAM)&mi); - DestroyIcon_protect(mi.hIcon); // eternity #004 - memset(&mi,0,sizeof(mi)); - mi.cbSize = sizeof(mi); mi.position = 400000; - mi.flags = CMIF_ICONFROMICOLIB; mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_OPTIONS); mi.pszService = "Options/OptionsCommand"; mi.pszName = LPGEN("&Options..."); - AddGroupMenuItem(0,(LPARAM)&mi); - DestroyIcon_protect(mi.hIcon); + AddGroupMenuItem(0, (LPARAM)&mi); - memset(&mi,0,sizeof(mi)); - mi.cbSize = sizeof(mi); mi.position = 500000; - mi.flags = CMIF_ICONFROMICOLIB; mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_MIRANDA); mi.pszService = "Help/AboutCommand"; mi.pszName = LPGEN("&About"); - AddGroupMenuItem(0,(LPARAM)&mi); - DestroyIcon_protect(mi.hIcon); + AddGroupMenuItem(0, (LPARAM)&mi); - memset(&mi,0,sizeof(mi)); - mi.cbSize = sizeof(mi); + mi.flags = 0; mi.position = 100000; mi.hIcon = ske_ImageList_GetIcon(hCListImages,NewGroupIconidx,0); mi.pszService = "CLISTMENUSGroup/CreateGroupHelper"; @@ -369,40 +342,29 @@ void GroupMenus_Init(void) hNewGroupMenuItem = (HANDLE)AddGroupMenuItem(0,(LPARAM)&mi); DestroyIcon_protect(mi.hIcon); - memset(&mi,0,sizeof(mi)); - mi.cbSize = sizeof(mi); mi.position = 100001; mi.hIcon = NULL; mi.pszService = MS_CLIST_SETHIDEOFFLINE; mi.pszName = LPGEN("&Hide Offline Users"); gmp.lParam = 0;gmp.wParam = -1; - hHideOfflineUsersMenuItem = (HANDLE)AddGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi); + hHideOfflineUsersMenuItem = (HANDLE)AddGroupMenuItem((WPARAM)&gmp, (LPARAM)&mi); - memset(&mi,0,sizeof(mi)); - mi.cbSize = sizeof(mi); mi.position = 100002; - mi.hIcon = NULL; mi.pszService = "CLISTMENUSGroup/HideOfflineRootHelper"; mi.pszName = LPGEN("Hide &Offline Users out here"); - hHideOfflineUsersOutHereMenuItem = (HANDLE)AddGroupMenuItem(0,(LPARAM)&mi); + hHideOfflineUsersOutHereMenuItem = (HANDLE)AddGroupMenuItem(0, (LPARAM)&mi); - memset(&mi,0,sizeof(mi)); - mi.cbSize = sizeof(mi); mi.position = 100003; - mi.hIcon = NULL; mi.pszService = "CLISTMENUSGroup/HideGroupsHelper"; mi.pszName = LPGEN("Hide &Empty Groups"); - hHideEmptyGroupsMenuItem = (HANDLE)AddGroupMenuItem(0,(LPARAM)&mi); + hHideEmptyGroupsMenuItem = (HANDLE)AddGroupMenuItem(0, (LPARAM)&mi); - memset(&mi,0,sizeof(mi)); - mi.cbSize = sizeof(mi); mi.position = 100004; - mi.hIcon = NULL; mi.pszService = "CLISTMENUSGroup/UseGroupsHelper"; mi.pszName = LPGEN("Disable &Groups"); - hDisableGroupsMenuItem = (HANDLE)AddGroupMenuItem(0,(LPARAM)&mi); + hDisableGroupsMenuItem = (HANDLE)AddGroupMenuItem(0, (LPARAM)&mi); - HookEvent(ME_SKIN2_ICONSCHANGED,OnIconLibIconChanged); + HookEvent(ME_SKIN2_ICONSCHANGED, OnIconLibIconChanged); } //////////////////////////////END Group MENU///////////////////////// @@ -558,8 +520,8 @@ INT_PTR FreeOwnerDataSubGroupMenu (WPARAM wParam,LPARAM lParam) { lpSubGroupMenuExecParam mmep = (lpSubGroupMenuExecParam)lParam; if (mmep != NULL){ - FreeAndNil((void **)&mmep->szServiceName); - FreeAndNil((void **)&mmep); + mir_free(mmep->szServiceName); + mir_free(mmep); } return 0; diff --git a/plugins/Clist_modern/src/modern_statusbar.cpp b/plugins/Clist_modern/src/modern_statusbar.cpp index 086b979ca8..c80e2c85e6 100644 --- a/plugins/Clist_modern/src/modern_statusbar.cpp +++ b/plugins/Clist_modern/src/modern_statusbar.cpp @@ -976,7 +976,7 @@ HWND StatusBar_Create(HWND parent) Frame.cbSize = sizeof(CLISTFrame); Frame.hWnd = hModernStatusBar; Frame.align = alBottom; - Frame.hIcon = LoadSkinnedIcon (SKINICON_OTHER_MIRANDA); + Frame.hIcon = LoadSkinnedIcon (SKINICON_OTHER_FRAME); Frame.Flags = (db_get_b(NULL,"CLUI","ShowSBar",SETTING_SHOWSBAR_DEFAULT)?F_VISIBLE:0)|F_LOCKED|F_NOBORDER|F_NO_SUBCONTAINER|F_TCHAR; Frame.height = h; Frame.tname = _T("Status Bar"); diff --git a/plugins/Clist_modern/src/modern_toolbar.cpp b/plugins/Clist_modern/src/modern_toolbar.cpp index 4088d6d2dc..0f8532bc5a 100644 --- a/plugins/Clist_modern/src/modern_toolbar.cpp +++ b/plugins/Clist_modern/src/modern_toolbar.cpp @@ -298,7 +298,7 @@ void CustomizeToolbar(HWND hwnd) Frame.align = alTop; Frame.Flags = F_VISIBLE | F_NOBORDER | F_LOCKED | F_TCHAR | F_NO_SUBCONTAINER; Frame.height = 18; - Frame.hIcon = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA); + Frame.hIcon = LoadSkinnedIcon(SKINICON_OTHER_FRAME); pMTBInfo->hFrame = (HANDLE)CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&Frame, 0); CallService(MS_SKINENG_REGISTERPAINTSUB,(WPARAM)hwnd,(LPARAM)ToolBar_LayeredPaintProc); diff --git a/plugins/Clist_modern/src/modern_viewmodebar.cpp b/plugins/Clist_modern/src/modern_viewmodebar.cpp index 68f5ca0aca..0162d589af 100644 --- a/plugins/Clist_modern/src/modern_viewmodebar.cpp +++ b/plugins/Clist_modern/src/modern_viewmodebar.cpp @@ -1315,7 +1315,7 @@ void CreateViewModeFrame() ZeroMemory(&frame, sizeof(frame)); frame.cbSize = sizeof(frame); frame.tname = _T("View modes"); - frame.hIcon = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);/*0;*/ + frame.hIcon = LoadSkinnedIcon(SKINICON_OTHER_FRAME); frame.height = 18; frame.TBtname = TranslateT("View Modes"); frame.Flags = F_VISIBLE|F_SHOWTBTIP|F_NOBORDER|F_NO_SUBCONTAINER|F_TCHAR; diff --git a/plugins/Clist_mw/clist_mw_11.vcxproj.filters b/plugins/Clist_mw/clist_mw_11.vcxproj.filters index e5eb64a833..5127f25ac5 100644 --- a/plugins/Clist_mw/clist_mw_11.vcxproj.filters +++ b/plugins/Clist_mw/clist_mw_11.vcxproj.filters @@ -5,9 +5,6 @@ {6c881602-dfa1-45ce-8613-13d8c6bd3ad5} cpp;c;cxx;rc;def;r;odl;idl;hpj;bat - - {eb8ace08-5854-4e7e-8dce-295b258ca064} - {56b79972-29f3-40b1-bf23-ccffb8791acd} h;hpp;hxx;hm;inl @@ -95,9 +92,6 @@ - - Source Files\CLUIFrames - Header Files @@ -110,6 +104,9 @@ Header Files + + Header Files + diff --git a/plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp b/plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp index 0326de4745..b504a96f0e 100644 --- a/plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp +++ b/plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp @@ -180,7 +180,7 @@ static int id2pos(int id) if (FramesSysNotStarted) return -1; - for (int i = 0;ihwndContactList,0); return 0; @@ -1113,7 +1114,7 @@ static INT_PTR CLUIFramesShowAll(WPARAM wParam,LPARAM lParam) //wparam = lparam = 0 INT_PTR CLUIFramesShowAllTitleBars(WPARAM wParam,LPARAM lParam) { - for (int i = 0;ihwndContactList,0); return 0; @@ -1122,7 +1123,7 @@ INT_PTR CLUIFramesShowAllTitleBars(WPARAM wParam,LPARAM lParam) //wparam = lparam = 0 INT_PTR CLUIFramesHideAllTitleBars(WPARAM wParam,LPARAM lParam) { - for (int i = 0;ihwndContactList,0); return 0; @@ -1166,14 +1167,14 @@ INT_PTR CLUIFramesMoveUpDown(WPARAM wParam,LPARAM lParam) lockfrm(); pos = id2pos(wParam); - if (pos>=0&&(int)pos= 0 &&(int)pos < nFramescount) { SortData *sd; curpos = Frames[pos].order; curalign = Frames[pos].align; v = 0; sd = (SortData*)malloc(sizeof(SortData)*nFramescount); memset(sd,0,sizeof(SortData)*nFramescount); - for (i = 0;i= v-1) @@ -1358,7 +1359,7 @@ INT_PTR CLUIFramesCollapseUnCollapseFrame(WPARAM wParam,LPARAM lParam) } else { int i,sumheight = 0; - for (i = 0; i < nFramescount; i++) { + for (i=0; i < nFramescount; i++) { if ((Frames[i].align != alClient)&&(!Frames[i].floating)&&(Frames[i].visible)&&(!Frames[i].needhide)) { sumheight += (Frames[i].height)+(TitleBarH*btoint(Frames[i].TitleBar.ShowTitleBar))+2; return FALSE; @@ -1406,38 +1407,6 @@ INT_PTR CLUIFramesCollapseUnCollapseFrame(WPARAM wParam,LPARAM lParam) static int CLUIFramesLoadMainMenu() { - int i,separator; - - if ( !(ServiceExists(MS_CLIST_REMOVEMAINMENUITEM))) { - // create "show all frames" menu - CLISTMENUITEM mi = { sizeof(mi) }; - mi.hIcon = NULL;//LoadIcon(g_hInst,MAKEINTRESOURCE(IDI_MIRANDA)); - mi.flags = CMIF_GRAYED; - mi.position = 10000000; - mi.pszPopupName = LPGEN("Frames"); - mi.pszName = LPGEN("New Menu System not Found..."); - mi.pszService = ""; - Menu_AddMainMenuItem(&mi); - - // create "show all frames" menu - mi.hIcon = NULL;//LoadIcon(g_hInst,MAKEINTRESOURCE(IDI_MIRANDA)); - mi.flags = 0; - mi.position = 10100000; - mi.pszPopupName = LPGEN("Frames"); - mi.pszName = LPGEN("Show All Frames"); - mi.pszService = MS_CLIST_FRAMES_SHOWALLFRAMES; - Menu_AddMainMenuItem(&mi); - - mi.hIcon = NULL;//LoadIcon(g_hInst,MAKEINTRESOURCE(IDI_HELP)); - mi.position = 10100001; - mi.pszPopupName = LPGEN("Frames"); - mi.flags = CMIF_CHILDPOPUP; - mi.pszName = LPGEN("Show All Titlebars"); - mi.pszService = MS_CLIST_FRAMES_SHOWALLFRAMESTB; - Menu_AddMainMenuItem(&mi); - return 0; - } - if (MainMIRoot != (HGENMENU)-1) { CallService(MS_CLIST_REMOVEMAINMENUITEM,(WPARAM)MainMIRoot,0); MainMIRoot = (HGENMENU)-1; @@ -1445,8 +1414,8 @@ static int CLUIFramesLoadMainMenu() // create root menu CLISTMENUITEM mi = { sizeof(mi) }; - mi.hIcon = LoadIcon(g_hInst,MAKEINTRESOURCE(IDI_CLIENTMIRANDA)); - mi.flags = CMIF_ROOTPOPUP; + mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_FRAME); + mi.flags = CMIF_ROOTPOPUP | CMIF_ICONFROMICOLIB; mi.position = 3000090000; mi.pszPopupName = (char*)-1; mi.pszName = LPGEN("Frames"); @@ -1454,10 +1423,10 @@ static int CLUIFramesLoadMainMenu() MainMIRoot = Menu_AddMainMenuItem(&mi); // create frames menu - separator = 3000200000; - for (i = 0;iContactListHeight-tbh-2) @@ -1746,7 +1715,7 @@ int CLUIFramesGetMinHeight() if (clientfrm != -1) tbh = TitleBarH*btoint(Frames[clientfrm].TitleBar.ShowTitleBar); - for (i = 0; i < nFramescount; i++) { + for (i=0; i < nFramescount; i++) { if ((Frames[i].align != alClient)&&(Frames[i].visible)&&(!Frames[i].needhide)&&(!Frames[i].floating)) { RECT wsize; @@ -1786,7 +1755,7 @@ int CLUIFramesResize(const RECT newsize) if (clientfrm != -1) tbh = (TitleBarH+GapBetweenTitlebar)*btoint(Frames[clientfrm].TitleBar.ShowTitleBar); - for (i = 0; i < nFramescount; i++) { + for (i=0; i < nFramescount; i++) { if ( !Frames[i].floating) { Frames[i].needhide = FALSE; Frames[i].wndSize.left = 0; @@ -1797,7 +1766,7 @@ int CLUIFramesResize(const RECT newsize) //sorting stuff sdarray = (SortData*)malloc(sizeof(SortData)*nFramescount); if (sdarray == NULL){return(-1);} - for (i = 0;i(newheight-tbh)&&drawitems>0) { sumheight = 0; drawitems = 0; - for (i = 0;ihwndContactList,0); CLUIFramesStoreAllFrames(); lockfrm(); - for (int i = 0; i < nFramescount; i++) { + for (int i=0; i < nFramescount; i++) { DestroyWindow(Frames[i].hWnd); Frames[i].hWnd = (HWND)-1; DestroyWindow(Frames[i].TitleBar.hwnd); diff --git a/plugins/Clist_mw/src/CLUIFrames/statusbar.cpp b/plugins/Clist_mw/src/CLUIFrames/statusbar.cpp index 2c88c43175..5d6288269c 100644 --- a/plugins/Clist_mw/src/CLUIFrames/statusbar.cpp +++ b/plugins/Clist_mw/src/CLUIFrames/statusbar.cpp @@ -457,7 +457,7 @@ HANDLE CreateStatusBarFrame() Frame.cbSize = sizeof(CLISTFrame); Frame.hWnd = helperhwnd; Frame.align = alBottom; - Frame.hIcon = LoadSkinnedIcon (SKINICON_OTHER_MIRANDA); + Frame.hIcon = LoadSkinnedIcon(SKINICON_OTHER_FRAME); Frame.Flags = ( db_get_b(NULL,"CLUI","ShowSBar",1)?F_VISIBLE:0)|F_LOCKED|F_NOBORDER|F_TCHAR; Frame.height = (h == 0) ? 20 : h; Frame.tname = _T("Status"); diff --git a/plugins/Clist_mw/src/clui.cpp b/plugins/Clist_mw/src/clui.cpp index aadd15cdbd..67862d2a79 100644 --- a/plugins/Clist_mw/src/clui.cpp +++ b/plugins/Clist_mw/src/clui.cpp @@ -391,7 +391,7 @@ int CreateCLC(HWND parent) Frame.cbSize = sizeof(CLISTFrame); Frame.hWnd = pcli->hwndContactTree; Frame.align = alClient; - Frame.hIcon = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA); + Frame.hIcon = LoadSkinnedIcon(SKINICON_OTHER_FRAME); //LoadIcon(hInst,MAKEINTRESOURCE(IDI_MIRANDA)); Frame.Flags = F_VISIBLE|F_SHOWTB|F_SHOWTBTIP|F_TCHAR; Frame.tname = _T("My Contacts"); diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp index 4209cde5ea..3707e9d8b1 100644 --- a/plugins/Clist_nicer/src/clui.cpp +++ b/plugins/Clist_nicer/src/clui.cpp @@ -227,7 +227,7 @@ static int CreateCLC(HWND parent) Frame.cbSize = sizeof(CLISTFrame); Frame.hWnd = pcli->hwndContactTree; Frame.align = alClient; - Frame.hIcon = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA); + Frame.hIcon = LoadSkinnedIcon(SKINICON_OTHER_FRAME); Frame.Flags = F_VISIBLE | F_SHOWTB | F_SHOWTBTIP | F_NOBORDER | F_TCHAR; Frame.tname = _T("My Contacts"); Frame.TBtname = TranslateT("My Contacts"); diff --git a/plugins/MyDetails/src/frame.cpp b/plugins/MyDetails/src/frame.cpp index 0cf86070a1..bcedb541c5 100644 --- a/plugins/MyDetails/src/frame.cpp +++ b/plugins/MyDetails/src/frame.cpp @@ -1,4 +1,4 @@ -/* +/* Copyright (C) 2005 Ricardo Pescuma Domenecci This is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this file; see the file license.txt. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. +Boston, MA 02111-1307, USA. */ #include "commons.h" @@ -177,7 +177,7 @@ void InitFrames() void DeInitFrames() { - if (ServiceExists(MS_CLIST_FRAMES_REMOVEFRAME) && frame_id != -1) + if (ServiceExists(MS_CLIST_FRAMES_REMOVEFRAME) && frame_id != -1) { CallService(MS_CLIST_FRAMES_REMOVEFRAME, (WPARAM)frame_id, 0); } @@ -192,7 +192,7 @@ void DeInitFrames() } -int ReloadFont(WPARAM wParam, LPARAM lParam) +int ReloadFont(WPARAM wParam, LPARAM lParam) { LOGFONT log_font; @@ -212,7 +212,7 @@ int ReloadColour(WPARAM,LPARAM) { opts.bkg_color = (COLORREF) CallService(MS_COLOUR_GETT,(WPARAM)&bg_colour,0); opts.draw_avatar_border_color = (COLORREF) CallService(MS_COLOUR_GETT,(WPARAM)&av_colour,0); - + RefreshFrame(); return 0; } @@ -223,10 +223,10 @@ int SmileyAddOptionsChangedHook(WPARAM wParam,LPARAM lParam) return 0; } -int CreateFrame() +int CreateFrame() { HDC hdc = GetDC(NULL); - + ZeroMemory(&bg_colour, sizeof(bg_colour)); bg_colour.cbSize = sizeof(ColourIDT); _tcsncpy(bg_colour.name,LPGENT("Background"),SIZEOF(bg_colour.name)); @@ -235,7 +235,7 @@ int CreateFrame() strncpy(bg_colour.setting,"BackgroundColor",sizeof(bg_colour.setting)); bg_colour.defcolour = GetSysColor(COLOR_BTNFACE); ColourRegisterT(&bg_colour); - + ZeroMemory(&av_colour, sizeof(av_colour)); av_colour.cbSize = sizeof(ColourIDT); _tcsncpy(av_colour.name,LPGENT("Avatar Border"),SIZEOF(av_colour.name)); @@ -291,33 +291,33 @@ int CreateFrame() RegisterClass(&wndclass); if (ServiceExists(MS_CLIST_FRAMES_ADDFRAME)) { - hwnd_frame = CreateWindow(WINDOW_CLASS_NAME, TranslateT("My Details"), - WS_CHILD | WS_VISIBLE, + hwnd_frame = CreateWindow(WINDOW_CLASS_NAME, TranslateT("My Details"), + WS_CHILD | WS_VISIBLE, 0,0,10,10, (HWND)CallService(MS_CLUI_GETHWND, 0, 0), NULL, hInst, NULL); CLISTFrame Frame = {0}; - + Frame.cbSize = sizeof(Frame); Frame.tname = TranslateT("My Details"); Frame.cbSize = sizeof(CLISTFrame); Frame.hWnd = hwnd_frame; Frame.align = alTop; - Frame.hIcon = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA); + Frame.hIcon = LoadSkinnedIcon(SKINICON_OTHER_FRAME); Frame.Flags = F_VISIBLE | F_SHOWTB | F_SHOWTBTIP | F_NOBORDER | F_SKINNED | F_TCHAR; Frame.height = 100; frame_id = CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&Frame, 0); - + if ( db_get_b(NULL, "MyDetails", "ForceHideFrame", 0)) { int flags = CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS, MAKEWPARAM(FO_FLAGS, frame_id), 0); - if (flags & F_VISIBLE) + if (flags & F_VISIBLE) CallService(MS_CLIST_FRAMES_SHFRAME, frame_id, 0); db_unset(NULL, "MyDetails", "ForceHideFrame"); } - if ( db_get_b(NULL, "MyDetails", "ForceShowFrame", 0)) { + if ( db_get_b(NULL, "MyDetails", "ForceShowFrame", 0)) { int flags = CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS, MAKEWPARAM(FO_FLAGS, frame_id), 0); - if (!(flags & F_VISIBLE)) + if (!(flags & F_VISIBLE)) CallService(MS_CLIST_FRAMES_SHFRAME, frame_id, 0); db_unset(NULL, "MyDetails", "ForceShowFrame"); @@ -336,11 +336,11 @@ int CreateFrame() wndclass.lpszClassName = CONTAINER_CLASS_NAME; RegisterClass(&wndclass); - hwnd_container = CreateWindowEx(WS_EX_TOOLWINDOW, CONTAINER_CLASS_NAME, TranslateT("My Details"), + hwnd_container = CreateWindowEx(WS_EX_TOOLWINDOW, CONTAINER_CLASS_NAME, TranslateT("My Details"), (WS_THICKFRAME | WS_CAPTION | WS_SYSMENU) & ~WS_VISIBLE, 0,0,200,130, (HWND)CallService(MS_CLUI_GETHWND, 0, 0), NULL, hInst, NULL); - - hwnd_frame = CreateWindow(WINDOW_CLASS_NAME, TranslateT("My Details"), + + hwnd_frame = CreateWindow(WINDOW_CLASS_NAME, TranslateT("My Details"), WS_CHILD | WS_VISIBLE, 0,0,10,10, hwnd_container, NULL, hInst, NULL); @@ -372,11 +372,11 @@ int CreateFrame() } -bool FrameIsFloating() +bool FrameIsFloating() { - if (frame_id == -1) + if (frame_id == -1) return true; // no frames, always floating - + return (CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS, MAKEWPARAM(FO_FLOATING, frame_id), 0) != 0); } @@ -457,7 +457,7 @@ RECT GetInnerRect(const RECT &rc, const RECT &clipping) return rc_ret; } -RECT GetRect(HDC hdc, RECT rc, SIZE s, UINT uFormat, int next_top, int text_left, bool frame = true, +RECT GetRect(HDC hdc, RECT rc, SIZE s, UINT uFormat, int next_top, int text_left, bool frame = true, bool end_elipsis_on_frame = true) { RECT r = rc; @@ -505,7 +505,7 @@ RECT GetRect(HDC hdc, RECT rc, SIZE s, UINT uFormat, int next_top, int text_left return r; } -RECT GetRect(HDC hdc, RECT rc, const TCHAR *text, const TCHAR *def_text, Protocol *proto, UINT uFormat, +RECT GetRect(HDC hdc, RECT rc, const TCHAR *text, const TCHAR *def_text, Protocol *proto, UINT uFormat, int next_top, int text_left, bool smileys = true, bool frame = true, bool end_elipsis_on_frame = true) { const TCHAR *tmp; @@ -558,7 +558,7 @@ HWND CreateTooltip(HWND hwnd, RECT &rect) HWND hwndTT = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, NULL, - WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP, + WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, @@ -578,46 +578,46 @@ HWND CreateTooltip(HWND hwnd, RECT &rect) ti.uId = uid; ti.lpszText = LPSTR_TEXTCALLBACK; // ToolTip control will cover the whole window - ti.rect.left = rect.left; + ti.rect.left = rect.left; ti.rect.top = rect.top; ti.rect.right = rect.right; ti.rect.bottom = rect.bottom; /* SEND AN ADDTOOL MESSAGE TO THE TOOLTIP CONTROL WINDOW */ - SendMessage(hwndTT, TTM_ADDTOOL, 0, (LPARAM) (LPTOOLINFO) &ti); - SendMessage(hwndTT, TTM_SETDELAYTIME, (WPARAM) (DWORD) TTDT_AUTOPOP, (LPARAM) MAKELONG(24 * 60 * 60 * 1000, 0)); + SendMessage(hwndTT, TTM_ADDTOOL, 0, (LPARAM) (LPTOOLINFO) &ti); + SendMessage(hwndTT, TTM_SETDELAYTIME, (WPARAM) (DWORD) TTDT_AUTOPOP, (LPARAM) MAKELONG(24 * 60 * 60 * 1000, 0)); return hwndTT; -} +} void DeleteTooltipWindows(MyDetailsFrameData *data) { - if (data->nick_tt_hwnd != NULL) { + if (data->nick_tt_hwnd != NULL) { DestroyWindow(data->nick_tt_hwnd); data->nick_tt_hwnd = NULL; } - if (data->status_tt_hwnd != NULL) { + if (data->status_tt_hwnd != NULL) { DestroyWindow(data->status_tt_hwnd); data->status_tt_hwnd = NULL; } - if (data->next_proto_tt_hwnd != NULL) { + if (data->next_proto_tt_hwnd != NULL) { DestroyWindow(data->next_proto_tt_hwnd); data->next_proto_tt_hwnd = NULL; } - if (data->prev_proto_tt_hwnd != NULL) { + if (data->prev_proto_tt_hwnd != NULL) { DestroyWindow(data->prev_proto_tt_hwnd); data->prev_proto_tt_hwnd = NULL; } - if (data->away_msg_tt_hwnd != NULL) { + if (data->away_msg_tt_hwnd != NULL) { DestroyWindow(data->away_msg_tt_hwnd); data->away_msg_tt_hwnd = NULL; } - if (data->listening_to_tt_hwnd != NULL) { + if (data->listening_to_tt_hwnd != NULL) { DestroyWindow(data->listening_to_tt_hwnd); data->listening_to_tt_hwnd = NULL; } @@ -689,7 +689,7 @@ void CalcRectangles(HWND hwnd) int text_left; int avatar_bottom = 0; - UINT uFormat = DT_SINGLELINE | DT_NOPREFIX | DT_END_ELLIPSIS + UINT uFormat = DT_SINGLELINE | DT_NOPREFIX | DT_END_ELLIPSIS | (opts.draw_text_align_right ? DT_RIGHT : DT_LEFT) | (opts.draw_text_rtl ? DT_RTLREADING : 0); @@ -773,7 +773,7 @@ void CalcRectangles(HWND hwnd) next_top = data->nick_rect.bottom + SPACE_TEXT_TEXT; // Fits more? - if (next_top > r.bottom) + if (next_top > r.bottom) goto finish; if (next_top > avatar_bottom && opts.use_avatar_space_to_draw_text) @@ -790,7 +790,7 @@ void CalcRectangles(HWND hwnd) if (opts.show_protocol_cycle_button) tmp_r.right -= 2 * ICON_SIZE; - data->proto_rect = GetRect(hdc, tmp_r, proto->description, _T(""), proto, uFormat, + data->proto_rect = GetRect(hdc, tmp_r, proto->description, _T(""), proto, uFormat, next_top, tmp_text_left, false, true, false); if (opts.show_protocol_cycle_button) { @@ -837,7 +837,7 @@ void CalcRectangles(HWND hwnd) } // Fits more? - if (next_top + 2 * BORDER_SPACE > r.bottom) + if (next_top + 2 * BORDER_SPACE > r.bottom) goto finish; if (next_top > avatar_bottom && opts.use_avatar_space_to_draw_text) @@ -851,7 +851,7 @@ void CalcRectangles(HWND hwnd) // Text size RECT r_tmp = r; - DrawText(hdc, proto->status_name, _tcslen(proto->status_name), &r_tmp, + DrawText(hdc, proto->status_name, _tcslen(proto->status_name), &r_tmp, DT_CALCRECT | (uFormat & ~DT_END_ELLIPSIS)); SIZE s; @@ -900,7 +900,7 @@ void CalcRectangles(HWND hwnd) } // Fits more? - if (next_top + 2 * BORDER_SPACE > r.bottom) + if (next_top + 2 * BORDER_SPACE > r.bottom) goto finish; if (next_top > avatar_bottom && opts.use_avatar_space_to_draw_text) @@ -921,7 +921,7 @@ void CalcRectangles(HWND hwnd) } // Fits more? - if (next_top + 2 * BORDER_SPACE > r.bottom) + if (next_top + 2 * BORDER_SPACE > r.bottom) goto finish; if (next_top > avatar_bottom && opts.use_avatar_space_to_draw_text) @@ -934,7 +934,7 @@ void CalcRectangles(HWND hwnd) if (proto->listening_to[0] == '\0') { SelectObject(hdc, hFont[FONT_LISTENING_TO]); - data->listening_to_rect = GetRect(hdc, r, proto->listening_to, DEFAULT_LISTENING_TO, proto, uFormat, + data->listening_to_rect = GetRect(hdc, r, proto->listening_to, DEFAULT_LISTENING_TO, proto, uFormat, next_top, text_left); data->listening_to_text_rect = data->listening_to_rect; @@ -947,7 +947,7 @@ void CalcRectangles(HWND hwnd) // Text size RECT r_tmp = r; - DrawText(hdc, proto->listening_to, _tcslen(proto->listening_to), &r_tmp, + DrawText(hdc, proto->listening_to, _tcslen(proto->listening_to), &r_tmp, DT_CALCRECT | (uFormat & ~DT_END_ELLIPSIS)); SIZE s; @@ -1037,7 +1037,7 @@ finish: HBITMAP CreateBitmap32(int cx, int cy) { - BITMAPINFO RGB32BitsBITMAPINFO; + BITMAPINFO RGB32BitsBITMAPINFO; UINT * ptPixels; ZeroMemory(&RGB32BitsBITMAPINFO,sizeof(BITMAPINFO)); @@ -1047,10 +1047,10 @@ HBITMAP CreateBitmap32(int cx, int cy) RGB32BitsBITMAPINFO.bmiHeader.biPlanes=1; RGB32BitsBITMAPINFO.bmiHeader.biBitCount=32; - HBITMAP DirectBitmap = CreateDIBSection(NULL, - &RGB32BitsBITMAPINFO, + HBITMAP DirectBitmap = CreateDIBSection(NULL, + &RGB32BitsBITMAPINFO, DIB_RGB_COLORS, - (void **)&ptPixels, + (void **)&ptPixels, NULL, 0); return DirectBitmap; } @@ -1069,7 +1069,7 @@ void EraseBackground(HWND hwnd, HDC hdc, MyDetailsFrameData* data) } } -void DrawTextWithRect(HDC hdc, const TCHAR *text, const TCHAR *def_text, RECT rc, UINT uFormat, +void DrawTextWithRect(HDC hdc, const TCHAR *text, const TCHAR *def_text, RECT rc, UINT uFormat, bool mouse_over, Protocol *proto, bool replace_smileys = true) { const TCHAR *tmp; @@ -1094,7 +1094,7 @@ void DrawTextWithRect(HDC hdc, const TCHAR *text, const TCHAR *def_text, RECT rc HRGN rgn = CreateRectRgnIndirect(&r); SelectClipRgn(hdc, rgn); - + RECT rc_tmp; int text_height; @@ -1178,7 +1178,7 @@ void Draw(HWND hwnd, HDC hdc_orig) // Draw items - UINT uFormat = DT_SINGLELINE | DT_NOPREFIX | DT_END_ELLIPSIS + UINT uFormat = DT_SINGLELINE | DT_NOPREFIX | DT_END_ELLIPSIS | (opts.draw_text_align_right ? DT_RIGHT : DT_LEFT) | (opts.draw_text_rtl ? DT_RTLREADING : 0); @@ -1211,7 +1211,7 @@ void Draw(HWND hwnd, HDC hdc_orig) adr.hTargetDC = hdc; adr.rcDraw = data->img_rect; - adr.dwFlags = AVDRQ_OWNPIC | AVDRQ_HIDEBORDERONTRANSPARENCY | + adr.dwFlags = AVDRQ_OWNPIC | AVDRQ_HIDEBORDERONTRANSPARENCY | (opts.draw_avatar_border ? AVDRQ_DRAWBORDER : 0 ) | (opts.draw_avatar_round_corner ? AVDRQ_ROUNDEDCORNER : 0 ); adr.clrBorder = opts.draw_avatar_border_color; @@ -1236,7 +1236,7 @@ void Draw(HWND hwnd, HDC hdc_orig) SelectObject(hdc, hFont[FONT_NICK]); SetTextColor(hdc, font_colour[FONT_NICK]); - DrawTextWithRect(hdc, proto->nickname, DEFAULT_NICKNAME, rc, uFormat, + DrawTextWithRect(hdc, proto->nickname, DEFAULT_NICKNAME, rc, uFormat, data->mouse_over_nick && proto->CanSetNick(), proto); // Clipping rgn @@ -1315,7 +1315,7 @@ void Draw(HWND hwnd, HDC hdc_orig) SelectClipRgn(hdc, rgn); HICON status_icon; - if (proto->custom_status != 0 && ProtoServiceExists(proto->name, PS_GETCUSTOMSTATUSICON)) + if (proto->custom_status != 0 && ProtoServiceExists(proto->name, PS_GETCUSTOMSTATUSICON)) status_icon = (HICON) CallProtoService(proto->name, PS_GETCUSTOMSTATUSICON, proto->custom_status, 0); else status_icon = LoadSkinnedProtoIcon(proto->name, proto->status); @@ -1324,7 +1324,7 @@ void Draw(HWND hwnd, HDC hdc_orig) DrawIconEx(hdc, data->status_icon_rect.left, data->status_icon_rect.top, status_icon, ICON_SIZE, ICON_SIZE, 0, NULL, DI_NORMAL); DeleteObject(status_icon); } - + SelectClipRgn(hdc, NULL); DeleteObject(rgn); @@ -1354,7 +1354,7 @@ void Draw(HWND hwnd, HDC hdc_orig) SelectObject(hdc, hFont[FONT_AWAY_MSG]); SetTextColor(hdc, font_colour[FONT_AWAY_MSG]); - DrawTextWithRect(hdc, proto->status_message, DEFAULT_STATUS_MESSAGE, rc, uFormat, + DrawTextWithRect(hdc, proto->status_message, DEFAULT_STATUS_MESSAGE, rc, uFormat, data->mouse_over_away_msg && proto->CanSetStatusMsg(), proto); // Clipping rgn @@ -1374,7 +1374,7 @@ void Draw(HWND hwnd, HDC hdc_orig) SelectObject(hdc, hFont[FONT_LISTENING_TO]); SetTextColor(hdc, font_colour[FONT_LISTENING_TO]); - DrawTextWithRect(hdc, proto->listening_to, DEFAULT_LISTENING_TO, rc, uFormat, + DrawTextWithRect(hdc, proto->listening_to, DEFAULT_LISTENING_TO, rc, uFormat, data->mouse_over_listening_to && protocols->CanSetListeningTo(), proto); // Clipping rgn @@ -1399,7 +1399,7 @@ void Draw(HWND hwnd, HDC hdc_orig) icon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_LISTENINGTO)); DrawIconEx(hdc, data->listening_to_icon_rect.left, data->listening_to_icon_rect.top, icon, ICON_SIZE, ICON_SIZE, 0, NULL, DI_NORMAL); Skin_ReleaseIcon(icon); - + SelectClipRgn(hdc, NULL); DeleteObject(rgn); @@ -1424,7 +1424,7 @@ void Draw(HWND hwnd, HDC hdc_orig) SetTextColor(hdc, old_color); SetBkMode(hdc, old_bk_mode); - BitBlt(hdc_orig, r_full.left, r_full.top, r_full.right - r_full.left, + BitBlt(hdc_orig, r_full.left, r_full.top, r_full.right - r_full.left, r_full.bottom - r_full.top, hdc, r_full.left, r_full.top, SRCCOPY); DeleteDC(hdc); DeleteObject(hBmp); @@ -1453,7 +1453,7 @@ void MakeHover(HWND hwnd, bool draw, bool *hover, POINT *p, RECT *r) TrackMouseEvent(&tme); } } - else + else { if (*hover) { @@ -1467,11 +1467,11 @@ void MakeHover(HWND hwnd, bool draw, bool *hover, POINT *p, RECT *r) void ShowGlobalStatusMenu(HWND hwnd, MyDetailsFrameData *data, Protocol *proto, POINT &p) { HMENU submenu = (HMENU) CallService(MS_CLIST_MENUGETSTATUS,0,0); - + p.x = (opts.draw_text_align_right ? data->status_rect.right : data->status_rect.left); p.y = data->status_rect.bottom+1; ClientToScreen(hwnd, &p); - + int ret = TrackPopupMenu(submenu, TPM_TOPALIGN|TPM_RIGHTBUTTON|TPM_RETURNCMD | (opts.draw_text_align_right ? TPM_RIGHTALIGN : TPM_LEFTALIGN), p.x, p.y, 0, hwnd, NULL); @@ -1494,9 +1494,9 @@ void ShowProtocolStatusMenu(HWND hwnd, MyDetailsFrameData *data, Protocol *proto mii.cbSize = sizeof(mii); - if (!IsWinVer98Plus()) + if (!IsWinVer98Plus()) mii.fMask = MIIM_TYPE; - else + else mii.fMask = MIIM_STRING; GetMenuItemInfo(menu, i, TRUE, &mii); @@ -1524,7 +1524,7 @@ void ShowProtocolStatusMenu(HWND hwnd, MyDetailsFrameData *data, Protocol *proto p.x = (opts.draw_text_align_right ? data->status_rect.right : data->status_rect.left); p.y = data->status_rect.bottom+1; ClientToScreen(hwnd, &p); - + int ret = TrackPopupMenu(submenu, TPM_TOPALIGN|TPM_RIGHTBUTTON|TPM_RETURNCMD | (opts.draw_text_align_right ? TPM_RIGHTALIGN : TPM_LEFTALIGN), p.x, p.y, 0, hwnd, NULL); @@ -1560,11 +1560,11 @@ void ShowProtocolStatusMenu(HWND hwnd, MyDetailsFrameData *data, Protocol *proto p.x = (opts.draw_text_align_right ? data->status_rect.right : data->status_rect.left); p.y = data->status_rect.bottom+1; ClientToScreen(hwnd, &p); - + int ret = TrackPopupMenu(submenu, TPM_TOPALIGN|TPM_RIGHTBUTTON|TPM_RETURNCMD | (opts.draw_text_align_right ? TPM_RIGHTALIGN : TPM_LEFTALIGN), p.x, p.y, 0, hwnd, NULL); DestroyMenu(menu); - if (ret) + if (ret) { proto->SetStatus(ret); } @@ -1608,11 +1608,11 @@ void ShowListeningToMenu(HWND hwnd, MyDetailsFrameData *data, Protocol *proto, P } SetMenuItemInfo(submenu, ID_LISTENINGTOPOPUP_SENDLISTENINGTO, FALSE, &mii); - + p.x = (opts.draw_text_align_right ? data->listening_to_rect.right : data->listening_to_rect.left); p.y = data->listening_to_rect.bottom+1; ClientToScreen(hwnd, &p); - + int ret = TrackPopupMenu(submenu, TPM_TOPALIGN|TPM_RIGHTBUTTON|TPM_RETURNCMD | (opts.draw_text_align_right ? TPM_RIGHTALIGN : TPM_LEFTALIGN), p.x, p.y, 0, hwnd, NULL); DestroyMenu(menu); @@ -1634,11 +1634,11 @@ void ShowListeningToMenu(HWND hwnd, MyDetailsFrameData *data, Protocol *proto, P } -LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) +LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { - switch(msg) + switch(msg) { - case WM_CREATE: + case WM_CREATE: { MyDetailsFrameData *data = new MyDetailsFrameData(); ZeroMemory(data, sizeof(MyDetailsFrameData)); @@ -1674,7 +1674,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar { RECT r; - if (GetUpdateRect(hwnd, &r, FALSE)) + if (GetUpdateRect(hwnd, &r, FALSE)) { PAINTSTRUCT ps; @@ -1682,7 +1682,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar Draw(hwnd, hdc); EndPaint(hwnd, &ps); } - + return TRUE; } @@ -1739,8 +1739,8 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar break; POINT p; - p.x = LOWORD(lParam); - p.y = HIWORD(lParam); + p.x = LOWORD(lParam); + p.y = HIWORD(lParam); // In image? if (data->draw_img && InsideRect(&p, &data->img_rect) && proto->CanSetAvatar()) @@ -1816,14 +1816,14 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar InsertMenuItem(menu, 0, TRUE, &mii); } - + if (opts.draw_text_align_right) p.x = data->proto_rect.right; else p.x = data->proto_rect.left; p.y = data->proto_rect.bottom+1; ClientToScreen(hwnd, &p); - + int ret = TrackPopupMenu(menu, TPM_TOPALIGN|TPM_LEFTALIGN|TPM_RIGHTBUTTON|TPM_RETURNCMD, p.x, p.y, 0, hwnd, NULL); DestroyMenu(menu); @@ -1855,8 +1855,8 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar break; POINT p; - p.x = LOWORD(lParam); - p.y = HIWORD(lParam); + p.x = LOWORD(lParam); + p.y = HIWORD(lParam); ScreenToClient(hwnd, &p); @@ -1888,9 +1888,9 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar } InsertMenuItem(submenu, 0, TRUE, &mii); - + ClientToScreen(hwnd, &p); - + int ret = TrackPopupMenu(submenu, TPM_TOPALIGN|TPM_LEFTALIGN|TPM_RIGHTBUTTON|TPM_RETURNCMD, p.x, p.y, 0, hwnd, NULL); DestroyMenu(menu); @@ -1934,9 +1934,9 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar } InsertMenuItem(submenu, 0, TRUE, &mii); - + ClientToScreen(hwnd, &p); - + int ret = TrackPopupMenu(submenu, TPM_TOPALIGN|TPM_LEFTALIGN|TPM_RIGHTBUTTON|TPM_RETURNCMD, p.x, p.y, 0, hwnd, NULL); DestroyMenu(menu); @@ -1991,9 +1991,9 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar InsertMenuItem(submenu, 0, TRUE, &mii); } - + // Add this to menu - mir_sntprintf(tmp, SIZEOF(tmp), TranslateT("Set My Status Message for %s..."), + mir_sntprintf(tmp, SIZEOF(tmp), TranslateT("Set My Status Message for %s..."), CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, proto->status, GSMDF_TCHAR)); MENUITEMINFO mii = {0}; @@ -2010,9 +2010,9 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar } InsertMenuItem(submenu, 0, TRUE, &mii); - + ClientToScreen(hwnd, &p); - + int ret = TrackPopupMenu(submenu, TPM_TOPALIGN|TPM_LEFTALIGN|TPM_RIGHTBUTTON|TPM_RETURNCMD, p.x, p.y, 0, hwnd, NULL); DestroyMenu(menu); @@ -2024,7 +2024,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar case 2: CallService(MS_MYDETAILS_SETMYSTATUSMESSAGEUI, (WPARAM) proto->status, 0); break; - + case ID_STATUSMESSAGEPOPUP_SETMYSTATUSMESSAGE: CallService(MS_MYDETAILS_SETMYSTATUSMESSAGEUI, 0, 0); break; @@ -2048,7 +2048,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar { } // Default context menu - else + else { HMENU menu = LoadMenu(hInst, MAKEINTRESOURCE(IDR_MENU1)); HMENU submenu = GetSubMenu(menu, 1); @@ -2082,7 +2082,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar InsertMenuItem(submenu, 0, TRUE, &mii); // Add this to menu - mir_sntprintf(tmp, SIZEOF(tmp), TranslateT("Set My Status Message for %s..."), + mir_sntprintf(tmp, SIZEOF(tmp), TranslateT("Set My Status Message for %s..."), CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, proto->status, GSMDF_TCHAR)); ZeroMemory(&mii, sizeof(mii)); @@ -2171,7 +2171,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar SetMenuItemInfo(submenu, ID_CONTEXTPOPUP_ENABLELISTENINGTO, FALSE, &mii); ClientToScreen(hwnd, &p); - + int ret = TrackPopupMenu(submenu, TPM_TOPALIGN|TPM_LEFTALIGN|TPM_RIGHTBUTTON|TPM_RETURNCMD, p.x, p.y, 0, hwnd, NULL); DestroyMenu(menu); @@ -2291,8 +2291,8 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar break; POINT p; - p.x = LOWORD(lParam); - p.y = HIWORD(lParam); + p.x = LOWORD(lParam); + p.y = HIWORD(lParam); MakeHover(hwnd, data->draw_img, &data->mouse_over_img, &p, &data->img_rect); MakeHover(hwnd, data->draw_nick, &data->mouse_over_nick, &p, &data->nick_rect); @@ -2318,7 +2318,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar LPNMTTDISPINFO lpttd = (LPNMTTDISPINFO) lpnmhdr; SendMessage(lpnmhdr->hwndFrom, TTM_SETMAXTIPWIDTH, 0, 300); - + if (lpnmhdr->hwndFrom == data->nick_tt_hwnd) lpttd->lpszText = proto->nickname; else if (lpnmhdr->hwndFrom == data->status_tt_hwnd) @@ -2431,9 +2431,9 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar } -INT_PTR ShowHideFrameFunc(WPARAM wParam, LPARAM lParam) +INT_PTR ShowHideFrameFunc(WPARAM wParam, LPARAM lParam) { - if (ServiceExists(MS_CLIST_FRAMES_ADDFRAME)) + if (ServiceExists(MS_CLIST_FRAMES_ADDFRAME)) { CallService(MS_CLIST_FRAMES_SHFRAME, frame_id, 0); } @@ -2443,7 +2443,7 @@ INT_PTR ShowHideFrameFunc(WPARAM wParam, LPARAM lParam) { SendMessage(hwnd_container, WM_CLOSE, 0, 0); } - else + else { ShowWindow(hwnd_container, SW_SHOW); db_set_b(0, MODULE_NAME, SETTING_FRAME_VISIBLE, 1); @@ -2457,10 +2457,10 @@ INT_PTR ShowHideFrameFunc(WPARAM wParam, LPARAM lParam) INT_PTR ShowFrameFunc(WPARAM wParam, LPARAM lParam) { - if (ServiceExists(MS_CLIST_FRAMES_ADDFRAME)) + if (ServiceExists(MS_CLIST_FRAMES_ADDFRAME)) { int flags = CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS, MAKEWPARAM(FO_FLAGS, frame_id), 0); - if (!(flags & F_VISIBLE)) + if (!(flags & F_VISIBLE)) CallService(MS_CLIST_FRAMES_SHFRAME, frame_id, 0); } else @@ -2480,10 +2480,10 @@ INT_PTR ShowFrameFunc(WPARAM wParam, LPARAM lParam) INT_PTR HideFrameFunc(WPARAM wParam, LPARAM lParam) { - if (ServiceExists(MS_CLIST_FRAMES_ADDFRAME)) + if (ServiceExists(MS_CLIST_FRAMES_ADDFRAME)) { int flags = CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS, MAKEWPARAM(FO_FLAGS, frame_id), 0); - if (flags & F_VISIBLE) + if (flags & F_VISIBLE) CallService(MS_CLIST_FRAMES_SHFRAME, frame_id, 0); } else @@ -2499,7 +2499,7 @@ INT_PTR HideFrameFunc(WPARAM wParam, LPARAM lParam) } -void FixMainMenu() +void FixMainMenu() { CLISTMENUITEM mi = { sizeof(mi) }; mi.flags = CMIM_NAME | CMIF_TCHAR; @@ -2514,15 +2514,15 @@ void FixMainMenu() #include -void RedrawFrame() +void RedrawFrame() { - if (frame_id == -1) + if (frame_id == -1) InvalidateRect(hwnd_container, NULL, TRUE); else CallService(MS_CLIST_FRAMES_UPDATEFRAME, (WPARAM)frame_id, (LPARAM)FU_TBREDRAW | FU_FMREDRAW); } -void RefreshFrameAndCalcRects() +void RefreshFrameAndCalcRects() { if (hwnd_frame != NULL) { @@ -2533,21 +2533,21 @@ void RefreshFrameAndCalcRects() } } -void RefreshFrame() +void RefreshFrame() { if (hwnd_frame != NULL) PostMessage(hwnd_frame, MWM_REFRESH, 0, 0); } // only used when no multiwindow functionality is available -bool MyDetailsFrameVisible() +bool MyDetailsFrameVisible() { return IsWindowVisible(hwnd_container) ? true : false; } -void SetMyDetailsFrameVisible(bool visible) +void SetMyDetailsFrameVisible(bool visible) { - if (frame_id == -1 && hwnd_container != 0) + if (frame_id == -1 && hwnd_container != 0) { ShowWindow(hwnd_container, visible ? SW_SHOW : SW_HIDE); } @@ -2669,7 +2669,7 @@ INT_PTR PluginCommand_ShowProtocol(WPARAM wParam,LPARAM lParam) return 0; } -int SettingsChangedHook(WPARAM wParam, LPARAM lParam) +int SettingsChangedHook(WPARAM wParam, LPARAM lParam) { if (hwnd_frame == NULL) return 0; @@ -2681,11 +2681,11 @@ int SettingsChangedHook(WPARAM wParam, LPARAM lParam) Protocol *proto = protocols->Get(cws->szModule); if (!strcmp(cws->szSetting,"MyHandle") - || !strcmp(cws->szSetting,"UIN") - || !strcmp(cws->szSetting,"Nick") - || !strcmp(cws->szSetting,"FirstName") - || !strcmp(cws->szSetting,"e-mail") - || !strcmp(cws->szSetting,"LastName") + || !strcmp(cws->szSetting,"UIN") + || !strcmp(cws->szSetting,"Nick") + || !strcmp(cws->szSetting,"FirstName") + || !strcmp(cws->szSetting,"e-mail") + || !strcmp(cws->szSetting,"LastName") || !strcmp(cws->szSetting,"JID")) { // Name changed @@ -2706,7 +2706,7 @@ int SettingsChangedHook(WPARAM wParam, LPARAM lParam) return 0; } -int AvatarChangedHook(WPARAM wParam, LPARAM lParam) +int AvatarChangedHook(WPARAM wParam, LPARAM lParam) { if (hwnd_frame == NULL) return 0; @@ -2728,7 +2728,7 @@ int ProtoAckHook(WPARAM wParam, LPARAM lParam) if(ack->result == ACKRESULT_SUCCESS) { - switch (ack->type) + switch (ack->type) { case ACKTYPE_STATUS: { diff --git a/plugins/Ping/src/pingthread.cpp b/plugins/Ping/src/pingthread.cpp index 9ff2b50efe..f032d93b45 100644 --- a/plugins/Ping/src/pingthread.cpp +++ b/plugins/Ping/src/pingthread.cpp @@ -6,7 +6,7 @@ int upCount, total = 0; int list_size = 0; HANDLE mainThread; -HANDLE hWakeEvent = 0; +HANDLE hWakeEvent = 0; // thread protected variables CRITICAL_SECTION thread_finished_cs, list_changed_cs, data_list_cs; @@ -92,7 +92,7 @@ DWORD WINAPI sttCheckStatusThreadProc( void *vp) { clock_t start_t = clock(), end_t; while(!get_thread_finished()) { - + end_t = clock(); int wait = (int)((options.ping_period - ((end_t - start_t) / (double)CLOCKS_PER_SEC)) * 1000); @@ -114,7 +114,7 @@ DWORD WINAPI sttCheckStatusThreadProc( void *vp) set_list_changed(false); int size = data_list.size(); Unlock(&data_list_cs); - + int index = 0; for(; index < size; index++) { Lock(&data_list_cs, "ping thread loop start"); @@ -133,7 +133,7 @@ DWORD WINAPI sttCheckStatusThreadProc( void *vp) pa.status = i.val().status; break; } - + } Unlock(&data_list_cs); @@ -152,7 +152,7 @@ DWORD WINAPI sttCheckStatusThreadProc( void *vp) InvalidateRect(list_hwnd, 0, FALSE); } - CallService(PLUG "/Ping", 0, (LPARAM)&pa); + CallService(PLUG "/Ping", 0, (LPARAM)&pa); if(get_thread_finished()) break; if(get_list_changed()) break; @@ -191,11 +191,11 @@ DWORD WINAPI sttCheckStatusThreadProc( void *vp) } } Unlock(&data_list_cs); - - if(pa.responding) { + + if(pa.responding) { count++; - if(pa.miss_count == -1 - options.retries || + if(pa.miss_count == -1 - options.retries || (((-pa.miss_count) % (options.retries + 1)) == 0 && !options.block_reps)) { reply = true; @@ -211,7 +211,7 @@ DWORD WINAPI sttCheckStatusThreadProc( void *vp) SetProtoStatus(pa.pszLabel, pa.pszProto, pa.get_status, pa.set_status); } else { - if(pa.miss_count == 1 + options.retries || + if(pa.miss_count == 1 + options.retries || ((pa.miss_count % (options.retries + 1)) == 0 && !options.block_reps)) { timeout = true; @@ -227,7 +227,7 @@ DWORD WINAPI sttCheckStatusThreadProc( void *vp) } InvalidateRect(list_hwnd, 0, FALSE); - } + } } if(timeout) SkinPlaySound("PingTimeout"); @@ -262,9 +262,9 @@ void stop_ping_thread() { } bool FrameIsFloating() { - if(frame_id == -1) + if(frame_id == -1) return true; // no frames, always floating - + return (CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS, MAKEWPARAM(FO_FLOATING, frame_id), 0) != 0); } @@ -278,7 +278,7 @@ int FillList(WPARAM wParam, LPARAM lParam) { SendMessage(list_hwnd, WM_SETREDRAW, (WPARAM)FALSE, 0); Lock(&data_list_cs, "fill_list"); - + data_list = pl; SendMessage(list_hwnd, LB_RESETCONTENT, 0, 0); @@ -327,7 +327,7 @@ void CALLBACK TimerProc( wsprintf(TBcapt,"Ping (%d/%d)", upCount, total); else wsprintf(TBcapt,"Ping"); - + CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS,MAKEWPARAM(FO_TBNAME,frame_id),(LPARAM)TBcapt); CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS,MAKEWPARAM(FO_TBTIPNAME,frame_id),(LPARAM)TBcapt); CallService(MS_CLIST_FRAMES_UPDATEFRAME,frame_id,FU_TBREDRAW); @@ -353,7 +353,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar switch(msg) { - + case WM_MEASUREITEM: mis = (MEASUREITEMSTRUCT *)lParam; mis->itemWidth = 100; @@ -383,13 +383,13 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar GetClientRect(hwnd, &r); - if((dis->itemState & ODS_SELECTED && dis->itemState & ODS_FOCUS) + if((dis->itemState & ODS_SELECTED && dis->itemState & ODS_FOCUS) || (context_point_valid && (x >= dis->rcItem.left && x <= dis->rcItem.right) && (y >= dis->rcItem.top && y <= dis->rcItem.bottom))) { tcol = DBGetContactSettingDword(NULL,"CLC","SelBkColour", GetSysColor(COLOR_HIGHLIGHT)); SetBkColor(dis->hDC, tcol); FillRect(dis->hDC, &dis->rcItem, (ttbrush = CreateSolidBrush(tcol))); - + tcol = DBGetContactSettingDword(NULL,"CLC","SelTextColour", GetSysColor(COLOR_HIGHLIGHTTEXT)); SetTextColor(dis->hDC, tcol); } else { @@ -400,7 +400,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar tcol = DBGetContactSettingDword(NULL, PLUG, "FontCol", GetSysColor(COLOR_WINDOWTEXT)); SetTextColor(dis->hDC, tcol); } - + SetBkMode(dis->hDC, TRANSPARENT); HICON hIcon = (itemData.status != PS_DISABLED ? (itemData.status == PS_TESTING ? hIconTesting : (itemData.status == PS_RESPONDING ? hIconResponding : hIconNotResponding)) : hIconDisabled); dis->rcItem.left += options.indent; @@ -421,7 +421,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar mir_snprintf(buf, 256, "[%d]", itemData.miss_count); GetTextExtentPoint32(dis->hDC,buf,lstrlen(buf),&textSize); TextOut(dis->hDC,dis->rcItem.right - textSize.cx - 2,(dis->rcItem.top + dis->rcItem.bottom -textSize.cy)>>1,buf,lstrlen(buf)); - } + } } SetBkMode(dis->hDC, OPAQUE); } @@ -430,15 +430,15 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar } //return DefWindowProc(hwnd, msg, wParam, lParam); return TRUE; - + case WM_CTLCOLORLISTBOX: { if(tbrush) DeleteObject(tbrush); return (BOOL)(tbrush = CreateSolidBrush(bk_col)); - } - - case WM_ERASEBKGND: + } + + case WM_ERASEBKGND: { RECT r; GetClientRect(hwnd, &r); @@ -463,7 +463,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar DWORD item = SendMessage(list_hwnd, LB_ITEMFROMPOINT, 0, MAKELPARAM(pt.x, pt.y)); bool found = false; - if(HIWORD(item) == 0) { + if(HIWORD(item) == 0) { int count = LOWORD(item); Lock(&data_list_cs, "show graph"); if(count >= 0 && count < (int)data_list.size()) { @@ -471,7 +471,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar found = true; } Unlock(&data_list_cs); - + } if(found) { @@ -501,7 +501,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar context_point_valid = false; InvalidateRect(list_hwnd, 0, FALSE); } - + return TRUE; case WM_SYSCOLORCHANGE: @@ -509,17 +509,17 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar return DefWindowProc(hwnd, msg, wParam, lParam); case WM_CREATE: - list_hwnd = CreateWindow("LISTBOX", "", - //(WS_VISIBLE | WS_CHILD | LBS_NOINTEGRALHEIGHT| LBS_STANDARD | WS_CLIPCHILDREN | LBS_OWNERDRAWVARIABLE | LBS_NOTIFY) - (WS_VISIBLE | WS_CHILD | LBS_STANDARD | LBS_OWNERDRAWFIXED | LBS_NOTIFY) - & ~WS_BORDER, 0, 0, 0, 0, hwnd, NULL, hInst,0); + list_hwnd = CreateWindow("LISTBOX", "", + //(WS_VISIBLE | WS_CHILD | LBS_NOINTEGRALHEIGHT| LBS_STANDARD | WS_CLIPCHILDREN | LBS_OWNERDRAWVARIABLE | LBS_NOTIFY) + (WS_VISIBLE | WS_CHILD | LBS_STANDARD | LBS_OWNERDRAWFIXED | LBS_NOTIFY) + & ~WS_BORDER, 0, 0, 0, 0, hwnd, NULL, hInst,0); if (DBGetContactSettingByte(NULL,"CList","Transparent",0)) { if(ServiceExists(MS_CLIST_FRAMES_ADDFRAME)) { } else { -#ifdef WS_EX_LAYERED +#ifdef WS_EX_LAYERED SetWindowLong(hwnd, GWL_EXSTYLE, GetWindowLong(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED); #endif #ifdef LWA_ALPHA @@ -568,7 +568,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar case WM_TIMER: if ((int)wParam==TM_AUTOALPHA) { int inwnd; - + if (GetForegroundWindow()==hwnd) { KillTimer(hwnd,TM_AUTOALPHA); inwnd=1; @@ -642,26 +642,26 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar } /* - case WM_PAINT: + case WM_PAINT: { - paintDC = BeginPaint(hwnd, &paintStruct); // + paintDC = BeginPaint(hwnd, &paintStruct); // //SelectObject(paintDC,TitleBarFont); //SetBkMode(paintDC,TRANSPARENT); //paintStruct.fErase=TRUE; //color=RGB(1,1,1); //brush=CreateSolidBrush(RGB(200,20,20)); - + //GetClientRect(hwnd,&rect); //FillRect(paintDC,&rect,brush); //TextOut(paintDC,4,4,"cl1 Bottom window",sizeof("cl1 Bottom window")-1); //DeleteObject(brush); - EndPaint(hwnd, &paintStruct); // - + EndPaint(hwnd, &paintStruct); // + }; return TRUE; - + */ case WM_COMMAND: //CreateServiceFunction("PingPlug/DisableAll", PingPlugDisableAll); @@ -674,7 +674,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar RECT r; GetWindowRect(list_hwnd, &r); DWORD item = SendMessage(list_hwnd, LB_ITEMFROMPOINT, 0, MAKELPARAM(x - r.left, y - r.top)); - if(HIWORD(item) == 0) { + if(HIWORD(item) == 0) { int count = LOWORD(item); bool found = false; Lock(&data_list_cs, "menu show graph"); @@ -695,7 +695,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar RECT r; GetWindowRect(list_hwnd, &r); DWORD item = SendMessage(list_hwnd, LB_ITEMFROMPOINT, 0, MAKELPARAM(x - r.left, y - r.top)); - if(HIWORD(item) == 0) { + if(HIWORD(item) == 0) { int count = LOWORD(item); bool found = false; Lock(&data_list_cs, "menu toggle"); @@ -717,7 +717,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar GetWindowRect(list_hwnd, &r); DWORD item = SendMessage(list_hwnd, LB_ITEMFROMPOINT, 0, MAKELPARAM(x - r.left, y - r.top)); PINGADDRESS *temp = 0; - if(HIWORD(item) == 0) { + if(HIWORD(item) == 0) { int count = LOWORD(item); Lock(&data_list_cs, "menu edit"); if(count >= 0 && count < (int)data_list.size()) { @@ -774,7 +774,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar if(pItemData) { DWORD item_id = pItemData->item_id; - Unlock(&data_list_cs); + Unlock(&data_list_cs); int wake = CallService(PLUG "/DblClick", (WPARAM)item_id, 0); InvalidateRect(list_hwnd, 0, FALSE); @@ -787,22 +787,22 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar } } else { - Unlock(&data_list_cs); + Unlock(&data_list_cs); } } } return TRUE; } return DefWindowProc(hwnd, msg, wParam, lParam); - + case WM_MOVE: // needed for docked frames in clist_mw (not needed in clist_modern) - if(FrameIsFloating()) + if(FrameIsFloating()) break; case WM_SIZE: { //PostMessage(label, WM_SIZE, wParam, lParam); - - GetClientRect(hwnd,&rect); + + GetClientRect(hwnd,&rect); //SetWindowPos(list_hwnd, 0, rect.left, rect.top, rect.right-rect.left, rect.bottom-rect.top, SWP_NOZORDER); //InvalidateRect(list_hwnd, &rect, FALSE); int winheight = rect.bottom - rect.top, @@ -873,7 +873,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar return DefWindowProc(hwnd, msg, wParam, lParam); }; - + return(TRUE); }; @@ -918,15 +918,15 @@ void UpdateFrame() { SetWindowPos(hpwnd, 0, r_clist.left, r_clist.top - height, (r_clist.right - r_clist.left), height, SWP_NOZORDER | SWP_NOACTIVATE); } -WNDPROC wpOrigClistProc; +WNDPROC wpOrigClistProc; -// Subclass procedure +// Subclass procedure LRESULT APIENTRY ClistSubclassProc( - HWND hwnd, - UINT uMsg, - WPARAM wParam, - LPARAM lParam) -{ + HWND hwnd, + UINT uMsg, + WPARAM wParam, + LPARAM lParam) +{ if(uMsg == WM_SIZE || uMsg == WM_MOVE) UpdateFrame(); @@ -943,9 +943,9 @@ LRESULT APIENTRY ClistSubclassProc( if(uMsg == WM_SHOWWINDOW) { ShowWindow(hpwnd, wParam); } - - return CallWindowProc(wpOrigClistProc, hwnd, uMsg, wParam, lParam); -} + + return CallWindowProc(wpOrigClistProc, hwnd, uMsg, wParam, lParam); +} void AttachToClist(bool attach) { if(!hpwnd) return; @@ -956,15 +956,15 @@ void AttachToClist(bool attach) { SetWindowPos(hpwnd, 0, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOSIZE); // subclass clist to trap move/size - wpOrigClistProc = (WNDPROC) SetWindowLongPtr(hwnd_clist, GWLP_WNDPROC, (LONG_PTR) ClistSubclassProc); + wpOrigClistProc = (WNDPROC) SetWindowLongPtr(hwnd_clist, GWLP_WNDPROC, (LONG_PTR) ClistSubclassProc); UpdateFrame(); } else { SetWindowLong(hpwnd, GWL_STYLE, (WS_POPUPWINDOW | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_VISIBLE | WS_CLIPCHILDREN)); SetWindowLong(hpwnd, GWL_EXSTYLE, WS_EX_TOOLWINDOW); SetWindowPos(hpwnd, 0, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOSIZE); - - SetWindowLongPtr(hwnd_clist, GWLP_WNDPROC, (LONG_PTR) wpOrigClistProc); + + SetWindowLongPtr(hwnd_clist, GWLP_WNDPROC, (LONG_PTR) wpOrigClistProc); } } @@ -1000,10 +1000,10 @@ void InitList() { frame.cbSize=sizeof(CLISTFrame); frame.hWnd=hpwnd; frame.align=alBottom; - frame.Flags=F_VISIBLE|F_SHOWTB|F_SHOWTBTIP; + frame.Flags=F_VISIBLE | F_SHOWTB | F_SHOWTBTIP; frame.height=30; frame.TBname=Translate("Ping"); - + frame_id=CallService(MS_CLIST_FRAMES_ADDFRAME,(WPARAM)&frame,0); } else { hpwnd=CreateWindowEx(WS_EX_TOOLWINDOW, _T(PLUG) _T("WindowClass"),_T("Ping"), @@ -1013,7 +1013,7 @@ void InitList() { Utils_RestoreWindowPosition(hpwnd, 0, PLUG, "main_window"); CreateServiceFunction(PLUG "/ShowWindow", PingPlugShowWindow); - + CLISTMENUITEM mi = { sizeof(mi) }; mi.flags = CMIF_TCHAR; mi.popupPosition = 1000200001; diff --git a/plugins/TopToolBar/src/toolbarwnd.cpp b/plugins/TopToolBar/src/toolbarwnd.cpp index 5899e46a1f..c4a3dc993f 100644 --- a/plugins/TopToolBar/src/toolbarwnd.cpp +++ b/plugins/TopToolBar/src/toolbarwnd.cpp @@ -295,7 +295,7 @@ INT_PTR OnEventFire(WPARAM wParam, LPARAM lParam) Frame.align = alTop; Frame.Flags = F_VISIBLE | F_NOBORDER | F_LOCKED | F_TCHAR; Frame.height = g_ctrl->nLastHeight; - Frame.hIcon = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA); + Frame.hIcon = LoadSkinnedIcon(SKINICON_OTHER_FRAME); g_ctrl->hFrame = (HANDLE)CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&Frame, 0); } diff --git a/plugins/Weather/src/weather_mwin.cpp b/plugins/Weather/src/weather_mwin.cpp index 9e6288cd34..3e6cfd7b9b 100644 --- a/plugins/Weather/src/weather_mwin.cpp +++ b/plugins/Weather/src/weather_mwin.cpp @@ -36,23 +36,23 @@ typedef struct { HANDLE hContact; HWND hAvt; - BOOL haveAvatar; + BOOL haveAvatar; } MWinDataType; #define WM_REDRAWWIN (WM_USER + 17369) -static LRESULT CALLBACK wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) +static LRESULT CALLBACK wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { MWinDataType *data = (MWinDataType*)GetWindowLongPtr(hwnd, GWLP_USERDATA); - switch(msg) + switch(msg) { case WM_CREATE: data = (MWinDataType*)mir_calloc(sizeof(MWinDataType)); SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)data); data->hContact = (HANDLE)((LPCREATESTRUCT)lParam)->lpCreateParams; - data->hAvt = CreateWindow(AVATAR_CONTROL_CLASS, TEXT(""), WS_CHILD, + data->hAvt = CreateWindow(AVATAR_CONTROL_CLASS, TEXT(""), WS_CHILD, 0, 0, opt.AvatarSize, opt.AvatarSize, hwnd, NULL, hInst, 0); if (data->hAvt) SendMessage(data->hAvt, AVATAR_SETCONTACT, 0, (LPARAM)data->hContact); break; @@ -145,7 +145,7 @@ static LRESULT CALLBACK wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara { RECT r, rc; - if (GetUpdateRect(hwnd, &r, FALSE)) + if (GetUpdateRect(hwnd, &r, FALSE)) { DBVARIANT dbv = {0}; PAINTSTRUCT ps; @@ -161,7 +161,7 @@ static LRESULT CALLBACK wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara picSize = GetSystemMetrics(SM_CXICON); hIcon = LoadSkinnedProtoIconBig(WEATHERPROTONAME, statusIcon); - if ((INT_PTR)hIcon == CALLSERVICE_NOTFOUND) + if ((INT_PTR)hIcon == CALLSERVICE_NOTFOUND) { picSize = GetSystemMetrics(SM_CXSMICON); hIcon = LoadSkinnedProtoIcon(WEATHERPROTONAME, statusIcon); @@ -227,7 +227,7 @@ static LRESULT CALLBACK wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara SelectObject(hdc, hfntold); DeleteObject(hfnt); - if (dbv.pszVal) + if (dbv.pszVal) { HFONT hfnt = CreateFontIndirect(&lfnt); HFONT hfntold = ( HFONT )SelectObject(hdc, hfnt); @@ -251,7 +251,7 @@ static LRESULT CALLBACK wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara return(TRUE); } -static void addWindow(HANDLE hContact) +static void addWindow(HANDLE hContact) { DBVARIANT dbv; db_get_ts(hContact, WEATHERPROTONAME, "Nick", &dbv); @@ -260,7 +260,7 @@ static void addWindow(HANDLE hContact) mir_sntprintf(winname, SIZEOF(winname), _T("Weather: %s"), dbv.ptszVal); db_free(&dbv); - HWND hWnd = CreateWindow( _T("WeatherFrame"), _T(""), WS_CHILD | WS_VISIBLE, + HWND hWnd = CreateWindow( _T("WeatherFrame"), _T(""), WS_CHILD | WS_VISIBLE, 0, 0, 10, 10, (HWND)CallService(MS_CLUI_GETHWND, 0, 0), NULL, hInst, hContact); WindowList_Add(hMwinWindowList, hWnd, hContact); @@ -270,7 +270,7 @@ static void addWindow(HANDLE hContact) Frame.cbSize = sizeof(Frame); Frame.hWnd = hWnd; Frame.align = alBottom; - Frame.Flags = F_VISIBLE|F_NOBORDER|F_TCHAR; + Frame.Flags = F_VISIBLE | F_NOBORDER | F_TCHAR; Frame.height = 32; DWORD frameID = CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&Frame, 0); @@ -278,7 +278,7 @@ static void addWindow(HANDLE hContact) db_set_b(hContact, "CList", "Hidden", TRUE); } -void removeWindow(HANDLE hContact) +void removeWindow(HANDLE hContact) { DWORD frameId = db_get_dw(hContact, WEATHERPROTONAME, "mwin", 0); @@ -289,7 +289,7 @@ void removeWindow(HANDLE hContact) db_unset(hContact, "CList", "Hidden"); } -void UpdateMwinData(HANDLE hContact) +void UpdateMwinData(HANDLE hContact) { HWND hwnd = WindowList_Find(hMwinWindowList, hContact); if (hwnd != NULL) @@ -297,7 +297,7 @@ void UpdateMwinData(HANDLE hContact) } -INT_PTR Mwin_MenuClicked(WPARAM wParam,LPARAM lParam) +INT_PTR Mwin_MenuClicked(WPARAM wParam,LPARAM lParam) { BOOL addwnd = WindowList_Find(hMwinWindowList, (HANDLE)wParam) == NULL; if (addwnd) @@ -308,10 +308,10 @@ INT_PTR Mwin_MenuClicked(WPARAM wParam,LPARAM lParam) } -int BuildContactMenu(WPARAM wparam,LPARAM lparam) +int BuildContactMenu(WPARAM wparam,LPARAM lparam) { CLISTMENUITEM mi = { sizeof(mi) }; - mi.flags = CMIM_FLAGS | + mi.flags = CMIM_FLAGS | (db_get_dw((HANDLE)wparam, WEATHERPROTONAME, "mwin", 0) ? CMIF_CHECKED : 0); CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMwinMenu, (LPARAM)&mi); return 0; @@ -325,7 +325,7 @@ int RedrawFrame(WPARAM wParam, LPARAM lParam) } -void InitMwin(void) +void InitMwin(void) { HMODULE hUser = GetModuleHandle(_T("user32.dll")); @@ -386,10 +386,10 @@ void InitMwin(void) } HANDLE hContact = db_find_first(); - while(hContact) + while(hContact) { // see if the contact is a weather contact - if (IsMyContact(hContact)) + if (IsMyContact(hContact)) { if (db_get_dw(hContact, WEATHERPROTONAME, "mwin", 0)) addWindow(hContact); @@ -402,10 +402,10 @@ void InitMwin(void) void DestroyMwin(void) { HANDLE hContact = db_find_first(); - while(hContact) + while(hContact) { // see if the contact is a weather contact - if (IsMyContact(hContact)) + if (IsMyContact(hContact)) { DWORD frameId = db_get_dw(hContact, WEATHERPROTONAME, "mwin", 0); if (frameId) -- cgit v1.2.3