]> git.saurik.com Git - wxWidgets.git/blame - src/mac/carbon/settings.cpp
corrected GetDepth method and wrong disposal calls for pixmap
[wxWidgets.git] / src / mac / carbon / settings.cpp
CommitLineData
e9576ca5
SC
1/////////////////////////////////////////////////////////////////////////////
2// Name: settings.cpp
3// Purpose: wxSettings
4// Author: AUTHOR
5// Modified by:
6// Created: ??/??/98
7// RCS-ID: $Id$
8// Copyright: (c) AUTHOR
00500f40 9// Licence: wxWindows licence
e9576ca5
SC
10/////////////////////////////////////////////////////////////////////////////
11
12#ifdef __GNUG__
13#pragma implementation "settings.h"
14#endif
15
16#include "wx/settings.h"
03e11df5 17#include "wx/gdicmn.h"
00500f40 18#include "wx/utils.h"
e9576ca5 19
76a5e5d2
SC
20#include "wx/mac/uma.h"
21
a174f139
GD
22// ----------------------------------------------------------------------------
23// wxSystemSettingsNative
24// ----------------------------------------------------------------------------
25
26// ----------------------------------------------------------------------------
27// colours
28// ----------------------------------------------------------------------------
29
30wxColour wxSystemSettingsNative::GetColour(wxSystemColour index)
e9576ca5 31{
00500f40
RR
32 int major,minor;
33 wxGetOsVersion( &major, &minor );
34
35 switch( index )
36 {
37 case wxSYS_COLOUR_SCROLLBAR :
38 case wxSYS_COLOUR_BACKGROUND:
39 case wxSYS_COLOUR_ACTIVECAPTION:
40 case wxSYS_COLOUR_INACTIVECAPTION:
41 case wxSYS_COLOUR_MENU:
42 case wxSYS_COLOUR_WINDOW:
43 case wxSYS_COLOUR_WINDOWFRAME:
44 case wxSYS_COLOUR_ACTIVEBORDER:
45 case wxSYS_COLOUR_INACTIVEBORDER:
46 case wxSYS_COLOUR_BTNFACE:
47 return wxColor( 0xDD , 0xDD , 0xDD ) ;
48 break ;
519cb848 49
00500f40
RR
50 case wxSYS_COLOUR_LISTBOX :
51 {
52 if (major >= 10)
53 return *wxWHITE ;
54 else
55 return wxColor( 0xEE , 0xEE , 0xEE ) ;
56 break ;
57 }
58 case wxSYS_COLOUR_BTNSHADOW:
59 return wxColor( 0x44 , 0x44 , 0x44 ) ;
60 break ;
519cb848 61
00500f40
RR
62 case wxSYS_COLOUR_BTNTEXT:
63 case wxSYS_COLOUR_MENUTEXT:
64 case wxSYS_COLOUR_WINDOWTEXT:
65 case wxSYS_COLOUR_CAPTIONTEXT:
66 case wxSYS_COLOUR_INFOTEXT:
67 case wxSYS_COLOUR_INACTIVECAPTIONTEXT:
68 return *wxBLACK;
69 break ;
70 case wxSYS_COLOUR_HIGHLIGHT:
71 {
72 RGBColor hilite ;
73 LMGetHiliteRGB(&hilite) ;
74 return wxColor( hilite.red >> 8 , hilite.green >> 8 , hilite.blue >> 8 ) ;
75 }
76 break ;
77 case wxSYS_COLOUR_BTNHIGHLIGHT:
78 case wxSYS_COLOUR_GRAYTEXT:
79 return wxColor( 0xCC , 0xCC , 0xCC ) ;
80 break ;
81
82 case wxSYS_COLOUR_3DDKSHADOW:
83 return wxColor( 0x44 , 0x44 , 0x44 ) ;
84 break ;
85 case wxSYS_COLOUR_3DLIGHT:
86 return wxColor( 0xCC , 0xCC , 0xCC ) ;
87 break ;
88 case wxSYS_COLOUR_HIGHLIGHTTEXT :
89 {
90 RGBColor hilite ;
91 LMGetHiliteRGB(&hilite) ;
92 if ( ( hilite.red + hilite.green + hilite.blue ) == 0 )
93 return *wxWHITE ;
94 else
95 return *wxBLACK ;
96 }
97 break ;
98 case wxSYS_COLOUR_INFOBK :
99 case wxSYS_COLOUR_APPWORKSPACE:
100 return *wxWHITE ;
101 break ;
102 }
103 return *wxWHITE;
e9576ca5
SC
104}
105
a174f139
GD
106// ----------------------------------------------------------------------------
107// fonts
108// ----------------------------------------------------------------------------
109
110wxFont wxSystemSettingsNative::GetFont(wxSystemFont index)
e9576ca5 111{
e9576ca5
SC
112 switch (index)
113 {
519cb848
SC
114 case wxSYS_ANSI_VAR_FONT :
115 case wxSYS_SYSTEM_FONT :
116 case wxSYS_DEVICE_DEFAULT_FONT :
117 case wxSYS_DEFAULT_GUI_FONT :
00500f40
RR
118 {
119 return *wxSMALL_FONT ;
120 } ;
121 break ;
519cb848
SC
122 case wxSYS_OEM_FIXED_FONT :
123 case wxSYS_ANSI_FIXED_FONT :
124 case wxSYS_SYSTEM_FIXED_FONT :
125 default :
00500f40
RR
126 {
127 return *wxNORMAL_FONT ;
128 } ;
129 break ;
130
e9576ca5 131 }
519cb848 132 return *wxNORMAL_FONT;
e9576ca5
SC
133}
134
a174f139
GD
135// ----------------------------------------------------------------------------
136// system metrics/features
137// ----------------------------------------------------------------------------
138
e9576ca5 139// Get a system metric, e.g. scrollbar size
a174f139 140int wxSystemSettingsNative::GetMetric(wxSystemMetric index)
e9576ca5 141{
00500f40
RR
142 switch ( index)
143 {
e9576ca5 144 case wxSYS_MOUSE_BUTTONS:
00500f40 145 return 2; // we emulate a two button mouse (ctrl + click = right button )
e9576ca5
SC
146 case wxSYS_BORDER_X:
147 // TODO
00500f40 148 return 0;
e9576ca5
SC
149 case wxSYS_BORDER_Y:
150 // TODO
00500f40 151 return 0;
e9576ca5
SC
152 case wxSYS_CURSOR_X:
153 // TODO
00500f40 154 return 0;
e9576ca5
SC
155 case wxSYS_CURSOR_Y:
156 // TODO
00500f40 157 return 0;
e9576ca5
SC
158 case wxSYS_DCLICK_X:
159 // TODO
00500f40 160 return 0;
e9576ca5
SC
161 case wxSYS_DCLICK_Y:
162 // TODO
00500f40 163 return 0;
e9576ca5
SC
164 case wxSYS_DRAG_X:
165 // TODO
00500f40 166 return 0;
e9576ca5
SC
167 case wxSYS_DRAG_Y:
168 // TODO
00500f40 169 return 0;
e9576ca5
SC
170 case wxSYS_EDGE_X:
171 // TODO
00500f40 172 return 0;
e9576ca5
SC
173 case wxSYS_EDGE_Y:
174 // TODO
00500f40 175 return 0;
e9576ca5 176 case wxSYS_HSCROLL_ARROW_X:
a174f139 177 return 16;
e9576ca5 178 case wxSYS_HSCROLL_ARROW_Y:
a174f139 179 return 16;
e9576ca5 180 case wxSYS_HTHUMB_X:
a174f139 181 return 16;
e9576ca5
SC
182 case wxSYS_ICON_X:
183 // TODO
00500f40 184 return 0;
e9576ca5
SC
185 case wxSYS_ICON_Y:
186 // TODO
00500f40 187 return 0;
e9576ca5
SC
188 case wxSYS_ICONSPACING_X:
189 // TODO
00500f40 190 return 0;
e9576ca5
SC
191 case wxSYS_ICONSPACING_Y:
192 // TODO
00500f40 193 return 0;
e9576ca5
SC
194 case wxSYS_WINDOWMIN_X:
195 // TODO
00500f40 196 return 0;
e9576ca5
SC
197 case wxSYS_WINDOWMIN_Y:
198 // TODO
00500f40 199 return 0;
e9576ca5
SC
200 case wxSYS_SCREEN_X:
201 // TODO
00500f40 202 return 0;
e9576ca5
SC
203 case wxSYS_SCREEN_Y:
204 // TODO
00500f40 205 return 0;
e9576ca5
SC
206 case wxSYS_FRAMESIZE_X:
207 // TODO
00500f40 208 return 0;
e9576ca5
SC
209 case wxSYS_FRAMESIZE_Y:
210 // TODO
00500f40 211 return 0;
e9576ca5
SC
212 case wxSYS_SMALLICON_X:
213 // TODO
00500f40 214 return 0;
e9576ca5
SC
215 case wxSYS_SMALLICON_Y:
216 // TODO
00500f40 217 return 0;
e9576ca5 218 case wxSYS_HSCROLL_Y:
a174f139 219 return 16;
e9576ca5 220 case wxSYS_VSCROLL_X:
a174f139 221 return 16;
e9576ca5 222 case wxSYS_VSCROLL_ARROW_X:
a174f139 223 return 16;
e9576ca5 224 case wxSYS_VSCROLL_ARROW_Y:
a174f139 225 return 16;
e9576ca5 226 case wxSYS_VTHUMB_Y:
a174f139 227 return 16;
e9576ca5
SC
228 case wxSYS_CAPTION_Y:
229 // TODO
a174f139 230 return 0;
e9576ca5
SC
231 case wxSYS_MENU_Y:
232 // TODO
a174f139 233 return 0;
e9576ca5
SC
234 case wxSYS_NETWORK_PRESENT:
235 // TODO
a174f139 236 return 0;
e9576ca5 237 case wxSYS_PENWINDOWS_PRESENT:
a174f139 238 return 0;
e9576ca5
SC
239 case wxSYS_SHOW_SOUNDS:
240 // TODO
00500f40 241 return 0;
e9576ca5 242 case wxSYS_SWAP_BUTTONS:
a174f139
GD
243 return 0;
244 default:
245 return 0;
00500f40
RR
246 }
247 return 0;
e9576ca5
SC
248}
249
a174f139 250bool wxSystemSettingsNative::HasFeature(wxSystemFeature index)
253293c1
VS
251{
252 switch (index)
253 {
254 case wxSYS_CAN_ICONIZE_FRAME:
255 case wxSYS_CAN_DRAW_FRAME_DECORATIONS:
a174f139
GD
256 return TRUE;
257
253293c1
VS
258 default:
259 return FALSE;
260 }
261}