summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src/jabber_icolib.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-11-03 20:16:42 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-11-03 20:16:42 +0000
commitf12d8b56f2894e94491bd7424d69f595d285f01f (patch)
tree3f54d66c8c248bb456da1cb0c5cc31661f144e5f /protocols/JabberG/src/jabber_icolib.cpp
parent1b1a54dc156bec90be3ddc337c17b4e67179d4ea (diff)
no more MS_CLIST_EXTRA_ADD_ICON in the application code
git-svn-id: http://svn.miranda-ng.org/main/trunk@2175 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/JabberG/src/jabber_icolib.cpp')
-rw-r--r--protocols/JabberG/src/jabber_icolib.cpp54
1 files changed, 4 insertions, 50 deletions
diff --git a/protocols/JabberG/src/jabber_icolib.cpp b/protocols/JabberG/src/jabber_icolib.cpp
index 689ace5b09..828951e4ea 100644
--- a/protocols/JabberG/src/jabber_icolib.cpp
+++ b/protocols/JabberG/src/jabber_icolib.cpp
@@ -84,20 +84,20 @@ static int skinStatusToJabberStatus[] = {0,1,2,3,4,4,6,7,2,2};
///////////////////////////////////////////////////////////////////////////////
// CIconPool class
+
int CIconPool::CPoolItem::cmp(const CPoolItem *p1, const CPoolItem *p2)
{
return lstrcmpA(p1->m_name, p2->m_name);
}
CIconPool::CPoolItem::CPoolItem():
- m_name(NULL), m_szIcolibName(NULL), m_hIcolibItem(NULL), m_hClistItem(NULL)
+ m_name(NULL), m_szIcolibName(NULL), m_hIcolibItem(NULL)
{
}
CIconPool::CPoolItem::~CPoolItem()
{
- if (m_hIcolibItem && m_szIcolibName)
- {
+ if (m_hIcolibItem && m_szIcolibName) {
CallService(MS_SKIN2_REMOVEICON, 0, (LPARAM)m_szIcolibName);
mir_free(m_szIcolibName);
}
@@ -114,8 +114,7 @@ CIconPool::CIconPool(CJabberProto *proto):
CIconPool::~CIconPool()
{
- if (m_hOnExtraIconsRebuild)
- {
+ if (m_hOnExtraIconsRebuild) {
UnhookEvent(m_hOnExtraIconsRebuild);
m_hOnExtraIconsRebuild = NULL;
}
@@ -129,7 +128,6 @@ void CIconPool::RegisterIcon(const char *name, const char *filename, int iconid,
CPoolItem *item = new CPoolItem;
item->m_name = mir_strdup(name);
item->m_szIcolibName = mir_strdup(szSettingName);
- item->m_hClistItem = NULL;
SKINICONDESC sid = {0};
sid.cbSize = sizeof(SKINICONDESC);
@@ -168,35 +166,6 @@ HICON CIconPool::GetIcon(const char *name, bool big)
return NULL;
}
-HANDLE CIconPool::GetClistHandle(const char *name)
-{
- if (!name)
- return (HANDLE)-1;
-
- if (!ExtraIconsSupported())
- return (HANDLE)-1;
-
- if (!m_hOnExtraIconsRebuild)
- {
- int (__cdecl CIconPool::*hookProc)(WPARAM, LPARAM);
- hookProc = &CIconPool::OnExtraIconsRebuild;
- m_hOnExtraIconsRebuild = HookEventObj(ME_CLIST_EXTRA_LIST_REBUILD, (MIRANDAHOOKOBJ)*(void **)&hookProc, this);
- }
-
- if (CPoolItem *item = FindItemByName(name))
- {
- if (item->m_hClistItem)
- return item->m_hClistItem;
-
- HICON hIcon = Skin_GetIconByHandle(item->m_hIcolibItem);
- item->m_hClistItem = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)hIcon, 0);
- g_ReleaseIcon(hIcon);
- return item->m_hClistItem;
- }
-
- return (HANDLE)-1;
-}
-
CIconPool::CPoolItem *CIconPool::FindItemByName(const char *name)
{
CPoolItem item;
@@ -204,21 +173,6 @@ CIconPool::CPoolItem *CIconPool::FindItemByName(const char *name)
return m_items.find(&item);
}
-int CIconPool::OnExtraIconsRebuild(WPARAM, LPARAM)
-{
- for (int i = 0; i < m_items.getCount(); ++i)
- m_items[i].m_hClistItem = NULL;
-
- return 0;
-}
-
-bool CIconPool::ExtraIconsSupported()
-{
- static int res = -1;
- if (res < 0) res = ServiceExists(MS_CLIST_EXTRA_ADD_ICON) ? 1 : 0;
- return res ? true : false;
-}
-
/////////////////////////////////////////////////////////////////////////////////////////
// Icons init