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 | |
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')
-rw-r--r-- | plugins/MetaContacts/icons.cpp | 48 | ||||
-rw-r--r-- | plugins/MetaContacts/meta_services.cpp | 2 | ||||
-rw-r--r-- | plugins/MetaContacts/metacontacts.h | 2 |
3 files changed, 17 insertions, 35 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);
-}
diff --git a/plugins/MetaContacts/meta_services.cpp b/plugins/MetaContacts/meta_services.cpp index 1fe1d9af4d..94aea51fc9 100644 --- a/plugins/MetaContacts/meta_services.cpp +++ b/plugins/MetaContacts/meta_services.cpp @@ -2072,6 +2072,4 @@ void Meta_CloseHandles() // lets leave them, hey? (why?)
for (i=0;i<NB_SERVICES;i++) // Scan each 'HANDLE' and Destroy the service attached to it.
if (hServices[i]) DestroyServiceFunction(hServices[i]);
-
- DeinitIcons();
}
diff --git a/plugins/MetaContacts/metacontacts.h b/plugins/MetaContacts/metacontacts.h index 762bd17b8d..b0c896c5f8 100644 --- a/plugins/MetaContacts/metacontacts.h +++ b/plugins/MetaContacts/metacontacts.h @@ -62,6 +62,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <m_langpack.h>
#include <m_popup.h>
#include <m_cluiframes.h>
+#include <win2k.h>
#define META_PROTO "MetaContacts"
#define META_FILTER "MetaContactsFilter"
@@ -224,7 +225,6 @@ INT_PTR MyDBGetContactSetting(HANDLE hContact, const char *szModule, const char // IcoLib support
void InitIcons(void);
-void DeinitIcons(void);
typedef enum {I_MENUOFF, I_MENU, I_CONVERT, I_ADD, I_EDIT, I_SETDEFAULT, I_REMOVE} IconIndex;
HICON LoadIconEx(IconIndex i);
|