From 74608bcc6cb28e2d5e111dbc30c2009ea01bffc0 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 29 Dec 2017 18:15:20 +0300 Subject: removing obsolete C-style helpers --- include/m_protoint.h | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'include/m_protoint.h') diff --git a/include/m_protoint.h b/include/m_protoint.h index d0a40c5587..64d423fab0 100644 --- a/include/m_protoint.h +++ b/include/m_protoint.h @@ -77,33 +77,32 @@ typedef INT_PTR (__cdecl PROTO_INTERFACE::*ProtoServiceFuncParam)(WPARAM, LPARAM EXTERN_C MIR_APP_DLL(void) ProtoCreateServiceParam(PROTO_INTERFACE *pThis, const char* szService, ProtoServiceFuncParam, LPARAM); #endif -EXTERN_C MIR_APP_DLL(void) ProtoLogA(PROTO_INTERFACE *pThis, LPCSTR szFormat, va_list args); -EXTERN_C MIR_APP_DLL(void) ProtoLogW(PROTO_INTERFACE *pThis, LPCWSTR wszFormat, va_list args); - ///////////////////////////////////////////////////////////////////////////////////////// // interface declaration struct MIR_APP_EXPORT PROTO_INTERFACE : public MZeroedObject { - int m_iStatus, // current protocol status - m_iDesiredStatus, // status to be set after logging in - m_iXStatus, // extanded status - m_iVersion; // version 2 or higher designate support of Unicode services + +protected: + MWindowList m_hWindowList; // list of all windows which belong to this protocol's instance + +public: + int m_iStatus; // current protocol status + int m_iDesiredStatus; // status to be set after logging in + int m_iXStatus; // extanded status + int m_iVersion; // version 2 or higher designate support of Unicode services wchar_t* m_tszUserName; // human readable protocol's name char* m_szModuleName; // internal protocol name, also its database module name HANDLE m_hProtoIcon; // icon to be displayed in the account manager HNETLIBUSER m_hNetlibUser; // network agent - MWindowList m_hWindowList; // list of all windows which belong to this protocol's instance HGENMENU m_hMainMenuItem; // if protocol menus are displayed in the main menu, this is the root + PROTO_INTERFACE(const char *pszModuleName, const wchar_t *ptszUserName); + ~PROTO_INTERFACE(); + ////////////////////////////////////////////////////////////////////////////////////// // Helpers - __forceinline void WindowSubscribe(HWND hwnd) { - ::ProtoWindowAdd(this, hwnd); } - __forceinline void WindowUnsubscribe(HWND hwnd) { - ::ProtoWindowRemove(this, hwnd); } - __forceinline INT_PTR ProtoBroadcastAck(MCONTACT hContact, int type, int hResult, HANDLE hProcess, LPARAM lParam = 0) { return ::ProtoBroadcastAck(m_szModuleName, hContact, type, hResult, hProcess, lParam); } @@ -175,6 +174,9 @@ struct MIR_APP_EXPORT PROTO_INTERFACE : public MZeroedObject void setAllContactStatuses(int iStatus, bool bSkipChats = true); + void WindowSubscribe(HWND hwnd); + void WindowUnsubscribe(HWND hwnd); + ////////////////////////////////////////////////////////////////////////////////////// // Virtual functions @@ -227,11 +229,9 @@ struct MIR_APP_EXPORT PROTO_INTERFACE : public MZeroedObject template struct PROTO : public PROTO_INTERFACE { - __forceinline PROTO(const char *szProto, const wchar_t *tszUserName) { - ::ProtoConstructor(this, szProto, tszUserName); } - - __forceinline ~PROTO() { - ::ProtoDestructor(this); } + __forceinline PROTO(const char *szProto, const wchar_t *tszUserName) : + PROTO_INTERFACE(szProto, tszUserName) + {} __forceinline HANDLE CreateProtoEvent(const char *name) { return ::ProtoCreateHookableEvent(this, name); } -- cgit v1.2.3