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"
50 //forward declarations
51 class wxTopLevelWindowMac
;
54 // as macro in FixMath.h for 10.3
55 inline Fixed
IntToFixed( int inInt
)
57 return (((SInt32
) inInt
) << 16);
60 inline int FixedToInt( Fixed inFixed
)
62 return (((SInt32
) inFixed
) >> 16);
69 #include "wx/window.h"
71 class wxMacPortStateHelper
73 DECLARE_NO_COPY_CLASS(wxMacPortStateHelper
)
76 wxMacPortStateHelper( GrafPtr newport
) ;
77 wxMacPortStateHelper() ;
78 ~wxMacPortStateHelper() ;
80 void Setup( GrafPtr newport
) ;
82 bool IsCleared() { return m_clip
== NULL
; }
83 GrafPtr
GetCurrentPort() { return m_currentPort
; }
86 GrafPtr m_currentPort
;
89 ThemeDrawingState m_drawingState
;
96 class WXDLLEXPORT wxMacPortSaver
98 DECLARE_NO_COPY_CLASS(wxMacPortSaver
)
101 wxMacPortSaver( GrafPtr port
)
103 ::GetPort( &m_port
) ;
108 ::SetPort( m_port
) ;
114 class WXDLLEXPORT wxMacPortSetter
116 DECLARE_NO_COPY_CLASS(wxMacPortSetter
)
119 wxMacPortSetter( const wxDC
* dc
) ;
122 wxMacPortStateHelper m_ph
;
127 Clips to the visible region of a control within the current port
130 class WXDLLEXPORT wxMacWindowClipper
: public wxMacPortSaver
132 DECLARE_NO_COPY_CLASS(wxMacWindowClipper
)
135 wxMacWindowClipper( const wxWindow
* win
) ;
136 ~wxMacWindowClipper() ;
139 RgnHandle m_formerClip
;
140 RgnHandle m_newClip
;
143 class WXDLLEXPORT wxMacWindowStateSaver
: public wxMacWindowClipper
145 DECLARE_NO_COPY_CLASS(wxMacWindowStateSaver
)
148 wxMacWindowStateSaver( const wxWindow
* win
) ;
149 ~wxMacWindowStateSaver() ;
152 ThemeDrawingState m_themeDrawingState
;
155 #if wxMAC_USE_CORE_GRAPHICS
156 class WXDLLEXPORT wxMacCGContextStateSaver
158 DECLARE_NO_COPY_CLASS(wxMacCGContextStateSaver
)
161 wxMacCGContextStateSaver( CGContextRef cg
)
164 CGContextSaveGState( cg
) ;
166 ~wxMacCGContextStateSaver()
168 CGContextRestoreGState( m_cg
) ;
176 class wxMacDrawingHelper
178 DECLARE_NO_COPY_CLASS(wxMacDrawingHelper)
181 wxMacDrawingHelper( wxWindowMac * theWindow , bool clientArea = false ) ;
182 ~wxMacDrawingHelper() ;
183 bool Ok() { return m_ok ; }
184 void LocalToWindow( Rect *rect) { OffsetRect( rect , m_origin.h , m_origin.v ) ; }
185 void LocalToWindow( Point *pt ) { AddPt( m_origin , pt ) ; }
186 void LocalToWindow( RgnHandle rgn ) { OffsetRgn( rgn , m_origin.h , m_origin.v ) ; }
187 const Point& GetOrigin() { return m_origin ; }
190 GrafPtr m_formerPort ;
191 GrafPtr m_currentPort ;
192 PenState m_savedPenState ;
198 bool wxMacConvertEventToRecord( EventRef event
, EventRecord
*rec
) ;
203 WXDLLEXPORT wxString
wxMacFSSpec2MacFilename( const FSSpec
*spec
) ;
204 WXDLLEXPORT
void wxMacFilename2FSSpec( const wxString
&path
, FSSpec
*spec
) ;
207 WXDLLEXPORT wxString
wxMacFindFolder(short vRefNum
,
209 Boolean createFolder
);
211 template<typename T
> EventParamType
wxMacGetEventParamType() { wxFAIL_MSG( wxT("Unknown Param Type") ) ; return 0 ; }
212 template<> inline EventParamType wxMacGetEventParamType
<RgnHandle
>() { return typeQDRgnHandle
; }
213 template<> inline EventParamType wxMacGetEventParamType
<ControlRef
>() { return typeControlRef
; }
214 template<> inline EventParamType wxMacGetEventParamType
<WindowRef
>() { return typeWindowRef
; }
215 template<> inline EventParamType wxMacGetEventParamType
<MenuRef
>() { return typeMenuRef
; }
216 template<> inline EventParamType wxMacGetEventParamType
<EventRef
>() { return typeEventRef
; }
217 template<> inline EventParamType wxMacGetEventParamType
<Point
>() { return typeQDPoint
; }
218 template<> inline EventParamType wxMacGetEventParamType
<Rect
>() { return typeQDRectangle
; }
219 template<> inline EventParamType wxMacGetEventParamType
<Boolean
>() { return typeBoolean
; }
220 #if TARGET_API_MAC_OSX
221 template<> inline EventParamType wxMacGetEventParamType
<HICommand
>() { return typeHICommand
; }
222 template<> inline EventParamType wxMacGetEventParamType
<HIPoint
>() { return typeHIPoint
; }
223 template<> inline EventParamType wxMacGetEventParamType
<HISize
>() { return typeHISize
; }
224 template<> inline EventParamType wxMacGetEventParamType
<HIRect
>() { return typeHIRect
; }
225 template<> inline EventParamType wxMacGetEventParamType
<void*>() { return typeVoidPtr
; }
227 template<> inline EventParamType wxMacGetEventParamType
<Collection
>() { return typeCollection
; }
228 template<> inline EventParamType wxMacGetEventParamType
<CGContextRef
>() { return typeCGContextRef
; }
231 template<> EventParamType wxMacGetEventParamType<GrafPtr>() { return typeGrafPtr ; }
232 template<> EventParamType wxMacGetEventParamType<OSStatus>() { return typeOSStatus ; }
233 template<> EventParamType wxMacGetEventParamType<CFIndex>() { return typeCFIndex ; }
234 template<> EventParamType wxMacGetEventParamType<GWorldPtr>() { return typeGWorldPtr ; }
237 class wxMacCarbonEvent
247 wxMacCarbonEvent( EventRef event
, bool release
= false )
250 m_release
= release
;
253 wxMacCarbonEvent(UInt32 inClassID
,UInt32 inKind
,EventTime inWhen
= 0 /*now*/,EventAttributes inAttributes
=kEventAttributeNone
)
256 verify_noerr( MacCreateEvent( NULL
, inClassID
, inKind
,inWhen
,inAttributes
,&m_eventRef
) ) ;
263 ReleaseEvent( m_eventRef
) ;
266 OSStatus
Create(UInt32 inClassID
,UInt32 inKind
,EventTime inWhen
= 0 /*now*/,EventAttributes inAttributes
=kEventAttributeNone
)
268 verify( (m_eventRef
== NULL
) || m_release
) ;
269 if ( m_eventRef
&& m_release
)
271 ReleaseEvent( m_eventRef
) ;
276 OSStatus err
= MacCreateEvent( NULL
, inClassID
, inKind
,inWhen
,inAttributes
,&m_eventRef
) ;
282 OSStatus
GetParameter( EventParamName inName
, EventParamType inDesiredType
, UInt32 inBufferSize
, void * outData
) ;
284 template <typename T
> OSStatus
GetParameter( EventParamName inName
, EventParamType type
, T
*data
)
286 return GetParameter( inName
, type
, sizeof( T
) , data
) ;
288 template <typename T
> OSStatus
GetParameter( EventParamName inName
, T
*data
)
290 return GetParameter
<T
>( inName
, wxMacGetEventParamType
<T
>() , data
) ;
293 template <typename T
> T
GetParameter( EventParamName inName
)
296 verify_noerr( GetParameter
<T
>( inName
, &value
) ) ;
299 template <typename T
> T
GetParameter( EventParamName inName
, EventParamType inDesiredType
)
302 verify_noerr( GetParameter
<T
>( inName
, inDesiredType
, &value
) ) ;
306 OSStatus
SetParameter( EventParamName inName
, EventParamType inType
, UInt32 inSize
, const void * inData
) ;
307 template <typename T
> OSStatus
SetParameter( EventParamName inName
, EventParamType inDesiredType
, const T
*data
)
309 return SetParameter( inName
, inDesiredType
, sizeof( T
) , data
) ;
311 template <typename T
> OSStatus
SetParameter( EventParamName inName
, EventParamType inDesiredType
, const T
& data
)
313 return SetParameter
<T
>( inName
, inDesiredType
, &data
) ;
315 template <typename T
> OSStatus
SetParameter( EventParamName inName
, const T
*data
)
317 return SetParameter
<T
>( inName
, wxMacGetEventParamType
<T
>() , data
) ;
319 template <typename T
> OSStatus
SetParameter( EventParamName inName
, const T
& data
)
321 return SetParameter
<T
>( inName
, wxMacGetEventParamType
<T
>() , &data
) ;
325 return ::GetEventClass( m_eventRef
) ;
329 return ::GetEventKind( m_eventRef
) ;
333 return ::GetEventTime( m_eventRef
) ;
337 return EventTimeToTicks( GetTime() ) ;
339 OSStatus
SetTime( EventTime inWhen
= 0 /*now*/ )
341 return ::SetEventTime( m_eventRef
, inWhen
? inWhen
: GetCurrentEventTime() ) ;
343 operator EventRef () { return m_eventRef
; }
345 bool IsValid() { return m_eventRef
!= 0 ; }
347 EventRef m_eventRef
;
352 // helper class for allocating and deallocating Universal Proc Ptrs
355 template <typename procType
, typename uppType
, uppType (*newUPP
)(procType
) , void (*disposeUPP
)(uppType
) > class wxMacUPP
358 wxMacUPP( procType proc
)
361 m_upp
= (*newUPP
)( NULL
) ;
366 disposeUPP( m_upp
) ;
368 operator uppType() { return m_upp
; }
373 typedef wxMacUPP
<NMProcPtr
,NMUPP
,NewNMUPP
,DisposeNMUPP
> wxMacNMUPP
;
377 GWorldPtr wxMacCreateGWorld( int width , int height , int depth ) ;
378 void wxMacDestroyGWorld( GWorldPtr gw ) ;
379 PicHandle wxMacCreatePict( GWorldPtr gw , GWorldPtr mask = NULL ) ;
380 CIconHandle wxMacCreateCIcon(GWorldPtr image , GWorldPtr mask , short dstDepth , short iconSize ) ;
381 void wxMacSetColorTableEntry( CTabHandle newColors , int index , int red , int green , int blue ) ;
382 CTabHandle wxMacCreateColorTable( int numColors ) ;
384 void wxMacCreateBitmapButton( ControlButtonContentInfo
*info
, const wxBitmap
& bitmap
, int forceType
= 0 ) ;
385 void wxMacReleaseBitmapButton( ControlButtonContentInfo
*info
) ;
387 #define MAC_WXCOLORREF(a) (*((RGBColor*)&(a)))
388 #define MAC_WXHBITMAP(a) (GWorldPtr(a))
389 #define MAC_WXHMETAFILE(a) (PicHandle(a))
390 #define MAC_WXHICON(a) (IconRef(a))
391 #define MAC_WXHCURSOR(a) (CursHandle(a))
392 #define MAC_WXHRGN(a) (RgnHandle(a))
393 #define MAC_WXHWND(a) (WindowPtr(a))
394 #define MAC_WXRECPTR(a) ((Rect*)a)
395 #define MAC_WXPOINTPTR(a) ((Point*)a)
396 #define MAC_WXHMENU(a) ((MenuHandle)a)
398 struct wxOpaqueWindowRef
400 wxOpaqueWindowRef( WindowRef ref
) { m_data
= ref
; }
401 operator WindowRef() { return m_data
; }
406 wxWindow
* wxFindControlFromMacControl(ControlRef inControl
) ;
407 wxTopLevelWindowMac
* wxFindWinFromMacWindow( WindowRef inWindow
) ;
408 wxMenu
* wxFindMenuFromMacMenu(MenuRef inMenuRef
) ;
410 extern wxWindow
* g_MacLastWindow
;
411 pascal OSStatus
wxMacTopLevelMouseEventHandler( EventHandlerCallRef handler
, EventRef event
, void *data
) ;
412 Rect
wxMacGetBoundsForControl( wxWindow
* window
, const wxPoint
& pos
, const wxSize
&size
, bool adjustForOrigin
= true ) ;
417 wxMacControl( wxWindow
* peer
) ;
418 wxMacControl( wxWindow
* peer
, ControlRef control
) ;
419 wxMacControl( wxWindow
* peer
, WXWidget control
) ;
420 virtual ~wxMacControl() ;
424 virtual void Dispose() ;
426 bool Ok() const { return GetControlRef() != NULL
; }
428 virtual ControlRef
* GetControlRefAddr() { return &m_controlRef
; }
429 virtual ControlRef
GetControlRef() const { return m_controlRef
; }
431 virtual void SetReference( SInt32 data
) ;
433 void operator= (ControlRef c) { m_controlRef = c ; }
434 operator ControlRef () { return m_controlRef; }
435 operator ControlRef * () { return &m_controlRef; }
437 // accessing data and values
439 virtual OSStatus
SetData( ControlPartCode inPartCode
, ResType inTag
, Size inSize
, const void * inData
) ;
440 virtual OSStatus
GetData( ControlPartCode inPartCode
, ResType inTag
, Size inBufferSize
, void * inOutBuffer
, Size
* outActualSize
) const ;
441 virtual OSStatus
GetDataSize( ControlPartCode inPartCode
, ResType inTag
, Size
* outActualSize
) const ;
442 virtual OSStatus
SendEvent( EventRef ref
, OptionBits inOptions
= 0 ) ;
443 virtual OSStatus
SendHICommand( HICommand
&command
, OptionBits inOptions
= 0 ) ;
445 virtual OSStatus
SendHICommand( UInt32 commandID
, OptionBits inOptions
= 0 ) ;
447 virtual SInt32
GetValue() const ;
448 virtual SInt32
GetMaximum() const ;
449 virtual SInt32
GetMinimum() const ;
451 virtual void SetValue( SInt32 v
) ;
452 virtual void SetMinimum( SInt32 v
) ;
453 virtual void SetMaximum( SInt32 v
) ;
455 virtual void SetValueAndRange( SInt32 value
, SInt32 minimum
, SInt32 maximum
) ;
456 virtual void SetRange( SInt32 minimum
, SInt32 maximum
) ;
458 virtual OSStatus
SetFocus( ControlFocusPart focusPart
) ;
459 virtual bool HasFocus() const ;
460 virtual bool NeedsFocusRect() const ;
461 virtual void SetNeedsFocusRect( bool needs
) ;
465 Size
GetDataSize( ControlPartCode inPartCode
, ResType inTag
) const
468 verify_noerr( GetDataSize( inPartCode
, inTag
, &sz
) ) ;
471 template <typename T
> OSStatus
SetData( ControlPartCode inPartCode
, ResType inTag
, const T
*data
)
473 return SetData( inPartCode
, inTag
, sizeof( T
) , data
) ;
475 template <typename T
> OSStatus
SetData( ControlPartCode inPartCode
, ResType inTag
, const T
& data
)
477 return SetData( inPartCode
, inTag
, sizeof( T
) , &data
) ;
479 template <typename T
> OSStatus
GetData( ControlPartCode inPartCode
, ResType inTag
, T
*data
) const
482 return GetData( inPartCode
, inTag
, sizeof( T
) , data
, &dummy
) ;
484 template <typename T
> T
GetData( ControlPartCode inPartCode
, ResType inTag
) const
487 verify_noerr( GetData
<T
>( inPartCode
, inTag
, &value
) ) ;
491 // Flash the control for the specified amount of time
492 virtual void Flash( ControlPartCode part
, UInt32 ticks
= 8 ) ;
494 virtual void VisibilityChanged( bool shown
) ;
495 virtual void SuperChangedPosition() ;
498 virtual void SetFont( const wxFont
& font
, const wxColour
& foreground
, long windowStyle
) ;
499 virtual void SetBackground( const wxBrush
&brush
) ;
500 virtual ControlPartCode
HandleKey( SInt16 keyCode
, SInt16 charCode
, EventModifiers modifiers
) ;
501 void SetActionProc( ControlActionUPP actionProc
) ;
502 void SetViewSize( SInt32 viewSize
) ;
503 SInt32
GetViewSize() const ;
505 virtual bool IsVisible() const ;
506 virtual void SetVisibility( bool visible
, bool redraw
) ;
507 virtual bool IsEnabled() const ;
508 virtual bool IsActive() const ;
509 virtual void Enable( bool enable
) ;
511 // invalidates this control and all children
512 virtual void InvalidateWithChildren() ;
513 virtual void SetDrawingEnabled( bool enable
) ;
515 virtual bool GetNeedsDisplay() const ;
516 virtual void SetNeedsDisplay( bool needsDisplay
, RgnHandle where
= NULL
) ;
518 virtual void ScrollRect( const wxRect
&rect
, int dx
, int dy
) ;
520 virtual void GetRect( Rect
*r
) ;
521 virtual void SetRect( Rect
*r
) ;
522 virtual void GetRectInWindowCoords( Rect
*r
) ;
523 virtual void GetBestRect( Rect
*r
) ;
524 virtual void SetTitle( const wxString
&title
) ;
525 // converts from Toplevel-Content relative to local
526 static void Convert( wxPoint
*pt
, wxMacControl
*convert
, wxMacControl
*to
) ;
528 virtual void GetFeatures( UInt32
*features
) ;
529 virtual OSStatus
GetRegion( ControlPartCode partCode
, RgnHandle region
) ;
530 virtual OSStatus
SetZOrder( bool above
, wxMacControl
* other
) ;
531 // to be moved into a databrowser subclass
533 virtual OSStatus
SetSelectionFlags( DataBrowserSelectionFlags
) ;
534 virtual OSStatus
AddListViewColumn( DataBrowserListViewColumnDesc
*columnDesc
,
535 DataBrowserTableViewColumnIndex position
) ;
536 virtual OSStatus
AutoSizeListViewColumns() ;
537 virtual OSStatus
SetHasScrollBars( bool horiz
, bool vert
) ;
538 virtual OSStatus
SetTableViewHiliteStyle( DataBrowserTableViewHiliteStyle hiliteStyle
) ;
539 virtual OSStatus
SetListViewHeaderBtnHeight(UInt16 height
) ;
540 virtual OSStatus
SetCallbacks(const DataBrowserCallbacks
* callbacks
) ;
541 virtual OSStatus
UpdateItems( DataBrowserItemID container
, UInt32 numItems
,
542 const DataBrowserItemID
* items
,
543 DataBrowserPropertyID preSortProperty
,
544 DataBrowserPropertyID propertyID
) ;
545 virtual OSStatus
AddItems( DataBrowserItemID container
, UInt32 numItems
,
546 const DataBrowserItemID
* items
,
547 DataBrowserPropertyID preSortProperty
) ;
548 virtual OSStatus
RemoveItems( DataBrowserItemID container
, UInt32 numItems
,
549 const DataBrowserItemID
* items
,
550 DataBrowserPropertyID preSortProperty
) ;
551 virtual OSStatus
RevealItem( DataBrowserItemID item
,
552 DataBrowserPropertyID propertyID
,
553 DataBrowserRevealOptions options
) ;
554 virtual OSStatus
GetSelectionAnchor( DataBrowserItemID
* first
, DataBrowserItemID
* last
) ;
555 virtual bool IsItemSelected( DataBrowserItemID item
) ;
556 virtual OSStatus
SetSelectedItems(UInt32 numItems
,
557 const DataBrowserItemID
* items
,
558 DataBrowserSetOption operation
) ;
560 // to be moved into a tab control class
562 virtual OSStatus
SetTabEnabled( SInt16 tabNo
, bool enable
) ;
563 bool IsCompositing() { return m_isCompositing
; }
565 ControlRef m_controlRef
;
569 bool m_needsFocusRect
;
570 bool m_isCompositing
;
573 #if wxMAC_USE_CORE_GRAPHICS
575 class WXDLLEXPORT wxMacCGPath
: public wxGraphicPath
577 DECLARE_NO_COPY_CLASS(wxMacCGPath
)
582 // Starts a new subpath at
583 void MoveToPoint( wxCoord x1
, wxCoord y1
) ;
584 void AddLineToPoint( wxCoord x1
, wxCoord y1
) ;
585 void AddRectangle( wxCoord x
, wxCoord y
, wxCoord w
, wxCoord h
) ;
586 void AddCircle( wxCoord x
, wxCoord y
, wxCoord r
) ;
588 // closes the current subpath
589 void CloseSubpath() ;
591 CGPathRef
GetPath() const ;
593 CGMutablePathRef m_path
;
596 class WXDLLEXPORT wxMacCGContext
: public wxGraphicContext
598 DECLARE_NO_COPY_CLASS(wxMacCGContext
)
601 wxMacCGContext( CGrafPtr port
) ;
602 wxMacCGContext( CGContextRef cgcontext
) ;
606 virtual void Clip( const wxRegion
®ion
) ;
607 virtual void StrokePath( const wxGraphicPath
*p
) ;
608 virtual void DrawPath( const wxGraphicPath
*p
, int fillStyle
= wxWINDING_RULE
) ;
609 virtual void FillPath( const wxGraphicPath
*p
, const wxColor
&fillColor
, int fillStyle
= wxWINDING_RULE
) ;
611 virtual wxGraphicPath
* CreatePath() ;
612 virtual void SetPen( const wxPen
&pen
) ;
613 virtual void SetBrush( const wxBrush
&brush
) ;
614 CGContextRef
GetNativeContext() ;
615 void SetNativeContext( CGContextRef cg
) ;
616 CGPathDrawingMode
GetDrawingMode() const { return m_mode
; }
618 CGContextRef m_cgContext
;
620 CGPathDrawingMode m_mode
;
625 CGColorSpaceRef
wxMacGetGenericRGBColorSpace(void) ;
626 void wxMacMemoryBufferReleaseProc(void *info
, const void *data
, size_t size
) ;
628 #endif // wxMAC_USE_CORE_GRAPHICS
630 class WXDLLEXPORT wxBitmapRefData
: public wxGDIRefData
632 DECLARE_NO_COPY_CLASS(wxBitmapRefData
)
634 friend class WXDLLEXPORT wxIcon
;
635 friend class WXDLLEXPORT wxCursor
;
637 wxBitmapRefData(int width
, int height
, int depth
);
642 bool Ok() const { return m_ok
; }
643 void SetOk( bool isOk
) { m_ok
= isOk
; }
645 void SetWidth( int width
) { m_width
= width
; }
646 void SetHeight( int height
) { m_height
= height
; }
647 void SetDepth( int depth
) { m_depth
= depth
; }
649 int GetWidth() const { return m_width
; }
650 int GetHeight() const { return m_height
; }
651 int GetDepth() const { return m_depth
; }
653 void *GetRawAccess() const ;
654 void *BeginRawAccess() ;
655 void EndRawAccess() ;
657 bool HasAlpha() const { return m_hasAlpha
; }
658 void UseAlpha( bool useAlpha
) ;
662 wxPalette m_bitmapPalette
;
663 #endif // wxUSE_PALETTE
665 wxMask
* m_bitmapMask
; // Optional mask
666 #if wxMAC_USE_CORE_GRAPHICS
667 CGImageRef
CGImageCreate() const ;
670 // returns true if the bitmap has a size that
671 // can be natively transferred into a true icon
672 // if no is returned GetIconRef will still produce
673 // an icon but it will be generated via a PICT and
674 // rescaled to 16 x 16
675 bool HasNativeSize() ;
677 // caller should increase ref count if needed longer
678 // than the bitmap exists
679 IconRef
GetIconRef() ;
681 // returns a Pict from the bitmap content
682 PicHandle
GetPictHandle() ;
683 GWorldPtr
GetHBITMAP(GWorldPtr
* mask
= NULL
) const ;
684 void UpdateAlphaMask() const ;
687 bool Create(int width
, int height
, int depth
) ;
695 wxMemoryBuffer m_memBuf
;
696 int m_rawAccessCount
;
698 #if wxMAC_USE_CORE_GRAPHICS
699 mutable CGImageRef m_cgImageRef
;
702 PicHandle m_pictHandle
;
704 GWorldPtr m_hMaskBitmap
;
705 wxMemoryBuffer m_maskMemBuf
;
706 int m_maskBytesPerRow
;
709 class WXDLLEXPORT wxIconRefData
: public wxGDIRefData
713 wxIconRefData( WXHICON
) ;
714 virtual ~wxIconRefData() { Free(); }
719 void SetWidth( int width
) { m_width
= width
; }
720 void SetHeight( int height
) { m_height
= height
; }
722 int GetWidth() const { return m_width
; }
723 int GetHeight() const { return m_height
; }
725 WXHICON
GetHICON() const { return (WXHICON
) m_iconRef
; }
734 //---------------------------------------------------------------------------
735 // wxMac string conversions
736 //---------------------------------------------------------------------------
738 void wxMacSetupConverters() ;
739 void wxMacCleanupConverters() ;
741 void wxMacStringToPascal( const wxString
&from
, StringPtr to
) ;
742 wxString
wxMacMakeStringFromPascal( ConstStringPtr from
) ;
746 ControlRef
wxMacFindControlUnderMouse( wxTopLevelWindowMac
* toplevelWindow
, Point location
, WindowRef window
, ControlPartCode
*outPart
) ;
750 wxString
wxMacFSRefToPath( const FSRef
*fsRef
, CFStringRef additionalPathComponent
= NULL
) ;
751 OSStatus
wxMacPathToFSRef( const wxString
&path
, FSRef
*fsRef
) ;
752 wxString
wxMacHFSUniStrToString( ConstHFSUniStr255Param uniname
) ;