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;
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
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__)
#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)
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;
}
wxRect rect(pos, sz);
- if (rect.Inside(pt))
+ if (rect.Contains(pt))
return win;
return NULL;