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 /protocols/Gadu-Gadu/src/gg_proto.cpp | |
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 'protocols/Gadu-Gadu/src/gg_proto.cpp')
-rw-r--r-- | protocols/Gadu-Gadu/src/gg_proto.cpp | 32 |
1 files changed, 3 insertions, 29 deletions
diff --git a/protocols/Gadu-Gadu/src/gg_proto.cpp b/protocols/Gadu-Gadu/src/gg_proto.cpp index c7571f7255..3dba2f5552 100644 --- a/protocols/Gadu-Gadu/src/gg_proto.cpp +++ b/protocols/Gadu-Gadu/src/gg_proto.cpp @@ -23,6 +23,8 @@ GGPROTO::GGPROTO(const char* pszProtoName, const TCHAR* tszUserName)
{
+ ProtoConstructor(this, pszProtoName, tszUserName);
+
#ifdef DEBUGMODE
extendedLogging = 0;
#endif
@@ -36,10 +38,7 @@ GGPROTO::GGPROTO(const char* pszProtoName, const TCHAR* tszUserName) InitializeCriticalSection(&sessions_mutex);
// Init instance names
- m_szModuleName = mir_strdup(pszProtoName);
- m_tszUserName = mir_tstrdup(tszUserName);
m_szProtoName = GGDEF_PROTONAME;
- m_iVersion = 2;
// Register netlib user
TCHAR name[128];
@@ -126,8 +125,7 @@ GGPROTO::~GGPROTO() if (modemsg.invisible) mir_free(modemsg.invisible);
if (modemsg.offline) mir_free(modemsg.offline);
- mir_free(m_szModuleName);
- mir_free(m_tszUserName);
+ ProtoDestructor(this);
}
//////////////////////////////////////////////////////////
@@ -194,30 +192,6 @@ DWORD_PTR GGPROTO::GetCaps(int type, HANDLE hContact) }
//////////////////////////////////////////////////////////
-// loads protocol icon
-
-HICON GGPROTO::GetIcon(int iconIndex)
-{
- if (LOWORD(iconIndex) == PLI_PROTOCOL)
- {
- if (iconIndex & PLIF_ICOLIBHANDLE)
- return (HICON)GetIconHandle(IDI_GG);
-
- BOOL big = (iconIndex & PLIF_SMALL) == 0;
- HICON hIcon = LoadIconEx("main", big);
-
- if (iconIndex & PLIF_ICOLIB)
- return hIcon;
-
- hIcon = CopyIcon(hIcon);
- ReleaseIconEx("main", big);
- return hIcon;
- }
-
- return (HICON)NULL;
-}
-
-//////////////////////////////////////////////////////////
// user info request
void __cdecl GGPROTO::cmdgetinfothread(void *hContact)
|