2
Copyright (c) 1999-2005, Apple, Inc. All rights reserved.
4
{ Pascal Translation Updated: Peter N Lewis, <peter@stairways.com.au>, September 2005 }
6
Modified for use with Free Pascal
8
Please report any bugs to <gpc@microbizz.nl>
19
{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
20
{$setc GAP_INTERFACES_VERSION := $0200}
22
{$ifc not defined USE_CFSTR_CONSTANT_MACROS}
23
{$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
26
{$ifc defined CPUPOWERPC and defined CPUI386}
27
{$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
29
{$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
30
{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
33
{$ifc not defined __ppc__ and defined CPUPOWERPC}
38
{$ifc not defined __i386__ and defined CPUI386}
44
{$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
45
{$error Conflicting definitions for __ppc__ and __i386__}
48
{$ifc defined __ppc__ and __ppc__}
49
{$setc TARGET_CPU_PPC := TRUE}
50
{$setc TARGET_CPU_X86 := FALSE}
51
{$elifc defined __i386__ and __i386__}
52
{$setc TARGET_CPU_PPC := FALSE}
53
{$setc TARGET_CPU_X86 := TRUE}
55
{$error Neither __ppc__ nor __i386__ is defined.}
57
{$setc TARGET_CPU_PPC_64 := FALSE}
59
{$ifc defined FPC_BIG_ENDIAN}
60
{$setc TARGET_RT_BIG_ENDIAN := TRUE}
61
{$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
62
{$elifc defined FPC_LITTLE_ENDIAN}
63
{$setc TARGET_RT_BIG_ENDIAN := FALSE}
64
{$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
66
{$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
68
{$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
69
{$setc CALL_NOT_IN_CARBON := FALSE}
70
{$setc OLDROUTINENAMES := FALSE}
71
{$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
72
{$setc OPAQUE_UPP_TYPES := TRUE}
73
{$setc OTCARBONAPPLICATION := TRUE}
74
{$setc OTKERNEL := FALSE}
75
{$setc PM_USE_SESSION_APIS := TRUE}
76
{$setc TARGET_API_MAC_CARBON := TRUE}
77
{$setc TARGET_API_MAC_OS8 := FALSE}
78
{$setc TARGET_API_MAC_OSX := TRUE}
79
{$setc TARGET_CARBON := TRUE}
80
{$setc TARGET_CPU_68K := FALSE}
81
{$setc TARGET_CPU_MIPS := FALSE}
82
{$setc TARGET_CPU_SPARC := FALSE}
83
{$setc TARGET_OS_MAC := TRUE}
84
{$setc TARGET_OS_UNIX := FALSE}
85
{$setc TARGET_OS_WIN32 := FALSE}
86
{$setc TARGET_RT_MAC_68881 := FALSE}
87
{$setc TARGET_RT_MAC_CFM := FALSE}
88
{$setc TARGET_RT_MAC_MACHO := TRUE}
89
{$setc TYPED_FUNCTION_POINTERS := TRUE}
90
{$setc TYPE_BOOL := FALSE}
91
{$setc TYPE_EXTENDED := FALSE}
92
{$setc TYPE_LONGLONG := TRUE}
98
CFBooleanRef = ^SInt32; { an opaque 32-bit type }
99
CFBooleanRefPtr = ^CFBooleanRef;
101
var kCFBooleanTrue: CFBooleanRef; external name '_kCFBooleanTrue'; (* attribute const *)
102
var kCFBooleanFalse: CFBooleanRef; external name '_kCFBooleanFalse'; (* attribute const *)
104
function CFBooleanGetTypeID: CFTypeID; external name '_CFBooleanGetTypeID';
106
function CFBooleanGetValue( value: CFBooleanRef ): Boolean; external name '_CFBooleanGetValue';
109
CFNumberType = SInt32;
111
{ Types from MacTypes.h }
112
kCFNumberSInt8Type = 1;
113
kCFNumberSInt16Type = 2;
114
kCFNumberSInt32Type = 3;
115
kCFNumberSInt64Type = 4;
116
kCFNumberFloat32Type = 5;
117
kCFNumberFloat64Type = 6; { 64-bit IEEE 754 }
119
kCFNumberCharType = 7;
120
kCFNumberShortType = 8;
121
kCFNumberIntType = 9;
122
kCFNumberLongType = 10;
123
kCFNumberLongLongType = 11;
124
kCFNumberFloatType = 12;
125
kCFNumberDoubleType = 13; { Other }
126
kCFNumberCFIndexType = 14;
127
kCFNumberMaxType = 14;
130
CFNumberRef = ^SInt32; { an opaque 32-bit type }
131
CFNumberRefPtr = ^CFNumberRef;
133
var kCFNumberPositiveInfinity: CFNumberRef; external name '_kCFNumberPositiveInfinity'; (* attribute const *)
134
var kCFNumberNegativeInfinity: CFNumberRef; external name '_kCFNumberNegativeInfinity'; (* attribute const *)
135
var kCFNumberNaN: CFNumberRef; external name '_kCFNumberNaN'; (* attribute const *)
137
function CFNumberGetTypeID: CFTypeID; external name '_CFNumberGetTypeID';
140
Creates a CFNumber with the given value. The type of number pointed
141
to by the valuePtr is specified by type. If type is a floating point
142
type and the value represents one of the infinities or NaN, the
143
well-defined CFNumber for that value is returned. If either of
144
valuePtr or type is an invalid value, the result is undefined.
146
function CFNumberCreate( allocator: CFAllocatorRef; theType: CFNumberType; valuePtr: {const} UnivPtr ): CFNumberRef; external name '_CFNumberCreate';
149
Returns the storage format of the CFNumber's value. Note that
150
this is not necessarily the type provided in CFNumberCreate().
152
function CFNumberGetType( number: CFNumberRef ): CFNumberType; external name '_CFNumberGetType';
155
Returns the size in bytes of the type of the number.
157
function CFNumberGetByteSize( number: CFNumberRef ): CFIndex; external name '_CFNumberGetByteSize';
160
Returns true if the type of the CFNumber's value is one of
161
the defined floating point types.
163
function CFNumberIsFloatType( number: CFNumberRef ): Boolean; external name '_CFNumberIsFloatType';
166
Copies the CFNumber's value into the space pointed to by
167
valuePtr, as the specified type. If conversion needs to take
168
place, the conversion rules follow human expectation and not
169
C's promotion and truncation rules. If the conversion is
170
lossy, or the value is out of range, false is returned. Best
171
attempt at conversion will still be in *valuePtr.
173
function CFNumberGetValue( number: CFNumberRef; theType: CFNumberType; valuePtr: UnivPtr ): Boolean; external name '_CFNumberGetValue';
176
Compares the two CFNumber instances. If conversion of the
177
types of the values is needed, the conversion and comparison
178
follow human expectations and not C's promotion and comparison
179
rules. Negative zero compares less than positive zero.
180
Positive infinity compares greater than everything except
181
itself, to which it compares equal. Negative infinity compares
182
less than everything except itself, to which it compares equal.
183
Unlike standard practice, if both numbers are NaN, then they
184
compare equal; if only one of the numbers is NaN, then the NaN
185
compares greater than the other number if it is negative, and
186
smaller than the other number if it is positive. (Note that in
187
CFEqual() with two CFNumbers, if either or both of the numbers
188
is NaN, true is returned.)
190
function CFNumberCompare( number: CFNumberRef; otherNumber: CFNumberRef; context: UnivPtr ): CFComparisonResult; external name '_CFNumberCompare';