summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-01-26 21:04:38 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-01-26 21:04:38 +0000
commitf8a2931aff174ded0a69b7b5933dd27337cbb134 (patch)
tree8e8960cfd9d816d822837bc882e3c6e539832f8b /plugins/Clist_modern
parenteecb95c8e17f3397f64820f36f2a1d2351fe92e0 (diff)
SKINICON_OTHER_FRAME for all plugins
git-svn-id: http://svn.miranda-ng.org/main/trunk@3297 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_modern')
-rw-r--r--plugins/Clist_modern/src/hdr/modern_commonheaders.h2
-rw-r--r--plugins/Clist_modern/src/modern_clcopts.cpp6
-rw-r--r--plugins/Clist_modern/src/modern_clistevents.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_clisttray.cpp134
-rw-r--r--plugins/Clist_modern/src/modern_clui.cpp9
-rw-r--r--plugins/Clist_modern/src/modern_cluiframes.cpp4
-rw-r--r--plugins/Clist_modern/src/modern_framesmenu.cpp188
-rw-r--r--plugins/Clist_modern/src/modern_groupmenu.cpp66
-rw-r--r--plugins/Clist_modern/src/modern_statusbar.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_toolbar.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_viewmodebar.cpp2
11 files changed, 151 insertions, 266 deletions
diff --git a/plugins/Clist_modern/src/hdr/modern_commonheaders.h b/plugins/Clist_modern/src/hdr/modern_commonheaders.h
index c8aa087968..c085350474 100644
--- a/plugins/Clist_modern/src/hdr/modern_commonheaders.h
+++ b/plugins/Clist_modern/src/hdr/modern_commonheaders.h
@@ -255,8 +255,6 @@ HWND WINAPI MyGetAncestor( HWND, UINT );
typedef BOOL (WINAPI *pfnGetMenuBarInfo)( HWND, LONG, LONG, PMENUBARINFO );
extern pfnGetMenuBarInfo fnGetMenuBarInfo;
-void FreeAndNil( void **p );
-
extern SortedList *clistCache;
HICON LoadSmallIcon(HINSTANCE hInstance, LPCTSTR lpIconName);
diff --git a/plugins/Clist_modern/src/modern_clcopts.cpp b/plugins/Clist_modern/src/modern_clcopts.cpp
index c735ab547c..a2d7680a54 100644
--- a/plugins/Clist_modern/src/modern_clcopts.cpp
+++ b/plugins/Clist_modern/src/modern_clcopts.cpp
@@ -2028,10 +2028,8 @@ int ModernOptInit(WPARAM wParam,LPARAM lParam)
MODERNOPT_CTRL_LAST
};
- MODERNOPTOBJECT obj = {0};
-
- obj.cbSize = sizeof(obj);
- obj.dwFlags = MODEROPT_FLG_TCHAR|MODEROPT_FLG_NORESIZE;
+ MODERNOPTOBJECT obj = { sizeof(obj) };
+ obj.dwFlags = MODEROPT_FLG_TCHAR | MODEROPT_FLG_NORESIZE;
obj.hIcon = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);
obj.hInstance = g_hInst;
obj.iSection = MODERNOPT_PAGE_CLIST;
diff --git a/plugins/Clist_modern/src/modern_clistevents.cpp b/plugins/Clist_modern/src/modern_clistevents.cpp
index f15f7f0045..016a1a5304 100644
--- a/plugins/Clist_modern/src/modern_clistevents.cpp
+++ b/plugins/Clist_modern/src/modern_clistevents.cpp
@@ -429,7 +429,7 @@ int EventArea_Create(HWND hCluiWnd)
CLISTFrame Frame = { sizeof(CLISTFrame) };
Frame.hWnd = g_CluiData.hwndEventFrame;
Frame.align = alBottom;
- Frame.hIcon = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);
+ Frame.hIcon = LoadSkinnedIcon(SKINICON_OTHER_FRAME);
Frame.Flags = (db_get_b(NULL,"CLUI","ShowEventArea",SETTING_SHOWEVENTAREAFRAME_DEFAULT)?F_VISIBLE:0)|F_LOCKED|F_NOBORDER|F_NO_SUBCONTAINER|F_TCHAR;
Frame.height = h;
Frame.tname = _T("EventArea"); //do not translate
diff --git a/plugins/Clist_modern/src/modern_clisttray.cpp b/plugins/Clist_modern/src/modern_clisttray.cpp
index 03414ab7f9..9e8c143ece 100644
--- a/plugins/Clist_modern/src/modern_clisttray.cpp
+++ b/plugins/Clist_modern/src/modern_clisttray.cpp
@@ -590,12 +590,10 @@ INT_PTR TrayMenuExecService(WPARAM wParam,LPARAM lParam) {
INT_PTR FreeOwnerDataTrayMenu (WPARAM wParam,LPARAM lParam)
{
-
- lpTrayMenuExecParam mmep;
- mmep = (lpTrayMenuExecParam)lParam;
- if (mmep != NULL){
- FreeAndNil((void**)&mmep->szServiceName);
- FreeAndNil((void**)&mmep);
+ lpTrayMenuExecParam mmep = (lpTrayMenuExecParam)lParam;
+ if (mmep != NULL) {
+ mir_free(mmep->szServiceName);
+ mir_free(mmep);
}
return 0;
@@ -603,9 +601,6 @@ INT_PTR FreeOwnerDataTrayMenu (WPARAM wParam,LPARAM lParam)
void InitTrayMenus(void)
{
- TMenuParam tmp;
- OptParam op;
-
CreateServiceFunction("CLISTMENUSTRAY/ExecService",TrayMenuExecService);
CreateServiceFunction("CLISTMENUSTRAY/FreeOwnerDataTrayMenu",FreeOwnerDataTrayMenu);
CreateServiceFunction("CLISTMENUSTRAY/TrayMenuonAddService",TrayMenuonAddService);
@@ -614,16 +609,14 @@ void InitTrayMenus(void)
CreateServiceFunction(MS_CLIST_REMOVETRAYMENUITEM,RemoveTrayMenuItem);
CreateServiceFunction(MS_CLIST_MENUBUILDTRAY,BuildTrayMenu);
-
//Tray menu
- memset(&tmp,0,sizeof(tmp));
- tmp.cbSize = sizeof(tmp);
+ TMenuParam tmp = { sizeof(tmp) };
tmp.CheckService = NULL;
tmp.ExecService = "CLISTMENUSTRAY/ExecService";
tmp.name = "TrayMenu";
hTrayMenuObject = (HANDLE)CallService(MO_CREATENEWMENUOBJECT,0,(LPARAM)&tmp);
-
+ OptParam op;
op.Handle = hTrayMenuObject;
op.Setting = OPT_USERDEFINEDITEMS;
op.Value = TRUE;
@@ -639,77 +632,50 @@ void InitTrayMenus(void)
op.Value = (INT_PTR)"CLISTMENUSTRAY/TrayMenuonAddService";
CallService(MO_SETOPTIONSMENUOBJECT,0,(LPARAM)&op);
- {
- //add exit command to menu
- CLISTMENUITEM mi = { sizeof(mi) };
- mi.position = 900000;
- mi.pszService = "CloseAction";
- mi.pszName = LPGEN("E&xit");
- mi.flags = CMIF_ICONFROMICOLIB;
- mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_EXIT);
- AddTrayMenuItem(0,(LPARAM)&mi);
- DestroyIcon_protect(mi.hIcon);
-
- memset(&mi,0,sizeof(mi));
- mi.cbSize = sizeof(mi);
- mi.position = 100000;
- mi.pszService = MS_CLIST_SHOWHIDE;
- mi.pszName = LPGEN("&Hide/Show");
- mi.flags = CMIF_ICONFROMICOLIB;
- mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_SHOWHIDE);
- hTrayHideShowMainMenuItem = (HANDLE)AddTrayMenuItem(0,(LPARAM)&mi);
- DestroyIcon_protect(mi.hIcon);
-
- memset(&mi,0,sizeof(mi));
- mi.cbSize = sizeof(mi);
- mi.position = 200000;
- mi.flags = CMIF_ICONFROMICOLIB;
- mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_FINDUSER);
- mi.pszService = "FindAdd/FindAddCommand";
- mi.pszName = LPGEN("&Find/Add Contacts...");
- AddTrayMenuItem(0,(LPARAM)&mi);
- DestroyIcon_protect(mi.hIcon);
-
- memset(&mi,0,sizeof(mi));
- mi.cbSize = sizeof(mi);
- mi.position = 300000;
- mi.flags = CMIF_ICONFROMICOLIB; // eternity #004
- mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_MAINMENU); // eternity #004
- mi.pszService = "FakeService_1";
- mi.pszName = LPGEN("&Main Menu");
- hTrayMainMenuItemProxy = (HANDLE)AddTrayMenuItem(0,(LPARAM)&mi);
- DestroyIcon_protect(mi.hIcon); // eternity #004
-
- memset(&mi,0,sizeof(mi));
- mi.cbSize = sizeof(mi);
- mi.position = 300100;
- mi.pszService = "FakeService_2";
- mi.flags = CMIF_ICONFROMICOLIB; // eternity #004
- mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_STATUS); // eternity #004
- mi.pszName = LPGEN("&Status");
- hTrayStatusMenuItemProxy = (HANDLE)AddTrayMenuItem(0,(LPARAM)&mi);
- DestroyIcon_protect(mi.hIcon); // eternity #004
-
- memset(&mi,0,sizeof(mi));
- mi.cbSize = sizeof(mi);
- mi.position = 400000;
- mi.flags = CMIF_ICONFROMICOLIB;
- mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_OPTIONS);
- mi.pszService = "Options/OptionsCommand";
- mi.pszName = LPGEN("&Options...");
- AddTrayMenuItem(0,(LPARAM)&mi);
- DestroyIcon_protect(mi.hIcon);
-
- memset(&mi,0,sizeof(mi));
- mi.cbSize = sizeof(mi);
- mi.position = 500000;
- mi.flags = CMIF_ICONFROMICOLIB;
- mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_MIRANDA);
- mi.pszService = "Help/AboutCommand";
- mi.pszName = LPGEN("&About");
- AddTrayMenuItem(0,(LPARAM)&mi);
- DestroyIcon_protect(mi.hIcon);
- }
+ //add exit command to menu
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.position = 900000;
+ mi.pszService = "CloseAction";
+ mi.pszName = LPGEN("E&xit");
+ mi.flags = CMIF_ICONFROMICOLIB;
+ mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_EXIT);
+ AddTrayMenuItem(0,(LPARAM)&mi);
+
+ mi.position = 100000;
+ mi.pszService = MS_CLIST_SHOWHIDE;
+ mi.pszName = LPGEN("&Hide/Show");
+ mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_SHOWHIDE);
+ hTrayHideShowMainMenuItem = (HANDLE)AddTrayMenuItem(0,(LPARAM)&mi);
+
+ mi.position = 200000;
+ mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_FINDUSER);
+ mi.pszService = "FindAdd/FindAddCommand";
+ mi.pszName = LPGEN("&Find/Add Contacts...");
+ AddTrayMenuItem(0,(LPARAM)&mi);
+
+ mi.position = 300000;
+ mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_MAINMENU); // eternity #004
+ mi.pszService = "FakeService_1";
+ mi.pszName = LPGEN("&Main Menu");
+ hTrayMainMenuItemProxy = (HANDLE)AddTrayMenuItem(0,(LPARAM)&mi);
+
+ mi.position = 300100;
+ mi.pszService = "FakeService_2";
+ mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_STATUS); // eternity #004
+ mi.pszName = LPGEN("&Status");
+ hTrayStatusMenuItemProxy = (HANDLE)AddTrayMenuItem(0,(LPARAM)&mi);
+
+ mi.position = 400000;
+ mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_OPTIONS);
+ mi.pszService = "Options/OptionsCommand";
+ mi.pszName = LPGEN("&Options...");
+ AddTrayMenuItem(0,(LPARAM)&mi);
+
+ mi.position = 500000;
+ mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_MIRANDA);
+ mi.pszService = "Help/AboutCommand";
+ mi.pszName = LPGEN("&About");
+ AddTrayMenuItem(0,(LPARAM)&mi);
hMainMenu = (HMENU)CallService(MS_CLIST_MENUGETMAIN,0,0);
hStatusMenu = (HMENU)CallService(MS_CLIST_MENUGETSTATUS,0,0);
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp
index 622a997a4f..4e188a182b 100644
--- a/plugins/Clist_modern/src/modern_clui.cpp
+++ b/plugins/Clist_modern/src/modern_clui.cpp
@@ -287,7 +287,7 @@ HRESULT CLUI::RegisterAvatarMenu()
CLISTMENUITEM mi = { sizeof(mi) };
CreateServiceFunction("CList/ShowContactAvatar",CLUI::Service_Menu_ShowContactAvatar);
mi.position = 2000150000;
- mi.hIcon = LoadSmallIcon(g_hInst,MAKEINTRESOURCE(IDI_SHOW_AVATAR));
+ mi.hIcon = LoadSmallIcon(g_hInst, MAKEINTRESOURCE(IDI_SHOW_AVATAR));
mi.pszName = LPGEN("Show Contact &Avatar");
mi.pszService = "CList/ShowContactAvatar";
hShowAvatarMenuItem = Menu_AddContactMenuItem(&mi);
@@ -295,14 +295,13 @@ HRESULT CLUI::RegisterAvatarMenu()
CreateServiceFunction("CList/HideContactAvatar",CLUI::Service_Menu_HideContactAvatar);
mi.position = 2000150001;
- mi.hIcon = LoadSmallIcon(g_hInst,MAKEINTRESOURCE(IDI_HIDE_AVATAR));
+ mi.hIcon = LoadSmallIcon(g_hInst, MAKEINTRESOURCE(IDI_HIDE_AVATAR));
mi.pszName = LPGEN("Hide Contact &Avatar");
mi.pszService = "CList/HideContactAvatar";
hHideAvatarMenuItem = Menu_AddContactMenuItem(&mi);
DestroyIcon_protect(mi.hIcon);
HookEvent(ME_CLIST_PREBUILDCONTACTMENU, CLUI::OnEvent_ContactMenuPreBuild);
-
return S_OK;
}
@@ -372,8 +371,8 @@ HRESULT CLUI::CreateCLC()
Frame.hWnd = ClcWnd();
Frame.align = alClient;
- Frame.hIcon = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);
- Frame.Flags = F_VISIBLE|/*F_SHOWTB|*/F_SHOWTBTIP|F_NO_SUBCONTAINER|F_TCHAR;
+ Frame.hIcon = LoadSkinnedIcon(SKINICON_OTHER_FRAME);
+ Frame.Flags = F_VISIBLE | F_SHOWTBTIP | F_NO_SUBCONTAINER | F_TCHAR;
Frame.tname = LPGENT("My Contacts");
Frame.TBtname = TranslateT("My Contacts");
hFrameContactTree = (HWND)CallService(MS_CLIST_FRAMES_ADDFRAME,(WPARAM)&Frame,0);
diff --git a/plugins/Clist_modern/src/modern_cluiframes.cpp b/plugins/Clist_modern/src/modern_cluiframes.cpp
index ee1fc86397..70bc97ec4b 100644
--- a/plugins/Clist_modern/src/modern_cluiframes.cpp
+++ b/plugins/Clist_modern/src/modern_cluiframes.cpp
@@ -1744,11 +1744,11 @@ static int CLUIFramesLoadMainMenu()
// create root menu
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIF_ICONFROMICOLIB | CMIF_ROOTHANDLE;
- mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_MIRANDA);
+ mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_FRAME);
mi.position = 3000090000;
mi.pszName = LPGEN("Frames");
_hmiRoot = Menu_AddMainMenuItem(&mi);
- DestroyIcon_protect(mi.hIcon);
+
// create frames menu
int separator = 3000200000;
for (int i=0; i < g_nFramesCount; i++) {
diff --git a/plugins/Clist_modern/src/modern_framesmenu.cpp b/plugins/Clist_modern/src/modern_framesmenu.cpp
index dba4a3eb30..bb46b58083 100644
--- a/plugins/Clist_modern/src/modern_framesmenu.cpp
+++ b/plugins/Clist_modern/src/modern_framesmenu.cpp
@@ -1,7 +1,7 @@
#include "hdr/modern_commonheaders.h"
#include "hdr/modern_commonprototypes.h"
-// == == == == == == == == == == == == == Frames
+//========================== Frames
HANDLE hFrameMenuObject;
//contactmenu exec param(ownerdata)
@@ -13,20 +13,11 @@ typedef struct{
}
FrameMenuExecParam,*lpFrameMenuExecParam;
-void FreeAndNil( void **p )
+static INT_PTR AddContextFrameMenuItem(WPARAM wParam, LPARAM lParam)
{
- if ( p == NULL )
- return;
-
- if ( *p != NULL ) {
- mir_free( *p );
- *p = NULL;
-} }
+ CLISTMENUITEM *mi = (CLISTMENUITEM*)lParam;
-static INT_PTR AddContextFrameMenuItem(WPARAM wParam,LPARAM lParam)
-{
TMO_MenuItem tmi;
- CLISTMENUITEM *mi = (CLISTMENUITEM*)lParam;
if ( !pcli->pfnConvertMenu(mi, &tmi))
return NULL;
@@ -41,21 +32,20 @@ static INT_PTR AddContextFrameMenuItem(WPARAM 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 CallService(MO_ADDNEWMENUITEM, (WPARAM)hFrameMenuObject, (LPARAM)&tmi);
}
-static INT_PTR RemoveContextFrameMenuItem(WPARAM wParam,LPARAM lParam)
+static INT_PTR RemoveContextFrameMenuItem(WPARAM wParam, LPARAM lParam)
{
- lpFrameMenuExecParam fmep = (lpFrameMenuExecParam)CallService(MO_MENUITEMGETOWNERDATA,wParam,lParam);
- if (fmep != NULL){
+ lpFrameMenuExecParam fmep = (lpFrameMenuExecParam)CallService(MO_MENUITEMGETOWNERDATA, wParam, lParam);
+ if (fmep != NULL) {
if (fmep->szServiceName != NULL)
mir_free(fmep->szServiceName);
mir_free(fmep);
}
if (lParam != 1)
- CallService(MO_REMOVEMENUITEM,wParam,0);
+ CallService(MO_REMOVEMENUITEM, wParam, 0);
return 0;
}
@@ -63,40 +53,40 @@ static INT_PTR RemoveContextFrameMenuItem(WPARAM wParam,LPARAM lParam)
//called with:
//wparam - ownerdata
//lparam - lparam from winproc
-INT_PTR FrameMenuExecService(WPARAM wParam,LPARAM lParam) {
+INT_PTR FrameMenuExecService(WPARAM wParam, LPARAM lParam)
+{
lpFrameMenuExecParam fmep = (lpFrameMenuExecParam)wParam;
- if (fmep == NULL){return(-1);};
- CallService(fmep->szServiceName,lParam,fmep->param1);
+ if (fmep ==NULL)
+ return -1;
+ CallService(fmep->szServiceName, lParam, fmep->param1);
return 0;
-};
+}
//true - ok,false ignore
-INT_PTR FrameMenuCheckService(WPARAM wParam,LPARAM lParam) {
-
+INT_PTR FrameMenuCheckService(WPARAM wParam, LPARAM lParam)
+{
PCheckProcParam pcpp = (PCheckProcParam)wParam;
- lpFrameMenuExecParam fmep;
- TMO_MenuItem mi;
+ if (pcpp == NULL)
+ return FALSE;
- if (pcpp == NULL){return(FALSE);};
- if (CallService(MO_GETMENUITEM,(WPARAM)pcpp->MenuItemHandle,(LPARAM)&mi) == 0)
- {
- fmep = (lpFrameMenuExecParam)mi.ownerdata;
- if (fmep != NULL)
- {
+ TMO_MenuItem mi;
+ if ( CallService(MO_GETMENUITEM, (WPARAM)pcpp->MenuItemHandle, (LPARAM)&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);
-};
+ if (((WPARAM)fmep->Frameid == pcpp->wParam) || fmep->Frameid == -1)
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
-static INT_PTR ContextFrameMenuNotify(WPARAM wParam,LPARAM lParam)
+static INT_PTR ContextFrameMenuNotify(WPARAM wParam, LPARAM lParam)
{
- NotifyEventHooks(g_CluiData.hEventPreBuildFrameMenu,wParam,lParam);
+ NotifyEventHooks(g_CluiData.hEventPreBuildFrameMenu, wParam, lParam);
return 0;
-};
+}
static INT_PTR BuildContextFrameMenu(WPARAM wParam,LPARAM lParam)
{
@@ -106,81 +96,62 @@ static INT_PTR BuildContextFrameMenu(WPARAM wParam,LPARAM lParam)
param.lParam = lParam;
HMENU hMenu = CreatePopupMenu();
- //NotifyEventHooks(hPreBuildFrameMenuEvent,wParam,-1);
- ContextFrameMenuNotify(wParam,-1);
- CallService(MO_BUILDMENU,(WPARAM)hMenu,(LPARAM)&param);
+ ContextFrameMenuNotify(wParam, -1);
+ CallService(MO_BUILDMENU, (WPARAM)hMenu, (LPARAM)&param);
return (INT_PTR)hMenu;
}
-// == == == == == == == == == == == == == Frames end
+//========================== Frames end
bool InternalGenMenuModule = FALSE;
-int MeasureItemProxy(WPARAM wParam,LPARAM lParam) {
-
- int val;
- if (InternalGenMenuModule)
- {
-
- val = CallService(MS_INT_MENUMEASUREITEM,wParam,lParam);
- if (val) return(val);
- };
- return CallService(MS_CLIST_MENUMEASUREITEM,wParam,lParam);
-
-
-};
-
-
-int DrawItemProxy(WPARAM wParam,LPARAM lParam) {
- if (InternalGenMenuModule)
- {
- int val;
- val = CallService(MS_INT_MENUDRAWITEM,wParam,lParam);
- if (val) return(val);
+int MeasureItemProxy(WPARAM wParam, LPARAM lParam)
+{
+ if (InternalGenMenuModule) {
+ int val = CallService(MS_INT_MENUMEASUREITEM, wParam, lParam);
+ if (val)
+ return val;
}
- return CallService(MS_CLIST_MENUDRAWITEM,wParam,lParam);
-
-};
-
-
+ return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam);
+}
-int ProcessCommandProxy(WPARAM wParam,LPARAM lParam) {
- if (InternalGenMenuModule)
- {
- int val;
- val = CallService(MS_INT_MENUPROCESSCOMMAND,wParam,lParam);
- if (val) return(val);
- };
+int DrawItemProxy(WPARAM wParam, LPARAM lParam)
+{
+ if (InternalGenMenuModule) {
+ int val = CallService(MS_INT_MENUDRAWITEM, wParam, lParam);
+ if (val)
+ return val;
+ }
+ return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam);
+}
+int ProcessCommandProxy(WPARAM wParam, LPARAM lParam)
+{
+ if (InternalGenMenuModule) {
+ int val = CallService(MS_INT_MENUPROCESSCOMMAND, wParam, lParam);
+ if (val)
+ return val;
+ }
return CallService(MS_CLIST_MENUPROCESSCOMMAND,wParam,lParam);
+}
-};
-
-int ModifyMenuItemProxy(WPARAM wParam,LPARAM lParam) {
- if (InternalGenMenuModule)
- {
- int val;
- val = CallService(MS_INT_MODIFYMENUITEM,wParam,lParam);
- if (val) return(val);
- };
-
+int ModifyMenuItemProxy(WPARAM wParam, LPARAM lParam)
+{
+ if (InternalGenMenuModule) {
+ int val = CallService(MS_INT_MODIFYMENUITEM, wParam, lParam);
+ if (val)
+ return val;
+ }
return CallService(MS_CLIST_MODIFYMENUITEM,wParam,lParam);
-
-};
-
+}
int InitFramesMenus(void)
{
- TMenuParam tmp;
-
- if ( !ServiceExists(MO_REMOVEMENUOBJECT))
- {
-
- InitCustomMenus();
+ if ( !ServiceExists(MO_REMOVEMENUOBJECT)) {
+ InitCustomMenus();
InternalGenMenuModule = TRUE;
- };
+ }
- if ( ServiceExists(MO_REMOVEMENUOBJECT))
- {
+ if ( ServiceExists(MO_REMOVEMENUOBJECT)) {
CreateServiceFunction("FrameMenuExecService",FrameMenuExecService);
CreateServiceFunction("FrameMenuCheckService",FrameMenuCheckService);
@@ -188,27 +159,18 @@ int InitFramesMenus(void)
CreateServiceFunction("CList/AddContextFrameMenuItem",AddContextFrameMenuItem);
CreateServiceFunction(MS_CLIST_MENUBUILDFRAMECONTEXT,BuildContextFrameMenu);
CreateServiceFunction(MS_CLIST_FRAMEMENUNOTIFY,ContextFrameMenuNotify);
-
//frame menu object
- memset(&tmp,0,sizeof(tmp));
- tmp.cbSize = sizeof(tmp);
+ TMenuParam tmp = { sizeof(tmp) };
tmp.CheckService = "FrameMenuCheckService";
tmp.ExecService = "FrameMenuExecService";
tmp.name = "FrameMenu";
- hFrameMenuObject = (HANDLE)CallService(MO_CREATENEWMENUOBJECT,0,(LPARAM)&tmp);
+ hFrameMenuObject = (HANDLE)CallService(MO_CREATENEWMENUOBJECT, 0, (LPARAM)&tmp);
}
return 0;
}
+
int UnitFramesMenu()
{
-
- /*
- if ( ServiceExists(MO_REMOVEMENUOBJECT))
- {
- CallService(MO_REMOVEMENUOBJECT,hFrameMenuObject,0);
- if (InternalGenMenuModule){UnitGenMenu();};
- };
- */
return 0;
-};
+}
diff --git a/plugins/Clist_modern/src/modern_groupmenu.cpp b/plugins/Clist_modern/src/modern_groupmenu.cpp
index 454459ff0b..4b265c382d 100644
--- a/plugins/Clist_modern/src/modern_groupmenu.cpp
+++ b/plugins/Clist_modern/src/modern_groupmenu.cpp
@@ -160,11 +160,10 @@ INT_PTR GroupMenuExecService(WPARAM wParam,LPARAM lParam)
INT_PTR FreeOwnerDataGroupMenu (WPARAM wParam,LPARAM lParam)
{
- lpGroupMenuExecParam mmep;
- mmep = (lpGroupMenuExecParam)lParam;
- if (mmep != NULL){
- FreeAndNil((void **)&mmep->szServiceName);
- FreeAndNil((void **)&mmep);
+ lpGroupMenuExecParam mmep = (lpGroupMenuExecParam)lParam;
+ if (mmep != NULL) {
+ mir_free(mmep->szServiceName);
+ mir_free(mmep);
}
return 0;
@@ -298,70 +297,44 @@ void GroupMenus_Init(void)
mi.pszName = LPGEN("E&xit");
mi.flags = CMIF_ICONFROMICOLIB;
AddGroupMenuItem(0,(LPARAM)&mi);
- DestroyIcon_protect(mi.hIcon);
- memset(&mi,0,sizeof(mi));
- mi.cbSize = sizeof(mi);
mi.position = 500;
mi.pszService = MS_CLIST_SHOWHIDE;
mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_SHOWHIDE);
mi.pszName = LPGEN("&Hide/Show");
- mi.flags = CMIF_ICONFROMICOLIB;
hHideShowMainMenuItem = (HANDLE)AddGroupMenuItem(0,(LPARAM)&mi);
- DestroyIcon_protect(mi.hIcon);
- memset(&mi,0,sizeof(mi));
- mi.cbSize = sizeof(mi);
mi.position = 200000;
- mi.flags = CMIF_ICONFROMICOLIB;
mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_FINDUSER);
mi.pszService = "FindAdd/FindAddCommand";
mi.pszName = LPGEN("&Find/Add Contacts...");
AddGroupMenuItem(0,(LPARAM)&mi);
- DestroyIcon_protect(mi.hIcon);
- memset(&mi,0,sizeof(mi));
- mi.cbSize = sizeof(mi);
mi.position = 300000;
mi.pszService = "";
mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_MAINMENU); // eternity #004
mi.pszName = LPGEN("&Main Menu");
- mi.flags = CMIF_ICONFROMICOLIB; // eternity #004
hGroupMainMenuItemProxy = (HANDLE)AddGroupMenuItem(0,(LPARAM)&mi);
- DestroyIcon_protect(mi.hIcon); // eternity #004
- memset(&mi,0,sizeof(mi));
- mi.cbSize = sizeof(mi);
mi.position = 300100;
mi.pszService = "";
mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_STATUS); // eternity #004
mi.pszName = LPGEN("&Status");
- mi.flags = CMIF_ICONFROMICOLIB; // eternity #004
hGroupStatusMenuItemProxy = (HANDLE)AddGroupMenuItem(0,(LPARAM)&mi);
- DestroyIcon_protect(mi.hIcon); // eternity #004
- memset(&mi,0,sizeof(mi));
- mi.cbSize = sizeof(mi);
mi.position = 400000;
- mi.flags = CMIF_ICONFROMICOLIB;
mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_OPTIONS);
mi.pszService = "Options/OptionsCommand";
mi.pszName = LPGEN("&Options...");
- AddGroupMenuItem(0,(LPARAM)&mi);
- DestroyIcon_protect(mi.hIcon);
+ AddGroupMenuItem(0, (LPARAM)&mi);
- memset(&mi,0,sizeof(mi));
- mi.cbSize = sizeof(mi);
mi.position = 500000;
- mi.flags = CMIF_ICONFROMICOLIB;
mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_MIRANDA);
mi.pszService = "Help/AboutCommand";
mi.pszName = LPGEN("&About");
- AddGroupMenuItem(0,(LPARAM)&mi);
- DestroyIcon_protect(mi.hIcon);
+ AddGroupMenuItem(0, (LPARAM)&mi);
- memset(&mi,0,sizeof(mi));
- mi.cbSize = sizeof(mi);
+ mi.flags = 0;
mi.position = 100000;
mi.hIcon = ske_ImageList_GetIcon(hCListImages,NewGroupIconidx,0);
mi.pszService = "CLISTMENUSGroup/CreateGroupHelper";
@@ -369,40 +342,29 @@ void GroupMenus_Init(void)
hNewGroupMenuItem = (HANDLE)AddGroupMenuItem(0,(LPARAM)&mi);
DestroyIcon_protect(mi.hIcon);
- 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 = (HANDLE)AddGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
+ hHideOfflineUsersMenuItem = (HANDLE)AddGroupMenuItem((WPARAM)&gmp, (LPARAM)&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 = (HANDLE)AddGroupMenuItem(0,(LPARAM)&mi);
+ hHideOfflineUsersOutHereMenuItem = (HANDLE)AddGroupMenuItem(0, (LPARAM)&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 = (HANDLE)AddGroupMenuItem(0,(LPARAM)&mi);
+ hHideEmptyGroupsMenuItem = (HANDLE)AddGroupMenuItem(0, (LPARAM)&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 = (HANDLE)AddGroupMenuItem(0,(LPARAM)&mi);
+ hDisableGroupsMenuItem = (HANDLE)AddGroupMenuItem(0, (LPARAM)&mi);
- HookEvent(ME_SKIN2_ICONSCHANGED,OnIconLibIconChanged);
+ HookEvent(ME_SKIN2_ICONSCHANGED, OnIconLibIconChanged);
}
//////////////////////////////END Group MENU/////////////////////////
@@ -558,8 +520,8 @@ INT_PTR FreeOwnerDataSubGroupMenu (WPARAM wParam,LPARAM lParam)
{
lpSubGroupMenuExecParam mmep = (lpSubGroupMenuExecParam)lParam;
if (mmep != NULL){
- FreeAndNil((void **)&mmep->szServiceName);
- FreeAndNil((void **)&mmep);
+ mir_free(mmep->szServiceName);
+ mir_free(mmep);
}
return 0;
diff --git a/plugins/Clist_modern/src/modern_statusbar.cpp b/plugins/Clist_modern/src/modern_statusbar.cpp
index 086b979ca8..c80e2c85e6 100644
--- a/plugins/Clist_modern/src/modern_statusbar.cpp
+++ b/plugins/Clist_modern/src/modern_statusbar.cpp
@@ -976,7 +976,7 @@ HWND StatusBar_Create(HWND parent)
Frame.cbSize = sizeof(CLISTFrame);
Frame.hWnd = hModernStatusBar;
Frame.align = alBottom;
- Frame.hIcon = LoadSkinnedIcon (SKINICON_OTHER_MIRANDA);
+ Frame.hIcon = LoadSkinnedIcon (SKINICON_OTHER_FRAME);
Frame.Flags = (db_get_b(NULL,"CLUI","ShowSBar",SETTING_SHOWSBAR_DEFAULT)?F_VISIBLE:0)|F_LOCKED|F_NOBORDER|F_NO_SUBCONTAINER|F_TCHAR;
Frame.height = h;
Frame.tname = _T("Status Bar");
diff --git a/plugins/Clist_modern/src/modern_toolbar.cpp b/plugins/Clist_modern/src/modern_toolbar.cpp
index 4088d6d2dc..0f8532bc5a 100644
--- a/plugins/Clist_modern/src/modern_toolbar.cpp
+++ b/plugins/Clist_modern/src/modern_toolbar.cpp
@@ -298,7 +298,7 @@ void CustomizeToolbar(HWND hwnd)
Frame.align = alTop;
Frame.Flags = F_VISIBLE | F_NOBORDER | F_LOCKED | F_TCHAR | F_NO_SUBCONTAINER;
Frame.height = 18;
- Frame.hIcon = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);
+ Frame.hIcon = LoadSkinnedIcon(SKINICON_OTHER_FRAME);
pMTBInfo->hFrame = (HANDLE)CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&Frame, 0);
CallService(MS_SKINENG_REGISTERPAINTSUB,(WPARAM)hwnd,(LPARAM)ToolBar_LayeredPaintProc);
diff --git a/plugins/Clist_modern/src/modern_viewmodebar.cpp b/plugins/Clist_modern/src/modern_viewmodebar.cpp
index 68f5ca0aca..0162d589af 100644
--- a/plugins/Clist_modern/src/modern_viewmodebar.cpp
+++ b/plugins/Clist_modern/src/modern_viewmodebar.cpp
@@ -1315,7 +1315,7 @@ void CreateViewModeFrame()
ZeroMemory(&frame, sizeof(frame));
frame.cbSize = sizeof(frame);
frame.tname = _T("View modes");
- frame.hIcon = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);/*0;*/
+ frame.hIcon = LoadSkinnedIcon(SKINICON_OTHER_FRAME);
frame.height = 18;
frame.TBtname = TranslateT("View Modes");
frame.Flags = F_VISIBLE|F_SHOWTBTIP|F_NOBORDER|F_NO_SUBCONTAINER|F_TCHAR;