summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-06-25 12:23:28 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-06-25 12:23:28 +0000
commitadca17ccaecda72c8dd1234f1a7b91a0d5aff564 (patch)
treef0eaacc2570951ed615afd310f7f7ab144b612a9 /plugins/Clist_modern/src
parent12d7476bd6e91fd3020a83b9249b63bafe68cd1d (diff)
another portion of dead genmenu services
git-svn-id: http://svn.miranda-ng.org/main/trunk@14377 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_modern/src')
-rw-r--r--plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp50
-rw-r--r--plugins/Clist_modern/src/CLUIFrames/framesmenu.cpp14
-rw-r--r--plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp20
-rw-r--r--plugins/Clist_modern/src/modern_clc.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_clistmenus.cpp5
-rw-r--r--plugins/Clist_modern/src/modern_clisttray.cpp15
6 files changed, 42 insertions, 64 deletions
diff --git a/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp b/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp
index f087d307b9..7f8f7269e1 100644
--- a/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp
+++ b/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp
@@ -1544,7 +1544,7 @@ static int CLUIFramesLoadMainMenu()
return -1;
if (_hmiRoot != HGENMENU_ROOT) {
- CallService(MO_REMOVEMENUITEM, (WPARAM)_hmiRoot, 0);
+ Menu_RemoveItem(_hmiRoot);
_hmiRoot = HGENMENU_ROOT;
}
@@ -3493,29 +3493,29 @@ int CLUIFrameOnModulesUnload(WPARAM, LPARAM)
if (!_hmiVisible)
return 0;
- CallService(MO_REMOVEMENUITEM, (LPARAM)_hmiVisible, 0);
- CallService(MO_REMOVEMENUITEM, (LPARAM)_hmiTBVisible, 0);
- CallService(MO_REMOVEMENUITEM, (LPARAM)_hmiLock, 0);
- CallService(MO_REMOVEMENUITEM, (LPARAM)_hmiColl, 0);
- CallService(MO_REMOVEMENUITEM, (LPARAM)_hmiFloating, 0);
- CallService(MO_REMOVEMENUITEM, (LPARAM)_hmiAlignTop, 0);
- CallService(MO_REMOVEMENUITEM, (LPARAM)_hmiAlignClient, 0);
- CallService(MO_REMOVEMENUITEM, (LPARAM)_hmiAlignBottom, 0);
- CallService(MO_REMOVEMENUITEM, (LPARAM)_hmiBorder, 0);
- CallService(MO_REMOVEMENUITEM, (LPARAM)_hmiAlignRoot, 0);
-
- CallService(MO_REMOVEMENUITEM, (LPARAM)_hmiPosUp, 0);
- CallService(MO_REMOVEMENUITEM, (LPARAM)_hmiPosDown, 0);
- CallService(MO_REMOVEMENUITEM, (LPARAM)_hmiPosRoot, 0);
-
- CallService(MO_REMOVEMENUITEM, (LPARAM)_hmiVisible, 0);
- CallService(MO_REMOVEMENUITEM, (LPARAM)_hmiTBVisible, 0);
- CallService(MO_REMOVEMENUITEM, (LPARAM)_hmiLock, 0);
- CallService(MO_REMOVEMENUITEM, (LPARAM)_hmiColl, 0);
- CallService(MO_REMOVEMENUITEM, (LPARAM)_hmiFloating, 0);
- CallService(MO_REMOVEMENUITEM, (LPARAM)_hmiBorder, 0);
- CallService(MO_REMOVEMENUITEM, (LPARAM)_hmiAlignRoot, 0);
- CallService(MO_REMOVEMENUITEM, (LPARAM)_hmiPosRoot, 0);
+ Menu_RemoveItem(_hmiVisible);
+ Menu_RemoveItem(_hmiTBVisible);
+ Menu_RemoveItem(_hmiLock);
+ Menu_RemoveItem(_hmiColl);
+ Menu_RemoveItem(_hmiFloating);
+ Menu_RemoveItem(_hmiAlignTop);
+ Menu_RemoveItem(_hmiAlignClient);
+ Menu_RemoveItem(_hmiAlignBottom);
+ Menu_RemoveItem(_hmiBorder);
+ Menu_RemoveItem(_hmiAlignRoot);
+
+ Menu_RemoveItem(_hmiPosUp);
+ Menu_RemoveItem(_hmiPosDown);
+ Menu_RemoveItem(_hmiPosRoot);
+
+ Menu_RemoveItem(_hmiVisible);
+ Menu_RemoveItem(_hmiTBVisible);
+ Menu_RemoveItem(_hmiLock);
+ Menu_RemoveItem(_hmiColl);
+ Menu_RemoveItem(_hmiFloating);
+ Menu_RemoveItem(_hmiBorder);
+ Menu_RemoveItem(_hmiAlignRoot);
+ Menu_RemoveItem(_hmiPosRoot);
_hmiVisible = 0;
_AniAva_OnModulesUnload();
@@ -3576,7 +3576,7 @@ static INT_PTR UnloadMainMenu()
{
CLUIFrameOnModulesUnload(0, 0);
if (_hmiRoot != HGENMENU_ROOT) {
- CallService(MO_REMOVEMENUITEM, (WPARAM)_hmiRoot, 0);
+ Menu_RemoveItem(_hmiRoot);
_hmiRoot = HGENMENU_ROOT;
}
diff --git a/plugins/Clist_modern/src/CLUIFrames/framesmenu.cpp b/plugins/Clist_modern/src/CLUIFrames/framesmenu.cpp
index a8d4a70d58..35e6b95a7f 100644
--- a/plugins/Clist_modern/src/CLUIFrames/framesmenu.cpp
+++ b/plugins/Clist_modern/src/CLUIFrames/framesmenu.cpp
@@ -41,8 +41,7 @@ static INT_PTR AddContextFrameMenuItem(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 (INT_PTR)Menu_AddItem(hFrameMenuObject, &tmi);
}
//called with:
@@ -61,7 +60,7 @@ INT_PTR FrameMenuExecService(WPARAM wParam, LPARAM lParam)
//true - ok,false ignore
INT_PTR FrameMenuCheckService(WPARAM wParam, LPARAM)
{
- PCheckProcParam pcpp = (PCheckProcParam)wParam;
+ TCheckProcParam *pcpp = (TCheckProcParam*)wParam;
if (pcpp == NULL)
return FALSE;
@@ -85,14 +84,9 @@ static INT_PTR ContextFrameMenuNotify(WPARAM wParam, LPARAM lParam)
static INT_PTR BuildContextFrameMenu(WPARAM wParam, LPARAM lParam)
{
- ListParam param = { 0 };
- param.MenuObjectHandle = hFrameMenuObject;
- param.wParam = wParam;
- param.lParam = lParam;
-
HMENU hMenu = CreatePopupMenu();
ContextFrameMenuNotify(wParam, -1);
- CallService(MO_BUILDMENU, (WPARAM)hMenu, (LPARAM)&param);
+ Menu_Build(hMenu, hFrameMenuObject, wParam, lParam);
return (INT_PTR)hMenu;
}
@@ -110,7 +104,7 @@ int InitFramesMenus(void)
hPreBuildFrameMenuEvent = CreateHookableEvent(ME_CLIST_PREBUILDFRAMEMENU);
// frame menu object
- hFrameMenuObject = MO_CreateMenuObject("FrameMenu", LPGEN("Frame menu"), "FrameMenuCheckService", "FrameMenuExecService");
+ hFrameMenuObject = Menu_AddObject("FrameMenu", LPGEN("Frame menu"), "FrameMenuCheckService", "FrameMenuExecService");
Menu_ConfigureObject(hFrameMenuObject, MCO_OPT_FREE_SERVICE, "FrameMenuFreeService");
return 0;
}
diff --git a/plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp b/plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp
index 188639ecf0..eedeba5e7d 100644
--- a/plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp
+++ b/plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp
@@ -56,10 +56,7 @@ INT_PTR BuildGroupMenu(WPARAM, LPARAM)
NotifyEventHooks(g_CluiData.hEventPreBuildGroupMenu, 0, 0);
HMENU hMenu = CreatePopupMenu();
-
- ListParam param = { 0 };
- param.MenuObjectHandle = hGroupMenuObject;
- CallService(MO_BUILDMENU, (WPARAM)hMenu, (LPARAM)&param);
+ Menu_Build(hMenu, hGroupMenuObject);
return (INT_PTR)hMenu;
}
@@ -84,7 +81,7 @@ static INT_PTR AddGroupMenuItem(WPARAM wParam, LPARAM lParam)
}
tmi.ownerdata = mmep;
- HGENMENU hNewItem = (HGENMENU)CallService(MO_ADDNEWMENUITEM, (WPARAM)hGroupMenuObject, (LPARAM)&tmi);
+ HGENMENU hNewItem = Menu_AddItem(hGroupMenuObject, &tmi);
char buf[1024];
mir_snprintf(buf, "%s/%s", mi->pszService, mi->pszName);
@@ -224,7 +221,7 @@ void GroupMenus_Init(void)
InitSubGroupMenus();
// Group menu
- hGroupMenuObject = MO_CreateMenuObject("GroupMenu", LPGEN("Group menu"), 0, "CLISTMENUSGroup/ExecService");
+ hGroupMenuObject = Menu_AddObject("GroupMenu", LPGEN("Group menu"), 0, "CLISTMENUSGroup/ExecService");
Menu_ConfigureObject(hGroupMenuObject, MCO_OPT_USERDEFINEDITEMS, TRUE);
Menu_ConfigureObject(hGroupMenuObject, MCO_OPT_FREE_SERVICE, "CLISTMENUSGroup/FreeOwnerDataGroupMenu");
Menu_ConfigureObject(hGroupMenuObject, MCO_OPT_ONADD_SERVICE, "CLISTMENUSGroup/GroupMenuonAddService");
@@ -355,13 +352,8 @@ INT_PTR BuildSubGroupMenu(WPARAM wParam, LPARAM lParam)
{
NotifyEventHooks(g_CluiData.hEventPreBuildSubGroupMenu, wParam, 0);
- ListParam param = { 0 };
- param.MenuObjectHandle = hSubGroupMenuObject;
- param.wParam = wParam;
- param.lParam = lParam;
-
HMENU hMenu = CreatePopupMenu();
- CallService(MO_BUILDMENU, (WPARAM)hMenu, (LPARAM)&param);
+ Menu_Build(hMenu, hSubGroupMenuObject, wParam, lParam);
return (INT_PTR)hMenu;
}
@@ -391,7 +383,7 @@ static INT_PTR AddSubGroupMenuItem(WPARAM wParam, LPARAM lParam)
}
tmi.ownerdata = mmep;
- HGENMENU hNewItem = (HGENMENU)CallService(MO_ADDNEWMENUITEM, (WPARAM)hSubGroupMenuObject, (LPARAM)&tmi);
+ HGENMENU hNewItem = Menu_AddItem(hSubGroupMenuObject, &tmi);
char buf[1024];
mir_snprintf(buf, "%s/%s", mi->pszService, mi->pszName);
@@ -469,7 +461,7 @@ void InitSubGroupMenus(void)
HookEvent(ME_CLIST_PREBUILDSUBGROUPMENU, OnBuildSubGroupMenu);
// SubGroup menu
- hSubGroupMenuObject = MO_CreateMenuObject("SubGroupMenu", LPGEN("Subgroup menu"), 0, "CLISTMENUSSubGroup/ExecService");
+ hSubGroupMenuObject = Menu_AddObject("SubGroupMenu", LPGEN("Subgroup menu"), 0, "CLISTMENUSSubGroup/ExecService");
Menu_ConfigureObject(hSubGroupMenuObject, MCO_OPT_USERDEFINEDITEMS, TRUE);
Menu_ConfigureObject(hSubGroupMenuObject, MCO_OPT_FREE_SERVICE, "CLISTMENUSSubGroup/FreeOwnerDataSubGroupMenu");
Menu_ConfigureObject(hSubGroupMenuObject, MCO_OPT_ONADD_SERVICE, "CLISTMENUSSubGroup/SubGroupMenuonAddService");
diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp
index 3618cf2d9b..5ee7d52875 100644
--- a/plugins/Clist_modern/src/modern_clc.cpp
+++ b/plugins/Clist_modern/src/modern_clc.cpp
@@ -374,7 +374,7 @@ static LRESULT clcOnCommand(ClcData *dat, HWND hwnd, UINT, WPARAM wParam, LPARAM
}
if (contact->type == CLCIT_GROUP)
- if (CallService(MO_PROCESSCOMMANDBYMENUIDENT, LOWORD(wParam), (LPARAM)hwnd))
+ if (Menu_ProcessCommandById(wParam, (LPARAM)hwnd))
return 0;
return 0;
diff --git a/plugins/Clist_modern/src/modern_clistmenus.cpp b/plugins/Clist_modern/src/modern_clistmenus.cpp
index 22bc5e14ab..77de5d473f 100644
--- a/plugins/Clist_modern/src/modern_clistmenus.cpp
+++ b/plugins/Clist_modern/src/modern_clistmenus.cpp
@@ -189,9 +189,6 @@ int UnloadFavoriteContactMenu()
free(hFavoriteContactMenuItems);
hFavoriteContactMenuItems = NULL;
- if (hFavoriteContactMenu)
- CallService(MO_REMOVEMENUITEM, (WPARAM)hFavoriteContactMenu, 0);
- hFavoriteContactMenu = NULL;
-
+ Menu_RemoveItem(hFavoriteContactMenu); hFavoriteContactMenu = NULL;
return 0;
}
diff --git a/plugins/Clist_modern/src/modern_clisttray.cpp b/plugins/Clist_modern/src/modern_clisttray.cpp
index 7854a6abfa..93ad8f1b2a 100644
--- a/plugins/Clist_modern/src/modern_clisttray.cpp
+++ b/plugins/Clist_modern/src/modern_clisttray.cpp
@@ -163,11 +163,8 @@ static INT_PTR BuildTrayMenu(WPARAM, LPARAM)
{
NotifyEventHooks(g_CluiData.hEventPreBuildTrayMenu, 0, 0);
- ListParam param = { 0 };
- param.MenuObjectHandle = hTrayMenuObject;
-
HMENU hMenu = CreatePopupMenu();
- CallService(MO_BUILDMENU, (WPARAM)hMenu, (LPARAM)&param);
+ Menu_Build(hMenu, hTrayMenuObject);
return (INT_PTR)hMenu;
}
@@ -181,7 +178,7 @@ static INT_PTR AddTrayMenuItem(WPARAM, LPARAM lParam)
tmi.ownerdata = mir_strdup(mi->pszService);
- HGENMENU hNewItem = (HGENMENU)CallService(MO_ADDNEWMENUITEM, (WPARAM)hTrayMenuObject, (LPARAM)&tmi);
+ HGENMENU hNewItem = Menu_AddItem(hTrayMenuObject, &tmi);
Menu_ConfigureItem(hNewItem, MCI_OPT_UNIQUENAME, mi->pszService);
return (INT_PTR)hNewItem;
}
@@ -311,7 +308,7 @@ void InitTrayMenus(void)
CreateServiceFunction(MS_CLIST_MENUBUILDTRAY, BuildTrayMenu);
// Tray menu
- hTrayMenuObject = MO_CreateMenuObject("TrayMenu", LPGEN("Tray menu"), 0, "CLISTMENUSTRAY/ExecService");
+ hTrayMenuObject = Menu_AddObject("TrayMenu", LPGEN("Tray menu"), 0, "CLISTMENUSTRAY/ExecService");
Menu_ConfigureObject(hTrayMenuObject, MCO_OPT_USERDEFINEDITEMS, TRUE);
Menu_ConfigureObject(hTrayMenuObject, MCO_OPT_FREE_SERVICE, "CLISTMENUSTRAY/FreeOwnerDataTrayMenu");
Menu_ConfigureObject(hTrayMenuObject, MCO_OPT_ONADD_SERVICE, "CLISTMENUSTRAY/TrayMenuonAddService");
@@ -366,10 +363,8 @@ void InitTrayMenus(void)
void UninitTrayMenu()
{
- if (hTrayMenuObject) {
- CallService(MO_REMOVEMENUOBJECT, (WPARAM)hTrayMenuObject, 0);
- hTrayMenuObject = NULL;
- }
+ Menu_RemoveObject(hTrayMenuObject);
+ hTrayMenuObject = NULL;
}
VOID CALLBACK cliTrayCycleTimerProc(HWND, UINT, UINT_PTR, DWORD)