diff options
author | George Hazan <george.hazan@gmail.com> | 2012-06-10 14:46:58 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-06-10 14:46:58 +0000 |
commit | 101ca36412b3e7b8851b6b48a4f6cbc17d9f9eff (patch) | |
tree | a846c60f7c2a7df17b694deba92e7f6df3bbb882 /plugins/UserInfoEx/mir_icolib.cpp | |
parent | a3fdadd09f12f6b246b11a5156bf6f0358e9a5f8 (diff) |
bitmap operations were removed from TopToolBar and replaced with IcoLib
git-svn-id: http://svn.miranda-ng.org/main/trunk@379 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/UserInfoEx/mir_icolib.cpp')
-rw-r--r-- | plugins/UserInfoEx/mir_icolib.cpp | 65 |
1 files changed, 26 insertions, 39 deletions
diff --git a/plugins/UserInfoEx/mir_icolib.cpp b/plugins/UserInfoEx/mir_icolib.cpp index 4e8da429a6..ef5d22e487 100644 --- a/plugins/UserInfoEx/mir_icolib.cpp +++ b/plugins/UserInfoEx/mir_icolib.cpp @@ -210,7 +210,7 @@ static VOID IcoLib_CheckIconPackVersion(LPTSTR szIconPack) **/
HICON IcoLib_GetIcon(LPCSTR pszIcon)
{
- return (pszIcon) ? (HICON)CallService(MS_SKIN2_GETICON, NULL, (LPARAM) pszIcon) : NULL;
+ return (pszIcon) ? Skin_GetIcon(pszIcon) : NULL;
}
/**
@@ -222,7 +222,7 @@ HICON IcoLib_GetIcon(LPCSTR pszIcon) **/
HICON IcoLib_GetIconByHandle(HANDLE hIconItem)
{
- return (HICON)CallService(MS_SKIN2_GETICONBYHANDLE, NULL, (LPARAM) hIconItem);
+ return Skin_GetIconByHandle(hIconItem);
}
/**
@@ -288,54 +288,42 @@ static HANDLE IcoLib_RegisterIconHandleEx(LPSTR szIconID, LPSTR szDescription, L {
HANDLE hIconHandle = NULL;
- if (szIconID && szDescription && szSection)
- {
- SKINICONDESC sid;
-
- ZeroMemory(&sid, sizeof(sid));
+ if (szIconID && szDescription && szSection) {
+ SKINICONDESC sid = { 0 };
sid.cbSize = sizeof(sid);
sid.flags = SIDF_ALL_TCHAR;
sid.pszName = szIconID;
sid.ptszDescription = mir_a2t(szDescription);
sid.ptszSection = mir_a2t(szSection);
- if (sid.ptszDescription && sid.ptszSection)
- {
- switch (Size)
- {
- // small icons (16x16)
- case 0:
- {
- sid.cx = GetSystemMetrics(SM_CXSMICON);
- sid.cy = GetSystemMetrics(SM_CYSMICON);
- break;
- }
- // normal icons (32x32)
- case 1:
- {
- sid.cx = GetSystemMetrics(SM_CXICON);
- sid.cy = GetSystemMetrics(SM_CYICON);
- break;
- }
- // custom icon size
- default:
- {
- sid.cx = sid.cy = Size;
- break;
- }
+ if (sid.ptszDescription && sid.ptszSection) {
+ switch (Size) {
+ // small icons (16x16)
+ case 0:
+ sid.cx = GetSystemMetrics(SM_CXSMICON);
+ sid.cy = GetSystemMetrics(SM_CYSMICON);
+ break;
+
+ // normal icons (32x32)
+ case 1:
+ sid.cx = GetSystemMetrics(SM_CXICON);
+ sid.cy = GetSystemMetrics(SM_CYICON);
+ break;
+
+ // custom icon size
+ default:
+ sid.cx = sid.cy = Size;
+ break;
}
sid.ptszDefaultFile = szDefaultFile;
if (sid.ptszDefaultFile && sid.ptszDefaultFile[0])
- {
- sid.iDefaultIndex = ICONINDEX(idIcon);
- }
- else
- {
+ sid.iDefaultIndex = -idIcon;
+ else {
sid.hDefaultIcon = hDefIcon;
sid.iDefaultIndex = -1;
}
- hIconHandle = (HANDLE) CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ hIconHandle = Skin_AddIcon(&sid);
}
MIR_FREE(sid.ptszDescription);
MIR_FREE(sid.ptszSection);
@@ -404,8 +392,7 @@ VOID IcoLib_LoadModule() ghDefIcon = (HICON)LoadImage(ghInst, MAKEINTRESOURCE(IDI_DEFAULT), IMAGE_ICON,
GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0);
- for (i = 0; i < SIZEOF(icoDesc); i++)
- {
+ for (i = 0; i < SIZEOF(icoDesc); i++) {
IcoLib_RegisterIconHandleEx(
icoDesc[i].pszName, icoDesc[i].pszDesc, icoDesc[i].pszSection,
szDefaultFile, icoDesc[i].idResource, icoDesc[i].size, ghDefIcon);
|