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/AimOscar/src/proto.cpp | 30 ++---------------------------- protocols/AimOscar/src/proto.h | 1 - 2 files changed, 2 insertions(+), 29 deletions(-) (limited to 'protocols/AimOscar') diff --git a/protocols/AimOscar/src/proto.cpp b/protocols/AimOscar/src/proto.cpp index db7b574e10..cd36490c21 100644 --- a/protocols/AimOscar/src/proto.cpp +++ b/protocols/AimOscar/src/proto.cpp @@ -20,9 +20,7 @@ along with this program. If not, see . CAimProto::CAimProto(const char* aProtoName, const TCHAR* aUserName) : chat_rooms(5) { - m_iVersion = 2; - m_tszUserName = mir_tstrdup(aUserName); - m_szModuleName = mir_strdup(aProtoName); + ProtoConstructor(this, aProtoName, aUserName); m_szProtoName = mir_strdup(aProtoName); _strlwr(m_szProtoName); m_szProtoName[0] = (char)toupper(m_szProtoName[0]); @@ -115,9 +113,8 @@ CAimProto::~CAimProto() mir_free(ADMIN_COOKIE); mir_free(username); - mir_free(m_szModuleName); - mir_free(m_tszUserName); mir_free(m_szProtoName); + ProtoDestructor(this); } //////////////////////////////////////////////////////////////////////////////////////// @@ -354,29 +351,6 @@ DWORD_PTR __cdecl CAimProto::GetCaps(int type, HANDLE hContact) return 0; } -//////////////////////////////////////////////////////////////////////////////////////// -// GetIcon - loads an icon for the contact list - -HICON __cdecl CAimProto::GetIcon(int iconIndex) -{ - if (LOWORD(iconIndex) == PLI_PROTOCOL) - { - if (iconIndex & PLIF_ICOLIBHANDLE) - return (HICON)GetIconHandle("aim"); - - bool big = (iconIndex & PLIF_SMALL) == 0; - HICON hIcon = LoadIconEx("aim", big); - - if (iconIndex & PLIF_ICOLIB) - return hIcon; - - hIcon = CopyIcon(hIcon); - ReleaseIconEx("aim", big); - return hIcon; - } - return NULL; -} - //////////////////////////////////////////////////////////////////////////////////////// // GetInfo - retrieves a contact info diff --git a/protocols/AimOscar/src/proto.h b/protocols/AimOscar/src/proto.h index bb4dc3c601..b964c3ce17 100644 --- a/protocols/AimOscar/src/proto.h +++ b/protocols/AimOscar/src/proto.h @@ -52,7 +52,6 @@ struct CAimProto : public PROTO_INTERFACE, public MZeroedObject virtual int __cdecl FileResume( HANDLE hTransfer, int* action, const PROTOCHAR** 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 PROTOCHAR* id ); -- cgit v1.2.3