+#ifdef __OBJC__
+
+ extern NSRect wxToNSRect( NSView* parent, const wxRect& r );
+ extern wxRect wxFromNSRect( NSView* parent, const NSRect& rect );
+ extern NSPoint wxToNSPoint( NSView* parent, const wxPoint& p );
+ extern wxPoint wxFromNSPoint( NSView* parent, const NSPoint& p );
+
+ // used for many wxControls
+
+ @interface wxNSButton : NSButton
+ {
+ wxWidgetCocoaImpl* impl;
+ }
+
+ - (void)setImplementation: (wxWidgetCocoaImpl *) theImplementation;
+ - (wxWidgetCocoaImpl*) implementation;
+ - (BOOL) isFlipped;
+ - (void) clickedAction: (id) sender;
+
+ @end
+
+ @interface wxNSBox : NSBox
+ {
+ wxWidgetCocoaImpl* impl;
+ }
+
+ - (void)setImplementation: (wxWidgetCocoaImpl *) theImplementation;
+ - (wxWidgetCocoaImpl*) implementation;
+ - (BOOL) isFlipped;
+
+ @end
+
+ @interface wxNSTextField : NSTextField
+ {
+ wxWidgetCocoaImpl* impl;
+ }
+
+ - (void)setImplementation: (wxWidgetCocoaImpl *) theImplementation;
+ - (wxWidgetCocoaImpl*) implementation;
+ - (BOOL) isFlipped;
+
+ @end
+
+ NSRect WXDLLIMPEXP_CORE wxOSXGetFrameForControl( wxWindowMac* window , const wxPoint& pos , const wxSize &size ,
+ bool adjustForOrigin = true );
+
+ // common code snippets for cocoa implementations
+ // later to be done using injection in method table
+
+ #define WXCOCOAIMPL_COMMON_MOUSE_INTERFACE -(void)mouseDown:(NSEvent *)event ;\
+ -(void)rightMouseDown:(NSEvent *)event ;\
+ -(void)otherMouseDown:(NSEvent *)event ;\
+ -(void)mouseUp:(NSEvent *)event ;\
+ -(void)rightMouseUp:(NSEvent *)event ;\
+ -(void)otherMouseUp:(NSEvent *)event ;\
+ -(void)handleMouseEvent:(NSEvent *)event;
+
+ #define WXCOCOAIMPL_COMMON_MOUSE_IMPLEMENTATION -(void)mouseDown:(NSEvent *)event \
+ {\
+ [self handleMouseEvent:event];\
+ }\
+ -(void)rightMouseDown:(NSEvent *)event\
+ {\
+ [self handleMouseEvent:event];\
+ }\
+ -(void)otherMouseDown:(NSEvent *)event\
+ {\
+ [self handleMouseEvent:event];\
+ }\
+ -(void)mouseUp:(NSEvent *)event\
+ {\
+ [self handleMouseEvent:event];\
+ }\
+ -(void)rightMouseUp:(NSEvent *)event\
+ {\
+ [self handleMouseEvent:event];\
+ }\
+ -(void)otherMouseUp:(NSEvent *)event\
+ {\
+ [self handleMouseEvent:event];\
+ }\
+ -(void)handleMouseEvent:(NSEvent *)event\
+ {\
+ impl->DoHandleMouseEvent(event);\
+ }
+
+#endif // __OBJC__
+