summaryrefslogtreecommitdiff
path: root/protocols/Gadu-Gadu/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-02-23 19:43:21 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-02-23 19:43:21 +0000
commitaa387fa04aa096d163932d3f5f9711a2f146c6f0 (patch)
tree7efe5dabf5bf5b9a78f8f991522487814bfc8cb0 /protocols/Gadu-Gadu/src
parent139c2c1a61d9f765704a2001199c2712d6587fb4 (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')
-rw-r--r--protocols/Gadu-Gadu/src/gg_proto.cpp32
-rw-r--r--protocols/Gadu-Gadu/src/gg_proto.h1
2 files changed, 3 insertions, 30 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)
diff --git a/protocols/Gadu-Gadu/src/gg_proto.h b/protocols/Gadu-Gadu/src/gg_proto.h
index de9c3af0e1..e59f8424e5 100644
--- a/protocols/Gadu-Gadu/src/gg_proto.h
+++ b/protocols/Gadu-Gadu/src/gg_proto.h
@@ -52,7 +52,6 @@ struct GGPROTO : public PROTO_INTERFACE, public MZeroedObject
virtual int __cdecl FileResume( HANDLE hTransfer, int* action, const TCHAR** szFilename );
virtual DWORD_PTR __cdecl GetCaps( int type, HANDLE hContact = NULL );
- virtual HICON __cdecl GetIcon( int iconIndex );
virtual int __cdecl GetInfo( HANDLE hContact, int infoType );
virtual HANDLE __cdecl SearchBasic( const TCHAR* id );