X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/382c4adea6e4d0306e65dd871da1c1c821ebce46..346634a0d36c13d8d817c281197dc1533de2ee83:/include/wx/osx/cocoa/private.h?ds=sidebyside diff --git a/include/wx/osx/cocoa/private.h b/include/wx/osx/cocoa/private.h index 6b6bef8e82..d24e39a1ed 100644 --- a/include/wx/osx/cocoa/private.h +++ b/include/wx/osx/cocoa/private.h @@ -6,7 +6,7 @@ // Author: Stefan Csomor // Modified by: // Created: 1998-01-01 -// RCS-ID: $Id: private.h 53819 2008-05-29 14:11:45Z SC $ +// RCS-ID: $Id$ // Copyright: (c) Stefan Csomor // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -41,13 +41,15 @@ OSStatus WXDLLIMPEXP_CORE wxMacDrawCGImage( CGImageRef inImage) ; WX_NSImage WXDLLIMPEXP_CORE wxOSXGetNSImageFromCGImage( CGImageRef image ); CGImageRef WXDLLIMPEXP_CORE wxOSXCreateCGImageFromNSImage( WX_NSImage nsimage ); +wxBitmap WXDLLIMPEXP_CORE wxOSXCreateSystemBitmap(const wxString& id, const wxString &client, const wxSize& size); +WXWindow WXDLLIMPEXP_CORE wxOSXGetMainWindow(); class WXDLLIMPEXP_FWD_CORE wxDialog; class WXDLLIMPEXP_CORE wxWidgetCocoaImpl : public wxWidgetImpl { public : - wxWidgetCocoaImpl( wxWindowMac* peer , WXWidget w, bool isRootControl = false ) ; + wxWidgetCocoaImpl( wxWindowMac* peer , WXWidget w, bool isRootControl = false, bool isUserPane = false ) ; wxWidgetCocoaImpl() ; ~wxWidgetCocoaImpl(); @@ -103,6 +105,8 @@ public : void CaptureMouse(); void ReleaseMouse(); + void SetDropTarget(wxDropTarget* target); + wxInt32 GetValue() const; void SetValue( wxInt32 v ); wxBitmap GetBitmap() const; @@ -144,13 +148,13 @@ public : virtual unsigned int draggingUpdated(void* sender, WXWidget slf, void* _cmd); virtual bool performDragOperation(void* sender, WXWidget slf, void* _cmd); virtual void mouseEvent(WX_NSEvent event, WXWidget slf, void* _cmd); + virtual void cursorUpdate(WX_NSEvent event, WXWidget slf, void* _cmd); virtual void keyEvent(WX_NSEvent event, WXWidget slf, void* _cmd); virtual void insertText(NSString* text, WXWidget slf, void* _cmd); virtual bool performKeyEquivalent(WX_NSEvent event, WXWidget slf, void* _cmd); virtual bool acceptsFirstResponder(WXWidget slf, void* _cmd); virtual bool becomeFirstResponder(WXWidget slf, void* _cmd); virtual bool resignFirstResponder(WXWidget slf, void* _cmd); - virtual void resetCursorRects(WXWidget slf, void* _cmd); virtual bool isFlipped(WXWidget slf, void* _cmd); virtual void drawRect(void* rect, WXWidget slf, void* _cmd); @@ -238,13 +242,37 @@ public : virtual void SetModified(bool modified); virtual bool IsModified() const; + virtual void SetRepresentedFilename(const wxString& filename); + wxNonOwnedWindow* GetWXPeer() { return m_wxPeer; } + + CGWindowLevel GetWindowLevel() const { return m_macWindowLevel; } + void RestoreWindowLevel(); protected : + CGWindowLevel m_macWindowLevel; WXWindow m_macWindow; void * m_macFullScreenData ; DECLARE_DYNAMIC_CLASS_NO_COPY(wxNonOwnedWindowCocoaImpl) }; +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__ WXDLLIMPEXP_CORE NSScreen* wxOSXGetMenuScreen(); @@ -347,6 +375,26 @@ protected : - (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() + { + } + + @end #endif // __OBJC__ @@ -380,12 +428,15 @@ const short kwxCursorSize = 11; const short kwxCursorSizeNESW = 12; const short kwxCursorSizeNWSE = 13; const short kwxCursorRoller = 14; -const short kwxCursorLast = kwxCursorRoller; +const short kwxCursorWatch = 15; +const short kwxCursorLast = kwxCursorWatch; // exposing our fallback cursor map extern ClassicCursor gMacCursors[]; +extern NSLayoutManager* gNSLayoutManager; + #endif #endif