ScalerStreamTypes.pas 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  1. {
  2. File: ATS/ScalerStreamTypes.h
  3. Contains: Scaler streaming data structures and constants for OFA 1.x
  4. Copyright: © 1994-2008 by Apple Inc., all rights reserved.
  5. Warning: *** APPLE INTERNAL USE ONLY ***
  6. This file may contain unreleased API's
  7. BuildInfo: Built by: root
  8. On: Fri Jul 24 22:21:51 2009
  9. With Interfacer: 3.0d46 (Mac OS X for PowerPC)
  10. From: ScalerStreamTypes.i
  11. Revision: 1.5
  12. Dated: 2007/01/15 23:28:27
  13. Last change by: kurita
  14. Last comment: <rdar://problem/4916090> updated copyright.
  15. Bugs: Report bugs to Radar component "System Interfaces", "Latest"
  16. List the version information (from above) in the Problem Description.
  17. }
  18. { Pascal Translation: Gorazd Krosl <[email protected]>, October 2009 }
  19. {
  20. Modified for use with Free Pascal
  21. Version 308
  22. Please report any bugs to <[email protected]>
  23. }
  24. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  25. {$mode macpas}
  26. {$packenum 1}
  27. {$macro on}
  28. {$inline on}
  29. {$calling mwpascal}
  30. unit ScalerStreamTypes;
  31. interface
  32. {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
  33. {$setc GAP_INTERFACES_VERSION := $0308}
  34. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  35. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  36. {$endc}
  37. {$ifc defined CPUPOWERPC and defined CPUI386}
  38. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  39. {$endc}
  40. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  41. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  42. {$endc}
  43. {$ifc not defined __ppc__ and defined CPUPOWERPC32}
  44. {$setc __ppc__ := 1}
  45. {$elsec}
  46. {$setc __ppc__ := 0}
  47. {$endc}
  48. {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
  49. {$setc __ppc64__ := 1}
  50. {$elsec}
  51. {$setc __ppc64__ := 0}
  52. {$endc}
  53. {$ifc not defined __i386__ and defined CPUI386}
  54. {$setc __i386__ := 1}
  55. {$elsec}
  56. {$setc __i386__ := 0}
  57. {$endc}
  58. {$ifc not defined __x86_64__ and defined CPUX86_64}
  59. {$setc __x86_64__ := 1}
  60. {$elsec}
  61. {$setc __x86_64__ := 0}
  62. {$endc}
  63. {$ifc not defined __arm__ and defined CPUARM}
  64. {$setc __arm__ := 1}
  65. {$elsec}
  66. {$setc __arm__ := 0}
  67. {$endc}
  68. {$ifc not defined __arm64__ and defined CPUAARCH64}
  69. {$setc __arm64__ := 1}
  70. {$elsec}
  71. {$setc __arm64__ := 0}
  72. {$endc}
  73. {$ifc defined cpu64}
  74. {$setc __LP64__ := 1}
  75. {$elsec}
  76. {$setc __LP64__ := 0}
  77. {$endc}
  78. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  79. {$error Conflicting definitions for __ppc__ and __i386__}
  80. {$endc}
  81. {$ifc defined __ppc__ and __ppc__}
  82. {$setc TARGET_CPU_PPC := TRUE}
  83. {$setc TARGET_CPU_PPC64 := FALSE}
  84. {$setc TARGET_CPU_X86 := FALSE}
  85. {$setc TARGET_CPU_X86_64 := FALSE}
  86. {$setc TARGET_CPU_ARM := FALSE}
  87. {$setc TARGET_CPU_ARM64 := FALSE}
  88. {$setc TARGET_OS_MAC := TRUE}
  89. {$setc TARGET_OS_IPHONE := FALSE}
  90. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  91. {$setc TARGET_OS_EMBEDDED := FALSE}
  92. {$elifc defined __ppc64__ and __ppc64__}
  93. {$setc TARGET_CPU_PPC := FALSE}
  94. {$setc TARGET_CPU_PPC64 := TRUE}
  95. {$setc TARGET_CPU_X86 := FALSE}
  96. {$setc TARGET_CPU_X86_64 := FALSE}
  97. {$setc TARGET_CPU_ARM := FALSE}
  98. {$setc TARGET_CPU_ARM64 := FALSE}
  99. {$setc TARGET_OS_MAC := TRUE}
  100. {$setc TARGET_OS_IPHONE := FALSE}
  101. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  102. {$setc TARGET_OS_EMBEDDED := FALSE}
  103. {$elifc defined __i386__ and __i386__}
  104. {$setc TARGET_CPU_PPC := FALSE}
  105. {$setc TARGET_CPU_PPC64 := FALSE}
  106. {$setc TARGET_CPU_X86 := TRUE}
  107. {$setc TARGET_CPU_X86_64 := FALSE}
  108. {$setc TARGET_CPU_ARM := FALSE}
  109. {$setc TARGET_CPU_ARM64 := FALSE}
  110. {$ifc defined(iphonesim)}
  111. {$setc TARGET_OS_MAC := FALSE}
  112. {$setc TARGET_OS_IPHONE := TRUE}
  113. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  114. {$elsec}
  115. {$setc TARGET_OS_MAC := TRUE}
  116. {$setc TARGET_OS_IPHONE := FALSE}
  117. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  118. {$endc}
  119. {$setc TARGET_OS_EMBEDDED := FALSE}
  120. {$elifc defined __x86_64__ and __x86_64__}
  121. {$setc TARGET_CPU_PPC := FALSE}
  122. {$setc TARGET_CPU_PPC64 := FALSE}
  123. {$setc TARGET_CPU_X86 := FALSE}
  124. {$setc TARGET_CPU_X86_64 := TRUE}
  125. {$setc TARGET_CPU_ARM := FALSE}
  126. {$setc TARGET_CPU_ARM64 := FALSE}
  127. {$ifc defined(iphonesim)}
  128. {$setc TARGET_OS_MAC := FALSE}
  129. {$setc TARGET_OS_IPHONE := TRUE}
  130. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  131. {$elsec}
  132. {$setc TARGET_OS_MAC := TRUE}
  133. {$setc TARGET_OS_IPHONE := FALSE}
  134. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  135. {$endc}
  136. {$setc TARGET_OS_EMBEDDED := FALSE}
  137. {$elifc defined __arm__ and __arm__}
  138. {$setc TARGET_CPU_PPC := FALSE}
  139. {$setc TARGET_CPU_PPC64 := FALSE}
  140. {$setc TARGET_CPU_X86 := FALSE}
  141. {$setc TARGET_CPU_X86_64 := FALSE}
  142. {$setc TARGET_CPU_ARM := TRUE}
  143. {$setc TARGET_CPU_ARM64 := FALSE}
  144. { will require compiler define when/if other Apple devices with ARM cpus ship }
  145. {$setc TARGET_OS_MAC := FALSE}
  146. {$setc TARGET_OS_IPHONE := TRUE}
  147. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  148. {$setc TARGET_OS_EMBEDDED := TRUE}
  149. {$elifc defined __arm64__ and __arm64__}
  150. {$setc TARGET_CPU_PPC := FALSE}
  151. {$setc TARGET_CPU_PPC64 := FALSE}
  152. {$setc TARGET_CPU_X86 := FALSE}
  153. {$setc TARGET_CPU_X86_64 := FALSE}
  154. {$setc TARGET_CPU_ARM := FALSE}
  155. {$setc TARGET_CPU_ARM64 := TRUE}
  156. { will require compiler define when/if other Apple devices with ARM cpus ship }
  157. {$setc TARGET_OS_MAC := FALSE}
  158. {$setc TARGET_OS_IPHONE := TRUE}
  159. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  160. {$setc TARGET_OS_EMBEDDED := TRUE}
  161. {$elsec}
  162. {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ nor __arm64__ is defined.}
  163. {$endc}
  164. {$ifc defined __LP64__ and __LP64__ }
  165. {$setc TARGET_CPU_64 := TRUE}
  166. {$elsec}
  167. {$setc TARGET_CPU_64 := FALSE}
  168. {$endc}
  169. {$ifc defined FPC_BIG_ENDIAN}
  170. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  171. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  172. {$elifc defined FPC_LITTLE_ENDIAN}
  173. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  174. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  175. {$elsec}
  176. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  177. {$endc}
  178. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  179. {$setc CALL_NOT_IN_CARBON := FALSE}
  180. {$setc OLDROUTINENAMES := FALSE}
  181. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  182. {$setc OPAQUE_UPP_TYPES := TRUE}
  183. {$setc OTCARBONAPPLICATION := TRUE}
  184. {$setc OTKERNEL := FALSE}
  185. {$setc PM_USE_SESSION_APIS := TRUE}
  186. {$setc TARGET_API_MAC_CARBON := TRUE}
  187. {$setc TARGET_API_MAC_OS8 := FALSE}
  188. {$setc TARGET_API_MAC_OSX := TRUE}
  189. {$setc TARGET_CARBON := TRUE}
  190. {$setc TARGET_CPU_68K := FALSE}
  191. {$setc TARGET_CPU_MIPS := FALSE}
  192. {$setc TARGET_CPU_SPARC := FALSE}
  193. {$setc TARGET_OS_UNIX := FALSE}
  194. {$setc TARGET_OS_WIN32 := FALSE}
  195. {$setc TARGET_RT_MAC_68881 := FALSE}
  196. {$setc TARGET_RT_MAC_CFM := FALSE}
  197. {$setc TARGET_RT_MAC_MACHO := TRUE}
  198. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  199. {$setc TYPE_BOOL := FALSE}
  200. {$setc TYPE_EXTENDED := FALSE}
  201. {$setc TYPE_LONGLONG := TRUE}
  202. uses MacTypes,SFNTTypes;
  203. {$endc} {not MACOSALLINCLUDE}
  204. {$ifc TARGET_OS_MAC}
  205. {$ALIGN POWER}
  206. { ScalerStream input/output types }
  207. const
  208. cexec68K = $00000001;
  209. truetypeStreamType = $00000001;
  210. type1StreamType = $00000002;
  211. type3StreamType = $00000004;
  212. type42StreamType = $00000008;
  213. type42GXStreamType = $00000010;
  214. portableStreamType = $00000020;
  215. flattenedStreamType = $00000040;
  216. cidType2StreamType = $00000080;
  217. cidType0StreamType = $00000100;
  218. type1CFFStreamType = $00000200;
  219. evenOddModifierStreamType = $00008000;
  220. eexecBinaryModifierStreamType = $00010000; { encrypted portion of Type1Stream to be binary }
  221. unicodeMappingModifierStreamType = $00020000; { include glyph ID to unicode mapping info for PDF }
  222. scalerSpecifcModifierMask = $0000F000; { for scaler's internal use }
  223. streamTypeModifierMask = $FFFFF000; { 16 bits for Apple, 4 bits for scaler }
  224. { Possible streamed font formats }
  225. type
  226. scalerStreamTypeFlag = UInt32;
  227. const
  228. downloadStreamAction = 0; { Transmit the (possibly sparse) font data }
  229. asciiDownloadStreamAction = 1; { Transmit font data to a 7-bit ASCII destination }
  230. fontSizeQueryStreamAction = 2; { Estimate in-printer memory used if the font were downloaded }
  231. encodingOnlyStreamAction = 3; { Transmit only the encoding for the font }
  232. prerequisiteQueryStreamAction = 4; { Return a list of prerequisite items needed for the font }
  233. prerequisiteItemStreamAction = 5; { Transmit a specified prerequisite item }
  234. variationQueryStreamAction = 6; { Return information regarding support for variation streaming }
  235. variationPSOperatorStreamAction = 7; { Transmit Postscript code necessary to effect variation of a font }
  236. type
  237. scalerStreamAction = SInt32;
  238. const
  239. selectAllVariations = -1; { Special variationCount value meaning include all variation data }
  240. type
  241. scalerPrerequisiteItem = record
  242. enumeration: SInt32; { Shorthand tag identifying the item }
  243. size: SInt32; { Worst case vm in printer item requires. Never > than 16-bit quantity }
  244. name: packed array[0..0] of char; { Name to be used by the client when emitting the item (Pascal string) }
  245. end;
  246. scalerStremFontRec = record
  247. encoding: { const } UInt16Ptr; { <- Intention is * unsigned short[256] }
  248. glyphBits: SInt32Ptr; { <-> Bitvector: a bit for each glyph, 1 = desired/supplied }
  249. name: PChar { <-> The printer font name to use/used (C string) }
  250. end;
  251. scalerStreamPrerequisiteQueryRec = record
  252. size: SInt32; { -> Size of the prereq. list in bytes (0 indicates no prerequisites)}
  253. list: { const } UnivPtr; { <- Pointer to client block to hold list (nil = list size query only) }
  254. end;
  255. scalerStreamInfoRec = record
  256. case SInt16 of
  257. 0: ( { Normal font streaming information }
  258. font: scalerStremFontRec
  259. );
  260. 1: ( { Used to obtain a list of prerequisites from the scaler}
  261. prerequisiteQuery: scalerStreamPrerequisiteQueryRec
  262. );
  263. 2: (
  264. prerequisiteItem: SInt32; { <- Enumeration value for the prerequisite item to be streamed.}
  265. );
  266. 3: (
  267. variationQueryResult: SInt32; { -> Output from the variationQueryStreamAction }
  268. );
  269. end;
  270. scalerStreamPtr = ^scalerStream;
  271. scalerStream = record
  272. streamRefCon: { const } UnivPtr; { <- private reference for client }
  273. targetVersion: { const } PChar; { <- e.g. Postscript printer name (C string) }
  274. types: scalerStreamTypeFlag; { <-> Data stream formats desired/supplied }
  275. action: scalerStreamAction; { <- What action to take }
  276. memorySize: UInt32; { -> Worst case memory use (vm) in printer or as sfnt }
  277. variationCount: SInt32; { <- The number of variations, or selectAllVariations }
  278. variations: { const } UnivPtr; { <- A pointer to an array of the variations (gxFontVariation) }
  279. info: scalerStreamInfoRec;
  280. end;
  281. scalerStreamDataPtr = ^scalerStreamData;
  282. scalerStreamData = record
  283. hexFlag: SInt32; { Indicates that the data is to be interpreted as hex, versus binary }
  284. byteCount: SInt32; { Number of bytes in the data being streamed }
  285. data: { const } UnivPtr; { Pointer to the data being streamed }
  286. end;
  287. {$endc} {TARGET_OS_MAC}
  288. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  289. end.
  290. {$endc} {not MACOSALLINCLUDE}