summaryrefslogtreecommitdiff
path: root/include/m_protoint.h
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-12-29 18:15:20 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-12-29 18:15:20 +0300
commit74608bcc6cb28e2d5e111dbc30c2009ea01bffc0 (patch)
treeb40e2d190550658c467dad7956bb75e48e0d89e9 /include/m_protoint.h
parent7c4d37c907ad4fabe55d4bc2b115604b346c547a (diff)
removing obsolete C-style helpers
Diffstat (limited to 'include/m_protoint.h')
-rw-r--r--include/m_protoint.h36
1 files changed, 18 insertions, 18 deletions
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<class T> 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); }