diff options
author | George Hazan <george.hazan@gmail.com> | 2016-09-02 15:00:54 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-09-02 15:00:54 +0000 |
commit | 6a2895b7cc2eabdd975ace83ce5dc5f8c0d6f88f (patch) | |
tree | 4b0447e0fccf3989dd61ca9a586d3f2d198dcebe /src | |
parent | cd045c23540a1a18886b1886f20aaa30b7f586c1 (diff) |
- three remaining clist services converted into functions (Clist_MenuProcessCommand, Clist_IsDocked, Clist_MenuProcessHotkey);
- old unused junk removed from CLIST_INTERFACE with its stubs;
- all unused clist services also removed with bunch of another crap like unused params
git-svn-id: http://svn.miranda-ng.org/main/trunk@17243 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
-rw-r--r-- | src/core/stdfile/src/filerecvdlg.cpp | 2 | ||||
-rw-r--r-- | src/core/stdfile/src/filesenddlg.cpp | 2 | ||||
-rw-r--r-- | src/core/stdfile/src/filexferdlg.cpp | 2 | ||||
-rw-r--r-- | src/core/stdmsg/src/msgdialog.cpp | 2 | ||||
-rw-r--r-- | src/mir_app/src/Docking.cpp | 4 | ||||
-rw-r--r-- | src/mir_app/src/clc.cpp | 4 | ||||
-rw-r--r-- | src/mir_app/src/clc.h | 10 | ||||
-rw-r--r-- | src/mir_app/src/clistcore.cpp | 5 | ||||
-rw-r--r-- | src/mir_app/src/clistmod.cpp | 12 | ||||
-rw-r--r-- | src/mir_app/src/clisttray.cpp | 4 | ||||
-rw-r--r-- | src/mir_app/src/clui.cpp | 21 | ||||
-rw-r--r-- | src/mir_app/src/keyboard.cpp | 22 | ||||
-rw-r--r-- | src/mir_app/src/menu_clist.cpp | 61 | ||||
-rw-r--r-- | src/mir_app/src/menu_tray.cpp | 8 | ||||
-rw-r--r-- | src/mir_app/src/meta_services.cpp | 2 | ||||
-rw-r--r-- | src/mir_app/src/mir_app.def | 3 | ||||
-rw-r--r-- | src/mir_app/src/mir_app64.def | 3 |
17 files changed, 66 insertions, 101 deletions
diff --git a/src/core/stdfile/src/filerecvdlg.cpp b/src/core/stdfile/src/filerecvdlg.cpp index 660b717bae..1d155b1544 100644 --- a/src/core/stdfile/src/filerecvdlg.cpp +++ b/src/core/stdfile/src/filerecvdlg.cpp @@ -286,7 +286,7 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l return Menu_DrawItem((LPDRAWITEMSTRUCT)lParam);
case WM_COMMAND:
- if (CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(wParam), MPCF_CONTACTMENU), (LPARAM)dat->hContact))
+ if (Clist_MenuProcessCommand(LOWORD(wParam), MPCF_CONTACTMENU, dat->hContact))
break;
switch (LOWORD(wParam)) {
diff --git a/src/core/stdfile/src/filesenddlg.cpp b/src/core/stdfile/src/filesenddlg.cpp index 3148d36c59..ccfc68af3f 100644 --- a/src/core/stdfile/src/filesenddlg.cpp +++ b/src/core/stdfile/src/filesenddlg.cpp @@ -281,7 +281,7 @@ INT_PTR CALLBACK DlgProcSendFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l break;
case WM_COMMAND:
- if (CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(wParam), MPCF_CONTACTMENU), (LPARAM)dat->hContact))
+ if (Clist_MenuProcessCommand(LOWORD(wParam), MPCF_CONTACTMENU, dat->hContact))
break;
switch (LOWORD(wParam)) {
diff --git a/src/core/stdfile/src/filexferdlg.cpp b/src/core/stdfile/src/filexferdlg.cpp index 810587b75e..cfb958c689 100644 --- a/src/core/stdfile/src/filexferdlg.cpp +++ b/src/core/stdfile/src/filexferdlg.cpp @@ -344,7 +344,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR if (!dat) break; - if (CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(wParam), MPCF_CONTACTMENU), (LPARAM)dat->hContact)) + if (Clist_MenuProcessCommand(LOWORD(wParam), MPCF_CONTACTMENU, dat->hContact)) break; switch (LOWORD(wParam)) { diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index 2c335fec1a..2286d0c5a1 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -1334,7 +1334,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l break;
case WM_COMMAND:
- if (!lParam && CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(wParam), MPCF_CONTACTMENU), (LPARAM)dat->hContact))
+ if (!lParam && Clist_MenuProcessCommand(LOWORD(wParam), MPCF_CONTACTMENU, dat->hContact))
break;
switch (LOWORD(wParam)) {
diff --git a/src/mir_app/src/Docking.cpp b/src/mir_app/src/Docking.cpp index e4e095662c..8085cfa075 100644 --- a/src/mir_app/src/Docking.cpp +++ b/src/mir_app/src/Docking.cpp @@ -32,7 +32,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define DOCKED_LEFT 1
#define DOCKED_RIGHT 2
-static char docked;
+static int docked;
static POINT dockPos;
static void Docking_GetMonitorRectFromPoint(LPPOINT pt, LPRECT rc)
@@ -127,7 +127,7 @@ static bool Docking_IsWindowVisible(HWND hwnd) return style & WS_VISIBLE && !(style & WS_MINIMIZE);
}
-INT_PTR Docking_IsDocked(WPARAM, LPARAM)
+MIR_APP_DLL(BOOL) Clist_IsDocked()
{
return docked;
}
diff --git a/src/mir_app/src/clc.cpp b/src/mir_app/src/clc.cpp index 4bbccb844b..872a099390 100644 --- a/src/mir_app/src/clc.cpp +++ b/src/mir_app/src/clc.cpp @@ -678,7 +678,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam cli.pfnHideInfoTip(hwnd, dat);
KillTimer(hwnd, TIMERID_INFOTIP);
KillTimer(hwnd, TIMERID_RENAME);
- if (!CallService(MS_CLIST_MENUPROCESSHOTKEY, wParam, MPCF_CONTACTMENU)) {
+ if (!Clist_MenuProcessHotkey(wParam)) {
RECT clRect;
GetClientRect(hwnd, &clRect);
int pageSize = clRect.bottom / dat->rowHeight;
@@ -1236,7 +1236,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam break;
if (contact->type == CLCIT_CONTACT)
- if (CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(wParam), MPCF_CONTACTMENU), contact->hContact))
+ if (Clist_MenuProcessCommand(LOWORD(wParam), MPCF_CONTACTMENU, contact->hContact))
break;
if (contact->type == CLCIT_GROUP) {
diff --git a/src/mir_app/src/clc.h b/src/mir_app/src/clc.h index 3783f8ba2f..ab06801d8e 100644 --- a/src/mir_app/src/clc.h +++ b/src/mir_app/src/clc.h @@ -119,8 +119,6 @@ int fnGetAccountIndexByPos(int Pos); int fnGetProtoIndexByPos(PROTOCOLDESCRIPTOR **proto, int protoCnt, int Pos);
void RebuildMenuOrder(void);
-INT_PTR MenuProcessCommand(WPARAM wParam, LPARAM lParam);
-
/* clistsettings.c */
wchar_t* fnGetContactDisplayName(MCONTACT hContact, int mode);
void fnGetDefaultFontSetting(int i, LOGFONT* lf, COLORREF * colour);
@@ -149,7 +147,7 @@ int fnRemoveEvent(MCONTACT hContact, MEVENT dbEvent); /* clistmod.c */
int fnGetContactIcon(MCONTACT hContact);
int fnIconFromStatusMode(const char *szProto, int status, MCONTACT hContact);
-int fnShowHide(WPARAM wParam, LPARAM lParam);
+int fnShowHide(void);
HICON fnGetIconFromStatusMode(MCONTACT hContact, const char *szProto, int status);
wchar_t* fnGetStatusModeDescription(int wParam, int lParam);
int fnGetWindowVisibleState(HWND hWnd, int iStepX, int iStepY);
@@ -191,9 +189,3 @@ int fnSetHideOffline(int iValue); /* docking.c */
int fnDocking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam);
-
-/* keyboard.c */
-int fnHotKeysRegister(HWND hwnd);
-void fnHotKeysUnregister(HWND hwnd);
-int fnHotKeysProcess(HWND hwnd, WPARAM wParam, LPARAM lParam);
-int fnHotkeysProcessMessage(WPARAM wParam, LPARAM lParam);
diff --git a/src/mir_app/src/clistcore.cpp b/src/mir_app/src/clistcore.cpp index ed68859386..0f232a662e 100644 --- a/src/mir_app/src/clistcore.cpp +++ b/src/mir_app/src/clistcore.cpp @@ -194,11 +194,6 @@ static INT_PTR srvRetrieveInterface(WPARAM, LPARAM) cli.pfnShowHide = fnShowHide;
cli.pfnGetStatusModeDescription = fnGetStatusModeDescription;
- cli.pfnHotKeysRegister = fnHotKeysRegister;
- cli.pfnHotKeysUnregister = fnHotKeysUnregister;
- cli.pfnHotKeysProcess = fnHotKeysProcess;
- cli.pfnHotkeysProcessMessage = fnHotkeysProcessMessage;
-
cli.pfnGetProtocolVisibility = fnGetProtocolVisibility;
cli.pfnGetProtoIndexByPos = fnGetProtoIndexByPos;
cli.pfnReloadProtoMenus = fnReloadProtoMenus;
diff --git a/src/mir_app/src/clistmod.cpp b/src/mir_app/src/clistmod.cpp index 9b39a4f170..edba951768 100644 --- a/src/mir_app/src/clistmod.cpp +++ b/src/mir_app/src/clistmod.cpp @@ -291,7 +291,7 @@ int fnGetWindowVisibleState(HWND hWnd, int iStepX, int iStepY) if (IsIconic(hWnd) || !IsWindowVisible(hWnd))
return GWVS_HIDDEN;
- if (CallService(MS_CLIST_DOCKINGISDOCKED, 0, 0))
+ if (Clist_IsDocked())
return GWVS_VISIBLE;
GetWindowRect(hWnd, &rcWin);
@@ -333,7 +333,7 @@ int fnGetWindowVisibleState(HWND hWnd, int iStepX, int iStepY) return GWVS_PARTIALLY_COVERED;
}
-int fnShowHide(WPARAM, LPARAM)
+int fnShowHide()
{
BOOL bShow = FALSE;
@@ -411,10 +411,6 @@ static INT_PTR CompareContacts(WPARAM wParam, LPARAM lParam) /***************************************************************************************/
-static INT_PTR ShowHideStub(WPARAM wParam, LPARAM lParam) { return cli.pfnShowHide(wParam, lParam); }
-static INT_PTR Docking_ProcessWindowMessageStub(WPARAM wParam, LPARAM lParam) { return cli.pfnDocking_ProcessWindowMessage(wParam, lParam); }
-static INT_PTR HotkeysProcessMessageStub(WPARAM wParam, LPARAM lParam) { return cli.pfnHotkeysProcessMessage(wParam, lParam); }
-
int LoadContactListModule2(void)
{
HookEvent(ME_SYSTEM_MODULESLOADED, ContactListModulesLoaded);
@@ -431,10 +427,6 @@ int LoadContactListModule2(void) CreateServiceFunction(MS_CLIST_CONTACTFILESDROPPED, ContactFilesDropped);
CreateServiceFunction(MS_CLIST_CONTACTSCOMPARE, CompareContacts);
CreateServiceFunction(MS_CLIST_CONTACTCHANGEGROUP, ContactChangeGroup);
- CreateServiceFunction(MS_CLIST_SHOWHIDE, ShowHideStub);
- CreateServiceFunction(MS_CLIST_DOCKINGPROCESSMESSAGE, Docking_ProcessWindowMessageStub);
- CreateServiceFunction(MS_CLIST_DOCKINGISDOCKED, Docking_IsDocked);
- CreateServiceFunction(MS_CLIST_HOTKEYSPROCESSMESSAGE, HotkeysProcessMessageStub);
InitCListEvents();
InitGroupServices();
diff --git a/src/mir_app/src/clisttray.cpp b/src/mir_app/src/clisttray.cpp index 5254bb9372..1b58b6647e 100644 --- a/src/mir_app/src/clisttray.cpp +++ b/src/mir_app/src/clisttray.cpp @@ -675,7 +675,7 @@ INT_PTR fnTrayIconProcessMessage(WPARAM wParam, LPARAM lParam) }
if (msg->lParam == WM_MBUTTONUP)
- cli.pfnShowHide(0, 0);
+ cli.pfnShowHide();
else if (msg->lParam == (db_get_b(NULL, "CList", "Tray1Click", SETTING_TRAY1CLICK_DEFAULT) ? WM_LBUTTONUP : WM_LBUTTONDBLCLK)) {
if ((GetAsyncKeyState(VK_CONTROL) & 0x8000)) {
POINT pt;
@@ -710,7 +710,7 @@ INT_PTR fnTrayIconProcessMessage(WPARAM wParam, LPARAM lParam) TrackPopupMenu(hMenu, TPM_TOPALIGN | TPM_LEFTALIGN | TPM_LEFTBUTTON, pt.x, pt.y, 0, msg->hwnd, NULL);
}
else if (cli.pfnEventsProcessTrayDoubleClick(msg->wParam))
- cli.pfnShowHide(0, 0);
+ cli.pfnShowHide();
}
else if (msg->lParam == WM_RBUTTONUP) {
HMENU hMenu = Menu_BuildTrayMenu();
diff --git a/src/mir_app/src/clui.cpp b/src/mir_app/src/clui.cpp index 8f6d32b2e7..6c474e04cd 100644 --- a/src/mir_app/src/clui.cpp +++ b/src/mir_app/src/clui.cpp @@ -231,8 +231,6 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l return result;
if (cli.pfnTrayIconProcessMessage((WPARAM)&m, (LPARAM)&result))
return result;
- if (cli.pfnHotkeysProcessMessage((WPARAM)&m, (LPARAM)&result))
- return result;
return cli.pfnContactListWndProc(hwnd, msg, wParam, lParam);
}
@@ -534,7 +532,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM GetWindowRect(hwnd, &rc);
//if docked, dont remember pos (except for width)
- if (!CallService(MS_CLIST_DOCKINGISDOCKED, 0, 0)) {
+ if (!Clist_IsDocked()) {
db_set_dw(NULL, "CList", "Height", (DWORD)(rc.bottom - rc.top));
db_set_dw(NULL, "CList", "x", (DWORD)rc.left);
db_set_dw(NULL, "CList", "y", (DWORD)rc.top);
@@ -684,7 +682,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM return DefWindowProc(hwnd, msg, wParam, lParam);
case WM_COMMAND:
- if (CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(wParam), MPCF_MAINMENU), (LPARAM)(HANDLE)NULL))
+ if (Clist_MenuProcessCommand(LOWORD(wParam), MPCF_MAINMENU, 0))
break;
switch (LOWORD(wParam)) {
@@ -695,7 +693,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM break;
case ID_TRAY_HIDE:
- CallService(MS_CLIST_SHOWHIDE, 0, 0);
+ cli.pfnShowHide();
break;
case POPUP_NEWGROUP:
@@ -720,13 +718,13 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM break;
case POPUP_HIDEMIRANDA:
- CallService(MS_CLIST_SHOWHIDE, 0, 0);
+ cli.pfnShowHide();
break;
}
return FALSE;
case WM_KEYDOWN:
- CallService(MS_CLIST_MENUPROCESSHOTKEY, wParam, MPCF_MAINMENU | MPCF_CONTACTMENU);
+ Clist_MenuProcessHotkey(wParam);
break;
case WM_GETMINMAXINFO:
@@ -736,8 +734,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM return 0;
case WM_SETTINGCHANGE:
- if (wParam == SPI_SETWORKAREA && (GetWindowLongPtr(hwnd, GWL_STYLE) & (WS_VISIBLE | WS_MINIMIZE)) == WS_VISIBLE &&
- !CallService(MS_CLIST_DOCKINGISDOCKED, 0, 0)) {
+ if (wParam == SPI_SETWORKAREA && (GetWindowLongPtr(hwnd, GWL_STYLE) & (WS_VISIBLE | WS_MINIMIZE)) == WS_VISIBLE && !Clist_IsDocked()) {
RECT rc;
GetWindowRect(hwnd, &rc);
if (Utils_AssertInsideScreen(&rc) == 1)
@@ -792,7 +789,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM return FALSE;
case NM_KEYDOWN:
- return CallService(MS_CLIST_MENUPROCESSHOTKEY, ((NMKEY*)lParam)->nVKey, MPCF_MAINMENU | MPCF_CONTACTMENU);
+ return Clist_MenuProcessHotkey(((NMKEY*)lParam)->nVKey);
case CLN_LISTSIZECHANGE:
{
@@ -801,7 +798,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM if (!db_get_b(NULL, "CLUI", "AutoSize", 0))
break;
- if (CallService(MS_CLIST_DOCKINGISDOCKED, 0, 0))
+ if (Clist_IsDocked())
break;
maxHeight = db_get_b(NULL, "CLUI", "MaxSizeHeight", 75);
GetWindowRect(hwnd, &rcWindow);
@@ -1025,7 +1022,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM GetWindowRect(hwnd, &rc);
//if docked, dont remember pos (except for width)
- if (!CallService(MS_CLIST_DOCKINGISDOCKED, 0, 0)) {
+ if (!Clist_IsDocked()) {
db_set_dw(NULL, "CList", "Height", (DWORD)(rc.bottom - rc.top));
db_set_dw(NULL, "CList", "x", (DWORD)rc.left);
db_set_dw(NULL, "CList", "y", (DWORD)rc.top);
diff --git a/src/mir_app/src/keyboard.cpp b/src/mir_app/src/keyboard.cpp index fbda9d07bf..0a501b7f63 100644 --- a/src/mir_app/src/keyboard.cpp +++ b/src/mir_app/src/keyboard.cpp @@ -28,7 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. static INT_PTR hkHideShow(WPARAM, LPARAM)
{
- cli.pfnShowHide(0, 0);
+ cli.pfnShowHide();
return 0;
}
@@ -90,23 +90,3 @@ int InitClistHotKeys(void) Hotkey_Register(&shk);
return 0;
}
-
-
-int fnHotKeysRegister(HWND)
-{
- return 0;
-}
-
-void fnHotKeysUnregister(HWND)
-{
-}
-
-int fnHotKeysProcess(HWND, WPARAM, LPARAM)
-{
- return TRUE;
-}
-
-int fnHotkeysProcessMessage(WPARAM, LPARAM)
-{
- return FALSE;
-}
diff --git a/src/mir_app/src/menu_clist.cpp b/src/mir_app/src/menu_clist.cpp index 524e19b75b..0c8b519402 100644 --- a/src/mir_app/src/menu_clist.cpp +++ b/src/mir_app/src/menu_clist.cpp @@ -642,32 +642,45 @@ INT_PTR FreeOwnerDataStatusMenu(WPARAM, LPARAM lParam) }
/////////////////////////////////////////////////////////////////////////////////////////
-// Other menu functions
+// Global menu functions
-INT_PTR MenuProcessCommand(WPARAM wParam, LPARAM lParam)
+MIR_APP_DLL(BOOL) Clist_MenuProcessCommand(int menu_id, int flags, MCONTACT hContact)
{
- WORD cmd = LOWORD(wParam);
-
- if (HIWORD(wParam) & MPCF_MAINMENU) {
- int hst = LOWORD(wParam);
- if (hst >= ID_STATUS_OFFLINE && hst <= ID_STATUS_OUTTOLUNCH) {
- int pos = statustopos(hst);
+ if (flags & MPCF_MAINMENU) {
+ if (menu_id >= ID_STATUS_OFFLINE && menu_id <= ID_STATUS_OUTTOLUNCH) {
+ int pos = statustopos(menu_id);
if (pos != -1 && hStatusMainMenuHandles != NULL)
- return Menu_ProcessCommand(hStatusMainMenuHandles[pos], lParam);
+ return Menu_ProcessCommand(hStatusMainMenuHandles[pos], hContact);
}
}
- if (!(cmd >= CLISTMENUIDMIN && cmd <= CLISTMENUIDMAX))
- return 0; // DO NOT process ids outside from clist menu id range v0.7.0.27+
+ if (!(menu_id >= CLISTMENUIDMIN && menu_id <= CLISTMENUIDMAX))
+ return false; // DO NOT process ids outside from clist menu id range v0.7.0.27+
// process old menu sys
- if (HIWORD(wParam) & MPCF_CONTACTMENU)
- return MO_ProcessCommandBySubMenuIdent(hContactMenuObject, cmd, lParam);
+ if (flags & MPCF_CONTACTMENU)
+ return MO_ProcessCommandBySubMenuIdent(hContactMenuObject, menu_id, hContact);
// unknown old menu
- return Menu_ProcessCommandById(cmd, lParam);
+ return Menu_ProcessCommandById(menu_id, hContact);
}
+MIR_APP_DLL(BOOL) Clist_MenuProcessHotkey(unsigned vKey)
+{
+ prochotkey = true;
+
+ bool res =
+ Menu_ProcessHotKey(hStatusMenuObject, vKey) ||
+ Menu_ProcessHotKey(hMainMenuObject, vKey);
+
+ prochotkey = false;
+
+ return res;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// Other menu functions
+
BOOL FindMenuHanleByGlobalID(HMENU hMenu, TMO_IntMenuItem *id, MenuItemData* itdat)
{
if (!itdat)
@@ -701,22 +714,9 @@ BOOL FindMenuHanleByGlobalID(HMENU hMenu, TMO_IntMenuItem *id, MenuItemData* itd return FALSE;
}
-static INT_PTR MenuProcessHotkey(WPARAM vKey, LPARAM)
-{
- prochotkey = true;
-
- bool res =
- Menu_ProcessHotKey(hStatusMenuObject, vKey) ||
- Menu_ProcessHotKey(hMainMenuObject, vKey);
-
- prochotkey = false;
-
- return res;
-}
-
static int MenuIconsChanged(WPARAM, LPARAM)
{
- //just rebuild menu
+ // just rebuild menu
RebuildMenuOrder();
cli.pfnCluiProtocolStatusChanged(0, 0);
return 0;
@@ -725,7 +725,7 @@ static int MenuIconsChanged(WPARAM, LPARAM) static INT_PTR SetStatusMode(WPARAM wParam, LPARAM)
{
prochotkey = true;
- MenuProcessCommand(MAKEWPARAM(LOWORD(wParam), MPCF_MAINMENU), 0);
+ Clist_MenuProcessCommand(LOWORD(wParam), MPCF_MAINMENU, 0);
prochotkey = false;
return 0;
}
@@ -1104,9 +1104,6 @@ void InitCustomMenus(void) CreateServiceFunction(MS_CLIST_SETSTATUSMODE, SetStatusMode);
- CreateServiceFunction(MS_CLIST_MENUPROCESSCOMMAND, MenuProcessCommand);
- CreateServiceFunction(MS_CLIST_MENUPROCESSHOTKEY, MenuProcessHotkey);
-
hPreBuildContactMenuEvent = CreateHookableEvent(ME_CLIST_PREBUILDCONTACTMENU);
hPreBuildMainMenuEvent = CreateHookableEvent(ME_CLIST_PREBUILDMAINMENU);
cli.hPreBuildStatusMenuEvent = CreateHookableEvent(ME_CLIST_PREBUILDSTATUSMENU);
diff --git a/src/mir_app/src/menu_tray.cpp b/src/mir_app/src/menu_tray.cpp index 6fa492ba65..2000a51c3c 100644 --- a/src/mir_app/src/menu_tray.cpp +++ b/src/mir_app/src/menu_tray.cpp @@ -96,6 +96,11 @@ static INT_PTR TrayMenuOnAddService(WPARAM wParam, LPARAM lParam) return TRUE;
}
+static INT_PTR ShowHideStub(WPARAM wParam, LPARAM lParam)
+{
+ return cli.pfnShowHide();
+}
+
void InitTrayMenus(void)
{
CreateServiceFunction("CLISTMENUSTRAY/ExecService", TrayMenuExecService);
@@ -116,10 +121,11 @@ void InitTrayMenus(void) SET_UID(mi, 0x6c202553, 0xb4d5, 0x403c, 0xa6, 0x82, 0x2, 0xd8, 0x2b, 0x42, 0xba, 0x9e);
mi.flags = CMIF_DEFAULT;
mi.position = 100000;
- mi.pszService = MS_CLIST_SHOWHIDE;
+ mi.pszService = "CList/ShowHide";
mi.name.a = LPGEN("&Hide/show");
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_SHOWHIDE);
Menu_AddTrayMenuItem(&mi);
+ CreateServiceFunction(mi.pszService, ShowHideStub);
SET_UID(mi, 0x10e9b2f0, 0xeef2, 0x4684, 0xa7, 0xa7, 0xde, 0x7f, 0x2a, 0xb3, 0x5b, 0x30);
mi.flags = 0;
diff --git a/src/mir_app/src/meta_services.cpp b/src/mir_app/src/meta_services.cpp index f42d3de877..3393c14a69 100644 --- a/src/mir_app/src/meta_services.cpp +++ b/src/mir_app/src/meta_services.cpp @@ -668,7 +668,7 @@ static VOID CALLBACK sttMenuThread(PVOID param) tpmp.cbSize = sizeof(tpmp);
BOOL menuRet = TrackPopupMenuEx(hMenu, TPM_RETURNCMD, menuMousePoint.x, menuMousePoint.y, cli.hwndContactList, &tpmp);
- CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(menuRet), MPCF_CONTACTMENU), (LPARAM)param);
+ Clist_MenuProcessCommand(LOWORD(menuRet), MPCF_CONTACTMENU, (INT_PTR)param);
DestroyMenu(hMenu);
}
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index b8ffebf951..832cbb31b9 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -265,3 +265,6 @@ Window_SetSkinIcon_IcoLib @264 Window_SetIcon_IcoLib @265
Clist_Broadcast @266
Clist_BroadcastAsync @267
+Clist_MenuProcessCommand @268
+Clist_IsDocked @269
+Clist_MenuProcessHotkey @270
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index 9ac85f12c7..d4dbb2fe8f 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -265,3 +265,6 @@ Window_SetSkinIcon_IcoLib @264 Window_SetIcon_IcoLib @265
Clist_Broadcast @266
Clist_BroadcastAsync @267
+Clist_MenuProcessCommand @268
+Clist_IsDocked @269
+Clist_MenuProcessHotkey @270
|