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
6 // Author: Stefan Csomor
9 // Copyright: (c) Stefan Csomor
10 // Licence: wxWindows licence
11 /////////////////////////////////////////////////////////////////////////////
13 #ifndef _WX_PRIVATE_CORE_H_
14 #define _WX_PRIVATE_CORE_H_
18 #include <CoreFoundation/CoreFoundation.h>
20 #include "wx/osx/core/cfstring.h"
21 #include "wx/osx/core/cfdataref.h"
23 // Define helper macros allowing to insert small snippets of code to be
24 // compiled for high enough OS X version only: this shouldn't be abused for
25 // anything big but it's handy for e.g. specifying OS X 10.6-only protocols in
26 // the Objective C classes declarations when they're not supported under the
28 #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
29 #define wxOSX_10_6_AND_LATER(x) x
31 #define wxOSX_10_6_AND_LATER(x)
34 // platform specific Clang analyzer support
35 #ifndef NS_RETURNS_RETAINED
36 # if WX_HAS_CLANG_FEATURE(attribute_ns_returns_retained)
37 # define NS_RETURNS_RETAINED __attribute__((ns_returns_retained))
39 # define NS_RETURNS_RETAINED
43 #ifndef CF_RETURNS_RETAINED
44 # if WX_HAS_CLANG_FEATURE(attribute_cf_returns_retained)
45 # define CF_RETURNS_RETAINED __attribute__((cf_returns_retained))
47 # define CF_RETURNS_RETAINED
51 #if ( !wxUSE_GUI && !wxOSX_USE_IPHONE ) || wxOSX_USE_COCOA_OR_CARBON
53 // Carbon functions are currently still used in wxOSX/Cocoa too (including
54 // wxBase part of it).
55 #include <Carbon/Carbon.h>
57 WXDLLIMPEXP_BASE
long UMAGetSystemVersion() ;
59 void WXDLLIMPEXP_CORE
wxMacStringToPascal( const wxString
&from
, unsigned char * to
);
60 wxString WXDLLIMPEXP_CORE
wxMacMakeStringFromPascal( const unsigned char * from
);
62 WXDLLIMPEXP_BASE wxString
wxMacFSRefToPath( const FSRef
*fsRef
, CFStringRef additionalPathComponent
= NULL
);
63 WXDLLIMPEXP_BASE OSStatus
wxMacPathToFSRef( const wxString
&path
, FSRef
*fsRef
);
64 WXDLLIMPEXP_BASE wxString
wxMacHFSUniStrToString( ConstHFSUniStr255Param uniname
);
66 // keycode utils from app.cpp
68 WXDLLIMPEXP_BASE CGKeyCode
wxCharCodeWXToOSX(wxKeyCode code
);
69 WXDLLIMPEXP_BASE
long wxMacTranslateKey(unsigned char key
, unsigned char code
);
76 #include <CoreGraphics/CoreGraphics.h>
78 #include <ApplicationServices/ApplicationServices.h>
81 #include "wx/bitmap.h"
82 #include "wx/window.h"
84 class WXDLLIMPEXP_CORE wxMacCGContextStateSaver
86 wxDECLARE_NO_COPY_CLASS(wxMacCGContextStateSaver
);
89 wxMacCGContextStateSaver( CGContextRef cg
)
92 CGContextSaveGState( cg
);
94 ~wxMacCGContextStateSaver()
96 CGContextRestoreGState( m_cg
);
102 class WXDLLIMPEXP_CORE wxDeferredObjectDeleter
: public wxObject
105 wxDeferredObjectDeleter( wxObject
* obj
) : m_obj(obj
)
108 virtual ~wxDeferredObjectDeleter()
118 WXDLLIMPEXP_CORE CGImageRef
wxMacCreateCGImageFromBitmap( const wxBitmap
& bitmap
);
120 WXDLLIMPEXP_CORE CGDataProviderRef
wxMacCGDataProviderCreateWithCFData( CFDataRef data
);
121 WXDLLIMPEXP_CORE CGDataConsumerRef
wxMacCGDataConsumerCreateWithCFData( CFMutableDataRef data
);
122 WXDLLIMPEXP_CORE CGDataProviderRef
wxMacCGDataProviderCreateWithMemoryBuffer( const wxMemoryBuffer
& buf
);
124 WXDLLIMPEXP_CORE CGColorSpaceRef
wxMacGetGenericRGBColorSpace(void);
126 WXDLLIMPEXP_CORE
double wxOSXGetMainScreenContentScaleFactor();
130 extern wxWindow
* g_MacLastWindow
;
131 class wxNonOwnedWindow
;
133 // temporary typedef so that no additional casts are necessary within carbon code at the moment
142 WXDLLIMPEXP_CORE wxWindowMac
* wxFindWindowFromWXWidget(WXWidget inControl
);
145 typedef wxMacControl wxWidgetImplType
;
147 typedef wxWidgetImpl wxWidgetImplType
;
151 class wxMenuItemImpl
: public wxObject
154 wxMenuItemImpl( wxMenuItem
* peer
) : m_peer(peer
)
158 virtual ~wxMenuItemImpl() ;
159 virtual void SetBitmap( const wxBitmap
& bitmap
) = 0;
160 virtual void Enable( bool enable
) = 0;
161 virtual void Check( bool check
) = 0;
162 virtual void SetLabel( const wxString
& text
, wxAcceleratorEntry
*entry
) = 0;
163 virtual void Hide( bool hide
= true ) = 0;
165 virtual void * GetHMenuItem() = 0;
167 wxMenuItem
* GetWXPeer() { return m_peer
; }
169 static wxMenuItemImpl
* Create( wxMenuItem
* peer
, wxMenu
*pParentMenu
,
171 const wxString
& text
,
172 wxAcceleratorEntry
*entry
,
173 const wxString
& strHelp
,
177 // handle OS specific menu items if they weren't handled during normal processing
178 virtual bool DoDefault() { return false; }
182 DECLARE_ABSTRACT_CLASS(wxMenuItemImpl
)
185 class wxMenuImpl
: public wxObject
188 wxMenuImpl( wxMenu
* peer
) : m_peer(peer
)
192 virtual ~wxMenuImpl() ;
193 virtual void InsertOrAppend(wxMenuItem
*pItem
, size_t pos
) = 0;
194 virtual void Remove( wxMenuItem
*pItem
) = 0;
196 virtual void MakeRoot() = 0;
198 virtual void SetTitle( const wxString
& text
) = 0;
200 virtual WXHMENU
GetHMenu() = 0;
202 wxMenu
* GetWXPeer() { return m_peer
; }
204 virtual void PopUp( wxWindow
*win
, int x
, int y
) = 0;
206 static wxMenuImpl
* Create( wxMenu
* peer
, const wxString
& title
);
207 static wxMenuImpl
* CreateRootMenu( wxMenu
* peer
);
211 DECLARE_ABSTRACT_CLASS(wxMenuItemImpl
)
216 class WXDLLIMPEXP_CORE wxWidgetImpl
: public wxObject
219 wxWidgetImpl( wxWindowMac
* peer
, bool isRootControl
= false, bool isUserPane
= false );
221 virtual ~wxWidgetImpl();
225 bool IsRootControl() const { return m_isRootControl
; }
227 bool IsUserPane() const { return m_isUserPane
; }
229 wxWindowMac
* GetWXPeer() const { return m_wxPeer
; }
231 bool IsOk() const { return GetWXWidget() != NULL
; }
233 // not only the control itself, but also all its parents must be visible
234 // in order for this function to return true
235 virtual bool IsVisible() const = 0;
236 // set the visibility of this widget (maybe latent)
237 virtual void SetVisibility( bool visible
) = 0;
239 virtual bool ShowWithEffect(bool WXUNUSED(show
),
240 wxShowEffect
WXUNUSED(effect
),
241 unsigned WXUNUSED(timeout
))
246 virtual void Raise() = 0;
248 virtual void Lower() = 0;
250 virtual void ScrollRect( const wxRect
*rect
, int dx
, int dy
) = 0;
252 virtual WXWidget
GetWXWidget() const = 0;
254 virtual void SetBackgroundColour( const wxColour
& col
) = 0;
255 virtual bool SetBackgroundStyle(wxBackgroundStyle style
) = 0;
257 // all coordinates in native parent widget relative coordinates
258 virtual void GetContentArea( int &left
, int &top
, int &width
, int &height
) const = 0;
259 virtual void Move(int x
, int y
, int width
, int height
) = 0;
260 virtual void GetPosition( int &x
, int &y
) const = 0;
261 virtual void GetSize( int &width
, int &height
) const = 0;
262 virtual void SetControlSize( wxWindowVariant variant
) = 0;
263 virtual double GetContentScaleFactor() const
268 // the native coordinates may have an 'aura' for shadows etc, if this is the case the layout
269 // inset indicates on which insets the real control is drawn
270 virtual void GetLayoutInset(int &left
, int &top
, int &right
, int &bottom
) const
272 left
= top
= right
= bottom
= 0;
275 // native view coordinates are topleft to bottom right (flipped regarding CoreGraphics origin)
276 virtual bool IsFlipped() const { return true; }
278 virtual void SetNeedsDisplay( const wxRect
* where
= NULL
) = 0;
279 virtual bool GetNeedsDisplay() const = 0;
281 virtual bool NeedsFocusRect() const;
282 virtual void SetNeedsFocusRect( bool needs
);
284 virtual bool NeedsFrame() const;
285 virtual void SetNeedsFrame( bool needs
);
287 virtual void SetDrawingEnabled(bool enabled
);
289 virtual bool CanFocus() const = 0;
290 // return true if successful
291 virtual bool SetFocus() = 0;
292 virtual bool HasFocus() const = 0;
294 virtual void RemoveFromParent() = 0;
295 virtual void Embed( wxWidgetImpl
*parent
) = 0;
297 virtual void SetDefaultButton( bool isDefault
) = 0;
298 virtual void PerformClick() = 0;
299 virtual void SetLabel( const wxString
& title
, wxFontEncoding encoding
) = 0;
300 #if wxUSE_MARKUP && wxOSX_USE_COCOA
301 virtual void SetLabelMarkup( const wxString
& WXUNUSED(markup
) ) { }
304 virtual void SetCursor( const wxCursor
& cursor
) = 0;
305 virtual void CaptureMouse() = 0;
306 virtual void ReleaseMouse() = 0;
308 virtual void SetDropTarget( wxDropTarget
* WXUNUSED(dropTarget
) ) {}
310 virtual wxInt32
GetValue() const = 0;
311 virtual void SetValue( wxInt32 v
) = 0;
312 virtual wxBitmap
GetBitmap() const = 0;
313 virtual void SetBitmap( const wxBitmap
& bitmap
) = 0;
314 virtual void SetBitmapPosition( wxDirection dir
) = 0;
315 virtual void SetupTabs( const wxNotebook
& WXUNUSED(notebook
) ) {}
316 virtual int TabHitTest( const wxPoint
& WXUNUSED(pt
), long *flags
) {*flags
=1; return -1;};
317 virtual void GetBestRect( wxRect
*r
) const = 0;
318 virtual bool IsEnabled() const = 0;
319 virtual void Enable( bool enable
) = 0;
320 virtual void SetMinimum( wxInt32 v
) = 0;
321 virtual void SetMaximum( wxInt32 v
) = 0;
322 virtual wxInt32
GetMinimum() const = 0;
323 virtual wxInt32
GetMaximum() const = 0;
324 virtual void PulseGauge() = 0;
325 virtual void SetScrollThumb( wxInt32 value
, wxInt32 thumbSize
) = 0;
327 virtual void SetFont( const wxFont
& font
, const wxColour
& foreground
, long windowStyle
, bool ignoreBlack
= true ) = 0;
329 virtual void SetToolTip(wxToolTip
* WXUNUSED(tooltip
)) { }
331 // is the clicked event sent AFTER the state already changed, so no additional
332 // state changing logic is required from the outside
333 virtual bool ButtonClickDidStateChange() = 0;
335 virtual void InstallEventHandler( WXWidget control
= NULL
) = 0;
337 // Mechanism used to keep track of whether a change should send an event
338 // Do SendEvents(false) when starting actions that would trigger programmatic events
339 // and SendEvents(true) at the end of the block.
340 virtual void SendEvents(bool shouldSendEvents
) { m_shouldSendEvents
= shouldSendEvents
; }
341 virtual bool ShouldSendEvents() { return m_shouldSendEvents
; }
343 // static methods for associating native controls and their implementations
345 // finds the impl associated with this native control
347 FindFromWXWidget(WXWidget control
);
349 // finds the impl associated with this native control, if the native control itself is not known
350 // also checks whether its parent is eg a registered scrollview, ie whether the control is a native subpart
351 // of a known control
353 FindBestFromWXWidget(WXWidget control
);
355 static void RemoveAssociations( wxWidgetImpl
* impl
);
357 static void Associate( WXWidget control
, wxWidgetImpl
*impl
);
359 static WXWidget
FindFocus();
361 // static creation methods, must be implemented by all toolkits
363 static wxWidgetImplType
* CreateUserPane( wxWindowMac
* wxpeer
,
370 static wxWidgetImplType
* CreateContentView( wxNonOwnedWindow
* now
) ;
372 static wxWidgetImplType
* CreateButton( wxWindowMac
* wxpeer
,
375 const wxString
& label
,
381 static wxWidgetImplType
* CreateDisclosureTriangle( wxWindowMac
* wxpeer
,
384 const wxString
& label
,
390 static wxWidgetImplType
* CreateStaticLine( wxWindowMac
* wxpeer
,
398 static wxWidgetImplType
* CreateGroupBox( wxWindowMac
* wxpeer
,
401 const wxString
& label
,
407 static wxWidgetImplType
* CreateStaticText( wxWindowMac
* wxpeer
,
410 const wxString
& label
,
416 static wxWidgetImplType
* CreateTextControl( wxTextCtrl
* wxpeer
,
419 const wxString
& content
,
425 static wxWidgetImplType
* CreateSearchControl( wxSearchCtrl
* wxpeer
,
428 const wxString
& content
,
434 static wxWidgetImplType
* CreateCheckBox( wxWindowMac
* wxpeer
,
437 const wxString
& label
,
443 static wxWidgetImplType
* CreateRadioButton( wxWindowMac
* wxpeer
,
446 const wxString
& label
,
452 static wxWidgetImplType
* CreateToggleButton( wxWindowMac
* wxpeer
,
455 const wxString
& label
,
461 static wxWidgetImplType
* CreateBitmapToggleButton( wxWindowMac
* wxpeer
,
464 const wxBitmap
& bitmap
,
470 static wxWidgetImplType
* CreateBitmapButton( wxWindowMac
* wxpeer
,
473 const wxBitmap
& bitmap
,
479 static wxWidgetImplType
* CreateTabView( wxWindowMac
* wxpeer
,
487 static wxWidgetImplType
* CreateGauge( wxWindowMac
* wxpeer
,
498 static wxWidgetImplType
* CreateSlider( wxWindowMac
* wxpeer
,
509 static wxWidgetImplType
* CreateSpinButton( wxWindowMac
* wxpeer
,
520 static wxWidgetImplType
* CreateScrollBar( wxWindowMac
* wxpeer
,
528 static wxWidgetImplType
* CreateChoice( wxWindowMac
* wxpeer
,
537 static wxWidgetImplType
* CreateListBox( wxWindowMac
* wxpeer
,
546 static wxWidgetImplType
* CreateComboBox( wxComboBox
* wxpeer
,
556 // converts from Toplevel-Content relative to local
557 static void Convert( wxPoint
*pt
, wxWidgetImpl
*from
, wxWidgetImpl
*to
);
559 bool m_isRootControl
;
561 wxWindowMac
* m_wxPeer
;
562 bool m_needsFocusRect
;
564 bool m_shouldSendEvents
;
566 DECLARE_ABSTRACT_CLASS(wxWidgetImpl
)
570 // the interface to be implemented eg by a listbox
573 class WXDLLIMPEXP_CORE wxListWidgetColumn
576 virtual ~wxListWidgetColumn() {}
579 class WXDLLIMPEXP_CORE wxListWidgetCellValue
582 wxListWidgetCellValue() {}
583 virtual ~wxListWidgetCellValue() {}
585 virtual void Set( CFStringRef value
) = 0;
586 virtual void Set( const wxString
& value
) = 0;
587 virtual void Set( int value
) = 0;
588 virtual void Check( bool check
);
590 virtual bool IsChecked() const;
591 virtual int GetIntValue() const = 0;
592 virtual wxString
GetStringValue() const = 0;
595 class WXDLLIMPEXP_CORE wxListWidgetImpl
598 wxListWidgetImpl() {}
599 virtual ~wxListWidgetImpl() { }
601 virtual wxListWidgetColumn
* InsertTextColumn( unsigned pos
, const wxString
& title
, bool editable
= false,
602 wxAlignment just
= wxALIGN_LEFT
, int defaultWidth
= -1) = 0 ;
603 virtual wxListWidgetColumn
* InsertCheckColumn( unsigned pos
, const wxString
& title
, bool editable
= false,
604 wxAlignment just
= wxALIGN_LEFT
, int defaultWidth
= -1) = 0 ;
608 // TODO will be replaced
609 virtual void ListDelete( unsigned int n
) = 0;
610 virtual void ListInsert( unsigned int n
) = 0;
611 virtual void ListClear() = 0;
615 virtual void ListDeselectAll() = 0;
616 virtual void ListSetSelection( unsigned int n
, bool select
, bool multi
) = 0;
617 virtual int ListGetSelection() const = 0;
618 virtual int ListGetSelections( wxArrayInt
& aSelections
) const = 0;
619 virtual bool ListIsSelected( unsigned int n
) const = 0;
623 virtual void ListScrollTo( unsigned int n
) = 0;
624 virtual void UpdateLine( unsigned int n
, wxListWidgetColumn
* col
= NULL
) = 0;
625 virtual void UpdateLineToEnd( unsigned int n
) = 0;
629 virtual unsigned int ListGetCount() const = 0;
631 virtual int DoListHitTest( const wxPoint
& inpoint
) const = 0;
635 // interface to be implemented by a textcontrol
638 class WXDLLIMPEXP_FWD_CORE wxTextAttr
;
639 class WXDLLIMPEXP_FWD_CORE wxTextEntry
;
641 // common interface for all implementations
642 class WXDLLIMPEXP_CORE wxTextWidgetImpl
646 // Any widgets implementing this interface must be associated with a
647 // wxTextEntry so instead of requiring the derived classes to implement
648 // another (pure) virtual function, just take the pointer to this entry in
649 // our ctor and implement GetTextEntry() ourselves.
650 wxTextWidgetImpl(wxTextEntry
*entry
) : m_entry(entry
) {}
652 virtual ~wxTextWidgetImpl() {}
654 wxTextEntry
*GetTextEntry() const { return m_entry
; }
656 virtual bool CanFocus() const { return true; }
658 virtual wxString
GetStringValue() const = 0 ;
659 virtual void SetStringValue( const wxString
&val
) = 0 ;
660 virtual void SetSelection( long from
, long to
) = 0 ;
661 virtual void GetSelection( long* from
, long* to
) const = 0 ;
662 virtual void WriteText( const wxString
& str
) = 0 ;
664 virtual bool CanClipMaxLength() const { return false; }
665 virtual void SetMaxLength(unsigned long WXUNUSED(len
)) {}
667 virtual bool GetStyle( long position
, wxTextAttr
& style
);
668 virtual void SetStyle( long start
, long end
, const wxTextAttr
& style
) ;
669 virtual void Copy() ;
671 virtual void Paste() ;
672 virtual bool CanPaste() const ;
673 virtual void SetEditable( bool editable
) ;
674 virtual long GetLastPosition() const ;
675 virtual void Replace( long from
, long to
, const wxString
&str
) ;
676 virtual void Remove( long from
, long to
) ;
679 virtual bool HasOwnContextMenu() const
682 virtual bool SetupCursor( const wxPoint
& WXUNUSED(pt
) )
685 virtual void Clear() ;
686 virtual bool CanUndo() const;
687 virtual void Undo() ;
688 virtual bool CanRedo() const;
689 virtual void Redo() ;
690 virtual int GetNumberOfLines() const ;
691 virtual long XYToPosition(long x
, long y
) const;
692 virtual bool PositionToXY(long pos
, long *x
, long *y
) const ;
693 virtual void ShowPosition(long WXUNUSED(pos
)) ;
694 virtual int GetLineLength(long lineNo
) const ;
695 virtual wxString
GetLineText(long lineNo
) const ;
696 virtual void CheckSpelling(bool WXUNUSED(check
)) { }
698 virtual wxSize
GetBestSize() const { return wxDefaultSize
; }
700 virtual bool SetHint(const wxString
& WXUNUSED(hint
)) { return false; }
702 wxTextEntry
* const m_entry
;
704 wxDECLARE_NO_COPY_CLASS(wxTextWidgetImpl
);
707 // common interface for all implementations
708 class WXDLLIMPEXP_CORE wxComboWidgetImpl
712 wxComboWidgetImpl() {}
714 virtual ~wxComboWidgetImpl() {}
716 virtual int GetSelectedItem() const { return -1; }
717 virtual void SetSelectedItem(int WXUNUSED(item
)) {}
719 virtual int GetNumberOfItems() const { return -1; }
721 virtual void InsertItem(int WXUNUSED(pos
), const wxString
& WXUNUSED(item
)) {}
723 virtual void RemoveItem(int WXUNUSED(pos
)) {}
725 virtual void Clear() {}
726 virtual void Popup() {}
727 virtual void Dismiss() {}
729 virtual wxString
GetStringAtIndex(int WXUNUSED(pos
)) const { return wxEmptyString
; }
731 virtual int FindString(const wxString
& WXUNUSED(text
)) const { return -1; }
735 // common interface for buttons
742 virtual ~wxButtonImpl(){}
744 virtual void SetPressedBitmap( const wxBitmap
& bitmap
) = 0;
748 // common interface for search controls
751 class wxSearchWidgetImpl
754 wxSearchWidgetImpl(){}
755 virtual ~wxSearchWidgetImpl(){}
757 // search field options
758 virtual void ShowSearchButton( bool show
) = 0;
759 virtual bool IsSearchButtonVisible() const = 0;
761 virtual void ShowCancelButton( bool show
) = 0;
762 virtual bool IsCancelButtonVisible() const = 0;
764 virtual void SetSearchMenu( wxMenu
* menu
) = 0;
766 virtual void SetDescriptiveText(const wxString
& text
) = 0;
770 // toplevel window implementation class
773 class wxNonOwnedWindowImpl
: public wxObject
776 wxNonOwnedWindowImpl( wxNonOwnedWindow
* nonownedwnd
) : m_wxPeer(nonownedwnd
)
779 wxNonOwnedWindowImpl()
782 virtual ~wxNonOwnedWindowImpl()
786 virtual void WillBeDestroyed()
790 virtual void Create( wxWindow
* parent
, const wxPoint
& pos
, const wxSize
& size
,
791 long style
, long extraStyle
, const wxString
& name
) = 0;
794 virtual WXWindow
GetWXWindow() const = 0;
804 virtual bool Show(bool WXUNUSED(show
))
809 virtual bool ShowWithEffect(bool show
, wxShowEffect
WXUNUSED(effect
), unsigned WXUNUSED(timeout
))
814 virtual void Update()
818 virtual bool SetTransparent(wxByte
WXUNUSED(alpha
))
823 virtual bool SetBackgroundColour(const wxColour
& WXUNUSED(col
) )
828 virtual void SetExtraStyle( long WXUNUSED(exStyle
) )
832 virtual void SetWindowStyleFlag( long WXUNUSED(style
) )
836 virtual bool SetBackgroundStyle(wxBackgroundStyle
WXUNUSED(style
))
841 virtual bool CanSetTransparent()
846 virtual void GetContentArea( int &left
, int &top
, int &width
, int &height
) const = 0;
847 virtual void MoveWindow(int x
, int y
, int width
, int height
) = 0;
848 virtual void GetPosition( int &x
, int &y
) const = 0;
849 virtual void GetSize( int &width
, int &height
) const = 0;
851 virtual bool SetShape(const wxRegion
& WXUNUSED(region
))
856 virtual void SetTitle( const wxString
& title
, wxFontEncoding encoding
) = 0;
858 virtual bool IsMaximized() const = 0;
860 virtual bool IsIconized() const= 0;
862 virtual void Iconize( bool iconize
)= 0;
864 virtual void Maximize(bool maximize
) = 0;
866 virtual bool IsFullScreen() const= 0;
868 virtual void ShowWithoutActivating() { Show(true); }
870 virtual bool ShowFullScreen(bool show
, long style
)= 0;
872 virtual void RequestUserAttention(int flags
) = 0;
874 virtual void ScreenToWindow( int *x
, int *y
) = 0;
876 virtual void WindowToScreen( int *x
, int *y
) = 0;
878 virtual bool IsActive() = 0;
880 wxNonOwnedWindow
* GetWXPeer() { return m_wxPeer
; }
882 static wxNonOwnedWindowImpl
*
883 FindFromWXWindow(WXWindow window
);
885 static void RemoveAssociations( wxNonOwnedWindowImpl
* impl
);
887 static void Associate( WXWindow window
, wxNonOwnedWindowImpl
*impl
);
889 // static creation methods, must be implemented by all toolkits
891 static wxNonOwnedWindowImpl
* CreateNonOwnedWindow( wxNonOwnedWindow
* wxpeer
, wxWindow
* parent
, WXWindow native
) ;
893 static wxNonOwnedWindowImpl
* CreateNonOwnedWindow( wxNonOwnedWindow
* wxpeer
, wxWindow
* parent
, const wxPoint
& pos
, const wxSize
& size
,
894 long style
, long extraStyle
, const wxString
& name
) ;
896 virtual void SetModified(bool WXUNUSED(modified
)) { }
897 virtual bool IsModified() const { return false; }
899 virtual void SetRepresentedFilename(const wxString
& WXUNUSED(filename
)) { }
902 virtual CGFloat
GetWindowLevel() const { return 0.0; }
904 virtual CGWindowLevel
GetWindowLevel() const { return kCGNormalWindowLevel
; }
906 virtual void RestoreWindowLevel() {}
908 wxNonOwnedWindow
* m_wxPeer
;
909 DECLARE_ABSTRACT_CLASS(wxNonOwnedWindowImpl
)
914 //---------------------------------------------------------------------------
915 // cocoa bridging utilities
916 //---------------------------------------------------------------------------
918 bool wxMacInitCocoa();
920 class WXDLLIMPEXP_CORE wxMacAutoreleasePool
923 wxMacAutoreleasePool();
924 ~wxMacAutoreleasePool();
931 void wxMacCocoaRelease( void* obj
);
932 void wxMacCocoaAutorelease( void* obj
);
933 void* wxMacCocoaRetain( void* obj
);
937 // _WX_PRIVATE_CORE_H_