CTFontManagerErrors.pas 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. {
  2. * CTFontManagerErrors.h
  3. * CoreText
  4. *
  5. * Copyright (c) 2008-2012 Apple Inc. All rights reserved.
  6. *
  7. }
  8. { Initial Pascal Translation: Jonas Maebe, <[email protected]>, October 2009 }
  9. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, October 2012 }
  10. {
  11. Modified for use with Free Pascal
  12. Version 308
  13. Please report any bugs to <[email protected]>
  14. }
  15. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  16. {$mode macpas}
  17. {$packenum 1}
  18. {$macro on}
  19. {$inline on}
  20. {$calling mwpascal}
  21. unit CTFontManagerErrors;
  22. interface
  23. {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
  24. {$setc GAP_INTERFACES_VERSION := $0308}
  25. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  26. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  27. {$endc}
  28. {$ifc defined CPUPOWERPC and defined CPUI386}
  29. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  30. {$endc}
  31. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  32. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  33. {$endc}
  34. {$ifc not defined __ppc__ and defined CPUPOWERPC32}
  35. {$setc __ppc__ := 1}
  36. {$elsec}
  37. {$setc __ppc__ := 0}
  38. {$endc}
  39. {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
  40. {$setc __ppc64__ := 1}
  41. {$elsec}
  42. {$setc __ppc64__ := 0}
  43. {$endc}
  44. {$ifc not defined __i386__ and defined CPUI386}
  45. {$setc __i386__ := 1}
  46. {$elsec}
  47. {$setc __i386__ := 0}
  48. {$endc}
  49. {$ifc not defined __x86_64__ and defined CPUX86_64}
  50. {$setc __x86_64__ := 1}
  51. {$elsec}
  52. {$setc __x86_64__ := 0}
  53. {$endc}
  54. {$ifc not defined __arm__ and defined CPUARM}
  55. {$setc __arm__ := 1}
  56. {$elsec}
  57. {$setc __arm__ := 0}
  58. {$endc}
  59. {$ifc not defined __arm64__ and defined CPUAARCH64}
  60. {$setc __arm64__ := 1}
  61. {$elsec}
  62. {$setc __arm64__ := 0}
  63. {$endc}
  64. {$ifc defined cpu64}
  65. {$setc __LP64__ := 1}
  66. {$elsec}
  67. {$setc __LP64__ := 0}
  68. {$endc}
  69. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  70. {$error Conflicting definitions for __ppc__ and __i386__}
  71. {$endc}
  72. {$ifc defined __ppc__ and __ppc__}
  73. {$setc TARGET_CPU_PPC := TRUE}
  74. {$setc TARGET_CPU_PPC64 := FALSE}
  75. {$setc TARGET_CPU_X86 := FALSE}
  76. {$setc TARGET_CPU_X86_64 := FALSE}
  77. {$setc TARGET_CPU_ARM := FALSE}
  78. {$setc TARGET_CPU_ARM64 := FALSE}
  79. {$setc TARGET_OS_MAC := TRUE}
  80. {$setc TARGET_OS_IPHONE := FALSE}
  81. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  82. {$setc TARGET_OS_EMBEDDED := FALSE}
  83. {$elifc defined __ppc64__ and __ppc64__}
  84. {$setc TARGET_CPU_PPC := FALSE}
  85. {$setc TARGET_CPU_PPC64 := TRUE}
  86. {$setc TARGET_CPU_X86 := FALSE}
  87. {$setc TARGET_CPU_X86_64 := FALSE}
  88. {$setc TARGET_CPU_ARM := FALSE}
  89. {$setc TARGET_CPU_ARM64 := FALSE}
  90. {$setc TARGET_OS_MAC := TRUE}
  91. {$setc TARGET_OS_IPHONE := FALSE}
  92. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  93. {$setc TARGET_OS_EMBEDDED := FALSE}
  94. {$elifc defined __i386__ and __i386__}
  95. {$setc TARGET_CPU_PPC := FALSE}
  96. {$setc TARGET_CPU_PPC64 := FALSE}
  97. {$setc TARGET_CPU_X86 := TRUE}
  98. {$setc TARGET_CPU_X86_64 := FALSE}
  99. {$setc TARGET_CPU_ARM := FALSE}
  100. {$setc TARGET_CPU_ARM64 := FALSE}
  101. {$ifc defined(iphonesim)}
  102. {$setc TARGET_OS_MAC := FALSE}
  103. {$setc TARGET_OS_IPHONE := TRUE}
  104. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  105. {$elsec}
  106. {$setc TARGET_OS_MAC := TRUE}
  107. {$setc TARGET_OS_IPHONE := FALSE}
  108. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  109. {$endc}
  110. {$setc TARGET_OS_EMBEDDED := FALSE}
  111. {$elifc defined __x86_64__ and __x86_64__}
  112. {$setc TARGET_CPU_PPC := FALSE}
  113. {$setc TARGET_CPU_PPC64 := FALSE}
  114. {$setc TARGET_CPU_X86 := FALSE}
  115. {$setc TARGET_CPU_X86_64 := TRUE}
  116. {$setc TARGET_CPU_ARM := FALSE}
  117. {$setc TARGET_CPU_ARM64 := FALSE}
  118. {$ifc defined(iphonesim)}
  119. {$setc TARGET_OS_MAC := FALSE}
  120. {$setc TARGET_OS_IPHONE := TRUE}
  121. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  122. {$elsec}
  123. {$setc TARGET_OS_MAC := TRUE}
  124. {$setc TARGET_OS_IPHONE := FALSE}
  125. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  126. {$endc}
  127. {$setc TARGET_OS_EMBEDDED := FALSE}
  128. {$elifc defined __arm__ and __arm__}
  129. {$setc TARGET_CPU_PPC := FALSE}
  130. {$setc TARGET_CPU_PPC64 := FALSE}
  131. {$setc TARGET_CPU_X86 := FALSE}
  132. {$setc TARGET_CPU_X86_64 := FALSE}
  133. {$setc TARGET_CPU_ARM := TRUE}
  134. {$setc TARGET_CPU_ARM64 := FALSE}
  135. { will require compiler define when/if other Apple devices with ARM cpus ship }
  136. {$setc TARGET_OS_MAC := FALSE}
  137. {$setc TARGET_OS_IPHONE := TRUE}
  138. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  139. {$setc TARGET_OS_EMBEDDED := TRUE}
  140. {$elifc defined __arm64__ and __arm64__}
  141. {$setc TARGET_CPU_PPC := FALSE}
  142. {$setc TARGET_CPU_PPC64 := FALSE}
  143. {$setc TARGET_CPU_X86 := FALSE}
  144. {$setc TARGET_CPU_X86_64 := FALSE}
  145. {$setc TARGET_CPU_ARM := FALSE}
  146. {$setc TARGET_CPU_ARM64 := TRUE}
  147. { will require compiler define when/if other Apple devices with ARM cpus ship }
  148. {$setc TARGET_OS_MAC := FALSE}
  149. {$setc TARGET_OS_IPHONE := TRUE}
  150. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  151. {$setc TARGET_OS_EMBEDDED := TRUE}
  152. {$elsec}
  153. {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ nor __arm64__ is defined.}
  154. {$endc}
  155. {$ifc defined __LP64__ and __LP64__ }
  156. {$setc TARGET_CPU_64 := TRUE}
  157. {$elsec}
  158. {$setc TARGET_CPU_64 := FALSE}
  159. {$endc}
  160. {$ifc defined FPC_BIG_ENDIAN}
  161. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  162. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  163. {$elifc defined FPC_LITTLE_ENDIAN}
  164. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  165. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  166. {$elsec}
  167. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  168. {$endc}
  169. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  170. {$setc CALL_NOT_IN_CARBON := FALSE}
  171. {$setc OLDROUTINENAMES := FALSE}
  172. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  173. {$setc OPAQUE_UPP_TYPES := TRUE}
  174. {$setc OTCARBONAPPLICATION := TRUE}
  175. {$setc OTKERNEL := FALSE}
  176. {$setc PM_USE_SESSION_APIS := TRUE}
  177. {$setc TARGET_API_MAC_CARBON := TRUE}
  178. {$setc TARGET_API_MAC_OS8 := FALSE}
  179. {$setc TARGET_API_MAC_OSX := TRUE}
  180. {$setc TARGET_CARBON := TRUE}
  181. {$setc TARGET_CPU_68K := FALSE}
  182. {$setc TARGET_CPU_MIPS := FALSE}
  183. {$setc TARGET_CPU_SPARC := FALSE}
  184. {$setc TARGET_OS_UNIX := FALSE}
  185. {$setc TARGET_OS_WIN32 := FALSE}
  186. {$setc TARGET_RT_MAC_68881 := FALSE}
  187. {$setc TARGET_RT_MAC_CFM := FALSE}
  188. {$setc TARGET_RT_MAC_MACHO := TRUE}
  189. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  190. {$setc TYPE_BOOL := FALSE}
  191. {$setc TYPE_EXTENDED := FALSE}
  192. {$setc TYPE_LONGLONG := TRUE}
  193. uses MacTypes,CFBase;
  194. {$endc} {not MACOSALLINCLUDE}
  195. {$ALIGN POWER}
  196. {!
  197. @const kCTFontManagerErrorDomain
  198. @abstract CFError domain for CTFontManager errors
  199. @discussion CFErrors with this domain will have error codes corresponding to one of the CTFontManagerErrors above.
  200. }
  201. var kCTFontManagerErrorDomain: CFStringRef; external name '_kCTFontManagerErrorDomain'; (* attribute const *)
  202. (* CT_AVAILABLE_STARTING( __MAC_10_6, __IPHONE_3_2) *)
  203. {!
  204. @constant kCTFontManagerErrorFontURLsKey
  205. @abstract User info key to be used with CFError references returned from registration functions.
  206. @discussion The value associated with this key in the user info dictionary of a CFError is a CFArray of font URLs that failed with given error.
  207. }
  208. var kCTFontManagerErrorFontURLsKey: CFStringRef; external name '_kCTFontManagerErrorFontURLsKey'; (* attribute const *)
  209. (* CT_AVAILABLE_STARTING( __MAC_10_6, __IPHONE_3_2) *)
  210. {!
  211. @enum
  212. @abstract Font registration errors
  213. @discussion Errors that would prevent registration of fonts for a specified font file URL.
  214. @constant kCTFontManagerErrorFileNotFound
  215. The file does not exist at the specified URL.
  216. @constant kCTFontManagerErrorInsufficientPermissions
  217. Cannot access the file due to insufficient permissions.
  218. @constant kCTFontManagerErrorUnrecognizedFileFormat
  219. The file is not a recognized or supported font file format.
  220. @constant kCTFontManagerErrorInvalidFontData
  221. The file contains invalid font data that could cause system problems.
  222. @constant kCTFontManagerErrorAlreadyRegistered
  223. The file has already been registered in the specified scope.
  224. }
  225. const
  226. kCTFontManagerErrorFileNotFound = 101;
  227. kCTFontManagerErrorInsufficientPermissions = 102;
  228. kCTFontManagerErrorUnrecognizedFormat = 103;
  229. kCTFontManagerErrorInvalidFontData = 104;
  230. kCTFontManagerErrorAlreadyRegistered = 105;
  231. {!
  232. @enum
  233. @abstract Font un-registration errors
  234. @discussion Errors that would prevent un-registration of fonts for a specified font file URL.
  235. @constant kCTFontManagerErrorNotRegistered
  236. The file is not registered in the specified scope.
  237. @constant kCTFontManagerErrorInUse
  238. The font file is actively in use and cannot be unregistered.
  239. @constant kCTFontManagerErrorSystemRequired
  240. The file is required by the system and cannot be unregistered.
  241. }
  242. const
  243. kCTFontManagerErrorNotRegistered = 201;
  244. kCTFontManagerErrorInUse = 202;
  245. kCTFontManagerErrorSystemRequired = 202;
  246. type
  247. CTFontManagerError = CFIndex;
  248. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  249. end.
  250. {$endc} {not MACOSALLINCLUDE}