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
10 // Copyright: (c) Stefan Csomor
11 // Licence: wxWindows licence
12 /////////////////////////////////////////////////////////////////////////////
14 #ifndef _WX_PRIVATE_CORE_H_
15 #define _WX_PRIVATE_CORE_H_
19 #include <CoreFoundation/CoreFoundation.h>
21 #include "wx/osx/core/cfstring.h"
22 #include "wx/osx/core/cfdataref.h"
24 // Define helper macros allowing to insert small snippets of code to be
25 // compiled for high enough OS X version only: this shouldn't be abused for
26 // anything big but it's handy for e.g. specifying OS X 10.6-only protocols in
27 // the Objective C classes declarations when they're not supported under the
29 #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
30 #define wxOSX_10_6_AND_LATER(x) x
32 #define wxOSX_10_6_AND_LATER(x)
35 // platform specific Clang analyzer support
36 #ifndef NS_RETURNS_RETAINED
37 # if WX_HAS_CLANG_FEATURE(attribute_ns_returns_retained)
38 # define NS_RETURNS_RETAINED __attribute__((ns_returns_retained))
40 # define NS_RETURNS_RETAINED
44 #ifndef CF_RETURNS_RETAINED
45 # if WX_HAS_CLANG_FEATURE(attribute_cf_returns_retained)
46 # define CF_RETURNS_RETAINED __attribute__((cf_returns_retained))
48 # define CF_RETURNS_RETAINED
52 #if ( !wxUSE_GUI && !wxOSX_USE_IPHONE ) || wxOSX_USE_COCOA_OR_CARBON
54 // Carbon functions are currently still used in wxOSX/Cocoa too (including
55 // wxBase part of it).
56 #include <Carbon/Carbon.h>
58 WXDLLIMPEXP_BASE
long UMAGetSystemVersion() ;
60 void WXDLLIMPEXP_CORE
wxMacStringToPascal( const wxString
&from
, unsigned char * to
);
61 wxString WXDLLIMPEXP_CORE
wxMacMakeStringFromPascal( const unsigned char * from
);
63 WXDLLIMPEXP_BASE wxString
wxMacFSRefToPath( const FSRef
*fsRef
, CFStringRef additionalPathComponent
= NULL
);
64 WXDLLIMPEXP_BASE OSStatus
wxMacPathToFSRef( const wxString
&path
, FSRef
*fsRef
);
65 WXDLLIMPEXP_BASE wxString
wxMacHFSUniStrToString( ConstHFSUniStr255Param uniname
);
67 // keycode utils from app.cpp
69 WXDLLIMPEXP_BASE CGKeyCode
wxCharCodeWXToOSX(wxKeyCode code
);
70 WXDLLIMPEXP_BASE
long wxMacTranslateKey(unsigned char key
, unsigned char code
);
77 #include <CoreGraphics/CoreGraphics.h>
79 #include <ApplicationServices/ApplicationServices.h>
82 #include "wx/bitmap.h"
83 #include "wx/window.h"
85 class WXDLLIMPEXP_CORE wxMacCGContextStateSaver
87 wxDECLARE_NO_COPY_CLASS(wxMacCGContextStateSaver
);
90 wxMacCGContextStateSaver( CGContextRef cg
)
93 CGContextSaveGState( cg
);
95 ~wxMacCGContextStateSaver()
97 CGContextRestoreGState( m_cg
);
103 class WXDLLIMPEXP_CORE wxDeferredObjectDeleter
: public wxObject
106 wxDeferredObjectDeleter( wxObject
* obj
) : m_obj(obj
)
109 virtual ~wxDeferredObjectDeleter()
119 WXDLLIMPEXP_CORE CGImageRef
wxMacCreateCGImageFromBitmap( const wxBitmap
& bitmap
);
121 WXDLLIMPEXP_CORE CGDataProviderRef
wxMacCGDataProviderCreateWithCFData( CFDataRef data
);
122 WXDLLIMPEXP_CORE CGDataConsumerRef
wxMacCGDataConsumerCreateWithCFData( CFMutableDataRef data
);
123 WXDLLIMPEXP_CORE CGDataProviderRef
wxMacCGDataProviderCreateWithMemoryBuffer( const wxMemoryBuffer
& buf
);
125 WXDLLIMPEXP_CORE CGColorSpaceRef
wxMacGetGenericRGBColorSpace(void);
127 WXDLLIMPEXP_CORE
double wxOSXGetMainScreenContentScaleFactor();
131 extern wxWindow
* g_MacLastWindow
;
132 class wxNonOwnedWindow
;
134 // temporary typedef so that no additional casts are necessary within carbon code at the moment
143 WXDLLIMPEXP_CORE wxWindowMac
* wxFindWindowFromWXWidget(WXWidget inControl
);
146 typedef wxMacControl wxWidgetImplType
;
148 typedef wxWidgetImpl wxWidgetImplType
;
152 class wxMenuItemImpl
: public wxObject
155 wxMenuItemImpl( wxMenuItem
* peer
) : m_peer(peer
)
159 virtual ~wxMenuItemImpl() ;
160 virtual void SetBitmap( const wxBitmap
& bitmap
) = 0;
161 virtual void Enable( bool enable
) = 0;
162 virtual void Check( bool check
) = 0;
163 virtual void SetLabel( const wxString
& text
, wxAcceleratorEntry
*entry
) = 0;
164 virtual void Hide( bool hide
= true ) = 0;
166 virtual void * GetHMenuItem() = 0;
168 wxMenuItem
* GetWXPeer() { return m_peer
; }
170 static wxMenuItemImpl
* Create( wxMenuItem
* peer
, wxMenu
*pParentMenu
,
172 const wxString
& text
,
173 wxAcceleratorEntry
*entry
,
174 const wxString
& strHelp
,
178 // handle OS specific menu items if they weren't handled during normal processing
179 virtual bool DoDefault() { return false; }
183 DECLARE_ABSTRACT_CLASS(wxMenuItemImpl
)
186 class wxMenuImpl
: public wxObject
189 wxMenuImpl( wxMenu
* peer
) : m_peer(peer
)
193 virtual ~wxMenuImpl() ;
194 virtual void InsertOrAppend(wxMenuItem
*pItem
, size_t pos
) = 0;
195 virtual void Remove( wxMenuItem
*pItem
) = 0;
197 virtual void MakeRoot() = 0;
199 virtual void SetTitle( const wxString
& text
) = 0;
201 virtual WXHMENU
GetHMenu() = 0;
203 wxMenu
* GetWXPeer() { return m_peer
; }
205 virtual void PopUp( wxWindow
*win
, int x
, int y
) = 0;
207 static wxMenuImpl
* Create( wxMenu
* peer
, const wxString
& title
);
208 static wxMenuImpl
* CreateRootMenu( wxMenu
* peer
);
212 DECLARE_ABSTRACT_CLASS(wxMenuItemImpl
)
217 class WXDLLIMPEXP_CORE wxWidgetImpl
: public wxObject
220 wxWidgetImpl( wxWindowMac
* peer
, bool isRootControl
= false, bool isUserPane
= false );
222 virtual ~wxWidgetImpl();
226 bool IsRootControl() const { return m_isRootControl
; }
228 bool IsUserPane() const { return m_isUserPane
; }
230 wxWindowMac
* GetWXPeer() const { return m_wxPeer
; }
232 bool IsOk() const { return GetWXWidget() != NULL
; }
234 // not only the control itself, but also all its parents must be visible
235 // in order for this function to return true
236 virtual bool IsVisible() const = 0;
237 // set the visibility of this widget (maybe latent)
238 virtual void SetVisibility( bool visible
) = 0;
240 virtual bool ShowWithEffect(bool WXUNUSED(show
),
241 wxShowEffect
WXUNUSED(effect
),
242 unsigned WXUNUSED(timeout
))
247 virtual void Raise() = 0;
249 virtual void Lower() = 0;
251 virtual void ScrollRect( const wxRect
*rect
, int dx
, int dy
) = 0;
253 virtual WXWidget
GetWXWidget() const = 0;
255 virtual void SetBackgroundColour( const wxColour
& col
) = 0;
256 virtual bool SetBackgroundStyle(wxBackgroundStyle style
) = 0;
258 // all coordinates in native parent widget relative coordinates
259 virtual void GetContentArea( int &left
, int &top
, int &width
, int &height
) const = 0;
260 virtual void Move(int x
, int y
, int width
, int height
) = 0;
261 virtual void GetPosition( int &x
, int &y
) const = 0;
262 virtual void GetSize( int &width
, int &height
) const = 0;
263 virtual void SetControlSize( wxWindowVariant variant
) = 0;
264 virtual double GetContentScaleFactor() const
269 // the native coordinates may have an 'aura' for shadows etc, if this is the case the layout
270 // inset indicates on which insets the real control is drawn
271 virtual void GetLayoutInset(int &left
, int &top
, int &right
, int &bottom
) const
273 left
= top
= right
= bottom
= 0;
276 // native view coordinates are topleft to bottom right (flipped regarding CoreGraphics origin)
277 virtual bool IsFlipped() const { return true; }
279 virtual void SetNeedsDisplay( const wxRect
* where
= NULL
) = 0;
280 virtual bool GetNeedsDisplay() const = 0;
282 virtual bool NeedsFocusRect() const;
283 virtual void SetNeedsFocusRect( bool needs
);
285 virtual bool NeedsFrame() const;
286 virtual void SetNeedsFrame( bool needs
);
288 virtual void SetDrawingEnabled(bool enabled
);
290 virtual bool CanFocus() const = 0;
291 // return true if successful
292 virtual bool SetFocus() = 0;
293 virtual bool HasFocus() const = 0;
295 virtual void RemoveFromParent() = 0;
296 virtual void Embed( wxWidgetImpl
*parent
) = 0;
298 virtual void SetDefaultButton( bool isDefault
) = 0;
299 virtual void PerformClick() = 0;
300 virtual void SetLabel( const wxString
& title
, wxFontEncoding encoding
) = 0;
301 #if wxUSE_MARKUP && wxOSX_USE_COCOA
302 virtual void SetLabelMarkup( const wxString
& WXUNUSED(markup
) ) { }
305 virtual void SetCursor( const wxCursor
& cursor
) = 0;
306 virtual void CaptureMouse() = 0;
307 virtual void ReleaseMouse() = 0;
309 virtual void SetDropTarget( wxDropTarget
* WXUNUSED(dropTarget
) ) {}
311 virtual wxInt32
GetValue() const = 0;
312 virtual void SetValue( wxInt32 v
) = 0;
313 virtual wxBitmap
GetBitmap() const = 0;
314 virtual void SetBitmap( const wxBitmap
& bitmap
) = 0;
315 virtual void SetBitmapPosition( wxDirection dir
) = 0;
316 virtual void SetupTabs( const wxNotebook
& WXUNUSED(notebook
) ) {}
317 virtual int TabHitTest( const wxPoint
& WXUNUSED(pt
), long *flags
) {*flags
=1; return -1;};
318 virtual void GetBestRect( wxRect
*r
) const = 0;
319 virtual bool IsEnabled() const = 0;
320 virtual void Enable( bool enable
) = 0;
321 virtual void SetMinimum( wxInt32 v
) = 0;
322 virtual void SetMaximum( wxInt32 v
) = 0;
323 virtual wxInt32
GetMinimum() const = 0;
324 virtual wxInt32
GetMaximum() const = 0;
325 virtual void PulseGauge() = 0;
326 virtual void SetScrollThumb( wxInt32 value
, wxInt32 thumbSize
) = 0;
328 virtual void SetFont( const wxFont
& font
, const wxColour
& foreground
, long windowStyle
, bool ignoreBlack
= true ) = 0;
330 virtual void SetToolTip(wxToolTip
* WXUNUSED(tooltip
)) { }
332 // is the clicked event sent AFTER the state already changed, so no additional
333 // state changing logic is required from the outside
334 virtual bool ButtonClickDidStateChange() = 0;
336 virtual void InstallEventHandler( WXWidget control
= NULL
) = 0;
338 // Mechanism used to keep track of whether a change should send an event
339 // Do SendEvents(false) when starting actions that would trigger programmatic events
340 // and SendEvents(true) at the end of the block.
341 virtual void SendEvents(bool shouldSendEvents
) { m_shouldSendEvents
= shouldSendEvents
; }
342 virtual bool ShouldSendEvents() { return m_shouldSendEvents
; }
344 // static methods for associating native controls and their implementations
346 // finds the impl associated with this native control
348 FindFromWXWidget(WXWidget control
);
350 // finds the impl associated with this native control, if the native control itself is not known
351 // also checks whether its parent is eg a registered scrollview, ie whether the control is a native subpart
352 // of a known control
354 FindBestFromWXWidget(WXWidget control
);
356 static void RemoveAssociations( wxWidgetImpl
* impl
);
358 static void Associate( WXWidget control
, wxWidgetImpl
*impl
);
360 static WXWidget
FindFocus();
362 // static creation methods, must be implemented by all toolkits
364 static wxWidgetImplType
* CreateUserPane( wxWindowMac
* wxpeer
,
371 static wxWidgetImplType
* CreateContentView( wxNonOwnedWindow
* now
) ;
373 static wxWidgetImplType
* CreateButton( wxWindowMac
* wxpeer
,
376 const wxString
& label
,
382 static wxWidgetImplType
* CreateDisclosureTriangle( wxWindowMac
* wxpeer
,
385 const wxString
& label
,
391 static wxWidgetImplType
* CreateStaticLine( wxWindowMac
* wxpeer
,
399 static wxWidgetImplType
* CreateGroupBox( wxWindowMac
* wxpeer
,
402 const wxString
& label
,
408 static wxWidgetImplType
* CreateStaticText( wxWindowMac
* wxpeer
,
411 const wxString
& label
,
417 static wxWidgetImplType
* CreateTextControl( wxTextCtrl
* wxpeer
,
420 const wxString
& content
,
426 static wxWidgetImplType
* CreateSearchControl( wxSearchCtrl
* wxpeer
,
429 const wxString
& content
,
435 static wxWidgetImplType
* CreateCheckBox( wxWindowMac
* wxpeer
,
438 const wxString
& label
,
444 static wxWidgetImplType
* CreateRadioButton( wxWindowMac
* wxpeer
,
447 const wxString
& label
,
453 static wxWidgetImplType
* CreateToggleButton( wxWindowMac
* wxpeer
,
456 const wxString
& label
,
462 static wxWidgetImplType
* CreateBitmapToggleButton( wxWindowMac
* wxpeer
,
465 const wxBitmap
& bitmap
,
471 static wxWidgetImplType
* CreateBitmapButton( wxWindowMac
* wxpeer
,
474 const wxBitmap
& bitmap
,
480 static wxWidgetImplType
* CreateTabView( wxWindowMac
* wxpeer
,
488 static wxWidgetImplType
* CreateGauge( wxWindowMac
* wxpeer
,
499 static wxWidgetImplType
* CreateSlider( wxWindowMac
* wxpeer
,
510 static wxWidgetImplType
* CreateSpinButton( wxWindowMac
* wxpeer
,
521 static wxWidgetImplType
* CreateScrollBar( wxWindowMac
* wxpeer
,
529 static wxWidgetImplType
* CreateChoice( wxWindowMac
* wxpeer
,
538 static wxWidgetImplType
* CreateListBox( wxWindowMac
* wxpeer
,
547 static wxWidgetImplType
* CreateComboBox( wxComboBox
* wxpeer
,
557 // converts from Toplevel-Content relative to local
558 static void Convert( wxPoint
*pt
, wxWidgetImpl
*from
, wxWidgetImpl
*to
);
560 bool m_isRootControl
;
562 wxWindowMac
* m_wxPeer
;
563 bool m_needsFocusRect
;
565 bool m_shouldSendEvents
;
567 DECLARE_ABSTRACT_CLASS(wxWidgetImpl
)
571 // the interface to be implemented eg by a listbox
574 class WXDLLIMPEXP_CORE wxListWidgetColumn
577 virtual ~wxListWidgetColumn() {}
580 class WXDLLIMPEXP_CORE wxListWidgetCellValue
583 wxListWidgetCellValue() {}
584 virtual ~wxListWidgetCellValue() {}
586 virtual void Set( CFStringRef value
) = 0;
587 virtual void Set( const wxString
& value
) = 0;
588 virtual void Set( int value
) = 0;
589 virtual void Check( bool check
);
591 virtual bool IsChecked() const;
592 virtual int GetIntValue() const = 0;
593 virtual wxString
GetStringValue() const = 0;
596 class WXDLLIMPEXP_CORE wxListWidgetImpl
599 wxListWidgetImpl() {}
600 virtual ~wxListWidgetImpl() { }
602 virtual wxListWidgetColumn
* InsertTextColumn( unsigned pos
, const wxString
& title
, bool editable
= false,
603 wxAlignment just
= wxALIGN_LEFT
, int defaultWidth
= -1) = 0 ;
604 virtual wxListWidgetColumn
* InsertCheckColumn( unsigned pos
, const wxString
& title
, bool editable
= false,
605 wxAlignment just
= wxALIGN_LEFT
, int defaultWidth
= -1) = 0 ;
609 // TODO will be replaced
610 virtual void ListDelete( unsigned int n
) = 0;
611 virtual void ListInsert( unsigned int n
) = 0;
612 virtual void ListClear() = 0;
616 virtual void ListDeselectAll() = 0;
617 virtual void ListSetSelection( unsigned int n
, bool select
, bool multi
) = 0;
618 virtual int ListGetSelection() const = 0;
619 virtual int ListGetSelections( wxArrayInt
& aSelections
) const = 0;
620 virtual bool ListIsSelected( unsigned int n
) const = 0;
624 virtual void ListScrollTo( unsigned int n
) = 0;
625 virtual void UpdateLine( unsigned int n
, wxListWidgetColumn
* col
= NULL
) = 0;
626 virtual void UpdateLineToEnd( unsigned int n
) = 0;
630 virtual unsigned int ListGetCount() const = 0;
632 virtual int DoListHitTest( const wxPoint
& inpoint
) const = 0;
636 // interface to be implemented by a textcontrol
639 class WXDLLIMPEXP_FWD_CORE wxTextAttr
;
640 class WXDLLIMPEXP_FWD_CORE wxTextEntry
;
642 // common interface for all implementations
643 class WXDLLIMPEXP_CORE wxTextWidgetImpl
647 // Any widgets implementing this interface must be associated with a
648 // wxTextEntry so instead of requiring the derived classes to implement
649 // another (pure) virtual function, just take the pointer to this entry in
650 // our ctor and implement GetTextEntry() ourselves.
651 wxTextWidgetImpl(wxTextEntry
*entry
) : m_entry(entry
) {}
653 virtual ~wxTextWidgetImpl() {}
655 wxTextEntry
*GetTextEntry() const { return m_entry
; }
657 virtual bool CanFocus() const { return true; }
659 virtual wxString
GetStringValue() const = 0 ;
660 virtual void SetStringValue( const wxString
&val
) = 0 ;
661 virtual void SetSelection( long from
, long to
) = 0 ;
662 virtual void GetSelection( long* from
, long* to
) const = 0 ;
663 virtual void WriteText( const wxString
& str
) = 0 ;
665 virtual bool CanClipMaxLength() const { return false; }
666 virtual void SetMaxLength(unsigned long WXUNUSED(len
)) {}
668 virtual bool GetStyle( long position
, wxTextAttr
& style
);
669 virtual void SetStyle( long start
, long end
, const wxTextAttr
& style
) ;
670 virtual void Copy() ;
672 virtual void Paste() ;
673 virtual bool CanPaste() const ;
674 virtual void SetEditable( bool editable
) ;
675 virtual long GetLastPosition() const ;
676 virtual void Replace( long from
, long to
, const wxString
&str
) ;
677 virtual void Remove( long from
, long to
) ;
680 virtual bool HasOwnContextMenu() const
683 virtual bool SetupCursor( const wxPoint
& WXUNUSED(pt
) )
686 virtual void Clear() ;
687 virtual bool CanUndo() const;
688 virtual void Undo() ;
689 virtual bool CanRedo() const;
690 virtual void Redo() ;
691 virtual int GetNumberOfLines() const ;
692 virtual long XYToPosition(long x
, long y
) const;
693 virtual bool PositionToXY(long pos
, long *x
, long *y
) const ;
694 virtual void ShowPosition(long WXUNUSED(pos
)) ;
695 virtual int GetLineLength(long lineNo
) const ;
696 virtual wxString
GetLineText(long lineNo
) const ;
697 virtual void CheckSpelling(bool WXUNUSED(check
)) { }
699 virtual wxSize
GetBestSize() const { return wxDefaultSize
; }
701 virtual bool SetHint(const wxString
& WXUNUSED(hint
)) { return false; }
703 wxTextEntry
* const m_entry
;
705 wxDECLARE_NO_COPY_CLASS(wxTextWidgetImpl
);
708 // common interface for all implementations
709 class WXDLLIMPEXP_CORE wxComboWidgetImpl
713 wxComboWidgetImpl() {}
715 virtual ~wxComboWidgetImpl() {}
717 virtual int GetSelectedItem() const { return -1; }
718 virtual void SetSelectedItem(int WXUNUSED(item
)) {}
720 virtual int GetNumberOfItems() const { return -1; }
722 virtual void InsertItem(int WXUNUSED(pos
), const wxString
& WXUNUSED(item
)) {}
724 virtual void RemoveItem(int WXUNUSED(pos
)) {}
726 virtual void Clear() {}
727 virtual void Popup() {}
728 virtual void Dismiss() {}
730 virtual wxString
GetStringAtIndex(int WXUNUSED(pos
)) const { return wxEmptyString
; }
732 virtual int FindString(const wxString
& WXUNUSED(text
)) const { return -1; }
736 // common interface for buttons
743 virtual ~wxButtonImpl(){}
745 virtual void SetPressedBitmap( const wxBitmap
& bitmap
) = 0;
749 // common interface for search controls
752 class wxSearchWidgetImpl
755 wxSearchWidgetImpl(){}
756 virtual ~wxSearchWidgetImpl(){}
758 // search field options
759 virtual void ShowSearchButton( bool show
) = 0;
760 virtual bool IsSearchButtonVisible() const = 0;
762 virtual void ShowCancelButton( bool show
) = 0;
763 virtual bool IsCancelButtonVisible() const = 0;
765 virtual void SetSearchMenu( wxMenu
* menu
) = 0;
767 virtual void SetDescriptiveText(const wxString
& text
) = 0;
771 // toplevel window implementation class
774 class wxNonOwnedWindowImpl
: public wxObject
777 wxNonOwnedWindowImpl( wxNonOwnedWindow
* nonownedwnd
) : m_wxPeer(nonownedwnd
)
780 wxNonOwnedWindowImpl()
783 virtual ~wxNonOwnedWindowImpl()
787 virtual void WillBeDestroyed()
791 virtual void Create( wxWindow
* parent
, const wxPoint
& pos
, const wxSize
& size
,
792 long style
, long extraStyle
, const wxString
& name
) = 0;
795 virtual WXWindow
GetWXWindow() const = 0;
805 virtual bool Show(bool WXUNUSED(show
))
810 virtual bool ShowWithEffect(bool show
, wxShowEffect
WXUNUSED(effect
), unsigned WXUNUSED(timeout
))
815 virtual void Update()
819 virtual bool SetTransparent(wxByte
WXUNUSED(alpha
))
824 virtual bool SetBackgroundColour(const wxColour
& WXUNUSED(col
) )
829 virtual void SetExtraStyle( long WXUNUSED(exStyle
) )
833 virtual void SetWindowStyleFlag( long WXUNUSED(style
) )
837 virtual bool SetBackgroundStyle(wxBackgroundStyle
WXUNUSED(style
))
842 virtual bool CanSetTransparent()
847 virtual void GetContentArea( int &left
, int &top
, int &width
, int &height
) const = 0;
848 virtual void MoveWindow(int x
, int y
, int width
, int height
) = 0;
849 virtual void GetPosition( int &x
, int &y
) const = 0;
850 virtual void GetSize( int &width
, int &height
) const = 0;
852 virtual bool SetShape(const wxRegion
& WXUNUSED(region
))
857 virtual void SetTitle( const wxString
& title
, wxFontEncoding encoding
) = 0;
859 virtual bool IsMaximized() const = 0;
861 virtual bool IsIconized() const= 0;
863 virtual void Iconize( bool iconize
)= 0;
865 virtual void Maximize(bool maximize
) = 0;
867 virtual bool IsFullScreen() const= 0;
869 virtual void ShowWithoutActivating() { Show(true); }
871 virtual bool ShowFullScreen(bool show
, long style
)= 0;
873 virtual void RequestUserAttention(int flags
) = 0;
875 virtual void ScreenToWindow( int *x
, int *y
) = 0;
877 virtual void WindowToScreen( int *x
, int *y
) = 0;
879 virtual bool IsActive() = 0;
881 wxNonOwnedWindow
* GetWXPeer() { return m_wxPeer
; }
883 static wxNonOwnedWindowImpl
*
884 FindFromWXWindow(WXWindow window
);
886 static void RemoveAssociations( wxNonOwnedWindowImpl
* impl
);
888 static void Associate( WXWindow window
, wxNonOwnedWindowImpl
*impl
);
890 // static creation methods, must be implemented by all toolkits
892 static wxNonOwnedWindowImpl
* CreateNonOwnedWindow( wxNonOwnedWindow
* wxpeer
, wxWindow
* parent
, WXWindow native
) ;
894 static wxNonOwnedWindowImpl
* CreateNonOwnedWindow( wxNonOwnedWindow
* wxpeer
, wxWindow
* parent
, const wxPoint
& pos
, const wxSize
& size
,
895 long style
, long extraStyle
, const wxString
& name
) ;
897 virtual void SetModified(bool WXUNUSED(modified
)) { }
898 virtual bool IsModified() const { return false; }
900 virtual void SetRepresentedFilename(const wxString
& WXUNUSED(filename
)) { }
903 virtual CGFloat
GetWindowLevel() const { return 0.0; }
905 virtual CGWindowLevel
GetWindowLevel() const { return kCGNormalWindowLevel
; }
907 virtual void RestoreWindowLevel() {}
909 wxNonOwnedWindow
* m_wxPeer
;
910 DECLARE_ABSTRACT_CLASS(wxNonOwnedWindowImpl
)
915 //---------------------------------------------------------------------------
916 // cocoa bridging utilities
917 //---------------------------------------------------------------------------
919 bool wxMacInitCocoa();
921 class WXDLLIMPEXP_CORE wxMacAutoreleasePool
924 wxMacAutoreleasePool();
925 ~wxMacAutoreleasePool();
932 void wxMacCocoaRelease( void* obj
);
933 void wxMacCocoaAutorelease( void* obj
);
934 void* wxMacCocoaRetain( void* obj
);
938 // _WX_PRIVATE_CORE_H_