From ab4abbb7a60f941acab8f0566c6b619f68f1b489 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 27 Jun 2015 11:09:19 +0000 Subject: - CLISTMENUITEM::pszContactOwner removed, because it's supported only by contact's menu; - Menu_AddContactMenuItem now receives parameter szProto; - Menu_Add* helpers are converted into real functions; git-svn-id: http://svn.miranda-ng.org/main/trunk@14409 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- include/delphi/m_clist.inc | 72 ++++++++++++++-------------------------------- 1 file changed, 22 insertions(+), 50 deletions(-) (limited to 'include/delphi/m_clist.inc') diff --git a/include/delphi/m_clist.inc b/include/delphi/m_clist.inc index 04af0877d9..0183450f3d 100644 --- a/include/delphi/m_clist.inc +++ b/include/delphi/m_clist.inc @@ -46,6 +46,19 @@ const } MS_CLIST_GETSTATUSMODEDESCRIPTION:PAnsiChar = 'CList/GetStatusModeDescription'; +const + CMIF_GRAYED = 1; + CMIF_CHECKED = 2; + CMIF_HIDDEN = 4; // only works on contact menus + CMIF_NOTOFFLINE = 8; // item won't appear for contacts that are offline + CMIF_NOTONLINE = 16; // " online + CMIF_NOTONLIST = 32; // item won't appear on standard contacts + CMIF_NOTOFFLIST = 64; // item won't appear on contacts that have the 'NotOnList' setting + CMIF_UNICODE = 512; // will return TCHAR* instead of AnsiChar* + CMIF_KEEPUNTRANSLATED = 1024; // don't translate a menu item + + CMIF_DEFAULT = 4096; // this menu item is the default one + type // WARNING: do not use Translate(TS) for p(t)szName or p(t)szPopupName as they // are translated by the core, which may lead to double translation. @@ -53,67 +66,26 @@ type PCLISTMENUITEM = ^TCLISTMENUITEM; TCLISTMENUITEM = record szName : TChar; // [TRANSLATED-BY-CORE] text of the menu item - flags : dword; + flags : dword; // combination of CMIF_* position : int; // approx position on the menu, lower numbers go nearer the top hIcon : THANDLE; // icon to put by the item, if this was *not* loaded from // a resource, you can delete it straight after the call pszService : PAnsiChar; // name of the service to call when the service is clicked hParentMenu : THANDLE; // parent menu hamdle - - pszContactOwner: PAnsiChar; // contact menus only, the protocol module that owns - // the contacts to which this to which this menu item - // applies, NULL(0) if it applies to all contacts. - // if it applies to multiple but not all protocols - // add multiple menu items or use ME_CLIST_PREBUILDCONTACTMENU hLangpack : int; // plugin's hLangpack (added automatically) end; -const - CMIF_GRAYED = 1; - CMIF_CHECKED = 2; - CMIF_HIDDEN = 4; // only works on contact menus - CMIF_NOTOFFLINE = 8; // item won't appear for contacts that are offline - CMIF_NOTONLINE = 16; // " online - CMIF_NOTONLIST = 32; // item won't appear on standard contacts - CMIF_NOTOFFLIST = 64; // item won't appear on contacts that have the 'NotOnList' setting - CMIF_ROOTHANDLE = 384; // means that hParentMenu member is set (since 0.8#26) - CMIF_UNICODE = 512; // will return TCHAR* instead of AnsiChar* - CMIF_KEEPUNTRANSLATED = 1024; // don't translate a menu item - - CMIF_DEFAULT = 4096; // this menu item is the default one +function _AddMainMenuItem(mi:PCLISTMENUITEM; hlang:integer) : HGENMENU; stdcall; + external AppDll name 'Menu_AddMainMenuItem'; -// for compatibility. since 0.8.0 they both mean nothing - CMIF_ROOTPOPUP = 128; // root item for new popup (save return id for childs) - CMIF_CHILDPOPUP = 256; // child for rootpopup menu +function _AddContactMenuItem(mi:PCLISTMENUITEM; pszProto:PAnsiChar; hlang:integer) : HGENMENU; stdcall; + external AppDll name 'Menu_AddContactMenuItem'; - { - wParam : 0 - lParam : Pointer to a initalised TCLISTMENUITEM structure - Affect : Add a new menu item to the main menu, see notes - Returns: A handle to the new MENU item or NULL(0) on failure - Notes : The given TCLISTMENUITEM.pszService in is called when the item - get clicked with : - - - wParam = 0, lParam = hwndContactList - } - MS_CLIST_ADDMAINMENUITEM:PAnsiChar = 'CList/AddMainMenuItem'; +function _AddProtoMenuItem(mi:PCLISTMENUITEM; pszProto:PAnsiChar; hlang:integer) : HGENMENU; stdcall; + external AppDll name 'Menu_AddProtoMenuItem'; - { - wParam : 0 - lParam : Pointer to a initalised TCLISTMENUITEM structure - Affect : Add a new item to the user contact menus, see notes - Notes : exactly the same as MS_CLIST_ADDMAINMENUITEM except when an item - is selected, the service gets called with wParam=hContact, - pszContactOwner is obeyed. - - - Popup menus are not supported, pszPopupName and popupPosition - are ignored. If CTRL is held down when right clicking the menu - position numbers will be displayed in brackets after the menu item - text, this only works in debug builds! - } - MS_CLIST_ADDCONTACTMENUITEM:PAnsiChar = 'CList/AddContactMenuItem'; - MS_CLIST_ADDSTATUSMENUITEM :PAnsiChar = 'CList/AddStatusMenuItem'; - MS_CLIST_ADDPROTOMENUITEM :PAnsiChar = 'CList/AddProtoMenuItem'; +function _AddStatusMenuItem(mi:PCLISTMENUITEM; pszProto:PAnsiChar; hlang:integer) : HGENMENU; stdcall; + external AppDll name 'Menu_AddStatusMenuItem'; { Affect : Modify an existing menu item, see notes -- cgit v1.2.3