X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b3b17ee74390803c2743455f5f3c744a2dd392ea..53f60d4ab61af3d8f72eb2202b4cda96774531d8:/include/wx/osx/cocoa/private.h diff --git a/include/wx/osx/cocoa/private.h b/include/wx/osx/cocoa/private.h index ab8ba6b158..857e98908f 100644 --- a/include/wx/osx/cocoa/private.h +++ b/include/wx/osx/cocoa/private.h @@ -23,12 +23,21 @@ #if wxOSX_USE_ATSU_TEXT // we need theming and atsu #include +#else + // we only need theming, if we find a better include replace the following + #include #endif #ifdef __OBJC__ #import #endif +#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5 +// available in 10.4 but not in the headers +enum { + kEventMouseScroll = 11 +}; +#endif // // shared between Cocoa and Carbon // @@ -42,7 +51,8 @@ OSStatus WXDLLIMPEXP_CORE wxMacDrawCGImage( CGContextRef inContext, const CGRect * inBounds, CGImageRef inImage) ; -WX_NSImage WXDLLIMPEXP_CORE wxOSXCreateNSImageFromCGImage( CGImageRef image ); +WX_NSImage WXDLLIMPEXP_CORE wxOSXGetNSImageFromCGImage( CGImageRef image ); +CGImageRef WXDLLIMPEXP_CORE wxOSXCreateCGImageFromNSImage( WX_NSImage nsimage ); #endif long UMAGetSystemVersion() ; @@ -51,6 +61,8 @@ WXDLLIMPEXP_BASE wxString wxMacFSRefToPath( const FSRef *fsRef , CFStringRef add WXDLLIMPEXP_BASE OSStatus wxMacPathToFSRef( const wxString&path , FSRef *fsRef ); WXDLLIMPEXP_BASE wxString wxMacHFSUniStrToString( ConstHFSUniStr255Param uniname ); +class WXDLLIMPEXP_FWD_CORE wxDialog; + // // // @@ -69,6 +81,17 @@ public : virtual bool IsVisible() const ; virtual void SetVisibility(bool); + // we provide a static function which can be reused from + // wxNonOwnedWindowCocoaImpl too + static bool ShowViewOrWindowWithEffect(wxWindow *win, + bool show, + wxShowEffect effect, + unsigned timeout); + + virtual bool ShowWithEffect(bool show, + wxShowEffect effect, + unsigned timeout); + virtual void Raise(); virtual void Lower(); @@ -78,6 +101,7 @@ public : virtual WXWidget GetWXWidget() const { return m_osxView; } virtual void SetBackgroundColour(const wxColour&); + virtual bool SetBackgroundStyle(wxBackgroundStyle style); virtual void GetContentArea( int &left , int &top , int &width , int &height ) const; virtual void Move(int x, int y, int width, int height); @@ -122,6 +146,7 @@ public : void SetScrollThumb( wxInt32 value, wxInt32 thumbSize ); void SetFont( const wxFont & font , const wxColour& foreground , long windowStyle, bool ignoreBlack = true ); + void SetToolTip( wxToolTip* tooltip ); void InstallEventHandler( WXWidget control = NULL ); @@ -130,6 +155,10 @@ public : virtual bool DoHandleCharEvent(NSEvent *event, NSString *text); virtual void DoNotifyFocusEvent(bool receivedFocus, wxWidgetImpl* otherWindow); + virtual void SetupKeyEvent(wxKeyEvent &wxevent, NSEvent * nsEvent, NSString* charString = NULL); + virtual void SetupMouseEvent(wxMouseEvent &wxevent, NSEvent * nsEvent); + + void SetFlipped(bool flipped); virtual bool IsFlipped() const { return m_isFlipped; } @@ -152,6 +181,10 @@ public : virtual void controlAction(WXWidget slf, void* _cmd, void* sender); virtual void controlDoubleAction(WXWidget slf, void* _cmd, void *sender); + + // for wxTextCtrl-derived classes, put here since they don't all derive + // from the same pimpl class. + virtual void controlTextDidChange(); protected: WXWidget m_osxView; @@ -174,20 +207,25 @@ public : virtual ~wxNonOwnedWindowCocoaImpl(); - virtual void Destroy() ; + virtual void WillBeDestroyed() ; void Create( wxWindow* parent, const wxPoint& pos, const wxSize& size, long style, long extraStyle, const wxString& name ) ; + void Create( wxWindow* parent, WXWindow nativeWindow ); WXWindow GetWXWindow() const; void Raise(); void Lower(); bool Show(bool show); - bool ShowWithEffect(bool show, wxShowEffect effect, unsigned timeout); + + virtual bool ShowWithEffect(bool show, + wxShowEffect effect, + unsigned timeout); void Update(); bool SetTransparent(wxByte alpha); bool SetBackgroundColour(const wxColour& col ); void SetExtraStyle( long exStyle ); + void SetWindowStyleFlag( long style ); bool SetBackgroundStyle(wxBackgroundStyle style); bool CanSetTransparent(); @@ -212,16 +250,23 @@ public : virtual bool ShowFullScreen(bool show, long style); + virtual void ShowWithoutActivating(); + virtual void RequestUserAttention(int flags); virtual void ScreenToWindow( int *x, int *y ); virtual void WindowToScreen( int *x, int *y ); + virtual bool IsActive(); + + virtual void SetModified(bool modified); + virtual bool IsModified() const; + wxNonOwnedWindow* GetWXPeer() { return m_wxPeer; } protected : - WX_wxNSWindow m_macWindow; - void * m_macFullScreenData ; + WXWindow m_macWindow; + void * m_macFullScreenData ; DECLARE_DYNAMIC_CLASS_NO_COPY(wxNonOwnedWindowCocoaImpl) }; @@ -239,6 +284,7 @@ protected : @interface wxNSButton : NSButton { + NSTrackingRectTag rectTag; } @end @@ -256,7 +302,7 @@ protected : @end - @interface wxNSTextField : NSTextField + @interface wxNSTextField : NSTextField wxOSX_10_6_AND_LATER() { wxNSTextFieldEditor* fieldEditor; } @@ -266,17 +312,19 @@ protected : @end - @interface wxNSSecureTextField : NSSecureTextField + @interface wxNSSecureTextField : NSSecureTextField wxOSX_10_6_AND_LATER() { } @end - @interface wxNSTextView : NSTextView + @interface wxNSTextView : NSTextView wxOSX_10_6_AND_LATER() { } + - (void)textDidChange:(NSNotification *)aNotification; + @end @interface wxNSMenu : NSMenu @@ -313,8 +361,10 @@ protected : { BOOL sheetFinished; int resultCode; + wxDialog* impl; } + - (void)setImplementation: (wxDialog *)dialog; - (BOOL)finished; - (int)code; - (void)waitForSheetToFinish;