summaryrefslogtreecommitdiff
path: root/plugins/Clist_mw/src/groupmenu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Clist_mw/src/groupmenu.cpp')
-rw-r--r--plugins/Clist_mw/src/groupmenu.cpp285
1 files changed, 143 insertions, 142 deletions
diff --git a/plugins/Clist_mw/src/groupmenu.cpp b/plugins/Clist_mw/src/groupmenu.cpp
index e911a3f5f5..70932d494c 100644
--- a/plugins/Clist_mw/src/groupmenu.cpp
+++ b/plugins/Clist_mw/src/groupmenu.cpp
@@ -42,15 +42,15 @@ HGENMENU hDisableGroupsMenuItem, hNewGroupMenuItem, hNewSubGroupMenuItem;
int NewGroupIconidx;
extern HIMAGELIST hCListImages;
-HICON LoadIconFromExternalFile(char *filename,int i,boolean UseLibrary,boolean registerit,char *IconName,char *SectName,char *Description,int internalidx,HICON DefIcon);
+HICON LoadIconFromExternalFile(char *filename, int i, boolean UseLibrary, boolean registerit, char *IconName, char *SectName, char *Description, int internalidx, HICON DefIcon);
void InitSubGroupMenus(void);
//Groupmenu exec param(ownerdata)
typedef struct{
-char *szServiceName;
-int Param1,Param2;
-}GroupMenuExecParam,*lpGroupMenuExecParam;
+ char *szServiceName;
+ int Param1, Param2;
+} GroupMenuExecParam, *lpGroupMenuExecParam;
/*
wparam = handle to the menu item returned by MS_CLIST_ADDCONTACTMENUITEM
@@ -58,7 +58,7 @@ return 0 on success.
*/
static INT_PTR RemoveGroupMenuItem(WPARAM wParam, LPARAM lParam)
{
- CallService(MO_REMOVEMENUITEM,wParam,0);
+ CallService(MO_REMOVEMENUITEM, wParam, 0);
return 0;
}
@@ -67,7 +67,7 @@ static INT_PTR BuildGroupMenu(WPARAM wParam, LPARAM lParam)
{
int tick;
HMENU hMenu;
- ListParam param = { 0 };
+ ListParam param = {0};
param.MenuObjectHandle = hGroupMenuObject;
//hMenu = hMainMenu;
@@ -75,19 +75,19 @@ static INT_PTR BuildGroupMenu(WPARAM wParam, LPARAM lParam)
//hMenu = wParam;
tick = GetTickCount();
- NotifyEventHooks(hPreBuildGroupMenuEvent,0,0);
+ NotifyEventHooks(hPreBuildGroupMenuEvent, 0, 0);
- CallService(MO_BUILDMENU,(WPARAM)hMenu,(LPARAM)&param);
+ CallService(MO_BUILDMENU, (WPARAM)hMenu, (LPARAM)&param);
//DrawMenuBar((HWND)CallService("CLUI/GetHwnd",0,0));
- tick = GetTickCount()-tick;
+ tick = GetTickCount() - tick;
return (INT_PTR)hMenu;
}
static INT_PTR AddGroupMenuItem(WPARAM wParam, LPARAM lParam)
{
TMO_MenuItem tmi;
- CLISTMENUITEM *mi = (CLISTMENUITEM*)lParam;
- if ( !pcli->pfnConvertMenu(mi, &tmi))
+ CLISTMENUITEM *mi = (CLISTMENUITEM *)lParam;
+ if (!pcli->pfnConvertMenu(mi, &tmi))
return 0;
lpGroupMenuExecParam mmep = (lpGroupMenuExecParam)mir_calloc(sizeof(GroupMenuExecParam));
@@ -108,24 +108,25 @@ 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);
+ CallService(MO_SETOPTIONSMENUITEM, 0, (LPARAM)&op);
return (INT_PTR)op.Handle;
// mainItemCount++;
// return MENU_CUSTOMITEMMAIN|(mainMenuItem[mainItemCount-1].id);
}
-INT_PTR GroupMenuCheckService(WPARAM wParam, LPARAM lParam) {
+INT_PTR GroupMenuCheckService(WPARAM wParam, LPARAM lParam)
+{
//not used
return 0;
}
-INT_PTR GroupMenuonAddService(WPARAM wParam, LPARAM lParam) {
-
- MENUITEMINFO *mii = (MENUITEMINFO* )wParam;
+INT_PTR GroupMenuonAddService(WPARAM wParam, LPARAM lParam)
+{
+ MENUITEMINFO *mii = (MENUITEMINFO *)wParam;
if (mii == NULL) return 0;
if (hHideShowMainMenuItem == (HANDLE)lParam) {
@@ -135,12 +136,12 @@ INT_PTR GroupMenuonAddService(WPARAM wParam, LPARAM lParam) {
if (hGroupMainMenuItemProxy == (HANDLE)lParam) {
mii->fMask |= MIIM_SUBMENU;
- mii->hSubMenu = (HMENU)CallService(MS_CLIST_MENUGETMAIN,0,0);
+ mii->hSubMenu = (HMENU)CallService(MS_CLIST_MENUGETMAIN, 0, 0);
}
if (hGroupStatusMenuItemProxy == (HANDLE)lParam) {
mii->fMask |= MIIM_SUBMENU;
- mii->hSubMenu = (HMENU)CallService(MS_CLIST_MENUGETSTATUS,0,0);
+ mii->hSubMenu = (HMENU)CallService(MS_CLIST_MENUGETSTATUS, 0, 0);
}
return TRUE;
@@ -149,25 +150,23 @@ INT_PTR GroupMenuonAddService(WPARAM wParam, LPARAM lParam) {
//called with:
//wparam - ownerdata
//lparam - lparam from winproc
-INT_PTR GroupMenuExecService(WPARAM wParam, LPARAM lParam) {
- if (wParam != 0)
- {
+INT_PTR GroupMenuExecService(WPARAM wParam, LPARAM lParam)
+{
+ if (wParam != 0) {
lpGroupMenuExecParam mmep = (lpGroupMenuExecParam)wParam;
- if ( !strcmp(mmep->szServiceName,"Help/AboutCommand"))
- {
+ if (!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);
- }else
- {
- CallService(mmep->szServiceName,mmep->Param1,mmep->Param2);
+ CallService(mmep->szServiceName, mmep->Param1, lParam);
}
+ else
+ CallService(mmep->szServiceName, mmep->Param1, mmep->Param2);
}
- return(1);
+ return 1;
}
-INT_PTR FreeOwnerDataGroupMenu (WPARAM wParam, LPARAM lParam)
+INT_PTR FreeOwnerDataGroupMenu(WPARAM wParam, LPARAM lParam)
{
lpGroupMenuExecParam mmep = (lpGroupMenuExecParam)lParam;
if (mmep != NULL) {
@@ -179,55 +178,51 @@ INT_PTR FreeOwnerDataGroupMenu (WPARAM wParam, LPARAM lParam)
INT_PTR HideGroupsHelper(WPARAM wParam, LPARAM 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 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)
{
-SendMessage(
- pcli->hwndContactTree,
- CLM_SETHIDEOFFLINEROOT,
- !SendMessage(pcli->hwndContactTree,CLM_GETHIDEOFFLINEROOT,0,0),
- 0);
+ SendMessage(pcli->hwndContactTree, CLM_SETHIDEOFFLINEROOT, !SendMessage(pcli->hwndContactTree, CLM_GETHIDEOFFLINEROOT, 0, 0), 0);
return 0;
}
static int OnBuildGroupMenu(WPARAM wParam, LPARAM lParam)
{
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;
}
int static OnIconLibIconChanged(WPARAM wParam, LPARAM lParam)
{
- HICON hicon = LoadIconFromExternalFile("clisticons.dll",2,TRUE,FALSE,"NewGroup","Contact list","New Group",-IDI_NEWGROUP,0);
- NewGroupIconidx = ImageList_ReplaceIcon(hCListImages,NewGroupIconidx,hicon);
+ HICON hicon = LoadIconFromExternalFile("clisticons.dll", 2, TRUE, FALSE, "NewGroup", "Contact list", "New group", -IDI_NEWGROUP, 0);
+ NewGroupIconidx = ImageList_ReplaceIcon(hCListImages, NewGroupIconidx, hicon);
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_ICON;
- mi.hIcon = ImageList_GetIcon(hCListImages,NewGroupIconidx,0);
+ mi.hIcon = ImageList_GetIcon(hCListImages, NewGroupIconidx, 0);
Menu_ModifyItem(hNewSubGroupMenuItem, &mi);
Menu_ModifyItem(hNewGroupMenuItem, &mi);
return 0;
@@ -235,21 +230,21 @@ int static OnIconLibIconChanged(WPARAM wParam, LPARAM lParam)
void InitGroupMenus(void)
{
- HICON hicon = LoadIconFromExternalFile("clisticons.dll",2,TRUE,TRUE,"NewGroup","Contact list","New Group",-IDI_NEWGROUP2,0);
- NewGroupIconidx = ImageList_AddIcon(hCListImages,hicon );
-
- 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("CList/AddGroupMenuItem",AddGroupMenuItem);
- CreateServiceFunction(MS_CLIST_REMOVEGROUPMENUITEM,RemoveGroupMenuItem);
- CreateServiceFunction(MS_CLIST_MENUBUILDGROUP,BuildGroupMenu);
+ HICON hicon = LoadIconFromExternalFile("clisticons.dll", 2, TRUE, TRUE, "NewGroup", "Contact list", "New group", -IDI_NEWGROUP2, 0);
+ NewGroupIconidx = ImageList_AddIcon(hCListImages, hicon);
+
+ 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("CList/AddGroupMenuItem", AddGroupMenuItem);
+ CreateServiceFunction(MS_CLIST_REMOVEGROUPMENUITEM, RemoveGroupMenuItem);
+ CreateServiceFunction(MS_CLIST_MENUBUILDGROUP, BuildGroupMenu);
hPreBuildGroupMenuEvent = CreateHookableEvent(ME_CLIST_PREBUILDGROUPMENU);
- HookEvent(ME_CLIST_PREBUILDGROUPMENU,OnBuildGroupMenu);
+ HookEvent(ME_CLIST_PREBUILDGROUPMENU, OnBuildGroupMenu);
InitSubGroupMenus();
@@ -259,104 +254,105 @@ void InitGroupMenus(void)
MO_SetMenuObjectParam(hGroupMenuObject, OPT_MENUOBJECT_SET_FREE_SERVICE, "CLISTMENUSGroup/FreeOwnerDataGroupMenu");
MO_SetMenuObjectParam(hGroupMenuObject, OPT_MENUOBJECT_SET_ONADD_SERVICE, "CLISTMENUSGroup/GroupMenuonAddService");
{
- //add exit command to menu
+ //add exit command to menu
GroupMenuParam gmp;
CLISTMENUITEM mi = { sizeof(mi) };
mi.position = 1900000;
mi.pszService = "CloseAction";
mi.pszName = LPGEN("E&xit");
- AddGroupMenuItem(0,(LPARAM)&mi);
+ AddGroupMenuItem(0, (LPARAM)&mi);
- memset(&mi,0,sizeof(mi));
+ memset(&mi, 0, sizeof(mi));
mi.cbSize = sizeof(mi);
mi.position = 500;
mi.pszService = MS_CLIST_SHOWHIDE;
mi.pszName = LPGEN("&Hide/Show");
- hHideShowMainMenuItem = (HANDLE)AddGroupMenuItem(0,(LPARAM)&mi);
+ hHideShowMainMenuItem = (HANDLE)AddGroupMenuItem(0, (LPARAM)&mi);
- memset(&mi,0,sizeof(mi));
+ memset(&mi, 0, sizeof(mi));
mi.cbSize = sizeof(mi);
mi.position = 200000;
mi.hIcon = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_FINDUSER));
mi.pszService = "FindAdd/FindAddCommand";
- mi.pszName = LPGEN("&Find/Add Contacts...");
- AddGroupMenuItem(0,(LPARAM)&mi);
+ mi.pszName = LPGEN("&Find/Add contacts...");
+ AddGroupMenuItem(0, (LPARAM)&mi);
- memset(&mi,0,sizeof(mi));
+ memset(&mi, 0, sizeof(mi));
mi.cbSize = sizeof(mi);
mi.position = 300000;
mi.pszService = "";
mi.pszName = LPGEN("&Main menu");
- hGroupMainMenuItemProxy = (HANDLE)AddGroupMenuItem(0,(LPARAM)&mi);
+ hGroupMainMenuItemProxy = (HANDLE)AddGroupMenuItem(0, (LPARAM)&mi);
- memset(&mi,0,sizeof(mi));
+ memset(&mi, 0, sizeof(mi));
mi.cbSize = sizeof(mi);
mi.position = 300100;
mi.pszService = "";
mi.pszName = LPGEN("&Status");
- hGroupStatusMenuItemProxy = (HANDLE)AddGroupMenuItem(0,(LPARAM)&mi);
+ hGroupStatusMenuItemProxy = (HANDLE)AddGroupMenuItem(0, (LPARAM)&mi);
- memset(&mi,0,sizeof(mi));
+ memset(&mi, 0, sizeof(mi));
mi.cbSize = sizeof(mi);
mi.position = 400000;
- mi.hIcon = LoadIcon(GetModuleHandle(NULL),MAKEINTRESOURCE(IDI_OPTIONS));
+ mi.hIcon = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_OPTIONS));
mi.pszService = "Options/OptionsCommand";
mi.pszName = LPGEN("&Options...");
- AddGroupMenuItem(0,(LPARAM)&mi);
+ AddGroupMenuItem(0, (LPARAM)&mi);
- memset(&mi,0,sizeof(mi));
+ memset(&mi, 0, sizeof(mi));
mi.cbSize = sizeof(mi);
mi.position = 500000;
- mi.hIcon = LoadIcon(GetModuleHandle(NULL),MAKEINTRESOURCE(IDI_CLIENTMIRANDA));
+ mi.hIcon = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_CLIENTMIRANDA));
mi.pszService = "Help/AboutCommand";
mi.pszName = LPGEN("&About");
- //AddGroupMenuItem(0,(LPARAM)&mi);
+ //AddGroupMenuItem(0, (LPARAM)&mi);
- memset(&mi,0,sizeof(mi));
+ memset(&mi, 0, sizeof(mi));
mi.cbSize = sizeof(mi);
mi.position = 100000;
- mi.hIcon = ImageList_GetIcon(hCListImages,NewGroupIconidx,0);
+ mi.hIcon = ImageList_GetIcon(hCListImages, NewGroupIconidx, 0);
mi.pszService = MS_CLIST_GROUPCREATE;
- mi.pszName = LPGEN("&New Group");
- hNewGroupMenuItem = (HGENMENU)AddGroupMenuItem(0,(LPARAM)&mi);
+ mi.pszName = LPGEN("&New group");
+ hNewGroupMenuItem = (HGENMENU)AddGroupMenuItem(0, (LPARAM)&mi);
- memset(&mi,0,sizeof(mi));
+ 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 = (HGENMENU)AddGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
+ mi.pszName = LPGEN("&Hide offline users");
+ gmp.lParam = 0;
+ gmp.wParam = -1;
+ hHideOfflineUsersMenuItem = (HGENMENU)AddGroupMenuItem((WPARAM)&gmp, (LPARAM)&mi);
- memset(&mi,0,sizeof(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 = (HGENMENU)AddGroupMenuItem(0,(LPARAM)&mi);
+ mi.pszName = LPGEN("Hide &offline users out here");
+ hHideOfflineUsersOutHereMenuItem = (HGENMENU)AddGroupMenuItem(0, (LPARAM)&mi);
- memset(&mi,0,sizeof(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 = (HGENMENU)AddGroupMenuItem(0,(LPARAM)&mi);
+ mi.pszName = LPGEN("Hide &empty groups");
+ hHideEmptyGroupsMenuItem = (HGENMENU)AddGroupMenuItem(0, (LPARAM)&mi);
- memset(&mi,0,sizeof(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 = (HGENMENU)AddGroupMenuItem(0,(LPARAM)&mi);
+ mi.pszName = LPGEN("Disable &groups");
+ hDisableGroupsMenuItem = (HGENMENU)AddGroupMenuItem(0, (LPARAM)&mi);
- HookEvent(ME_SKIN2_ICONSCHANGED,OnIconLibIconChanged);
+ HookEvent(ME_SKIN2_ICONSCHANGED, OnIconLibIconChanged);
}
}
@@ -376,9 +372,9 @@ HGENMENU hHideOfflineUsersHereMenuItem;
//SubGroupmenu exec param(ownerdata)
typedef struct{
-char *szServiceName;
-int Param1,Param2;
-}SubGroupMenuExecParam,*lpSubGroupMenuExecParam;
+ char *szServiceName;
+ int Param1, Param2;
+} SubGroupMenuExecParam, *lpSubGroupMenuExecParam;
/*
wparam = handle to the menu item returned by MS_CLIST_ADDCONTACTMENUITEM
@@ -386,7 +382,7 @@ return 0 on success.
*/
static INT_PTR RemoveSubGroupMenuItem(WPARAM wParam, LPARAM lParam)
{
- CallService(MO_REMOVEMENUITEM,wParam,0);
+ CallService(MO_REMOVEMENUITEM, wParam, 0);
return 0;
}
@@ -397,7 +393,7 @@ static int OnBuildSubGroupMenu(WPARAM wParam, LPARAM lParam)
//contact->group
CLISTMENUITEM mi = { sizeof(mi) };
- mi.flags = CMIM_FLAGS | (group->hideOffline?CMIF_CHECKED:0);
+ mi.flags = CMIM_FLAGS | (group->hideOffline ? CMIF_CHECKED : 0);
Menu_ModifyItem(hHideOfflineUsersHereMenuItem, &mi);
return 0;
}
@@ -415,30 +411,30 @@ static INT_PTR BuildSubGroupMenu(WPARAM wParam, LPARAM lParam)
//hMenu = wParam;
tick = GetTickCount();
- NotifyEventHooks(hPreBuildSubGroupMenuEvent,wParam,0);
+ NotifyEventHooks(hPreBuildSubGroupMenuEvent, wParam, 0);
- CallService(MO_BUILDMENU,(WPARAM)hMenu,(LPARAM)&param);
+ CallService(MO_BUILDMENU, (WPARAM)hMenu, (LPARAM)&param);
//DrawMenuBar((HWND)CallService("CLUI/GetHwnd",0,0));
- tick = GetTickCount()-tick;
+ tick = GetTickCount() - tick;
return (INT_PTR)hMenu;
}
static INT_PTR AddSubGroupMenuItem(WPARAM wParam, LPARAM lParam)
{
TMO_MenuItem tmi;
- CLISTMENUITEM *mi = (CLISTMENUITEM*)lParam;
- if ( !pcli->pfnConvertMenu(mi, &tmi))
+ CLISTMENUITEM *mi = (CLISTMENUITEM *)lParam;
+ if (!pcli->pfnConvertMenu(mi, &tmi))
return 0;
lpSubGroupMenuExecParam mmep = (lpSubGroupMenuExecParam)mir_calloc(sizeof(SubGroupMenuExecParam));
- if ( mmep == NULL)
+ if (mmep == NULL)
return 0;
//we need just one parametr.
mmep->szServiceName = mir_strdup(mi->pszService);
mmep->Param1 = mi->popupPosition;
lpGroupMenuParam gmp = (lpGroupMenuParam)wParam;
- if ( gmp != NULL ) {
+ if (gmp != NULL ) {
mmep->Param1 = gmp->wParam;
mmep->Param2 = gmp->lParam;
}
@@ -448,10 +444,10 @@ 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);
+ CallService(MO_SETOPTIONSMENUITEM, 0, (LPARAM)&op);
return (INT_PTR)op.Handle;
}
@@ -462,7 +458,7 @@ INT_PTR SubGroupMenuCheckService(WPARAM wParam, LPARAM lParam)
INT_PTR SubGroupMenuonAddService(WPARAM wParam, LPARAM lParam)
{
- MENUITEMINFO *mii = (MENUITEMINFO* )wParam;
+ MENUITEMINFO *mii = (MENUITEMINFO *)wParam;
if (mii == NULL)
return 0;
@@ -476,18 +472,19 @@ INT_PTR SubGroupMenuExecService(WPARAM wParam, LPARAM lParam)
{
if (wParam != 0) {
lpSubGroupMenuExecParam mmep = (lpSubGroupMenuExecParam)wParam;
- if ( !strcmp(mmep->szServiceName,"Help/AboutCommand")) {
+ if (!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 FreeOwnerDataSubGroupMenu (WPARAM wParam, LPARAM lParam)
+INT_PTR FreeOwnerDataSubGroupMenu(WPARAM wParam, LPARAM lParam)
{
lpSubGroupMenuExecParam mmep = (lpSubGroupMenuExecParam)lParam;
if (mmep != NULL) {
@@ -500,22 +497,22 @@ INT_PTR FreeOwnerDataSubGroupMenu (WPARAM wParam, LPARAM lParam)
//wparam menu handle to pass to clc.c
INT_PTR GroupMenuExecProxy(WPARAM wParam, LPARAM lParam)
{
- SendMessage(pcli->hwndContactTree,WM_COMMAND,wParam,0);
+ SendMessage(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/GroupMenuExecProxy",GroupMenuExecProxy);
-
- CreateServiceFunction("CList/AddSubGroupMenuItem",AddSubGroupMenuItem);
- CreateServiceFunction(MS_CLIST_REMOVESUBGROUPMENUITEM,RemoveSubGroupMenuItem);
- CreateServiceFunction(MS_CLIST_MENUBUILDSUBGROUP,BuildSubGroupMenu);
+ CreateServiceFunction("CLISTMENUSSubGroup/ExecService", SubGroupMenuExecService);
+ CreateServiceFunction("CLISTMENUSSubGroup/FreeOwnerDataSubGroupMenu", FreeOwnerDataSubGroupMenu);
+ CreateServiceFunction("CLISTMENUSSubGroup/SubGroupMenuonAddService", SubGroupMenuonAddService);
+ CreateServiceFunction("CLISTMENUSSubGroup/GroupMenuExecProxy", GroupMenuExecProxy);
+
+ CreateServiceFunction("CList/AddSubGroupMenuItem", AddSubGroupMenuItem);
+ CreateServiceFunction(MS_CLIST_REMOVESUBGROUPMENUITEM, RemoveSubGroupMenuItem);
+ CreateServiceFunction(MS_CLIST_MENUBUILDSUBGROUP, BuildSubGroupMenu);
hPreBuildSubGroupMenuEvent = CreateHookableEvent(ME_CLIST_PREBUILDSUBGROUPMENU);
- HookEvent(ME_CLIST_PREBUILDSUBGROUPMENU,OnBuildSubGroupMenu);
+ HookEvent(ME_CLIST_PREBUILDSUBGROUPMENU, OnBuildSubGroupMenu);
//SubGroup menu
hSubGroupMenuObject = MO_CreateMenuObject("SubGroupMenu", LPGEN("Subgroup menu"), 0, "CLISTMENUSSubGroup/ExecService");
@@ -528,38 +525,42 @@ void InitSubGroupMenus(void)
CLISTMENUITEM mi = { sizeof(mi) };
mi.position = 1000;
- mi.hIcon = ImageList_GetIcon(hCListImages,NewGroupIconidx,0);
+ mi.hIcon = ImageList_GetIcon(hCListImages, NewGroupIconidx, 0);
mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy";
- mi.pszName = LPGEN("&New SubGroup");
- gmp.lParam = 0;gmp.wParam = POPUP_NEWSUBGROUP;
- hNewSubGroupMenuItem = (HGENMENU)AddSubGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
+ mi.pszName = LPGEN("&New subgroup");
+ gmp.lParam = 0;
+ gmp.wParam = POPUP_NEWSUBGROUP;
+ hNewSubGroupMenuItem = (HGENMENU)AddSubGroupMenuItem((WPARAM)&gmp, (LPARAM)&mi);
- memset(&mi,0,sizeof(mi));
+ memset(&mi, 0, sizeof(mi));
mi.cbSize = sizeof(mi);
mi.position = 1001;
mi.hIcon = NULL;
mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy";
- mi.pszName = LPGEN("&Hide Offline Users in here");
- gmp.lParam = 0;gmp.wParam = POPUP_GROUPHIDEOFFLINE;
- hHideOfflineUsersHereMenuItem = (HGENMENU)AddSubGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
+ mi.pszName = LPGEN("&Hide offline users in here");
+ gmp.lParam = 0;
+ gmp.wParam = POPUP_GROUPHIDEOFFLINE;
+ hHideOfflineUsersHereMenuItem = (HGENMENU)AddSubGroupMenuItem((WPARAM)&gmp, (LPARAM)&mi);
- memset(&mi,0,sizeof(mi));
+ memset(&mi, 0, sizeof(mi));
mi.cbSize = sizeof(mi);
mi.position = 900001;
mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_RENAME); //LoadIcon(GetModuleHandle(NULL),MAKEINTRESOURCE(IDI_RENAME));
mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy";
- mi.pszName = LPGEN("&Rename Group");
- gmp.lParam = 0;gmp.wParam = POPUP_RENAMEGROUP;
- AddSubGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
+ mi.pszName = LPGEN("&Rename group");
+ gmp.lParam = 0;
+ gmp.wParam = POPUP_RENAMEGROUP;
+ AddSubGroupMenuItem((WPARAM)&gmp, (LPARAM)&mi);
- memset(&mi,0,sizeof(mi));
+ memset(&mi, 0, sizeof(mi));
mi.cbSize = sizeof(mi);
mi.position = 900002;
mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_DELETE); //LoadIcon(GetModuleHandle(NULL),MAKEINTRESOURCE(IDI_DELETE));
mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy";
- mi.pszName = LPGEN("&Delete Group");
- gmp.lParam = 0;gmp.wParam = POPUP_DELETEGROUP;
- AddSubGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
+ mi.pszName = LPGEN("&Delete group");
+ gmp.lParam = 0;
+ gmp.wParam = POPUP_DELETEGROUP;
+ AddSubGroupMenuItem((WPARAM)&gmp, (LPARAM)&mi);
}
//////////////////////////////END SubGroup MENU/////////////////////////