ScalerStreamTypes.pas 11 KB

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