diff options
Diffstat (limited to 'plugins/Clist_modern')
7 files changed, 24 insertions, 145 deletions
diff --git a/plugins/Clist_modern/clist_modern_10.vcxproj b/plugins/Clist_modern/clist_modern_10.vcxproj index f0bab6adda..cf99c372d8 100644 --- a/plugins/Clist_modern/clist_modern_10.vcxproj +++ b/plugins/Clist_modern/clist_modern_10.vcxproj @@ -194,9 +194,6 @@ <ClCompile Include="src\CLUIFrames\cluiframes.cpp">
<PrecompiledHeaderFile>../hdr/modern_commonheaders.h</PrecompiledHeaderFile>
</ClCompile>
- <ClCompile Include="src\CLUIFrames\framesmenu.cpp">
- <PrecompiledHeaderFile>../hdr/modern_commonheaders.h</PrecompiledHeaderFile>
- </ClCompile>
<ClCompile Include="src\CLUIFrames\groupmenu.cpp">
<PrecompiledHeaderFile>../hdr/modern_commonheaders.h</PrecompiledHeaderFile>
</ClCompile>
diff --git a/plugins/Clist_modern/clist_modern_10.vcxproj.filters b/plugins/Clist_modern/clist_modern_10.vcxproj.filters index e6e68ac8f9..7c1674cd34 100644 --- a/plugins/Clist_modern/clist_modern_10.vcxproj.filters +++ b/plugins/Clist_modern/clist_modern_10.vcxproj.filters @@ -153,9 +153,6 @@ <ClCompile Include="src\CLUIFrames\cluiframes.cpp">
<Filter>Source Files\CLUIFrames</Filter>
</ClCompile>
- <ClCompile Include="src\CLUIFrames\framesmenu.cpp">
- <Filter>Source Files\CLUIFrames</Filter>
- </ClCompile>
<ClCompile Include="src\CLUIFrames\groupmenu.cpp">
<Filter>Source Files\CLUIFrames</Filter>
</ClCompile>
diff --git a/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp b/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp index 06cb843063..8f364c467f 100644 --- a/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp +++ b/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp @@ -758,7 +758,7 @@ static HMENU CLUIFramesCreateMenuForFrame(int frameid, HGENMENU root, int popupp CLISTMENUITEM mi = { 0 };
mi.hParentMenu = root;
- mi.popupPosition = frameid;
+ // mi.popupPosition = frameid; !!!!!!!!!!!!!!!!!!!!!!!!!!
mi.position = popuppos++;
mi.pszName = LPGEN("&Visible");
mi.flags = CMIF_ROOTHANDLE | CMIF_CHECKED;
@@ -3526,8 +3526,6 @@ int LoadCLUIFramesModule(void) g_nFramesCount = 0;
- InitFramesMenus();
-
HookEvent(ME_SYSTEM_MODULESLOADED, CLUIFrameOnModulesLoad);
HookEvent(ME_CLIST_PREBUILDFRAMEMENU, CLUIFramesModifyContextMenuForFrame);
HookEvent(ME_CLIST_PREBUILDMAINMENU, CLUIFrameOnMainMenuBuild);
diff --git a/plugins/Clist_modern/src/CLUIFrames/framesmenu.cpp b/plugins/Clist_modern/src/CLUIFrames/framesmenu.cpp deleted file mode 100644 index fc512f7ea9..0000000000 --- a/plugins/Clist_modern/src/CLUIFrames/framesmenu.cpp +++ /dev/null @@ -1,110 +0,0 @@ -#include "../hdr/modern_commonheaders.h"
-#include "../hdr/modern_commonprototypes.h"
-
-//========================== Frames
-HANDLE hFrameMenuObject;
-static HANDLE hPreBuildFrameMenuEvent;
-
-//contactmenu exec param(ownerdata)
-//also used in checkservice
-typedef struct{
- char *szServiceName;
- int Frameid;
- INT_PTR param1;
-}FrameMenuExecParam, *lpFrameMenuExecParam;
-
-INT_PTR FreeOwnerDataFrameMenu(WPARAM, LPARAM lParam)
-{
- lpFrameMenuExecParam cmep = (lpFrameMenuExecParam)lParam;
- if (cmep != NULL){
- mir_free(cmep->szServiceName);
- mir_free(cmep);
- }
- return 0;
-}
-
-static INT_PTR AddContextFrameMenuItem(WPARAM, LPARAM lParam)
-{
- CLISTMENUITEM *mi = (CLISTMENUITEM*)lParam;
-
- TMO_MenuItem tmi;
- if (!pcli->pfnConvertMenu(mi, &tmi))
- return NULL;
-
- tmi.root = (mi->flags & CMIF_ROOTHANDLE) ? mi->hParentMenu : NULL;
-
- lpFrameMenuExecParam fmep = (lpFrameMenuExecParam)mir_alloc(sizeof(FrameMenuExecParam));
- if (fmep == NULL)
- return 0;
-
- fmep->szServiceName = mir_strdup(mi->pszService);
- fmep->Frameid = mi->popupPosition;
- fmep->param1 = (INT_PTR)mi->pszContactOwner;
- tmi.ownerdata = fmep;
- return (INT_PTR)Menu_AddItem(hFrameMenuObject, &tmi);
-}
-
-//called with:
-//wparam - ownerdata
-//lparam - lparam from winproc
-INT_PTR FrameMenuExecService(WPARAM wParam, LPARAM lParam)
-{
- lpFrameMenuExecParam fmep = (lpFrameMenuExecParam)wParam;
- if (fmep == NULL)
- return -1;
-
- CallService(fmep->szServiceName, lParam, fmep->param1);
- return 0;
-}
-
-//true - ok,false ignore
-INT_PTR FrameMenuCheckService(WPARAM wParam, LPARAM)
-{
- TCheckProcParam *pcpp = (TCheckProcParam*)wParam;
- if (pcpp == NULL)
- return FALSE;
-
- TMO_MenuItem mi;
- if (Menu_GetItemInfo(pcpp->MenuItemHandle, 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;
-}
-
-static INT_PTR ContextFrameMenuNotify(WPARAM wParam, LPARAM lParam)
-{
- NotifyEventHooks(hPreBuildFrameMenuEvent, wParam, lParam);
- return 0;
-}
-
-static INT_PTR BuildContextFrameMenu(WPARAM wParam, LPARAM lParam)
-{
- HMENU hMenu = CreatePopupMenu();
- ContextFrameMenuNotify(wParam, -1);
- Menu_Build(hMenu, hFrameMenuObject, wParam, lParam);
- return (INT_PTR)hMenu;
-}
-
-//========================== Frames end
-
-int InitFramesMenus(void)
-{
- CreateServiceFunction("FrameMenuExecService", FrameMenuExecService);
- CreateServiceFunction("FrameMenuCheckService", FrameMenuCheckService);
- CreateServiceFunction("FrameMenuFreeService", FreeOwnerDataFrameMenu);
-
- CreateServiceFunction("CList/AddContextFrameMenuItem", AddContextFrameMenuItem);
- CreateServiceFunction(MS_CLIST_MENUBUILDFRAMECONTEXT, BuildContextFrameMenu);
- CreateServiceFunction(MS_CLIST_FRAMEMENUNOTIFY, ContextFrameMenuNotify);
- hPreBuildFrameMenuEvent = CreateHookableEvent(ME_CLIST_PREBUILDFRAMEMENU);
-
- // frame menu object
- 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 b9f6f06870..b901fa7678 100644 --- a/plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp +++ b/plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp @@ -62,8 +62,8 @@ INT_PTR BuildGroupMenu(WPARAM, LPARAM) static INT_PTR AddGroupMenuItem(WPARAM wParam, LPARAM lParam)
{
- CLISTMENUITEM *mi = (CLISTMENUITEM*)lParam;
TMO_MenuItem tmi;
+ CLISTMENUITEM *mi = (CLISTMENUITEM *)lParam;
if (!pcli->pfnConvertMenu(mi, &tmi))
return NULL;
@@ -73,7 +73,7 @@ static INT_PTR AddGroupMenuItem(WPARAM wParam, LPARAM lParam) //we need just one parametr.
mmep->szServiceName = mir_strdup(mi->pszService);
- mmep->Param1 = mi->popupPosition;
+ mmep->Param1 = 0; // mi->popupPosition; !!!!!!!!!!!!!!!!!!
lpGroupMenuParam gmp = (lpGroupMenuParam)wParam;
if (gmp != NULL) {
mmep->Param1 = gmp->wParam;
@@ -89,12 +89,6 @@ static INT_PTR AddGroupMenuItem(WPARAM wParam, LPARAM lParam) return (INT_PTR)hNewItem;
}
-int GroupMenuCheckService(WPARAM, LPARAM)
-{
- //not used
- return 0;
-};
-
INT_PTR GroupMenuonAddService(WPARAM wParam, LPARAM lParam)
{
MENUITEMINFO *mii = (MENUITEMINFO*)wParam;
@@ -149,7 +143,7 @@ INT_PTR FreeOwnerDataGroupMenu(WPARAM, LPARAM lParam) INT_PTR HideGroupsHelper(WPARAM, LPARAM)
{
- int newVal = !(GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE)&CLS_HIDEEMPTYGROUPS);
+ 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;
@@ -157,17 +151,15 @@ INT_PTR HideGroupsHelper(WPARAM, LPARAM) INT_PTR UseGroupsHelper(WPARAM, LPARAM)
{
- int newVal = !(GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE)&CLS_USEGROUPS);
+ int newVal = !(GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) & CLS_USEGROUPS);
db_set_b(NULL, "CList", "UseGroups", (BYTE)newVal);
- SendMessage(pcli->hwndContactTree, CLM_SETUSEGROUPS, newVal, 0);
+ SendMessage(pcli->hwndContactTree, CLM_SETUSEGROUPS, newVal,0);
return 0;
}
INT_PTR HideOfflineRootHelper(WPARAM, LPARAM)
{
- SendMessage(
- pcli->hwndContactTree,
- CLM_SETHIDEOFFLINEROOT,
+ SendMessage(pcli->hwndContactTree, CLM_SETHIDEOFFLINEROOT,
!SendMessage(pcli->hwndContactTree, CLM_GETHIDEOFFLINEROOT, 0, 0),
0);
return 0;
@@ -199,12 +191,18 @@ static int OnBuildGroupMenu(WPARAM, LPARAM) return 0;
}
-static IconItemT iconItem = { LPGENT("New group"), "NewGroup", IDI_NEWGROUP2 };
+static IconItemT iconItem[] =
+{
+ { LPGENT("New group"), "NewGroup", IDI_NEWGROUP2 }
+};
void GroupMenus_Init(void)
{
- Icon_RegisterT(g_hInst, LPGENT("Contact list"), &iconItem, 1);
+ Icon_RegisterT(g_hInst, LPGENT("Contact list"), iconItem, _countof(iconItem));
+}
+void InitGroupMenus(void)
+{
CreateServiceFunction("CLISTMENUSGroup/ExecService", GroupMenuExecService);
CreateServiceFunction("CLISTMENUSGroup/FreeOwnerDataGroupMenu", FreeOwnerDataGroupMenu);
CreateServiceFunction("CLISTMENUSGroup/GroupMenuonAddService", GroupMenuonAddService);
@@ -226,7 +224,7 @@ void GroupMenus_Init(void) Menu_ConfigureObject(hGroupMenuObject, MCO_OPT_FREE_SERVICE, "CLISTMENUSGroup/FreeOwnerDataGroupMenu");
Menu_ConfigureObject(hGroupMenuObject, MCO_OPT_ONADD_SERVICE, "CLISTMENUSGroup/GroupMenuonAddService");
- //add exit command to menu
+ // add exit command to menu
GroupMenuParam gmp;
CLISTMENUITEM mi = { 0 };
@@ -250,13 +248,13 @@ void GroupMenus_Init(void) mi.position = 300000;
mi.pszService = "";
- mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_MAINMENU); // eternity #004
+ mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_MAINMENU);
mi.pszName = LPGEN("&Main menu");
hGroupMainMenuItemProxy = (HGENMENU)AddGroupMenuItem(0, (LPARAM)&mi);
mi.position = 300100;
mi.pszService = "";
- mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_STATUS); // eternity #004
+ mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_STATUS);
mi.pszName = LPGEN("&Status");
hGroupStatusMenuItemProxy = (HGENMENU)AddGroupMenuItem(0, (LPARAM)&mi);
@@ -274,10 +272,10 @@ void GroupMenus_Init(void) mi.flags = 0;
mi.position = 100000;
- mi.icolibItem = iconItem.hIcolib;
+ mi.icolibItem = iconItem[0].hIcolib;
mi.pszService = "CLISTMENUSGroup/CreateGroupHelper";
mi.pszName = LPGEN("&New group");
- hNewGroupMenuItem = (HGENMENU)AddGroupMenuItem(0, (LPARAM)&mi);
+ hNewGroupMenuItem = (HGENMENU)AddGroupMenuItem((WPARAM)&gmp, (LPARAM)&mi);
DestroyIcon_protect(mi.hIcon);
mi.position = 100001;
@@ -375,7 +373,7 @@ static INT_PTR AddSubGroupMenuItem(WPARAM wParam, LPARAM lParam) //we need just one parametr.
mmep->szServiceName = mir_strdup(mi->pszService);
- mmep->Param1 = mi->popupPosition;
+ mmep->Param1 = 0; // mi->popupPosition; !!!!!!!!!!!!!!!!!!
lpGroupMenuParam gmp = (lpGroupMenuParam)wParam;
if (gmp != NULL) {
mmep->Param1 = gmp->wParam;
@@ -472,7 +470,7 @@ void InitSubGroupMenus(void) CLISTMENUITEM mi = { 0 };
mi.position = 1000;
- mi.icolibItem = iconItem.hIcolib;
+ mi.icolibItem = iconItem[0].hIcolib;
mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy";
mi.pszName = LPGEN("&New subgroup");
gmp.lParam = 0;
diff --git a/plugins/Clist_modern/src/hdr/modern_commonprototypes.h b/plugins/Clist_modern/src/hdr/modern_commonprototypes.h index d67cacb842..7ea8b2d8dc 100644 --- a/plugins/Clist_modern/src/hdr/modern_commonprototypes.h +++ b/plugins/Clist_modern/src/hdr/modern_commonprototypes.h @@ -201,7 +201,6 @@ int GetContactIconC(ClcCacheEntry *cacheEntry); // int GetContactIndex(ClcGroup *group, ClcContact *contact); //clcidents.c
int GetStatusForContact(MCONTACT hContact, char *szProto); //clistsettings.c
int InitCustomMenus(void); //clistmenus.c
-int InitFramesMenus(void); //framesmenus.c
int LoadMoveToGroup(); //movetogroup.c
int LoadStatusBarData(); //modern_statusbar.c
int MenuModulesLoaded(WPARAM wParam, LPARAM lParam); //clistmenu.c
diff --git a/plugins/Clist_modern/src/modern_clistmenus.cpp b/plugins/Clist_modern/src/modern_clistmenus.cpp index 77de5d473f..fb18a985cd 100644 --- a/plugins/Clist_modern/src/modern_clistmenus.cpp +++ b/plugins/Clist_modern/src/modern_clistmenus.cpp @@ -138,8 +138,8 @@ static int FAV_OnContactMenuBuild(WPARAM hContact, LPARAM) mi.icolibItem = iconList[i].hIcolib;
mi.ptszName = rates[i];
mi.pszService = CLUI_FAVSETRATE;
- mi.popupPosition = i;
hFavoriteContactMenuItems[i] = Menu_AddContactMenuItem(&mi);
+ Menu_ConfigureItem(hFavoriteContactMenuItems[i], MCI_OPT_EXECPARAM, i);
}
}
@@ -149,10 +149,10 @@ static int FAV_OnContactMenuBuild(WPARAM hContact, LPARAM) Menu_ModifyItem(hShowIfOflineItem, NULL, INVALID_HANDLE_VALUE, mi.flags);
else {
mi.pszService = CLUI_FAVTOGGLESHOWOFFLINE;
- mi.popupPosition = i + 100000000;
mi.position = -100000000;
mi.ptszName = LPGENT("Show even if offline");
hShowIfOflineItem = Menu_AddContactMenuItem(&mi);
+ Menu_ConfigureItem(hShowIfOflineItem, MCI_OPT_EXECPARAM, i + 100000000);
}
return 0;
|