diff options
author | George Hazan <george.hazan@gmail.com> | 2012-11-19 12:51:53 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-11-19 12:51:53 +0000 |
commit | 32dedc767dec565c576b78b786e7a95d76ac806e (patch) | |
tree | 0f2eb209b3716569a8e3c3ef146a91f402ebbb4d /include | |
parent | adf7367cfdb57b32aadeb74af45dce9a6a3c02a5 (diff) |
- added another helper, ExtraIcon_Clear, to remove an icon from slot;
- added ability to pass IcoLib handles instead of icons' names
git-svn-id: http://svn.miranda-ng.org/main/trunk@2371 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'include')
-rw-r--r-- | include/m_extraicons.h | 40 | ||||
-rw-r--r-- | include/m_icq.h | 2 | ||||
-rw-r--r-- | include/m_netlib.h | 2 |
3 files changed, 30 insertions, 14 deletions
diff --git a/include/m_extraicons.h b/include/m_extraicons.h index 921346ad3c..2d38fe7db4 100644 --- a/include/m_extraicons.h +++ b/include/m_extraicons.h @@ -117,11 +117,12 @@ typedef struct { typedef struct {
int cbSize;
- HANDLE hExtraIcon; // Value returned by MS_EXTRAICON_REGISTER
- HANDLE hContact; // Contact to set the extra icon
- union { // The icon to be set. This depends on the type of the extra icon:
- HANDLE hImage; // Value returned by MS_CLIST_EXTRA_ADD_ICON (if EXTRAICON_TYPE_CALLBACK)
- const char *icoName; // Name of the icon registered with icolib (if EXTRAICON_TYPE_ICOLIB)
+ HANDLE hExtraIcon; // Value returned by MS_EXTRAICON_REGISTER
+ HANDLE hContact; // Contact to set the extra icon
+ union { // The icon to be set. This depends on the type of the extra icon:
+ HANDLE hImage; // Value returned by MS_CLIST_EXTRA_ADD_ICON (if EXTRAICON_TYPE_CALLBACK)
+ // or the icolib icon handle (if EXTRAICON_TYPE_ICOLIB)
+ const char *icoName; // Name of the icon registered with icolib (if EXTRAICON_TYPE_ICOLIB)
};
} EXTRAICON;
@@ -130,15 +131,19 @@ typedef struct { // Return: 0 on success
#define MS_EXTRAICON_SET_ICON "ExtraIcon/SetIcon"
-
+// Set an extra icon by icolib icon's name
+// wParam = (EXTRAICON *) Extra icon
+// Return: 0 on success
+#define MS_EXTRAICON_SET_ICON_BY_NAME "ExtraIcon/SetIconByName"
#ifndef _NO_WRAPPERS
#ifdef __cplusplus
-static HANDLE ExtraIcon_Register(const char *name, const char *description, const char *descIcon,
- MIRANDAHOOK RebuildIcons,
- MIRANDAHOOK ApplyIcon,
- MIRANDAHOOKPARAM OnClick = NULL, LPARAM onClickParam = 0)
+static HANDLE ExtraIcon_Register(
+ const char *name, const char *description, const char *descIcon,
+ MIRANDAHOOK RebuildIcons,
+ MIRANDAHOOK ApplyIcon,
+ MIRANDAHOOKPARAM OnClick = NULL, LPARAM onClickParam = 0)
{
if (!ServiceExists(MS_EXTRAICON_REGISTER))
return NULL;
@@ -156,8 +161,9 @@ static HANDLE ExtraIcon_Register(const char *name, const char *description, cons return (HANDLE) CallService(MS_EXTRAICON_REGISTER, (WPARAM) &ei, 0);
}
-static HANDLE ExtraIcon_Register(const char *name, const char *description, const char *descIcon = NULL,
- MIRANDAHOOKPARAM OnClick = NULL, LPARAM onClickParam = 0)
+static HANDLE ExtraIcon_Register(
+ const char *name, const char *description, const char *descIcon = NULL,
+ MIRANDAHOOKPARAM OnClick = NULL, LPARAM onClickParam = 0)
{
if (!ServiceExists(MS_EXTRAICON_REGISTER))
return NULL;
@@ -190,6 +196,16 @@ static int ExtraIcon_SetIcon(HANDLE hExtraIcon, HANDLE hContact, const char *ico ei.hContact = hContact;
ei.icoName = icoName;
+ return CallService(MS_EXTRAICON_SET_ICON_BY_NAME, (WPARAM) &ei, 0);
+}
+
+static int ExtraIcon_Clear(HANDLE hExtraIcon, HANDLE hContact)
+{
+ EXTRAICON ei = { sizeof(ei) };
+ ei.hExtraIcon = hExtraIcon;
+ ei.hContact = hContact;
+ ei.icoName = NULL;
+
return CallService(MS_EXTRAICON_SET_ICON, (WPARAM) &ei, 0);
}
diff --git a/include/m_icq.h b/include/m_icq.h index e2378e3e7e..125eeef885 100644 --- a/include/m_icq.h +++ b/include/m_icq.h @@ -263,7 +263,7 @@ typedef struct { // Called from contact list in order to get index of custom status icon in list
// wParam = hContact
// lParam = 0
-// rerurn = (int) index of extra contact icon shifted <<16 (the low word will be normal status icon, the high will be xStatus Icon
+// rerurn = (int)index of extra contact icon shifted <<16 (the low word will be normal status icon, the high will be xStatus Icon
#define PS_ICQ_GETADVANCEDSTATUSICON "/GetAdvancedStatusIcon"
#endif // M_ICQ_H__
diff --git a/include/m_netlib.h b/include/m_netlib.h index 83b469e9c0..62b7512b69 100644 --- a/include/m_netlib.h +++ b/include/m_netlib.h @@ -435,7 +435,7 @@ typedef struct { // Converts numerical representation of IP in SOCKADDR_INET into string representation with IP and port
// IPv4 will be supplied in formats address:port or address
// IPv6 will be supplied in formats [address]:port or [address]
-// wParam = (WPARAM)(int) 0 - lParam - (sockaddr_gen*); 1 - lParam - (unsigned) in host byte order
+// wParam = (WPARAM)(int)0 - lParam - (sockaddr_gen*); 1 - lParam - (unsigned) in host byte order
// lParam = (LPARAM)(sockaddr_gen*) or (unsigned) numeric IP address structure
// Returns pointer to the string or NULL if not successful
#define MS_NETLIB_ADDRESSTOSTRING "Netlib/AddressToString"
|