]> git.saurik.com Git - wxWidgets.git/blame - include/wx/osx/core/private.h
adapting init sequence for different osx platforms
[wxWidgets.git] / include / wx / osx / core / private.h
CommitLineData
5c6eb3a8 1/////////////////////////////////////////////////////////////////////////////
eefe52da 2// Name: wx/osx/core/private.h
5c6eb3a8
SC
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
eefe52da
SC
14#ifndef _WX_PRIVATE_CORE_H_
15#define _WX_PRIVATE_CORE_H_
5c6eb3a8
SC
16
17#include "wx/defs.h"
18
19#include <CoreFoundation/CoreFoundation.h>
20
ef0e9220
SC
21#include "wx/osx/core/cfstring.h"
22#include "wx/osx/core/cfdataref.h"
5c6eb3a8 23
524c47aa 24#if wxOSX_USE_COCOA_OR_CARBON
1e181c7a 25
524c47aa 26WXDLLIMPEXP_BASE long UMAGetSystemVersion() ;
1e181c7a
SC
27
28void WXDLLIMPEXP_CORE wxMacStringToPascal( const wxString&from , unsigned char * to );
29wxString WXDLLIMPEXP_CORE wxMacMakeStringFromPascal( const unsigned char * from );
30
524c47aa
SC
31#endif
32
5c6eb3a8
SC
33#if wxUSE_GUI
34
eefe52da 35#if wxOSX_USE_IPHONE
5c6eb3a8 36#include <CoreGraphics/CoreGraphics.h>
eefe52da 37#else
09f0f2cf 38#include <ApplicationServices/ApplicationServices.h>
eefe52da
SC
39#endif
40
41#include "wx/bitmap.h"
42#include "wx/window.h"
5c6eb3a8
SC
43
44class WXDLLIMPEXP_CORE wxMacCGContextStateSaver
45{
c0c133e1 46 wxDECLARE_NO_COPY_CLASS(wxMacCGContextStateSaver);
5c6eb3a8
SC
47
48public:
49 wxMacCGContextStateSaver( CGContextRef cg )
50 {
51 m_cg = cg;
52 CGContextSaveGState( cg );
53 }
54 ~wxMacCGContextStateSaver()
55 {
56 CGContextRestoreGState( m_cg );
57 }
58private:
59 CGContextRef m_cg;
60};
61
eefe52da
SC
62class WXDLLIMPEXP_CORE wxDeferredObjectDeleter : public wxObject
63{
64public :
65 wxDeferredObjectDeleter( wxObject* obj ) : m_obj(obj)
66 {
67 }
68 virtual ~wxDeferredObjectDeleter()
69 {
70 delete m_obj;
71 }
72protected :
73 wxObject* m_obj ;
74} ;
5c6eb3a8
SC
75
76// Quartz
77
78WXDLLIMPEXP_CORE CGImageRef wxMacCreateCGImageFromBitmap( const wxBitmap& bitmap );
79
80WXDLLIMPEXP_CORE CGDataProviderRef wxMacCGDataProviderCreateWithCFData( CFDataRef data );
81WXDLLIMPEXP_CORE CGDataConsumerRef wxMacCGDataConsumerCreateWithCFData( CFMutableDataRef data );
82WXDLLIMPEXP_CORE CGDataProviderRef wxMacCGDataProviderCreateWithMemoryBuffer( const wxMemoryBuffer& buf );
83
84CGColorSpaceRef WXDLLIMPEXP_CORE wxMacGetGenericRGBColorSpace(void);
85
eefe52da
SC
86class wxWindowMac;
87// to
88extern wxWindow* g_MacLastWindow;
89class wxNonOwnedWindow;
90
524c47aa
SC
91// temporary typedef so that no additional casts are necessary within carbon code at the moment
92
93class wxMacControl;
94class wxWidgetImpl;
95class wxNotebook;
de24bdf2 96class wxTextCtrl;
524c47aa 97
8fa9ac5e
SC
98WXDLLIMPEXP_CORE wxWindowMac * wxFindWindowFromWXWidget(WXWidget inControl );
99
524c47aa
SC
100#if wxOSX_USE_CARBON
101typedef wxMacControl wxWidgetImplType;
102#else
103typedef wxWidgetImpl wxWidgetImplType;
104#endif
105
6c1f25cc 106#if wxUSE_MENUS
524c47aa
SC
107class wxMenuItemImpl : public wxObject
108{
109public :
110 wxMenuItemImpl( wxMenuItem* peer ) : m_peer(peer)
111 {
112 }
113
114 virtual ~wxMenuItemImpl() ;
115 virtual void SetBitmap( const wxBitmap& bitmap ) = 0;
116 virtual void Enable( bool enable ) = 0;
117 virtual void Check( bool check ) = 0;
118 virtual void SetLabel( const wxString& text, wxAcceleratorEntry *entry ) = 0;
119 virtual void Hide( bool hide = true ) = 0;
120
121 virtual void * GetHMenuItem() = 0;
122
123 wxMenuItem* GetWXPeer() { return m_peer ; }
124
125 static wxMenuItemImpl* Create( wxMenuItem* peer, wxMenu *pParentMenu,
126 int id,
127 const wxString& text,
128 wxAcceleratorEntry *entry,
129 const wxString& strHelp,
130 wxItemKind kind,
131 wxMenu *pSubMenu );
132
133protected :
134 wxMenuItem* m_peer;
135
69cc4323 136 DECLARE_ABSTRACT_CLASS(wxMenuItemImpl)
524c47aa
SC
137} ;
138
139class wxMenuImpl : public wxObject
140{
141public :
142 wxMenuImpl( wxMenu* peer ) : m_peer(peer)
143 {
144 }
145
146 virtual ~wxMenuImpl() ;
147 virtual void InsertOrAppend(wxMenuItem *pItem, size_t pos) = 0;
148 virtual void Remove( wxMenuItem *pItem ) = 0;
149
150 virtual void MakeRoot() = 0;
151
152 virtual void SetTitle( const wxString& text ) = 0;
153
154 virtual WXHMENU GetHMenu() = 0;
155
156 wxMenu* GetWXPeer() { return m_peer ; }
157
2cb5d2d2
SC
158 virtual void PopUp( wxWindow *win, int x, int y ) = 0;
159
524c47aa
SC
160 static wxMenuImpl* Create( wxMenu* peer, const wxString& title );
161 static wxMenuImpl* CreateRootMenu( wxMenu* peer );
162protected :
163 wxMenu* m_peer;
164
69cc4323 165 DECLARE_ABSTRACT_CLASS(wxMenuItemImpl)
524c47aa 166} ;
6c1f25cc 167#endif
524c47aa
SC
168
169
eefe52da
SC
170class WXDLLIMPEXP_CORE wxWidgetImpl : public wxObject
171{
172public :
173 wxWidgetImpl( wxWindowMac* peer , bool isRootControl = false );
174 wxWidgetImpl();
175 virtual ~wxWidgetImpl();
176
177 void Init();
178
eefe52da
SC
179 bool IsRootControl() const { return m_isRootControl; }
180
181 wxWindowMac* GetWXPeer() const { return m_wxPeer; }
182
183 bool IsOk() const { return GetWXWidget() != NULL; }
184
185 // not only the control itself, but also all its parents must be visible
186 // in order for this function to return true
187 virtual bool IsVisible() const = 0;
188 // set the visibility of this widget (maybe latent)
189 virtual void SetVisibility( bool visible ) = 0;
190
191 virtual void Raise() = 0;
192
193 virtual void Lower() = 0;
194
195 virtual void ScrollRect( const wxRect *rect, int dx, int dy ) = 0;
196
197 virtual WXWidget GetWXWidget() const = 0;
198
199 virtual void SetBackgroundColour( const wxColour& col ) = 0;
200
201 // all coordinates in native parent widget relative coordinates
202 virtual void GetContentArea( int &left , int &top , int &width , int &height ) const = 0;
203 virtual void Move(int x, int y, int width, int height) = 0;
204 virtual void GetPosition( int &x, int &y ) const = 0;
205 virtual void GetSize( int &width, int &height ) const = 0;
524c47aa 206 virtual void SetControlSize( wxWindowVariant variant ) = 0;
eefe52da 207
ee032c59
SC
208 // native view coordinates are topleft to bottom right (flipped regarding CoreGraphics origin)
209 virtual bool IsFlipped() const { return true; }
210
eefe52da
SC
211 virtual void SetNeedsDisplay( const wxRect* where = NULL ) = 0;
212 virtual bool GetNeedsDisplay() const = 0;
213
214 virtual bool NeedsFocusRect() const;
215 virtual void SetNeedsFocusRect( bool needs );
216
f2f6030e
SC
217 virtual bool NeedsFrame() const;
218 virtual void SetNeedsFrame( bool needs );
219
eefe52da
SC
220 virtual bool CanFocus() const = 0;
221 // return true if successful
222 virtual bool SetFocus() = 0;
223 virtual bool HasFocus() const = 0;
224
225 virtual void RemoveFromParent() = 0;
226 virtual void Embed( wxWidgetImpl *parent ) = 0;
524c47aa
SC
227
228 virtual void SetDefaultButton( bool isDefault ) = 0;
229 virtual void PerformClick() = 0;
230 virtual void SetLabel( const wxString& title, wxFontEncoding encoding ) = 0;
231
54f11060
SC
232 virtual void SetCursor( const wxCursor & cursor ) = 0;
233 virtual void CaptureMouse() = 0;
234 virtual void ReleaseMouse() = 0;
235
524c47aa
SC
236 virtual wxInt32 GetValue() const = 0;
237 virtual void SetValue( wxInt32 v ) = 0;
e5d05b90 238 virtual wxBitmap GetBitmap() const = 0;
524c47aa 239 virtual void SetBitmap( const wxBitmap& bitmap ) = 0;
e5d05b90 240 virtual void SetBitmapPosition( wxDirection dir ) = 0;
524c47aa
SC
241 virtual void SetupTabs( const wxNotebook &notebook ) =0;
242 virtual void GetBestRect( wxRect *r ) const = 0;
243 virtual bool IsEnabled() const = 0;
244 virtual void Enable( bool enable ) = 0;
245 virtual void SetMinimum( wxInt32 v ) = 0;
246 virtual void SetMaximum( wxInt32 v ) = 0;
19c7ac3d
SC
247 virtual wxInt32 GetMinimum() const = 0;
248 virtual wxInt32 GetMaximum() const = 0;
524c47aa
SC
249 virtual void PulseGauge() = 0;
250 virtual void SetScrollThumb( wxInt32 value, wxInt32 thumbSize ) = 0;
251
1e181c7a
SC
252 virtual void SetFont( const wxFont & font , const wxColour& foreground , long windowStyle, bool ignoreBlack = true ) = 0;
253
524c47aa
SC
254 // is the clicked event sent AFTER the state already changed, so no additional
255 // state changing logic is required from the outside
256 virtual bool ButtonClickDidStateChange() = 0;
c4825ef7
SC
257
258 virtual void InstallEventHandler( WXWidget control = NULL ) = 0;
eefe52da 259
f55d9f74
SC
260 // static methods for associating native controls and their implementations
261
262 static wxWidgetImpl*
263 FindFromWXWidget(WXWidget control);
264
265 static void RemoveAssociations( wxWidgetImpl* impl);
266
267 static void Associate( WXWidget control, wxWidgetImpl *impl );
268
f06e0fea
SC
269 static WXWidget FindFocus();
270
eefe52da
SC
271 // static creation methods, must be implemented by all toolkits
272
524c47aa
SC
273 static wxWidgetImplType* CreateUserPane( wxWindowMac* wxpeer,
274 wxWindowMac* parent,
275 wxWindowID id,
276 const wxPoint& pos,
277 const wxSize& size,
278 long style,
279 long extraStyle) ;
280 static wxWidgetImplType* CreateContentView( wxNonOwnedWindow* now ) ;
281
282 static wxWidgetImplType* CreateButton( wxWindowMac* wxpeer,
283 wxWindowMac* parent,
284 wxWindowID id,
285 const wxString& label,
286 const wxPoint& pos,
287 const wxSize& size,
288 long style,
289 long extraStyle) ;
290
291 static wxWidgetImplType* CreateDisclosureTriangle( wxWindowMac* wxpeer,
292 wxWindowMac* parent,
293 wxWindowID id,
294 const wxString& label,
295 const wxPoint& pos,
296 const wxSize& size,
297 long style,
298 long extraStyle) ;
299
300 static wxWidgetImplType* CreateStaticLine( wxWindowMac* wxpeer,
301 wxWindowMac* parent,
302 wxWindowID id,
303 const wxPoint& pos,
304 const wxSize& size,
305 long style,
306 long extraStyle) ;
307
308 static wxWidgetImplType* CreateGroupBox( wxWindowMac* wxpeer,
309 wxWindowMac* parent,
310 wxWindowID id,
311 const wxString& label,
312 const wxPoint& pos,
313 const wxSize& size,
314 long style,
315 long extraStyle) ;
316
317 static wxWidgetImplType* CreateStaticText( wxWindowMac* wxpeer,
318 wxWindowMac* parent,
319 wxWindowID id,
320 const wxString& label,
321 const wxPoint& pos,
322 const wxSize& size,
323 long style,
324 long extraStyle) ;
325
326 static wxWidgetImplType* CreateTextControl( wxTextCtrl* wxpeer,
327 wxWindowMac* parent,
328 wxWindowID id,
329 const wxString& content,
330 const wxPoint& pos,
331 const wxSize& size,
332 long style,
333 long extraStyle) ;
334
1e181c7a
SC
335 static wxWidgetImplType* CreateSearchControl( wxTextCtrl* wxpeer,
336 wxWindowMac* parent,
337 wxWindowID id,
338 const wxString& content,
339 const wxPoint& pos,
340 const wxSize& size,
341 long style,
342 long extraStyle) ;
343
524c47aa
SC
344 static wxWidgetImplType* CreateCheckBox( wxWindowMac* wxpeer,
345 wxWindowMac* parent,
346 wxWindowID id,
347 const wxString& label,
348 const wxPoint& pos,
349 const wxSize& size,
350 long style,
351 long extraStyle);
352
353 static wxWidgetImplType* CreateRadioButton( wxWindowMac* wxpeer,
354 wxWindowMac* parent,
355 wxWindowID id,
356 const wxString& label,
357 const wxPoint& pos,
358 const wxSize& size,
359 long style,
360 long extraStyle);
361
362 static wxWidgetImplType* CreateToggleButton( wxWindowMac* wxpeer,
363 wxWindowMac* parent,
364 wxWindowID id,
365 const wxString& label,
366 const wxPoint& pos,
367 const wxSize& size,
368 long style,
369 long extraStyle);
370
371 static wxWidgetImplType* CreateBitmapToggleButton( wxWindowMac* wxpeer,
372 wxWindowMac* parent,
373 wxWindowID id,
374 const wxBitmap& bitmap,
375 const wxPoint& pos,
376 const wxSize& size,
377 long style,
378 long extraStyle);
379
380 static wxWidgetImplType* CreateBitmapButton( wxWindowMac* wxpeer,
381 wxWindowMac* parent,
382 wxWindowID id,
383 const wxBitmap& bitmap,
384 const wxPoint& pos,
385 const wxSize& size,
386 long style,
387 long extraStyle);
388
389 static wxWidgetImplType* CreateTabView( wxWindowMac* wxpeer,
390 wxWindowMac* parent,
391 wxWindowID id,
392 const wxPoint& pos,
393 const wxSize& size,
394 long style,
395 long extraStyle);
396
397 static wxWidgetImplType* CreateGauge( wxWindowMac* wxpeer,
398 wxWindowMac* parent,
399 wxWindowID id,
400 wxInt32 value,
401 wxInt32 minimum,
402 wxInt32 maximum,
403 const wxPoint& pos,
404 const wxSize& size,
405 long style,
406 long extraStyle);
407
408 static wxWidgetImplType* CreateSlider( wxWindowMac* wxpeer,
409 wxWindowMac* parent,
410 wxWindowID id,
411 wxInt32 value,
412 wxInt32 minimum,
413 wxInt32 maximum,
414 const wxPoint& pos,
415 const wxSize& size,
416 long style,
417 long extraStyle);
418
419 static wxWidgetImplType* CreateSpinButton( wxWindowMac* wxpeer,
420 wxWindowMac* parent,
421 wxWindowID id,
422 wxInt32 value,
423 wxInt32 minimum,
424 wxInt32 maximum,
425 const wxPoint& pos,
426 const wxSize& size,
427 long style,
428 long extraStyle);
429
430 static wxWidgetImplType* CreateScrollBar( wxWindowMac* wxpeer,
431 wxWindowMac* parent,
432 wxWindowID id,
433 const wxPoint& pos,
434 const wxSize& size,
435 long style,
436 long extraStyle);
437
438 static wxWidgetImplType* CreateChoice( wxWindowMac* wxpeer,
439 wxWindowMac* parent,
440 wxWindowID id,
441 wxMenu* menu,
442 const wxPoint& pos,
443 const wxSize& size,
444 long style,
445 long extraStyle);
446
447 static wxWidgetImplType* CreateListBox( wxWindowMac* wxpeer,
448 wxWindowMac* parent,
449 wxWindowID id,
450 const wxPoint& pos,
451 const wxSize& size,
452 long style,
453 long extraStyle);
eefe52da
SC
454
455 // converts from Toplevel-Content relative to local
456 static void Convert( wxPoint *pt , wxWidgetImpl *from , wxWidgetImpl *to );
457protected :
458 bool m_isRootControl;
459 wxWindowMac* m_wxPeer;
460 bool m_needsFocusRect;
f2f6030e 461 bool m_needsFrame;
eefe52da
SC
462
463 DECLARE_ABSTRACT_CLASS(wxWidgetImpl)
464};
465
524c47aa
SC
466//
467// the interface to be implemented eg by a listbox
468//
469
524c47aa
SC
470class WXDLLIMPEXP_CORE wxListWidgetColumn
471{
472public :
473 virtual ~wxListWidgetColumn() {}
474} ;
475
476class WXDLLIMPEXP_CORE wxListWidgetCellValue
477{
478public :
479 wxListWidgetCellValue() {}
480 virtual ~wxListWidgetCellValue() {}
481
482 virtual void Set( CFStringRef value ) = 0;
483 virtual void Set( const wxString& value ) = 0;
484 virtual void Set( int value ) = 0;
60ebcb8a 485 virtual void Check( bool check );
524c47aa 486
60ebcb8a 487 virtual bool IsChecked() const;
524c47aa
SC
488 virtual int GetIntValue() const = 0;
489 virtual wxString GetStringValue() const = 0;
490} ;
491
492class WXDLLIMPEXP_CORE wxListWidgetImpl
493{
494public:
495 wxListWidgetImpl() {}
496 virtual ~wxListWidgetImpl() { }
497
498 virtual wxListWidgetColumn* InsertTextColumn( unsigned pos, const wxString& title, bool editable = false,
499 wxAlignment just = wxALIGN_LEFT , int defaultWidth = -1) = 0 ;
500 virtual wxListWidgetColumn* InsertCheckColumn( unsigned pos , const wxString& title, bool editable = false,
501 wxAlignment just = wxALIGN_LEFT , int defaultWidth = -1) = 0 ;
502
503 // add and remove
504
505 // TODO will be replaced
506 virtual void ListDelete( unsigned int n ) = 0;
507 virtual void ListInsert( unsigned int n ) = 0;
508 virtual void ListClear() = 0;
509
510 // selecting
511
512 virtual void ListDeselectAll() = 0;
513 virtual void ListSetSelection( unsigned int n, bool select, bool multi ) = 0;
514 virtual int ListGetSelection() const = 0;
515 virtual int ListGetSelections( wxArrayInt& aSelections ) const = 0;
516 virtual bool ListIsSelected( unsigned int n ) const = 0;
517
518 // display
519
520 virtual void ListScrollTo( unsigned int n ) = 0;
521 virtual void UpdateLine( unsigned int n, wxListWidgetColumn* col = NULL ) = 0;
522 virtual void UpdateLineToEnd( unsigned int n) = 0;
523
524 // accessing content
525
526 virtual unsigned int ListGetCount() const = 0;
527};
528
1e181c7a
SC
529//
530// interface to be implemented by a textcontrol
531//
532
21a9d326
SC
533class WXDLLIMPEXP_FWD_CORE wxTextAttr;
534
1e181c7a
SC
535// common interface for all implementations
536class WXDLLIMPEXP_CORE wxTextWidgetImpl
537
538{
539public :
540 wxTextWidgetImpl() {}
541
542 virtual ~wxTextWidgetImpl() {}
543
544 virtual bool CanFocus() const { return true; }
545
546 virtual wxString GetStringValue() const = 0 ;
547 virtual void SetStringValue( const wxString &val ) = 0 ;
548 virtual void SetSelection( long from, long to ) = 0 ;
549 virtual void GetSelection( long* from, long* to ) const = 0 ;
550 virtual void WriteText( const wxString& str ) = 0 ;
551
552 virtual void SetStyle( long start, long end, const wxTextAttr& style ) ;
553 virtual void Copy() ;
554 virtual void Cut() ;
555 virtual void Paste() ;
556 virtual bool CanPaste() const ;
557 virtual void SetEditable( bool editable ) ;
0b6a49c2 558 virtual long GetLastPosition() const ;
1e181c7a
SC
559 virtual void Replace( long from, long to, const wxString &str ) ;
560 virtual void Remove( long from, long to ) ;
561
562
563 virtual bool HasOwnContextMenu() const
564 { return false ; }
565
566 virtual bool SetupCursor( const wxPoint& WXUNUSED(pt) )
567 { return false ; }
568
569 virtual void Clear() ;
570 virtual bool CanUndo() const;
571 virtual void Undo() ;
572 virtual bool CanRedo() const;
573 virtual void Redo() ;
574 virtual int GetNumberOfLines() const ;
575 virtual long XYToPosition(long x, long y) const;
576 virtual bool PositionToXY(long pos, long *x, long *y) const ;
577 virtual void ShowPosition(long WXUNUSED(pos)) ;
578 virtual int GetLineLength(long lineNo) const ;
579 virtual wxString GetLineText(long lineNo) const ;
580 virtual void CheckSpelling(bool WXUNUSED(check)) { }
581};
582
583//
584// common interface for search controls
585//
586
587class wxSearchWidgetImpl
588{
589public :
590 wxSearchWidgetImpl(){}
591 virtual ~wxSearchWidgetImpl(){}
592
593 // search field options
594 virtual void ShowSearchButton( bool show ) = 0;
595 virtual bool IsSearchButtonVisible() const = 0;
596
597 virtual void ShowCancelButton( bool show ) = 0;
598 virtual bool IsCancelButtonVisible() const = 0;
599
600 virtual void SetSearchMenu( wxMenu* menu ) = 0;
601
602 virtual void SetDescriptiveText(const wxString& text) = 0;
603} ;
604
524c47aa
SC
605//
606// toplevel window implementation class
607//
608
eefe52da
SC
609class wxNonOwnedWindowImpl : public wxObject
610{
611public :
612 wxNonOwnedWindowImpl( wxNonOwnedWindow* nonownedwnd) : m_wxPeer(nonownedwnd)
613 {
614 }
615 wxNonOwnedWindowImpl()
616 {
617 }
618 virtual ~wxNonOwnedWindowImpl()
619 {
620 }
621
622 virtual void Destroy()
623 {
624 }
625
626 virtual void Create( wxWindow* parent, const wxPoint& pos, const wxSize& size,
627 long style, long extraStyle, const wxString& name ) = 0;
628
629
630 virtual WXWindow GetWXWindow() const = 0;
631
632 virtual void Raise()
633 {
634 }
635
636 virtual void Lower()
637 {
638 }
639
1aec1f8b 640 virtual bool Show(bool WXUNUSED(show))
eefe52da
SC
641 {
642 return false;
643 }
644
1aec1f8b 645 virtual bool ShowWithEffect(bool show, wxShowEffect WXUNUSED(effect), unsigned WXUNUSED(timeout))
eefe52da
SC
646 {
647 return Show(show);
648 }
649
650 virtual void Update()
651 {
652 }
653
1aec1f8b 654 virtual bool SetTransparent(wxByte WXUNUSED(alpha))
eefe52da
SC
655 {
656 return false;
657 }
658
1aec1f8b 659 virtual bool SetBackgroundColour(const wxColour& WXUNUSED(col) )
eefe52da
SC
660 {
661 return false;
662 }
663
1aec1f8b 664 virtual void SetExtraStyle( long WXUNUSED(exStyle) )
eefe52da
SC
665 {
666 }
667
1aec1f8b 668 virtual bool SetBackgroundStyle(wxBackgroundStyle WXUNUSED(style))
eefe52da
SC
669 {
670 return false ;
671 }
672
673 bool CanSetTransparent()
674 {
675 return false;
676 }
677
678 virtual void GetContentArea( int &left , int &top , int &width , int &height ) const = 0;
679 virtual void MoveWindow(int x, int y, int width, int height) = 0;
680 virtual void GetPosition( int &x, int &y ) const = 0;
681 virtual void GetSize( int &width, int &height ) const = 0;
682
1aec1f8b 683 virtual bool SetShape(const wxRegion& WXUNUSED(region))
eefe52da
SC
684 {
685 return false;
686 }
687
688 virtual void SetTitle( const wxString& title, wxFontEncoding encoding ) = 0;
689
690 virtual bool IsMaximized() const = 0;
691
692 virtual bool IsIconized() const= 0;
693
694 virtual void Iconize( bool iconize )= 0;
695
696 virtual void Maximize(bool maximize) = 0;
697
698 virtual bool IsFullScreen() const= 0;
699
700 virtual bool ShowFullScreen(bool show, long style)= 0;
701
702 virtual void RequestUserAttention(int flags) = 0;
703
704 virtual void ScreenToWindow( int *x, int *y ) = 0;
705
706 virtual void WindowToScreen( int *x, int *y ) = 0;
707
708 wxNonOwnedWindow* GetWXPeer() { return m_wxPeer; }
524c47aa
SC
709
710 // static creation methods, must be implemented by all toolkits
711
712 static wxNonOwnedWindowImpl* CreateNonOwnedWindow( wxNonOwnedWindow* wxpeer, wxWindow* parent, const wxPoint& pos, const wxSize& size,
713 long style, long extraStyle, const wxString& name ) ;
714
eefe52da
SC
715protected :
716 wxNonOwnedWindow* m_wxPeer;
717 DECLARE_ABSTRACT_CLASS(wxNonOwnedWindowImpl)
718};
719
5c6eb3a8
SC
720#endif // wxUSE_GUI
721
722//---------------------------------------------------------------------------
723// cocoa bridging utilities
724//---------------------------------------------------------------------------
725
726bool wxMacInitCocoa();
727
728class WXDLLIMPEXP_CORE wxMacAutoreleasePool
729{
730public :
731 wxMacAutoreleasePool();
732 ~wxMacAutoreleasePool();
733private :
734 void* m_pool;
735};
736
737// NSObject
738
739void wxMacCocoaRelease( void* obj );
740void wxMacCocoaAutorelease( void* obj );
f1c40652 741void* wxMacCocoaRetain( void* obj );
5c6eb3a8
SC
742
743
744#endif
eefe52da 745 // _WX_PRIVATE_CORE_H_