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/JabberG/src/jabber_icolib.cpp | 2 -- protocols/JabberG/src/jabber_proto.cpp | 33 ++++----------------------------- protocols/JabberG/src/jabber_proto.h | 3 --- 3 files changed, 4 insertions(+), 34 deletions(-) (limited to 'protocols/JabberG/src') diff --git a/protocols/JabberG/src/jabber_icolib.cpp b/protocols/JabberG/src/jabber_icolib.cpp index 71bfea3dc6..23a704f48c 100644 --- a/protocols/JabberG/src/jabber_icolib.cpp +++ b/protocols/JabberG/src/jabber_icolib.cpp @@ -180,8 +180,6 @@ void CJabberProto::IconsInit(void) m_transportProtoTableStartIndex = (int *)mir_alloc(sizeof(int) * SIZEOF(TransportProtoTable)); for (int i = 0; i < SIZEOF(TransportProtoTable); i++) m_transportProtoTableStartIndex[i] = -1; - - m_hProtoIcon = (HANDLE)CallService(MS_SKIN2_ISMANAGEDICON, (WPARAM)LoadSkinnedProtoIcon(m_szModuleName, ID_STATUS_ONLINE), 0); } HANDLE CJabberProto::GetIconHandle(int iconId) diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index 520c0b9954..29e17f7444 100644 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -85,15 +85,14 @@ CJabberProto::CJabberProto(const char* aProtoName, const TCHAR *aUserName) : m_lstJabberFeatCapPairsDynamic(2), m_uEnabledFeatCapsDynamic(0) { + ProtoConstructor(this, aProtoName, aUserName); + InitializeCriticalSection(&m_csModeMsgMutex); InitializeCriticalSection(&m_csLists); InitializeCriticalSection(&m_csLastResourceMap); m_szXmlStreamToBeInitialized = NULL; - m_iVersion = 2; - m_tszUserName = mir_tstrdup(aUserName); - m_szModuleName = mir_strdup(aProtoName); m_szProtoName = mir_strdup(aProtoName); _strlwr(m_szProtoName); m_szProtoName[0] = toupper(m_szProtoName[0]); @@ -221,8 +220,6 @@ CJabberProto::~CJabberProto() delete m_pInfoFrame; - Skin_RemoveIconHandle(m_hProtoIcon); - DestroyHookableEvent(m_hEventNudge); DestroyHookableEvent(m_hEventXStatusIconChanged); DestroyHookableEvent(m_hEventXStatusChanged); @@ -249,8 +246,6 @@ CJabberProto::~CJabberProto() mir_free(m_szStreamId); mir_free(m_szProtoName); - mir_free(m_szModuleName); - mir_free(m_tszUserName); int i; for (i=0; i < m_lstTransports.getCount(); i++) @@ -266,6 +261,8 @@ CJabberProto::~CJabberProto() } m_lstJabberFeatCapPairsDynamic.destroy(); m_hPrivacyMenuItems.destroy(); + + ProtoDestructor(this); } //////////////////////////////////////////////////////////////////////////////////////// @@ -704,28 +701,6 @@ DWORD_PTR __cdecl CJabberProto::GetCaps(int type, HANDLE hContact) return 0; } -//////////////////////////////////////////////////////////////////////////////////////// -// GetIcon - loads an icon for the contact list - -HICON __cdecl CJabberProto::GetIcon(int iconIndex) -{ - if (LOWORD(iconIndex) == PLI_PROTOCOL) { - if (iconIndex & PLIF_ICOLIBHANDLE) - return (HICON)m_hProtoIcon; - - bool big = (iconIndex & PLIF_SMALL) == 0; - HICON hIcon = Skin_GetIconByHandle(m_hProtoIcon, big); - - if (iconIndex & PLIF_ICOLIB) - return hIcon; - - HICON hIcon2 = CopyIcon(hIcon); - g_ReleaseIcon(hIcon); - return hIcon2; - } - return NULL; -} - //////////////////////////////////////////////////////////////////////////////////////// // GetInfo - retrieves a contact info diff --git a/protocols/JabberG/src/jabber_proto.h b/protocols/JabberG/src/jabber_proto.h index 799f97a90e..9f0a9f286a 100644 --- a/protocols/JabberG/src/jabber_proto.h +++ b/protocols/JabberG/src/jabber_proto.h @@ -172,7 +172,6 @@ struct CJabberProto : 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); @@ -1001,8 +1000,6 @@ private: int m_nMenuResourceItems; HANDLE* m_phMenuResourceItems; - - HANDLE m_hProtoIcon; }; extern LIST g_Instances; -- cgit v1.2.3