]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/iphone/utils.mm
Add sanity check on the item number.
[wxWidgets.git] / src / osx / iphone / utils.mm
index f6b5b25d32d4d5ccab559af5a680f20e7f3d0851..ae34a8473a79006ffa4922faa7c07b2b12a67e80 100644 (file)
@@ -100,6 +100,16 @@ void wxMacWakeUp()
 
 #if wxUSE_GUI
 
+// ----------------------------------------------------------------------------
+// Launch default browser
+// ----------------------------------------------------------------------------
+
+bool wxDoLaunchDefaultBrowser(const wxString& url, int flags)
+{
+    return [[UIApplication sharedApplication] openURL:[NSURL URLWithString:wxCFStringRef(url).AsNSString()]]
+        == YES;
+}
+
 // TODO : reorganize
 
 extern wxFont* CreateNormalFont()
@@ -176,9 +186,18 @@ void wxClientDisplayRect(int *x, int *y, int *width, int *height)
 
 void wxGetMousePosition( int* x, int* y )
 {
-//    wxPoint pt = wxFromNSPoint(NULL, [NSEvent mouseLocation]);
+    if ( x )
+        *x = 0;
+    if ( y )
+        *y = 0;
 };
 
+wxMouseState wxGetMouseState()
+{
+    wxMouseState ms;
+    return ms;
+}    
+
 // Returns depth of screen
 int wxDisplayDepth()
 {
@@ -191,7 +210,7 @@ void wxDisplaySize(int *width, int *height)
     CGRect r = [[UIScreen mainScreen] applicationFrame];
     CGRect bounds = [[UIScreen mainScreen] bounds];
 
-    if ( bounds.size.height > r.size.height )
+    if ( UIInterfaceOrientationIsPortrait([[UIApplication sharedApplication] statusBarOrientation]) )
     {
         // portrait
         if ( width )