QuickdrawText.pas 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798
  1. {
  2. File: QD/QuickdrawText.h
  3. Contains: Quickdraw Text Interfaces.
  4. Version: Quickdraw-262~1
  5. Copyright: © 1983-2008 by Apple Inc. all rights reserved.
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://bugs.freepascal.org
  9. }
  10. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, October 2009 }
  11. {
  12. Modified for use with Free Pascal
  13. Version 308
  14. Please report any bugs to <[email protected]>
  15. }
  16. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  17. {$mode macpas}
  18. {$packenum 1}
  19. {$macro on}
  20. {$inline on}
  21. {$calling mwpascal}
  22. unit QuickdrawText;
  23. interface
  24. {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
  25. {$setc GAP_INTERFACES_VERSION := $0308}
  26. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  27. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  28. {$endc}
  29. {$ifc defined CPUPOWERPC and defined CPUI386}
  30. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  31. {$endc}
  32. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  33. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  34. {$endc}
  35. {$ifc not defined __ppc__ and defined CPUPOWERPC32}
  36. {$setc __ppc__ := 1}
  37. {$elsec}
  38. {$setc __ppc__ := 0}
  39. {$endc}
  40. {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
  41. {$setc __ppc64__ := 1}
  42. {$elsec}
  43. {$setc __ppc64__ := 0}
  44. {$endc}
  45. {$ifc not defined __i386__ and defined CPUI386}
  46. {$setc __i386__ := 1}
  47. {$elsec}
  48. {$setc __i386__ := 0}
  49. {$endc}
  50. {$ifc not defined __x86_64__ and defined CPUX86_64}
  51. {$setc __x86_64__ := 1}
  52. {$elsec}
  53. {$setc __x86_64__ := 0}
  54. {$endc}
  55. {$ifc not defined __arm__ and defined CPUARM}
  56. {$setc __arm__ := 1}
  57. {$elsec}
  58. {$setc __arm__ := 0}
  59. {$endc}
  60. {$ifc not defined __arm64__ and defined CPUAARCH64}
  61. {$setc __arm64__ := 1}
  62. {$elsec}
  63. {$setc __arm64__ := 0}
  64. {$endc}
  65. {$ifc defined cpu64}
  66. {$setc __LP64__ := 1}
  67. {$elsec}
  68. {$setc __LP64__ := 0}
  69. {$endc}
  70. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  71. {$error Conflicting definitions for __ppc__ and __i386__}
  72. {$endc}
  73. {$ifc defined __ppc__ and __ppc__}
  74. {$setc TARGET_CPU_PPC := TRUE}
  75. {$setc TARGET_CPU_PPC64 := FALSE}
  76. {$setc TARGET_CPU_X86 := FALSE}
  77. {$setc TARGET_CPU_X86_64 := FALSE}
  78. {$setc TARGET_CPU_ARM := FALSE}
  79. {$setc TARGET_CPU_ARM64 := 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 __ppc64__ and __ppc64__}
  85. {$setc TARGET_CPU_PPC := FALSE}
  86. {$setc TARGET_CPU_PPC64 := TRUE}
  87. {$setc TARGET_CPU_X86 := FALSE}
  88. {$setc TARGET_CPU_X86_64 := FALSE}
  89. {$setc TARGET_CPU_ARM := FALSE}
  90. {$setc TARGET_CPU_ARM64 := FALSE}
  91. {$setc TARGET_OS_MAC := TRUE}
  92. {$setc TARGET_OS_IPHONE := FALSE}
  93. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  94. {$setc TARGET_OS_EMBEDDED := FALSE}
  95. {$elifc defined __i386__ and __i386__}
  96. {$setc TARGET_CPU_PPC := FALSE}
  97. {$setc TARGET_CPU_PPC64 := FALSE}
  98. {$setc TARGET_CPU_X86 := TRUE}
  99. {$setc TARGET_CPU_X86_64 := FALSE}
  100. {$setc TARGET_CPU_ARM := FALSE}
  101. {$setc TARGET_CPU_ARM64 := FALSE}
  102. {$ifc defined(iphonesim)}
  103. {$setc TARGET_OS_MAC := FALSE}
  104. {$setc TARGET_OS_IPHONE := TRUE}
  105. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  106. {$elsec}
  107. {$setc TARGET_OS_MAC := TRUE}
  108. {$setc TARGET_OS_IPHONE := FALSE}
  109. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  110. {$endc}
  111. {$setc TARGET_OS_EMBEDDED := FALSE}
  112. {$elifc defined __x86_64__ and __x86_64__}
  113. {$setc TARGET_CPU_PPC := FALSE}
  114. {$setc TARGET_CPU_PPC64 := FALSE}
  115. {$setc TARGET_CPU_X86 := FALSE}
  116. {$setc TARGET_CPU_X86_64 := TRUE}
  117. {$setc TARGET_CPU_ARM := FALSE}
  118. {$setc TARGET_CPU_ARM64 := FALSE}
  119. {$ifc defined(iphonesim)}
  120. {$setc TARGET_OS_MAC := FALSE}
  121. {$setc TARGET_OS_IPHONE := TRUE}
  122. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  123. {$elsec}
  124. {$setc TARGET_OS_MAC := TRUE}
  125. {$setc TARGET_OS_IPHONE := FALSE}
  126. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  127. {$endc}
  128. {$setc TARGET_OS_EMBEDDED := FALSE}
  129. {$elifc defined __arm__ and __arm__}
  130. {$setc TARGET_CPU_PPC := FALSE}
  131. {$setc TARGET_CPU_PPC64 := FALSE}
  132. {$setc TARGET_CPU_X86 := FALSE}
  133. {$setc TARGET_CPU_X86_64 := FALSE}
  134. {$setc TARGET_CPU_ARM := TRUE}
  135. {$setc TARGET_CPU_ARM64 := FALSE}
  136. { will require compiler define when/if other Apple devices with ARM cpus ship }
  137. {$setc TARGET_OS_MAC := FALSE}
  138. {$setc TARGET_OS_IPHONE := TRUE}
  139. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  140. {$setc TARGET_OS_EMBEDDED := TRUE}
  141. {$elifc defined __arm64__ and __arm64__}
  142. {$setc TARGET_CPU_PPC := FALSE}
  143. {$setc TARGET_CPU_PPC64 := FALSE}
  144. {$setc TARGET_CPU_X86 := FALSE}
  145. {$setc TARGET_CPU_X86_64 := FALSE}
  146. {$setc TARGET_CPU_ARM := FALSE}
  147. {$setc TARGET_CPU_ARM64 := TRUE}
  148. { will require compiler define when/if other Apple devices with ARM cpus ship }
  149. {$setc TARGET_OS_MAC := FALSE}
  150. {$setc TARGET_OS_IPHONE := TRUE}
  151. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  152. {$setc TARGET_OS_EMBEDDED := TRUE}
  153. {$elsec}
  154. {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ nor __arm64__ is defined.}
  155. {$endc}
  156. {$ifc defined __LP64__ and __LP64__ }
  157. {$setc TARGET_CPU_64 := TRUE}
  158. {$elsec}
  159. {$setc TARGET_CPU_64 := FALSE}
  160. {$endc}
  161. {$ifc defined FPC_BIG_ENDIAN}
  162. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  163. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  164. {$elifc defined FPC_LITTLE_ENDIAN}
  165. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  166. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  167. {$elsec}
  168. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  169. {$endc}
  170. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  171. {$setc CALL_NOT_IN_CARBON := FALSE}
  172. {$setc OLDROUTINENAMES := FALSE}
  173. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  174. {$setc OPAQUE_UPP_TYPES := TRUE}
  175. {$setc OTCARBONAPPLICATION := TRUE}
  176. {$setc OTKERNEL := FALSE}
  177. {$setc PM_USE_SESSION_APIS := TRUE}
  178. {$setc TARGET_API_MAC_CARBON := TRUE}
  179. {$setc TARGET_API_MAC_OS8 := FALSE}
  180. {$setc TARGET_API_MAC_OSX := TRUE}
  181. {$setc TARGET_CARBON := TRUE}
  182. {$setc TARGET_CPU_68K := FALSE}
  183. {$setc TARGET_CPU_MIPS := FALSE}
  184. {$setc TARGET_CPU_SPARC := FALSE}
  185. {$setc TARGET_OS_UNIX := FALSE}
  186. {$setc TARGET_OS_WIN32 := FALSE}
  187. {$setc TARGET_RT_MAC_68881 := FALSE}
  188. {$setc TARGET_RT_MAC_CFM := FALSE}
  189. {$setc TARGET_RT_MAC_MACHO := TRUE}
  190. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  191. {$setc TYPE_BOOL := FALSE}
  192. {$setc TYPE_EXTENDED := FALSE}
  193. {$setc TYPE_LONGLONG := TRUE}
  194. uses MacTypes,MixedMode,IntlResources;
  195. {$endc} {not MACOSALLINCLUDE}
  196. {$ifc TARGET_OS_MAC}
  197. {$ALIGN MAC68K}
  198. {
  199. * The remaining functions in this file have all been deprecated on Mac OS X 10.4. There are other
  200. * solutions that are recommended that provide better compatibility with the rest of the operating
  201. * system.
  202. *
  203. * Instead of using the QuickDraw functions, you should consider the following:
  204. *
  205. * 1. For drawing and measuring text, you can use the Appearance Manager API in HITheme.h or the
  206. * ATSUI API in ATSUnicode.h to render text directly through a Quartz graphics context.
  207. *
  208. * 2. For accessing information on fonts tracked by the operating system, please refer to the
  209. * functions described in ATSFont.h.
  210. *
  211. * 3. For accessing and modifying information on fonts in a Quartz graphics context, please refer
  212. * to the functions described in CoreGraphics.h.
  213. }
  214. const
  215. { CharToPixel directions }
  216. leftCaret = 0; {Place caret for left block}
  217. rightCaret = -1; {Place caret for right block}
  218. kHilite = 1; {Direction is SysDirection}
  219. const
  220. smLeftCaret = 0; {Place caret for left block - obsolete }
  221. smRightCaret = -1; {Place caret for right block - obsolete }
  222. smHilite = 1; {Direction is TESysJust - obsolete }
  223. { Constants for styleRunPosition argument in PortionLine, DrawJustified, MeasureJustified, CharToPixel, and PixelToChar. }
  224. const
  225. onlyStyleRun = 0; { This is the only style run on the line }
  226. leftStyleRun = 1; { This is leftmost of multiple style runs on the line }
  227. rightStyleRun = 2; { This is rightmost of multiple style runs on the line }
  228. middleStyleRun = 3; { There are multiple style runs on the line and this is neither the leftmost nor the rightmost. }
  229. smOnlyStyleRun = 0; { obsolete }
  230. smLeftStyleRun = 1; { obsolete }
  231. smRightStyleRun = 2; { obsolete }
  232. smMiddleStyleRun = 3; { obsolete }
  233. { Type for styleRunPosition parameter in PixelToChar etc. }
  234. type
  235. JustStyleCode = SInt16;
  236. { Type for truncWhere parameter in TruncString, TruncText }
  237. type
  238. TruncCode = SInt16;
  239. { Constants for truncWhere argument in TruncString and TruncText }
  240. const
  241. truncEnd = 0; { Truncate at end }
  242. truncMiddle = $4000; { Truncate in middle }
  243. smTruncEnd = 0; { Truncate at end - obsolete }
  244. smTruncMiddle = $4000; { Truncate in middle - obsolete }
  245. { Constants for TruncString and TruncText results }
  246. const
  247. notTruncated = 0; { No truncation was necessary }
  248. truncated = 1; { Truncation performed }
  249. truncErr = -1; { General error }
  250. smNotTruncated = 0; { No truncation was necessary - obsolete }
  251. smTruncated = 1; { Truncation performed - obsolete }
  252. smTruncErr = -1; { General error - obsolete }
  253. type
  254. StyledLineBreakCode = SInt8;
  255. const
  256. smBreakWord = 0;
  257. smBreakChar = 1;
  258. smBreakOverflow = 2;
  259. { Constants for txFlags (which used to be the pad field after txFace) in QuickTime 3.0. }
  260. const
  261. tfAntiAlias = 1 shl 0;
  262. tfUnicode = 1 shl 1;
  263. type
  264. FontInfoPtr = ^FontInfo;
  265. FontInfo = record
  266. ascent: SInt16;
  267. descent: SInt16;
  268. widMax: SInt16;
  269. leading: SInt16;
  270. end;
  271. type
  272. FormatOrder = array [0..0] of SInt16;
  273. FormatOrderPtr = ^FormatOrder;
  274. { FormatStatus was moved to TextUtils.i.}
  275. { OffsetTable moved to IntlResources.i.}
  276. {$ifc not TARGET_CPU_64}
  277. {
  278. * StandardGlyphs() *** DEPRECATED ***
  279. *
  280. * Discussion:
  281. * The CGrafPort bottleneck ("newProc2") function, used in Unicode
  282. * text drawing.
  283. *
  284. * Availability:
  285. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.4
  286. * CarbonLib: in CarbonLib 1.0 and later
  287. * Non-Carbon CFM: in QuickDrawText 8.5 and later
  288. }
  289. function StandardGlyphs( dataStream: UnivPtr; size: ByteCount ): OSStatus; external name '_StandardGlyphs';
  290. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  291. {$endc} {not TARGET_CPU_64}
  292. type
  293. StyleRunDirectionProcPtr = function( styleRunIndex: SInt16; dirParam: UnivPtr ): Boolean;
  294. StyleRunDirectionUPP = StyleRunDirectionProcPtr;
  295. {
  296. * NewStyleRunDirectionUPP()
  297. *
  298. * Availability:
  299. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  300. * CarbonLib: in CarbonLib 1.0 and later
  301. * Non-Carbon CFM: available as macro/inline
  302. }
  303. function NewStyleRunDirectionUPP( userRoutine: StyleRunDirectionProcPtr ): StyleRunDirectionUPP; external name '_NewStyleRunDirectionUPP';
  304. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  305. {
  306. * DisposeStyleRunDirectionUPP()
  307. *
  308. * Availability:
  309. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  310. * CarbonLib: in CarbonLib 1.0 and later
  311. * Non-Carbon CFM: available as macro/inline
  312. }
  313. procedure DisposeStyleRunDirectionUPP( userUPP: StyleRunDirectionUPP ); external name '_DisposeStyleRunDirectionUPP';
  314. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  315. {
  316. * InvokeStyleRunDirectionUPP()
  317. *
  318. * Availability:
  319. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  320. * CarbonLib: in CarbonLib 1.0 and later
  321. * Non-Carbon CFM: available as macro/inline
  322. }
  323. function InvokeStyleRunDirectionUPP( styleRunIndex: SInt16; dirParam: UnivPtr; userUPP: StyleRunDirectionUPP ): Boolean; external name '_InvokeStyleRunDirectionUPP';
  324. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  325. {$ifc not TARGET_CPU_64}
  326. {
  327. * Pixel2Char()
  328. *
  329. * Availability:
  330. * Mac OS X: not available [32-bit only]
  331. * CarbonLib: not available
  332. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  333. }
  334. {
  335. * Char2Pixel()
  336. *
  337. * Availability:
  338. * Mac OS X: not available [32-bit only]
  339. * CarbonLib: not available
  340. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  341. }
  342. {
  343. * PixelToChar() *** DEPRECATED ***
  344. *
  345. * Availability:
  346. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.4
  347. * CarbonLib: in CarbonLib 1.0 and later
  348. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  349. }
  350. function PixelToChar( textBuf: Ptr; textLength: SIGNEDLONG; slop: Fixed; pixelWidth: Fixed; var leadingEdge: Boolean; var widthRemaining: Fixed; styleRunPosition: JustStyleCode; numer: Point; denom: Point ): SInt16; external name '_PixelToChar';
  351. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  352. {
  353. * CharToPixel() *** DEPRECATED ***
  354. *
  355. * Availability:
  356. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.4
  357. * CarbonLib: in CarbonLib 1.0 and later
  358. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  359. }
  360. function CharToPixel( textBuf: Ptr; textLength: SIGNEDLONG; slop: Fixed; offset: SIGNEDLONG; direction: SInt16; styleRunPosition: JustStyleCode; numer: Point; denom: Point ): SInt16; external name '_CharToPixel';
  361. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  362. {
  363. * DrawJustified() *** DEPRECATED ***
  364. *
  365. * Availability:
  366. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.4
  367. * CarbonLib: in CarbonLib 1.0 and later
  368. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  369. }
  370. procedure DrawJustified( textPtr: Ptr; textLength: SIGNEDLONG; slop: Fixed; styleRunPosition: JustStyleCode; numer: Point; denom: Point ); external name '_DrawJustified';
  371. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  372. {
  373. * MeasureJustified() *** DEPRECATED ***
  374. *
  375. * Availability:
  376. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.4
  377. * CarbonLib: in CarbonLib 1.0 and later
  378. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  379. }
  380. procedure MeasureJustified( textPtr: Ptr; textLength: SIGNEDLONG; slop: Fixed; charLocs: Ptr; styleRunPosition: JustStyleCode; numer: Point; denom: Point ); external name '_MeasureJustified';
  381. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  382. {
  383. * PortionLine() *** DEPRECATED ***
  384. *
  385. * Availability:
  386. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.4
  387. * CarbonLib: in CarbonLib 1.0 and later
  388. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  389. }
  390. function PortionLine( textPtr: Ptr; textLen: SIGNEDLONG; styleRunPosition: JustStyleCode; numer: Point; denom: Point ): Fixed; external name '_PortionLine';
  391. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  392. {
  393. * HiliteText() *** DEPRECATED ***
  394. *
  395. * Availability:
  396. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.4
  397. * CarbonLib: in CarbonLib 1.0 and later
  398. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  399. }
  400. procedure HiliteText( textPtr: Ptr; textLength: SInt16; firstOffset: SInt16; secondOffset: SInt16; var offsets: OffsetTable ); external name '_HiliteText';
  401. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  402. {
  403. * DrawJust()
  404. *
  405. * Availability:
  406. * Mac OS X: not available [32-bit only]
  407. * CarbonLib: not available
  408. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  409. }
  410. {
  411. * MeasureJust()
  412. *
  413. * Availability:
  414. * Mac OS X: not available [32-bit only]
  415. * CarbonLib: not available
  416. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  417. }
  418. {
  419. * PortionText()
  420. *
  421. * Availability:
  422. * Mac OS X: not available [32-bit only]
  423. * CarbonLib: not available
  424. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  425. }
  426. {
  427. * VisibleLength() *** DEPRECATED ***
  428. *
  429. * Availability:
  430. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.4
  431. * CarbonLib: in CarbonLib 1.0 and later
  432. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  433. }
  434. function VisibleLength( textPtr: Ptr; textLength: SIGNEDLONG ): SIGNEDLONG; external name '_VisibleLength';
  435. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  436. {
  437. * GetFormatOrder() *** DEPRECATED ***
  438. *
  439. * Availability:
  440. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.4
  441. * CarbonLib: in CarbonLib 1.0 and later
  442. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  443. }
  444. procedure GetFormatOrder( ordering: FormatOrderPtr; firstFormat: SInt16; lastFormat: SInt16; lineRight: Boolean; rlDirProc: StyleRunDirectionUPP; dirParam: Ptr ); external name '_GetFormatOrder';
  445. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  446. {
  447. * TextFont() *** DEPRECATED ***
  448. *
  449. * Availability:
  450. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.4
  451. * CarbonLib: in CarbonLib 1.0 and later
  452. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  453. }
  454. procedure TextFont( font: SInt16 ); external name '_TextFont';
  455. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  456. {
  457. * TextFace() *** DEPRECATED ***
  458. *
  459. * Availability:
  460. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.4
  461. * CarbonLib: in CarbonLib 1.0 and later
  462. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  463. }
  464. procedure TextFace( face: StyleParameter ); external name '_TextFace';
  465. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  466. {
  467. * TextMode() *** DEPRECATED ***
  468. *
  469. * Availability:
  470. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.4
  471. * CarbonLib: in CarbonLib 1.0 and later
  472. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  473. }
  474. procedure TextMode( mode: SInt16 ); external name '_TextMode';
  475. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  476. {
  477. * TextSize() *** DEPRECATED ***
  478. *
  479. * Availability:
  480. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.4
  481. * CarbonLib: in CarbonLib 1.0 and later
  482. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  483. }
  484. procedure TextSize( size: SInt16 ); external name '_TextSize';
  485. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  486. {
  487. * SpaceExtra() *** DEPRECATED ***
  488. *
  489. * Availability:
  490. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.4
  491. * CarbonLib: in CarbonLib 1.0 and later
  492. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  493. }
  494. procedure SpaceExtra( extra: Fixed ); external name '_SpaceExtra';
  495. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  496. {
  497. * DrawChar() *** DEPRECATED ***
  498. *
  499. * Availability:
  500. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.4
  501. * CarbonLib: in CarbonLib 1.0 and later
  502. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  503. }
  504. procedure DrawChar( ch: CharParameter ); external name '_DrawChar';
  505. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  506. {
  507. * DrawString() *** DEPRECATED ***
  508. *
  509. * Availability:
  510. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.4
  511. * CarbonLib: in CarbonLib 1.0 and later
  512. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  513. }
  514. procedure DrawString( const (*var*) s: Str255 ); external name '_DrawString';
  515. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  516. {
  517. * [Mac]DrawText() *** DEPRECATED ***
  518. *
  519. * Availability:
  520. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.4
  521. * CarbonLib: in CarbonLib 1.0 and later
  522. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  523. }
  524. procedure MacDrawText( textBuf: {const} UnivPtr; firstByte: SInt16; byteCount: SInt16 ); external name '_DrawText';
  525. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  526. procedure DrawText( textBuf: {const} UnivPtr; firstByte: SInt16; byteCount: SInt16 ); external name '_DrawText';
  527. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  528. {
  529. * CharWidth() *** DEPRECATED ***
  530. *
  531. * Availability:
  532. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.4
  533. * CarbonLib: in CarbonLib 1.0 and later
  534. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  535. }
  536. function CharWidth( ch: CharParameter ): SInt16; external name '_CharWidth';
  537. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  538. {
  539. * StringWidth() *** DEPRECATED ***
  540. *
  541. * Availability:
  542. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.4
  543. * CarbonLib: in CarbonLib 1.0 and later
  544. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  545. }
  546. function StringWidth( const (*var*) s: Str255 ): SInt16; external name '_StringWidth';
  547. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  548. {
  549. * TextWidth() *** DEPRECATED ***
  550. *
  551. * Availability:
  552. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.4
  553. * CarbonLib: in CarbonLib 1.0 and later
  554. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  555. }
  556. function TextWidth( textBuf: {const} UnivPtr; firstByte: SInt16; byteCount: SInt16 ): SInt16; external name '_TextWidth';
  557. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  558. {
  559. * MeasureText() *** DEPRECATED ***
  560. *
  561. * Availability:
  562. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.4
  563. * CarbonLib: in CarbonLib 1.0 and later
  564. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  565. }
  566. procedure MeasureText( count: SInt16; textAddr: {const} UnivPtr; charLocs: UnivPtr ); external name '_MeasureText';
  567. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  568. {
  569. * GetFontInfo() *** DEPRECATED ***
  570. *
  571. * Availability:
  572. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.4
  573. * CarbonLib: in CarbonLib 1.0 and later
  574. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  575. }
  576. procedure GetFontInfo( var info: FontInfo ); external name '_GetFontInfo';
  577. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  578. {
  579. * CharExtra() *** DEPRECATED ***
  580. *
  581. * Availability:
  582. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.4
  583. * CarbonLib: in CarbonLib 1.0 and later
  584. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  585. }
  586. procedure CharExtra( extra: Fixed ); external name '_CharExtra';
  587. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  588. {
  589. * StdText() *** DEPRECATED ***
  590. *
  591. * Availability:
  592. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.4
  593. * CarbonLib: in CarbonLib 1.0 and later
  594. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  595. }
  596. procedure StdText( count: SInt16; textAddr: {const} UnivPtr; numer: Point; denom: Point ); external name '_StdText';
  597. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  598. {
  599. * StdTxMeas() *** DEPRECATED ***
  600. *
  601. * Availability:
  602. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.4
  603. * CarbonLib: in CarbonLib 1.0 and later
  604. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  605. }
  606. function StdTxMeas( byteCount: SInt16; textAddr: {const} UnivPtr; var numer: Point; var denom: Point; var info: FontInfo ): SInt16; external name '_StdTxMeas';
  607. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  608. {
  609. * StyledLineBreak() *** DEPRECATED ***
  610. *
  611. * Availability:
  612. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.4
  613. * CarbonLib: in CarbonLib 1.0 and later
  614. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  615. }
  616. function StyledLineBreak( textPtr: Ptr; textLen: SInt32; textStart: SInt32; textEnd: SInt32; flags: SInt32; var textWidth: Fixed; var textOffset: SInt32 ): StyledLineBreakCode; external name '_StyledLineBreak';
  617. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  618. {
  619. * TruncString() *** DEPRECATED ***
  620. *
  621. * Availability:
  622. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.4
  623. * CarbonLib: in CarbonLib 1.0 and later
  624. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  625. }
  626. function TruncString( width: SInt16; var theString: Str255; truncWhere: TruncCode ): SInt16; external name '_TruncString';
  627. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  628. {
  629. * TruncText() *** DEPRECATED ***
  630. *
  631. * Availability:
  632. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.4
  633. * CarbonLib: in CarbonLib 1.0 and later
  634. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  635. }
  636. function TruncText( width: SInt16; textPtr: Ptr; var length: SInt16; truncWhere: TruncCode ): SInt16; external name '_TruncText';
  637. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  638. {$endc} {not TARGET_CPU_64}
  639. {$ifc not TARGET_CPU_64}
  640. {
  641. * drawstring()
  642. *
  643. * Availability:
  644. * Mac OS X: not available [32-bit only]
  645. * CarbonLib: not available
  646. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  647. }
  648. {
  649. * stringwidth()
  650. *
  651. * Availability:
  652. * Mac OS X: not available [32-bit only]
  653. * CarbonLib: not available
  654. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  655. }
  656. {
  657. * stdtext() *** DEPRECATED ***
  658. *
  659. * Availability:
  660. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.4
  661. * CarbonLib: in CarbonLib 1.0 and later
  662. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  663. }
  664. // overloading not available
  665. // procedure stdtext( count: SInt16; textAddr: {const} UnivPtr; const (*var*) numer: Point; const (*var*) denom: Point );
  666. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4;
  667. {$endc} {not TARGET_CPU_64}
  668. {$ifc not TARGET_CPU_64}
  669. {
  670. * SwapQDTextFlags() *** DEPRECATED ***
  671. *
  672. * Discussion:
  673. * Use QDSwapTextFlags instead (in Quickdraw.h).
  674. *
  675. * Availability:
  676. * Mac OS X: in version 10.2 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.4
  677. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  678. * Non-Carbon CFM: not available
  679. }
  680. function SwapQDTextFlags( newFlags: UInt32 ): UInt32; external name '_SwapQDTextFlags';
  681. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  682. {$endc} {not TARGET_CPU_64}
  683. {$endc} {TARGET_OS_MAC}
  684. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  685. end.
  686. {$endc} {not MACOSALLINCLUDE}