Mercurial > projects > dwt-mac
annotate dwt/internal/c/Carbon.d @ 123:63a09873578e
Fixed compile errors
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Thu, 15 Jan 2009 23:08:54 +0100 |
parents | 2e671fa40eec |
children |
rev | line source |
---|---|
45 | 1 /** |
2 * Copyright: Copyright (c) 2008 Jacob Carlborg. All rights reserved. | |
3 * Authors: Jacob Carlborg | |
4 * Version: Initial created: Nov 18, 2008 | |
5 * License: $(LINK2 http://opensource.org/licenses/bsd-license.php, BSD Style) | |
6 * | |
7 */ | |
8 module dwt.internal.c.Carbon; | |
9 | |
10 import dwt.dwthelper.utils; | |
11 import bindings = dwt.internal.c.bindings; | |
12 | |
13 // MacTypes.h | |
14 | |
15 /******************************************************************************** | |
16 | |
17 Base integer types for all target OS's and CPU's | |
18 | |
19 UInt8 8-bit unsigned integer | |
20 SInt8 8-bit signed integer | |
21 UInt16 16-bit uinteger | |
22 SInt16 16-bit signed integer | |
23 UInt32 32-bit uinteger | |
24 SInt32 32-bit signed integer | |
25 UInt64 64-bit uinteger | |
26 SInt64 64-bit integer | |
27 | |
28 *********************************************************************************/ | |
29 alias ubyte UInt8; | |
30 alias byte SInt8; | |
31 alias ushort UInt16; | |
32 alias short SInt16; | |
33 alias uint UInt32; | |
34 alias int SInt32; | |
35 alias ulong UInt64; | |
36 alias long SInt64; | |
37 | |
38 alias byte uint8_t; | |
39 | |
40 /******************************************************************************** | |
41 | |
42 Higher level basic types | |
43 | |
44 OSErr 16-bit result error code | |
45 OSStatus 32-bit result error code | |
46 LogicalAddress Address in the clients virtual address space | |
47 ConstLogicalAddress Address in the clients virtual address space that will only be read | |
48 PhysicalAddress Real address as used on the hardware bus | |
49 BytePtr Pointer to an array of bytes | |
50 ByteCount The size of an array of bytes | |
51 ByteOffset An offset into an array of bytes | |
52 ItemCount 32-bit iteration count | |
53 OptionBits Standard 32-bit set of bit flags | |
54 PBVersion ? | |
55 Duration 32-bit millisecond timer for drivers | |
56 AbsoluteTime 64-bit clock | |
57 ScriptCode A particular set of written characters (e.g. Roman vs Cyrillic) and their encoding | |
58 LangCode A particular language (e.g. English), as represented using a particular ScriptCode | |
59 RegionCode Designates a language as used in a particular region (e.g. British vs American | |
60 English) together with other region-dependent characteristics (e.g. date format) | |
61 FourCharCode A 32-bit value made by packing four 1 byte characters together | |
62 OSType A FourCharCode used in the OS and file system (e.g. creator) | |
63 ResType A FourCharCode used to tag resources (e.g. 'DLOG') | |
64 | |
65 *********************************************************************************/ | |
66 alias SInt16 OSErr; | |
67 alias SInt32 OSStatus; | |
68 alias void* LogicalAddress; | |
69 alias /*const*/void* ConstLogicalAddress; | |
70 alias void* PhysicalAddress; | |
71 alias UInt8* BytePtr; | |
72 alias uint ByteCount; | |
73 alias uint ByteOffset; | |
74 alias SInt32 Duration; | |
75 alias UnsignedWide AbsoluteTime; | |
76 alias UInt32 OptionBits; | |
77 alias uint ItemCount; | |
78 alias UInt32 PBVersion; | |
79 alias SInt16 ScriptCode; | |
80 alias SInt16 LangCode; | |
81 alias SInt16 RegionCode; | |
82 alias UInt32 FourCharCode; | |
83 alias FourCharCode OSType; | |
84 alias FourCharCode ResType; | |
85 alias OSType* OSTypePtr; | |
86 alias ResType* ResTypePtr; | |
87 | |
88 struct UnsignedWide | |
89 { | |
90 uint hi; | |
91 uint lo; | |
92 } | |
93 | |
94 struct ProcessSerialNumber | |
95 { | |
96 uint highLongOfPSN; | |
97 uint lowLongOfPSN; | |
98 } | |
99 | |
100 struct CPSProcessSerNum | |
101 { | |
102 uint lo; | |
103 uint hi; | |
104 } | |
105 | |
106 alias ProcessSerialNumber * ProcessSerialNumberPtr; | |
107 | |
108 | |
123 | 109 |
45 | 110 // Appearance.h |
111 enum ThemeCursor : uint | |
112 { | |
113 kThemeArrowCursor = 0, | |
114 kThemeCopyArrowCursor = 1, | |
115 kThemeAliasArrowCursor = 2, | |
116 kThemeContextualMenuArrowCursor = 3, | |
117 kThemeIBeamCursor = 4, | |
118 kThemeCrossCursor = 5, | |
119 kThemePlusCursor = 6, | |
120 kThemeWatchCursor = 7, | |
121 kThemeClosedHandCursor = 8, | |
122 kThemeOpenHandCursor = 9, | |
123 kThemePointingHandCursor = 10, | |
124 kThemeCountingUpHandCursor = 11, | |
125 kThemeCountingDownHandCursor = 12, | |
126 kThemeCountingUpAndDownHandCursor = 13, | |
127 kThemeSpinningCursor = 14, | |
128 kThemeResizeLeftCursor = 15, | |
129 kThemeResizeRightCursor = 16, | |
130 kThemeResizeLeftRightCursor = 17, | |
131 kThemeNotAllowedCursor = 18, | |
132 kThemeResizeUpCursor = 19, | |
133 kThemeResizeDownCursor = 20, | |
134 kThemeResizeUpDownCursor = 21, | |
135 kThemePoofCursor = 22 | |
136 } | |
137 | |
138 alias bindings.SetThemeCursor SetThemeCursor; | |
139 | |
140 | |
141 | |
142 // CABase.h | |
143 static if ((void*).sizeof > int.sizeof) // 64bit target | |
144 alias double CGFloat; | |
145 | |
146 else | |
147 alias float CGFloat; | |
148 | |
149 | |
150 | |
151 // CarbonEventsCore.h | |
152 alias bindings.GetCurrentButtonState GetCurrentButtonState; | |
153 | |
154 | |
155 | |
156 // CFBase.h | |
157 alias void* CFTypeRef; | |
158 alias void* __CFAllocator; | |
159 alias __CFAllocator* CFAllocatorRef; | |
160 alias void* __CFString; | |
161 alias __CFString* CFStringRef; | |
162 | |
163 alias bindings.CFRelease CFRelease; | |
164 | |
165 | |
166 | |
167 // CFNumberFormatter.h | |
168 enum | |
169 { | |
170 kCFNumberFormatterPadBeforePrefix = 0, | |
171 kCFNumberFormatterPadAfterPrefix = 1, | |
172 kCFNumberFormatterPadBeforeSuffix = 2, | |
173 kCFNumberFormatterPadAfterSuffix = 3 | |
174 } | |
175 | |
176 enum CFNumberFormatterRoundingMode | |
177 { | |
178 kCFNumberFormatterRoundCeiling = 0, | |
179 kCFNumberFormatterRoundFloor = 1, | |
180 kCFNumberFormatterRoundDown = 2, | |
181 kCFNumberFormatterRoundUp = 3, | |
182 kCFNumberFormatterRoundHalfEven = 4, | |
183 kCFNumberFormatterRoundHalfDown = 5, | |
184 kCFNumberFormatterRoundHalfUp = 6 | |
185 } | |
186 | |
187 enum | |
188 { | |
189 kCFNumberFormatterNoStyle = 0, | |
190 kCFNumberFormatterDecimalStyle = 1, | |
191 kCFNumberFormatterCurrencyStyle = 2, | |
192 kCFNumberFormatterPercentStyle = 3, | |
193 kCFNumberFormatterScientificStyle = 4, | |
194 kCFNumberFormatterSpellOutStyle = 5 | |
195 } | |
196 | |
197 | |
198 | |
199 //CFPropertyList.h | |
200 enum CFPropertyListFormat | |
201 { | |
202 kCFPropertyListOpenStepFormat = 1, | |
203 kCFPropertyListXMLFormat_v1_0 = 100, | |
204 kCFPropertyListBinaryFormat_v1_0 = 200 | |
205 } | |
206 | |
207 enum CFPropertyListMutabilityOptions | |
208 { | |
209 kCFPropertyListImmutable = 0, | |
210 kCFPropertyListMutableContainers = 1, | |
211 kCFPropertyListMutableContainersAndLeaves = 2 | |
212 } | |
213 | |
214 | |
215 | |
216 // CFRunLoop.h | |
217 alias void* __CFRunLoop; | |
218 alias __CFRunLoop* CFRunLoopRef; | |
219 | |
220 | |
221 | |
123 | 222 // CFString.h |
223 alias uint CFStringEncoding; | |
224 | |
225 | |
226 | |
45 | 227 // CFURL.h |
228 alias bindings.CFURLCreateStringByAddingPercentEscapes CFURLCreateStringByAddingPercentEscapes; | |
229 | |
230 | |
231 | |
232 // CGColorSpace.h | |
233 alias void* CGColorSpace; | |
234 alias CGColorSpace* CGColorSpaceRef; | |
235 | |
236 | |
237 | |
238 // CGError.h | |
239 alias int CGError; | |
240 | |
241 | |
242 | |
243 // CGEventTypes.h | |
244 alias void* __CGEvent; | |
245 alias __CGEvent* CGEventRef; | |
246 | |
247 | |
248 | |
249 // CGRemoteOperation.h | |
250 alias bindings.CGWarpMouseCursorPosition CGWarpMouseCursorPosition; | |
251 | |
252 | |
253 | |
254 // Gestalt.h | |
255 alias bindings.Gestalt Gestalt; | |
256 | |
257 | |
258 | |
259 // IconsCore.h | |
260 alias void* OpaqueIconRef; | |
261 alias OpaqueIconRef* IconRef; | |
262 | |
263 | |
264 | |
265 // Processes.h | |
266 enum ProcessApplicationTransformState : uint | |
267 { | |
268 kProcessTransformToForegroundApplication = 1 | |
269 } | |
270 | |
271 alias bindings.GetCurrentProcess GetCurrentProcess; | |
272 alias bindings.SetFrontProcess SetFrontProcess; | |
273 alias bindings.TransformProcessType TransformProcessType; | |
60
62202ce0039f
Updated and fixed many modules to 3.514
Jacob Carlborg <doob@me.com>
parents:
50
diff
changeset
|
274 alias bindings.CPSSetProcessName CPSSetProcessName; |
45 | 275 |
276 | |
277 | |
278 // Quickdraw.h | |
279 struct Rect | |
280 { | |
281 short top; | |
282 short left; | |
283 short bottom; | |
284 short right; | |
285 } | |
286 | |
287 alias int QDRegionParseDirection; | |
288 alias extern (C) OSStatus function (ushort message, RgnHandle rgn, /*const*/ Rect* rect, void* refCon) RegionToRectsProcPtr; | |
289 alias RegionToRectsProcPtr RegionToRectsUPP; | |
290 | |
291 alias bindings.NewRgn NewRgn; | |
292 alias bindings.RectRgn RectRgn; | |
293 alias bindings.OpenRgn OpenRgn; | |
294 alias bindings.OffsetRgn OffsetRgn; | |
295 alias bindings.MoveTo MoveTo; | |
296 alias bindings.LineTo LineTo; | |
297 alias bindings.UnionRgn UnionRgn; | |
298 alias bindings.CloseRgn CloseRgn; | |
299 alias bindings.DisposeRgn DisposeRgn; | |
300 alias bindings.PtInRgn PtInRgn; | |
301 alias bindings.GetRegionBounds GetRegionBounds; | |
302 alias bindings.SectRgn SectRgn; | |
303 alias bindings.EmptyRgn EmptyRgn; | |
304 alias bindings.DiffRgn DiffRgn; | |
305 alias bindings.RectInRgn RectInRgn; | |
306 alias bindings.QDRegionToRects QDRegionToRects; | |
307 alias bindings.CopyRgn CopyRgn; | |
308 alias bindings.SetRect SetRect; | |
309 | |
310 | |
311 | |
312 // QuickdrawTypes.h | |
313 struct MacRegion | |
314 { | |
315 ushort rgnSize; /* size in bytes; don't rely on it */ | |
316 Rect rgnBBox; /* enclosing rectangle; in Carbon use GetRegionBounds */ | |
317 } | |
318 | |
319 struct Point | |
320 { | |
321 short v; | |
322 short h; | |
323 } | |
324 | |
325 alias MacRegion Region; | |
326 alias MacRegion* RgnPtr; | |
327 alias RgnPtr* RgnHandle; | |
328 | |
329 alias bool Boolean; | |
50 | 330 alias bool BOOL; |
331 | |
332 enum | |
333 { | |
334 kQDRegionToRectsMsgInit = 1, | |
335 kQDRegionToRectsMsgParse = 2, | |
336 kQDRegionToRectsMsgTerminate = 3 | |
337 } | |
338 | |
339 enum | |
340 { | |
341 kQDParseRegionFromTop = (1 << 0), | |
342 kQDParseRegionFromBottom = (1 << 1), | |
343 kQDParseRegionFromLeft = (1 << 2), | |
344 kQDParseRegionFromRight = (1 << 3), | |
345 kQDParseRegionFromTopLeft = kQDParseRegionFromTop | kQDParseRegionFromLeft, | |
346 kQDParseRegionFromBottomRight = kQDParseRegionFromBottom | kQDParseRegionFromRight | |
347 } |