]>
Commit | Line | Data |
---|---|---|
4849f027 SC |
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 | |
5 | // with "wx". | |
6 | // Author: Stefan Csomor | |
7 | // Modified by: | |
8 | // Created: 1998-01-01 | |
9 | // RCS-ID: $Id: private.h 53819 2008-05-29 14:11:45Z SC $ | |
10 | // Copyright: (c) Stefan Csomor | |
11 | // Licence: wxWindows licence | |
12 | ///////////////////////////////////////////////////////////////////////////// | |
13 | ||
14 | #ifndef _WX_PRIVATE_COCOA_H_ | |
15 | #define _WX_PRIVATE_COCOA_H_ | |
16 | ||
17 | #include "wx/osx/core/private.h" | |
18 | ||
19 | #ifdef __OBJC__ | |
20 | ||
21 | #import <Cocoa/Cocoa.h> | |
22 | ||
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 ); | |
27 | ||
28 | #endif // __OBJC__ | |
29 | ||
30 | #if wxUSE_GUI | |
31 | ||
32 | class WXDLLIMPEXP_CORE wxWidgetCocoaImpl : public wxWidgetImpl | |
33 | { | |
34 | public : | |
35 | wxWidgetCocoaImpl( wxWindowMac* peer , WXWidget w, bool isRootControl = false ) ; | |
36 | wxWidgetCocoaImpl() ; | |
37 | ~wxWidgetCocoaImpl(); | |
38 | ||
39 | void Init(); | |
40 | ||
41 | virtual bool IsVisible() const ; | |
42 | ||
43 | virtual void Raise(); | |
44 | ||
45 | virtual void Lower(); | |
46 | ||
47 | virtual void ScrollRect( const wxRect *rect, int dx, int dy ); | |
48 | ||
49 | virtual WXWidget GetWXWidget() const { return m_osxView; } | |
50 | ||
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; | |
55 | ||
56 | virtual void SetNeedsDisplay( const wxRect* where = NULL ); | |
57 | virtual bool GetNeedsDisplay() const; | |
58 | ||
59 | virtual bool CanFocus() const; | |
60 | // return true if successful | |
61 | virtual bool SetFocus(); | |
62 | virtual bool HasFocus() const; | |
63 | ||
64 | void RemoveFromParent(); | |
65 | void Embed( wxWidgetImpl *parent ); | |
66 | protected: | |
67 | WXWidget m_osxView; | |
68 | DECLARE_DYNAMIC_CLASS_NO_COPY(wxWidgetCocoaImpl) | |
69 | }; | |
70 | ||
71 | class wxNonOwnedWindowCocoaImpl : public wxNonOwnedWindowImpl | |
72 | { | |
73 | public : | |
74 | wxNonOwnedWindowCocoaImpl( wxNonOwnedWindow* nonownedwnd) ; | |
75 | wxNonOwnedWindowCocoaImpl(); | |
76 | ||
77 | virtual ~wxNonOwnedWindowCocoaImpl(); | |
78 | ||
79 | virtual void Destroy() ; | |
80 | void Create( wxWindow* parent, const wxPoint& pos, const wxSize& size, | |
81 | long style, long extraStyle, const wxString& name ) ; | |
82 | ||
83 | WXWindow GetWXWindow() const; | |
84 | void Raise(); | |
85 | void Lower(); | |
86 | bool Show(bool show); | |
87 | bool ShowWithEffect(bool show, wxShowEffect effect, unsigned timeout); | |
88 | ||
89 | void Update(); | |
90 | bool SetTransparent(wxByte alpha); | |
91 | bool SetBackgroundColour(const wxColour& col ); | |
92 | void SetExtraStyle( long exStyle ); | |
93 | bool SetBackgroundStyle(wxBackgroundStyle style); | |
94 | bool CanSetTransparent(); | |
95 | ||
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; | |
99 | ||
100 | void GetContentArea( int &left , int &top , int &width , int &height ) const; | |
101 | bool SetShape(const wxRegion& region); | |
102 | ||
103 | virtual void SetTitle( const wxString& title, wxFontEncoding encoding ) ; | |
104 | ||
105 | virtual bool IsMaximized() const; | |
106 | ||
107 | virtual bool IsIconized() const; | |
108 | ||
109 | virtual void Iconize( bool iconize ); | |
110 | ||
111 | virtual void Maximize(bool maximize); | |
112 | ||
113 | virtual bool IsFullScreen() const; | |
114 | ||
115 | virtual bool ShowFullScreen(bool show, long style); | |
116 | ||
117 | virtual void RequestUserAttention(int flags); | |
118 | ||
119 | virtual void ScreenToWindow( int *x, int *y ); | |
120 | ||
121 | virtual void WindowToScreen( int *x, int *y ); | |
122 | ||
123 | wxNonOwnedWindow* GetWXPeer() { return m_wxPeer; } | |
124 | protected : | |
125 | WX_NSWindow m_macWindow; | |
126 | void * m_macFullScreenData ; | |
127 | DECLARE_DYNAMIC_CLASS_NO_COPY(wxNonOwnedWindowCocoaImpl) | |
128 | }; | |
129 | ||
130 | // NSCursor | |
131 | ||
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(); | |
137 | ||
138 | typedef struct tagClassicCursor | |
139 | { | |
140 | wxUint16 bits[16]; | |
141 | wxUint16 mask[16]; | |
142 | wxInt16 hotspot[2]; | |
143 | }ClassicCursor; | |
144 | ||
145 | #endif | |
146 | ||
147 | #endif | |
148 | // _WX_PRIVATE_COCOA_H_ | |
149 |