1 /////////////////////////////////////////////////////////////////////////////
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_
21 # include <Carbon/Carbon.h>
23 # include <Debugging.h>
24 # include <Quickdraw.h>
25 # include <Appearance.h>
27 # include <Controls.h>
28 # include <ControlDefinitions.h>
34 #if UNIVERSAL_INTERFACES_VERSION < 0x0340
35 #error "please update to Apple's lastest 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 #ifdef __WXMAC_CARBON__
47 #include "wx/mac/corefoundation/cfstring.h"
51 // as macro in FixMath.h for 10.3
52 inline Fixed
IntToFixed( int inInt
)
54 return (((SInt32
) inInt
) << 16);
57 inline int FixedToInt( Fixed inFixed
)
59 return (((SInt32
) inFixed
) >> 16);
66 #include "wx/window.h"
68 class wxMacPortStateHelper
70 DECLARE_NO_COPY_CLASS(wxMacPortStateHelper
)
73 wxMacPortStateHelper( GrafPtr newport
) ;
74 wxMacPortStateHelper() ;
75 ~wxMacPortStateHelper() ;
77 void Setup( GrafPtr newport
) ;
79 bool IsCleared() { return m_clip
== NULL
; }
80 GrafPtr
GetCurrentPort() { return m_currentPort
; }
83 GrafPtr m_currentPort
;
86 ThemeDrawingState m_drawingState
;
93 class WXDLLEXPORT wxMacPortSaver
95 DECLARE_NO_COPY_CLASS(wxMacPortSaver
)
98 wxMacPortSaver( GrafPtr port
)
100 ::GetPort( &m_port
) ;
105 ::SetPort( m_port
) ;
111 class WXDLLEXPORT wxMacPortSetter
113 DECLARE_NO_COPY_CLASS(wxMacPortSetter
)
116 wxMacPortSetter( const wxDC
* dc
) ;
119 wxMacPortStateHelper m_ph
;
124 Clips to the visible region of a control within the current port
127 class WXDLLEXPORT wxMacWindowClipper
: public wxMacPortSaver
129 DECLARE_NO_COPY_CLASS(wxMacWindowClipper
)
132 wxMacWindowClipper( const wxWindow
* win
) ;
133 ~wxMacWindowClipper() ;
136 RgnHandle m_formerClip
;
137 RgnHandle m_newClip
;
140 class WXDLLEXPORT wxMacWindowStateSaver
: public wxMacWindowClipper
142 DECLARE_NO_COPY_CLASS(wxMacWindowStateSaver
)
145 wxMacWindowStateSaver( const wxWindow
* win
) ;
146 ~wxMacWindowStateSaver() ;
149 ThemeDrawingState m_themeDrawingState
;
152 #if wxMAC_USE_CORE_GRAPHICS
153 class WXDLLEXPORT wxMacCGContextStateSaver
155 DECLARE_NO_COPY_CLASS(wxMacCGContextStateSaver
)
158 wxMacCGContextStateSaver( CGContextRef cg
)
161 CGContextSaveGState( cg
) ;
163 ~wxMacCGContextStateSaver()
165 CGContextRestoreGState( m_cg
) ;
173 class wxMacDrawingHelper
175 DECLARE_NO_COPY_CLASS(wxMacDrawingHelper)
178 wxMacDrawingHelper( wxWindowMac * theWindow , bool clientArea = false ) ;
179 ~wxMacDrawingHelper() ;
180 bool Ok() { return m_ok ; }
181 void LocalToWindow( Rect *rect) { OffsetRect( rect , m_origin.h , m_origin.v ) ; }
182 void LocalToWindow( Point *pt ) { AddPt( m_origin , pt ) ; }
183 void LocalToWindow( RgnHandle rgn ) { OffsetRgn( rgn , m_origin.h , m_origin.v ) ; }
184 const Point& GetOrigin() { return m_origin ; }
187 GrafPtr m_formerPort ;
188 GrafPtr m_currentPort ;
189 PenState m_savedPenState ;
195 bool wxMacConvertEventToRecord( EventRef event
, EventRecord
*rec
) ;
200 WXDLLEXPORT wxString
wxMacFSSpec2MacFilename( const FSSpec
*spec
) ;
201 WXDLLEXPORT
void wxMacFilename2FSSpec( const wxString
&path
, FSSpec
*spec
) ;
204 WXDLLEXPORT wxString
wxMacFindFolder(short vRefNum
,
206 Boolean createFolder
);
208 template<typename T
> EventParamType
wxMacGetEventParamType() { wxFAIL_MSG( wxT("Unknown Param Type") ) ; return 0 ; }
209 template<> inline EventParamType wxMacGetEventParamType
<RgnHandle
>() { return typeQDRgnHandle
; }
210 template<> inline EventParamType wxMacGetEventParamType
<ControlRef
>() { return typeControlRef
; }
211 template<> inline EventParamType wxMacGetEventParamType
<WindowRef
>() { return typeWindowRef
; }
212 template<> inline EventParamType wxMacGetEventParamType
<MenuRef
>() { return typeMenuRef
; }
213 template<> inline EventParamType wxMacGetEventParamType
<EventRef
>() { return typeEventRef
; }
214 template<> inline EventParamType wxMacGetEventParamType
<Point
>() { return typeQDPoint
; }
215 template<> inline EventParamType wxMacGetEventParamType
<Rect
>() { return typeQDRectangle
; }
216 template<> inline EventParamType wxMacGetEventParamType
<Boolean
>() { return typeBoolean
; }
217 #if TARGET_API_MAC_OSX
218 template<> inline EventParamType wxMacGetEventParamType
<HICommand
>() { return typeHICommand
; }
219 template<> inline EventParamType wxMacGetEventParamType
<HIPoint
>() { return typeHIPoint
; }
220 template<> inline EventParamType wxMacGetEventParamType
<HISize
>() { return typeHISize
; }
221 template<> inline EventParamType wxMacGetEventParamType
<HIRect
>() { return typeHIRect
; }
222 template<> inline EventParamType wxMacGetEventParamType
<void*>() { return typeVoidPtr
; }
224 template<> inline EventParamType wxMacGetEventParamType
<Collection
>() { return typeCollection
; }
225 template<> inline EventParamType wxMacGetEventParamType
<CGContextRef
>() { return typeCGContextRef
; }
228 template<> EventParamType wxMacGetEventParamType<GrafPtr>() { return typeGrafPtr ; }
229 template<> EventParamType wxMacGetEventParamType<OSStatus>() { return typeOSStatus ; }
230 template<> EventParamType wxMacGetEventParamType<CFIndex>() { return typeCFIndex ; }
231 template<> EventParamType wxMacGetEventParamType<GWorldPtr>() { return typeGWorldPtr ; }
234 class wxMacCarbonEvent
244 wxMacCarbonEvent( EventRef event
, bool release
= false )
247 m_release
= release
;
250 wxMacCarbonEvent(UInt32 inClassID
,UInt32 inKind
,EventTime inWhen
= 0 /*now*/,EventAttributes inAttributes
=kEventAttributeNone
)
253 verify_noerr( MacCreateEvent( NULL
, inClassID
, inKind
,inWhen
,inAttributes
,&m_eventRef
) ) ;
260 ReleaseEvent( m_eventRef
) ;
263 OSStatus
Create(UInt32 inClassID
,UInt32 inKind
,EventTime inWhen
= 0 /*now*/,EventAttributes inAttributes
=kEventAttributeNone
)
265 verify( (m_eventRef
== NULL
) || m_release
) ;
266 if ( m_eventRef
&& m_release
)
268 ReleaseEvent( m_eventRef
) ;
273 OSStatus err
= MacCreateEvent( NULL
, inClassID
, inKind
,inWhen
,inAttributes
,&m_eventRef
) ;
279 OSStatus
GetParameter( EventParamName inName
, EventParamType inDesiredType
, UInt32 inBufferSize
, void * outData
) ;
281 template <typename T
> OSStatus
GetParameter( EventParamName inName
, EventParamType type
, T
*data
)
283 return GetParameter( inName
, type
, sizeof( T
) , data
) ;
285 template <typename T
> OSStatus
GetParameter( EventParamName inName
, T
*data
)
287 return GetParameter
<T
>( inName
, wxMacGetEventParamType
<T
>() , data
) ;
290 template <typename T
> T
GetParameter( EventParamName inName
)
293 verify_noerr( GetParameter
<T
>( inName
, &value
) ) ;
296 template <typename T
> T
GetParameter( EventParamName inName
, EventParamType inDesiredType
)
299 verify_noerr( GetParameter
<T
>( inName
, inDesiredType
, &value
) ) ;
303 OSStatus
SetParameter( EventParamName inName
, EventParamType inType
, UInt32 inSize
, const void * inData
) ;
304 template <typename T
> OSStatus
SetParameter( EventParamName inName
, EventParamType inDesiredType
, const T
*data
)
306 return SetParameter( inName
, inDesiredType
, sizeof( T
) , data
) ;
308 template <typename T
> OSStatus
SetParameter( EventParamName inName
, EventParamType inDesiredType
, const T
& data
)
310 return SetParameter
<T
>( inName
, inDesiredType
, &data
) ;
312 template <typename T
> OSStatus
SetParameter( EventParamName inName
, const T
*data
)
314 return SetParameter
<T
>( inName
, wxMacGetEventParamType
<T
>() , data
) ;
316 template <typename T
> OSStatus
SetParameter( EventParamName inName
, const T
& data
)
318 return SetParameter
<T
>( inName
, wxMacGetEventParamType
<T
>() , &data
) ;
322 return ::GetEventClass( m_eventRef
) ;
326 return ::GetEventKind( m_eventRef
) ;
330 return ::GetEventTime( m_eventRef
) ;
334 return EventTimeToTicks( GetTime() ) ;
336 OSStatus
SetTime( EventTime inWhen
= 0 /*now*/ )
338 return ::SetEventTime( m_eventRef
, inWhen
? inWhen
: GetCurrentEventTime() ) ;
340 operator EventRef () { return m_eventRef
; }
342 bool IsValid() { return m_eventRef
!= 0 ; }
344 EventRef m_eventRef
;
349 // helper class for allocating and deallocating Universal Proc Ptrs
352 template <typename procType
, typename uppType
, uppType (*newUPP
)(procType
) , void (*disposeUPP
)(uppType
) > class wxMacUPP
355 wxMacUPP( procType proc
)
358 m_upp
= (*newUPP
)( NULL
) ;
363 disposeUPP( m_upp
) ;
365 operator uppType() { return m_upp
; }
370 typedef wxMacUPP
<NMProcPtr
,NMUPP
,NewNMUPP
,DisposeNMUPP
> wxMacNMUPP
;
374 GWorldPtr wxMacCreateGWorld( int width , int height , int depth ) ;
375 void wxMacDestroyGWorld( GWorldPtr gw ) ;
376 PicHandle wxMacCreatePict( GWorldPtr gw , GWorldPtr mask = NULL ) ;
377 CIconHandle wxMacCreateCIcon(GWorldPtr image , GWorldPtr mask , short dstDepth , short iconSize ) ;
378 void wxMacSetColorTableEntry( CTabHandle newColors , int index , int red , int green , int blue ) ;
379 CTabHandle wxMacCreateColorTable( int numColors ) ;
381 void wxMacCreateBitmapButton( ControlButtonContentInfo
*info
, const wxBitmap
& bitmap
, int forceType
= 0 ) ;
382 void wxMacReleaseBitmapButton( ControlButtonContentInfo
*info
) ;
384 #define MAC_WXCOLORREF(a) (*((RGBColor*)&(a)))
385 #define MAC_WXHBITMAP(a) (GWorldPtr(a))
386 #define MAC_WXHMETAFILE(a) (PicHandle(a))
387 #define MAC_WXHICON(a) (IconRef(a))
388 #define MAC_WXHCURSOR(a) (CursHandle(a))
389 #define MAC_WXHRGN(a) (RgnHandle(a))
390 #define MAC_WXHWND(a) (WindowPtr(a))
391 #define MAC_WXRECPTR(a) ((Rect*)a)
392 #define MAC_WXPOINTPTR(a) ((Point*)a)
393 #define MAC_WXHMENU(a) ((MenuHandle)a)
395 struct wxOpaqueWindowRef
397 wxOpaqueWindowRef( WindowRef ref
) { m_data
= ref
; }
398 operator WindowRef() { return m_data
; }
403 wxWindow
* wxFindControlFromMacControl(ControlRef inControl
) ;
404 wxTopLevelWindowMac
* wxFindWinFromMacWindow( WindowRef inWindow
) ;
405 wxMenu
* wxFindMenuFromMacMenu(MenuRef inMenuRef
) ;
407 extern wxWindow
* g_MacLastWindow
;
408 pascal OSStatus
wxMacTopLevelMouseEventHandler( EventHandlerCallRef handler
, EventRef event
, void *data
) ;
409 Rect
wxMacGetBoundsForControl( wxWindow
* window
, const wxPoint
& pos
, const wxSize
&size
, bool adjustForOrigin
= true ) ;
416 m_controlRef
= NULL
;
419 wxMacControl( ControlRef control
)
421 m_controlRef
= control
;
423 wxMacControl( WXWidget control
)
425 m_controlRef
= (ControlRef
) control
;
427 virtual ~wxMacControl()
431 virtual void Dispose() ;
433 bool Ok() const { return GetControlRef() != NULL
; }
435 virtual ControlRef
* GetControlRefAddr() { return &m_controlRef
; }
436 virtual ControlRef
GetControlRef() const { return m_controlRef
; }
438 virtual void SetReference( SInt32 data
) ;
440 void operator= (ControlRef c) { m_controlRef = c ; }
441 operator ControlRef () { return m_controlRef; }
442 operator ControlRef * () { return &m_controlRef; }
444 // accessing data and values
446 virtual OSStatus
SetData( ControlPartCode inPartCode
, ResType inTag
, Size inSize
, const void * inData
) ;
447 virtual OSStatus
GetData( ControlPartCode inPartCode
, ResType inTag
, Size inBufferSize
, void * inOutBuffer
, Size
* outActualSize
) const ;
448 virtual OSStatus
GetDataSize( ControlPartCode inPartCode
, ResType inTag
, Size
* outActualSize
) const ;
449 virtual OSStatus
SendEvent( EventRef ref
, OptionBits inOptions
= 0 ) ;
450 virtual OSStatus
SendHICommand( HICommand
&command
, OptionBits inOptions
= 0 ) ;
452 virtual OSStatus
SendHICommand( UInt32 commandID
, OptionBits inOptions
= 0 ) ;
454 virtual SInt32
GetValue() const ;
455 virtual SInt32
GetMaximum() const ;
456 virtual SInt32
GetMinimum() const ;
458 virtual void SetValue( SInt32 v
) ;
459 virtual void SetMinimum( SInt32 v
) ;
460 virtual void SetMaximum( SInt32 v
) ;
462 virtual void SetValueAndRange( SInt32 value
, SInt32 minimum
, SInt32 maximum
) ;
463 virtual void SetRange( SInt32 minimum
, SInt32 maximum
) ;
465 virtual OSStatus
SetFocus( ControlFocusPart focusPart
) ;
466 virtual bool HasFocus() const ;
467 virtual bool NeedsFocusRect() const ;
471 Size
GetDataSize( ControlPartCode inPartCode
, ResType inTag
) const
474 verify_noerr( GetDataSize( inPartCode
, inTag
, &sz
) ) ;
477 template <typename T
> OSStatus
SetData( ControlPartCode inPartCode
, ResType inTag
, const T
*data
)
479 return SetData( inPartCode
, inTag
, sizeof( T
) , data
) ;
481 template <typename T
> OSStatus
SetData( ControlPartCode inPartCode
, ResType inTag
, const T
& data
)
483 return SetData( inPartCode
, inTag
, sizeof( T
) , &data
) ;
485 template <typename T
> OSStatus
GetData( ControlPartCode inPartCode
, ResType inTag
, T
*data
) const
488 return GetData( inPartCode
, inTag
, sizeof( T
) , data
, &dummy
) ;
490 template <typename T
> T
GetData( ControlPartCode inPartCode
, ResType inTag
) const
493 verify_noerr( GetData
<T
>( inPartCode
, inTag
, &value
) ) ;
497 // Flash the control for the specified amount of time
498 virtual void Flash( ControlPartCode part
, UInt32 ticks
= 8 ) ;
499 virtual void VisibilityChanged( bool shown
) ;
500 virtual void SetFont( const wxFont
& font
, const wxColour
& foreground
, long windowStyle
) ;
501 virtual void SetBackground( const wxBrush
&brush
) ;
502 virtual ControlPartCode
HandleKey( SInt16 keyCode
, SInt16 charCode
, EventModifiers modifiers
) ;
503 void SetActionProc( ControlActionUPP actionProc
) ;
504 void SetViewSize( SInt32 viewSize
) ;
505 SInt32
GetViewSize() const ;
507 virtual bool IsVisible() const ;
508 virtual void SetVisibility( bool visible
, bool redraw
) ;
509 virtual bool IsEnabled() const ;
510 virtual bool IsActive() const ;
511 virtual void Enable( bool enable
) ;
513 // invalidates this control and all children
514 virtual void InvalidateWithChildren() ;
515 virtual void SetDrawingEnabled( bool enable
) ;
516 virtual bool GetNeedsDisplay() const ;
517 virtual void SetNeedsDisplay( bool needsDisplay
, RgnHandle where
= NULL
) ;
519 virtual void ScrollRect( const wxRect
&rect
, int dx
, int dy
) ;
521 virtual void GetRect( Rect
*r
) ;
522 virtual void SetRect( Rect
*r
) ;
523 virtual void GetRectInWindowCoords( Rect
*r
) ;
524 virtual void GetBestRect( Rect
*r
) ;
525 virtual void SetTitle( const wxString
&title
) ;
526 // converts from Toplevel-Content relative to local
527 static void Convert( wxPoint
*pt
, wxMacControl
*convert
, wxMacControl
*to
) ;
529 virtual void GetFeatures( UInt32
*features
) ;
530 virtual OSStatus
GetRegion( ControlPartCode partCode
, RgnHandle region
) ;
531 virtual OSStatus
SetZOrder( bool above
, wxMacControl
* other
) ;
532 // to be moved into a databrowser subclass
534 virtual OSStatus
SetSelectionFlags( DataBrowserSelectionFlags
) ;
535 virtual OSStatus
AddListViewColumn( DataBrowserListViewColumnDesc
*columnDesc
,
536 DataBrowserTableViewColumnIndex position
) ;
537 virtual OSStatus
AutoSizeListViewColumns() ;
538 virtual OSStatus
SetHasScrollBars( bool horiz
, bool vert
) ;
539 virtual OSStatus
SetTableViewHiliteStyle( DataBrowserTableViewHiliteStyle hiliteStyle
) ;
540 virtual OSStatus
SetListViewHeaderBtnHeight(UInt16 height
) ;
541 virtual OSStatus
SetCallbacks(const DataBrowserCallbacks
* callbacks
) ;
542 virtual OSStatus
UpdateItems( DataBrowserItemID container
, UInt32 numItems
,
543 const DataBrowserItemID
* items
,
544 DataBrowserPropertyID preSortProperty
,
545 DataBrowserPropertyID propertyID
) ;
546 virtual OSStatus
AddItems( DataBrowserItemID container
, UInt32 numItems
,
547 const DataBrowserItemID
* items
,
548 DataBrowserPropertyID preSortProperty
) ;
549 virtual OSStatus
RemoveItems( DataBrowserItemID container
, UInt32 numItems
,
550 const DataBrowserItemID
* items
,
551 DataBrowserPropertyID preSortProperty
) ;
552 virtual OSStatus
RevealItem( DataBrowserItemID item
,
553 DataBrowserPropertyID propertyID
,
554 DataBrowserRevealOptions options
) ;
555 virtual OSStatus
GetSelectionAnchor( DataBrowserItemID
* first
, DataBrowserItemID
* last
) ;
556 virtual bool IsItemSelected( DataBrowserItemID item
) ;
557 virtual OSStatus
SetSelectedItems(UInt32 numItems
,
558 const DataBrowserItemID
* items
,
559 DataBrowserSetOption operation
) ;
561 // to be moved into a tab control class
563 virtual OSStatus
SetTabEnabled( SInt16 tabNo
, bool enable
) ;
565 ControlRef m_controlRef
;
570 #if wxMAC_USE_CORE_GRAPHICS
572 class WXDLLEXPORT wxMacCGPath
: public wxGraphicPath
574 DECLARE_NO_COPY_CLASS(wxMacCGPath
)
579 // Starts a new subpath at
580 void MoveToPoint( wxCoord x1
, wxCoord y1
) ;
581 void AddLineToPoint( wxCoord x1
, wxCoord y1
) ;
582 void AddRectangle( wxCoord x
, wxCoord y
, wxCoord w
, wxCoord h
) ;
583 void AddCircle( wxCoord x
, wxCoord y
, wxCoord r
) ;
585 // closes the current subpath
586 void CloseSubpath() ;
588 CGPathRef
GetPath() const ;
590 CGMutablePathRef m_path
;
593 class WXDLLEXPORT wxMacCGContext
: public wxGraphicContext
595 DECLARE_NO_COPY_CLASS(wxMacCGContext
)
598 wxMacCGContext( CGrafPtr port
) ;
599 wxMacCGContext( CGContextRef cgcontext
) ;
603 virtual void Clip( const wxRegion
®ion
) ;
604 virtual void StrokePath( const wxGraphicPath
*p
) ;
605 virtual void DrawPath( const wxGraphicPath
*p
, int fillStyle
= wxWINDING_RULE
) ;
606 virtual void FillPath( const wxGraphicPath
*p
, const wxColor
&fillColor
, int fillStyle
= wxWINDING_RULE
) ;
608 virtual wxGraphicPath
* CreatePath() ;
609 virtual void SetPen( const wxPen
&pen
) ;
610 virtual void SetBrush( const wxBrush
&brush
) ;
611 CGContextRef
GetNativeContext() ;
612 void SetNativeContext( CGContextRef cg
) ;
613 CGPathDrawingMode
GetDrawingMode() const { return m_mode
; }
615 CGContextRef m_cgContext
;
617 CGPathDrawingMode m_mode
;
622 CGColorSpaceRef
wxMacGetGenericRGBColorSpace(void) ;
623 void wxMacMemoryBufferReleaseProc(void *info
, const void *data
, size_t size
) ;
625 #endif // wxMAC_USE_CORE_GRAPHICS
627 class WXDLLEXPORT wxBitmapRefData
: public wxGDIRefData
629 DECLARE_NO_COPY_CLASS(wxBitmapRefData
)
631 friend class WXDLLEXPORT wxIcon
;
632 friend class WXDLLEXPORT wxCursor
;
634 wxBitmapRefData(int width
, int height
, int depth
);
639 bool Ok() const { return m_ok
; }
640 void SetOk( bool isOk
) { m_ok
= isOk
; }
642 void SetWidth( int width
) { m_width
= width
; }
643 void SetHeight( int height
) { m_height
= height
; }
644 void SetDepth( int depth
) { m_depth
= depth
; }
646 int GetWidth() const { return m_width
; }
647 int GetHeight() const { return m_height
; }
648 int GetDepth() const { return m_depth
; }
650 void *GetRawAccess() const ;
651 void *BeginRawAccess() ;
652 void EndRawAccess() ;
654 bool HasAlpha() const { return m_hasAlpha
; }
655 void UseAlpha( bool useAlpha
) ;
659 wxPalette m_bitmapPalette
;
660 #endif // wxUSE_PALETTE
662 wxMask
* m_bitmapMask
; // Optional mask
663 #if wxMAC_USE_CORE_GRAPHICS
664 CGImageRef
CGImageCreate() const ;
667 // returns true if the bitmap has a size that
668 // can be natively transferred into a true icon
669 // if no is returned GetIconRef will still produce
670 // an icon but it will be generated via a PICT and
671 // rescaled to 16 x 16
672 bool HasNativeSize() ;
674 // caller should increase ref count if needed longer
675 // than the bitmap exists
676 IconRef
GetIconRef() ;
678 // returns a Pict from the bitmap content
679 PicHandle
GetPictHandle() ;
680 GWorldPtr
GetHBITMAP(GWorldPtr
* mask
= NULL
) const ;
681 void UpdateAlphaMask() const ;
684 bool Create(int width
, int height
, int depth
) ;
692 wxMemoryBuffer m_memBuf
;
693 int m_rawAccessCount
;
695 #if wxMAC_USE_CORE_GRAPHICS
696 mutable CGImageRef m_cgImageRef
;
699 PicHandle m_pictHandle
;
701 GWorldPtr m_hMaskBitmap
;
702 wxMemoryBuffer m_maskMemBuf
;
703 int m_maskBytesPerRow
;
706 class WXDLLEXPORT wxIconRefData
: public wxGDIRefData
710 wxIconRefData( WXHICON
) ;
711 virtual ~wxIconRefData() { Free(); }
716 void SetWidth( int width
) { m_width
= width
; }
717 void SetHeight( int height
) { m_height
= height
; }
719 int GetWidth() const { return m_width
; }
720 int GetHeight() const { return m_height
; }
722 WXHICON
GetHICON() const { return (WXHICON
) m_iconRef
; }
731 //---------------------------------------------------------------------------
732 // wxMac string conversions
733 //---------------------------------------------------------------------------
735 void wxMacSetupConverters() ;
736 void wxMacCleanupConverters() ;
738 void wxMacStringToPascal( const wxString
&from
, StringPtr to
) ;
739 wxString
wxMacMakeStringFromPascal( ConstStringPtr from
) ;
743 ControlRef
wxMacFindControlUnderMouse( Point location
, WindowRef window
, ControlPartCode
*outPart
) ;
747 wxString
wxMacFSRefToPath( const FSRef
*fsRef
, CFStringRef additionalPathComponent
= NULL
) ;
748 OSStatus
wxMacPathToFSRef( const wxString
&path
, FSRef
*fsRef
) ;
749 wxString
wxMacHFSUniStrToString( ConstHFSUniStr255Param uniname
) ;