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/JabberG | |
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/JabberG')
-rw-r--r-- | protocols/JabberG/src/jabber_icolib.cpp | 2 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_proto.cpp | 33 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_proto.h | 3 |
3 files changed, 4 insertions, 34 deletions
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);
}
////////////////////////////////////////////////////////////////////////////////////////
@@ -705,28 +702,6 @@ DWORD_PTR __cdecl CJabberProto::GetCaps(int type, HANDLE hContact) }
////////////////////////////////////////////////////////////////////////////////////////
-// 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
int __cdecl CJabberProto::GetInfo(HANDLE hContact, int /*infoType*/)
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<CJabberProto> g_Instances;
|