+#else // Win16
+ return _("Windows 3.1");
+#endif // Win32/16
+}
+
+int wxAppTraits::GetOSVersion(int *verMaj, int *verMin)
+{
+ // cache the version info, it's not going to change
+ //
+ // NB: this is MT-safe, we may use these static vars from different threads
+ // but as they always have the same value it doesn't matter
+ static int s_ver = -1,
+ s_major = -1,
+ s_minor = -1;
+
+ if ( s_ver == -1 )
+ {
+ OSVERSIONINFO info;
+ wxZeroMemory(info);
+
+ s_ver = wxWINDOWS;
+ info.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+ if ( ::GetVersionEx(&info) )
+ {
+ s_major = info.dwMajorVersion;
+ s_minor = info.dwMinorVersion;
+
+ switch ( info.dwPlatformId )
+ {
+ case VER_PLATFORM_WIN32s:
+ s_ver = wxWIN32S;
+ break;
+
+ case VER_PLATFORM_WIN32_WINDOWS:
+ s_ver = wxWIN95;
+ break;
+
+ case VER_PLATFORM_WIN32_NT:
+ s_ver = wxWINDOWS_NT;
+ break;
+#ifdef __WXWINCE__
+ case VER_PLATFORM_WIN32_CE:
+ s_ver = wxWINDOWS_CE;
+ break;
+#endif
+ }
+ }
+ }
+
+ if ( verMaj )
+ *verMaj = s_major;
+ if ( verMin )
+ *verMin = s_minor;
+
+ return s_ver;
+}
+
+// ----------------------------------------------------------------------------
+// sleep functions
+// ----------------------------------------------------------------------------
+
+void wxUsleep(unsigned long milliseconds)
+{
+ ::Sleep(milliseconds);
+}
+
+void wxSleep(int nSecs)
+{
+ wxUsleep(1000*nSecs);
+}
+
+// ----------------------------------------------------------------------------
+// font encoding <-> Win32 codepage conversion functions
+// ----------------------------------------------------------------------------
+
+extern WXDLLIMPEXP_BASE long wxEncodingToCharset(wxFontEncoding encoding)
+{
+ switch ( encoding )
+ {
+ // although this function is supposed to return an exact match, do do
+ // some mappings here for the most common case of "standard" encoding
+ case wxFONTENCODING_SYSTEM:
+ return DEFAULT_CHARSET;
+
+ case wxFONTENCODING_ISO8859_1:
+ case wxFONTENCODING_ISO8859_15:
+ case wxFONTENCODING_CP1252:
+ return ANSI_CHARSET;
+
+#if !defined(__WXMICROWIN__)
+ // The following four fonts are multi-byte charsets
+ case wxFONTENCODING_CP932:
+ return SHIFTJIS_CHARSET;
+
+ case wxFONTENCODING_CP936:
+ return GB2312_CHARSET;
+
+ case wxFONTENCODING_CP949:
+ return HANGUL_CHARSET;
+
+ case wxFONTENCODING_CP950:
+ return CHINESEBIG5_CHARSET;
+
+ // The rest are single byte encodings
+ case wxFONTENCODING_CP1250:
+ return EASTEUROPE_CHARSET;
+
+ case wxFONTENCODING_CP1251:
+ return RUSSIAN_CHARSET;
+
+ case wxFONTENCODING_CP1253:
+ return GREEK_CHARSET;
+
+ case wxFONTENCODING_CP1254:
+ return TURKISH_CHARSET;
+
+ case wxFONTENCODING_CP1255:
+ return HEBREW_CHARSET;
+
+ case wxFONTENCODING_CP1256:
+ return ARABIC_CHARSET;
+
+ case wxFONTENCODING_CP1257:
+ return BALTIC_CHARSET;
+
+ case wxFONTENCODING_CP874:
+ return THAI_CHARSET;
+#endif // !__WXMICROWIN__
+
+ case wxFONTENCODING_CP437:
+ return OEM_CHARSET;
+
+ default:
+ // no way to translate this encoding into a Windows charset
+ return -1;
+ }