]> git.saurik.com Git - wxWidgets.git/blob - include/wx/mac/private.h
removed unneeded ;
[wxWidgets.git] / include / wx / mac / private.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: private.h
3 // Purpose: Private declarations: as this header is only included by
4 // wxWindows itself, it may contain identifiers which don't start
5 // with "wx".
6 // Author: Stefan Csomor
7 // Modified by:
8 // Created: ??/??/98
9 // RCS-ID: $Id$
10 // Copyright: (c) Stefan Csomor
11 // Licence: wxWindows licence
12 /////////////////////////////////////////////////////////////////////////////
13
14 #ifndef _WX_PRIVATE_H_
15 #define _WX_PRIVATE_H_
16
17 #include "wx/defs.h"
18 #include "wx/window.h"
19
20 #if defined(__POWERPC__) && defined(__DARWIN__)
21 #include <Carbon/Carbon.h>
22 #else
23 #include "MacHeaders.c"
24 #endif
25 #if UNIVERSAL_INTERFACES_VERSION < 0x0340
26 #error "please update to Apple's lastest universal headers from http://developer.apple.com/sdk/"
27 #endif
28
29 class wxMacPortStateHelper
30 {
31 public :
32 wxMacPortStateHelper( GrafPtr newport) ;
33 wxMacPortStateHelper() ;
34 ~wxMacPortStateHelper() ;
35
36 void Setup( GrafPtr newport ) ;
37 void Clear() ;
38 bool IsCleared() { return m_clip == NULL ; }
39 GrafPtr GetCurrentPort() { return m_currentPort ; }
40
41 private :
42 GrafPtr m_currentPort ;
43 GrafPtr m_oldPort ;
44 RgnHandle m_clip ;
45 ThemeDrawingState m_drawingState ;
46 short m_textFont ;
47 short m_textSize ;
48 short m_textStyle ;
49 short m_textMode ;
50 } ;
51
52 class WXDLLEXPORT wxMacPortSetter
53 {
54 public :
55 wxMacPortSetter( const wxDC* dc ) ;
56 ~wxMacPortSetter() ;
57 private :
58 wxMacPortStateHelper m_ph ;
59 } ;
60
61 class wxMacDrawingHelper
62 {
63 public :
64 wxMacDrawingHelper( wxWindowMac * theWindow , bool clientArea = false ) ;
65 ~wxMacDrawingHelper() ;
66 bool Ok() { return m_ok ; }
67 void LocalToWindow( Rect *rect) { OffsetRect( rect , m_origin.h , m_origin.v ) ; }
68 void LocalToWindow( Point *pt ) { AddPt( m_origin , pt ) ; }
69 void LocalToWindow( RgnHandle rgn ) { OffsetRgn( rgn , m_origin.h , m_origin.v ) ; }
70 const Point& GetOrigin() { return m_origin ; }
71 private :
72 Point m_origin ;
73 GrafPtr m_formerPort ;
74 GrafPtr m_currentPort ;
75 PenState m_savedPenState ;
76 bool m_ok ;
77 } ;
78
79
80 // filefn.h
81 WXDLLEXPORT wxString wxMacFSSpec2MacFilename( const FSSpec *spec ) ;
82 WXDLLEXPORT void wxMacFilename2FSSpec( const char *path , FSSpec *spec ) ;
83 # ifndef __DARWIN__
84 // Mac file names are POSIX (Unix style) under Darwin, so these are not needed
85 WXDLLEXPORT wxString wxMacFSSpec2UnixFilename( const FSSpec *spec ) ;
86 WXDLLEXPORT void wxUnixFilename2FSSpec( const char *path , FSSpec *spec ) ;
87 WXDLLEXPORT wxString wxMac2UnixFilename( const char *s) ;
88 WXDLLEXPORT wxString wxUnix2MacFilename( const char *s);
89 # endif
90
91 // utils.h
92 WXDLLEXPORT wxString wxMacFindFolder(short vRefNum,
93 OSType folderType,
94 Boolean createFolder);
95
96 GWorldPtr wxMacCreateGWorld( int width , int height , int depth ) ;
97 void wxMacDestroyGWorld( GWorldPtr gw ) ;
98 PicHandle wxMacCreatePict( GWorldPtr gw , GWorldPtr mask = NULL ) ;
99 CIconHandle wxMacCreateCIcon(GWorldPtr image , GWorldPtr mask , short dstDepth , short iconSize ) ;
100 void wxMacSetColorTableEntry( CTabHandle newColors , int index , int red , int green , int blue ) ;
101 CTabHandle wxMacCreateColorTable( int numColors ) ;
102
103 #define MAC_WXCOLORREF(a) (*((RGBColor*)&(a)))
104 #define MAC_WXHBITMAP(a) (GWorldPtr(a))
105 #define MAC_WXHMETAFILE(a) (PicHandle(a))
106 #define MAC_WXHICON(a) (CIconHandle(a))
107 #define MAC_WXHCURSOR(a) (CursHandle(a))
108 #define MAC_WXHRGN(a) (RgnHandle(a))
109 #define MAC_WXHWND(a) (WindowPtr(a))
110 #define MAC_WXRECPTR(a) ((Rect*)a)
111 #define MAC_WXPOINTPTR(a) ((Point*)a)
112 #define MAC_WXHMENU(a) ((MenuHandle)a)
113 #endif
114 // _WX_PRIVATE_H_