summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-06-28 17:41:48 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-06-28 17:41:48 +0000
commit59cd198e89782263777c57dcd54704ecb1e10212 (patch)
tree9515cc2c31c1254c330e79906bb669279af9b8a5 /plugins/Clist_modern
parentca2afc50a432cefe892c6877710642bce6bd57c9 (diff)
finally CLISTEVENT removed completely
git-svn-id: http://svn.miranda-ng.org/main/trunk@14430 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_modern')
-rw-r--r--plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp22
-rw-r--r--plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp72
-rw-r--r--plugins/Clist_modern/src/modern_clistmenus.cpp10
-rw-r--r--plugins/Clist_modern/src/modern_clisttray.cpp29
-rw-r--r--plugins/Clist_modern/src/modern_clui.cpp6
5 files changed, 63 insertions, 76 deletions
diff --git a/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp b/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp
index 24cf7b4f08..00c1caa893 100644
--- a/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp
+++ b/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp
@@ -751,7 +751,7 @@ static int CLUIFramesGetalClientFrame(void)
/////////////////////////////////////////////////////////////////////////////////////////
-static HGENMENU addFrameMenuItem(CLISTMENUITEM *pmi, int frameid, bool bMain)
+static HGENMENU addFrameMenuItem(TMO_MenuItem *pmi, int frameid, bool bMain)
{
HGENMENU res = (bMain) ? Menu_AddMainMenuItem(pmi) : Menu_AddContextFrameMenuItem(pmi);
if (pmi->pszService != NULL)
@@ -767,8 +767,8 @@ static HMENU CLUIFramesCreateMenuForFrame(int frameid, HGENMENU root, int popupp
int framepos = id2pos(frameid);
FrameMenuHandles &fmh = (frameid == -1) ? cont : g_pfwFrames[framepos].MenuHandles;
- CLISTMENUITEM mi = { 0 };
- mi.hParentMenu = root;
+ TMO_MenuItem mi = { 0 };
+ mi.root = root;
mi.position = popuppos++;
mi.name.a = LPGEN("&Visible");
mi.flags = CMIF_CHECKED;
@@ -815,7 +815,7 @@ static HMENU CLUIFramesCreateMenuForFrame(int frameid, HGENMENU root, int popupp
fmh.MIAlignRoot = addFrameMenuItem(&mi, frameid, bMain);
// align top
- mi.hParentMenu = fmh.MIAlignRoot;
+ mi.root = fmh.MIAlignRoot;
mi.position = popuppos++;
mi.name.a = LPGEN("&Top");
mi.pszService = CLUIFRAMESSETALIGNALTOP;
@@ -834,11 +834,11 @@ static HMENU CLUIFramesCreateMenuForFrame(int frameid, HGENMENU root, int popupp
fmh.MIAlignBottom = addFrameMenuItem(&mi, frameid, bMain);
// position root
- mi.hParentMenu = root;
+ mi.root = root;
mi.position = popuppos++;
mi.name.a = LPGEN("&Position");
mi.pszService = NULL;
- mi.hParentMenu = addFrameMenuItem(&mi, frameid, bMain);
+ mi.root = addFrameMenuItem(&mi, frameid, bMain);
mi.position = popuppos++;
mi.name.a = LPGEN("&Up");
@@ -1487,17 +1487,17 @@ static int CLUIFramesLoadMainMenu()
}
// create root menu
- CLISTMENUITEM mi = { 0 };
- mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_FRAME);
+ TMO_MenuItem mi = { 0 };
+ mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_FRAME);
mi.position = 3000090000;
mi.name.a = LPGEN("Frames");
cont.MainMenuItem = Menu_AddMainMenuItem(&mi);
// create frames menu
- mi.hParentMenu = cont.MainMenuItem;
+ mi.root = cont.MainMenuItem;
int separator = 3000200000;
for (int i = 0; i < g_nFramesCount; i++) {
- mi.icolibItem = g_pfwFrames[i].TitleBar.hicon;
+ mi.hIcolibItem = g_pfwFrames[i].TitleBar.hicon;
mi.flags = CMIF_TCHAR;
mi.position = separator++;
mi.name.t = g_pfwFrames[i].TitleBar.tbname ? g_pfwFrames[i].TitleBar.tbname : g_pfwFrames[i].name;
@@ -1511,7 +1511,7 @@ static int CLUIFramesLoadMainMenu()
separator += 100000;
// create "show all frames" menu
- mi.icolibItem = NULL;
+ mi.hIcolibItem = NULL;
mi.flags = 0;
mi.position = separator++;
mi.name.a = LPGEN("Show all frames");
diff --git a/plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp b/plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp
index 1af388347a..163d920fcd 100644
--- a/plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp
+++ b/plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp
@@ -62,29 +62,26 @@ INT_PTR BuildGroupMenu(WPARAM, LPARAM)
static INT_PTR AddGroupMenuItem(WPARAM wParam, LPARAM lParam)
{
- TMO_MenuItem tmi;
- CLISTMENUITEM *mi = (CLISTMENUITEM *)lParam;
- if (!pcli->pfnConvertMenu(mi, &tmi))
- return NULL;
-
lpGroupMenuExecParam mmep = (lpGroupMenuExecParam)mir_calloc(sizeof(GroupMenuExecParam));
if (mmep == NULL)
return 0;
- //we need just one parametr.
- mmep->szServiceName = mir_strdup(mi->pszService);
+ TMO_MenuItem *pmi = (TMO_MenuItem*)lParam;
+
+ // we need just one parametr.
+ mmep->szServiceName = mir_strdup(pmi->pszService);
mmep->Param1 = 0; // mi->popupPosition; !!!!!!!!!!!!!!!!!!
lpGroupMenuParam gmp = (lpGroupMenuParam)wParam;
if (gmp != NULL) {
mmep->Param1 = gmp->wParam;
mmep->Param2 = gmp->lParam;
}
- tmi.ownerdata = mmep;
+ pmi->ownerdata = mmep;
- HGENMENU hNewItem = Menu_AddItem(hGroupMenuObject, &tmi);
+ HGENMENU hNewItem = Menu_AddItem(hGroupMenuObject, pmi);
char buf[1024];
- mir_snprintf(buf, "%s/%s", mi->pszService, mi->name.a);
+ mir_snprintf(buf, "%s/%s", pmi->pszService, pmi->name.a);
Menu_ConfigureItem(hNewItem, MCI_OPT_UNIQUENAME, buf);
return (INT_PTR)hNewItem;
}
@@ -225,45 +222,45 @@ void InitGroupMenus(void)
Menu_ConfigureObject(hGroupMenuObject, MCO_OPT_ONADD_SERVICE, "CLISTMENUSGroup/GroupMenuonAddService");
// add exit command to menu
- CLISTMENUITEM mi = { 0 };
+ TMO_MenuItem mi = { 0 };
mi.position = 1900000;
mi.pszService = "CloseAction";
- mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_EXIT);
+ mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_EXIT);
mi.name.a = LPGEN("E&xit");
AddGroupMenuItem(0, (LPARAM)&mi);
mi.position = 500;
mi.pszService = MS_CLIST_SHOWHIDE;
- mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_SHOWHIDE);
+ mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_SHOWHIDE);
mi.name.a = LPGEN("&Hide/show");
hHideShowMainMenuItem = (HGENMENU)AddGroupMenuItem(0, (LPARAM)&mi);
mi.position = 200000;
- mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_FINDUSER);
+ mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_FINDUSER);
mi.pszService = "FindAdd/FindAddCommand";
mi.name.a = LPGEN("&Find/add contacts...");
AddGroupMenuItem(0, (LPARAM)&mi);
mi.position = 300000;
mi.pszService = "";
- mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_MAINMENU);
+ mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_MAINMENU);
mi.name.a = LPGEN("&Main menu");
hGroupMainMenuItemProxy = (HGENMENU)AddGroupMenuItem(0, (LPARAM)&mi);
mi.position = 300100;
mi.pszService = "";
- mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_STATUS);
+ mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_STATUS);
mi.name.a = LPGEN("&Status");
hGroupStatusMenuItemProxy = (HGENMENU)AddGroupMenuItem(0, (LPARAM)&mi);
mi.position = 400000;
- mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_OPTIONS);
+ mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_OPTIONS);
mi.pszService = "Options/OptionsCommand";
mi.name.a = LPGEN("&Options...");
AddGroupMenuItem(0, (LPARAM)&mi);
mi.position = 500000;
- mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_MIRANDA);
+ mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_MIRANDA);
mi.pszService = "Help/AboutCommand";
mi.name.a = LPGEN("&About");
AddGroupMenuItem(0, (LPARAM)&mi);
@@ -271,15 +268,15 @@ void InitGroupMenus(void)
GroupMenuParam gmp = {};
mi.flags = 0;
mi.position = 100000;
- mi.icolibItem = iconItem[0].hIcolib;
+ mi.hIcolibItem = iconItem[0].hIcolib;
mi.pszService = "CLISTMENUSGroup/CreateGroupHelper";
mi.name.a = LPGEN("&New group");
hNewGroupMenuItem = (HGENMENU)AddGroupMenuItem((WPARAM)&gmp, (LPARAM)&mi);
- DestroyIcon_protect((HICON)mi.icolibItem);
+ DestroyIcon_protect((HICON)mi.hIcolibItem);
mi.position = 100001;
- mi.icolibItem = NULL;
- mi.icolibItem = NULL;
+ mi.hIcolibItem = NULL;
+ mi.hIcolibItem = NULL;
mi.pszService = MS_CLIST_SETHIDEOFFLINE;
mi.name.a = LPGEN("&Hide offline users");
gmp.lParam = 0; gmp.wParam = -1;
@@ -362,29 +359,24 @@ HMENU cliBuildGroupPopupMenu(ClcGroup *group)
static INT_PTR AddSubGroupMenuItem(WPARAM wParam, LPARAM lParam)
{
- TMO_MenuItem tmi;
- CLISTMENUITEM *mi = (CLISTMENUITEM*)lParam;
- if (!pcli->pfnConvertMenu(mi, &tmi))
- return NULL;
-
lpSubGroupMenuExecParam mmep = (lpSubGroupMenuExecParam)mir_calloc(sizeof(SubGroupMenuExecParam));
if (mmep == NULL)
return 0;
- //we need just one parametr.
- mmep->szServiceName = mir_strdup(mi->pszService);
- mmep->Param1 = 0; // mi->popupPosition; !!!!!!!!!!!!!!!!!!
+ TMO_MenuItem *pmi = (TMO_MenuItem*)lParam;
+ // we need just one parametr.
+ mmep->szServiceName = mir_strdup(pmi->pszService);
lpGroupMenuParam gmp = (lpGroupMenuParam)wParam;
if (gmp != NULL) {
mmep->Param1 = gmp->wParam;
mmep->Param2 = gmp->lParam;
}
- tmi.ownerdata = mmep;
+ pmi->ownerdata = mmep;
- HGENMENU hNewItem = Menu_AddItem(hSubGroupMenuObject, &tmi);
+ HGENMENU hNewItem = Menu_AddItem(hSubGroupMenuObject, pmi);
char buf[1024];
- mir_snprintf(buf, "%s/%s", mi->pszService, mi->name.a);
+ mir_snprintf(buf, "%s/%s", pmi->pszService, pmi->name.a);
Menu_ConfigureItem(hNewItem, MCI_OPT_UNIQUENAME, buf);
return (INT_PTR)hNewItem;
}
@@ -468,9 +460,9 @@ void InitSubGroupMenus(void)
// add exit command to menu
GroupMenuParam gmp;
- CLISTMENUITEM mi = { 0 };
+ TMO_MenuItem mi = { 0 };
mi.position = 1000;
- mi.icolibItem = iconItem[0].hIcolib;
+ mi.hIcolibItem = iconItem[0].hIcolib;
mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy";
mi.name.a = LPGEN("&New subgroup");
gmp.lParam = 0;
@@ -478,8 +470,8 @@ void InitSubGroupMenus(void)
hNewSubGroupMenuItem = (HGENMENU)AddSubGroupMenuItem((WPARAM)&gmp, (LPARAM)&mi);
mi.position = 1001;
- mi.icolibItem = NULL;
- mi.icolibItem = NULL;
+ mi.hIcolibItem = NULL;
+ mi.hIcolibItem = NULL;
mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy";
mi.name.a = LPGEN("&Hide offline users in here");
gmp.lParam = 0;
@@ -487,7 +479,7 @@ void InitSubGroupMenus(void)
hHideOfflineUsersHereMenuItem = (HGENMENU)AddSubGroupMenuItem((WPARAM)&gmp, (LPARAM)&mi);
mi.position = 1002;
- mi.icolibItem = NULL;
+ mi.hIcolibItem = NULL;
mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy";
mi.name.a = LPGEN("&Show offline users in here");
gmp.lParam = 0;
@@ -496,7 +488,7 @@ void InitSubGroupMenus(void)
memset(&mi, 0, sizeof(mi));
mi.position = 900001;
- mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_RENAME);
+ mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_RENAME);
mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy";
mi.name.a = LPGEN("&Rename group");
gmp.lParam = 0;
@@ -504,7 +496,7 @@ void InitSubGroupMenus(void)
AddSubGroupMenuItem((WPARAM)&gmp, (LPARAM)&mi);
mi.position = 900002;
- mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_DELETE);
+ mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_DELETE);
mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy";
mi.name.a = LPGEN("&Delete group");
gmp.lParam = 0;
diff --git a/plugins/Clist_modern/src/modern_clistmenus.cpp b/plugins/Clist_modern/src/modern_clistmenus.cpp
index b31af23f27..90850f414b 100644
--- a/plugins/Clist_modern/src/modern_clistmenus.cpp
+++ b/plugins/Clist_modern/src/modern_clistmenus.cpp
@@ -99,8 +99,8 @@ static int FAV_OnContactMenuBuild(WPARAM hContact, LPARAM)
BOOL bModifyMenu = FALSE;
- CLISTMENUITEM mi = { 0 };
- mi.icolibItem = iconList[bContactRate].hIcolib;
+ TMO_MenuItem mi = { 0 };
+ mi.hIcolibItem = iconList[bContactRate].hIcolib;
mi.flags = CMIF_TCHAR;
if (!bContactRate)
mi.name.t = FAVMENUROOTNAME;
@@ -121,7 +121,7 @@ static int FAV_OnContactMenuBuild(WPARAM hContact, LPARAM)
Menu_ConfigureItem(hFavoriteContactMenu, MCI_OPT_UNIQUENAME, "ModernClistMenu_ContactRate");
- mi.hParentMenu = hFavoriteContactMenu;
+ mi.root = hFavoriteContactMenu;
if (!hFavoriteContactMenuItems) {
hFavoriteContactMenuItems = (HGENMENU *)malloc(sizeof(HANDLE) * _countof(rates));
memset(hFavoriteContactMenuItems, 0, sizeof(HANDLE) * _countof(rates));
@@ -133,7 +133,7 @@ static int FAV_OnContactMenuBuild(WPARAM hContact, LPARAM)
if (bModifyMenu && hFavoriteContactMenuItems[i])
Menu_ModifyItem(hFavoriteContactMenuItems[i], NULL, iconList[i].hIcolib, mi.flags);
else {
- mi.icolibItem = iconList[i].hIcolib;
+ mi.hIcolibItem = iconList[i].hIcolib;
mi.name.t = rates[i];
mi.pszService = CLUI_FAVSETRATE;
hFavoriteContactMenuItems[i] = Menu_AddContactMenuItem(&mi);
@@ -141,7 +141,7 @@ static int FAV_OnContactMenuBuild(WPARAM hContact, LPARAM)
}
}
- mi.icolibItem = NULL;
+ mi.hIcolibItem = NULL;
mi.flags = CMIF_TCHAR | (db_get_b(hContact, "CList", "noOffline", 0) ? CMIF_CHECKED : 0);
if (bModifyMenu && hShowIfOflineItem)
Menu_ModifyItem(hShowIfOflineItem, NULL, INVALID_HANDLE_VALUE, mi.flags);
diff --git a/plugins/Clist_modern/src/modern_clisttray.cpp b/plugins/Clist_modern/src/modern_clisttray.cpp
index 5dfb00c715..f66e4c2456 100644
--- a/plugins/Clist_modern/src/modern_clisttray.cpp
+++ b/plugins/Clist_modern/src/modern_clisttray.cpp
@@ -170,16 +170,11 @@ static INT_PTR BuildTrayMenu(WPARAM, LPARAM)
static INT_PTR AddTrayMenuItem(WPARAM, LPARAM lParam)
{
- CLISTMENUITEM *mi = (CLISTMENUITEM*)lParam;
+ TMO_MenuItem *pmi = (TMO_MenuItem*)lParam;
+ pmi->ownerdata = mir_strdup(pmi->pszService);
- TMO_MenuItem tmi;
- if (!pcli->pfnConvertMenu(mi, &tmi))
- return NULL;
-
- tmi.ownerdata = mir_strdup(mi->pszService);
-
- HGENMENU hNewItem = Menu_AddItem(hTrayMenuObject, &tmi);
- Menu_ConfigureItem(hNewItem, MCI_OPT_UNIQUENAME, mi->pszService);
+ HGENMENU hNewItem = Menu_AddItem(hTrayMenuObject, pmi);
+ Menu_ConfigureItem(hNewItem, MCI_OPT_UNIQUENAME, pmi->pszService);
return (INT_PTR)hNewItem;
}
@@ -314,45 +309,45 @@ void InitTrayMenus(void)
Menu_ConfigureObject(hTrayMenuObject, MCO_OPT_ONADD_SERVICE, "CLISTMENUSTRAY/TrayMenuonAddService");
// add exit command to menu
- CLISTMENUITEM mi = { 0 };
+ TMO_MenuItem mi = { 0 };
mi.position = 900000;
mi.pszService = "CloseAction";
mi.name.a = LPGEN("E&xit");
- mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_EXIT);
+ mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_EXIT);
Menu_AddTrayMenuItem(&mi);
mi.position = 100000;
mi.pszService = MS_CLIST_SHOWHIDE;
mi.name.a = LPGEN("&Hide/show");
- mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_SHOWHIDE);
+ mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_SHOWHIDE);
hTrayHideShowMainMenuItem = Menu_AddTrayMenuItem(&mi);
mi.position = 200000;
- mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_FINDUSER);
+ mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_FINDUSER);
mi.pszService = "FindAdd/FindAddCommand";
mi.name.a = LPGEN("&Find/add contacts...");
Menu_AddTrayMenuItem(&mi);
mi.position = 300000;
- mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_MAINMENU); // eternity #004
+ mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_MAINMENU); // eternity #004
mi.pszService = "FakeService_1";
mi.name.a = LPGEN("&Main menu");
hTrayMainMenuItemProxy = Menu_AddTrayMenuItem(&mi);
mi.position = 300100;
mi.pszService = "FakeService_2";
- mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_STATUS); // eternity #004
+ mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_STATUS); // eternity #004
mi.name.a = LPGEN("&Status");
hTrayStatusMenuItemProxy = Menu_AddTrayMenuItem(&mi);
mi.position = 400000;
- mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_OPTIONS);
+ mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_OPTIONS);
mi.pszService = "Options/OptionsCommand";
mi.name.a = LPGEN("&Options...");
Menu_AddTrayMenuItem(&mi);
mi.position = 500000;
- mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_MIRANDA);
+ mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_MIRANDA);
mi.pszService = "Help/AboutCommand";
mi.name.a = LPGEN("&About");
Menu_AddTrayMenuItem(&mi);
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp
index d4851203ce..0c02b4fb12 100644
--- a/plugins/Clist_modern/src/modern_clui.cpp
+++ b/plugins/Clist_modern/src/modern_clui.cpp
@@ -335,17 +335,17 @@ HRESULT CLUI::RegisterAvatarMenu()
{
Icon_RegisterT(g_hInst, LPGENT("Contact list"), iconItem, _countof(iconItem));
- CLISTMENUITEM mi = { 0 };
+ TMO_MenuItem mi = { 0 };
CreateServiceFunction("CList/ShowContactAvatar", CLUI::Service_Menu_ShowContactAvatar);
mi.position = 2000150000;
- mi.icolibItem = iconItem[0].hIcolib;
+ mi.hIcolibItem = iconItem[0].hIcolib;
mi.name.a = LPGEN("Show contact &avatar");
mi.pszService = "CList/ShowContactAvatar";
hShowAvatarMenuItem = Menu_AddContactMenuItem(&mi);
CreateServiceFunction("CList/HideContactAvatar", CLUI::Service_Menu_HideContactAvatar);
mi.position = 2000150001;
- mi.icolibItem = iconItem[1].hIcolib;
+ mi.hIcolibItem = iconItem[1].hIcolib;
mi.name.a = LPGEN("Hide contact &avatar");
mi.pszService = "CList/HideContactAvatar";
hHideAvatarMenuItem = Menu_AddContactMenuItem(&mi);