+};
+
+DECLARE_WXCOCOA_OBJC_CLASS( wxNSButton );
+
+class wxButtonCocoaImpl : public wxWidgetCocoaImpl, public wxButtonImpl
+{
+public:
+ wxButtonCocoaImpl(wxWindowMac *wxpeer, wxNSButton *v);
+ virtual void SetBitmap(const wxBitmap& bitmap);
+#if wxUSE_MARKUP
+ virtual void SetLabelMarkup(const wxString& markup);
+#endif // wxUSE_MARKUP
+
+ void SetPressedBitmap( const wxBitmap& bitmap );
+ void GetLayoutInset(int &left , int &top , int &right, int &bottom) const;
+ void SetAcceleratorFromLabel(const wxString& label);
+
+ NSButton *GetNSButton() const;
+};
+
+#ifdef __OBJC__
+ typedef void (*wxOSX_TextEventHandlerPtr)(NSView* self, SEL _cmd, NSString *event);
+ typedef void (*wxOSX_EventHandlerPtr)(NSView* self, SEL _cmd, NSEvent *event);
+ typedef BOOL (*wxOSX_PerformKeyEventHandlerPtr)(NSView* self, SEL _cmd, NSEvent *event);
+ typedef BOOL (*wxOSX_FocusHandlerPtr)(NSView* self, SEL _cmd);
+
+
+ WXDLLIMPEXP_CORE NSScreen* wxOSXGetMenuScreen();
+ WXDLLIMPEXP_CORE NSRect wxToNSRect( NSView* parent, const wxRect& r );
+ WXDLLIMPEXP_CORE wxRect wxFromNSRect( NSView* parent, const NSRect& rect );
+ WXDLLIMPEXP_CORE NSPoint wxToNSPoint( NSView* parent, const wxPoint& p );
+ WXDLLIMPEXP_CORE wxPoint wxFromNSPoint( NSView* parent, const NSPoint& p );
+
+ NSRect WXDLLIMPEXP_CORE wxOSXGetFrameForControl( wxWindowMac* window , const wxPoint& pos , const wxSize &size ,
+ bool adjustForOrigin = true );
+
+ WXDLLIMPEXP_CORE NSView* wxOSXGetViewFromResponder( NSResponder* responder );
+
+ // used for many wxControls
+
+ @interface wxNSButton : NSButton
+ {
+ NSTrackingRectTag rectTag;
+ }
+
+ @end
+
+ @interface wxNSBox : NSBox
+ {
+ }
+
+ @end
+
+ @interface wxNSTextFieldEditor : NSTextView
+ {
+ NSEvent* lastKeyDownEvent;
+ }
+
+ @end
+
+ @interface wxNSTextField : NSTextField wxOSX_10_6_AND_LATER(<NSTextFieldDelegate>)
+ {
+ wxNSTextFieldEditor* fieldEditor;
+ }
+
+ - (wxNSTextFieldEditor*) fieldEditor;
+ - (void) setFieldEditor:(wxNSTextFieldEditor*) fieldEditor;
+
+ @end
+
+ @interface wxNSSecureTextField : NSSecureTextField wxOSX_10_6_AND_LATER(<NSTextFieldDelegate>)
+ {
+ }
+
+ @end
+
+
+ @interface wxNSTextView : NSTextView wxOSX_10_6_AND_LATER(<NSTextViewDelegate>)
+ {
+ }
+
+ - (void)textDidChange:(NSNotification *)aNotification;
+
+ @end
+
+ @interface wxNSComboBox : NSComboBox
+ {
+ wxNSTextFieldEditor* fieldEditor;
+ }
+
+ - (wxNSTextFieldEditor*) fieldEditor;
+ - (void) setFieldEditor:(wxNSTextFieldEditor*) fieldEditor;
+
+ @end
+
+
+
+ @interface wxNSMenu : NSMenu
+ {
+ wxMenuImpl* impl;
+ }
+
+ - (void) setImplementation:(wxMenuImpl*) item;
+ - (wxMenuImpl*) implementation;
+
+ @end
+
+ @interface wxNSMenuItem : NSMenuItem
+ {
+ wxMenuItemImpl* impl;
+ }
+
+ - (void) setImplementation:(wxMenuItemImpl*) item;
+ - (wxMenuItemImpl*) implementation;
+
+ - (void)clickedAction:(id)sender;
+ - (BOOL)validateMenuItem:(NSMenuItem *)menuItem;
+
+ @end
+
+ void WXDLLIMPEXP_CORE wxOSXCocoaClassAddWXMethods(Class c);
+
+ /*
+ We need this for ShowModal, as the sheet just disables the parent window and
+ returns control to the app, whereas we don't want to return from ShowModal
+ until the sheet has been dismissed.
+ */
+ @interface ModalDialogDelegate : NSObject
+ {
+ BOOL sheetFinished;
+ int resultCode;
+ wxDialog* impl;
+ }
+
+ - (void)setImplementation: (wxDialog *)dialog;
+ - (BOOL)finished;
+ - (int)code;
+ - (void)waitForSheetToFinish;
+ - (void)sheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo;
+ @end
+
+ // This interface must be exported in shared 64 bit multilib build but
+ // using WXEXPORT with Objective C interfaces doesn't work with old (4.0.1)
+ // gcc when using 10.4 SDK. It does work with newer gcc even in 32 bit
+ // builds but seems to be unnecessary there so to avoid the expense of a
+ // configure check verifying if this does work or not with the current
+ // compiler we just only use it for 64 bit builds where this is always
+ // supported.
+ //
+ // NB: Currently this is the only place where we need to export an
+ // interface but if we need to do it elsewhere we should define a
+ // WXEXPORT_OBJC macro once and reuse it in all places it's needed
+ // instead of duplicating this preprocessor check.
+#ifdef __LP64__
+ WXEXPORT
+#endif // 64 bit builds
+ @interface wxNSAppController : NSObject wxOSX_10_6_AND_LATER(<NSApplicationDelegate>)
+ {
+ }
+
+ @end
+
+#endif // __OBJC__