]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/utils.cpp
A slightly modified version of Patch #1197468. Keeps track of pending
[wxWidgets.git] / src / msw / utils.cpp
index cb4eba01722b599012352ec58ac7d56369df5e8a..c8be5b77c9c92cc7951a5e296c1ef02b54ce26bf 100644 (file)
 #include "wx/msw/private.h"     // includes <windows.h>
 #include "wx/msw/missing.h"     // CHARSET_HANGUL
 
-#if defined(__GNUWIN32_OLD__) || defined(__WXWINCE__) \
-    || defined(__CYGWIN32__)
+#if defined(__CYGWIN__)
+    //CYGWIN gives annoying warning about runtime stuff if we don't do this
+#   define USE_SYS_TYPES_FD_SET
+#   include <sys/types.h>
+#endif
+
+// Doesn't work with Cygwin at present
+#if wxUSE_SOCKETS && (defined(__GNUWIN32_OLD__) || defined(__WXWINCE__) || defined(__CYGWIN32__))
     // apparently we need to include winsock.h to get WSADATA and other stuff
     // used in wxGetFullHostName() with the old mingw32 versions
     #include <winsock.h>
@@ -148,7 +154,7 @@ bool wxGetHostName(wxChar *buf, int maxSize)
 // get full hostname (with domain name if possible)
 bool wxGetFullHostName(wxChar *buf, int maxSize)
 {
-#if !defined( __WXMICROWIN__) && wxUSE_DYNAMIC_LOADER
+#if !defined( __WXMICROWIN__) && wxUSE_DYNAMIC_LOADER && wxUSE_SOCKETS
     // TODO should use GetComputerNameEx() when available
 
     // we don't want to always link with Winsock DLL as we might not use it at
@@ -390,7 +396,7 @@ const wxChar* wxGetHomeDir(wxString *pstr)
         strDir = windowsPath;
     #endif
 #elif defined(__WXWINCE__)
-      // Nothing
+    strDir = wxT("\\");
 #else
     strDir.clear();
 
@@ -460,16 +466,6 @@ wxChar *wxGetUserHome(const wxString& WXUNUSED(user))
     return (wxChar *)wxGetHomeDir(&s_home);
 }
 
-bool wxDirExists(const wxString& dir)
-{
-#ifdef __WXMICROWIN__
-    return wxPathExist(dir);
-#elif defined(__WIN32__)
-    DWORD attribs = GetFileAttributes(dir);
-    return ((attribs != (DWORD)-1) && (attribs & FILE_ATTRIBUTE_DIRECTORY));
-#endif // Win32/__WXMICROWIN__
-}
-
 bool wxGetDiskSpace(const wxString& path, wxLongLong *pTotal, wxLongLong *pFree)
 {
 #ifdef __WXWINCE__
@@ -1210,6 +1206,11 @@ wxToolkitInfo& wxAppTraits::GetToolkitInfo()
             s_major = info.dwMajorVersion;
             s_minor = info.dwMinorVersion;
 
+#ifdef __SMARTPHONE__
+            s_ver = wxWINDOWS_SMARTPHONE;
+#elif defined(__POCKETPC__)
+            s_ver = wxWINDOWS_POCKETPC;
+#else
             switch ( info.dwPlatformId )
             {
                 case VER_PLATFORM_WIN32s:
@@ -1226,9 +1227,9 @@ wxToolkitInfo& wxAppTraits::GetToolkitInfo()
 #ifdef __WXWINCE__
                 case VER_PLATFORM_WIN32_CE:
                     s_ver = wxWINDOWS_CE;
-                    break;
 #endif
             }
+#endif
         }
     }
 
@@ -1379,7 +1380,7 @@ extern WXDLLIMPEXP_BASE long wxEncodingToCodepage(wxFontEncoding encoding)
         case wxFONTENCODING_CP1255:         ret = 1255; break;
         case wxFONTENCODING_CP1256:         ret = 1256; break;
         case wxFONTENCODING_CP1257:         ret = 1257; break;
-        case wxFONTENCODING_EUC_JP:         ret = 51932; break;
+        case wxFONTENCODING_EUC_JP:         ret = 20932; break;
         case wxFONTENCODING_MACROMAN:       ret = 10000; break;
         case wxFONTENCODING_MACJAPANESE:    ret = 10001; break;
         case wxFONTENCODING_MACCHINESETRAD: ret = 10002; break;
@@ -1415,7 +1416,7 @@ extern long wxCharsetToCodepage(const wxChar *name)
     if ( !name )
         return -1;
 
-    wxFontEncoding enc = wxFontMapper::Get()->CharsetToEncoding(name, false);
+    wxFontEncoding enc = wxFontMapperBase::Get()->CharsetToEncoding(name, false);
     if ( enc == wxFONTENCODING_SYSTEM )
         return -1;