/packages/univint/src/CGPDFOperatorTable.pas

https://github.com/slibre/freepascal · Pascal · 208 lines · 10 code · 26 blank · 172 comment · 0 complexity · 860e6dc779f7d418e9513b4c30f93982 MD5 · raw file

  1. { CoreGraphics - CGPDFOperatorTable.h
  2. * Copyright (c) 2004-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. {
  8. Modified for use with Free Pascal
  9. Version 308
  10. Please report any bugs to <gpc@microbizz.nl>
  11. }
  12. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  13. {$mode macpas}
  14. {$packenum 1}
  15. {$macro on}
  16. {$inline on}
  17. {$calling mwpascal}
  18. unit CGPDFOperatorTable;
  19. interface
  20. {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
  21. {$setc GAP_INTERFACES_VERSION := $0308}
  22. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  23. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  24. {$endc}
  25. {$ifc defined CPUPOWERPC and defined CPUI386}
  26. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  27. {$endc}
  28. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  29. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  30. {$endc}
  31. {$ifc not defined __ppc__ and defined CPUPOWERPC32}
  32. {$setc __ppc__ := 1}
  33. {$elsec}
  34. {$setc __ppc__ := 0}
  35. {$endc}
  36. {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
  37. {$setc __ppc64__ := 1}
  38. {$elsec}
  39. {$setc __ppc64__ := 0}
  40. {$endc}
  41. {$ifc not defined __i386__ and defined CPUI386}
  42. {$setc __i386__ := 1}
  43. {$elsec}
  44. {$setc __i386__ := 0}
  45. {$endc}
  46. {$ifc not defined __x86_64__ and defined CPUX86_64}
  47. {$setc __x86_64__ := 1}
  48. {$elsec}
  49. {$setc __x86_64__ := 0}
  50. {$endc}
  51. {$ifc not defined __arm__ and defined CPUARM}
  52. {$setc __arm__ := 1}
  53. {$elsec}
  54. {$setc __arm__ := 0}
  55. {$endc}
  56. {$ifc defined cpu64}
  57. {$setc __LP64__ := 1}
  58. {$elsec}
  59. {$setc __LP64__ := 0}
  60. {$endc}
  61. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  62. {$error Conflicting definitions for __ppc__ and __i386__}
  63. {$endc}
  64. {$ifc defined __ppc__ and __ppc__}
  65. {$setc TARGET_CPU_PPC := TRUE}
  66. {$setc TARGET_CPU_PPC64 := FALSE}
  67. {$setc TARGET_CPU_X86 := FALSE}
  68. {$setc TARGET_CPU_X86_64 := FALSE}
  69. {$setc TARGET_CPU_ARM := FALSE}
  70. {$setc TARGET_OS_MAC := TRUE}
  71. {$setc TARGET_OS_IPHONE := FALSE}
  72. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  73. {$setc TARGET_OS_EMBEDDED := FALSE}
  74. {$elifc defined __ppc64__ and __ppc64__}
  75. {$setc TARGET_CPU_PPC := FALSE}
  76. {$setc TARGET_CPU_PPC64 := TRUE}
  77. {$setc TARGET_CPU_X86 := FALSE}
  78. {$setc TARGET_CPU_X86_64 := FALSE}
  79. {$setc TARGET_CPU_ARM := FALSE}
  80. {$setc TARGET_OS_MAC := TRUE}
  81. {$setc TARGET_OS_IPHONE := FALSE}
  82. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  83. {$setc TARGET_OS_EMBEDDED := FALSE}
  84. {$elifc defined __i386__ and __i386__}
  85. {$setc TARGET_CPU_PPC := FALSE}
  86. {$setc TARGET_CPU_PPC64 := FALSE}
  87. {$setc TARGET_CPU_X86 := TRUE}
  88. {$setc TARGET_CPU_X86_64 := FALSE}
  89. {$setc TARGET_CPU_ARM := FALSE}
  90. {$ifc defined(iphonesim)}
  91. {$setc TARGET_OS_MAC := FALSE}
  92. {$setc TARGET_OS_IPHONE := TRUE}
  93. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  94. {$elsec}
  95. {$setc TARGET_OS_MAC := TRUE}
  96. {$setc TARGET_OS_IPHONE := FALSE}
  97. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  98. {$endc}
  99. {$setc TARGET_OS_EMBEDDED := FALSE}
  100. {$elifc defined __x86_64__ and __x86_64__}
  101. {$setc TARGET_CPU_PPC := FALSE}
  102. {$setc TARGET_CPU_PPC64 := FALSE}
  103. {$setc TARGET_CPU_X86 := FALSE}
  104. {$setc TARGET_CPU_X86_64 := TRUE}
  105. {$setc TARGET_CPU_ARM := FALSE}
  106. {$setc TARGET_OS_MAC := TRUE}
  107. {$setc TARGET_OS_IPHONE := FALSE}
  108. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  109. {$setc TARGET_OS_EMBEDDED := FALSE}
  110. {$elifc defined __arm__ and __arm__}
  111. {$setc TARGET_CPU_PPC := FALSE}
  112. {$setc TARGET_CPU_PPC64 := FALSE}
  113. {$setc TARGET_CPU_X86 := FALSE}
  114. {$setc TARGET_CPU_X86_64 := FALSE}
  115. {$setc TARGET_CPU_ARM := TRUE}
  116. { will require compiler define when/if other Apple devices with ARM cpus ship }
  117. {$setc TARGET_OS_MAC := FALSE}
  118. {$setc TARGET_OS_IPHONE := TRUE}
  119. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  120. {$setc TARGET_OS_EMBEDDED := TRUE}
  121. {$elsec}
  122. {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
  123. {$endc}
  124. {$ifc defined __LP64__ and __LP64__ }
  125. {$setc TARGET_CPU_64 := TRUE}
  126. {$elsec}
  127. {$setc TARGET_CPU_64 := FALSE}
  128. {$endc}
  129. {$ifc defined FPC_BIG_ENDIAN}
  130. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  131. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  132. {$elifc defined FPC_LITTLE_ENDIAN}
  133. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  134. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  135. {$elsec}
  136. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  137. {$endc}
  138. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  139. {$setc CALL_NOT_IN_CARBON := FALSE}
  140. {$setc OLDROUTINENAMES := FALSE}
  141. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  142. {$setc OPAQUE_UPP_TYPES := TRUE}
  143. {$setc OTCARBONAPPLICATION := TRUE}
  144. {$setc OTKERNEL := FALSE}
  145. {$setc PM_USE_SESSION_APIS := TRUE}
  146. {$setc TARGET_API_MAC_CARBON := TRUE}
  147. {$setc TARGET_API_MAC_OS8 := FALSE}
  148. {$setc TARGET_API_MAC_OSX := TRUE}
  149. {$setc TARGET_CARBON := TRUE}
  150. {$setc TARGET_CPU_68K := FALSE}
  151. {$setc TARGET_CPU_MIPS := FALSE}
  152. {$setc TARGET_CPU_SPARC := FALSE}
  153. {$setc TARGET_OS_UNIX := FALSE}
  154. {$setc TARGET_OS_WIN32 := FALSE}
  155. {$setc TARGET_RT_MAC_68881 := FALSE}
  156. {$setc TARGET_RT_MAC_CFM := FALSE}
  157. {$setc TARGET_RT_MAC_MACHO := TRUE}
  158. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  159. {$setc TYPE_BOOL := FALSE}
  160. {$setc TYPE_EXTENDED := FALSE}
  161. {$setc TYPE_LONGLONG := TRUE}
  162. uses MacTypes,CGBase;
  163. {$endc} {not MACOSALLINCLUDE}
  164. {$ALIGN POWER}
  165. // CGPDFOperatorTableRef defined in CGBase
  166. type
  167. CGPDFOperatorCallback = procedure( scanner: CGPDFScannerRef; info: UnivPtr );
  168. { Return an empty operator table. }
  169. function CGPDFOperatorTableCreate: CGPDFOperatorTableRef; external name '_CGPDFOperatorTableCreate';
  170. (* CG_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) *)
  171. { Increment the retain count of `table'. }
  172. function CGPDFOperatorTableRetain( table: CGPDFOperatorTableRef ): CGPDFOperatorTableRef; external name '_CGPDFOperatorTableRetain';
  173. (* CG_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) *)
  174. { Decrement the retain count of `table'. }
  175. procedure CGPDFOperatorTableRelease( table: CGPDFOperatorTableRef ); external name '_CGPDFOperatorTableRelease';
  176. (* CG_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) *)
  177. { Set the callback for the operator named `name' to `callback' }
  178. procedure CGPDFOperatorTableSetCallback( table: CGPDFOperatorTableRef; name: ConstCStringPtr; callback: CGPDFOperatorCallback ); external name '_CGPDFOperatorTableSetCallback';
  179. (* CG_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) *)
  180. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  181. end.
  182. {$endc} {not MACOSALLINCLUDE}