2
File: HIToolbox/HIGeometry.h
4
Contains: HIToolbox interfaces for geometry
6
Version: HIToolbox-219.4.81~2
8
Copyright: � 1984-2005 by Apple Computer, Inc., all rights reserved.
10
Bugs?: For bug reports, consult the following page on
13
http://www.freepascal.org/bugs.html
16
{ Pascal Translation: Peter N Lewis, <peter@stairways.com.au>, August 2005 }
18
Modified for use with Free Pascal
20
Please report any bugs to <gpc@microbizz.nl>
31
{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
32
{$setc GAP_INTERFACES_VERSION := $0200}
34
{$ifc not defined USE_CFSTR_CONSTANT_MACROS}
35
{$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
38
{$ifc defined CPUPOWERPC and defined CPUI386}
39
{$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
41
{$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
42
{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
45
{$ifc not defined __ppc__ and defined CPUPOWERPC}
50
{$ifc not defined __i386__ and defined CPUI386}
56
{$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
57
{$error Conflicting definitions for __ppc__ and __i386__}
60
{$ifc defined __ppc__ and __ppc__}
61
{$setc TARGET_CPU_PPC := TRUE}
62
{$setc TARGET_CPU_X86 := FALSE}
63
{$elifc defined __i386__ and __i386__}
64
{$setc TARGET_CPU_PPC := FALSE}
65
{$setc TARGET_CPU_X86 := TRUE}
67
{$error Neither __ppc__ nor __i386__ is defined.}
69
{$setc TARGET_CPU_PPC_64 := FALSE}
71
{$ifc defined FPC_BIG_ENDIAN}
72
{$setc TARGET_RT_BIG_ENDIAN := TRUE}
73
{$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
74
{$elifc defined FPC_LITTLE_ENDIAN}
75
{$setc TARGET_RT_BIG_ENDIAN := FALSE}
76
{$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
78
{$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
80
{$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
81
{$setc CALL_NOT_IN_CARBON := FALSE}
82
{$setc OLDROUTINENAMES := FALSE}
83
{$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
84
{$setc OPAQUE_UPP_TYPES := TRUE}
85
{$setc OTCARBONAPPLICATION := TRUE}
86
{$setc OTKERNEL := FALSE}
87
{$setc PM_USE_SESSION_APIS := TRUE}
88
{$setc TARGET_API_MAC_CARBON := TRUE}
89
{$setc TARGET_API_MAC_OS8 := FALSE}
90
{$setc TARGET_API_MAC_OSX := TRUE}
91
{$setc TARGET_CARBON := TRUE}
92
{$setc TARGET_CPU_68K := FALSE}
93
{$setc TARGET_CPU_MIPS := FALSE}
94
{$setc TARGET_CPU_SPARC := FALSE}
95
{$setc TARGET_OS_MAC := TRUE}
96
{$setc TARGET_OS_UNIX := FALSE}
97
{$setc TARGET_OS_WIN32 := FALSE}
98
{$setc TARGET_RT_MAC_68881 := FALSE}
99
{$setc TARGET_RT_MAC_CFM := FALSE}
100
{$setc TARGET_RT_MAC_MACHO := TRUE}
101
{$setc TYPED_FUNCTION_POINTERS := TRUE}
102
{$setc TYPE_BOOL := FALSE}
103
{$setc TYPE_EXTENDED := FALSE}
104
{$setc TYPE_LONGLONG := TRUE}
105
uses MacTypes,CGGeometry;
115
* HIPoint is a new, floating point-based type to help express
116
* coordinates in a much richer fashion than the classic QuickDraw
117
* points. It will, in time, be more heavily used throughout the
118
* Toolbox. For now, it is replacing our use of typeQDPoint in mouse
119
* events. This is to better support sub-pixel tablet coordinates.
120
* If you ask for a mouse location with typeQDPoint, and the point
121
* is actually stored as typeHIPoint, it will automatically be
122
* coerced to typeQDPoint for you, so this change should be largely
123
* transparent to applications. HIPoints are in screen space, i.e.
124
* the top left of the screen is 0, 0.
128
HIPointPtr = ^HIPoint;
134
* HISize is a floating point-based type to help express dimensions
135
* in a much richer fashion than the classic QuickDraw coordinates.
145
* HIRect is a new, floating point-based type to help express
146
* rectangles in a much richer fashion than the classic QuickDraw
147
* rects. It will, in time, be more heavily used throughout the
148
* Toolbox. HIRects are in screen space, i.e. the top left of the
158
* Returns the resolution independence scale factor.
160
* Mac OS X threading:
164
* A float indicating the resolution independence scale factor.
167
* Mac OS X: in version 10.4 and later in Carbon.framework
168
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
169
* Non-Carbon CFM: not available
171
function HIGetScaleFactor: Float32; external name '_HIGetScaleFactor';
172
(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
179
* Coordinate spaces for use with HIPointConvert, HIRectConvert, and
183
HICoordinateSpace = UInt32;
186
* The coordinate space defined by the position and sizes of the
187
* screen GDevices. More correctly, this is a 72 DPI coordinate space
188
* covering the screens. When the scale factor is not 1.0, this is
189
* the compatibility notion of global coordinates. When the scale
190
* factor is 1.0, this and kHICoordSpaceScreenPixel are the same.
192
kHICoordSpace72DPIGlobal = 1;
195
* The coordinate space defined by physical screen pixels. When the
196
* scale factor is 1.0, this and kHICoordSpace72DPIGlobal are the
199
kHICoordSpaceScreenPixel = 2;
202
* The coordinate space of a specified WindowRef, with ( 0, 0 ) at
203
* the top left of the window's structure. When this is passed to a
204
* conversion routine as a source or destination coordinate space,
205
* you must also pass a WindowRef as a source or destination object.
207
kHICoordSpaceWindow = 3;
210
* The coordinate space of a given HIViewRef, with ( 0, 0 ) at the
211
* top left of the view unless changed by HIViewSetBoundsOrigin. When
212
* this is passed to a conversion routine as a source or destination
213
* coordinate space, you must also pass an HIViewRef as a source or
214
* destination object.
216
kHICoordSpaceView = 4;
222
* This routine converts an HIPoint from one coordinate space to
223
* another. It takes into account the resolution-independent display
224
* scale factor as appropriate.
226
* Mac OS X threading:
232
* The HIPoint to convert.
235
* The HICoordinateSpace constant specifying the source coordinate
236
* space that the point is to be converted from. Some coordinate
237
* spaces require the caller to pass extra information in the
238
* inSourceObject parameter.
241
* An specific object defining the source coordinate space that
242
* the point is to be converted from. You might pass a WindowRef
243
* or an HIViewRef. If no object is necessary, you must pass NULL.
244
* See the HICoordinateSpace documentation for details on which
245
* HICoordinateSpaces require objects.
247
* inDestinationSpace:
248
* The HICoordinateSpace constant specifying the destination
249
* coordinate space that the point is to be converted to. Some
250
* coordinate spaces require the caller to pass extra information
251
* in the inDestinationObject parameter.
253
* inDestinationObject:
254
* An specific object defining the destination coordinate space
255
* that the point is to be converted to. You might pass a
256
* WindowRef or an HIViewRef. If no object is necessary, you must
257
* pass NULL. See the HICoordinateSpace documentation for details
258
* on which HICoordinateSpaces require objects.
261
* Mac OS X: in version 10.4 and later in Carbon.framework
262
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
263
* Non-Carbon CFM: not available
265
procedure HIPointConvert( var ioPoint: HIPoint; inSourceSpace: HICoordinateSpace; inSourceObject: UnivPtr { can be NULL }; inDestinationSpace: HICoordinateSpace; inDestinationObject: UnivPtr { can be NULL } ); external name '_HIPointConvert';
266
(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
273
* This routine converts an HIRect from one coordinate space to
274
* another. It takes into account the resolution-independent display
275
* scale factor as appropriate.
277
* Mac OS X threading:
283
* The HIRect to convert.
286
* The HICoordinateSpace constant specifying the source coordinate
287
* space that the rect is to be converted from. Some coordinate
288
* spaces require the caller to pass extra information in the
289
* inSourceObject parameter.
292
* An specific object defining the source coordinate space that
293
* the rect is to be converted from. You might pass a WindowRef or
294
* an HIViewRef. If no object is necessary, you must pass NULL.
295
* See the HICoordinateSpace documentation for details on which
296
* HICoordinateSpaces require objects.
298
* inDestinationSpace:
299
* The HICoordinateSpace constant specifying the destination
300
* coordinate space that the rect is to be converted to. Some
301
* coordinate spaces require the caller to pass extra information
302
* in the inDestinationObject parameter.
304
* inDestinationObject:
305
* An specific object defining the destination coordinate space
306
* that the rect is to be converted to. You might pass a WindowRef
307
* or an HIViewRef. If no object is necessary, you must pass NULL.
308
* See the HICoordinateSpace documentation for details on which
309
* HICoordinateSpaces require objects.
312
* Mac OS X: in version 10.4 and later in Carbon.framework
313
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
314
* Non-Carbon CFM: not available
316
procedure HIRectConvert( var ioRect: HIRect; inSourceSpace: HICoordinateSpace; inSourceObject: UnivPtr { can be NULL }; inDestinationSpace: HICoordinateSpace; inDestinationObject: UnivPtr { can be NULL } ); external name '_HIRectConvert';
317
(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
324
* This routine converts an HISize from one coordinate space to
325
* another. It takes into account the resolution-independent display
326
* scale factor as appropriate.
328
* Mac OS X threading:
334
* The HISize to convert.
337
* The HICoordinateSpace constant specifying the source coordinate
338
* space that the size is to be converted from. Some coordinate
339
* spaces require the caller to pass extra information in the
340
* inSourceObject parameter.
343
* An specific object defining the source coordinate space that
344
* the size is to be converted from. You might pass a WindowRef or
345
* an HIViewRef. If no object is necessary, you must pass NULL.
346
* See the HICoordinateSpace documentation for details on which
347
* HICoordinateSpaces require objects.
349
* inDestinationSpace:
350
* The HICoordinateSpace constant specifying the destination
351
* coordinate space that the size is to be converted to. Some
352
* coordinate spaces require the caller to pass extra information
353
* in the inDestinationObject parameter.
355
* inDestinationObject:
356
* An specific object defining the destination coordinate space
357
* that the size is to be converted to. You might pass a WindowRef
358
* or an HIViewRef. If no object is necessary, you must pass NULL.
359
* See the HICoordinateSpace documentation for details on which
360
* HICoordinateSpaces require objects.
363
* Mac OS X: in version 10.4 and later in Carbon.framework
364
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
365
* Non-Carbon CFM: not available
367
procedure HISizeConvert( var ioSize: HISize; inSourceSpace: HICoordinateSpace; inSourceObject: UnivPtr { can be NULL }; inDestinationSpace: HICoordinateSpace; inDestinationObject: UnivPtr { can be NULL } ); external name '_HISizeConvert';
368
(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)