]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/utilscmn.cpp
Added wxDC::GetAsBitmap, and implemented wxWindowDC::DoGetAsBitmap on OS X, in order...
[wxWidgets.git] / src / common / utilscmn.cpp
index 79dae2984de2637e29728f5ea47ea6e4481935e3..5ee6713dbf0c8126df0ebf50d5402d8b6a2e171a 100644 (file)
@@ -440,13 +440,18 @@ void wxPlatform::ClearPlatforms()
 bool wxPlatform::Is(int platform)
 {
 #ifdef __WXMSW__
-    if (platform == wxMSW)
+    if (platform == wxOS_WINDOWS)
         return true;
 #endif
 #ifdef __WXWINCE__
-    if (platform == wxWinCE)
+    if (platform == wxOS_WINDOWS_CE)
         return true;
 #endif
+
+#if 0
+
+// FIXME: wxWinPocketPC and wxWinSmartPhone are unknown symbols
+
 #if defined(__WXWINCE__) && defined(__POCKETPC__)
     if (platform == wxWinPocketPC)
         return true;
@@ -455,32 +460,39 @@ bool wxPlatform::Is(int platform)
     if (platform == wxWinSmartPhone)
         return true;
 #endif
+
+#endif
+
 #ifdef __WXGTK__
-    if (platform == wxGTK)
+    if (platform == wxPORT_GTK)
         return true;
 #endif
 #ifdef __WXMAC__
-    if (platform == wxMac)
+    if (platform == wxPORT_MAC)
         return true;
 #endif
 #ifdef __WXX11__
-    if (platform == wxX11)
+    if (platform == wxPORT_X11)
         return true;
 #endif
 #ifdef __UNIX__
-    if (platform == wxUnix)
+    if (platform == wxOS_UNIX)
         return true;
 #endif
 #ifdef __WXMGL__
-    if (platform == wxMGL)
+    if (platform == wxPORT_MGL)
+        return true;
+#endif
+#ifdef __OS2__
+    if (platform == wxOS_OS2)
         return true;
 #endif
-#ifdef __WXOS2__
-    if (platform == wxOS2)
+#ifdef __WXPM__
+    if (platform == wxPORT_PM)
         return true;
 #endif
 #ifdef __WXCOCOA__
-    if (platform == wxCocoa)
+    if (platform == wxPORT_MAC)
         return true;
 #endif
 
@@ -715,9 +727,13 @@ bool wxLaunchDefaultBrowser(const wxString& urlOrig, int flags)
     wxUnusedVar(flags);
 
     // set the scheme of url to http if it does not have one
+    // RR: This doesn't work if the url is just a local path
     wxString url(urlOrig);
+#if 0
     if ( !wxURI(url).HasScheme() )
         url.Prepend(wxT("http://"));
+#endif
+
 
 #if defined(__WXMSW__)
 
@@ -804,8 +820,8 @@ bool wxLaunchDefaultBrowser(const wxString& urlOrig, int flags)
 #elif defined(__WXMAC__)
     OSStatus err;
     ICInstance inst;
-    SInt32 startSel;
-    SInt32 endSel;
+    long int startSel;
+    long int endSel;
 
     err = ICStart(&inst, 'STKA'); // put your app creator code here
     if (err == noErr)
@@ -830,8 +846,25 @@ bool wxLaunchDefaultBrowser(const wxString& urlOrig, int flags)
         wxLogDebug(wxT("ICStart error %d"), (int) err);
         return false;
     }
-#elif wxUSE_MIMETYPE
-    // Non-windows way
+#else 
+    // (non-Mac, non-MSW)
+
+#ifdef __UNIX__
+    if (wxTheApp->GetTraits()->GetDesktopEnvironment() == wxT("GNOME"))
+    {
+        wxArrayString errors;
+        wxArrayString output;
+        long res = wxExecute( wxT("gconftool-2 --get /desktop/gnome/applications/browser/exec"), output, errors, wxEXEC_NODISABLE );
+        if (res >= 0 && errors.GetCount() == 0)
+        {
+            wxString cmd = output[0];
+            cmd << _T(' ') << url;
+            if (wxExecute(cmd))
+                return true;
+        }
+    }
+#endif
+
     bool ok = false;
     wxString cmd;
 
@@ -1065,7 +1098,7 @@ wxWindow* wxFindWindowAtPoint(wxWindow* win, const wxPoint& pt)
     }
 
     wxRect rect(pos, sz);
-    if (rect.Inside(pt))
+    if (rect.Contains(pt))
         return win;
 
     return NULL;