From 66b61f42871089f3962920924f9030cd6dff2ad8 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 3 Apr 2018 13:37:13 +0300 Subject: CLIST_INTERFACE: - unused members removed (requires new History++ for people who compile Miranda themselves); - useless helpers Proto_IsAccountEnabled & Proto_IsProtocolLocked replaced with direct calls of PROTOACCOUNT members IsEnabled & IsLocked respectively; - static interface member pfnGetProtocolVisibility replaced with static function Clist_GetProtocolVisibility or PROTOACCOUNT::IsVisible when possible --- include/delphi/m_clistint.inc | 11 +------- include/delphi/m_protocols.inc | 16 ------------ include/m_clist.h | 7 ++++- include/m_clistint.h | 59 ++++++++++++++++++------------------------ include/m_protocols.h | 49 +++++++++++++---------------------- 5 files changed, 50 insertions(+), 92 deletions(-) (limited to 'include') diff --git a/include/delphi/m_clistint.inc b/include/delphi/m_clistint.inc index 1c04a491cb..699b138f4f 100644 --- a/include/delphi/m_clistint.inc +++ b/include/delphi/m_clistint.inc @@ -298,7 +298,6 @@ type (* clc.h *) pfnClcOptionsChanged : procedure; cdecl; - unused3 : procedure; cdecl; pfnBuildGroupPopupMenu : function (_para1:PClcGroup):HMENU; cdecl; pfnContactListControlWndProc:function(hwnd:HWND; msg:uint; wParam:WPARAM; lParam:LPARAM):LRESULT; stdcall; @@ -423,11 +422,6 @@ type (* docking.c *) pfnDocking_ProcessWindowMessage : function (wParam:WPARAM; lParam:LPARAM):int; cdecl; - blablabla1 : procedure; cdecl; - blablabla2 : procedure; cdecl; - blablabla3 : procedure; cdecl; - blablabla4 : procedure; cdecl; - (************************************************************************************* * version 2 - events processing *************************************************************************************) @@ -459,10 +453,7 @@ type bDisplayLocked : bool; bAutoRebuild : bool; - pfnGetProtocolMenu : function (_para1:PAnsiChar):HGENMENU; cdecl; - pfnStub2 : function (_para1:int):int; cdecl; - - pfnGetProtocolVisibility : function (_para1:PAnsiChar):int; cdecl; + pfnGetProtocolMenu : function (_para1:PAnsiChar):HGENMENU; cdecl; pfnGetProtoIndexByPos : function (var proto:PPROTOCOLDESCRIPTOR; protoCnt:int; Pos:int):int; cdecl; pfnReloadProtoMenus : procedure ; cdecl; diff --git a/include/delphi/m_protocols.inc b/include/delphi/m_protocols.inc index 83deebaf44..c4038e9600 100644 --- a/include/delphi/m_protocols.inc +++ b/include/delphi/m_protocols.inc @@ -311,22 +311,6 @@ const } MS_PROTO_SHOWACCMGR:PAnsiChar = 'Protos/ShowAccountManager'; -{ - determines if an account is enabled or not - Returns 1 if an account is valid and enabled, 0 otherwise -} - -function Proto_IsAccountEnabled(proto:PPROTOACCOUNT) : byte; stdcall; external AppDLL; - -{ - determines if an account is locked or not - wParam = 0 - lParam = PAnsiChar szAccountName - Returns 1 if an account is locked and not supposed to change status, 0 otherwise -} - -function Proto_IsAccountLocked(proto:PPROTOACCOUNT) : byte; stdcall; external AppDLL; - { gets the account associated with a contact Returns a PAnsiChar pointing to the asciiz name of the protocol or NULL if the diff --git a/include/m_clist.h b/include/m_clist.h index b3eb928deb..a35d4680e1 100644 --- a/include/m_clist.h +++ b/include/m_clist.h @@ -49,10 +49,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ///////////////////////////////////////////////////////////////////////////////////////// // force a change of status mode -// wParam = new status, from statusmodes.h +// iStatus = new status, from statusmodes.h EXTERN_C MIR_APP_DLL(void) Clist_SetStatusMode(int iStatus); +///////////////////////////////////////////////////////////////////////////////////////// +// detects whether a protocol is visible or not + +EXTERN_C MIR_APP_DLL(bool) Clist_GetProtocolVisibility(const char *szModuleName); + ///////////////////////////////////////////////////////////////////////////////////////// // get the current status mode // wParam = lParam = 0 diff --git a/include/m_clistint.h b/include/m_clistint.h index 3e145fa977..6a58baf1c1 100644 --- a/include/m_clistint.h +++ b/include/m_clistint.h @@ -285,7 +285,6 @@ struct CLIST_INTERFACE /* clc.h */ void (*pfnClcOptionsChanged)(void); - void (*pfnUnused1)(); HMENU (*pfnBuildGroupPopupMenu)(struct ClcGroup*); // unused LRESULT (CALLBACK *pfnContactListControlWndProc)(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); @@ -409,11 +408,6 @@ struct CLIST_INTERFACE /* docking.c */ int (*pfnDocking_ProcessWindowMessage)(WPARAM wParam, LPARAM lParam); - int (*blablabla1)(); - int (*blablabla2)(); - int (*blablabla3)(); - int (*blablabla4)(); - /************************************************************************************* * version 2 - events processing *************************************************************************************/ @@ -439,16 +433,13 @@ struct CLIST_INTERFACE MenuProto* menuProtos; int menuProtoCount; - HANDLE hPreBuildStatusMenuEvent; - int currentStatusMenuItem, currentDesiredStatusMode; - BOOL bDisplayLocked, bAutoRebuild; + HANDLE hPreBuildStatusMenuEvent; + int currentStatusMenuItem, currentDesiredStatusMode; + BOOL bDisplayLocked, bAutoRebuild; HGENMENU (*pfnGetProtocolMenu)(const char*); - int (*pfnStub2)(int); - - int (*pfnGetProtocolVisibility)(const char*); - int (*pfnGetProtoIndexByPos)(PROTOCOLDESCRIPTOR** proto, int protoCnt, int Pos); - void (*pfnReloadProtoMenus)(void); + int (*pfnGetProtoIndexByPos)(PROTOCOLDESCRIPTOR **proto, int protoCnt, int Pos); + void (*pfnReloadProtoMenus)(void); /************************************************************************************* * version 5 additions (0.7.0.x) - tray icons @@ -459,44 +450,44 @@ struct CLIST_INTERFACE int shellVersion; UINT_PTR cycleTimerId; int cycleStep; - wchar_t* szTip; + wchar_t* szTip; BOOL bTrayMenuOnScreen; - HICON (*pfnGetIconFromStatusMode)(MCONTACT hContact, const char *szProto, int status); + HICON (*pfnGetIconFromStatusMode)(MCONTACT hContact, const char *szProto, int status); - void (*pfnInitTray)(void); - void (*pfnUninitTray)(void); + void (*pfnInitTray)(void); + void (*pfnUninitTray)(void); - int (*pfnTrayIconAdd)(HWND hwnd, const char *szProto, const char *szIconProto, int status); - int (*pfnTrayIconDestroy)(HWND hwnd); - int (*pfnTrayIconInit)(HWND hwnd); + int (*pfnTrayIconAdd)(HWND hwnd, const char *szProto, const char *szIconProto, int status); + int (*pfnTrayIconDestroy)(HWND hwnd); + int (*pfnTrayIconInit)(HWND hwnd); wchar_t* (*pfnTrayIconMakeTooltip)(const wchar_t *szPrefix, const char *szProto); - void (*pfnTrayIconRemove)(HWND hwnd, const char *szProto); - int (*pfnTrayIconSetBaseInfo)(HICON hIcon, const char *szPreferredProto); - void (*pfnTrayIconTaskbarCreated)(HWND hwnd); - int (*pfnTrayIconUpdate)(HICON hNewIcon, const wchar_t *szNewTip, const char *szPreferredProto, int isBase); + void (*pfnTrayIconRemove)(HWND hwnd, const char *szProto); + int (*pfnTrayIconSetBaseInfo)(HICON hIcon, const char *szPreferredProto); + void (*pfnTrayIconTaskbarCreated)(HWND hwnd); + int (*pfnTrayIconUpdate)(HICON hNewIcon, const wchar_t *szNewTip, const char *szPreferredProto, int isBase); - VOID (CALLBACK *pfnTrayCycleTimerProc)(HWND hwnd, UINT message, UINT_PTR idEvent, DWORD dwTime); + VOID (CALLBACK *pfnTrayCycleTimerProc)(HWND hwnd, UINT message, UINT_PTR idEvent, DWORD dwTime); /************************************************************************************* * version 6 additions (0.8.0.x) - accounts *************************************************************************************/ - int (*pfnGetAccountIndexByPos)(int pos); + int (*pfnGetAccountIndexByPos)(int pos); /************************************************************************************* * version 7 additions (0.11.0.x) - extra images *************************************************************************************/ - void (*pfnReloadExtraIcons)(void); - void (*pfnSetAllExtraIcons)(MCONTACT hContact); + void (*pfnReloadExtraIcons)(void); + void (*pfnSetAllExtraIcons)(MCONTACT hContact); /************************************************************************************* * Miranda NG additions *************************************************************************************/ - int (*pfnGetContactIcon)(MCONTACT hContact); - int (*pfnTrayCalcChanged)(const char *szChangedProto, int averageMode, int iProtoCount); - int (*pfnGetAverageMode)(int *pNetProtoCount); - void (*pfnInitAutoRebuild)(HWND hwnd); - void (*pfnSetContactCheckboxes)(ClcContact *cc, int checked); + int (*pfnGetContactIcon)(MCONTACT hContact); + int (*pfnTrayCalcChanged)(const char *szChangedProto, int averageMode, int iProtoCount); + int (*pfnGetAverageMode)(int *pNetProtoCount); + void (*pfnInitAutoRebuild)(HWND hwnd); + void (*pfnSetContactCheckboxes)(ClcContact *cc, int checked); }; // retrieves the pointer to a CLIST_INTERFACE structure diff --git a/include/m_protocols.h b/include/m_protocols.h index cee4513363..537cb5308d 100644 --- a/include/m_protocols.h +++ b/include/m_protocols.h @@ -276,27 +276,30 @@ EXTERN_C MIR_APP_DLL(int) Proto_IsProtoOnContact(MCONTACT hContact, const char * // -------------- accounts support --------------------- 0.8.0+ -typedef struct tagACCOUNT +struct MIR_APP_EXPORT PROTOACCOUNT { - int cbSize; // sizeof this structure - char* szModuleName; // unique physical account name (matches database module name) + int cbSize; // sizeof this structure + char* szModuleName; // unique physical account name (matches database module name) wchar_t* tszAccountName; // user-defined account name - char* szProtoName; // physical protocol name - bool bIsEnabled; // is account enabled? - bool bIsVisible; // is account visible? - bool bIsVirtual; // is account virtual? - bool bOldProto; // old-styled account (one instance per dll) - bool bDynDisabled; // dynamic disable flag, is never written to db + char* szProtoName; // physical protocol name + bool bIsEnabled; // is account enabled? + bool bIsVisible; // is account visible? + bool bIsVirtual; // is account virtual? + bool bOldProto; // old-styled account (one instance per dll) + bool bDynDisabled; // dynamic disable flag, is never written to db - bool bAccMgrUIChanged; - HWND hwndAccMgrUI; + bool bAccMgrUIChanged; + HWND hwndAccMgrUI; - int iOrder; // account order in various menus & lists + int iOrder; // account order in various menus & lists PROTO_INTERFACE *ppro; // pointer to the underlying object - char* szUniqueId; // setting's unique id for any contact in the account -} - PROTOACCOUNT; + char* szUniqueId; // setting's unique id for any contact in the account + + bool IsEnabled(void) const; + bool IsLocked(void) const; + bool IsVisible(void) const; +}; ///////////////////////////////////////////////////////////////////////////////////////// // account enumeration service @@ -343,22 +346,6 @@ EXTERN_C MIR_APP_DLL(PROTOACCOUNT*) Proto_GetAccount(const char *pszModuleName); #define MS_PROTO_SHOWACCMGR "Protos/ShowAccountManager" -///////////////////////////////////////////////////////////////////////////////////////// -// determines if an account is enabled or not -// wParam = 0 -// lParam = (LPARAM)(PROTOACCOUNT*) -// Returns 1 if an account is valid and enabled, 0 otherwise - -EXTERN_C MIR_APP_DLL(bool) Proto_IsAccountEnabled(const PROTOACCOUNT *pa); - -///////////////////////////////////////////////////////////////////////////////////////// -// determines if an account is locked or not -// wParam = 0 -// lParam = (LPARAM)(char*)szAccountName -// Returns 1 if an account is locked and not supposed to change status, 0 otherwise - -EXTERN_C MIR_APP_DLL(bool) Proto_IsAccountLocked(const PROTOACCOUNT *pa); - ///////////////////////////////////////////////////////////////////////////////////////// // gets the account associated with a contact // Returns a char* pointing to the asciiz name of the protocol or NULL if the -- cgit v1.2.3