]> git.saurik.com Git - wxWidgets.git/blame - include/wx/mac/private.h
common value change method
[wxWidgets.git] / include / wx / mac / private.h
CommitLineData
0dbd6262
SC
1/////////////////////////////////////////////////////////////////////////////
2// Name: private.h
5273bf2f
SC
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
0dbd6262
SC
7// Modified by:
8// Created: ??/??/98
9// RCS-ID: $Id$
5273bf2f 10// Copyright: (c) Stefan Csomor
0dbd6262
SC
11// Licence: wxWindows licence
12/////////////////////////////////////////////////////////////////////////////
13
14#ifndef _WX_PRIVATE_H_
15#define _WX_PRIVATE_H_
16
17#include "wx/defs.h"
18
5273bf2f 19#if defined(__POWERPC__) && defined(__DARWIN__)
fa9d617b
GD
20# include <Carbon/Carbon.h>
21# define TARGET_CARBON 1
5273bf2f 22#else
5921f83f
SC
23# include <Quickdraw.h>
24# include <Appearance.h>
25# include <Folders.h>
26# include <Controls.h>
27# include <ControlDefinitions.h>
28# include <LowMem.h>
29# include <Gestalt.h>
5273bf2f 30#endif
5921f83f 31
5273bf2f
SC
32#if UNIVERSAL_INTERFACES_VERSION < 0x0340
33 #error "please update to Apple's lastest universal headers from http://developer.apple.com/sdk/"
34#endif
35
fa9d617b
GD
36#include "wx/window.h"
37
5273bf2f
SC
38class wxMacPortStateHelper
39{
d84afea9
GD
40 DECLARE_NO_COPY_CLASS(wxMacPortStateHelper)
41
42public:
43 wxMacPortStateHelper( GrafPtr newport) ;
44 wxMacPortStateHelper() ;
45 ~wxMacPortStateHelper() ;
5273bf2f 46
d84afea9
GD
47 void Setup( GrafPtr newport ) ;
48 void Clear() ;
49 bool IsCleared() { return m_clip == NULL ; }
50 GrafPtr GetCurrentPort() { return m_currentPort ; }
5273bf2f 51
d84afea9
GD
52private:
53 GrafPtr m_currentPort ;
54 GrafPtr m_oldPort ;
55 RgnHandle m_clip ;
56 ThemeDrawingState m_drawingState ;
57 short m_textFont ;
58 short m_textSize ;
59 short m_textStyle ;
60 short m_textMode ;
5273bf2f
SC
61} ;
62
63class WXDLLEXPORT wxMacPortSetter
64{
d84afea9
GD
65 DECLARE_NO_COPY_CLASS(wxMacPortSetter)
66
67public:
68 wxMacPortSetter( const wxDC* dc ) ;
69 ~wxMacPortSetter() ;
70private:
71 wxMacPortStateHelper m_ph ;
72 const wxDC* m_dc ;
5273bf2f
SC
73} ;
74
75class wxMacDrawingHelper
76{
d84afea9
GD
77 DECLARE_NO_COPY_CLASS(wxMacDrawingHelper)
78
79public:
80 wxMacDrawingHelper( wxWindowMac * theWindow , bool clientArea = false ) ;
81 ~wxMacDrawingHelper() ;
82 bool Ok() { return m_ok ; }
83 void LocalToWindow( Rect *rect) { OffsetRect( rect , m_origin.h , m_origin.v ) ; }
84 void LocalToWindow( Point *pt ) { AddPt( m_origin , pt ) ; }
85 void LocalToWindow( RgnHandle rgn ) { OffsetRgn( rgn , m_origin.h , m_origin.v ) ; }
86 const Point& GetOrigin() { return m_origin ; }
87private:
88 Point m_origin ;
89 GrafPtr m_formerPort ;
90 GrafPtr m_currentPort ;
91 PenState m_savedPenState ;
92 bool m_ok ;
5273bf2f
SC
93} ;
94
95
96// filefn.h
97WXDLLEXPORT wxString wxMacFSSpec2MacFilename( const FSSpec *spec ) ;
98WXDLLEXPORT void wxMacFilename2FSSpec( const char *path , FSSpec *spec ) ;
99# ifndef __DARWIN__
100// Mac file names are POSIX (Unix style) under Darwin, so these are not needed
101WXDLLEXPORT wxString wxMacFSSpec2UnixFilename( const FSSpec *spec ) ;
102WXDLLEXPORT void wxUnixFilename2FSSpec( const char *path , FSSpec *spec ) ;
103WXDLLEXPORT wxString wxMac2UnixFilename( const char *s) ;
104WXDLLEXPORT wxString wxUnix2MacFilename( const char *s);
105# endif
106
107// utils.h
108WXDLLEXPORT wxString wxMacFindFolder(short vRefNum,
109 OSType folderType,
110 Boolean createFolder);
111
112GWorldPtr wxMacCreateGWorld( int width , int height , int depth ) ;
113void wxMacDestroyGWorld( GWorldPtr gw ) ;
114PicHandle wxMacCreatePict( GWorldPtr gw , GWorldPtr mask = NULL ) ;
115CIconHandle wxMacCreateCIcon(GWorldPtr image , GWorldPtr mask , short dstDepth , short iconSize ) ;
116void wxMacSetColorTableEntry( CTabHandle newColors , int index , int red , int green , int blue ) ;
117CTabHandle wxMacCreateColorTable( int numColors ) ;
22385679 118void wxMacCreateBitmapButton( ControlButtonContentInfo*info , const wxBitmap& bitmap ) ;
0dbd6262 119
5273bf2f
SC
120#define MAC_WXCOLORREF(a) (*((RGBColor*)&(a)))
121#define MAC_WXHBITMAP(a) (GWorldPtr(a))
122#define MAC_WXHMETAFILE(a) (PicHandle(a))
123#define MAC_WXHICON(a) (CIconHandle(a))
124#define MAC_WXHCURSOR(a) (CursHandle(a))
125#define MAC_WXHRGN(a) (RgnHandle(a))
126#define MAC_WXHWND(a) (WindowPtr(a))
127#define MAC_WXRECPTR(a) ((Rect*)a)
128#define MAC_WXPOINTPTR(a) ((Point*)a)
129#define MAC_WXHMENU(a) ((MenuHandle)a)
0dbd6262
SC
130#endif
131 // _WX_PRIVATE_H_