1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/mac/carbon/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_H_
15 #define _WX_PRIVATE_H_
20 # include <Carbon/Carbon.h>
22 # include <Debugging.h>
23 # include <Quickdraw.h>
24 # include <Appearance.h>
26 # include <Controls.h>
27 # include <ControlDefinitions.h>
31 # include <CoreServices.h>
34 #if UNIVERSAL_INTERFACES_VERSION < 0x0342
35 #error "please update to Apple's latest universal headers from http://developer.apple.com/sdk/"
38 #ifndef MAC_OS_X_VERSION_10_3
39 #define MAC_OS_X_VERSION_10_3 1030
42 #ifndef MAC_OS_X_VERSION_10_4
43 #define MAC_OS_X_VERSION_10_4 1040
46 #ifndef MAC_OS_X_VERSION_10_5
47 #define MAC_OS_X_VERSION_10_5 1050
50 #ifdef __WXMAC_CARBON__
51 #include "wx/mac/corefoundation/cfstring.h"
52 #include "wx/mac/corefoundation/cfdataref.h"
56 // as macro in FixMath.h for 10.3
57 inline Fixed
IntToFixed( int inInt
)
59 return (((SInt32
) inInt
) << 16);
62 inline int FixedToInt( Fixed inFixed
)
64 return (((SInt32
) inFixed
) >> 16);
68 #if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5
69 typedef UInt32 URefCon
;
70 typedef SInt32 SRefCon
;
75 #include "wx/listbox.h"
79 class wxMacPortStateHelper
81 DECLARE_NO_COPY_CLASS(wxMacPortStateHelper
)
84 wxMacPortStateHelper( GrafPtr newport
);
85 wxMacPortStateHelper();
86 ~wxMacPortStateHelper();
88 void Setup( GrafPtr newport
);
90 bool IsCleared() { return m_clip
== NULL
; }
91 GrafPtr
GetCurrentPort() { return m_currentPort
; }
94 GrafPtr m_currentPort
;
97 ThemeDrawingState m_drawingState
;
104 class WXDLLEXPORT wxMacPortSaver
106 DECLARE_NO_COPY_CLASS(wxMacPortSaver
)
109 wxMacPortSaver( GrafPtr port
);
115 class WXDLLEXPORT wxMacPortSetter
117 DECLARE_NO_COPY_CLASS(wxMacPortSetter
)
120 wxMacPortSetter( const wxDC
* dc
);
123 wxMacPortStateHelper m_ph
;
128 Clips to the visible region of a control within the current port
131 class WXDLLEXPORT wxMacWindowClipper
: public wxMacPortSaver
133 DECLARE_NO_COPY_CLASS(wxMacWindowClipper
)
136 wxMacWindowClipper( const wxWindow
* win
);
137 ~wxMacWindowClipper();
140 RgnHandle m_formerClip
;
144 class WXDLLEXPORT wxMacWindowStateSaver
: public wxMacWindowClipper
146 DECLARE_NO_COPY_CLASS(wxMacWindowStateSaver
)
149 wxMacWindowStateSaver( const wxWindow
* win
);
150 ~wxMacWindowStateSaver();
153 ThemeDrawingState m_themeDrawingState
;
157 #if wxMAC_USE_CORE_GRAPHICS
158 class WXDLLEXPORT wxMacCGContextStateSaver
160 DECLARE_NO_COPY_CLASS(wxMacCGContextStateSaver
)
163 wxMacCGContextStateSaver( CGContextRef cg
)
166 CGContextSaveGState( cg
);
168 ~wxMacCGContextStateSaver()
170 CGContextRestoreGState( m_cg
);
178 class wxMacDrawingHelper
180 DECLARE_NO_COPY_CLASS(wxMacDrawingHelper)
183 wxMacDrawingHelper( wxWindowMac * theWindow , bool clientArea = false );
184 ~wxMacDrawingHelper();
185 bool Ok() const { return IsOk(); }
186 bool IsOk() { return m_ok; }
187 void LocalToWindow( Rect *rect) { OffsetRect( rect , m_origin.h , m_origin.v ); }
188 void LocalToWindow( Point *pt ) { AddPt( m_origin , pt ); }
189 void LocalToWindow( RgnHandle rgn ) { OffsetRgn( rgn , m_origin.h , m_origin.v ); }
190 const Point& GetOrigin() { return m_origin; }
193 GrafPtr m_formerPort;
194 GrafPtr m_currentPort;
195 PenState m_savedPenState;
201 bool wxMacConvertEventToRecord( EventRef event
, EventRecord
*rec
);
206 WXDLLIMPEXP_BASE wxString
wxMacFSSpec2MacFilename( const FSSpec
*spec
);
207 WXDLLIMPEXP_BASE
void wxMacFilename2FSSpec( const wxString
&path
, FSSpec
*spec
);
210 WXDLLIMPEXP_BASE wxString
wxMacFindFolderNoSeparator(short vRefNum
,
212 Boolean createFolder
);
213 WXDLLIMPEXP_BASE wxString
wxMacFindFolder(short vRefNum
,
215 Boolean createFolder
);
217 template<typename T
> EventParamType
wxMacGetEventParamType() { wxFAIL_MSG( wxT("Unknown Param Type") ); return 0; }
218 template<> inline EventParamType wxMacGetEventParamType
<RgnHandle
>() { return typeQDRgnHandle
; }
219 template<> inline EventParamType wxMacGetEventParamType
<ControlRef
>() { return typeControlRef
; }
220 template<> inline EventParamType wxMacGetEventParamType
<WindowRef
>() { return typeWindowRef
; }
221 template<> inline EventParamType wxMacGetEventParamType
<MenuRef
>() { return typeMenuRef
; }
222 template<> inline EventParamType wxMacGetEventParamType
<EventRef
>() { return typeEventRef
; }
223 template<> inline EventParamType wxMacGetEventParamType
<Point
>() { return typeQDPoint
; }
224 template<> inline EventParamType wxMacGetEventParamType
<Rect
>() { return typeQDRectangle
; }
225 template<> inline EventParamType wxMacGetEventParamType
<Boolean
>() { return typeBoolean
; }
226 template<> inline EventParamType wxMacGetEventParamType
<SInt16
>() { return typeSInt16
; }
227 template<> inline EventParamType wxMacGetEventParamType
<SInt32
>() { return typeSInt32
; }
228 template<> inline EventParamType wxMacGetEventParamType
<UInt32
>() { return typeUInt32
; }
229 template<> inline EventParamType wxMacGetEventParamType
<RGBColor
>() { return typeRGBColor
; }
230 #if TARGET_API_MAC_OSX
231 template<> inline EventParamType wxMacGetEventParamType
<HICommand
>() { return typeHICommand
; }
232 template<> inline EventParamType wxMacGetEventParamType
<HIPoint
>() { return typeHIPoint
; }
233 template<> inline EventParamType wxMacGetEventParamType
<HISize
>() { return typeHISize
; }
234 template<> inline EventParamType wxMacGetEventParamType
<HIRect
>() { return typeHIRect
; }
235 template<> inline EventParamType wxMacGetEventParamType
<void*>() { return typeVoidPtr
; }
237 #if TARGET_API_MAC_OSX
238 template<> inline EventParamType wxMacGetEventParamType
<CFDictionaryRef
>() { return typeCFDictionaryRef
; }
240 template<> inline EventParamType wxMacGetEventParamType
<Collection
>() { return typeCollection
; }
241 template<> inline EventParamType wxMacGetEventParamType
<CGContextRef
>() { return typeCGContextRef
; }
244 template<> EventParamType wxMacGetEventParamType<GrafPtr>() { return typeGrafPtr; }
245 template<> EventParamType wxMacGetEventParamType<OSStatus>() { return typeOSStatus; }
246 template<> EventParamType wxMacGetEventParamType<CFIndex>() { return typeCFIndex; }
247 template<> EventParamType wxMacGetEventParamType<GWorldPtr>() { return typeGWorldPtr; }
250 class wxMacCarbonEvent
260 wxMacCarbonEvent( EventRef event
, bool release
= false )
266 wxMacCarbonEvent(UInt32 inClassID
,UInt32 inKind
,EventTime inWhen
= 0 /*now*/,EventAttributes inAttributes
=kEventAttributeNone
)
269 verify_noerr( MacCreateEvent( NULL
, inClassID
, inKind
,inWhen
,inAttributes
,&m_eventRef
) );
276 ReleaseEvent( m_eventRef
);
279 OSStatus
Create(UInt32 inClassID
,UInt32 inKind
,EventTime inWhen
= 0 /*now*/,EventAttributes inAttributes
=kEventAttributeNone
)
281 verify( (m_eventRef
== NULL
) || m_release
);
282 if ( m_eventRef
&& m_release
)
284 ReleaseEvent( m_eventRef
);
288 OSStatus err
= MacCreateEvent( NULL
, inClassID
, inKind
,inWhen
,inAttributes
,&m_eventRef
);
294 OSStatus
GetParameter( EventParamName inName
, EventParamType inDesiredType
, UInt32 inBufferSize
, void * outData
);
296 template <typename T
> OSStatus
GetParameter( EventParamName inName
, EventParamType type
, T
*data
)
298 return GetParameter( inName
, type
, sizeof( T
) , data
);
300 template <typename T
> OSStatus
GetParameter( EventParamName inName
, T
*data
)
302 return GetParameter
<T
>( inName
, wxMacGetEventParamType
<T
>() , data
);
305 template <typename T
> T
GetParameter( EventParamName inName
)
308 verify_noerr( GetParameter
<T
>( inName
, &value
) );
311 template <typename T
> T
GetParameter( EventParamName inName
, EventParamType inDesiredType
)
314 verify_noerr( GetParameter
<T
>( inName
, inDesiredType
, &value
) );
318 OSStatus
SetParameter( EventParamName inName
, EventParamType inType
, UInt32 inSize
, const void * inData
);
319 template <typename T
> OSStatus
SetParameter( EventParamName inName
, EventParamType inDesiredType
, const T
*data
)
321 return SetParameter( inName
, inDesiredType
, sizeof( T
) , data
);
323 template <typename T
> OSStatus
SetParameter( EventParamName inName
, EventParamType inDesiredType
, const T
& data
)
325 return SetParameter
<T
>( inName
, inDesiredType
, &data
);
327 template <typename T
> OSStatus
SetParameter( EventParamName inName
, const T
*data
)
329 return SetParameter
<T
>( inName
, wxMacGetEventParamType
<T
>() , data
);
331 template <typename T
> OSStatus
SetParameter( EventParamName inName
, const T
& data
)
333 return SetParameter
<T
>( inName
, wxMacGetEventParamType
<T
>() , &data
);
337 return ::GetEventClass( m_eventRef
);
341 return ::GetEventKind( m_eventRef
);
345 return ::GetEventTime( m_eventRef
);
349 return EventTimeToTicks( GetTime() );
351 OSStatus
SetCurrentTime( )
353 return ::SetEventTime( m_eventRef
, GetCurrentEventTime() );
355 OSStatus
SetTime( EventTime when
)
357 return ::SetEventTime( m_eventRef
, when
);
359 operator EventRef () { return m_eventRef
; }
361 bool IsValid() { return m_eventRef
!= 0; }
368 // helper class for allocating and deallocating Universal Proc Ptrs
371 template <typename procType
, typename uppType
, uppType (*newUPP
)(procType
) , void (*disposeUPP
)(uppType
) > class wxMacUPP
374 wxMacUPP( procType
WXUNUSED(proc
) )
377 m_upp
= (*newUPP
)( NULL
);
384 operator uppType() { return m_upp
; }
389 typedef wxMacUPP
<NMProcPtr
,NMUPP
,NewNMUPP
,DisposeNMUPP
> wxMacNMUPP
;
391 template <typename refType
> class wxMacCFRefHolder
395 : m_ref(NULL
) , m_release(false)
399 wxMacCFRefHolder( refType ref
, bool release
= true )
400 : m_ref(ref
) , m_release(release
)
411 if ( m_release
&& m_ref
!= NULL
)
424 void Set( refType ref
, bool release
= true )
431 operator refType () const { return m_ref
; }
433 wxMacCFRefHolder
& operator=(refType r
)
442 DECLARE_NO_COPY_CLASS( wxMacCFRefHolder
)
447 class wxMacToolTipTimer
;
455 void Setup( WindowRef window
, const wxString
& text
, const wxPoint
& localPosition
) ;
470 PicHandle m_backpict
;
474 wxMacToolTipTimer
* m_timer
;
477 wxMacCFStringHolder m_helpTextRef
;
482 GWorldPtr wxMacCreateGWorld( int width , int height , int depth );
483 void wxMacDestroyGWorld( GWorldPtr gw );
484 PicHandle wxMacCreatePict( GWorldPtr gw , GWorldPtr mask = NULL );
485 CIconHandle wxMacCreateCIcon(GWorldPtr image , GWorldPtr mask , short dstDepth , short iconSize );
486 void wxMacSetColorTableEntry( CTabHandle newColors , int index , int red , int green , int blue );
487 CTabHandle wxMacCreateColorTable( int numColors );
489 void wxMacCreateBitmapButton( ControlButtonContentInfo
*info
, const wxBitmap
& bitmap
, int forceType
= 0 );
490 void wxMacReleaseBitmapButton( ControlButtonContentInfo
*info
);
491 CGImageRef
wxMacCreateCGImageFromBitmap( const wxBitmap
& bitmap
);
493 #define MAC_WXCOLORREF(a) (*((RGBColor*)&(a)))
494 #define MAC_WXHBITMAP(a) (GWorldPtr(a))
495 #define MAC_WXHMETAFILE(a) (PicHandle(a))
496 #define MAC_WXHICON(a) (IconRef(a))
497 #define MAC_WXHCURSOR(a) (CursHandle(a))
498 #define MAC_WXHRGN(a) (RgnHandle(a))
499 #define MAC_WXHWND(a) (WindowPtr(a))
500 #define MAC_WXRECPTR(a) ((Rect*)a)
501 #define MAC_WXPOINTPTR(a) ((Point*)a)
502 #define MAC_WXHMENU(a) ((MenuHandle)a)
504 struct wxOpaqueWindowRef
506 wxOpaqueWindowRef( WindowRef ref
) { m_data
= ref
; }
507 operator WindowRef() { return m_data
; }
512 void wxMacRectToNative( const wxRect
*wx
, Rect
*n
);
513 void wxMacNativeToRect( const Rect
*n
, wxRect
* wx
);
514 void wxMacPointToNative( const wxPoint
* wx
, Point
*n
);
515 void wxMacNativeToPoint( const Point
*n
, wxPoint
* wx
);
517 WXDLLIMPEXP_CORE wxWindow
* wxFindControlFromMacControl(ControlRef inControl
);
518 WXDLLIMPEXP_CORE wxTopLevelWindowMac
* wxFindWinFromMacWindow( WindowRef inWindow
);
519 WXDLLIMPEXP_CORE wxMenu
* wxFindMenuFromMacMenu(MenuRef inMenuRef
);
521 WXDLLIMPEXP_CORE
int wxMacCommandToId( UInt32 macCommandId
);
522 WXDLLIMPEXP_CORE UInt32
wxIdToMacCommand( int wxId
);
523 WXDLLIMPEXP_CORE wxMenu
* wxFindMenuFromMacCommand( const HICommand
&macCommandId
, wxMenuItem
* &item
);
525 extern wxWindow
* g_MacLastWindow
;
526 WXDLLIMPEXP_CORE
pascal OSStatus
wxMacTopLevelMouseEventHandler( EventHandlerCallRef handler
, EventRef event
, void *data
);
527 WXDLLIMPEXP_CORE Rect
wxMacGetBoundsForControl( wxWindow
* window
, const wxPoint
& pos
, const wxSize
&size
, bool adjustForOrigin
= true );
529 ControlActionUPP
GetwxMacLiveScrollbarActionProc();
531 class wxMacControl
: public wxObject
534 wxMacControl( wxWindow
* peer
, bool isRootControl
= false );
535 wxMacControl( wxWindow
* peer
, ControlRef control
);
536 wxMacControl( wxWindow
* peer
, WXWidget control
);
538 virtual ~wxMacControl();
542 virtual void Dispose();
544 bool Ok() const { return IsOk(); }
545 bool IsOk() const { return GetControlRef() != NULL
; }
547 void SetReferenceInNativeControl();
548 static wxMacControl
* GetReferenceFromNativeControl(ControlRef control
);
550 virtual ControlRef
* GetControlRefAddr() { return &m_controlRef
; }
551 virtual ControlRef
GetControlRef() const { return m_controlRef
; }
553 virtual void SetReference( URefCon data
);
555 void operator= (ControlRef c) { m_controlRef = c; }
556 operator ControlRef () { return m_controlRef; }
557 operator ControlRef * () { return &m_controlRef; }
559 // accessing data and values
561 virtual OSStatus
SetData( ControlPartCode inPartCode
, ResType inTag
, Size inSize
, const void * inData
);
562 virtual OSStatus
GetData( ControlPartCode inPartCode
, ResType inTag
, Size inBufferSize
, void * inOutBuffer
, Size
* outActualSize
) const;
563 virtual OSStatus
GetDataSize( ControlPartCode inPartCode
, ResType inTag
, Size
* outActualSize
) const;
564 virtual OSStatus
SendEvent( EventRef ref
, OptionBits inOptions
= 0 );
565 virtual OSStatus
SendHICommand( HICommand
&command
, OptionBits inOptions
= 0 );
567 virtual OSStatus
SendHICommand( UInt32 commandID
, OptionBits inOptions
= 0 );
569 virtual SInt32
GetValue() const;
570 virtual SInt32
GetMaximum() const;
571 virtual SInt32
GetMinimum() const;
573 virtual void SetValue( SInt32 v
);
574 virtual void SetMinimum( SInt32 v
);
575 virtual void SetMaximum( SInt32 v
);
577 virtual void SetValueAndRange( SInt32 value
, SInt32 minimum
, SInt32 maximum
);
578 virtual void SetRange( SInt32 minimum
, SInt32 maximum
);
580 virtual OSStatus
SetFocus( ControlFocusPart focusPart
);
581 virtual bool HasFocus() const;
582 virtual bool NeedsFocusRect() const;
583 virtual void SetNeedsFocusRect( bool needs
);
587 Size
GetDataSize( ControlPartCode inPartCode
, ResType inTag
) const
590 verify_noerr( GetDataSize( inPartCode
, inTag
, &sz
) );
593 template <typename T
> OSStatus
SetData( ControlPartCode inPartCode
, ResType inTag
, const T
*data
)
595 return SetData( inPartCode
, inTag
, sizeof( T
) , data
);
597 template <typename T
> OSStatus
SetData( ControlPartCode inPartCode
, ResType inTag
, const T
& data
)
599 return SetData( inPartCode
, inTag
, sizeof( T
) , &data
);
601 template <typename T
> OSStatus
SetData( ResType inTag
, const T
*data
)
603 return SetData( kControlEntireControl
, inTag
, sizeof( T
) , data
);
605 template <typename T
> OSStatus
SetData( ResType inTag
, const T
& data
)
607 return SetData( kControlEntireControl
, inTag
, sizeof( T
) , &data
);
609 template <typename T
> OSStatus
GetData( ControlPartCode inPartCode
, ResType inTag
, T
*data
) const
612 return GetData( inPartCode
, inTag
, sizeof( T
) , data
, &dummy
);
614 template <typename T
> T
GetData( ControlPartCode inPartCode
, ResType inTag
) const
617 OSStatus err
= GetData
<T
>( inPartCode
, inTag
, &value
);
619 wxASSERT_MSG( err
== noErr
,
620 wxString::Format(wxT("GetData Failed for Part [%i] and Tag [%i]"),
621 inPartCode
, (int)inTag
) );
624 template <typename T
> OSStatus
GetData( ResType inTag
, T
*data
) const
627 return GetData( kControlEntireControl
, inTag
, sizeof( T
) , data
, &dummy
);
629 template <typename T
> T
GetData( ResType inTag
) const
631 return GetData
<T
>( kControlEntireControl
, inTag
);
634 // Flash the control for the specified amount of time
635 virtual void Flash( ControlPartCode part
, UInt32 ticks
= 8 );
637 virtual void VisibilityChanged( bool shown
);
638 virtual void SuperChangedPosition();
641 virtual void SetFont( const wxFont
& font
, const wxColour
& foreground
, long windowStyle
);
642 virtual void SetBackground( const wxBrush
&brush
);
643 virtual ControlPartCode
HandleKey( SInt16 keyCode
, SInt16 charCode
, EventModifiers modifiers
);
644 void SetActionProc( ControlActionUPP actionProc
);
645 void SetViewSize( SInt32 viewSize
);
646 SInt32
GetViewSize() const;
648 virtual bool IsVisible() const;
649 virtual void SetVisibility( bool visible
, bool redraw
);
650 virtual bool IsEnabled() const;
651 virtual bool IsActive() const;
652 virtual void Enable( bool enable
);
654 // invalidates this control and all children
655 virtual void InvalidateWithChildren();
656 virtual void SetDrawingEnabled( bool enable
);
658 virtual bool GetNeedsDisplay() const;
660 // where is in native window relative coordinates
661 virtual void SetNeedsDisplay( RgnHandle where
);
662 // where is in native window relative coordinates
663 virtual void SetNeedsDisplay( Rect
* where
= NULL
);
665 // if rect = NULL, entire view
666 virtual void ScrollRect( wxRect
*rect
, int dx
, int dy
);
668 // in native parent window relative coordinates
669 virtual void GetRect( Rect
*r
);
671 // in native parent window relative coordinates
672 virtual void SetRect( Rect
*r
);
674 virtual void GetRectInWindowCoords( Rect
*r
);
675 virtual void GetBestRect( Rect
*r
);
676 virtual void SetLabel( const wxString
&title
);
677 // converts from Toplevel-Content relative to local
678 static void Convert( wxPoint
*pt
, wxMacControl
*convert
, wxMacControl
*to
);
680 virtual void GetFeatures( UInt32
*features
);
681 virtual OSStatus
GetRegion( ControlPartCode partCode
, RgnHandle region
);
682 virtual OSStatus
SetZOrder( bool above
, wxMacControl
* other
);
684 bool IsRootControl() { return m_isRootControl
; }
686 wxWindow
* GetPeer() const
691 // to be moved into a tab control class
693 virtual OSStatus
SetTabEnabled( SInt16 tabNo
, bool enable
);
695 ControlRef m_controlRef
;
699 bool m_needsFocusRect
;
700 bool m_isRootControl
;
701 DECLARE_DYNAMIC_CLASS_NO_COPY(wxMacControl
)
704 // ============================================================================
705 // DataBrowser Wrapper
706 // ============================================================================
708 // basing on DataBrowserItemIDs
711 class wxMacDataBrowserControl
: public wxMacControl
714 wxMacDataBrowserControl( wxWindow
* peer
, const wxPoint
& pos
, const wxSize
& size
, long style
);
715 wxMacDataBrowserControl() {}
717 OSStatus
SetCallbacks( const DataBrowserCallbacks
*callbacks
);
719 OSStatus
GetItemCount( DataBrowserItemID container
,
721 DataBrowserItemState state
,
722 ItemCount
*numItems
) const;
724 OSStatus
GetItems( DataBrowserItemID container
,
726 DataBrowserItemState state
,
730 OSStatus
AddColumn( DataBrowserListViewColumnDesc
*columnDesc
,
731 DataBrowserTableViewColumnIndex position
);
733 OSStatus
RemoveColumn( DataBrowserTableViewColumnIndex position
);
735 OSStatus
AutoSizeColumns();
737 OSStatus
SetHasScrollBars( bool horiz
, bool vert
);
738 OSStatus
SetHiliteStyle( DataBrowserTableViewHiliteStyle hiliteStyle
);
740 OSStatus
SetHeaderButtonHeight( UInt16 height
);
741 OSStatus
GetHeaderButtonHeight( UInt16
*height
);
743 OSStatus
UpdateItems( DataBrowserItemID container
, UInt32 numItems
,
744 const DataBrowserItemID
*items
,
745 DataBrowserPropertyID preSortProperty
,
746 DataBrowserPropertyID propertyID
) const;
748 OSStatus
AddItems( DataBrowserItemID container
, UInt32 numItems
,
749 const DataBrowserItemID
*items
,
750 DataBrowserPropertyID preSortProperty
);
751 OSStatus
RemoveItems( DataBrowserItemID container
, UInt32 numItems
,
752 const DataBrowserItemID
*items
,
753 DataBrowserPropertyID preSortProperty
);
754 OSStatus
RevealItem( DataBrowserItemID item
,
755 DataBrowserPropertyID propertyID
,
756 DataBrowserRevealOptions options
) const;
758 OSStatus
SetSelectionFlags( DataBrowserSelectionFlags
);
759 OSStatus
GetSelectionAnchor( DataBrowserItemID
*first
, DataBrowserItemID
*last
) const;
760 bool IsItemSelected( DataBrowserItemID item
) const;
761 OSStatus
SetSelectedItems( UInt32 numItems
,
762 const DataBrowserItemID
*items
,
763 DataBrowserSetOption operation
);
765 OSStatus
GetItemID( DataBrowserTableViewRowIndex row
,
766 DataBrowserItemID
* item
) const;
767 OSStatus
GetItemRow( DataBrowserItemID item
,
768 DataBrowserTableViewRowIndex
* row
) const;
770 OSStatus
SetDefaultRowHeight( UInt16 height
);
771 OSStatus
GetDefaultRowHeight( UInt16
* height
) const;
773 OSStatus
SetRowHeight( DataBrowserItemID item
, UInt16 height
);
774 OSStatus
GetRowHeight( DataBrowserItemID item
, UInt16
*height
) const;
776 OSStatus
GetColumnWidth( DataBrowserPropertyID column
, UInt16
*width
) const;
777 OSStatus
SetColumnWidth( DataBrowserPropertyID column
, UInt16 width
);
779 OSStatus
GetDefaultColumnWidth( UInt16
*width
) const;
780 OSStatus
SetDefaultColumnWidth( UInt16 width
);
782 OSStatus
GetColumnCount( UInt32
* numColumns
) const;
784 OSStatus
GetColumnIDFromIndex( DataBrowserTableViewColumnIndex position
, DataBrowserTableViewColumnID
* id
);
786 OSStatus
GetColumnPosition( DataBrowserPropertyID column
, DataBrowserTableViewColumnIndex
*position
) const;
787 OSStatus
SetColumnPosition( DataBrowserPropertyID column
, DataBrowserTableViewColumnIndex position
);
789 OSStatus
GetScrollPosition( UInt32
*top
, UInt32
*left
) const;
790 OSStatus
SetScrollPosition( UInt32 top
, UInt32 left
);
792 OSStatus
GetSortProperty( DataBrowserPropertyID
*column
) const;
793 OSStatus
SetSortProperty( DataBrowserPropertyID column
);
795 OSStatus
GetSortOrder( DataBrowserSortOrder
*order
) const;
796 OSStatus
SetSortOrder( DataBrowserSortOrder order
);
798 OSStatus
GetPropertyFlags( DataBrowserPropertyID property
, DataBrowserPropertyFlags
*flags
) const;
799 OSStatus
SetPropertyFlags( DataBrowserPropertyID property
, DataBrowserPropertyFlags flags
);
801 OSStatus
GetHeaderDesc( DataBrowserPropertyID property
, DataBrowserListViewHeaderDesc
*desc
) const;
802 OSStatus
SetHeaderDesc( DataBrowserPropertyID property
, DataBrowserListViewHeaderDesc
*desc
);
804 OSStatus
SetDisclosureColumn( DataBrowserPropertyID property
, Boolean expandableRows
);
807 static pascal void DataBrowserItemNotificationProc(
809 DataBrowserItemID itemID
,
810 DataBrowserItemNotification message
,
811 DataBrowserItemDataRef itemData
);
813 virtual void ItemNotification(
814 DataBrowserItemID itemID
,
815 DataBrowserItemNotification message
,
816 DataBrowserItemDataRef itemData
) = 0;
818 static pascal OSStatus
DataBrowserGetSetItemDataProc(
820 DataBrowserItemID itemID
,
821 DataBrowserPropertyID property
,
822 DataBrowserItemDataRef itemData
,
823 Boolean changeValue
);
825 virtual OSStatus
GetSetItemData(
826 DataBrowserItemID itemID
,
827 DataBrowserPropertyID property
,
828 DataBrowserItemDataRef itemData
,
829 Boolean changeValue
) = 0;
831 static pascal Boolean
DataBrowserCompareProc(
833 DataBrowserItemID itemOneID
,
834 DataBrowserItemID itemTwoID
,
835 DataBrowserPropertyID sortProperty
);
837 virtual Boolean
CompareItems(DataBrowserItemID itemOneID
,
838 DataBrowserItemID itemTwoID
,
839 DataBrowserPropertyID sortProperty
) = 0;
840 DECLARE_ABSTRACT_CLASS(wxMacDataBrowserControl
)
843 // ============================================================================
844 // Higher-level Databrowser
845 // ============================================================================
847 // basing on data item objects
852 class wxMacDataItemBrowserControl
;
853 class wxMacListBoxItem
;
855 const DataBrowserPropertyID kTextColumnId
= 1024;
856 const DataBrowserPropertyID kNumericOrderColumnId
= 1025;
858 // for multi-column controls, we will use this + the column ID to identify the
859 // column. We don't use kTextColumnId there, and ideally the two should merge.
860 const DataBrowserPropertyID kMinColumnId
= 1050;
862 // base API for high-level databrowser operations
864 class wxMacListControl
867 virtual void MacDelete( unsigned int n
) = 0;
868 virtual void MacInsert( unsigned int n
, const wxArrayStringsAdapter
& items
, int column
= -1 ) = 0;
869 // returns index of newly created line
870 virtual int MacAppend( const wxString
& item
) = 0;
871 virtual void MacSetString( unsigned int n
, const wxString
& item
) = 0;
872 virtual void MacClear() = 0;
873 virtual void MacDeselectAll() = 0;
874 virtual void MacSetSelection( unsigned int n
, bool select
, bool multi
) = 0;
875 virtual int MacGetSelection() const = 0;
876 virtual int MacGetSelections( wxArrayInt
& aSelections
) const = 0;
877 virtual bool MacIsSelected( unsigned int n
) const = 0;
878 virtual void MacScrollTo( unsigned int n
) = 0;
879 virtual wxString
MacGetString( unsigned int n
) const = 0;
880 virtual unsigned int MacGetCount() const = 0;
882 virtual void MacSetClientData( unsigned int n
, void * data
) = 0;
883 virtual void * MacGetClientData( unsigned int) const = 0;
885 virtual ~wxMacListControl() { }
888 // base class for databrowser items
898 virtual ~wxMacDataItem();
900 virtual bool IsLessThan(wxMacDataItemBrowserControl
*owner
,
901 const wxMacDataItem
*,
902 DataBrowserPropertyID property
) const;
904 // returns true if access was successful, otherwise false
905 virtual OSStatus
GetSetData(wxMacDataItemBrowserControl
*owner
,
906 DataBrowserPropertyID property
,
907 DataBrowserItemDataRef itemData
,
910 virtual void Notification(wxMacDataItemBrowserControl
*owner
,
911 DataBrowserItemNotification message
,
912 DataBrowserItemDataRef itemData
) const;
914 void SetLabel( const wxString
& str
);
915 const wxString
& GetLabel() const;
917 void SetOrder( SInt32 order
);
918 SInt32
GetOrder() const;
920 void SetData( void* data
);
921 void* GetData() const;
923 void SetColumn( short col
);
928 wxMacCFStringHolder m_cfLabel
;
931 DataBrowserPropertyID m_colId
;
937 SortOrder_Text_Ascending
,
938 SortOrder_Text_Descending
941 typedef wxMacDataItem
* wxMacDataItemPtr
;
942 const wxMacDataItemPtr wxMacDataBrowserRootContainer
= NULL
;
944 WX_DEFINE_USER_EXPORTED_ARRAY_PTR(wxMacDataItemPtr
, wxArrayMacDataItemPtr
, class WXDLLIMPEXP_CORE
);
946 class wxMacDataItemBrowserControl
: public wxMacDataBrowserControl
, public wxMacListControl
949 wxMacDataItemBrowserControl( wxWindow
* peer
, const wxPoint
& pos
, const wxSize
& size
, long style
);
950 wxMacDataItemBrowserControl() {}
951 // create a list item (can be a subclass of wxMacListBoxItem)
953 virtual wxMacDataItem
* CreateItem();
955 unsigned int GetItemCount(const wxMacDataItem
* container
, bool recurse
, DataBrowserItemState state
) const;
956 void GetItems(const wxMacDataItem
* container
, bool recurse
,
957 DataBrowserItemState state
, wxArrayMacDataItemPtr
&items
) const;
959 unsigned int GetSelectedItemCount( const wxMacDataItem
* container
, bool recurse
) const;
961 unsigned int GetLineFromItem(const wxMacDataItem
*item
) const;
962 wxMacDataItem
* GetItemFromLine(unsigned int n
) const;
964 void UpdateItem(const wxMacDataItem
*container
, const wxMacDataItem
*item
,
965 DataBrowserPropertyID property
) const;
966 void UpdateItems(const wxMacDataItem
*container
, wxArrayMacDataItemPtr
&items
,
967 DataBrowserPropertyID property
) const;
969 void InsertColumn(int colId
, DataBrowserPropertyType colType
,
970 const wxString
& title
, SInt16 just
= teFlushDefault
, int defaultWidth
= -1);
972 int GetColumnWidth(int colId
);
973 void SetColumnWidth(int colId
, int width
);
975 void AddItem(wxMacDataItem
*container
, wxMacDataItem
*item
);
976 void AddItems(wxMacDataItem
*container
, wxArrayMacDataItemPtr
&items
);
978 void RemoveAllItems(wxMacDataItem
*container
);
979 void RemoveItem(wxMacDataItem
*container
, wxMacDataItem
* item
);
980 void RemoveItems(wxMacDataItem
*container
, wxArrayMacDataItemPtr
&items
);
982 void SetSelectedItem( wxMacDataItem
* item
, DataBrowserSetOption option
);
983 void SetSelectedItems( wxArrayMacDataItemPtr
&items
, DataBrowserSetOption option
);
984 void SetSelectedAllItems( DataBrowserSetOption option
);
985 Boolean
IsItemSelected( const wxMacDataItem
* item
) const;
987 void RevealItem( wxMacDataItem
* item
, DataBrowserRevealOptions options
);
989 void GetSelectionAnchor( wxMacDataItemPtr
* first
, wxMacDataItemPtr
* last
) const;
991 // item aware methods, to be used in subclasses
993 virtual Boolean
CompareItems(const wxMacDataItem
* itemOneID
,
994 const wxMacDataItem
* itemTwoID
,
995 DataBrowserPropertyID sortProperty
);
997 virtual OSStatus
GetSetItemData(wxMacDataItem
* itemID
,
998 DataBrowserPropertyID property
,
999 DataBrowserItemDataRef itemData
,
1000 Boolean changeValue
);
1002 virtual void ItemNotification(
1003 const wxMacDataItem
* itemID
,
1004 DataBrowserItemNotification message
,
1005 DataBrowserItemDataRef itemData
);
1007 // as we are getting the same events for human and API selection we have to suppress
1008 // events in the latter case, since this will be used from many subclasses we keep it here
1010 bool IsSelectionSuppressed() const { return m_suppressSelection
; }
1011 bool SuppressSelection( bool suppress
);
1014 // wxMacListControl Methods
1017 virtual void MacDelete( unsigned int n
);
1018 virtual void MacInsert( unsigned int n
, const wxArrayStringsAdapter
& items
, int column
= -1 );
1019 virtual int MacAppend( const wxString
& item
);
1020 virtual void MacClear();
1024 virtual void MacDeselectAll();
1025 virtual void MacSetSelection( unsigned int n
, bool select
, bool multi
= false );
1026 virtual int MacGetSelection() const;
1027 virtual int MacGetSelections( wxArrayInt
& aSelections
) const;
1028 virtual bool MacIsSelected( unsigned int n
) const;
1032 virtual void MacScrollTo( unsigned int n
);
1034 // accessing content
1036 virtual void MacSetString( unsigned int n
, const wxString
& item
);
1037 virtual void MacSetClientData( unsigned int n
, void * data
);
1038 virtual wxString
MacGetString( unsigned int n
) const;
1039 virtual void * MacGetClientData( unsigned int) const;
1040 virtual unsigned int MacGetCount() const;
1044 virtual wxClientDataType
GetClientDataType() const;
1045 virtual void SetClientDataType(wxClientDataType clientDataItemsType
);
1046 //virtual ListSortOrder GetSortOrder() const;
1047 //virtual void SetSortOrder(const ListSortOrder sort);
1053 ListSortOrder m_sortOrder
;
1054 wxClientDataType m_clientDataItemsType
;
1056 // ID aware base methods, should be 'final' ie not changed in subclasses
1058 virtual Boolean
CompareItems(DataBrowserItemID itemOneID
,
1059 DataBrowserItemID itemTwoID
,
1060 DataBrowserPropertyID sortProperty
);
1062 virtual OSStatus
GetSetItemData(DataBrowserItemID itemID
,
1063 DataBrowserPropertyID property
,
1064 DataBrowserItemDataRef itemData
,
1065 Boolean changeValue
);
1067 virtual void ItemNotification(
1068 DataBrowserItemID itemID
,
1069 DataBrowserItemNotification message
,
1070 DataBrowserItemDataRef itemData
);
1075 bool m_suppressSelection
;
1076 DECLARE_DYNAMIC_CLASS_NO_COPY(wxMacDataItemBrowserControl
)
1079 class wxMacDataItemBrowserSelectionSuppressor
1082 wxMacDataItemBrowserSelectionSuppressor(wxMacDataItemBrowserControl
*browser
);
1083 ~wxMacDataItemBrowserSelectionSuppressor();
1088 wxMacDataItemBrowserControl
* m_browser
;
1091 // ============================================================================
1092 // platform listbox implementation
1093 // ============================================================================
1095 // exposed for reuse in wxCheckListBox
1097 class wxMacListBoxItem
: public wxMacDataItem
1102 virtual ~wxMacListBoxItem();
1104 virtual void Notification(wxMacDataItemBrowserControl
*owner
,
1105 DataBrowserItemNotification message
,
1106 DataBrowserItemDataRef itemData
) const;
1109 class wxMacDataBrowserListControl
: public wxMacDataItemBrowserControl
1112 wxMacDataBrowserListControl( wxWindow
*peer
, const wxPoint
& pos
, const wxSize
& size
, long style
);
1113 wxMacDataBrowserListControl() {}
1114 virtual ~wxMacDataBrowserListControl();
1116 virtual wxMacDataItem
* CreateItem();
1120 wxWindow
* GetPeer() const;
1122 DECLARE_DYNAMIC_CLASS_NO_COPY(wxMacDataBrowserListControl
)
1125 // ============================================================================
1126 // graphics implementation
1127 // ============================================================================
1129 // make sure we all use one class for all conversions from wx to native colour
1131 class wxMacCoreGraphicsColour
1134 wxMacCoreGraphicsColour();
1135 wxMacCoreGraphicsColour(const wxBrush
&brush
);
1136 ~wxMacCoreGraphicsColour();
1138 void Apply( CGContextRef cgContext
);
1141 wxMacCFRefHolder
<CGColorRef
> m_color
;
1142 wxMacCFRefHolder
<CGColorSpaceRef
> m_colorSpace
;
1145 wxMacCFRefHolder
<CGPatternRef
> m_pattern
;
1146 CGFloat
* m_patternColorComponents
;
1149 #if wxMAC_USE_CORE_GRAPHICS && !wxUSE_GRAPHICS_CONTEXT
1151 class WXDLLEXPORT wxMacCGPath
: public wxGraphicPath
1153 DECLARE_NO_COPY_CLASS(wxMacCGPath
)
1158 // Starts a new subpath at
1159 void MoveToPoint( wxCoord x1
, wxCoord y1
);
1160 void AddLineToPoint( wxCoord x1
, wxCoord y1
);
1161 void AddQuadCurveToPoint( wxCoord cx1
, wxCoord cy1
, wxCoord x1
, wxCoord y1
);
1162 void AddRectangle( wxCoord x
, wxCoord y
, wxCoord w
, wxCoord h
);
1163 void AddCircle( wxCoord x
, wxCoord y
, wxCoord r
);
1165 // draws a an arc to two tangents connecting (current) to (x1,y1) and (x1,y1) to (x2,y2)
1166 virtual void AddArcToPoint( wxCoord x1
, wxCoord y1
, wxCoord x2
, wxCoord y2
, wxCoord r
) ;
1167 virtual void AddArc( wxCoord x
, wxCoord y
, wxCoord r
, double startAngle
, double endAngle
, bool clockwise
) ;
1169 // closes the current subpath
1170 void CloseSubpath();
1172 CGPathRef
GetPath() const;
1174 CGMutablePathRef m_path
;
1177 class WXDLLEXPORT wxMacCGContext
: public wxGraphicContext
1179 DECLARE_NO_COPY_CLASS(wxMacCGContext
)
1182 wxMacCGContext( CGrafPtr port
);
1183 wxMacCGContext( CGContextRef cgcontext
);
1185 virtual ~wxMacCGContext();
1187 virtual void Clip( const wxRegion
®ion
);
1188 virtual void StrokePath( const wxGraphicPath
*p
);
1189 virtual void DrawPath( const wxGraphicPath
*p
, int fillStyle
= wxWINDING_RULE
);
1190 virtual void FillPath( const wxGraphicPath
*p
, const wxColor
&fillColor
, int fillStyle
= wxWINDING_RULE
);
1192 virtual wxGraphicPath
* CreatePath();
1193 virtual void SetPen( const wxPen
&pen
) ;
1194 virtual void SetBrush( const wxBrush
&brush
);
1195 CGContextRef
GetNativeContext();
1196 void SetNativeContext( CGContextRef cg
);
1197 CGPathDrawingMode
GetDrawingMode() const { return m_mode
; }
1199 virtual void Translate( wxCoord dx
, wxCoord dy
);
1200 virtual void Scale( wxCoord xScale
, wxCoord yScale
);
1201 virtual void DrawBitmap( const wxBitmap
&bmp
, wxCoord x
, wxCoord y
, wxCoord w
, wxCoord h
);
1202 virtual void DrawIcon( const wxIcon
&icon
, wxCoord x
, wxCoord y
, wxCoord w
, wxCoord h
);
1203 virtual void PushState();
1204 virtual void PopState();
1206 virtual void DrawText( const wxString
&str
, wxCoord x
, wxCoord y
, double angle
) ;
1208 virtual void GetTextExtent( const wxString
&str
, wxCoord
*width
, wxCoord
*height
,
1209 wxCoord
*descent
, wxCoord
*externalLeading
) const ;
1211 virtual void GetPartialTextExtents(const wxString
& text
, wxArrayInt
& widths
) const ;
1213 virtual void SetFont( const wxFont
&font
) ;
1215 virtual void SetTextColor( const wxColour
&col
) ;
1217 CGContextRef m_cgContext
;
1219 CGPathDrawingMode m_mode
;
1220 ATSUStyle m_macATSUIStyle
;
1223 wxColor m_textForegroundColor
;
1226 #endif // wxMAC_USE_CORE_GRAPHICS
1228 #ifdef __WXMAC_OSX__
1230 CGColorSpaceRef
wxMacGetGenericRGBColorSpace(void);
1231 void wxMacMemoryBufferReleaseProc(void *info
, const void *data
, size_t size
);
1235 class WXDLLEXPORT wxBitmapRefData
: public wxGDIRefData
1237 friend class WXDLLIMPEXP_FWD_CORE wxIcon
;
1238 friend class WXDLLIMPEXP_FWD_CORE wxCursor
;
1240 wxBitmapRefData(int width
, int height
, int depth
);
1242 wxBitmapRefData(const wxBitmapRefData
&tocopy
);
1244 virtual ~wxBitmapRefData();
1247 bool Ok() const { return IsOk(); }
1248 bool IsOk() const { return m_ok
; }
1249 void SetOk( bool isOk
) { m_ok
= isOk
; }
1251 void SetWidth( int width
) { m_width
= width
; }
1252 void SetHeight( int height
) { m_height
= height
; }
1253 void SetDepth( int depth
) { m_depth
= depth
; }
1255 int GetWidth() const { return m_width
; }
1256 int GetHeight() const { return m_height
; }
1257 int GetDepth() const { return m_depth
; }
1259 void *GetRawAccess() const;
1260 void *BeginRawAccess();
1261 void EndRawAccess();
1263 bool HasAlpha() const { return m_hasAlpha
; }
1264 void UseAlpha( bool useAlpha
);
1268 wxPalette m_bitmapPalette
;
1269 #endif // wxUSE_PALETTE
1271 wxMask
* m_bitmapMask
; // Optional mask
1272 #ifdef __WXMAC_OSX__
1273 CGImageRef
CGImageCreate() const;
1276 // returns true if the bitmap has a size that
1277 // can be natively transferred into a true icon
1278 // if no is returned GetIconRef will still produce
1279 // an icon but it will be generated via a PICT and
1280 // rescaled to 16 x 16
1281 bool HasNativeSize();
1283 // caller should increase ref count if needed longer
1284 // than the bitmap exists
1285 IconRef
GetIconRef();
1287 // returns a Pict from the bitmap content
1288 PicHandle
GetPictHandle();
1289 #if wxMAC_USE_CORE_GRAPHICS
1290 CGContextRef
GetBitmapContext() const;
1292 GWorldPtr
GetHBITMAP(GWorldPtr
* mask
= NULL
) const;
1293 void UpdateAlphaMask() const;
1295 int GetBytesPerRow() const { return m_bytesPerRow
; }
1297 bool Create(int width
, int height
, int depth
);
1305 wxMemoryBuffer m_memBuf
;
1306 int m_rawAccessCount
;
1308 #ifdef __WXMAC_OSX__
1309 mutable CGImageRef m_cgImageRef
;
1312 PicHandle m_pictHandle
;
1313 #if wxMAC_USE_CORE_GRAPHICS
1314 CGContextRef m_hBitmap
;
1316 GWorldPtr m_hBitmap
;
1317 GWorldPtr m_hMaskBitmap
;
1318 wxMemoryBuffer m_maskMemBuf
;
1319 int m_maskBytesPerRow
;
1323 class WXDLLEXPORT wxIconRefData
: public wxGDIRefData
1327 wxIconRefData( WXHICON
);
1328 virtual ~wxIconRefData() { Free(); }
1331 virtual void Free();
1333 void SetWidth( int width
) { m_width
= width
; }
1334 void SetHeight( int height
) { m_height
= height
; }
1336 int GetWidth() const { return m_width
; }
1337 int GetHeight() const { return m_height
; }
1339 WXHICON
GetHICON() const { return (WXHICON
) m_iconRef
; }
1348 class wxMacDeferredWindowDeleter
: public wxObject
1351 wxMacDeferredWindowDeleter( WindowRef windowRef
);
1352 virtual ~wxMacDeferredWindowDeleter();
1355 WindowRef m_macWindow
;
1358 ControlRef
wxMacFindControlUnderMouse( wxTopLevelWindowMac
* toplevelWindow
, const Point
& location
, WindowRef window
, ControlPartCode
*outPart
);
1362 #ifdef WORDS_BIGENDIAN
1363 inline Rect
* wxMacGetPictureBounds( PicHandle pict
, Rect
* rect
)
1365 *rect
= (**pict
).picFrame
;
1369 inline Rect
* wxMacGetPictureBounds( PicHandle pict
, Rect
* rect
)
1371 return QDGetPictureBounds( pict
, rect
);
1379 #define wxMAC_DEFINE_PROC_GETTER( UPP , x ) \
1382 static UPP sHandler = NULL; \
1383 if ( sHandler == NULL ) \
1384 sHandler = New##UPP( x ); \
1388 //---------------------------------------------------------------------------
1389 // wxMac string conversions
1390 //---------------------------------------------------------------------------
1392 void wxMacSetupConverters();
1393 void wxMacCleanupConverters();
1395 WXDLLIMPEXP_BASE
void wxMacStringToPascal( const wxString
&from
, StringPtr to
);
1396 WXDLLIMPEXP_BASE wxString
wxMacMakeStringFromPascal( ConstStringPtr from
);
1400 WXDLLIMPEXP_BASE wxString
wxMacFSRefToPath( const FSRef
*fsRef
, CFStringRef additionalPathComponent
= NULL
);
1401 WXDLLIMPEXP_BASE OSStatus
wxMacPathToFSRef( const wxString
&path
, FSRef
*fsRef
);
1402 WXDLLIMPEXP_BASE wxString
wxMacHFSUniStrToString( ConstHFSUniStr255Param uniname
);
1408 void wxMacLocalToGlobal( WindowRef window
, Point
*pt
);
1409 void wxMacGlobalToLocal( WindowRef window
, Point
*pt
);
1413 //---------------------------------------------------------------------------
1414 // cocoa bridging utilities
1415 //---------------------------------------------------------------------------
1417 bool wxMacInitCocoa();
1419 class wxMacAutoreleasePool
1422 wxMacAutoreleasePool();
1423 ~wxMacAutoreleasePool();
1430 void wxMacCocoaRelease( void* obj
);
1431 void wxMacCocoaAutorelease( void* obj
);
1432 void wxMacCocoaRetain( void* obj
);
1438 WX_NSCursor
wxMacCocoaCreateStockCursor( int cursor_type
);
1439 WX_NSCursor
wxMacCocoaCreateCursorFromCGImage( CGImageRef cgImageRef
, float hotSpotX
, float hotSpotY
);
1440 void wxMacCocoaSetCursor( WX_NSCursor cursor
);
1441 void wxMacCocoaHideCursor();
1442 void wxMacCocoaShowCursor();
1444 typedef struct tagClassicCursor
1451 #else // !wxMAC_USE_COCOA
1455 typedef Cursor ClassicCursor
;
1457 #endif // wxMAC_USE_COCOA
1465 const short kwxCursorBullseye
= 0;
1466 const short kwxCursorBlank
= 1;
1467 const short kwxCursorPencil
= 2;
1468 const short kwxCursorMagnifier
= 3;
1469 const short kwxCursorNoEntry
= 4;
1470 const short kwxCursorPaintBrush
= 5;
1471 const short kwxCursorPointRight
= 6;
1472 const short kwxCursorPointLeft
= 7;
1473 const short kwxCursorQuestionArrow
= 8;
1474 const short kwxCursorRightArrow
= 9;
1475 const short kwxCursorSizeNS
= 10;
1476 const short kwxCursorSize
= 11;
1477 const short kwxCursorSizeNESW
= 12;
1478 const short kwxCursorSizeNWSE
= 13;
1479 const short kwxCursorRoller
= 14;
1480 const short kwxCursorLast
= kwxCursorRoller
;
1482 // exposing our fallback cursor map
1484 extern ClassicCursor gMacCursors
[];