]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/carbon/utilscocoa.mm
guarding open combo box against AppDefined NSEvents issued by wxEventLoop::WakeUp...
[wxWidgets.git] / src / osx / carbon / utilscocoa.mm
index dc4248f3c7b0b115c433ebc03783028c24c25791..a4c9ba80161077673d0232b26e85c6ec64bb2196 100644 (file)
 
 #include "wx/wxprec.h"
 
+#ifndef WX_PRECOMP
+#include "wx/object.h"
+#endif
+
 #if wxOSX_USE_COCOA_OR_CARBON
 #include <Cocoa/Cocoa.h>
 #else
@@ -189,7 +193,7 @@ WX_NSFont wxFont::OSXCreateNSFont(wxOSXSystemFont font, wxNativeFontInfo* info)
 }
 
 static inline double DegToRad(double deg) { return (deg * M_PI) / 180.0; }
-static const NSAffineTransformStruct kSlantNSTransformStruct = { 1, 0, tan(DegToRad(11)), 1, 0, 0  };
+static const NSAffineTransformStruct kSlantNSTransformStruct = { 1, 0, static_cast<CGFloat>(tan(DegToRad(11))), 1, 0, 0  };
 
 WX_NSFont wxFont::OSXCreateNSFont(const wxNativeFontInfo* info)
 {
@@ -339,6 +343,19 @@ WX_UIFont wxFont::OSXCreateUIFont(const wxNativeFontInfo* info)
     return uiFont;
 }
 
+#endif
+
+// ----------------------------------------------------------------------------
+// NSWindow Utils
+// ----------------------------------------------------------------------------
+
+#if wxOSX_USE_COCOA
+
+WXWindow wxOSXGetMainWindow()
+{
+    return [NSApp mainWindow];
+}
+
 #endif
 // ----------------------------------------------------------------------------
 // NSImage Utils