diff options
author | George Hazan <george.hazan@gmail.com> | 2013-02-23 19:43:21 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-02-23 19:43:21 +0000 |
commit | aa387fa04aa096d163932d3f5f9711a2f146c6f0 (patch) | |
tree | 7efe5dabf5bf5b9a78f8f991522487814bfc8cb0 /include/m_protoint.h | |
parent | 139c2c1a61d9f765704a2001199c2712d6587fb4 (diff) |
- PROTO_INTERFACE::GetIcon removed and replaced with the standard implementation;
- PS_LOADICON also replaced with the standard function;
- ProtoConstructor() & ProtoDestructor() macroses are introduced to simplify protocols' code;
- GetIcon() method implementation removed from all protocols
git-svn-id: http://svn.miranda-ng.org/main/trunk@3739 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'include/m_protoint.h')
-rw-r--r-- | include/m_protoint.h | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/include/m_protoint.h b/include/m_protoint.h index 2e412e759c..a042a018e9 100644 --- a/include/m_protoint.h +++ b/include/m_protoint.h @@ -50,8 +50,7 @@ struct PROTO_INTERFACE TCHAR* m_tszUserName;
char* m_szProtoName;
char* m_szModuleName;
-
- DWORD reserved[ 40 ];
+ HANDLE m_hProtoIcon;
virtual HANDLE __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr) = 0;
virtual HANDLE __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent) = 0;
@@ -69,7 +68,6 @@ struct PROTO_INTERFACE virtual int __cdecl FileResume(HANDLE hTransfer, int* action, const PROTOCHAR** szFilename) = 0;
virtual DWORD_PTR __cdecl GetCaps(int type, HANDLE hContact = NULL) = 0;
- virtual HICON __cdecl GetIcon(int iconIndex) = 0;
virtual int __cdecl GetInfo(HANDLE hContact, int infoType) = 0;
virtual HANDLE __cdecl SearchBasic(const PROTOCHAR* id) = 0;
@@ -101,4 +99,17 @@ struct PROTO_INTERFACE virtual int __cdecl OnEvent(PROTOEVENTTYPE iEventType, WPARAM wParam, LPARAM lParam) = 0;
};
+// Call it in the very beginning of your proto's constructor
+__forceinline void ProtoConstructor(PROTO_INTERFACE *pThis, LPCSTR pszModuleName, LPCTSTR ptszUserName)
+{
+ CallService("Proto/Constructor", (WPARAM)pThis, (LPARAM)pszModuleName);
+ pThis->m_tszUserName = mir_tstrdup(ptszUserName);
+}
+
+// Call it in the very end of your proto's destructor
+__forceinline void ProtoDestructor(PROTO_INTERFACE *pThis)
+{
+ CallService("Proto/Destructor", (WPARAM)pThis, 0);
+}
+
#endif // M_PROTOINT_H__
|