diff options
author | George Hazan <george.hazan@gmail.com> | 2013-06-07 19:34:51 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-06-07 19:34:51 +0000 |
commit | c67ee19b7db5bd93c5dbc11865834ff8dd1db924 (patch) | |
tree | 801930cd5de7bdbde4341d14cf7baf3b72ecca37 /plugins/Clist_modern/src/modern_clistmod.cpp | |
parent | 5c7d4293bec3c872c11ace6b0d0ac02c95dd3ac7 (diff) |
- clist_modern: we don't redeclare code services anymore;
- new CLIST_INTERFACE member: pfnGetContactIcon
- code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@4898 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_modern/src/modern_clistmod.cpp')
-rw-r--r-- | plugins/Clist_modern/src/modern_clistmod.cpp | 37 |
1 files changed, 11 insertions, 26 deletions
diff --git a/plugins/Clist_modern/src/modern_clistmod.cpp b/plugins/Clist_modern/src/modern_clistmod.cpp index 75bfc5a271..f3da87eae2 100644 --- a/plugins/Clist_modern/src/modern_clistmod.cpp +++ b/plugins/Clist_modern/src/modern_clistmod.cpp @@ -87,12 +87,7 @@ HICON cliGetIconFromStatusMode(HANDLE hContact, const char *szProto,int status) }
}
- return ske_ImageList_GetIcon(g_himlCListClc,ExtIconFromStatusMode(hContact,szProto,status),ILD_NORMAL);
-}
-
-int ExtIconFromStatusMode(HANDLE hContact, const char *szProto,int status)
-{
- return pcli->pfnIconFromStatusMode(szProto,status,hContact);
+ return ske_ImageList_GetIcon(g_himlCListClc,pcli->pfnIconFromStatusMode(szProto,status,hContact),ILD_NORMAL);
}
int cli_IconFromStatusMode(const char *szProto,int nStatus, HANDLE hContact)
@@ -134,29 +129,22 @@ int cli_IconFromStatusMode(const char *szProto,int nStatus, HANDLE hContact) return corecli.pfnIconFromStatusMode(szProto,nStatus,NULL);
}
-int GetContactIconC(ClcCacheEntry *cacheEntry)
+int cli_GetContactIcon(HANDLE hContact)
{
- return ExtIconFromStatusMode(cacheEntry->hContact,cacheEntry->m_cache_cszProto,cacheEntry->m_cache_cszProto == NULL ? ID_STATUS_OFFLINE : pdnce___GetStatus( cacheEntry ));
+ int res = corecli.pfnGetContactIcon(hContact);
+ if (res != -1)
+ res &= 0xFFFF;
+ return res;
}
-//lParam
-// 0 - default - return icon id in order: transport status icon, protostatus icon, meta is affected
-
-
-INT_PTR GetContactIcon(WPARAM wParam,LPARAM lParam)
+int GetContactIconC(ClcCacheEntry *p)
{
- int status;
- char *szProto = GetContactProto((HANDLE)wParam);
- if (szProto == NULL)
- status = ID_STATUS_OFFLINE;
- else
- status = db_get_w((HANDLE) wParam, szProto, "Status", ID_STATUS_OFFLINE);
- int res = ExtIconFromStatusMode((HANDLE)wParam,szProto,szProto == NULL?ID_STATUS_OFFLINE:status); //by FYR
- if (lParam == 0 && res != -1)
- res &= 0xFFFF;
- return res;
+ return pcli->pfnIconFromStatusMode(p->m_cache_cszProto,p->m_cache_cszProto == NULL ? ID_STATUS_OFFLINE : pdnce___GetStatus(p), p->hContact);
}
+//lParam
+// 0 - default - return icon id in order: transport status icon, protostatus icon, meta is affected
+
void UnLoadContactListModule() //unhooks noncritical events
{
UninitTrayMenu();
@@ -203,7 +191,6 @@ HRESULT PreLoadContactListModule() //initialize firstly hooks
//clist interface is empty yet so handles should check
- CreateServiceFunction(MS_CLIST_GETCONTACTICON, GetContactIcon);
CreateServiceFunction(MS_CLUI_GETCAPS, GetCapsService);
// catch langpack events
@@ -237,8 +224,6 @@ HRESULT CluiLoadModule() CreateServiceFunction(MS_CLIST_TOGGLESOUNDS,ToggleSounds);
CreateServiceFunction(MS_CLIST_SETUSEGROUPS,SetUseGroups);
- CreateServiceFunction(MS_CLIST_GETCONTACTICON,GetContactIcon);
-
MySetProcessWorkingSetSize = (BOOL (WINAPI*)(HANDLE,SIZE_T,SIZE_T))GetProcAddress(GetModuleHandle(_T("kernel32")),"SetProcessWorkingSetSize");
hCListImages = ImageList_Create(16, 16, ILC_MASK|ILC_COLOR32, 32, 0);
InitCustomMenus();
|