From aa387fa04aa096d163932d3f5f9711a2f146c6f0 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 23 Feb 2013 19:43:21 +0000 Subject: - 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 --- protocols/Gadu-Gadu/src/gg_proto.cpp | 32 +++----------------------------- protocols/Gadu-Gadu/src/gg_proto.h | 1 - 2 files changed, 3 insertions(+), 30 deletions(-) (limited to 'protocols/Gadu-Gadu') 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); } ////////////////////////////////////////////////////////// @@ -193,30 +191,6 @@ DWORD_PTR GGPROTO::GetCaps(int type, HANDLE hContact) return 0; } -////////////////////////////////////////////////////////// -// 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 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 ); -- cgit v1.2.3