summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern/src/CLUIFrames
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2014-12-14 21:30:16 +0000
committerKirill Volinsky <mataes2007@gmail.com>2014-12-14 21:30:16 +0000
commitc730f12da81f636ecf65aa656a46b9337daaa37a (patch)
tree0b069d59b6366447e0a0d40982ac610fbe86d9a7 /plugins/Clist_modern/src/CLUIFrames
parent91867c03b57bbf85eae500475683c16da4ec3a9c (diff)
Clist_modern: changed warning lavel to w4
git-svn-id: http://svn.miranda-ng.org/main/trunk@11425 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_modern/src/CLUIFrames')
-rw-r--r--plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp67
-rw-r--r--plugins/Clist_modern/src/CLUIFrames/cluiframes.h4
-rw-r--r--plugins/Clist_modern/src/CLUIFrames/framesmenu.cpp10
-rw-r--r--plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp126
4 files changed, 99 insertions, 108 deletions
diff --git a/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp b/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp
index 0fc080fbac..e43d540057 100644
--- a/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp
+++ b/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp
@@ -31,12 +31,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "../hdr/modern_static_cluiframes_service.h" // contain services initialization and proxiation
-static const int UNCOLLAPSED_FRAME_SIZE = 0;
-static const int DEFAULT_TITLEBAR_HEIGHT = 18;
+static const int UNCOLLAPSED_FRAME_SIZE = 0;
+static const int DEFAULT_TITLEBAR_HEIGHT = 18;
//GLOBALS
-FRAMEWND *g_pfwFrames = NULL;
-int g_nFramesCount = 0;
+FRAMEWND *g_pfwFrames = NULL;
+int g_nFramesCount = 0;
int g_nTitleBarHeight = DEFAULT_TITLEBAR_HEIGHT;
// STATIC
@@ -205,7 +205,7 @@ int CLUIFrames_SetParentForContainers(HWND parent)
return 0;
}
-int CLUIFrames_OnShowHide(HWND hwnd, int mode)
+int CLUIFrames_OnShowHide(int mode)
{
int i;
int prevFrameCount;
@@ -316,7 +316,7 @@ FRAMEWND * FindFrameByItsHWND(HWND FrameHwnd)
return NULL;
}
-static void DockThumbs(FRAMEWND *pThumbLeft, FRAMEWND *pThumbRight, BOOL bMoveLeft)
+static void DockThumbs(FRAMEWND *pThumbLeft, FRAMEWND *pThumbRight)
{
if ((pThumbRight->dockOpt.hwndLeft == NULL) && (pThumbLeft->dockOpt.hwndRight == NULL)) {
pThumbRight->dockOpt.hwndLeft = pThumbLeft->ContainerWnd;
@@ -494,11 +494,11 @@ static void PositionThumb(FRAMEWND *pThumb, short nX, short nY)
if (bMoveTogether) {
if (bDockedRight) {
- DockThumbs(pThumb, pCurThumb, TRUE);
+ DockThumbs(pThumb, pCurThumb);
}
if (bDockedLeft) {
- DockThumbs(pCurThumb, pThumb, FALSE);
+ DockThumbs(pCurThumb, pThumb);
}
}
@@ -941,7 +941,7 @@ static int ModifyMItem(WPARAM wParam, LPARAM lParam)
};
-static int CLUIFramesModifyContextMenuForFrame(WPARAM wParam, LPARAM lParam)
+static int CLUIFramesModifyContextMenuForFrame(WPARAM wParam, LPARAM)
{
/* HOOK */
if (MirandaExiting()) return 0;
@@ -991,7 +991,7 @@ static int CLUIFramesModifyContextMenuForFrame(WPARAM wParam, LPARAM lParam)
return 0;
}
-static int CLUIFramesModifyMainMenuItems(WPARAM wParam, LPARAM lParam)
+static int CLUIFramesModifyMainMenuItems(WPARAM wParam, LPARAM)
{
//hiword(wParam) = frameid,loword(wParam) = flag
if (_fCluiFramesModuleNotStarted) return -1;
@@ -1045,7 +1045,7 @@ static int CLUIFramesModifyMainMenuItems(WPARAM wParam, LPARAM lParam)
}
-static INT_PTR _us_DoGetFrameOptions(WPARAM wParam, LPARAM lParam)
+static INT_PTR _us_DoGetFrameOptions(WPARAM wParam, LPARAM)
{
INT_PTR retval;
BOOL bUnicodeText = (LOWORD(wParam) & FO_UNICODETEXT) != 0;
@@ -1299,7 +1299,7 @@ static int _us_DoSetFrameOptions(WPARAM wParam, LPARAM lParam)
}
//wparam = lparam = 0
-static int _us_DoShowAllFrames(WPARAM wParam, LPARAM lParam)
+static int _us_DoShowAllFrames(WPARAM, LPARAM)
{
int i;
@@ -1312,7 +1312,7 @@ static int _us_DoShowAllFrames(WPARAM wParam, LPARAM lParam)
}
//wparam = lparam = 0
-static int _us_DoShowTitles(WPARAM wParam, LPARAM lParam)
+static int _us_DoShowTitles(WPARAM, LPARAM)
{
int i;
@@ -1325,13 +1325,11 @@ static int _us_DoShowTitles(WPARAM wParam, LPARAM lParam)
}
//wparam = lparam = 0
-static int _us_DoHideTitles(WPARAM wParam, LPARAM lParam)
+static int _us_DoHideTitles(WPARAM, LPARAM)
{
- int i;
-
if (_fCluiFramesModuleNotStarted) return -1;
- for (i = 0; i < g_nFramesCount; i++)
+ for (int i = 0; i < g_nFramesCount; i++)
g_pfwFrames[i].TitleBar.ShowTitleBar = FALSE;
CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0);
return 0;
@@ -1435,12 +1433,12 @@ static int _us_DoMoveFrame(WPARAM wParam, LPARAM lParam)
return 0;
}
-static int _us_DoMoveFrameUp(WPARAM wParam, LPARAM lParam)
+static int _us_DoMoveFrameUp(WPARAM wParam, LPARAM)
{
return CLUIFrames_MoveFrame(wParam, (LPARAM)+1);
}
-static int _us_DoMoveFrameDown(WPARAM wParam, LPARAM lParam)
+static int _us_DoMoveFrameDown(WPARAM wParam, LPARAM)
{
return CLUIFrames_MoveFrame(wParam, (LPARAM)-1);
}
@@ -1456,21 +1454,21 @@ static int _us_DoSetFrameAlign(WPARAM wParam, LPARAM lParam)
return 0;
}
-static int _us_DoAlignFrameTop(WPARAM wParam, LPARAM lParam)
+static int _us_DoAlignFrameTop(WPARAM wParam, LPARAM)
{
if (_fCluiFramesModuleNotStarted) return -1;
return CLUIFrames_SetFrameAlign(wParam, alTop);
}
-static int _us_DoAlignFrameBottom(WPARAM wParam, LPARAM lParam)
+static int _us_DoAlignFrameBottom(WPARAM wParam, LPARAM)
{
if (_fCluiFramesModuleNotStarted) return -1;
return CLUIFrames_SetFrameAlign(wParam, alBottom);
}
-static int _us_DoAlignFrameClient(WPARAM wParam, LPARAM lParam)
+static int _us_DoAlignFrameClient(WPARAM wParam, LPARAM)
{
if (_fCluiFramesModuleNotStarted) return -1;
@@ -1495,7 +1493,6 @@ static int _us_DoLockFrame(WPARAM wParam, LPARAM lParam)
static int _us_DoSetFrameBorder(WPARAM wParam, LPARAM lParam)
{
RECT rc;
- int oldflags;
if (_fCluiFramesModuleNotStarted) return -1;
@@ -1503,7 +1500,7 @@ static int _us_DoSetFrameBorder(WPARAM wParam, LPARAM lParam)
if (FrameId == -1)
return -1;
- int flt = oldflags = CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS, MAKEWPARAM(FO_FLAGS, wParam), 0);
+ int oldflags = CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS, MAKEWPARAM(FO_FLAGS, wParam), 0);
if (oldflags & F_NOBORDER)
oldflags &= ~F_NOBORDER;
else
@@ -1716,7 +1713,7 @@ static HFONT CLUILoadTitleBarFont()
//wparam = (CLISTFrame*)clfrm
-static int _us_DoAddFrame(WPARAM wParam, LPARAM lParam)
+static int _us_DoAddFrame(WPARAM wParam, LPARAM)
{
int retval;
LONG_PTR style;
@@ -1869,7 +1866,7 @@ static int _us_DoAddFrame(WPARAM wParam, LPARAM lParam)
return retval;
}
-static int _us_DoRemoveFrame(WPARAM wParam, LPARAM lParam)
+static int _us_DoRemoveFrame(WPARAM wParam, LPARAM)
{
int pos;
if (_fCluiFramesModuleNotStarted) return -1;
@@ -2102,7 +2099,6 @@ static int CLUIFramesResizeFrames(const RECT newsize)
int i, j;
int sepw = GapBetweenFrames;
int topBorder = newsize.top;
- int minHeight = CLUIFrames_GetTotalHeight();
SortData *sdarray;
@@ -2287,7 +2283,7 @@ static int _us_DoUpdateFrame(WPARAM wParam, LPARAM lParam)
return 0;
}
-int CLUIFrames_OnClistResize_mod(WPARAM wParam, LPARAM mode)
+int CLUIFrames_OnClistResize_mod(WPARAM, LPARAM mode)
{
RECT nRect;
int tick;
@@ -2526,7 +2522,7 @@ int CLUIFramesOnClistResize(WPARAM wParam, LPARAM lParam)
return 0;
}
-int OnFrameTitleBarBackgroundChange(WPARAM wParam, LPARAM lParam)
+int OnFrameTitleBarBackgroundChange(WPARAM, LPARAM)
{
if (MirandaExiting()) return 0;
{
@@ -2565,10 +2561,7 @@ void DrawBackGround(HWND hwnd, HDC mhdc, HBITMAP hBmpBackground, COLORREF bkColo
int y;
PAINTSTRUCT paintst = { 0 };
HBITMAP hBmpOsb, hOldBmp;
- LONG_PTR style = GetWindowLongPtr(hwnd, GWL_STYLE);
- int grey = 0;
HFONT oFont;
- HBRUSH hBrushAlternateGrey = NULL;
HFONT hFont;
@@ -2767,7 +2760,6 @@ int DrawTitleBar(HDC hdcMem2, RECT *rect, int Frameid)
mod_DrawIconEx_helper(hdcMem, rc.left, rc.top + ((g_nTitleBarHeight >> 1) - (GetSystemMetrics(SM_CXSMICON) >> 1)), g_pfwFrames[pos].collapsed ? LoadSkinnedIcon(SKINICON_OTHER_GROUPOPEN) : LoadSkinnedIcon(SKINICON_OTHER_GROUPSHUT), GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0, NULL, DI_NORMAL);
}
{
- BLENDFUNCTION bf = { AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
if (g_pfwFrames[pos].floating || (!g_CluiData.fLayered)) {
HRGN rgn = CreateRectRgn(rect->left, rect->top, rect->right, rect->bottom);
SelectClipRgn(hdcMem2, rgn);
@@ -3243,7 +3235,7 @@ static int CLUIFrameResizeFloatingFrame(int framepos)
return 0;
};
-static int CLUIFrameOnMainMenuBuild(WPARAM wParam, LPARAM lParam)
+static int CLUIFrameOnMainMenuBuild(WPARAM, LPARAM)
{
if (MirandaExiting()) return 0;
CLUIFramesLoadMainMenu();
@@ -3253,9 +3245,6 @@ static int CLUIFrameOnMainMenuBuild(WPARAM wParam, LPARAM lParam)
static LRESULT CALLBACK CLUIFrameSubContainerProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- RECT rect = { 0 };
- int Frameid = (GetWindowLongPtr(hwnd, GWLP_USERDATA));
-
switch (msg) {
case WM_ACTIVATE:
if (g_bTransparentFlag) {
@@ -3626,7 +3615,7 @@ static int _us_DoSetFrameFloat(WPARAM wParam, LPARAM lParam)
return 0;
}
-int CLUIFrameOnModulesLoad(WPARAM wParam, LPARAM lParam)
+int CLUIFrameOnModulesLoad(WPARAM, LPARAM)
{
/* HOOK */
CLUIFramesLoadMainMenu();
@@ -3634,7 +3623,7 @@ int CLUIFrameOnModulesLoad(WPARAM wParam, LPARAM lParam)
return 0;
}
-int CLUIFrameOnModulesUnload(WPARAM wParam, LPARAM lParam)
+int CLUIFrameOnModulesUnload(WPARAM, LPARAM)
{
g_CluiData.bSTATE = STATE_PREPEARETOEXIT;
diff --git a/plugins/Clist_modern/src/CLUIFrames/cluiframes.h b/plugins/Clist_modern/src/CLUIFrames/cluiframes.h
index d437c8ae03..03149f2250 100644
--- a/plugins/Clist_modern/src/CLUIFrames/cluiframes.h
+++ b/plugins/Clist_modern/src/CLUIFrames/cluiframes.h
@@ -1,5 +1,5 @@
/*
-Miranda ICQ: the free icq client for MS Windows
+Miranda ICQ: the free icq client for MS Windows
Copyright (C) 2000-2 Richard Hughes, Roland Rabien & Tristan Van de Vreede
This program is free software; you can redistribute it and/or
@@ -36,7 +36,7 @@ typedef struct tagProtocolData {
boolean show;
} ProtocolData;
-typedef struct
+typedef struct
{
int order;
int realpos;
diff --git a/plugins/Clist_modern/src/CLUIFrames/framesmenu.cpp b/plugins/Clist_modern/src/CLUIFrames/framesmenu.cpp
index 8b1bf6af9e..4f11a5d83d 100644
--- a/plugins/Clist_modern/src/CLUIFrames/framesmenu.cpp
+++ b/plugins/Clist_modern/src/CLUIFrames/framesmenu.cpp
@@ -11,9 +11,9 @@ typedef struct{
char *szServiceName;
int Frameid;
INT_PTR param1;
-}FrameMenuExecParam,*lpFrameMenuExecParam;
+}FrameMenuExecParam, *lpFrameMenuExecParam;
-INT_PTR FreeOwnerDataFrameMenu(WPARAM wParam, LPARAM lParam)
+INT_PTR FreeOwnerDataFrameMenu(WPARAM, LPARAM lParam)
{
lpFrameMenuExecParam cmep = (lpFrameMenuExecParam)lParam;
if (cmep != NULL){
@@ -23,7 +23,7 @@ INT_PTR FreeOwnerDataFrameMenu(WPARAM wParam, LPARAM lParam)
return 0;
}
-static INT_PTR AddContextFrameMenuItem(WPARAM wParam, LPARAM lParam)
+static INT_PTR AddContextFrameMenuItem(WPARAM, LPARAM lParam)
{
CLISTMENUITEM *mi = (CLISTMENUITEM*)lParam;
@@ -59,7 +59,7 @@ INT_PTR FrameMenuExecService(WPARAM wParam, LPARAM lParam)
}
//true - ok,false ignore
-INT_PTR FrameMenuCheckService(WPARAM wParam, LPARAM lParam)
+INT_PTR FrameMenuCheckService(WPARAM wParam, LPARAM)
{
PCheckProcParam pcpp = (PCheckProcParam)wParam;
if (pcpp == NULL)
@@ -79,7 +79,7 @@ INT_PTR FrameMenuCheckService(WPARAM wParam, LPARAM lParam)
static INT_PTR ContextFrameMenuNotify(WPARAM wParam, LPARAM lParam)
{
- NotifyEventHooks(hPreBuildFrameMenuEvent,wParam,lParam);
+ NotifyEventHooks(hPreBuildFrameMenuEvent, wParam, lParam);
return 0;
}
diff --git a/plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp b/plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp
index 64108e57ac..f0ebc98199 100644
--- a/plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp
+++ b/plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp
@@ -47,11 +47,11 @@ void InitSubGroupMenus(void);
typedef struct
{
char *szServiceName;
- int Param1,Param2;
+ int Param1, Param2;
}
- GroupMenuExecParam,*lpGroupMenuExecParam;
+GroupMenuExecParam, *lpGroupMenuExecParam;
-INT_PTR BuildGroupMenu(WPARAM wParam, LPARAM lParam)
+INT_PTR BuildGroupMenu(WPARAM, LPARAM)
{
NotifyEventHooks(g_CluiData.hEventPreBuildGroupMenu, 0, 0);
@@ -88,21 +88,23 @@ static INT_PTR AddGroupMenuItem(WPARAM wParam, LPARAM lParam)
mir_snprintf(buf, SIZEOF(buf), "%s/%s", mi->pszService, mi->pszName);
OptParam op;
- op.Handle = (HANDLE)CallService(MO_ADDNEWMENUITEM,(WPARAM)hGroupMenuObject,(LPARAM)&tmi);
+ op.Handle = (HANDLE)CallService(MO_ADDNEWMENUITEM, (WPARAM)hGroupMenuObject, (LPARAM)&tmi);
op.Setting = OPT_MENUITEMSETUNIQNAME;
op.Value = (INT_PTR)buf;
CallService(MO_SETOPTIONSMENUITEM, 0, (LPARAM)&op);
return (INT_PTR)op.Handle;
}
-int GroupMenuCheckService(WPARAM wParam, LPARAM lParam) {
-//not used
+int GroupMenuCheckService(WPARAM, LPARAM)
+{
+ //not used
return 0;
};
-INT_PTR GroupMenuonAddService(WPARAM wParam, LPARAM lParam) {
+INT_PTR GroupMenuonAddService(WPARAM wParam, LPARAM lParam)
+{
- MENUITEMINFO *mii = (MENUITEMINFO* )wParam;
+ MENUITEMINFO *mii = (MENUITEMINFO*)wParam;
if (mii == NULL)
return 0;
@@ -131,17 +133,17 @@ INT_PTR GroupMenuExecService(WPARAM wParam, LPARAM lParam)
{
if (wParam != 0) {
lpGroupMenuExecParam mmep = (lpGroupMenuExecParam)wParam;
- if (!mir_strcmp(mmep->szServiceName,"Help/AboutCommand")) {
+ if (!mir_strcmp(mmep->szServiceName, "Help/AboutCommand")) {
//bug in help.c,it used wparam as parent window handle without reason.
mmep->Param1 = 0;
- CallService(mmep->szServiceName,mmep->Param1,lParam);
+ CallService(mmep->szServiceName, mmep->Param1, lParam);
}
- else CallService(mmep->szServiceName,mmep->Param1,mmep->Param2);
+ else CallService(mmep->szServiceName, mmep->Param1, mmep->Param2);
}
return 1;
}
-INT_PTR FreeOwnerDataGroupMenu (WPARAM wParam, LPARAM lParam)
+INT_PTR FreeOwnerDataGroupMenu(WPARAM, LPARAM lParam)
{
lpGroupMenuExecParam mmep = (lpGroupMenuExecParam)lParam;
if (mmep != NULL) {
@@ -152,33 +154,33 @@ INT_PTR FreeOwnerDataGroupMenu (WPARAM wParam, LPARAM lParam)
return 0;
}
-INT_PTR HideGroupsHelper(WPARAM wParam, LPARAM lParam)
+INT_PTR HideGroupsHelper(WPARAM, LPARAM)
{
- int newVal = !(GetWindowLongPtr(pcli->hwndContactTree,GWL_STYLE)&CLS_HIDEEMPTYGROUPS);
- db_set_b(NULL,"CList","HideEmptyGroups",(BYTE)newVal);
- SendMessage(pcli->hwndContactTree,CLM_SETHIDEEMPTYGROUPS,newVal,0);
+ int newVal = !(GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE)&CLS_HIDEEMPTYGROUPS);
+ db_set_b(NULL, "CList", "HideEmptyGroups", (BYTE)newVal);
+ SendMessage(pcli->hwndContactTree, CLM_SETHIDEEMPTYGROUPS, newVal, 0);
return 0;
}
-INT_PTR UseGroupsHelper(WPARAM wParam, LPARAM lParam)
+INT_PTR UseGroupsHelper(WPARAM, LPARAM)
{
- int newVal = !(GetWindowLongPtr(pcli->hwndContactTree,GWL_STYLE)&CLS_USEGROUPS);
- db_set_b(NULL,"CList","UseGroups",(BYTE)newVal);
- SendMessage(pcli->hwndContactTree,CLM_SETUSEGROUPS,newVal,0);
+ int newVal = !(GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE)&CLS_USEGROUPS);
+ db_set_b(NULL, "CList", "UseGroups", (BYTE)newVal);
+ SendMessage(pcli->hwndContactTree, CLM_SETUSEGROUPS, newVal, 0);
return 0;
}
-INT_PTR HideOfflineRootHelper(WPARAM wParam, LPARAM lParam)
+INT_PTR HideOfflineRootHelper(WPARAM, LPARAM)
{
SendMessage(
(HWND)CallService(MS_CLUI_GETHWNDTREE, 0, 0),
CLM_SETHIDEOFFLINEROOT,
- !SendMessage((HWND)CallService(MS_CLUI_GETHWNDTREE, 0, 0),CLM_GETHIDEOFFLINEROOT, 0, 0),
+ !SendMessage((HWND)CallService(MS_CLUI_GETHWNDTREE, 0, 0), CLM_GETHIDEOFFLINEROOT, 0, 0),
0);
return 0;
}
-INT_PTR CreateGroupHelper(WPARAM wParam, LPARAM lParam)
+INT_PTR CreateGroupHelper(WPARAM, LPARAM)
{
SendMessage((HWND)CallService(MS_CLUI_GETHWNDTREE, 0, 0), CLM_SETHIDEEMPTYGROUPS, 0, 0);
SendMessage((HWND)CallService(MS_CLUI_GETHWNDTREE, 0, 0), CLM_SETUSEGROUPS, 1, 0);
@@ -186,21 +188,21 @@ INT_PTR CreateGroupHelper(WPARAM wParam, LPARAM lParam)
return 0;
};
-static int OnBuildGroupMenu(WPARAM wParam, LPARAM lParam)
+static int OnBuildGroupMenu(WPARAM, LPARAM)
{
if (MirandaExiting()) return 0;
CLISTMENUITEM mi = { sizeof(mi) };
- mi.flags = CMIM_FLAGS | ( db_get_b(NULL,"CList","HideOffline",SETTING_HIDEOFFLINE_DEFAULT)?CMIF_CHECKED:0);
+ mi.flags = CMIM_FLAGS | (db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT) ? CMIF_CHECKED : 0);
Menu_ModifyItem(hHideOfflineUsersMenuItem, &mi);
- mi.flags = CMIM_FLAGS | (SendMessage(pcli->hwndContactTree,CLM_GETHIDEOFFLINEROOT, 0, 0)?CMIF_CHECKED:0);
+ mi.flags = CMIM_FLAGS | (SendMessage(pcli->hwndContactTree, CLM_GETHIDEOFFLINEROOT, 0, 0) ? CMIF_CHECKED : 0);
Menu_ModifyItem(hHideOfflineUsersOutHereMenuItem, &mi);
- mi.flags = CMIM_FLAGS | (GetWindowLongPtr(pcli->hwndContactTree,GWL_STYLE)&CLS_HIDEEMPTYGROUPS?CMIF_CHECKED:0);
+ mi.flags = CMIM_FLAGS | (GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE)&CLS_HIDEEMPTYGROUPS ? CMIF_CHECKED : 0);
Menu_ModifyItem(hHideEmptyGroupsMenuItem, &mi);
- mi.flags = CMIM_FLAGS | (GetWindowLongPtr(pcli->hwndContactTree,GWL_STYLE)&CLS_USEGROUPS?0:CMIF_CHECKED);
+ mi.flags = CMIM_FLAGS | (GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE)&CLS_USEGROUPS ? 0 : CMIF_CHECKED);
Menu_ModifyItem(hDisableGroupsMenuItem, &mi);
return 0;
}
@@ -211,18 +213,18 @@ void GroupMenus_Init(void)
{
Icon_RegisterT(g_hInst, LPGENT("Contact list"), &iconItem, 1);
- CreateServiceFunction("CLISTMENUSGroup/ExecService",GroupMenuExecService);
- CreateServiceFunction("CLISTMENUSGroup/FreeOwnerDataGroupMenu",FreeOwnerDataGroupMenu);
- CreateServiceFunction("CLISTMENUSGroup/GroupMenuonAddService",GroupMenuonAddService);
- CreateServiceFunction("CLISTMENUSGroup/HideGroupsHelper",HideGroupsHelper);
- CreateServiceFunction("CLISTMENUSGroup/UseGroupsHelper",UseGroupsHelper);
- CreateServiceFunction("CLISTMENUSGroup/HideOfflineRootHelper",HideOfflineRootHelper);
- CreateServiceFunction("CLISTMENUSGroup/CreateGroupHelper",CreateGroupHelper);
+ CreateServiceFunction("CLISTMENUSGroup/ExecService", GroupMenuExecService);
+ CreateServiceFunction("CLISTMENUSGroup/FreeOwnerDataGroupMenu", FreeOwnerDataGroupMenu);
+ CreateServiceFunction("CLISTMENUSGroup/GroupMenuonAddService", GroupMenuonAddService);
+ CreateServiceFunction("CLISTMENUSGroup/HideGroupsHelper", HideGroupsHelper);
+ CreateServiceFunction("CLISTMENUSGroup/UseGroupsHelper", UseGroupsHelper);
+ CreateServiceFunction("CLISTMENUSGroup/HideOfflineRootHelper", HideOfflineRootHelper);
+ CreateServiceFunction("CLISTMENUSGroup/CreateGroupHelper", CreateGroupHelper);
- CreateServiceFunction("CList/AddGroupMenuItem",AddGroupMenuItem);
- CreateServiceFunction(MS_CLIST_MENUBUILDGROUP,BuildGroupMenu);
+ CreateServiceFunction("CList/AddGroupMenuItem", AddGroupMenuItem);
+ CreateServiceFunction(MS_CLIST_MENUBUILDGROUP, BuildGroupMenu);
- HookEvent(ME_CLIST_PREBUILDGROUPMENU,OnBuildGroupMenu);
+ HookEvent(ME_CLIST_PREBUILDGROUPMENU, OnBuildGroupMenu);
InitSubGroupMenus();
@@ -291,7 +293,7 @@ void GroupMenus_Init(void)
mi.icolibItem = NULL;
mi.pszService = MS_CLIST_SETHIDEOFFLINE;
mi.pszName = LPGEN("&Hide offline users");
- gmp.lParam = 0;gmp.wParam = -1;
+ gmp.lParam = 0; gmp.wParam = -1;
hHideOfflineUsersMenuItem = (HGENMENU)AddGroupMenuItem((WPARAM)&gmp, (LPARAM)&mi);
mi.position = 100002;
@@ -326,9 +328,9 @@ typedef struct
char *szServiceName;
int Param1, Param2;
}
-SubGroupMenuExecParam,*lpSubGroupMenuExecParam;
+SubGroupMenuExecParam, *lpSubGroupMenuExecParam;
-static int OnBuildSubGroupMenu(WPARAM wParam, LPARAM lParam)
+static int OnBuildSubGroupMenu(WPARAM wParam, LPARAM)
{
BOOL gray1 = FALSE;
BOOL gray2 = FALSE;
@@ -347,10 +349,10 @@ static int OnBuildSubGroupMenu(WPARAM wParam, LPARAM lParam)
if (gray1 && gray2) gray1 = FALSE; //should not be cause CLCItems_IsShowOfflineGroup return false if group->hideOffline
CLISTMENUITEM mi = { sizeof(mi) };
- mi.flags = CMIM_FLAGS | ((group->hideOffline && !gray1)?CMIF_CHECKED:0)| (gray1?CMIF_GRAYED:0);
+ mi.flags = CMIM_FLAGS | ((group->hideOffline && !gray1) ? CMIF_CHECKED : 0) | (gray1 ? CMIF_GRAYED : 0);
Menu_ModifyItem(hHideOfflineUsersHereMenuItem, &mi);
- mi.flags = CMIM_FLAGS | ((showOfflineinGroup && !gray2) ? CMIF_CHECKED:0)| (gray2?CMIF_GRAYED:0);
+ mi.flags = CMIM_FLAGS | ((showOfflineinGroup && !gray2) ? CMIF_CHECKED : 0) | (gray2 ? CMIF_GRAYED : 0);
Menu_ModifyItem(hShowOfflineUsersHereMenuItem, &mi);
return 0;
}
@@ -365,13 +367,13 @@ INT_PTR BuildSubGroupMenu(WPARAM wParam, LPARAM lParam)
param.lParam = lParam;
HMENU hMenu = CreatePopupMenu();
- CallService(MO_BUILDMENU,(WPARAM)hMenu,(LPARAM)&param);
+ CallService(MO_BUILDMENU, (WPARAM)hMenu, (LPARAM)&param);
return (INT_PTR)hMenu;
}
HMENU cliBuildGroupPopupMenu(ClcGroup *group)
{
- return (HMENU)CallService(MS_CLIST_MENUBUILDSUBGROUP,(WPARAM)group,0);
+ return (HMENU)CallService(MS_CLIST_MENUBUILDSUBGROUP, (WPARAM)group, 0);
}
static INT_PTR AddSubGroupMenuItem(WPARAM wParam, LPARAM lParam)
@@ -382,7 +384,7 @@ static INT_PTR AddSubGroupMenuItem(WPARAM wParam, LPARAM lParam)
return NULL;
lpSubGroupMenuExecParam mmep = (lpSubGroupMenuExecParam)mir_calloc(sizeof(SubGroupMenuExecParam));
- if ( mmep == NULL)
+ if (mmep == NULL)
return 0;
//we need just one parametr.
@@ -399,14 +401,14 @@ static INT_PTR AddSubGroupMenuItem(WPARAM wParam, LPARAM lParam)
mir_snprintf(buf, SIZEOF(buf), "%s/%s", mi->pszService, mi->pszName);
OptParam op;
- op.Handle = (HANDLE)CallService(MO_ADDNEWMENUITEM,(WPARAM)hSubGroupMenuObject,(LPARAM)&tmi);
+ op.Handle = (HANDLE)CallService(MO_ADDNEWMENUITEM, (WPARAM)hSubGroupMenuObject, (LPARAM)&tmi);
op.Setting = OPT_MENUITEMSETUNIQNAME;
op.Value = (INT_PTR)buf;
CallService(MO_SETOPTIONSMENUITEM, 0, (LPARAM)&op);
return (INT_PTR)op.Handle;
}
-INT_PTR SubGroupMenuCheckService(WPARAM wParam, LPARAM lParam)
+INT_PTR SubGroupMenuCheckService(WPARAM wParam, LPARAM)
{
TCheckProcParam * CParam = (TCheckProcParam*)wParam;
if (CParam) {
@@ -417,9 +419,9 @@ INT_PTR SubGroupMenuCheckService(WPARAM wParam, LPARAM lParam)
return 1;
}
-INT_PTR SubGroupMenuonAddService(WPARAM wParam, LPARAM lParam)
+INT_PTR SubGroupMenuonAddService(WPARAM wParam, LPARAM)
{
- MENUITEMINFO *mii = (MENUITEMINFO* )wParam;
+ MENUITEMINFO *mii = (MENUITEMINFO*)wParam;
if (mii == NULL)
return 0;
@@ -436,14 +438,14 @@ INT_PTR SubGroupMenuExecService(WPARAM wParam, LPARAM lParam)
if (!mir_strcmp(mmep->szServiceName, "Help/AboutCommand")) {
//bug in help.c,it used wparam as parent window handle without reason.
mmep->Param1 = 0;
- CallService(mmep->szServiceName,mmep->Param1,lParam);
+ CallService(mmep->szServiceName, mmep->Param1, lParam);
}
- else CallService(mmep->szServiceName,mmep->Param1,lParam);
+ else CallService(mmep->szServiceName, mmep->Param1, lParam);
}
return 1;
}
-INT_PTR FreeOwnerDataSubGroupMenu (WPARAM wParam, LPARAM lParam)
+INT_PTR FreeOwnerDataSubGroupMenu(WPARAM, LPARAM lParam)
{
lpSubGroupMenuExecParam mmep = (lpSubGroupMenuExecParam)lParam;
if (mmep != NULL){
@@ -458,22 +460,22 @@ INT_PTR FreeOwnerDataSubGroupMenu (WPARAM wParam, LPARAM lParam)
//lparam WM_COMMAND HWND
INT_PTR GroupMenuExecProxy(WPARAM wParam, LPARAM lParam)
{
- SendMessage(lParam?(HWND)lParam:(HWND)pcli->hwndContactTree,WM_COMMAND,wParam,0);
+ SendMessage(lParam ? (HWND)lParam : (HWND)pcli->hwndContactTree, WM_COMMAND, wParam, 0);
return 0;
}
void InitSubGroupMenus(void)
{
- CreateServiceFunction("CLISTMENUSSubGroup/ExecService",SubGroupMenuExecService);
- CreateServiceFunction("CLISTMENUSSubGroup/FreeOwnerDataSubGroupMenu",FreeOwnerDataSubGroupMenu);
- CreateServiceFunction("CLISTMENUSSubGroup/SubGroupMenuonAddService",SubGroupMenuonAddService);
- CreateServiceFunction("CLISTMENUSSubGroup/SubGroupMenuCheckService",SubGroupMenuCheckService);
- CreateServiceFunction("CLISTMENUSSubGroup/GroupMenuExecProxy",GroupMenuExecProxy);
+ CreateServiceFunction("CLISTMENUSSubGroup/ExecService", SubGroupMenuExecService);
+ CreateServiceFunction("CLISTMENUSSubGroup/FreeOwnerDataSubGroupMenu", FreeOwnerDataSubGroupMenu);
+ CreateServiceFunction("CLISTMENUSSubGroup/SubGroupMenuonAddService", SubGroupMenuonAddService);
+ CreateServiceFunction("CLISTMENUSSubGroup/SubGroupMenuCheckService", SubGroupMenuCheckService);
+ CreateServiceFunction("CLISTMENUSSubGroup/GroupMenuExecProxy", GroupMenuExecProxy);
- CreateServiceFunction("CList/AddSubGroupMenuItem",AddSubGroupMenuItem);
- CreateServiceFunction(MS_CLIST_MENUBUILDSUBGROUP,BuildSubGroupMenu);
+ CreateServiceFunction("CList/AddSubGroupMenuItem", AddSubGroupMenuItem);
+ CreateServiceFunction(MS_CLIST_MENUBUILDSUBGROUP, BuildSubGroupMenu);
- HookEvent(ME_CLIST_PREBUILDSUBGROUPMENU,OnBuildSubGroupMenu);
+ HookEvent(ME_CLIST_PREBUILDSUBGROUPMENU, OnBuildSubGroupMenu);
// SubGroup menu
hSubGroupMenuObject = MO_CreateMenuObject("SubGroupMenu", LPGEN("Subgroup menu"), 0, "CLISTMENUSSubGroup/ExecService");