From 59cd198e89782263777c57dcd54704ecb1e10212 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 28 Jun 2015 17:41:48 +0000 Subject: finally CLISTEVENT removed completely git-svn-id: http://svn.miranda-ng.org/main/trunk@14430 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- include/delphi/m_clist.inc | 41 ------------------------------------ include/delphi/m_clistint.inc | 1 - include/delphi/m_genmenu.inc | 40 ++++++++++++++++++++++++++++------- include/delphi/m_helpers.inc | 24 ++++++++++----------- include/m_clist.h | 49 +++++++++---------------------------------- include/m_clistint.h | 1 - include/m_cluiframes.h | 6 +++--- include/m_genmenu.h | 23 +++++++++++++++++--- 8 files changed, 78 insertions(+), 107 deletions(-) (limited to 'include') diff --git a/include/delphi/m_clist.inc b/include/delphi/m_clist.inc index 251b5d68f6..9c54fae5d5 100644 --- a/include/delphi/m_clist.inc +++ b/include/delphi/m_clist.inc @@ -46,47 +46,6 @@ 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. -// Use LPGEN instead which are just dummy wrappers/markers for "lpgen.pl". - PCLISTMENUITEM = ^TCLISTMENUITEM; - TCLISTMENUITEM = record - szName : TChar; // [TRANSLATED-BY-CORE] text of the menu item - 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 - hLangpack : int; // plugin's hLangpack (added automatically) - end; - -function _AddMainMenuItem(mi:PCLISTMENUITEM; hlang:integer) : HGENMENU; stdcall; - external AppDll name 'Menu_AddMainMenuItem'; - -function _AddContactMenuItem(mi:PCLISTMENUITEM; pszProto:PAnsiChar; hlang:integer) : HGENMENU; stdcall; - external AppDll name 'Menu_AddContactMenuItem'; - -function _AddProtoMenuItem(mi:PCLISTMENUITEM; pszProto:PAnsiChar; hlang:integer) : HGENMENU; stdcall; - external AppDll name 'Menu_AddProtoMenuItem'; - -function _AddStatusMenuItem(mi:PCLISTMENUITEM; pszProto:PAnsiChar; hlang:integer) : HGENMENU; stdcall; - external AppDll name 'Menu_AddStatusMenuItem'; - function Menu_BuildContactMenu(hContact:TMCONTACT) : HMENU; stdcall; external AppDll name 'Menu_BuildContactMenu'; diff --git a/include/delphi/m_clistint.inc b/include/delphi/m_clistint.inc index 64040a535d..33e2ab5d7e 100644 --- a/include/delphi/m_clistint.inc +++ b/include/delphi/m_clistint.inc @@ -520,7 +520,6 @@ type * version 6 additions (0.8.0.x) - accounts *************************************************************************************) pfnGetAccountIndexByPos : function (pos:int):int; cdecl; - pfnConvertMenu: function( clitem:PCLISTMENUITEM; moitem:PMO_MenuItem):int; cdecl; (************************************************************************************* * version 7 additions (0.11.0.x) - extra images diff --git a/include/delphi/m_genmenu.inc b/include/delphi/m_genmenu.inc index b152cb8106..ad49a1c160 100644 --- a/include/delphi/m_genmenu.inc +++ b/include/delphi/m_genmenu.inc @@ -141,18 +141,44 @@ const SETTING_NOOFFLINEBOTTOM_DEFAULT = 0; +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 PMO_MenuItem = ^TMO_MenuItem; TMO_MenuItem = record - position :int; - root :HGENMENU; - szName :TCHAR; - flags :integer; - hIcon :HICON; // or hIcolibItem:THANDLE; - ownerdata:^pointer; - hLangpack:int; + position :int; + pszService:PAnsiChar; + root :HGENMENU; + szName :TCHAR; + flags :integer; + hIcon :HICON; // or hIcolibItem:THANDLE; + ownerdata :^pointer; + hLangpack :int; end; +function _AddMainMenuItem(mi:PMO_MenuItem; hlang:integer) : HGENMENU; stdcall; + external AppDll name 'Menu_AddMainMenuItem'; + +function _AddContactMenuItem(mi:PMO_MenuItem; pszProto:PAnsiChar; hlang:integer) : HGENMENU; stdcall; + external AppDll name 'Menu_AddContactMenuItem'; + +function _AddProtoMenuItem(mi:PMO_MenuItem; pszProto:PAnsiChar; hlang:integer) : HGENMENU; stdcall; + external AppDll name 'Menu_AddProtoMenuItem'; + +function _AddStatusMenuItem(mi:PMO_MenuItem; pszProto:PAnsiChar; hlang:integer) : HGENMENU; stdcall; + external AppDll name 'Menu_AddStatusMenuItem'; + { This structure passed to CheckService. } diff --git a/include/delphi/m_helpers.inc b/include/delphi/m_helpers.inc index 72a0b66103..ac89dd005f 100644 --- a/include/delphi/m_helpers.inc +++ b/include/delphi/m_helpers.inc @@ -52,12 +52,12 @@ function Srmm_GetNthIcon(hContact:TMCONTACT; index:int):pStatusIconData; function SkinAddNewSound(const name, description, defaultFile: PAnsiChar): int_ptr; function SkinPlaySound (const name: PAnsiChar): int_ptr; -function Menu_AddContextFrameMenuItem(mi:PCLISTMENUITEM):HGENMENU; -function Menu_AddMainMenuItem (mi:PCLISTMENUITEM):HGENMENU; -function Menu_AddContactMenuItem (mi:PCLISTMENUITEM):HGENMENU; -function Menu_AddStatusMenuItem (mi:PCLISTMENUITEM):HGENMENU; -function Menu_AddProtoMenuItem (mi:PCLISTMENUITEM):HGENMENU; -function Menu_AddTrayMenuItem (mi:PCLISTMENUITEM):HGENMENU; +function Menu_AddContextFrameMenuItem(mi:PMO_MenuItem):HGENMENU; +function Menu_AddMainMenuItem (mi:PMO_MenuItem):HGENMENU; +function Menu_AddContactMenuItem (mi:PMO_MenuItem):HGENMENU; +function Menu_AddStatusMenuItem (mi:PMO_MenuItem):HGENMENU; +function Menu_AddProtoMenuItem (mi:PMO_MenuItem):HGENMENU; +function Menu_AddTrayMenuItem (mi:PMO_MenuItem):HGENMENU; function UserInfo_AddPage(wParam:WPARAM; odp:POPTIONSDIALOGPAGE):int_ptr; function Options_AddPage (wParam:WPARAM; odp:POPTIONSDIALOGPAGE):int_ptr; @@ -384,33 +384,33 @@ begin end; -function Menu_AddContextFrameMenuItem(mi:PCLISTMENUITEM):HGENMENU; +function Menu_AddContextFrameMenuItem(mi:PMO_MenuItem):HGENMENU; begin mi^.hLangpack:=hLangpack; result:=CallService(MS_CLIST_ADDCONTEXTFRAMEMENUITEM, 0,LPARAM(mi)); end; -function Menu_AddMainMenuItem(mi:PCLISTMENUITEM):HGENMENU; +function Menu_AddMainMenuItem(mi:PMO_MenuItem):HGENMENU; begin result:=_AddMainMenuItem(mi, hLangpack); end; -function Menu_AddContactMenuItem(mi:PCLISTMENUITEM):HGENMENU; +function Menu_AddContactMenuItem(mi:PMO_MenuItem):HGENMENU; begin result:=_AddContactMenuItem(mi, nil, hLangpack); end; -function Menu_AddStatusMenuItem(mi:PCLISTMENUITEM):HGENMENU; +function Menu_AddStatusMenuItem(mi:PMO_MenuItem):HGENMENU; begin result:=_AddStatusMenuItem(mi, nil, hLangpack); end; -function Menu_AddProtoMenuItem(mi:PCLISTMENUITEM):HGENMENU; +function Menu_AddProtoMenuItem(mi:PMO_MenuItem):HGENMENU; begin result:=_AddProtoMenuItem(mi, nil, hLangpack); end; -function Menu_AddTrayMenuItem(mi:PCLISTMENUITEM):HGENMENU; +function Menu_AddTrayMenuItem(mi:PMO_MenuItem):HGENMENU; begin mi^.hLangpack:=hLangpack; result:=CallService(MS_CLIST_ADDTRAYMENUITEM, 0,LPARAM(mi)); diff --git a/include/m_clist.h b/include/m_clist.h index 38cce1e062..803fe25ba5 100644 --- a/include/m_clist.h +++ b/include/m_clist.h @@ -75,40 +75,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define GSMDF_UNTRANSLATED 4 #define MS_CLIST_GETSTATUSMODEDESCRIPTION "CList/GetStatusModeDescription" -struct CLISTMENUITEM -{ - MAllStrings name; // [TRANSLATED-BY-CORE] text of the menu item - DWORD flags; // set of CMIF_* flags - int position; // approx position on the menu. lower numbers go nearer the top - HANDLE icolibItem; // set CMIF_ICONFROMICOLIB to pass this value - char* pszService; // name of service to call when the item gets selected - HGENMENU hParentMenu; // HGENMENU_ROOT or NULL means the root menu - int hLangpack; // plugin's hLangpack (added automatically) -}; - -#define CMIF_GRAYED 1 -#define CMIF_CHECKED 2 -#define CMIF_HIDDEN 4 //only works on contact menus -#define CMIF_NOTOFFLINE 8 //item won't appear for contacts that are offline -#define CMIF_NOTONLINE 16 // " online -#define CMIF_NOTONLIST 32 //item won't appear on standard contacts -#define CMIF_NOTOFFLIST 64 //item won't appear on contacts that have the 'NotOnList' setting - -#define CMIF_UNICODE 512 //will return TCHAR* instead of char* -#if defined(_UNICODE) - #define CMIF_TCHAR CMIF_UNICODE //will return TCHAR* instead of char* -#else - #define CMIF_TCHAR 0 //will return char*, as usual -#endif - -#define CMIF_KEEPUNTRANSLATED 1024 // don't translate a menu item -#define CMIF_DEFAULT 4096 // this menu item is the default one - ///////////////////////////////////////////////////////////////////////////////////////// // MAIN MENU // adds a new element into main menu -EXTERN_C MIR_APP_DLL(HGENMENU) Menu_AddMainMenuItem(CLISTMENUITEM *mi, int = hLangpack); +EXTERN_C MIR_APP_DLL(HGENMENU) Menu_AddMainMenuItem(TMO_MenuItem *mi, int = hLangpack); // gets a handle to the main Miranda menu // returns a HMENU. This need not to be freed since it's owned by clist @@ -127,7 +98,7 @@ EXTERN_C MIR_APP_DLL(HMENU) Menu_BuildMainMenu(void); // CONTACT MENU // adds a new element into contact menu -EXTERN_C MIR_APP_DLL(HGENMENU) Menu_AddContactMenuItem(CLISTMENUITEM *mi, const char *pszProto = NULL, int = hLangpack); +EXTERN_C MIR_APP_DLL(HGENMENU) Menu_AddContactMenuItem(TMO_MenuItem *mi, const char *pszProto = NULL, int = hLangpack); // builds the context menu for a specific contact // returns a HMENU identifying the menu. This should be DestroyMenu()ed when @@ -147,7 +118,7 @@ EXTERN_C MIR_APP_DLL(HMENU) Menu_BuildContactMenu(MCONTACT hContact); EXTERN_C MIR_APP_DLL(HMENU) Menu_GetStatusMenu(void); // adds an item to a status menu -EXTERN_C MIR_APP_DLL(HGENMENU) Menu_AddStatusMenuItem(CLISTMENUITEM *mi, const char *pszProto = NULL, int = hLangpack); +EXTERN_C MIR_APP_DLL(HGENMENU) Menu_AddStatusMenuItem(TMO_MenuItem *mi, const char *pszProto = NULL, int = hLangpack); // the status menu is about to be built // wParam = lParam = 0 @@ -157,7 +128,7 @@ EXTERN_C MIR_APP_DLL(HGENMENU) Menu_AddStatusMenuItem(CLISTMENUITEM *mi, const c // PROTOCOL MENU // adds an item to status or main menu, according to the option -EXTERN_C MIR_APP_DLL(HGENMENU) Menu_AddProtoMenuItem(CLISTMENUITEM *mi, const char *pszProto = NULL, int = hLangpack); +EXTERN_C MIR_APP_DLL(HGENMENU) Menu_AddProtoMenuItem(TMO_MenuItem *mi, const char *pszProto = NULL, int = hLangpack); ///////////////////////////////////////////////////////////////////////////////////////// // GROUP MENU @@ -176,9 +147,9 @@ GroupMenuParam, *lpGroupMenuParam; // add a new item to the Group menus // wParam=lpGroupMenuParam, params to call when exec menuitem -// lParam=(LPARAM)(CLISTMENUITEM*)&mi +// lParam=(LPARAM)(TMO_MenuItem*)&mi -__forceinline HGENMENU Menu_AddGroupMenuItem(lpGroupMenuParam gmp, CLISTMENUITEM *mi) +__forceinline HGENMENU Menu_AddGroupMenuItem(lpGroupMenuParam gmp, TMO_MenuItem *mi) { mi->hLangpack = hLangpack; return (HGENMENU)CallService("CList/AddGroupMenuItem", (WPARAM)gmp, (LPARAM)mi); @@ -198,9 +169,9 @@ __forceinline HGENMENU Menu_AddGroupMenuItem(lpGroupMenuParam gmp, CLISTMENUITEM // add a new item to the SubGroup menus // wParam=lpGroupMenuParam, params to call when exec menuitem -// lParam=(LPARAM)(CLISTMENUITEM*)&mi +// lParam=(LPARAM)(TMO_MenuItem*)&mi -__forceinline HGENMENU Menu_AddSubGroupMenuItem(lpGroupMenuParam gmp, CLISTMENUITEM *mi) +__forceinline HGENMENU Menu_AddSubGroupMenuItem(lpGroupMenuParam gmp, TMO_MenuItem *mi) { mi->hLangpack = hLangpack; return (HGENMENU)CallService("CList/AddSubGroupMenuItem", (WPARAM)gmp, (LPARAM)mi); @@ -220,9 +191,9 @@ __forceinline HGENMENU Menu_AddSubGroupMenuItem(lpGroupMenuParam gmp, CLISTMENUI // add a new item to the tray menus // wParam=0 -// lParam=(LPARAM)(CLISTMENUITEM*)&mi +// lParam=(LPARAM)(TMO_MenuItem*)&mi -__forceinline HGENMENU Menu_AddTrayMenuItem(CLISTMENUITEM *mi) +__forceinline HGENMENU Menu_AddTrayMenuItem(TMO_MenuItem *mi) { mi->hLangpack = hLangpack; return (HGENMENU)CallService("CList/AddTrayMenuItem", 0, (LPARAM)mi); diff --git a/include/m_clistint.h b/include/m_clistint.h index d518d92a79..7890028d09 100644 --- a/include/m_clistint.h +++ b/include/m_clistint.h @@ -463,7 +463,6 @@ typedef struct * version 6 additions (0.8.0.x) - accounts *************************************************************************************/ int (*pfnGetAccountIndexByPos)(int pos); - int (*pfnConvertMenu)(CLISTMENUITEM*, TMO_MenuItem*); /************************************************************************************* * version 7 additions (0.11.0.x) - extra images diff --git a/include/m_cluiframes.h b/include/m_cluiframes.h index a52f65375e..39ac12cfc5 100644 --- a/include/m_cluiframes.h +++ b/include/m_cluiframes.h @@ -231,9 +231,9 @@ typedef struct tagCLISTFrame { //popupposition=frameid //contactowner=advanced parameter -__forceinline HGENMENU Menu_AddContextFrameMenuItem(CLISTMENUITEM *mi) -{ mi->hLangpack = hLangpack; - return (HGENMENU)CallService("CList/AddContextFrameMenuItem", 0, (LPARAM)mi); +__forceinline HGENMENU Menu_AddContextFrameMenuItem(TMO_MenuItem *pmi) +{ pmi->hLangpack = hLangpack; + return (HGENMENU)CallService("CList/AddContextFrameMenuItem", 0, (LPARAM)pmi); } ////////////////////////////////////////////////////////////////////////// diff --git a/include/m_genmenu.h b/include/m_genmenu.h index 9ecbfadb31..20ca70b020 100644 --- a/include/m_genmenu.h +++ b/include/m_genmenu.h @@ -17,20 +17,37 @@ #define MO_PROTO (-3) #define MO_STATUS (-4) -#define SETTING_NOOFFLINEBOTTOM_DEFAULT 0 +#define CMIF_GRAYED 1 +#define CMIF_CHECKED 2 +#define CMIF_HIDDEN 4 //only works on contact menus +#define CMIF_NOTOFFLINE 8 //item won't appear for contacts that are offline +#define CMIF_NOTONLINE 16 // " online +#define CMIF_NOTONLIST 32 //item won't appear on standard contacts +#define CMIF_NOTOFFLIST 64 //item won't appear on contacts that have the 'NotOnList' setting + +#define CMIF_UNICODE 512 //will return TCHAR* instead of char* +#if defined(_UNICODE) +#define CMIF_TCHAR CMIF_UNICODE //will return TCHAR* instead of char* +#else +#define CMIF_TCHAR 0 //will return char*, as usual +#endif + +#define CMIF_KEEPUNTRANSLATED 1024 // don't translate a menu item +#define CMIF_DEFAULT 4096 // this menu item is the default one struct TMO_MenuItem { int position; + const char *pszService; HGENMENU root; MAllStrings name; - int flags; + int flags; // set of CMIF_* constants union { HICON hIcon; HANDLE hIcolibItem; }; void *ownerdata; - int hLangpack; + int hLangpack; }; /* -- cgit v1.2.3