summaryrefslogtreecommitdiff
path: root/plugins/Scriver/src/globals.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-11-02 14:11:01 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-11-02 14:11:01 +0000
commit75b1ff75c42644eb36552762652e4b0c9ff071bc (patch)
tree238f026ef373d30a395846f38c302a81961b14ac /plugins/Scriver/src/globals.cpp
parent2caba72d51b09368801f23dd8951d589ab4dc809 (diff)
final switch to the typed icolib api
git-svn-id: http://svn.miranda-ng.org/main/trunk@2152 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Scriver/src/globals.cpp')
-rw-r--r--plugins/Scriver/src/globals.cpp38
1 files changed, 16 insertions, 22 deletions
diff --git a/plugins/Scriver/src/globals.cpp b/plugins/Scriver/src/globals.cpp
index 6e9a23b22b..113cf79437 100644
--- a/plugins/Scriver/src/globals.cpp
+++ b/plugins/Scriver/src/globals.cpp
@@ -118,37 +118,34 @@ BOOL IsStaticIcon(HICON hIcon) {
}
void ReleaseIconSmart(HICON hIcon) {
- if (!IsStaticIcon(hIcon)) {
- DWORD result = CallService(MS_SKIN2_RELEASEICON,(WPARAM)hIcon, 0);
- if ( result == 1 || result == CALLSERVICE_NOTFOUND)
- DestroyIcon(hIcon);
- }
+ if (!IsStaticIcon(hIcon))
+ Skin_ReleaseIcon(hIcon);
}
int ImageList_AddIcon_Ex(HIMAGELIST hIml, int id) {
HICON hIcon = LoadSkinnedIcon(id);
int res = ImageList_AddIcon(hIml, hIcon);
- CallService(MS_SKIN2_RELEASEICON,(WPARAM)hIcon, 0);
+ Skin_ReleaseIcon(hIcon);
return res;
}
int ImageList_AddIcon_Ex2(HIMAGELIST hIml, HICON hIcon) {
int res = ImageList_AddIcon(hIml, hIcon);
- CallService(MS_SKIN2_RELEASEICON,(WPARAM)hIcon, 0);
+ Skin_ReleaseIcon(hIcon);
return res;
}
int ImageList_ReplaceIcon_Ex(HIMAGELIST hIml, int nIndex, int id) {
HICON hIcon = LoadSkinnedIcon(id);
int res = ImageList_ReplaceIcon(hIml, nIndex, hIcon);
- CallService(MS_SKIN2_RELEASEICON,(WPARAM)hIcon, 0);
+ Skin_ReleaseIcon(hIcon);
return res;
}
int ImageList_AddIcon_ProtoEx(HIMAGELIST hIml, const char* szProto, int status) {
HICON hIcon = LoadSkinnedProtoIcon(szProto, status);
int res = ImageList_AddIcon(hIml, hIcon);
- CallService(MS_SKIN2_RELEASEICON,(WPARAM)hIcon, 0);
+ Skin_ReleaseIcon(hIcon);
return res;
}
@@ -177,15 +174,13 @@ void RegisterIcons(void)
void ReleaseIcons()
{
- int i;
- for (i = 0; i < SIZEOF(hIconList); i++) {
- if (hIconList[i] != NULL) {
- CallService(MS_SKIN2_RELEASEICON, (WPARAM)hIconList[i], 0);
- }
- }
- CallService(MS_SKIN2_RELEASEICON, (WPARAM)g_dat->hMsgIcon, 0);
- CallService(MS_SKIN2_RELEASEICON, (WPARAM)g_dat->hMsgIconBig, 0);
- CallService(MS_SKIN2_RELEASEICON, (WPARAM)g_dat->hIconChatBig, 0);
+ for (int i = 0; i < SIZEOF(hIconList); i++)
+ if (hIconList[i] != NULL)
+ Skin_ReleaseIcon(hIconList[i]);
+
+ Skin_ReleaseIcon(g_dat->hMsgIcon);
+ Skin_ReleaseIcon(g_dat->hMsgIconBig);
+ Skin_ReleaseIcon(g_dat->hIconChatBig);
}
HICON GetCachedIcon(const char *name)
@@ -202,13 +197,12 @@ HICON GetCachedIcon(const char *name)
void LoadGlobalIcons() {
int i;
int overlayIcon;
- for (i = 0; i < SIZEOF(iconList); i++) {
- hIconList[i] = (HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM)iconList[i].name);
- }
+ for (i = 0; i < SIZEOF(iconList); i++)
+ hIconList[i] = Skin_GetIcon(iconList[i].name);
g_dat->hMsgIcon = LoadSkinnedIcon(SKINICON_EVENT_MESSAGE);
g_dat->hMsgIconBig = LoadSkinnedIconBig(SKINICON_EVENT_MESSAGE);
- g_dat->hIconChatBig = (HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM)"chat_window");
+ g_dat->hIconChatBig = Skin_GetIcon("chat_window");
ImageList_RemoveAll(g_dat->hButtonIconList);
ImageList_RemoveAll(g_dat->hChatButtonIconList);