1 { CoreGraphics - CGPDFString.h
2 * Copyright (c) 2002-2008 Apple Inc.
3 * All rights reserved. }
4 { Pascal Translation: Peter N Lewis, <peter@stairways.com.au>, August 2005 }
5 { Pascal Translation Updated: Jonas Maebe, <jonas@freepascal.org>, October 2009 }
6 { Pascal Translation Updated: Jonas Maebe, <jonas@freepascal.org>, October 2012 }
7 { Pascal Translation Updated: Jonas Maebe, <jonas@freepascal.org>, August 2015 }
8 {
9 Modified for use with Free Pascal
10 Version 308
11 Please report any bugs to <gpc@microbizz.nl>
12 }
13
14 {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
15 {$mode macpas}
16 {$modeswitch cblocks}
17 {$packenum 1}
18 {$macro on}
19 {$inline on}
20 {$calling mwpascal}
21
22 unit CGPDFString;
23 interface
24 {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
25 {$setc GAP_INTERFACES_VERSION := $0308}
26
27 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
28 {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
29 {$endc}
30
31 {$ifc defined CPUPOWERPC and defined CPUI386}
32 {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
33 {$endc}
34 {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
35 {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
36 {$endc}
37
38 {$ifc not defined __ppc__ and defined CPUPOWERPC32}
39 {$setc __ppc__ := 1}
40 {$elsec}
41 {$setc __ppc__ := 0}
42 {$endc}
43 {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
44 {$setc __ppc64__ := 1}
45 {$elsec}
46 {$setc __ppc64__ := 0}
47 {$endc}
48 {$ifc not defined __i386__ and defined CPUI386}
49 {$setc __i386__ := 1}
50 {$elsec}
51 {$setc __i386__ := 0}
52 {$endc}
53 {$ifc not defined __x86_64__ and defined CPUX86_64}
54 {$setc __x86_64__ := 1}
55 {$elsec}
56 {$setc __x86_64__ := 0}
57 {$endc}
58 {$ifc not defined __arm__ and defined CPUARM}
59 {$setc __arm__ := 1}
60 {$elsec}
61 {$setc __arm__ := 0}
62 {$endc}
63 {$ifc not defined __arm64__ and defined CPUAARCH64}
64 {$setc __arm64__ := 1}
65 {$elsec}
66 {$setc __arm64__ := 0}
67 {$endc}
68
69 {$ifc defined cpu64}
70 {$setc __LP64__ := 1}
71 {$elsec}
72 {$setc __LP64__ := 0}
73 {$endc}
74
75
76 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
77 {$error Conflicting definitions for __ppc__ and __i386__}
78 {$endc}
79
80 {$ifc defined __ppc__ and __ppc__}
81 {$setc TARGET_CPU_PPC := TRUE}
82 {$setc TARGET_CPU_PPC64 := FALSE}
83 {$setc TARGET_CPU_X86 := FALSE}
84 {$setc TARGET_CPU_X86_64 := FALSE}
85 {$setc TARGET_CPU_ARM := FALSE}
86 {$setc TARGET_CPU_ARM64 := FALSE}
87 {$setc TARGET_OS_MAC := TRUE}
88 {$setc TARGET_OS_IPHONE := FALSE}
89 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
90 {$setc TARGET_OS_EMBEDDED := FALSE}
91 {$elifc defined __ppc64__ and __ppc64__}
92 {$setc TARGET_CPU_PPC := FALSE}
93 {$setc TARGET_CPU_PPC64 := TRUE}
94 {$setc TARGET_CPU_X86 := FALSE}
95 {$setc TARGET_CPU_X86_64 := FALSE}
96 {$setc TARGET_CPU_ARM := FALSE}
97 {$setc TARGET_CPU_ARM64 := FALSE}
98 {$setc TARGET_OS_MAC := TRUE}
99 {$setc TARGET_OS_IPHONE := FALSE}
100 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
101 {$setc TARGET_OS_EMBEDDED := FALSE}
102 {$elifc defined __i386__ and __i386__}
103 {$setc TARGET_CPU_PPC := FALSE}
104 {$setc TARGET_CPU_PPC64 := FALSE}
105 {$setc TARGET_CPU_X86 := TRUE}
106 {$setc TARGET_CPU_X86_64 := FALSE}
107 {$setc TARGET_CPU_ARM := FALSE}
108 {$setc TARGET_CPU_ARM64 := FALSE}
109 {$ifc defined iphonesim}
110 {$setc TARGET_OS_MAC := FALSE}
111 {$setc TARGET_OS_IPHONE := TRUE}
112 {$setc TARGET_IPHONE_SIMULATOR := TRUE}
113 {$elsec}
114 {$setc TARGET_OS_MAC := TRUE}
115 {$setc TARGET_OS_IPHONE := FALSE}
116 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
117 {$endc}
118 {$setc TARGET_OS_EMBEDDED := FALSE}
119 {$elifc defined __x86_64__ and __x86_64__}
120 {$setc TARGET_CPU_PPC := FALSE}
121 {$setc TARGET_CPU_PPC64 := FALSE}
122 {$setc TARGET_CPU_X86 := FALSE}
123 {$setc TARGET_CPU_X86_64 := TRUE}
124 {$setc TARGET_CPU_ARM := FALSE}
125 {$setc TARGET_CPU_ARM64 := FALSE}
126 {$ifc defined iphonesim}
127 {$setc TARGET_OS_MAC := FALSE}
128 {$setc TARGET_OS_IPHONE := TRUE}
129 {$setc TARGET_IPHONE_SIMULATOR := TRUE}
130 {$elsec}
131 {$setc TARGET_OS_MAC := TRUE}
132 {$setc TARGET_OS_IPHONE := FALSE}
133 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
134 {$endc}
135 {$setc TARGET_OS_EMBEDDED := FALSE}
136 {$elifc defined __arm__ and __arm__}
137 {$setc TARGET_CPU_PPC := FALSE}
138 {$setc TARGET_CPU_PPC64 := FALSE}
139 {$setc TARGET_CPU_X86 := FALSE}
140 {$setc TARGET_CPU_X86_64 := FALSE}
141 {$setc TARGET_CPU_ARM := TRUE}
142 {$setc TARGET_CPU_ARM64 := FALSE}
143 {$setc TARGET_OS_MAC := FALSE}
144 {$setc TARGET_OS_IPHONE := TRUE}
145 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
146 {$setc TARGET_OS_EMBEDDED := TRUE}
147 {$elifc defined __arm64__ and __arm64__}
148 {$setc TARGET_CPU_PPC := FALSE}
149 {$setc TARGET_CPU_PPC64 := FALSE}
150 {$setc TARGET_CPU_X86 := FALSE}
151 {$setc TARGET_CPU_X86_64 := FALSE}
152 {$setc TARGET_CPU_ARM := FALSE}
153 {$setc TARGET_CPU_ARM64 := TRUE}
154 {$ifc defined ios}
155 {$setc TARGET_OS_MAC := FALSE}
156 {$setc TARGET_OS_IPHONE := TRUE}
157 {$setc TARGET_OS_EMBEDDED := TRUE}
158 {$elsec}
159 {$setc TARGET_OS_MAC := TRUE}
160 {$setc TARGET_OS_IPHONE := FALSE}
161 {$setc TARGET_OS_EMBEDDED := FALSE}
162 {$endc}
163 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
164 {$elsec}
165 {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ nor __arm64__ is defined.}
166 {$endc}
167
168 {$ifc defined __LP64__ and __LP64__ }
169 {$setc TARGET_CPU_64 := TRUE}
170 {$elsec}
171 {$setc TARGET_CPU_64 := FALSE}
172 {$endc}
173
174 {$ifc defined FPC_BIG_ENDIAN}
175 {$setc TARGET_RT_BIG_ENDIAN := TRUE}
176 {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
177 {$elifc defined FPC_LITTLE_ENDIAN}
178 {$setc TARGET_RT_BIG_ENDIAN := FALSE}
179 {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
180 {$elsec}
181 {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
182 {$endc}
183 {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
184 {$setc CALL_NOT_IN_CARBON := FALSE}
185 {$setc OLDROUTINENAMES := FALSE}
186 {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
187 {$setc OPAQUE_UPP_TYPES := TRUE}
188 {$setc OTCARBONAPPLICATION := TRUE}
189 {$setc OTKERNEL := FALSE}
190 {$setc PM_USE_SESSION_APIS := TRUE}
191 {$setc TARGET_API_MAC_CARBON := TRUE}
192 {$setc TARGET_API_MAC_OS8 := FALSE}
193 {$setc TARGET_API_MAC_OSX := TRUE}
194 {$setc TARGET_CARBON := TRUE}
195 {$setc TARGET_CPU_68K := FALSE}
196 {$setc TARGET_CPU_MIPS := FALSE}
197 {$setc TARGET_CPU_SPARC := FALSE}
198 {$setc TARGET_OS_UNIX := FALSE}
199 {$setc TARGET_OS_WIN32 := FALSE}
200 {$setc TARGET_RT_MAC_68881 := FALSE}
201 {$setc TARGET_RT_MAC_CFM := FALSE}
202 {$setc TARGET_RT_MAC_MACHO := TRUE}
203 {$setc TYPED_FUNCTION_POINTERS := TRUE}
204 {$setc TYPE_BOOL := FALSE}
205 {$setc TYPE_EXTENDED := FALSE}
206 {$setc TYPE_LONGLONG := TRUE}
207 uses MacTypes,CFBase,CFDate,CGBase;
208 {$endc} {not MACOSALLINCLUDE}
209
210 {$ALIGN POWER}
211
212
213 // CGPDFStringRef defined in CGBase
214
215
216 { Return the length of `string'. }
217
CGPDFStringGetLengthnull218 function CGPDFStringGetLength( strng: CGPDFStringRef ): size_t; external name '_CGPDFStringGetLength';
219 (* CG_AVAILABLE_STARTING(__MAC_10_3, __IPHONE_2_0) *)
220
221 { Return a pointer to the bytes of `string'. }
222
CGPDFStringGetBytePtrnull223 function CGPDFStringGetBytePtr( strng: CGPDFStringRef ): UInt8Ptr; external name '_CGPDFStringGetBytePtr';
224 (* CG_AVAILABLE_STARTING(__MAC_10_3, __IPHONE_2_0) *)
225
226 { Return a CFString representing `string' as a "text string". See Section
227 3.8.1 "Text Strings", PDF Reference: Adobe PDF version 1.6 (5th ed.) for
228 more information. }
229
CGPDFStringCopyTextStringnull230 function CGPDFStringCopyTextString( strng: CGPDFStringRef ): CFStringRef; external name '_CGPDFStringCopyTextString';
231 (* CG_AVAILABLE_STARTING(__MAC_10_3, __IPHONE_2_0) *)
232
233 { Convert `string' to a CFDate. See Section 3.8.3 "Dates", PDF Reference:
234 Adobe PDF version 1.6 (5th ed.) for more information. }
235
CGPDFStringCopyDatenull236 function CGPDFStringCopyDate( strng: CGPDFStringRef ): CFDateRef; external name '_CGPDFStringCopyDate';
237 (* CG_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) *)
238
239 {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
240
241 end.
242 {$endc} {not MACOSALLINCLUDE}
243