1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Private declarations: as this header is only included by
4 // wxWindows 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_
19 #if defined(__POWERPC__) && defined(__DARWIN__)
20 #include <Carbon/Carbon.h>
22 #include "MacHeaders.c"
24 #if UNIVERSAL_INTERFACES_VERSION < 0x0340
25 #error "please update to Apple's lastest universal headers from http://developer.apple.com/sdk/"
28 class wxMacPortStateHelper
31 wxMacPortStateHelper( GrafPtr newport
) ;
32 wxMacPortStateHelper() ;
33 ~wxMacPortStateHelper() ;
35 void Setup( GrafPtr newport
) ;
37 bool IsCleared() { return m_clip
== NULL
; }
38 GrafPtr
GetCurrentPort() { return m_currentPort
; }
41 GrafPtr m_currentPort
;
44 ThemeDrawingState m_drawingState
;
51 class WXDLLEXPORT wxMacPortSetter
54 wxMacPortSetter( const wxDC
* dc
) ;
57 wxMacPortStateHelper m_ph
;
60 class wxMacDrawingHelper
63 wxMacDrawingHelper( wxWindowMac
* theWindow
, bool clientArea
= false ) ;
64 ~wxMacDrawingHelper() ;
65 bool Ok() { return m_ok
; }
66 void LocalToWindow( Rect
*rect
) { OffsetRect( rect
, m_origin
.h
, m_origin
.v
) ; }
67 void LocalToWindow( Point
*pt
) { AddPt( m_origin
, pt
) ; }
68 void LocalToWindow( RgnHandle rgn
) { OffsetRgn( rgn
, m_origin
.h
, m_origin
.v
) ; }
69 const Point
& GetOrigin() { return m_origin
; }
72 GrafPtr m_formerPort
;
73 GrafPtr m_currentPort
;
74 PenState m_savedPenState
;
80 WXDLLEXPORT wxString
wxMacFSSpec2MacFilename( const FSSpec
*spec
) ;
81 WXDLLEXPORT
void wxMacFilename2FSSpec( const char *path
, FSSpec
*spec
) ;
83 // Mac file names are POSIX (Unix style) under Darwin, so these are not needed
84 WXDLLEXPORT wxString
wxMacFSSpec2UnixFilename( const FSSpec
*spec
) ;
85 WXDLLEXPORT
void wxUnixFilename2FSSpec( const char *path
, FSSpec
*spec
) ;
86 WXDLLEXPORT wxString
wxMac2UnixFilename( const char *s
) ;
87 WXDLLEXPORT wxString
wxUnix2MacFilename( const char *s
);
91 WXDLLEXPORT wxString
wxMacFindFolder(short vRefNum
,
93 Boolean createFolder
);
95 GWorldPtr
wxMacCreateGWorld( int width
, int height
, int depth
) ;
96 void wxMacDestroyGWorld( GWorldPtr gw
) ;
97 PicHandle
wxMacCreatePict( GWorldPtr gw
, GWorldPtr mask
= NULL
) ;
98 CIconHandle
wxMacCreateCIcon(GWorldPtr image
, GWorldPtr mask
, short dstDepth
, short iconSize
) ;
99 void wxMacSetColorTableEntry( CTabHandle newColors
, int index
, int red
, int green
, int blue
) ;
100 CTabHandle
wxMacCreateColorTable( int numColors
) ;
102 #define MAC_WXCOLORREF(a) (*((RGBColor*)&(a)))
103 #define MAC_WXHBITMAP(a) (GWorldPtr(a))
104 #define MAC_WXHMETAFILE(a) (PicHandle(a))
105 #define MAC_WXHICON(a) (CIconHandle(a))
106 #define MAC_WXHCURSOR(a) (CursHandle(a))
107 #define MAC_WXHRGN(a) (RgnHandle(a))
108 #define MAC_WXHWND(a) (WindowPtr(a))
109 #define MAC_WXRECPTR(a) ((Rect*)a)
110 #define MAC_WXPOINTPTR(a) ((Point*)a)
111 #define MAC_WXHMENU(a) ((MenuHandle)a)