added support for bitmaps in wxButton to wxOSX/Cocoa
[wxWidgets.git] / include / wx / osx / core / private.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/osx/core/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_CORE_H_
15 #define _WX_PRIVATE_CORE_H_
16
17 #include "wx/defs.h"
18
19 #include <CoreFoundation/CoreFoundation.h>
20
21 #include "wx/osx/core/cfstring.h"
22 #include "wx/osx/core/cfdataref.h"
23
24 #if wxOSX_USE_COCOA_OR_CARBON
25
26 WXDLLIMPEXP_BASE long UMAGetSystemVersion() ;
27
28 void WXDLLIMPEXP_CORE wxMacStringToPascal( const wxString&from , unsigned char * to );
29 wxString WXDLLIMPEXP_CORE wxMacMakeStringFromPascal( const unsigned char * from );
30
31 #endif
32
33 #if wxUSE_GUI
34
35 #if wxOSX_USE_IPHONE
36 #include <CoreGraphics/CoreGraphics.h>
37 #else
38 #include <ApplicationServices/ApplicationServices.h>
39 #endif
40
41 #include "wx/bitmap.h"
42 #include "wx/window.h"
43
44 class WXDLLIMPEXP_CORE wxMacCGContextStateSaver
45 {
46 wxDECLARE_NO_COPY_CLASS(wxMacCGContextStateSaver);
47
48 public:
49 wxMacCGContextStateSaver( CGContextRef cg )
50 {
51 m_cg = cg;
52 CGContextSaveGState( cg );
53 }
54 ~wxMacCGContextStateSaver()
55 {
56 CGContextRestoreGState( m_cg );
57 }
58 private:
59 CGContextRef m_cg;
60 };
61
62 class WXDLLIMPEXP_CORE wxDeferredObjectDeleter : public wxObject
63 {
64 public :
65 wxDeferredObjectDeleter( wxObject* obj ) : m_obj(obj)
66 {
67 }
68 virtual ~wxDeferredObjectDeleter()
69 {
70 delete m_obj;
71 }
72 protected :
73 wxObject* m_obj ;
74 } ;
75
76 // Quartz
77
78 WXDLLIMPEXP_CORE CGImageRef wxMacCreateCGImageFromBitmap( const wxBitmap& bitmap );
79
80 WXDLLIMPEXP_CORE CGDataProviderRef wxMacCGDataProviderCreateWithCFData( CFDataRef data );
81 WXDLLIMPEXP_CORE CGDataConsumerRef wxMacCGDataConsumerCreateWithCFData( CFMutableDataRef data );
82 WXDLLIMPEXP_CORE CGDataProviderRef wxMacCGDataProviderCreateWithMemoryBuffer( const wxMemoryBuffer& buf );
83
84 CGColorSpaceRef WXDLLIMPEXP_CORE wxMacGetGenericRGBColorSpace(void);
85
86 class wxWindowMac;
87 // to
88 extern wxWindow* g_MacLastWindow;
89 class wxNonOwnedWindow;
90
91 // temporary typedef so that no additional casts are necessary within carbon code at the moment
92
93 class wxMacControl;
94 class wxWidgetImpl;
95 class wxNotebook;
96 class wxTextCtrl;
97
98 WXDLLIMPEXP_CORE wxWindowMac * wxFindWindowFromWXWidget(WXWidget inControl );
99
100 #if wxOSX_USE_CARBON
101 typedef wxMacControl wxWidgetImplType;
102 #else
103 typedef wxWidgetImpl wxWidgetImplType;
104 #endif
105
106 #if wxUSE_MENUS
107 class wxMenuItemImpl : public wxObject
108 {
109 public :
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
133 protected :
134 wxMenuItem* m_peer;
135
136 DECLARE_ABSTRACT_CLASS(wxMenuItemImpl)
137 } ;
138
139 class wxMenuImpl : public wxObject
140 {
141 public :
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
158 virtual void PopUp( wxWindow *win, int x, int y ) = 0;
159
160 static wxMenuImpl* Create( wxMenu* peer, const wxString& title );
161 static wxMenuImpl* CreateRootMenu( wxMenu* peer );
162 protected :
163 wxMenu* m_peer;
164
165 DECLARE_ABSTRACT_CLASS(wxMenuItemImpl)
166 } ;
167 #endif
168
169
170 class WXDLLIMPEXP_CORE wxWidgetImpl : public wxObject
171 {
172 public :
173 wxWidgetImpl( wxWindowMac* peer , bool isRootControl = false );
174 wxWidgetImpl();
175 virtual ~wxWidgetImpl();
176
177 void Init();
178
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;
206 virtual void SetControlSize( wxWindowVariant variant ) = 0;
207
208 // native view coordinates are topleft to bottom right (flipped regarding CoreGraphics origin)
209 virtual bool IsFlipped() const { return true; }
210
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
217 virtual bool NeedsFrame() const;
218 virtual void SetNeedsFrame( bool needs );
219
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;
227
228 virtual void SetDefaultButton( bool isDefault ) = 0;
229 virtual void PerformClick() = 0;
230 virtual void SetLabel( const wxString& title, wxFontEncoding encoding ) = 0;
231
232 virtual void SetCursor( const wxCursor & cursor ) = 0;
233 virtual void CaptureMouse() = 0;
234 virtual void ReleaseMouse() = 0;
235
236 virtual wxInt32 GetValue() const = 0;
237 virtual void SetValue( wxInt32 v ) = 0;
238 virtual wxBitmap GetBitmap() const = 0;
239 virtual void SetBitmap( const wxBitmap& bitmap ) = 0;
240 virtual void SetBitmapPosition( wxDirection dir ) = 0;
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;
247 virtual wxInt32 GetMinimum() const = 0;
248 virtual wxInt32 GetMaximum() const = 0;
249 virtual void PulseGauge() = 0;
250 virtual void SetScrollThumb( wxInt32 value, wxInt32 thumbSize ) = 0;
251
252 virtual void SetFont( const wxFont & font , const wxColour& foreground , long windowStyle, bool ignoreBlack = true ) = 0;
253
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;
257
258 virtual void InstallEventHandler( WXWidget control = NULL ) = 0;
259
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
269 static WXWidget FindFocus();
270
271 // static creation methods, must be implemented by all toolkits
272
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
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
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);
454
455 // converts from Toplevel-Content relative to local
456 static void Convert( wxPoint *pt , wxWidgetImpl *from , wxWidgetImpl *to );
457 protected :
458 bool m_isRootControl;
459 wxWindowMac* m_wxPeer;
460 bool m_needsFocusRect;
461 bool m_needsFrame;
462
463 DECLARE_ABSTRACT_CLASS(wxWidgetImpl)
464 };
465
466 //
467 // the interface to be implemented eg by a listbox
468 //
469
470 class WXDLLIMPEXP_CORE wxListWidgetColumn
471 {
472 public :
473 virtual ~wxListWidgetColumn() {}
474 } ;
475
476 class WXDLLIMPEXP_CORE wxListWidgetCellValue
477 {
478 public :
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;
485
486 virtual int GetIntValue() const = 0;
487 virtual wxString GetStringValue() const = 0;
488 } ;
489
490 class WXDLLIMPEXP_CORE wxListWidgetImpl
491 {
492 public:
493 wxListWidgetImpl() {}
494 virtual ~wxListWidgetImpl() { }
495
496 virtual wxListWidgetColumn* InsertTextColumn( unsigned pos, const wxString& title, bool editable = false,
497 wxAlignment just = wxALIGN_LEFT , int defaultWidth = -1) = 0 ;
498 virtual wxListWidgetColumn* InsertCheckColumn( unsigned pos , const wxString& title, bool editable = false,
499 wxAlignment just = wxALIGN_LEFT , int defaultWidth = -1) = 0 ;
500
501 // add and remove
502
503 // TODO will be replaced
504 virtual void ListDelete( unsigned int n ) = 0;
505 virtual void ListInsert( unsigned int n ) = 0;
506 virtual void ListClear() = 0;
507
508 // selecting
509
510 virtual void ListDeselectAll() = 0;
511 virtual void ListSetSelection( unsigned int n, bool select, bool multi ) = 0;
512 virtual int ListGetSelection() const = 0;
513 virtual int ListGetSelections( wxArrayInt& aSelections ) const = 0;
514 virtual bool ListIsSelected( unsigned int n ) const = 0;
515
516 // display
517
518 virtual void ListScrollTo( unsigned int n ) = 0;
519 virtual void UpdateLine( unsigned int n, wxListWidgetColumn* col = NULL ) = 0;
520 virtual void UpdateLineToEnd( unsigned int n) = 0;
521
522 // accessing content
523
524 virtual unsigned int ListGetCount() const = 0;
525 };
526
527 //
528 // interface to be implemented by a textcontrol
529 //
530
531 class WXDLLIMPEXP_FWD_CORE wxTextAttr;
532
533 // common interface for all implementations
534 class WXDLLIMPEXP_CORE wxTextWidgetImpl
535
536 {
537 public :
538 wxTextWidgetImpl() {}
539
540 virtual ~wxTextWidgetImpl() {}
541
542 virtual bool CanFocus() const { return true; }
543
544 virtual wxString GetStringValue() const = 0 ;
545 virtual void SetStringValue( const wxString &val ) = 0 ;
546 virtual void SetSelection( long from, long to ) = 0 ;
547 virtual void GetSelection( long* from, long* to ) const = 0 ;
548 virtual void WriteText( const wxString& str ) = 0 ;
549
550 virtual void SetStyle( long start, long end, const wxTextAttr& style ) ;
551 virtual void Copy() ;
552 virtual void Cut() ;
553 virtual void Paste() ;
554 virtual bool CanPaste() const ;
555 virtual void SetEditable( bool editable ) ;
556 virtual long GetLastPosition() const ;
557 virtual void Replace( long from, long to, const wxString &str ) ;
558 virtual void Remove( long from, long to ) ;
559
560
561 virtual bool HasOwnContextMenu() const
562 { return false ; }
563
564 virtual bool SetupCursor( const wxPoint& WXUNUSED(pt) )
565 { return false ; }
566
567 virtual void Clear() ;
568 virtual bool CanUndo() const;
569 virtual void Undo() ;
570 virtual bool CanRedo() const;
571 virtual void Redo() ;
572 virtual int GetNumberOfLines() const ;
573 virtual long XYToPosition(long x, long y) const;
574 virtual bool PositionToXY(long pos, long *x, long *y) const ;
575 virtual void ShowPosition(long WXUNUSED(pos)) ;
576 virtual int GetLineLength(long lineNo) const ;
577 virtual wxString GetLineText(long lineNo) const ;
578 virtual void CheckSpelling(bool WXUNUSED(check)) { }
579 };
580
581 //
582 // common interface for search controls
583 //
584
585 class wxSearchWidgetImpl
586 {
587 public :
588 wxSearchWidgetImpl(){}
589 virtual ~wxSearchWidgetImpl(){}
590
591 // search field options
592 virtual void ShowSearchButton( bool show ) = 0;
593 virtual bool IsSearchButtonVisible() const = 0;
594
595 virtual void ShowCancelButton( bool show ) = 0;
596 virtual bool IsCancelButtonVisible() const = 0;
597
598 virtual void SetSearchMenu( wxMenu* menu ) = 0;
599
600 virtual void SetDescriptiveText(const wxString& text) = 0;
601 } ;
602
603 //
604 // toplevel window implementation class
605 //
606
607 class wxNonOwnedWindowImpl : public wxObject
608 {
609 public :
610 wxNonOwnedWindowImpl( wxNonOwnedWindow* nonownedwnd) : m_wxPeer(nonownedwnd)
611 {
612 }
613 wxNonOwnedWindowImpl()
614 {
615 }
616 virtual ~wxNonOwnedWindowImpl()
617 {
618 }
619
620 virtual void Destroy()
621 {
622 }
623
624 virtual void Create( wxWindow* parent, const wxPoint& pos, const wxSize& size,
625 long style, long extraStyle, const wxString& name ) = 0;
626
627
628 virtual WXWindow GetWXWindow() const = 0;
629
630 virtual void Raise()
631 {
632 }
633
634 virtual void Lower()
635 {
636 }
637
638 virtual bool Show(bool WXUNUSED(show))
639 {
640 return false;
641 }
642
643 virtual bool ShowWithEffect(bool show, wxShowEffect WXUNUSED(effect), unsigned WXUNUSED(timeout))
644 {
645 return Show(show);
646 }
647
648 virtual void Update()
649 {
650 }
651
652 virtual bool SetTransparent(wxByte WXUNUSED(alpha))
653 {
654 return false;
655 }
656
657 virtual bool SetBackgroundColour(const wxColour& WXUNUSED(col) )
658 {
659 return false;
660 }
661
662 virtual void SetExtraStyle( long WXUNUSED(exStyle) )
663 {
664 }
665
666 virtual bool SetBackgroundStyle(wxBackgroundStyle WXUNUSED(style))
667 {
668 return false ;
669 }
670
671 bool CanSetTransparent()
672 {
673 return false;
674 }
675
676 virtual void GetContentArea( int &left , int &top , int &width , int &height ) const = 0;
677 virtual void MoveWindow(int x, int y, int width, int height) = 0;
678 virtual void GetPosition( int &x, int &y ) const = 0;
679 virtual void GetSize( int &width, int &height ) const = 0;
680
681 virtual bool SetShape(const wxRegion& WXUNUSED(region))
682 {
683 return false;
684 }
685
686 virtual void SetTitle( const wxString& title, wxFontEncoding encoding ) = 0;
687
688 virtual bool IsMaximized() const = 0;
689
690 virtual bool IsIconized() const= 0;
691
692 virtual void Iconize( bool iconize )= 0;
693
694 virtual void Maximize(bool maximize) = 0;
695
696 virtual bool IsFullScreen() const= 0;
697
698 virtual bool ShowFullScreen(bool show, long style)= 0;
699
700 virtual void RequestUserAttention(int flags) = 0;
701
702 virtual void ScreenToWindow( int *x, int *y ) = 0;
703
704 virtual void WindowToScreen( int *x, int *y ) = 0;
705
706 wxNonOwnedWindow* GetWXPeer() { return m_wxPeer; }
707
708 // static creation methods, must be implemented by all toolkits
709
710 static wxNonOwnedWindowImpl* CreateNonOwnedWindow( wxNonOwnedWindow* wxpeer, wxWindow* parent, const wxPoint& pos, const wxSize& size,
711 long style, long extraStyle, const wxString& name ) ;
712
713 protected :
714 wxNonOwnedWindow* m_wxPeer;
715 DECLARE_ABSTRACT_CLASS(wxNonOwnedWindowImpl)
716 };
717
718 #endif // wxUSE_GUI
719
720 //---------------------------------------------------------------------------
721 // cocoa bridging utilities
722 //---------------------------------------------------------------------------
723
724 bool wxMacInitCocoa();
725
726 class WXDLLIMPEXP_CORE wxMacAutoreleasePool
727 {
728 public :
729 wxMacAutoreleasePool();
730 ~wxMacAutoreleasePool();
731 private :
732 void* m_pool;
733 };
734
735 // NSObject
736
737 void wxMacCocoaRelease( void* obj );
738 void wxMacCocoaAutorelease( void* obj );
739 void* wxMacCocoaRetain( void* obj );
740
741
742 #endif
743 // _WX_PRIVATE_CORE_H_