summaryrefslogtreecommitdiff
path: root/ExternalAPI/m_flags.h
diff options
context:
space:
mode:
Diffstat (limited to 'ExternalAPI/m_flags.h')
-rw-r--r--ExternalAPI/m_flags.h51
1 files changed, 25 insertions, 26 deletions
diff --git a/ExternalAPI/m_flags.h b/ExternalAPI/m_flags.h
index 5130190..aafa2fb 100644
--- a/ExternalAPI/m_flags.h
+++ b/ExternalAPI/m_flags.h
@@ -34,18 +34,40 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#endif
/* Load a country flag icon from the skin library. v0.1.0.0+
-The retrieved HICON SHOULDN'T be destroyed, it is managed by IcoLib,
-it should be released using MS_SKIN2_RELEASEICON after use.
+The retrieved icon should be released using MS_SKIN2_RELEASEICON after use.
The country numbers can be retrieved using MS_UTILS_GETCOUNTRYLIST.
Another way to get the country numbers are the CTRY_* constants in winnls.h of WinAPI.
To retrieve the country number from a locale, call GetLocaleInfo().
with LOCALE_ICOUNTRY.
wParam=countryNumber
- lParam=(BOOL)fReturnHandle (nonzero to to retrieve the icolib handle instead of the HICON)
+ lParam=(BOOL)fReturnHandle (nonzero to to retrieve the icolib handle instead of the icon)
Returns a icon handle (HICON) on success, NULL on error.
*/
#define MS_FLAGS_LOADFLAGICON "Flags/LoadFlagIcon"
+#if !defined(FLAGS_NOHELPERFUNCTIONS)
+__inline static HICON LoadFlagIcon(int countryNumber) {
+ if(!ServiceExists(MS_FLAGS_LOADFLAGICON)) return NULL;
+ return (HICON)CallService(MS_FLAGS_LOADFLAGICON,countryNumber,0);
+}
+__inline static HANDLE LoadFlagIconHandle(int countryNumber) {
+ if(!ServiceExists(MS_FLAGS_LOADFLAGICON)) return NULL;
+ return (HICON)CallService(MS_FLAGS_LOADFLAGICON,countryNumber,1);
+}
+#endif
+
+#define CTRY_UNSPECIFIED 0
+#define CTRY_OTHER 9999
+#define CTRY_UNKNOWN 0xFFFF
+
+/* Create a merged country flag icon. v0.1.0.0+
+The retrieved icon should be released using DestroyIcon() after use.
+ wParam=countryNumberUpper
+ lParam=countryNumberLower
+Returns a icon handle (HICON) on success, NULL on error.
+*/
+#define MS_FLAGS_CREATEMERGEDFLAGICON "Flags/CreateMergedFlagIcon"
+
/* Get a corresponding country given an (external) IP address. v0.1.0.0+
The retrieved number can be converted to a normal country name
using MS_UTILS_GETCOUNTRYBYNUMBER.
@@ -56,14 +78,6 @@ or 0xFFFF on failure (MS_UTILS_GETCOUNTRYBYNUMBER returns "Unknown" for this).
*/
#define MS_FLAGS_IPTOCOUNTRY "Flags/IpToCountry"
-/* Create a merged country flag icon. v0.1.0.0+
-The retrieved icon should be released using DestroyIcon() after use.
- wParam=countryNumberUpper
- lParam=countryNumberLower
-Returns a icon handle (HICON) on success, NULL on error.
-*/
-#define MS_FLAGS_CREATEMERGEDFLAGICON "Flags/CreateMergedFlagIcon"
-
/* Detect the origin country of a contact. v0.1.0.0+
This uses the contacts's IP first, and falls back on using
CNF_COUNTRY and CNF_COCOUNTRY of contact details.
@@ -77,10 +91,6 @@ or 0xFFFF on failure (MS_UTILS_GETCOUNTRYBYNUMBER returns "Unknown" for this).
#define MS_FLAGS_DETECTCONTACTORIGINCOUNTRY "Flags/DetectContactOriginCountry"
#define MS_FLAGS_GETCONTACTORIGINCOUNTRY "Flags/GetContactOriginCountry" //for beta version 0.1.1.0
-#define CTRY_UNSPECIFIED 0
-#define CTRY_OTHER 9999
-#define CTRY_UNKNOWN 0xFFFF
-
#if !defined(FLAGS_NOSETTINGS) && defined(EXTRA_ICON_ADV2)
#define SETTING_SHOWSTATUSICONFLAG_DEFAULT 1
#define SETTING_SHOWEXTRAIMGFLAG_DEFAULT 1
@@ -89,15 +99,4 @@ or 0xFFFF on failure (MS_UTILS_GETCOUNTRYBYNUMBER returns "Unknown" for this).
#define SETTING_USEIPTOCOUNTRY_DEFAULT 1
#endif
-#ifndef FLAGS_NOHELPERFUNCTIONS
-__inline static HICON LoadFlagIcon(int countryNumber) {
- if(!ServiceExists(MS_FLAGS_LOADFLAGICON)) return NULL;
- return (HICON)CallService(MS_FLAGS_LOADFLAGICON,countryNumber,0);
-}
-__inline static HANDLE LoadFlagIconHandle(int countryNumber) {
- if(!ServiceExists(MS_FLAGS_LOADFLAGICON)) return NULL;
- return (HICON)CallService(MS_FLAGS_LOADFLAGICON,countryNumber,1);
-}
-#endif
-
#endif // M_FLAGS_H