diff options
author | George Hazan <george.hazan@gmail.com> | 2012-07-19 22:48:01 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-07-19 22:48:01 +0000 |
commit | 95aa036670a1ce2c461ffd9bd3a586d191ee4675 (patch) | |
tree | cd244db18622df3462166ed39593ca924c890f6b /plugins/MetaContacts/icons.cpp | |
parent | f6e0db0590e2f8feeacc29d4e50007fbe358f9d5 (diff) |
- various icolib fixes;
- code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@1061 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MetaContacts/icons.cpp')
-rw-r--r-- | plugins/MetaContacts/icons.cpp | 48 |
1 files changed, 16 insertions, 32 deletions
diff --git a/plugins/MetaContacts/icons.cpp b/plugins/MetaContacts/icons.cpp index 829636be1f..e6cbc9a3a3 100644 --- a/plugins/MetaContacts/icons.cpp +++ b/plugins/MetaContacts/icons.cpp @@ -1,8 +1,5 @@ #include "metacontacts.h"
-HANDLE hIcoLibIconsChanged = NULL;
-
-
typedef struct {
char* szDescr;
char* szName;
@@ -20,26 +17,18 @@ static IconStruct iconList[] = { };
-HICON LoadIconEx(IconIndex i) {
- HICON hIcon;
-
- if (hIcoLibIconsChanged)
- hIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)iconList[(int)i].szName);
- else
- hIcon = (HICON)LoadImage(hInstance, MAKEINTRESOURCE(iconList[(int)i].defIconID), IMAGE_ICON, 0, 0, 0);
-
- return hIcon;
+HICON LoadIconEx(IconIndex i)
+{
+ return Skin_GetIcon(iconList[i].szName);
}
-
-void ReleaseIconEx(HICON hIcon) {
- if (hIcoLibIconsChanged)
- CallService(MS_SKIN2_RELEASEICON, (WPARAM)hIcon, 0);
- else
- DestroyIcon(hIcon);
+void ReleaseIconEx(HICON hIcon)
+{
+ Skin_ReleaseIcon(hIcon);
}
-int ReloadIcons(WPARAM wParam, LPARAM lParam) {
+int ReloadIcons(WPARAM wParam, LPARAM lParam)
+{
// fix menu icons
CLISTMENUITEM menu = {0};
@@ -73,29 +62,24 @@ int ReloadIcons(WPARAM wParam, LPARAM lParam) { return 0;
}
-void InitIcons(void) {
+void InitIcons(void)
+{
+ TCHAR path[MAX_PATH];
+ GetModuleFileName(hInstance, path, SIZEOF(path));
+
SKINICONDESC sid = {0};
- char path[MAX_PATH];
- int i;
-
sid.cbSize = sizeof(SKINICONDESC);
sid.pszSection = META_PROTO;
sid.pszDefaultFile = path;
- GetModuleFileName(hInstance, path, sizeof(path));
- for (i = 0; i < sizeof(iconList) / sizeof(IconStruct); ++i)
- {
- sid.pszDescription = Translate(iconList[i].szDescr);
+ for (int i=0; i < SIZEOF(iconList); ++i) {
+ sid.pszDescription = iconList[i].szDescr;
sid.pszName = iconList[i].szName;
sid.iDefaultIndex = -iconList[i].defIconID;
Skin_AddIcon(&sid);
}
- hIcoLibIconsChanged = HookEvent(ME_SKIN2_ICONSCHANGED, ReloadIcons);
+ HookEvent(ME_SKIN2_ICONSCHANGED, ReloadIcons);
ReloadIcons(0, 0);
}
-
-void DeinitIcons(void) {
- if (hIcoLibIconsChanged) UnhookEvent(hIcoLibIconsChanged);
-}
|