1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/osx/cocoa/private.h
3 // Purpose: Private declarations: as this header is only included by
4 // wxWidgets itself, it may contain identifiers which don't start
6 // Author: Stefan Csomor
9 // RCS-ID: $Id: private.h 53819 2008-05-29 14:11:45Z SC $
10 // Copyright: (c) Stefan Csomor
11 // Licence: wxWindows licence
12 /////////////////////////////////////////////////////////////////////////////
14 #ifndef _WX_PRIVATE_COCOA_H_
15 #define _WX_PRIVATE_COCOA_H_
17 #include "wx/osx/core/private.h"
21 #import <Cocoa/Cocoa.h>
23 extern NSRect
wxToNSRect( NSView
* parent
, const wxRect
& r
);
24 extern wxRect
wxFromNSRect( NSView
* parent
, const NSRect
& rect
);
25 extern NSPoint
wxToNSPoint( NSView
* parent
, const wxPoint
& p
);
26 extern wxPoint
wxFromNSPoint( NSView
* parent
, const NSPoint
& p
);
32 class WXDLLIMPEXP_CORE wxWidgetCocoaImpl
: public wxWidgetImpl
35 wxWidgetCocoaImpl( wxWindowMac
* peer
, WXWidget w
, bool isRootControl
= false ) ;
41 virtual bool IsVisible() const ;
47 virtual void ScrollRect( const wxRect
*rect
, int dx
, int dy
);
49 virtual WXWidget
GetWXWidget() const { return m_osxView
; }
51 virtual void GetContentArea( int &left
, int &top
, int &width
, int &height
) const;
52 virtual void Move(int x
, int y
, int width
, int height
);
53 virtual void GetPosition( int &x
, int &y
) const;
54 virtual void GetSize( int &width
, int &height
) const;
56 virtual void SetNeedsDisplay( const wxRect
* where
= NULL
);
57 virtual bool GetNeedsDisplay() const;
59 virtual bool CanFocus() const;
60 // return true if successful
61 virtual bool SetFocus();
62 virtual bool HasFocus() const;
64 void RemoveFromParent();
65 void Embed( wxWidgetImpl
*parent
);
68 DECLARE_DYNAMIC_CLASS_NO_COPY(wxWidgetCocoaImpl
)
71 class wxNonOwnedWindowCocoaImpl
: public wxNonOwnedWindowImpl
74 wxNonOwnedWindowCocoaImpl( wxNonOwnedWindow
* nonownedwnd
) ;
75 wxNonOwnedWindowCocoaImpl();
77 virtual ~wxNonOwnedWindowCocoaImpl();
79 virtual void Destroy() ;
80 void Create( wxWindow
* parent
, const wxPoint
& pos
, const wxSize
& size
,
81 long style
, long extraStyle
, const wxString
& name
) ;
83 WXWindow
GetWXWindow() const;
87 bool ShowWithEffect(bool show
, wxShowEffect effect
, unsigned timeout
);
90 bool SetTransparent(wxByte alpha
);
91 bool SetBackgroundColour(const wxColour
& col
);
92 void SetExtraStyle( long exStyle
);
93 bool SetBackgroundStyle(wxBackgroundStyle style
);
94 bool CanSetTransparent();
96 void MoveWindow(int x
, int y
, int width
, int height
);
97 void GetPosition( int &x
, int &y
) const;
98 void GetSize( int &width
, int &height
) const;
100 void GetContentArea( int &left
, int &top
, int &width
, int &height
) const;
101 bool SetShape(const wxRegion
& region
);
103 virtual void SetTitle( const wxString
& title
, wxFontEncoding encoding
) ;
105 virtual bool IsMaximized() const;
107 virtual bool IsIconized() const;
109 virtual void Iconize( bool iconize
);
111 virtual void Maximize(bool maximize
);
113 virtual bool IsFullScreen() const;
115 virtual bool ShowFullScreen(bool show
, long style
);
117 virtual void RequestUserAttention(int flags
);
119 virtual void ScreenToWindow( int *x
, int *y
);
121 virtual void WindowToScreen( int *x
, int *y
);
123 wxNonOwnedWindow
* GetWXPeer() { return m_wxPeer
; }
125 WX_NSWindow m_macWindow
;
126 void * m_macFullScreenData
;
127 DECLARE_DYNAMIC_CLASS_NO_COPY(wxNonOwnedWindowCocoaImpl
)
132 WX_NSCursor
wxMacCocoaCreateStockCursor( int cursor_type
);
133 WX_NSCursor
wxMacCocoaCreateCursorFromCGImage( CGImageRef cgImageRef
, float hotSpotX
, float hotSpotY
);
134 void wxMacCocoaSetCursor( WX_NSCursor cursor
);
135 void wxMacCocoaHideCursor();
136 void wxMacCocoaShowCursor();
138 typedef struct tagClassicCursor
148 // _WX_PRIVATE_COCOA_H_