+NSPoint wxWindowCocoa::CocoaTransformBoundsToWx(NSPoint pointBounds)
+{
+ // TODO: Handle scrolling offset
+ wxCHECK_MSG(GetNSView(), pointBounds, wxT("Need to have a Cocoa view to do translation"));
+ if([GetNSView() isFlipped])
+ return pointBounds;
+ NSRect ourBounds = [GetNSView() bounds];
+ return NSMakePoint
+ ( pointBounds.x
+ , ourBounds.size.height - pointBounds.y
+ );
+}
+
+NSRect wxWindowCocoa::CocoaTransformBoundsToWx(NSRect rectBounds)
+{
+ // TODO: Handle scrolling offset
+ wxCHECK_MSG(GetNSView(), rectBounds, wxT("Need to have a Cocoa view to do translation"));
+ if([GetNSView() isFlipped])
+ return rectBounds;
+ NSRect ourBounds = [GetNSView() bounds];
+ return NSMakeRect
+ ( rectBounds.origin.x
+ , ourBounds.size.height - (rectBounds.origin.y + rectBounds.size.height)
+ , rectBounds.size.width
+ , rectBounds.size.height
+ );
+}
+
+NSPoint wxWindowCocoa::CocoaTransformWxToBounds(NSPoint pointWx)
+{
+ // TODO: Handle scrolling offset
+ wxCHECK_MSG(GetNSView(), pointWx, wxT("Need to have a Cocoa view to do translation"));
+ if([GetNSView() isFlipped])
+ return pointWx;
+ NSRect ourBounds = [GetNSView() bounds];
+ return NSMakePoint
+ ( pointWx.x
+ , ourBounds.size.height - pointWx.y
+ );
+}
+
+NSRect wxWindowCocoa::CocoaTransformWxToBounds(NSRect rectWx)
+{
+ // TODO: Handle scrolling offset
+ wxCHECK_MSG(GetNSView(), rectWx, wxT("Need to have a Cocoa view to do translation"));
+ if([GetNSView() isFlipped])
+ return rectWx;
+ NSRect ourBounds = [GetNSView() bounds];
+ return NSMakeRect
+ ( rectWx.origin.x
+ , ourBounds.size.height - (rectWx.origin.y + rectWx.size.height)
+ , rectWx.size.width
+ , rectWx.size.height
+ );
+}
+