summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-06-14 17:17:39 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-06-14 17:17:39 +0000
commit37e1f0cb88e2344c288064b7d88963ba7ea26955 (patch)
tree5841101832e4c2a95a571c46ea6281c4018d09bf /plugins
parentd5d023f683b23fe26ddea93738cb721d532804f0 (diff)
- clists' menus compatibility issues;
- code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@412 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Chat/clist.c2
-rw-r--r--plugins/Clist_nicer/CLUIFrames/framesmenu.cpp35
-rw-r--r--plugins/Clist_nicer/CLUIFrames/groupmenu.cpp149
-rw-r--r--plugins/Modernb/modern_clisttray.cpp38
-rw-r--r--plugins/Modernb/modern_framesmenu.cpp44
-rw-r--r--plugins/Modernb/modern_groupmenu.cpp120
-rw-r--r--plugins/Mwclist/CLUIFrames/framesmenu.cpp36
-rw-r--r--plugins/Mwclist/clisttray.cpp38
-rw-r--r--plugins/Mwclist/groupmenu.cpp102
-rw-r--r--plugins/SRMM/msgs.c2
-rw-r--r--plugins/Scriver/chat/clist.c2
-rw-r--r--plugins/Scriver/msgs.c2
-rw-r--r--plugins/TabSRMM/chat/clist.cpp2
-rw-r--r--plugins/TabSRMM/src/mim.cpp2
14 files changed, 197 insertions, 377 deletions
diff --git a/plugins/Chat/clist.c b/plugins/Chat/clist.c
index 7c09dfe3e9..87d544097e 100644
--- a/plugins/Chat/clist.c
+++ b/plugins/Chat/clist.c
@@ -208,7 +208,7 @@ int CList_PrebuildContactMenu(WPARAM wParam, LPARAM lParam)
char* szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
CLISTMENUITEM clmi = {0};
- clmi.cbSize = sizeof( CLISTMENUITEM );
+ clmi.cbSize = sizeof(CLISTMENUITEM);
clmi.flags = CMIM_FLAGS | CMIF_DEFAULT | CMIF_HIDDEN;
if ( szProto ) {
diff --git a/plugins/Clist_nicer/CLUIFrames/framesmenu.cpp b/plugins/Clist_nicer/CLUIFrames/framesmenu.cpp
index 1d5b0dd850..07b6ebc4e6 100644
--- a/plugins/Clist_nicer/CLUIFrames/framesmenu.cpp
+++ b/plugins/Clist_nicer/CLUIFrames/framesmenu.cpp
@@ -44,34 +44,23 @@ INT_PTR FreeOwnerDataFrameMenu (WPARAM wParam,LPARAM lParam)
static INT_PTR AddContextFrameMenuItem(WPARAM wParam,LPARAM lParam)
{
- CLISTMENUITEM *mi=(CLISTMENUITEM*)lParam;
TMO_MenuItem tmi;
+ CLISTMENUITEM *mi = (CLISTMENUITEM*)lParam;
+ if ( !pcli->pfnConvertMenu(mi, &tmi))
+ return NULL;
- if(mi->cbSize!=sizeof(CLISTMENUITEM)) return 0;
-
- memset(&tmi,0,sizeof(tmi));
+ tmi.root = (mi->flags & CMIF_ROOTHANDLE) ? mi->hParentMenu : NULL;
- tmi.cbSize=sizeof(tmi);
- tmi.flags=mi->flags;
- tmi.hIcon=mi->hIcon;
- tmi.hotKey=mi->hotKey;
- tmi.position=mi->position;
- tmi.pszName=mi->pszName;
+ lpFrameMenuExecParam fmep = (lpFrameMenuExecParam)mir_alloc(sizeof(FrameMenuExecParam));
+ if (fmep == NULL)
+ return 0;
- if ( mi->flags & CMIF_ROOTHANDLE )
- tmi.root = mi->hParentMenu;
- {
- lpFrameMenuExecParam fmep;
- 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;
- }
+ fmep->szServiceName = mir_strdup(mi->pszService);
+ fmep->Frameid = mi->popupPosition;
+ fmep->param1 = (INT_PTR)mi->pszContactOwner;
+ tmi.ownerdata = fmep;
- return(CallService(MO_ADDNEWMENUITEM,(WPARAM)hFrameMenuObject,(LPARAM)&tmi));
+ return CallService(MO_ADDNEWMENUITEM,(WPARAM)hFrameMenuObject,(LPARAM)&tmi);
}
static INT_PTR RemoveContextFrameMenuItem(WPARAM wParam,LPARAM lParam)
diff --git a/plugins/Clist_nicer/CLUIFrames/groupmenu.cpp b/plugins/Clist_nicer/CLUIFrames/groupmenu.cpp
index 52bdb33c01..0fba19dd92 100644
--- a/plugins/Clist_nicer/CLUIFrames/groupmenu.cpp
+++ b/plugins/Clist_nicer/CLUIFrames/groupmenu.cpp
@@ -87,63 +87,40 @@ static INT_PTR BuildGroupMenu(WPARAM wParam,LPARAM lParam)
static INT_PTR AddGroupMenuItem(WPARAM wParam,LPARAM lParam)
{
- CLISTMENUITEM *mi=(CLISTMENUITEM*)lParam;
- lpGroupMenuParam gmp=(lpGroupMenuParam)wParam;
- char buf[1024];
-
TMO_MenuItem tmi;
- OptParam op;
-
- if (mi->cbSize!=sizeof(CLISTMENUITEM)) return 0;
-
- memset(&tmi,0,sizeof(tmi));
- tmi.cbSize=sizeof(tmi);
- tmi.flags=mi->flags;
- tmi.hIcon=mi->hIcon;
- tmi.hotKey=mi->hotKey;
- tmi.pszName=mi->pszName;
- tmi.position=mi->position;
-
- //pszPopupName for new system mean root level
- //pszPopupName for old system mean that exists popup
- tmi.root = mi->hParentMenu;
+ CLISTMENUITEM *mi = (CLISTMENUITEM*)lParam;
+ if ( !pcli->pfnConvertMenu(mi, &tmi))
+ return NULL;
- tmi.ownerdata=NULL;
+ lpGroupMenuExecParam mmep = (lpGroupMenuExecParam)mir_alloc(sizeof(GroupMenuExecParam));
+ if (mmep == NULL)
+ return 0;
- {
- lpGroupMenuExecParam mmep;
- mmep=(lpGroupMenuExecParam)mir_alloc(sizeof(GroupMenuExecParam));
- if (mmep==NULL) {
- return(0);
- };
-
- //we need just one parametr.
- mmep->szServiceName=mir_strdup(mi->pszService);
- mmep->Param1=mi->popupPosition;
- if (gmp!=NULL) {
- mmep->Param1=gmp->wParam;
- mmep->Param2=gmp->lParam;
-
- }
+ //we need just one parametr.
+ mmep->szServiceName = mir_strdup(mi->pszService);
+ mmep->Param1 = mi->popupPosition;
+ lpGroupMenuParam gmp=(lpGroupMenuParam)wParam;
+ if (gmp != NULL) {
+ mmep->Param1 = gmp->wParam;
+ mmep->Param2 = gmp->lParam;
+ }
+ tmi.ownerdata=mmep;
+ char buf[1024];
+ sprintf(buf,"%s/%s",mi->pszService,mi->pszName);
- tmi.ownerdata=mmep;
- }
+ OptParam op;
op.Handle=(HANDLE)CallService(MO_ADDNEWMENUITEM,(WPARAM)hGroupMenuObject,(LPARAM)&tmi);
op.Setting=OPT_MENUITEMSETUNIQNAME;
- sprintf(buf,"%s/%s",mi->pszService,mi->pszName);
op.Value=(INT_PTR)buf;
CallService(MO_SETOPTIONSMENUITEM,(WPARAM)0,(LPARAM)&op);
return (INT_PTR)op.Handle;
-
- // mainItemCount++;
- // return MENU_CUSTOMITEMMAIN|(mainMenuItem[mainItemCount-1].id);
}
-INT_PTR GroupMenuCheckService(WPARAM wParam,LPARAM lParam) {
- //not used
- return(0);
-};
+INT_PTR GroupMenuCheckService(WPARAM wParam,LPARAM lParam)
+{
+ return 0;
+}
INT_PTR GroupMenuonAddService(WPARAM wParam,LPARAM lParam) {
@@ -502,88 +479,64 @@ static INT_PTR RemoveSubGroupMenuItem(WPARAM wParam,LPARAM lParam)
static int OnBuildSubGroupMenu(WPARAM wParam,LPARAM lParam)
{
- CLISTMENUITEM mi;
- struct ClcGroup *group=(struct ClcGroup *)wParam;
- if (wParam==0) return 0;
-
+ ClcGroup *group=(struct ClcGroup *)wParam;
+ if (group == 0)
+ return 0;
//contact->group
- ZeroMemory(&mi,sizeof(mi));
+ CLISTMENUITEM mi = { 0 };
mi.cbSize = sizeof(mi);
mi.flags = CMIM_FLAGS | (group->hideOffline?CMIF_CHECKED:0);
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hHideOfflineUsersHereMenuItem, (LPARAM)&mi);
return 0;
-};
+}
+
static INT_PTR BuildSubGroupMenu(WPARAM wParam,LPARAM lParam)
{
- int tick;
- HMENU hMenu;
ListParam param = { 0 };
- param.MenuObjectHandle=hSubGroupMenuObject;
- param.wParam=wParam;
+ param.MenuObjectHandle = hSubGroupMenuObject;
+ param.wParam = wParam;
- //hMenu=hMainMenu;
- hMenu=CreatePopupMenu();
- //hMenu=wParam;
- tick=GetTickCount();
+ HMENU hMenu = CreatePopupMenu();
+ int tick = GetTickCount();
NotifyEventHooks(hPreBuildSubGroupMenuEvent,wParam,0);
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)
{
- CLISTMENUITEM *mi=(CLISTMENUITEM*)lParam;
- lpGroupMenuParam gmp=(lpGroupMenuParam)wParam;
- char buf[1024];
TMO_MenuItem tmi;
- OptParam op;
-
- if (mi->cbSize!=sizeof(CLISTMENUITEM)) return 0;
- memset(&tmi,0,sizeof(tmi));
- tmi.cbSize=sizeof(tmi);
- tmi.flags=mi->flags;
- tmi.hIcon=mi->hIcon;
- tmi.hotKey=mi->hotKey;
- tmi.pszName=mi->pszName;
- tmi.position=mi->position;
+ CLISTMENUITEM *mi = (CLISTMENUITEM*)lParam;
+ if ( !pcli->pfnConvertMenu(mi, &tmi))
+ return NULL;
- //pszPopupName for new system mean root level
- //pszPopupName for old system mean that exists popup
- tmi.root = mi->hParentMenu;
+ lpSubGroupMenuExecParam mmep = (lpSubGroupMenuExecParam)mir_alloc(sizeof(SubGroupMenuExecParam));
+ if (mmep == NULL)
+ return 0;
- tmi.ownerdata=NULL;
-
- {
- lpSubGroupMenuExecParam mmep;
- mmep=(lpSubGroupMenuExecParam)mir_alloc(sizeof(SubGroupMenuExecParam));
- if (mmep==NULL)
- return(0);
-
- //we need just one parametr.
- mmep->szServiceName=mir_strdup(mi->pszService);
- mmep->Param1=mi->popupPosition;
- if (gmp!=NULL) {
- mmep->Param1=gmp->wParam;
- mmep->Param2=gmp->lParam;
- }
-
- tmi.ownerdata=mmep;
+ //we need just one parametr.
+ lpGroupMenuParam gmp=(lpGroupMenuParam)wParam;
+ mmep->szServiceName = mir_strdup(mi->pszService);
+ mmep->Param1 = mi->popupPosition;
+ if (gmp != NULL) {
+ mmep->Param1 = gmp->wParam;
+ mmep->Param2 = gmp->lParam;
}
+ tmi.ownerdata = mmep;
+ char buf[1024];
+ sprintf(buf,"%s/%s",mi->pszService,mi->pszName);
+
+ OptParam op;
op.Handle=(HANDLE)CallService(MO_ADDNEWMENUITEM,(WPARAM)hSubGroupMenuObject,(LPARAM)&tmi);
op.Setting=OPT_MENUITEMSETUNIQNAME;
- sprintf(buf,"%s/%s",mi->pszService,mi->pszName);
op.Value=(INT_PTR)buf;
CallService(MO_SETOPTIONSMENUITEM,(WPARAM)0,(LPARAM)&op);
return (INT_PTR)op.Handle;
-
- // mainItemCount++;
- // return MENU_CUSTOMITEMMAIN|(mainMenuItem[mainItemCount-1].id);
}
INT_PTR SubGroupMenuCheckService(WPARAM wParam,LPARAM lParam) {
diff --git a/plugins/Modernb/modern_clisttray.cpp b/plugins/Modernb/modern_clisttray.cpp
index 521785066d..15c26506c8 100644
--- a/plugins/Modernb/modern_clisttray.cpp
+++ b/plugins/Modernb/modern_clisttray.cpp
@@ -520,37 +520,21 @@ static INT_PTR BuildTrayMenu(WPARAM wParam,LPARAM lParam)
static INT_PTR AddTrayMenuItem(WPARAM wParam,LPARAM lParam)
{
- CLISTMENUITEM *mi=(CLISTMENUITEM*)lParam;
TMO_MenuItem tmi;
- OptParam op;
-
- if(mi->cbSize!=sizeof(CLISTMENUITEM)) return 0;
-
- memset(&tmi,0,sizeof(tmi));
- tmi.cbSize=sizeof(tmi);
- tmi.flags=mi->flags;
- tmi.hIcon=mi->hIcon;
- tmi.hotKey=mi->hotKey;
- tmi.pszName=mi->pszName;
- tmi.position=mi->position;
-
- //pszPopupName for new system mean root level
- //pszPopupName for old system mean that exists popup
- tmi.root = mi->hParentMenu;
+ CLISTMENUITEM *mi = (CLISTMENUITEM*)lParam;
+ if ( !pcli->pfnConvertMenu(mi, &tmi))
+ return NULL;
- tmi.ownerdata=NULL;
+ lpTrayMenuExecParam mmep = (lpTrayMenuExecParam)mir_alloc(sizeof(TrayMenuExecParam));
+ if ( mmep == NULL)
+ return 0;
- {
- lpTrayMenuExecParam mmep;
- mmep=(lpTrayMenuExecParam)mir_alloc(sizeof(TrayMenuExecParam));
- if(mmep==NULL){return(0);};
-
- //we need just one parametr.
- mmep->szServiceName=mir_strdup(mi->pszService);
- mmep->Param1=mi->popupPosition;
+ //we need just one parametr.
+ mmep->szServiceName=mir_strdup(mi->pszService);
+ mmep->Param1=mi->popupPosition;
+ tmi.ownerdata = mmep;
- tmi.ownerdata=mmep;
- }
+ OptParam op;
op.Handle=(HANDLE)CallService(MO_ADDNEWMENUITEM,(WPARAM)hTrayMenuObject,(LPARAM)&tmi);
op.Setting=OPT_MENUITEMSETUNIQNAME;
op.Value=(INT_PTR)mi->pszService;
diff --git a/plugins/Modernb/modern_framesmenu.cpp b/plugins/Modernb/modern_framesmenu.cpp
index 5a8552f0cb..766adf4974 100644
--- a/plugins/Modernb/modern_framesmenu.cpp
+++ b/plugins/Modernb/modern_framesmenu.cpp
@@ -10,7 +10,8 @@ typedef struct{
char *szServiceName;
int Frameid;
INT_PTR param1;
-}FrameMenuExecParam,*lpFrameMenuExecParam;
+}
+ FrameMenuExecParam,*lpFrameMenuExecParam;
void FreeAndNil( void **p )
{
@@ -20,41 +21,30 @@ void FreeAndNil( void **p )
if ( *p != NULL ) {
mir_free( *p );
*p = NULL;
- } }
+} }
static INT_PTR AddContextFrameMenuItem(WPARAM wParam,LPARAM lParam)
{
- CLISTMENUITEM *mi=(CLISTMENUITEM*)lParam;
- TMO_MenuItem tmi={0};
+ TMO_MenuItem tmi;
+ CLISTMENUITEM *mi = (CLISTMENUITEM*)lParam;
+ if ( !pcli->pfnConvertMenu(mi, &tmi))
+ return NULL;
- if(mi->cbSize!=sizeof(CLISTMENUITEM)) return 0;
+ tmi.root = (mi->flags & CMIF_ROOTHANDLE) ? mi->hParentMenu : NULL;
- memset(&tmi,0,sizeof(tmi));
+ lpFrameMenuExecParam fmep = (lpFrameMenuExecParam)mir_alloc(sizeof(FrameMenuExecParam));
+ if (fmep == NULL)
+ return 0;
- tmi.cbSize=sizeof(tmi);
- tmi.flags=mi->flags;
- tmi.hIcon=mi->hIcon;
- tmi.hotKey=mi->hotKey;
- tmi.position=mi->position;
- tmi.pszName=mi->pszName;
+ memset(fmep, 0, sizeof(FrameMenuExecParam));
+ fmep->szServiceName = mir_strdup(mi->pszService);
+ fmep->Frameid = mi->popupPosition;
+ fmep->param1 = (INT_PTR)mi->pszContactOwner;
+ tmi.ownerdata = fmep;
- if ( mi->flags & CMIF_ROOTHANDLE ) tmi.root = mi->hParentMenu;
- {
- lpFrameMenuExecParam fmep;
- fmep=(lpFrameMenuExecParam)mir_alloc(sizeof(FrameMenuExecParam));
- if (fmep==NULL){return(0);};
- memset(fmep,0,sizeof(FrameMenuExecParam));
- fmep->szServiceName=mir_strdup(mi->pszService);
- fmep->Frameid=mi->popupPosition;
- fmep->param1=(INT_PTR)mi->pszContactOwner;
-
- tmi.ownerdata=fmep;
- };
-
- return(CallService(MO_ADDNEWMENUITEM,(WPARAM)hFrameMenuObject,(LPARAM)&tmi));
+ return CallService(MO_ADDNEWMENUITEM,(WPARAM)hFrameMenuObject,(LPARAM)&tmi);
}
-
static INT_PTR RemoveContextFrameMenuItem(WPARAM wParam,LPARAM lParam)
{
lpFrameMenuExecParam fmep;
diff --git a/plugins/Modernb/modern_groupmenu.cpp b/plugins/Modernb/modern_groupmenu.cpp
index dcfa6db2a8..9d2b3780e6 100644
--- a/plugins/Modernb/modern_groupmenu.cpp
+++ b/plugins/Modernb/modern_groupmenu.cpp
@@ -80,54 +80,34 @@ INT_PTR BuildGroupMenu(WPARAM wParam,LPARAM lParam)
static INT_PTR AddGroupMenuItem(WPARAM wParam,LPARAM lParam)
{
- CLISTMENUITEM *mi=(CLISTMENUITEM*)lParam;
- lpGroupMenuParam gmp=(lpGroupMenuParam)wParam;
- char buf[1024];
-
TMO_MenuItem tmi;
- OptParam op;
+ CLISTMENUITEM *mi = (CLISTMENUITEM*)lParam;
+ if ( !pcli->pfnConvertMenu(mi, &tmi))
+ return NULL;
- if(mi->cbSize!=sizeof(CLISTMENUITEM)) return 0;
-
- memset(&tmi,0,sizeof(tmi));
- tmi.cbSize=sizeof(tmi);
- tmi.flags=mi->flags;
- tmi.hIcon=mi->hIcon;
- tmi.hotKey=mi->hotKey;
- tmi.pszName=mi->pszName;
- tmi.position=mi->position;
-
- //pszPopupName for new system mean root level
- //pszPopupName for old system mean that exists popup
- tmi.root = mi->hParentMenu;
-
- tmi.ownerdata=NULL;
-
- {
- lpGroupMenuExecParam mmep;
- mmep=(lpGroupMenuExecParam)mir_calloc(sizeof(GroupMenuExecParam));
- if(mmep==NULL){return(0);};
+ lpGroupMenuExecParam mmep = (lpGroupMenuExecParam)mir_calloc(sizeof(GroupMenuExecParam));
+ if (mmep == NULL)
+ return 0;
- //we need just one parametr.
- mmep->szServiceName=mir_strdup(mi->pszService);
- mmep->Param1=mi->popupPosition;
- if (gmp!=NULL)
- {
- mmep->Param1=gmp->wParam;
- mmep->Param2=gmp->lParam;
- }
-
- tmi.ownerdata=mmep;
+ //we need just one parametr.
+ mmep->szServiceName = mir_strdup(mi->pszService);
+ mmep->Param1 = mi->popupPosition;
+ lpGroupMenuParam gmp = (lpGroupMenuParam)wParam;
+ if (gmp != NULL) {
+ mmep->Param1 = gmp->wParam;
+ mmep->Param2 = gmp->lParam;
}
- op.Handle=(HANDLE)CallService(MO_ADDNEWMENUITEM,(WPARAM)hGroupMenuObject,(LPARAM)&tmi);
- op.Setting=OPT_MENUITEMSETUNIQNAME;
+ tmi.ownerdata=mmep;
+
+ char buf[1024];
sprintf(buf,"%s/%s",mi->pszService,mi->pszName);
- op.Value=(INT_PTR)buf;
+
+ OptParam op;
+ op.Handle = (HANDLE)CallService(MO_ADDNEWMENUITEM,(WPARAM)hGroupMenuObject,(LPARAM)&tmi);
+ op.Setting = OPT_MENUITEMSETUNIQNAME;
+ op.Value = (INT_PTR)buf;
CallService(MO_SETOPTIONSMENUITEM,(WPARAM)0,(LPARAM)&op);
return (INT_PTR)op.Handle;
-
-// mainItemCount++;
-// return MENU_CUSTOMITEMMAIN|(mainMenuItem[mainItemCount-1].id);
}
int GroupMenuCheckService(WPARAM wParam,LPARAM lParam) {
@@ -545,54 +525,34 @@ HMENU cliBuildGroupPopupMenu(struct ClcGroup *group)
}
static INT_PTR AddSubGroupMenuItem(WPARAM wParam,LPARAM lParam)
{
- CLISTMENUITEM *mi=(CLISTMENUITEM*)lParam;
- lpGroupMenuParam gmp=(lpGroupMenuParam)wParam;
- char buf[1024];
TMO_MenuItem tmi;
- OptParam op;
-
- if(mi->cbSize!=sizeof(CLISTMENUITEM)) return 0;
- memset(&tmi,0,sizeof(tmi));
- tmi.cbSize=sizeof(tmi);
- tmi.flags=mi->flags;
- tmi.hIcon=mi->hIcon;
- tmi.hotKey=mi->hotKey;
- tmi.pszName=mi->pszName;
- tmi.position=mi->position;
-
- //pszPopupName for new system mean root level
- //pszPopupName for old system mean that exists popup
- tmi.root = mi->hParentMenu;
+ CLISTMENUITEM *mi = (CLISTMENUITEM*)lParam;
+ if ( !pcli->pfnConvertMenu(mi, &tmi))
+ return NULL;
- tmi.ownerdata=NULL;
-
- {
- lpSubGroupMenuExecParam mmep;
- mmep=(lpSubGroupMenuExecParam)mir_calloc(sizeof(SubGroupMenuExecParam));
- if(mmep==NULL){return(0);};
-
- //we need just one parametr.
- mmep->szServiceName=mir_strdup(mi->pszService);
- mmep->Param1=mi->popupPosition;
- if (gmp!=NULL)
- {
- mmep->Param1=gmp->wParam;
- mmep->Param2=gmp->lParam;
-
- }
+ lpSubGroupMenuExecParam mmep = (lpSubGroupMenuExecParam)mir_calloc(sizeof(SubGroupMenuExecParam));
+ if ( mmep == NULL)
+ return 0;
-
- tmi.ownerdata=mmep;
+ //we need just one parametr.
+ mmep->szServiceName = mir_strdup(mi->pszService);
+ mmep->Param1 = mi->popupPosition;
+ lpGroupMenuParam gmp=(lpGroupMenuParam)wParam;
+ if (gmp != NULL) {
+ mmep->Param1 = gmp->wParam;
+ mmep->Param2 = gmp->lParam;
}
+ tmi.ownerdata=mmep;
+
+ char buf[1024];
+ sprintf(buf,"%s/%s",mi->pszService,mi->pszName);
+
+ OptParam op;
op.Handle=(HANDLE)CallService(MO_ADDNEWMENUITEM,(WPARAM)hSubGroupMenuObject,(LPARAM)&tmi);
op.Setting=OPT_MENUITEMSETUNIQNAME;
- sprintf(buf,"%s/%s",mi->pszService,mi->pszName);
op.Value=(INT_PTR)buf;
CallService(MO_SETOPTIONSMENUITEM,(WPARAM)0,(LPARAM)&op);
return (INT_PTR)op.Handle;
-
-// mainItemCount++;
-// return MENU_CUSTOMITEMMAIN|(mainMenuItem[mainItemCount-1].id);
}
INT_PTR SubGroupMenuCheckService(WPARAM wParam,LPARAM lParam) {
diff --git a/plugins/Mwclist/CLUIFrames/framesmenu.cpp b/plugins/Mwclist/CLUIFrames/framesmenu.cpp
index 7a34206512..7ce6bdd2a1 100644
--- a/plugins/Mwclist/CLUIFrames/framesmenu.cpp
+++ b/plugins/Mwclist/CLUIFrames/framesmenu.cpp
@@ -37,34 +37,24 @@ INT_PTR FreeOwnerDataFrameMenu (WPARAM wParam,LPARAM lParam)
static INT_PTR AddContextFrameMenuItem(WPARAM wParam,LPARAM lParam)
{
- CLISTMENUITEM *mi = (CLISTMENUITEM*)lParam;
TMO_MenuItem tmi;
+ CLISTMENUITEM *mi = (CLISTMENUITEM*)lParam;
+ if ( !pcli->pfnConvertMenu(mi, &tmi))
+ return 0;
- if (mi->cbSize != sizeof(CLISTMENUITEM)) return 0;
-
- memset(&tmi,0,sizeof(tmi));
+ if ((mi->flags & CMIF_ROOTPOPUP) || (mi->flags & CMIF_CHILDPOPUP))
+ tmi.root = mi->hParentMenu;
- tmi.cbSize = sizeof(tmi);
- tmi.flags = mi->flags;
- tmi.hIcon = mi->hIcon;
- tmi.hotKey = mi->hotKey;
- tmi.position = mi->position;
- tmi.pszName = mi->pszName;
+ lpFrameMenuExecParam fmep = (lpFrameMenuExecParam)mir_alloc(sizeof(FrameMenuExecParam));
+ if (fmep == NULL)
+ return 0;
- if (mi->flags&CMIF_ROOTPOPUP||mi->flags&CMIF_CHILDPOPUP)
- tmi.root = mi->hParentMenu;
- {
- lpFrameMenuExecParam fmep;
- 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;
- }
+ fmep->szServiceName = mir_strdup(mi->pszService);
+ fmep->Frameid = mi->popupPosition;
+ fmep->param1 = (INT_PTR)mi->pszContactOwner;
+ tmi.ownerdata = fmep;
- return(CallService(MO_ADDNEWMENUITEM,(WPARAM)hFrameMenuObject,(LPARAM)&tmi));
+ return CallService(MO_ADDNEWMENUITEM, (WPARAM)hFrameMenuObject, (LPARAM)&tmi);
}
static INT_PTR RemoveContextFrameMenuItem(WPARAM wParam,LPARAM lParam)
diff --git a/plugins/Mwclist/clisttray.cpp b/plugins/Mwclist/clisttray.cpp
index 82ce1a2f16..d0e6e3ae93 100644
--- a/plugins/Mwclist/clisttray.cpp
+++ b/plugins/Mwclist/clisttray.cpp
@@ -106,38 +106,20 @@ static INT_PTR BuildTrayMenu(WPARAM wParam,LPARAM lParam)
static INT_PTR AddTrayMenuItem(WPARAM wParam,LPARAM lParam)
{
- CLISTMENUITEM *mi = (CLISTMENUITEM*)lParam;
TMO_MenuItem tmi;
- OptParam op;
-
- if (mi->cbSize != sizeof(CLISTMENUITEM)) return 0;
-
- memset(&tmi,0,sizeof(tmi));
- tmi.cbSize = sizeof(tmi);
- tmi.flags = mi->flags;
- tmi.hIcon = mi->hIcon;
- tmi.hotKey = mi->hotKey;
- tmi.pszName = mi->pszName;
- tmi.position = mi->position;
-
- //pszPopupName for new system mean root level
- //pszPopupName for old system mean that exists popup
- tmi.root = (HGENMENU)mi->pszPopupName;
-
- tmi.ownerdata = NULL;
+ CLISTMENUITEM *mi = (CLISTMENUITEM*)lParam;
+ if ( !pcli->pfnConvertMenu(mi, &tmi))
+ return NULL;
- {
- lpTrayMenuExecParam mmep;
- mmep = (lpTrayMenuExecParam)mir_alloc(sizeof(TrayMenuExecParam));
- if (mmep == NULL)
- return 0;
+ lpTrayMenuExecParam mmep = (lpTrayMenuExecParam)mir_alloc(sizeof(TrayMenuExecParam));
+ if (mmep == NULL)
+ return 0;
- //we need just one parametr.
- mmep->szServiceName = mir_strdup(mi->pszService);
- mmep->Param1 = mi->popupPosition;
+ mmep->szServiceName = mir_strdup(mi->pszService);
+ mmep->Param1 = mi->popupPosition;
+ tmi.ownerdata = mmep;
- tmi.ownerdata = mmep;
- }
+ OptParam op;
op.Handle = (HANDLE)CallService(MO_ADDNEWMENUITEM,(WPARAM)hTrayMenuObject,(LPARAM)&tmi);
op.Setting = OPT_MENUITEMSETUNIQNAME;
op.Value = (INT_PTR)mi->pszService;
diff --git a/plugins/Mwclist/groupmenu.cpp b/plugins/Mwclist/groupmenu.cpp
index fab616f6fb..496f98e78c 100644
--- a/plugins/Mwclist/groupmenu.cpp
+++ b/plugins/Mwclist/groupmenu.cpp
@@ -87,46 +87,31 @@ static INT_PTR BuildGroupMenu(WPARAM wParam,LPARAM lParam)
static INT_PTR AddGroupMenuItem(WPARAM wParam,LPARAM lParam)
{
+ TMO_MenuItem tmi;
CLISTMENUITEM *mi = (CLISTMENUITEM*)lParam;
+ if ( !pcli->pfnConvertMenu(mi, &tmi))
+ return 0;
+
+ lpGroupMenuExecParam mmep = (lpGroupMenuExecParam)mir_calloc(sizeof(GroupMenuExecParam));
+ 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) {
+ mmep->Param1 = gmp->wParam;
+ mmep->Param2 = gmp->lParam;
+ }
+ tmi.ownerdata = mmep;
+
char buf[1024];
+ sprintf(buf,"%s/%s",mi->pszService,mi->pszName);
- TMO_MenuItem tmi;
OptParam op;
-
- if (mi->cbSize != sizeof(CLISTMENUITEM)) return 0;
-
- memset(&tmi,0,sizeof(tmi));
- tmi.cbSize = sizeof(tmi);
- tmi.flags = mi->flags;
- tmi.hIcon = mi->hIcon;
- tmi.hotKey = mi->hotKey;
- tmi.pszName = mi->pszName;
- tmi.position = mi->position;
- tmi.root = mi->hParentMenu;
- tmi.ownerdata = NULL;
-
- {
- lpGroupMenuExecParam mmep;
- mmep = (lpGroupMenuExecParam)mir_calloc(sizeof(GroupMenuExecParam));
- if (mmep == NULL){return 0;}
-
- //we need just one parametr.
- mmep->szServiceName = mir_strdup(mi->pszService);
- mmep->Param1 = mi->popupPosition;
- if (gmp != NULL)
- {
- mmep->Param1 = gmp->wParam;
- mmep->Param2 = gmp->lParam;
-
- }
-
-
- tmi.ownerdata = mmep;
- }
op.Handle = (HANDLE)CallService(MO_ADDNEWMENUITEM,(WPARAM)hGroupMenuObject,(LPARAM)&tmi);
op.Setting = OPT_MENUITEMSETUNIQNAME;
- sprintf(buf,"%s/%s",mi->pszService,mi->pszName);
op.Value = (INT_PTR)buf;
CallService(MO_SETOPTIONSMENUITEM,(WPARAM)0,(LPARAM)&op);
return (INT_PTR)op.Handle;
@@ -494,44 +479,31 @@ static INT_PTR BuildSubGroupMenu(WPARAM wParam,LPARAM lParam)
static INT_PTR AddSubGroupMenuItem(WPARAM wParam,LPARAM lParam)
{
- CLISTMENUITEM *mi = (CLISTMENUITEM*)lParam;
- lpGroupMenuParam gmp = (lpGroupMenuParam)wParam;
- char buf[1024];
TMO_MenuItem tmi;
- OptParam op;
-
- if (mi->cbSize != sizeof(CLISTMENUITEM)) return 0;
- memset(&tmi,0,sizeof(tmi));
- tmi.cbSize = sizeof(tmi);
- tmi.flags = mi->flags;
- tmi.hIcon = mi->hIcon;
- tmi.hotKey = mi->hotKey;
- tmi.pszName = mi->pszName;
- tmi.position = mi->position;
-
- //pszPopupName for new system mean root level
- //pszPopupName for old system mean that exists popup
- tmi.root = mi->hParentMenu;
-
- tmi.ownerdata = NULL;
+ CLISTMENUITEM *mi = (CLISTMENUITEM*)lParam;
+ if ( !pcli->pfnConvertMenu(mi, &tmi))
+ return 0;
- { 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 = mi->popupPosition;
- if ( gmp != NULL ) {
- mmep->Param1 = gmp->wParam;
- mmep->Param2 = gmp->lParam;
- }
+ lpSubGroupMenuExecParam mmep = (lpSubGroupMenuExecParam)mir_calloc(sizeof(SubGroupMenuExecParam));
+ if ( mmep == NULL)
+ return 0;
- tmi.ownerdata = mmep;
+ //we need just one parametr.
+ mmep->szServiceName = mir_strdup(mi->pszService);
+ mmep->Param1 = mi->popupPosition;
+ lpGroupMenuParam gmp = (lpGroupMenuParam)wParam;
+ if ( gmp != NULL ) {
+ mmep->Param1 = gmp->wParam;
+ mmep->Param2 = gmp->lParam;
}
+ tmi.ownerdata = mmep;
+
+ char buf[1024];
+ sprintf(buf,"%s/%s",mi->pszService,mi->pszName);
+
+ OptParam op;
op.Handle = (HANDLE)CallService(MO_ADDNEWMENUITEM,(WPARAM)hSubGroupMenuObject,(LPARAM)&tmi);
op.Setting = OPT_MENUITEMSETUNIQNAME;
- sprintf(buf,"%s/%s",mi->pszService,mi->pszName);
op.Value = (INT_PTR)buf;
CallService(MO_SETOPTIONSMENUITEM,(WPARAM)0,(LPARAM)&op);
return (INT_PTR)op.Handle;
diff --git a/plugins/SRMM/msgs.c b/plugins/SRMM/msgs.c
index ac7a615703..8ebb549339 100644
--- a/plugins/SRMM/msgs.c
+++ b/plugins/SRMM/msgs.c
@@ -379,7 +379,7 @@ static int PrebuildContactMenu(WPARAM wParam, LPARAM lParam)
char* szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
CLISTMENUITEM clmi = {0};
- clmi.cbSize = sizeof( CLISTMENUITEM );
+ clmi.cbSize = sizeof(CLISTMENUITEM);
clmi.flags = CMIM_FLAGS | CMIF_DEFAULT | CMIF_HIDDEN;
if ( szProto ) {
diff --git a/plugins/Scriver/chat/clist.c b/plugins/Scriver/chat/clist.c
index 03a88ede7f..971ddfbe03 100644
--- a/plugins/Scriver/chat/clist.c
+++ b/plugins/Scriver/chat/clist.c
@@ -214,7 +214,7 @@ int CList_PrebuildContactMenu(WPARAM wParam, LPARAM lParam)
char* szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
CLISTMENUITEM clmi = {0};
- clmi.cbSize = sizeof( CLISTMENUITEM );
+ clmi.cbSize = sizeof(CLISTMENUITEM);
clmi.flags = CMIM_FLAGS | CMIF_DEFAULT | CMIF_HIDDEN;
if ( szProto ) {
diff --git a/plugins/Scriver/msgs.c b/plugins/Scriver/msgs.c
index 0ce59281ea..486887e84e 100644
--- a/plugins/Scriver/msgs.c
+++ b/plugins/Scriver/msgs.c
@@ -419,7 +419,7 @@ static int PrebuildContactMenu(WPARAM wParam, LPARAM lParam) {
char* szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
CLISTMENUITEM clmi = {0};
- clmi.cbSize = sizeof( CLISTMENUITEM );
+ clmi.cbSize = sizeof(CLISTMENUITEM);
clmi.flags = CMIM_FLAGS | CMIF_DEFAULT | CMIF_HIDDEN;
if ( szProto ) {
diff --git a/plugins/TabSRMM/chat/clist.cpp b/plugins/TabSRMM/chat/clist.cpp
index 18f1eba4e4..540997aa87 100644
--- a/plugins/TabSRMM/chat/clist.cpp
+++ b/plugins/TabSRMM/chat/clist.cpp
@@ -222,7 +222,7 @@ int CList_PrebuildContactMenu(WPARAM wParam, LPARAM lParam)
char* szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
CLISTMENUITEM clmi = {0};
- clmi.cbSize = sizeof( CLISTMENUITEM );
+ clmi.cbSize = sizeof(CLISTMENUITEM);
clmi.flags = CMIM_FLAGS | CMIF_DEFAULT | CMIF_HIDDEN;
if ( szProto ) {
diff --git a/plugins/TabSRMM/src/mim.cpp b/plugins/TabSRMM/src/mim.cpp
index 853279a086..1e412817be 100644
--- a/plugins/TabSRMM/src/mim.cpp
+++ b/plugins/TabSRMM/src/mim.cpp
@@ -706,7 +706,7 @@ int CMimAPI::PrebuildContactMenu(WPARAM wParam, LPARAM lParam)
char* szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
CLISTMENUITEM clmi = {0};
- clmi.cbSize = sizeof( CLISTMENUITEM );
+ clmi.cbSize = sizeof(CLISTMENUITEM);
clmi.flags = CMIM_FLAGS | CMIF_DEFAULT | CMIF_HIDDEN;
if ( szProto ) {