]>
Commit | Line | Data |
---|---|---|
4849f027 SC |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: wx/osx/iphone/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 | |
a9a4f229 | 9 | // RCS-ID: $Id$ |
4849f027 SC |
10 | // Copyright: (c) Stefan Csomor |
11 | // Licence: wxWindows licence | |
12 | ///////////////////////////////////////////////////////////////////////////// | |
13 | ||
14 | #ifndef _WX_PRIVATE_IPHONE_H_ | |
15 | #define _WX_PRIVATE_IPHONE_H_ | |
16 | ||
4849f027 SC |
17 | #ifdef __OBJC__ |
18 | #import <UIKit/UIKit.h> | |
19 | #endif | |
20 | ||
721ba9cb SC |
21 | #include <CoreText/CTFont.h> |
22 | #include <CoreText/CTStringAttributes.h> | |
23 | #include <CoreText/CTLine.h> | |
24 | ||
25 | ||
4849f027 SC |
26 | #if wxUSE_GUI |
27 | ||
d3929256 SC |
28 | OSStatus WXDLLIMPEXP_CORE wxMacDrawCGImage( |
29 | CGContextRef inContext, | |
30 | const CGRect * inBounds, | |
31 | CGImageRef inImage) ; | |
32 | ||
59d866ad | 33 | WX_UIImage WXDLLIMPEXP_CORE wxOSXGetUIImageFromCGImage( CGImageRef image ); |
ca9eebc3 | 34 | wxBitmap WXDLLIMPEXP_CORE wxOSXCreateSystemBitmap(const wxString& id, const wxString &client, const wxSize& size); |
d3929256 | 35 | |
4849f027 SC |
36 | class WXDLLIMPEXP_CORE wxWidgetIPhoneImpl : public wxWidgetImpl |
37 | { | |
38 | public : | |
415f4a01 | 39 | wxWidgetIPhoneImpl( wxWindowMac* peer , WXWidget w, bool isRootControl = false, bool isUserPane = false ) ; |
03647350 VZ |
40 | wxWidgetIPhoneImpl() ; |
41 | ~wxWidgetIPhoneImpl(); | |
42 | ||
4849f027 | 43 | void Init(); |
03647350 | 44 | |
4849f027 SC |
45 | virtual bool IsVisible() const ; |
46 | virtual void SetVisibility( bool visible ); | |
03647350 | 47 | |
4849f027 | 48 | virtual void Raise(); |
03647350 | 49 | |
4849f027 SC |
50 | virtual void Lower(); |
51 | ||
52 | virtual void ScrollRect( const wxRect *rect, int dx, int dy ); | |
53 | ||
54 | virtual WXWidget GetWXWidget() const { return m_osxView; } | |
55 | ||
56 | virtual void SetBackgroundColour( const wxColour& col ) ; | |
719ddf1e | 57 | virtual bool SetBackgroundStyle(wxBackgroundStyle style) ; |
4849f027 SC |
58 | |
59 | virtual void GetContentArea( int &left , int &top , int &width , int &height ) const; | |
60 | virtual void Move(int x, int y, int width, int height); | |
61 | virtual void GetPosition( int &x, int &y ) const; | |
62 | virtual void GetSize( int &width, int &height ) const; | |
d3929256 | 63 | virtual void SetControlSize( wxWindowVariant variant ); |
f082dcd5 | 64 | virtual double GetContentScaleFactor() const ; |
f18b5ee7 | 65 | |
4849f027 SC |
66 | virtual void SetNeedsDisplay( const wxRect* where = NULL ); |
67 | virtual bool GetNeedsDisplay() const; | |
68 | ||
69 | virtual bool CanFocus() const; | |
70 | // return true if successful | |
71 | virtual bool SetFocus(); | |
72 | virtual bool HasFocus() const; | |
73 | ||
74 | void RemoveFromParent(); | |
75 | void Embed( wxWidgetImpl *parent ); | |
03647350 | 76 | |
d3929256 SC |
77 | void SetDefaultButton( bool isDefault ); |
78 | void PerformClick(); | |
79 | virtual void SetLabel(const wxString& title, wxFontEncoding encoding); | |
80 | ||
81 | void SetCursor( const wxCursor & cursor ); | |
82 | void CaptureMouse(); | |
83 | void ReleaseMouse(); | |
84 | ||
85 | wxInt32 GetValue() const; | |
86 | void SetValue( wxInt32 v ); | |
9e55f38d SC |
87 | |
88 | virtual wxBitmap GetBitmap() const; | |
89 | virtual void SetBitmap( const wxBitmap& bitmap ); | |
90 | virtual void SetBitmapPosition( wxDirection dir ); | |
03647350 | 91 | |
d3929256 SC |
92 | void SetupTabs( const wxNotebook ¬ebook ); |
93 | void GetBestRect( wxRect *r ) const; | |
94 | bool IsEnabled() const; | |
95 | void Enable( bool enable ); | |
96 | bool ButtonClickDidStateChange() { return true ;} | |
97 | void SetMinimum( wxInt32 v ); | |
98 | void SetMaximum( wxInt32 v ); | |
99 | wxInt32 GetMinimum() const; | |
100 | wxInt32 GetMaximum() const; | |
101 | void PulseGauge(); | |
102 | void SetScrollThumb( wxInt32 value, wxInt32 thumbSize ); | |
103 | ||
104 | void SetFont( const wxFont & font , const wxColour& foreground , long windowStyle, bool ignoreBlack = true ); | |
105 | ||
106 | void InstallEventHandler( WXWidget control = NULL ); | |
03647350 VZ |
107 | |
108 | virtual void DoNotifyFocusEvent(bool receivedFocus, wxWidgetImpl* otherWindow); | |
d3929256 SC |
109 | |
110 | // thunk connected calls | |
03647350 | 111 | |
d3929256 SC |
112 | virtual void drawRect(CGRect* rect, WXWidget slf, void* _cmd); |
113 | virtual void touchEvent(WX_NSSet touches, WX_UIEvent event, WXWidget slf, void* _cmd); | |
114 | virtual bool becomeFirstResponder(WXWidget slf, void* _cmd); | |
115 | virtual bool resignFirstResponder(WXWidget slf, void* _cmd); | |
116 | ||
117 | // action | |
03647350 | 118 | |
719ddf1e SC |
119 | virtual void controlAction(void* sender, wxUint32 controlEvent, WX_UIEvent rawEvent); |
120 | virtual void controlTextDidChange(); | |
4849f027 SC |
121 | protected: |
122 | WXWidget m_osxView; | |
123 | DECLARE_DYNAMIC_CLASS_NO_COPY(wxWidgetIPhoneImpl) | |
124 | }; | |
125 | ||
126 | class wxNonOwnedWindowIPhoneImpl : public wxNonOwnedWindowImpl | |
127 | { | |
128 | public : | |
129 | wxNonOwnedWindowIPhoneImpl( wxNonOwnedWindow* nonownedwnd) ; | |
130 | wxNonOwnedWindowIPhoneImpl(); | |
03647350 | 131 | |
4849f027 | 132 | virtual ~wxNonOwnedWindowIPhoneImpl(); |
03647350 | 133 | |
0aaa6ace | 134 | virtual void WillBeDestroyed() ; |
4849f027 SC |
135 | void Create( wxWindow* parent, const wxPoint& pos, const wxSize& size, |
136 | long style, long extraStyle, const wxString& name ) ; | |
719ddf1e | 137 | void Create( wxWindow* parent, WXWindow nativeWindow ); |
03647350 | 138 | |
4849f027 | 139 | WXWindow GetWXWindow() const; |
03647350 | 140 | void Raise(); |
4849f027 | 141 | void Lower(); |
03647350 | 142 | bool Show(bool show); |
4849f027 | 143 | bool ShowWithEffect(bool show, wxShowEffect effect, unsigned timeout); |
03647350 | 144 | |
4849f027 SC |
145 | void Update(); |
146 | bool SetTransparent(wxByte alpha); | |
147 | bool SetBackgroundColour(const wxColour& col ); | |
03647350 VZ |
148 | void SetExtraStyle( long exStyle ); |
149 | bool SetBackgroundStyle(wxBackgroundStyle style); | |
4849f027 SC |
150 | bool CanSetTransparent(); |
151 | ||
152 | void MoveWindow(int x, int y, int width, int height); | |
153 | void GetPosition( int &x, int &y ) const; | |
154 | void GetSize( int &width, int &height ) const; | |
155 | ||
03647350 | 156 | void GetContentArea( int &left , int &top , int &width , int &height ) const; |
4849f027 | 157 | bool SetShape(const wxRegion& region); |
03647350 | 158 | |
4849f027 | 159 | virtual void SetTitle( const wxString& title, wxFontEncoding encoding ) ; |
03647350 | 160 | |
4849f027 | 161 | virtual bool IsMaximized() const; |
03647350 | 162 | |
4849f027 | 163 | virtual bool IsIconized() const; |
03647350 | 164 | |
4849f027 | 165 | virtual void Iconize( bool iconize ); |
03647350 | 166 | |
4849f027 | 167 | virtual void Maximize(bool maximize); |
03647350 | 168 | |
4849f027 | 169 | virtual bool IsFullScreen() const; |
03647350 | 170 | |
4849f027 SC |
171 | virtual bool ShowFullScreen(bool show, long style); |
172 | ||
173 | virtual void RequestUserAttention(int flags); | |
03647350 | 174 | |
4849f027 | 175 | virtual void ScreenToWindow( int *x, int *y ); |
03647350 | 176 | |
4849f027 | 177 | virtual void WindowToScreen( int *x, int *y ); |
03647350 | 178 | |
dbc7ceb9 KO |
179 | // FIXME: Does iPhone have a concept of inactive windows? |
180 | virtual bool IsActive() { return true; } | |
ce00f59b | 181 | |
4849f027 | 182 | wxNonOwnedWindow* GetWXPeer() { return m_wxPeer; } |
878357d8 SC |
183 | |
184 | virtual bool InitialShowEventSent() { return m_initialShowSent; } | |
4849f027 SC |
185 | protected : |
186 | WX_UIWindow m_macWindow; | |
187 | void * m_macFullScreenData ; | |
878357d8 | 188 | bool m_initialShowSent; |
4849f027 | 189 | DECLARE_DYNAMIC_CLASS_NO_COPY(wxNonOwnedWindowIPhoneImpl) |
03647350 | 190 | }; |
4849f027 | 191 | |
d3929256 SC |
192 | #ifdef __OBJC__ |
193 | ||
194 | WXDLLIMPEXP_CORE CGRect wxToNSRect( UIView* parent, const wxRect& r ); | |
195 | WXDLLIMPEXP_CORE wxRect wxFromNSRect( UIView* parent, const CGRect& rect ); | |
196 | WXDLLIMPEXP_CORE CGPoint wxToNSPoint( UIView* parent, const wxPoint& p ); | |
197 | WXDLLIMPEXP_CORE wxPoint wxFromNSPoint( UIView* parent, const CGPoint& p ); | |
03647350 VZ |
198 | |
199 | CGRect WXDLLIMPEXP_CORE wxOSXGetFrameForControl( wxWindowMac* window , const wxPoint& pos , const wxSize &size , | |
d3929256 SC |
200 | bool adjustForOrigin = true ); |
201 | ||
202 | @interface wxUIButton : UIButton | |
203 | { | |
204 | } | |
03647350 | 205 | |
d3929256 SC |
206 | @end |
207 | ||
98040646 SC |
208 | @interface wxUIView : UIView |
209 | { | |
210 | } | |
211 | ||
212 | @end // wxUIView | |
213 | ||
719ddf1e | 214 | |
d3929256 SC |
215 | void WXDLLIMPEXP_CORE wxOSXIPhoneClassAddWXMethods(Class c); |
216 | ||
217 | #endif | |
218 | ||
4849f027 SC |
219 | #endif // wxUSE_GUI |
220 | ||
221 | #endif | |
222 | // _WX_PRIVATE_IPHONE_H_ |