ATSUnicodeDrawing.pas 83 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886
  1. {
  2. File: QD/ATSUnicodeDrawing.h
  3. Contains: ATSUI drawing, measuring, and highlighting functions.
  4. Version: Quickdraw-285~150
  5. Copyright: © 2003-2008 by Apple Inc. all rights reserved.
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://www.freepascal.org/bugs.html
  9. }
  10. { Pascal Translation: Peter N Lewis, <[email protected]>, 2004 }
  11. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, October 2009 }
  12. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, October 2012 }
  13. {
  14. Modified for use with Free Pascal
  15. Version 308
  16. Please report any bugs to <[email protected]>
  17. }
  18. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  19. {$mode macpas}
  20. {$packenum 1}
  21. {$macro on}
  22. {$inline on}
  23. {$calling mwpascal}
  24. unit ATSUnicodeDrawing;
  25. interface
  26. {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
  27. {$setc GAP_INTERFACES_VERSION := $0308}
  28. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  29. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  30. {$endc}
  31. {$ifc defined CPUPOWERPC and defined CPUI386}
  32. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  33. {$endc}
  34. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  35. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  36. {$endc}
  37. {$ifc not defined __ppc__ and defined CPUPOWERPC32}
  38. {$setc __ppc__ := 1}
  39. {$elsec}
  40. {$setc __ppc__ := 0}
  41. {$endc}
  42. {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
  43. {$setc __ppc64__ := 1}
  44. {$elsec}
  45. {$setc __ppc64__ := 0}
  46. {$endc}
  47. {$ifc not defined __i386__ and defined CPUI386}
  48. {$setc __i386__ := 1}
  49. {$elsec}
  50. {$setc __i386__ := 0}
  51. {$endc}
  52. {$ifc not defined __x86_64__ and defined CPUX86_64}
  53. {$setc __x86_64__ := 1}
  54. {$elsec}
  55. {$setc __x86_64__ := 0}
  56. {$endc}
  57. {$ifc not defined __arm__ and defined CPUARM}
  58. {$setc __arm__ := 1}
  59. {$elsec}
  60. {$setc __arm__ := 0}
  61. {$endc}
  62. {$ifc defined cpu64}
  63. {$setc __LP64__ := 1}
  64. {$elsec}
  65. {$setc __LP64__ := 0}
  66. {$endc}
  67. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  68. {$error Conflicting definitions for __ppc__ and __i386__}
  69. {$endc}
  70. {$ifc defined __ppc__ and __ppc__}
  71. {$setc TARGET_CPU_PPC := TRUE}
  72. {$setc TARGET_CPU_PPC64 := FALSE}
  73. {$setc TARGET_CPU_X86 := FALSE}
  74. {$setc TARGET_CPU_X86_64 := FALSE}
  75. {$setc TARGET_CPU_ARM := FALSE}
  76. {$setc TARGET_OS_MAC := TRUE}
  77. {$setc TARGET_OS_IPHONE := FALSE}
  78. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  79. {$setc TARGET_OS_EMBEDDED := FALSE}
  80. {$elifc defined __ppc64__ and __ppc64__}
  81. {$setc TARGET_CPU_PPC := FALSE}
  82. {$setc TARGET_CPU_PPC64 := TRUE}
  83. {$setc TARGET_CPU_X86 := FALSE}
  84. {$setc TARGET_CPU_X86_64 := FALSE}
  85. {$setc TARGET_CPU_ARM := FALSE}
  86. {$setc TARGET_OS_MAC := TRUE}
  87. {$setc TARGET_OS_IPHONE := FALSE}
  88. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  89. {$setc TARGET_OS_EMBEDDED := FALSE}
  90. {$elifc defined __i386__ and __i386__}
  91. {$setc TARGET_CPU_PPC := FALSE}
  92. {$setc TARGET_CPU_PPC64 := FALSE}
  93. {$setc TARGET_CPU_X86 := TRUE}
  94. {$setc TARGET_CPU_X86_64 := FALSE}
  95. {$setc TARGET_CPU_ARM := FALSE}
  96. {$ifc defined(iphonesim)}
  97. {$setc TARGET_OS_MAC := FALSE}
  98. {$setc TARGET_OS_IPHONE := TRUE}
  99. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  100. {$elsec}
  101. {$setc TARGET_OS_MAC := TRUE}
  102. {$setc TARGET_OS_IPHONE := FALSE}
  103. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  104. {$endc}
  105. {$setc TARGET_OS_EMBEDDED := FALSE}
  106. {$elifc defined __x86_64__ and __x86_64__}
  107. {$setc TARGET_CPU_PPC := FALSE}
  108. {$setc TARGET_CPU_PPC64 := FALSE}
  109. {$setc TARGET_CPU_X86 := FALSE}
  110. {$setc TARGET_CPU_X86_64 := TRUE}
  111. {$setc TARGET_CPU_ARM := FALSE}
  112. {$setc TARGET_OS_MAC := TRUE}
  113. {$setc TARGET_OS_IPHONE := FALSE}
  114. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  115. {$setc TARGET_OS_EMBEDDED := FALSE}
  116. {$elifc defined __arm__ and __arm__}
  117. {$setc TARGET_CPU_PPC := FALSE}
  118. {$setc TARGET_CPU_PPC64 := FALSE}
  119. {$setc TARGET_CPU_X86 := FALSE}
  120. {$setc TARGET_CPU_X86_64 := FALSE}
  121. {$setc TARGET_CPU_ARM := TRUE}
  122. { will require compiler define when/if other Apple devices with ARM cpus ship }
  123. {$setc TARGET_OS_MAC := FALSE}
  124. {$setc TARGET_OS_IPHONE := TRUE}
  125. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  126. {$setc TARGET_OS_EMBEDDED := TRUE}
  127. {$elsec}
  128. {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
  129. {$endc}
  130. {$ifc defined __LP64__ and __LP64__ }
  131. {$setc TARGET_CPU_64 := TRUE}
  132. {$elsec}
  133. {$setc TARGET_CPU_64 := FALSE}
  134. {$endc}
  135. {$ifc defined FPC_BIG_ENDIAN}
  136. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  137. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  138. {$elifc defined FPC_LITTLE_ENDIAN}
  139. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  140. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  141. {$elsec}
  142. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  143. {$endc}
  144. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  145. {$setc CALL_NOT_IN_CARBON := FALSE}
  146. {$setc OLDROUTINENAMES := FALSE}
  147. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  148. {$setc OPAQUE_UPP_TYPES := TRUE}
  149. {$setc OTCARBONAPPLICATION := TRUE}
  150. {$setc OTKERNEL := FALSE}
  151. {$setc PM_USE_SESSION_APIS := TRUE}
  152. {$setc TARGET_API_MAC_CARBON := TRUE}
  153. {$setc TARGET_API_MAC_OS8 := FALSE}
  154. {$setc TARGET_API_MAC_OSX := TRUE}
  155. {$setc TARGET_CARBON := TRUE}
  156. {$setc TARGET_CPU_68K := FALSE}
  157. {$setc TARGET_CPU_MIPS := FALSE}
  158. {$setc TARGET_CPU_SPARC := FALSE}
  159. {$setc TARGET_OS_UNIX := FALSE}
  160. {$setc TARGET_OS_WIN32 := FALSE}
  161. {$setc TARGET_RT_MAC_68881 := FALSE}
  162. {$setc TARGET_RT_MAC_CFM := FALSE}
  163. {$setc TARGET_RT_MAC_MACHO := TRUE}
  164. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  165. {$setc TYPE_BOOL := FALSE}
  166. {$setc TYPE_EXTENDED := FALSE}
  167. {$setc TYPE_LONGLONG := TRUE}
  168. uses MacTypes,TextCommon,QuickdrawTypes,ATSLayoutTypes,ATSUnicodeTypes;
  169. {$endc} {not MACOSALLINCLUDE}
  170. {$ifc TARGET_OS_MAC}
  171. {$ALIGN POWER}
  172. { ---------------------------------------------------------------------------- }
  173. { ATSUI drawing and measuring }
  174. { ---------------------------------------------------------------------------- }
  175. {
  176. * ATSUDrawText() *** DEPRECATED ***
  177. *
  178. * Deprecated:
  179. * Use CTFrameDraw, CTLiineDraw, or CTRunDraw instead.
  180. *
  181. * Summary:
  182. * Draws a specified range of text in a QuickDraw graphics port or
  183. * Quartz graphics context.
  184. *
  185. * Discussion:
  186. * Before calling ATSUDrawText, you will most likely want to call
  187. * ATSUSetLayoutControls to set a value for the kATSUCGContextTag
  188. * attribute in order to specify your current graphics context.
  189. * Otherwise, ATSUI will attempt to draw using Quickdraw style text
  190. * rendering in whatever Quickdraw GrafPort is currently active (use
  191. * SetPort to determine the currently active Quickdraw GrafPort, see
  192. * Quickdraw.h). Carbon applications can create a CGContext from a
  193. * Quickdraw GrafPort using the functions QDBeginCGContext and
  194. * QDEndCGContext (see Quickdraw.h). Cocoa applications can call the
  195. * method "graphicsPort" on the current NSGraphicsContext in order
  196. * to get a CGContextRef to pass into ATSUI (use the method
  197. * "currentContext" to obtain the current NSGraphicsContext, see
  198. * NSGraphicsContext.h for more information). ATSUDrawText examines
  199. * the text layout object to ensure that each of the characters in
  200. * the range is assigned to a style run. If there are gaps between
  201. * style runs, ATSUI assigns the characters in the gap to the style
  202. * run that precedes (in storage order) the gap. If there is no
  203. * style run at the beginning of the text range, ATSUI assigns these
  204. * characters to the first style run it finds. If there is no style
  205. * run at the end of the text range, ATSUI assigns the remaining
  206. * characters to the last style run it finds. If you want to draw a
  207. * range of text that spans multiple lines, you should call
  208. * ATSUDrawText for each line of text to draw, even if all the lines
  209. * are in the same text layout object. You should adjust the
  210. * iLineOffset parameter to reflect the beginning of each line to be
  211. * drawn. Please note that when drawing into a GrafPort, calls to
  212. * QDSwapTextFlags have no effect on ATSUI text rendering. The
  213. * proper way to achieve Quartz text rendering from ATSUI is to use
  214. * the kATSUCGContextTag attribute to specify a CGContextRef in each
  215. * ATSUTextLayout before calling ATSUDrawText.
  216. *
  217. * Parameters:
  218. *
  219. * iTextLayout:
  220. * A layout containing text to draw.
  221. *
  222. * iLineOffset:
  223. * The starting offset of the range of text to draw. To specify
  224. * the beginning of the text buffer, pass kATSUFromTextBeginning
  225. * for this parameter.
  226. *
  227. * iLineLength:
  228. * The length of the range of text to draw. To specify a range
  229. * that continues to the end of the text buffer, pass
  230. * kATSUToTextEnd for this parameter.
  231. *
  232. * iLocationX:
  233. * The x-coordinate of the origin (in either the current graphics
  234. * port or Quartz graphics context) of the line containing the
  235. * text range to render. Note that the ATSUTextMeasurement type is
  236. * defined as a Fixed value, so you must ensure that your
  237. * coordinates are converted to Fixed values before passing them
  238. * to this function (see FixMath.h for conversion functions). Pass
  239. * the constant kATSUUseGrafPortPenLoc to draw relative to the
  240. * current pen location in the current graphics port.
  241. *
  242. * iLocationY:
  243. * The y-coordinate of the origin (in either the current graphics
  244. * port or Quartz graphics context) of the line containing the
  245. * text range to render. Note that the ATSUTextMeasurement type is
  246. * defined as a Fixed value, so you must ensure that your
  247. * coordinates are converted to Fixed values before passing them
  248. * to this function (see FixMath.h for conversion functions). Pass
  249. * the constant kATSUUseGrafPortPenLoc to draw relative to the
  250. * current pen location in the current graphics port.
  251. *
  252. * Result:
  253. * On success, noErr is returned. See MacErrors.h for possible error
  254. * codes.
  255. *
  256. * Availability:
  257. * Mac OS X: in version 10.0 and later in ApplicationServices.framework but deprecated in 10.6
  258. * CarbonLib: in CarbonLib 1.0 and later
  259. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  260. }
  261. function ATSUDrawText( iTextLayout: ATSUTextLayout; iLineOffset: UniCharArrayOffset; iLineLength: UniCharCount; iLocationX: ATSUTextMeasurement; iLocationY: ATSUTextMeasurement ): OSStatus; external name '_ATSUDrawText';
  262. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
  263. {$ifc not TARGET_CPU_64}
  264. {
  265. * ATSUGetUnjustifiedBounds() *** DEPRECATED ***
  266. *
  267. * Deprecated:
  268. * Use CTLineGetTypographicBounds or
  269. * CTLineGetTrailingWhitespaceWidth instead.
  270. *
  271. * Summary:
  272. * Obtains the typographic bounding rectangle for a line of text
  273. * prior to final layout.
  274. *
  275. * Discussion:
  276. * This function calculates the typographic bounds (in coordinates
  277. * independent of the rendering device) for a line of text. Note
  278. * that ATSUGetUnjustifiedBounds calculates these bounds prior to
  279. * the text's final layout, and therefore, the calculated bounds
  280. * might not reflect those of the final laid-out line.
  281. * Justification, truncation, and device level positioning are not
  282. * taken into account. To obtain the typographic bounds of a line
  283. * after it is laid out, you can call the function
  284. * ATSUGetGlyphBounds. For more infomration about the difference
  285. * between typographic and image bounds, please refer to the ATSUI
  286. * documentation. Note that ATSUGetUnjustifiedBounds treats the
  287. * specified text range as a single line. That is, if the range of
  288. * text you specify is less than a line, it nevertheless treats the
  289. * initial character in the range as the start of a line, for
  290. * measuring purposes. If the range of text extends beyond a line,
  291. * ATSUGetUnjustifiedBounds ignores soft line breaks, again,
  292. * treating the text as a single line.
  293. *
  294. * Parameters:
  295. *
  296. * iTextLayout:
  297. * The text layout object to obtain bounds information for.
  298. *
  299. * iLineStart:
  300. * The start of the line of text to obtain bounds information for.
  301. * To indicate that the line starts at the beginning of the text
  302. * buffer, you can pass the constant kATSUFromTextBeginning . To
  303. * specify the entire text buffer, pass kATSUFromTextBeginning in
  304. * this parameter and kATSUToTextEnd in the iLineLength parameter.
  305. *
  306. * iLineLength:
  307. * The length of the line to obtain bounds information for. If you
  308. * want the line to extend to the end of the text buffer, you can
  309. * pass the constant kATSUToTextEnd .
  310. *
  311. * oTextBefore:
  312. * On return, the value specifies the starting point of the
  313. * typographic bounds for the line, relative to the origin (0,0)
  314. * of the line and taking into account cross-stream shifting. Note
  315. * that the ATSUMeasureText function might produce negative values
  316. * for the typographic starting point of the line if, for example,
  317. * the initial character of the line is allowed to hang into the
  318. * margin. For horizontal text, this value corresponds to the left
  319. * side of the bounding rectangle.
  320. *
  321. * oTextAfter:
  322. * On return, the end point of the typographic bounds for the
  323. * line, relative to the origin (0,0) of the line and taking into
  324. * account cross-stream shifting. For horizontal text, this value
  325. * corresponds to the right side of the bounding rectangle.
  326. *
  327. * oAscent:
  328. * On return, the typographic bounds for the line, relative to the
  329. * origin (0,0) of the line and taking into account cross-stream
  330. * shifting. For horizontal text, this value corresponds to the
  331. * top side of the bounding rectangle.
  332. *
  333. * oDescent:
  334. * On return, the typographic bounds for the line, relative to the
  335. * origin (0,0) of the line and taking into account cross-stream
  336. * shifting. For horizontal text, this value corresponds to the
  337. * bottom side of the bounding rectangle.
  338. *
  339. * Result:
  340. * On success, noErr is returned. See MacErrors.h for possible error
  341. * codes.
  342. *
  343. * Availability:
  344. * Mac OS X: in version 10.2 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
  345. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  346. * Non-Carbon CFM: not available
  347. }
  348. function ATSUGetUnjustifiedBounds( iTextLayout: ATSUTextLayout; iLineStart: UniCharArrayOffset; iLineLength: UniCharCount; var oTextBefore: ATSUTextMeasurement; var oTextAfter: ATSUTextMeasurement; var oAscent: ATSUTextMeasurement; var oDescent: ATSUTextMeasurement ): OSStatus; external name '_ATSUGetUnjustifiedBounds';
  349. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
  350. {
  351. * ATSUMeasureTextImage() *** DEPRECATED ***
  352. *
  353. * Deprecated:
  354. * Use CTLineGetImageBounds or CTRunGetImageBounds instead.
  355. *
  356. * Summary:
  357. * Obtains the image bounding rectangle for a line of text after
  358. * final layout.
  359. *
  360. * Discussion:
  361. * This function obtains the image bounds of a laid-out line of
  362. * text. These bounds are described by the smallest rectangle that
  363. * completely encloses the filled or framed parts of a block of
  364. * textÑthat is, the text's "inked" glyphs. In measuring the line,
  365. * the ATSUMeasureTextImage function takes into account line
  366. * rotation, alignment, and justification, as well as other
  367. * characteristics that affect layout, such as hanging punctuation.
  368. * (If the line is rotated, the sides of the rectangle are parallel
  369. * to the coordinate axes and encompass the rotated line.) If no
  370. * attributes are set for the line, ATSUMeasureTextImage uses the
  371. * global attributes set for the text layout object. Because the
  372. * height of the image bounding rectangle is determined by the
  373. * actual device metrics, ATSUMeasureTextImage ignores any
  374. * previously set line ascent and descent values for the line it is
  375. * measuring.
  376. *
  377. * Parameters:
  378. *
  379. * iTextLayout:
  380. * The text layout for which to obtain image bounds.
  381. *
  382. * iLineOffset:
  383. * The first character of the line to examine. To indicate that
  384. * the specified line starts at the beginning of the text buffer,
  385. * you can pass the constant kATSUFromTextBeginning . To specify
  386. * the entire text buffer, pass kATSUFromTextBeginning in this
  387. * parameter and kATSUToTextEnd in the iLineLength parameter.
  388. *
  389. * iLineLength:
  390. * The length of the text range. If you want the range of text to
  391. * extend to the end of the text buffer, you can pass the constant
  392. * kATSUToTextEnd . However, the image bounds is restricted to the
  393. * line in which iLineOffset resides.
  394. *
  395. * iLocationX:
  396. * The x-coordinate of the line's origin in the current graphics
  397. * port or Quartz graphics context. Pass the constant
  398. * kATSUUseGrafPortPenLoc for the dimensions of the bounds
  399. * relative to the current pen location in the current graphics
  400. * port or graphics context. You can pass 0to obtain only the
  401. * dimensions of the bounding rectangle relative to one another,
  402. * not their actual onscreen position.
  403. *
  404. * iLocationY:
  405. * The y-coordinate of the line's origin in the current graphics
  406. * port or Quartz graphics context. Pass the constant
  407. * kATSUUseGrafPortPenLoc for the dimensions of the bounds
  408. * relative to the current pen location in the current graphics
  409. * port or graphics context. You can pass 0to obtain only the
  410. * dimensions of the bounding rectangle relative to one another,
  411. * not their actual onscreen position.
  412. *
  413. * oTextImageRect:
  414. * On return, the dimensions of the image bounding rectangle for
  415. * the text, offset by the values specified in the iLocationX and
  416. * iLocationY parameters. If the line is rotated, the sides of the
  417. * rectangle are parallel to the coordinate axis.
  418. *
  419. * Result:
  420. * On success, noErr is returned. See MacErrors.h for possible error
  421. * codes.
  422. *
  423. * Availability:
  424. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
  425. * CarbonLib: in CarbonLib 1.0 and later
  426. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  427. }
  428. function ATSUMeasureTextImage( iTextLayout: ATSUTextLayout; iLineOffset: UniCharArrayOffset; iLineLength: UniCharCount; iLocationX: ATSUTextMeasurement; iLocationY: ATSUTextMeasurement; var oTextImageRect: Rect ): OSStatus; external name '_ATSUMeasureTextImage';
  429. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
  430. {$endc} {not TARGET_CPU_64}
  431. {
  432. * ATSUGetGlyphBounds() *** DEPRECATED ***
  433. *
  434. * Deprecated:
  435. * Use CTRunGetTypographicBounds, CTLineGetTypographicBounds,
  436. * CTFontGetAscent, CTFontGetDescent, CTFontGetLeading, or
  437. * CTFontGetUnitsPerEm instead.
  438. *
  439. * Summary:
  440. * Obtains the typographic bounds of a line of glyphs after final
  441. * layout.
  442. *
  443. * Discussion:
  444. * This function produces the enclosing trapezoid(s) that represent
  445. * the typographic bounds for glyphs in a final, laid-out range of
  446. * text. You typically call this function when you need to obtain an
  447. * enclosing trapezoid for a line, taking rotation and all other
  448. * layout attributes into account. ATSUI determines the height of
  449. * each trapezoid by examining any line ascent and descent attribute
  450. * values you may have set for the line. If you have not set these
  451. * attributes for the line, the ATSUGetGlyphBounds function uses any
  452. * line ascent and descent values you may have set for the text
  453. * layout object containing the line. If these are not set,
  454. * ATSUGetGlyphBounds uses the font's natural line ascent and
  455. * descent values for the line. If these are previously set,
  456. * ATSUGetGlyphBounds uses the ATSUStyle ascent and or
  457. * descent/leading values. Note that the coordinates produced for
  458. * the trapezoid(s) are offset by the amount specified in the
  459. * iTextBasePointX and iTextBasePointY parameters. If your goal in
  460. * calling the ATSUGetGlyphBounds function is to obtain metrics for
  461. * drawing the typographic bounds on the screen, pass the position
  462. * of the origin of the line in the current graphics port or
  463. * graphics context in these parameters. This enables
  464. * ATSUGetGlyphBounds to match the trapezoids to their onscreen
  465. * image. When the range specified by the iBoundsCharStart and
  466. * iBoundsCharLength parameters covers an entire line, you are
  467. * guaranteed to receive only one trapezoid on return. Otherwise,
  468. * multiple trapezoids may be returned to cover incomplete sections
  469. * of bidi runs. In such cases, you would typically call
  470. * ATSUGetGlyphBounds twice, as follows: (1) Pass NULL for the
  471. * oGlyphBounds parameter, 0 for the iMaxNumberOfBounds parameter,
  472. * and valid values for the other parameters. The ATSUGetGlyphBounds
  473. * function returns the actual number of trapezoids needed to
  474. * enclose the glyphs in the oActualNumberOfBounds parameter. (2)
  475. * Allocate enough space for a buffer of the returned size, then
  476. * call the function again, passing a valid pointer to the buffer in
  477. * the oGlyphBounds parameter. On return, the buffer contains the
  478. * trapezoids for the glyphs' typographic bounds. To obtain the
  479. * typographic bounds of a line of text prior to line layout, call
  480. * the function ATSUGetUnjustifiedBounds. To calculate the image
  481. * bounding rectangle for a final laid-out line, call the function
  482. * ATSUMeasureTextImage. For more infomration about the difference
  483. * between typographic and image bounds, please refer to the ATSUI
  484. * documentation.
  485. *
  486. * Parameters:
  487. *
  488. * iTextLayout:
  489. * The text layout object for which glyph bounds are to be
  490. * obtained.
  491. *
  492. * iTextBasePointX:
  493. * The x-coordinate of the origin of the line containing the
  494. * glyphs in the current graphics port or Quartz graphics context.
  495. * Pass the constant kATSUUseGrafPortPenLoc to obtain the glyph
  496. * bounds relative to the current pen location in the current
  497. * graphics port or graphics context. You may pass 0 to obtain
  498. * only the dimensions of the bounds relative to one another, not
  499. * their actual onscreen position.
  500. *
  501. * iTextBasePointY:
  502. * The y-coordinate of the origin of the line containing the
  503. * glyphs in the current graphics port or Quartz graphics context.
  504. * Pass the constant kATSUUseGrafPortPenLoc to obtain the glyph
  505. * bounds relative to the current pen location in the current
  506. * graphics port or graphics context. You may pass 0 to obtain
  507. * only the dimensions of the bounds relative to one another, not
  508. * their actual onscreen position.
  509. *
  510. * iBoundsCharStart:
  511. * The offset from the beginning of the text buffer to the
  512. * character corresponding to the first glyph to measure. To
  513. * indicate that the text range starts at the beginning of the
  514. * text buffer, you can pass the constant kATSUFromTextBeginning.
  515. *
  516. * iBoundsCharLength:
  517. * The length of text range to measure. If you want the range to
  518. * extend to the end of the text buffer, you can pass the constant
  519. * kATSUToTextEnd.
  520. *
  521. * iTypeOfBounds:
  522. * The type of bounds you wish to obtain. See ATSLayoutTypes.h for
  523. * a list of possible values to pass in here.
  524. *
  525. * iMaxNumberOfBounds:
  526. * The maximum number of bounding trapezoids to obtain. Typically,
  527. * this is equivalent to the number of bounds in the oGlyphBounds
  528. * array. To determine this value, see the Discussion.
  529. *
  530. * oGlyphBounds:
  531. * A pointer to memory you have allocated for an array of
  532. * ATSTrapezoid values. On return, the array contains a trapezoid
  533. * representing the typographic bounds for glyphs in the text
  534. * range. If the specified range of text encloses nested
  535. * bidirectional text, ATSUGetGlyphBounds produces multiple
  536. * trapezoids defining these regions.In ATSUI 1.1, the maximum
  537. * number of enclosing trapezoids that can be returned is 31; in
  538. * ATSUI 1.2, the maximum number is 127. If you pass a range that
  539. * covers an entire line, ATSUGetGlyphBounds always returns only 1
  540. * trapezoid. If you are uncertain of how much memory to allocate
  541. * for this array, see the Discussion.
  542. *
  543. * oActualNumberOfBounds:
  544. * On return, the value specifies the actual number of enclosing
  545. * trapezoids bounding the specified characters. This may be
  546. * greater than the value you provide in the iMaxNumberOfBounds
  547. * parameter.
  548. *
  549. * Result:
  550. * On success, noErr is returned. See MacErrors.h for possible error
  551. * codes.
  552. *
  553. * Availability:
  554. * Mac OS X: in version 10.0 and later in ApplicationServices.framework but deprecated in 10.6
  555. * CarbonLib: in CarbonLib 1.0 and later
  556. * Non-Carbon CFM: in ATSUnicodeLib 8.6 and later
  557. }
  558. function ATSUGetGlyphBounds( iTextLayout: ATSUTextLayout; iTextBasePointX: ATSUTextMeasurement; iTextBasePointY: ATSUTextMeasurement; iBoundsCharStart: UniCharArrayOffset; iBoundsCharLength: UniCharCount; iTypeOfBounds: UInt16; iMaxNumberOfBounds: ItemCount; oGlyphBounds: {variable-size-array} ATSTrapezoidPtr { can be NULL }; var oActualNumberOfBounds: ItemCount ): OSStatus; external name '_ATSUGetGlyphBounds';
  559. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
  560. { ---------------------------------------------------------------------------- }
  561. { ATSUI line breaking }
  562. { ---------------------------------------------------------------------------- }
  563. {$ifc not TARGET_CPU_64}
  564. {
  565. * ATSUBatchBreakLines() *** DEPRECATED ***
  566. *
  567. * Deprecated:
  568. * Use CTTypesetterSuggestLineBreak,
  569. * CTTypesetterSuggestClusterBreak, or CTTypesetterCreateLine
  570. * instead.
  571. *
  572. * Summary:
  573. * Soft wraps a range of text in a layout to a constant line width.
  574. *
  575. * Discussion:
  576. * Equivalent to repeatedly calling the ATSUBreakLine function with
  577. * the parameter iUseAsSoftLineBreak set to true. Use this function
  578. * to gain a substantial performance increase over the use of
  579. * ATSUBreakLine. It will set soft breaks in a layout for multiple
  580. * lines in a single call. It assumes constant line width. Soft line
  581. * breaks within a layout are what divide it into lines. You can
  582. * manipulate the soft breaks that are currently set within a layout
  583. * using the functions ATSUGetSoftLineBreaks, ATSUSetSoftLineBreak,
  584. * and ATSUClearSoftLineBreaks.
  585. *
  586. * Parameters:
  587. *
  588. * iTextLayout:
  589. * The layout containing text to be soft wrapped.
  590. *
  591. * iRangeStart:
  592. * Beginning offset for the rage of text to be soft wrapped.
  593. *
  594. * iRangeLength:
  595. * The length of the range of text to be soft wrapped.
  596. *
  597. * iLineWidth:
  598. * The line width at which to force soft wrapping of text. Note
  599. * that this parameter is of type ATSUTextMeasurement, which is
  600. * defined as Fixed. See FixMath.h for conversion routines for
  601. * fixed point values.
  602. *
  603. * oBreakCount:
  604. * On return, the number of soft breaks that were set in the
  605. * layout. Use this to determine how much memory to allocate when
  606. * calling ATSUGetSoftLineBreaks.
  607. *
  608. * Result:
  609. * On success, noErr is returned. See MacErrors.h for possible error
  610. * codes.
  611. *
  612. * Availability:
  613. * Mac OS X: in version 10.2 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
  614. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  615. * Non-Carbon CFM: not available
  616. }
  617. function ATSUBatchBreakLines( iTextLayout: ATSUTextLayout; iRangeStart: UniCharArrayOffset; iRangeLength: UniCharCount; iLineWidth: ATSUTextMeasurement; oBreakCount: ItemCountPtr { can be NULL } ): OSStatus; external name '_ATSUBatchBreakLines';
  618. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
  619. {
  620. * ATSUBreakLine() *** DEPRECATED ***
  621. *
  622. * Deprecated:
  623. * Use CTTypesetterSuggestLineBreak,
  624. * CTTypesetterSuggestClusterBreak, or CTTypesetterCreateLine
  625. * instead.
  626. *
  627. * Summary:
  628. * Soft wraps a single line of text within a layout.
  629. *
  630. * Discussion:
  631. * This function will automatically determine the optimal place to
  632. * set a soft break in a given range of text. It suggests a soft
  633. * line break each time it encounters a hard line break character
  634. * such as a carriage return, line feed, form feed, line separator,
  635. * or paragraph separator. If ATSUBreakLine does not encounter a
  636. * hard line break, it uses the line width you specify to determine
  637. * how many characters fit on a line and suggests soft line breaks
  638. * accordingly. You can loop over ATSUBreakLine, repeatedly calling
  639. * it on the same layout, until all the text in the entire layout
  640. * has been soft wrapped. However, for maximum efficiency, you
  641. * should use ATSUBatchBreakLines. ATSUBreakLine should only be used
  642. * if you have special needs, such as a non-constant line width.
  643. *
  644. * Parameters:
  645. *
  646. * iTextLayout:
  647. * The layout containing text to be soft wrapped.
  648. *
  649. * iLineStart:
  650. * The beginning of the line you wish to soft wrap. To specify the
  651. * beginning of the text buffer, pass the constant
  652. * kATSUFromTextBeginning.
  653. *
  654. * iLineWidth:
  655. * The line width at which to force soft wrapping of text. Note
  656. * that this parameter is of type ATSUTextMeasurement, which is
  657. * defined as Fixed. See FixMath.h for conversion routines for
  658. * fixed point values.
  659. *
  660. * iUseAsSoftLineBreak:
  661. * A Boolean value indicating whether ATSUBreakLine should
  662. * automatically set the line break produced in the oLineBreak
  663. * parameter. If true ,ATSUBreakLine sets the line break and
  664. * clears any previously-set soft line breaks that precede the new
  665. * break in the line but lie after the offset specified by
  666. * iLineStart. You should ususally pass true for this parameter,
  667. * unless you plan to use ATSUSetSoftLineBreak to set the soft
  668. * break somewhere other than what is suggested by ATSUBreakLine.
  669. *
  670. * oLineBreak:
  671. * On return, the value specifies the soft line break as
  672. * determined by ATSUBreakLine. If the value returned is the same
  673. * value as specified in iLineStart , you have made an input
  674. * parameter error. In this case, check to make sure that the line
  675. * width specified in iLineWidth is big enough for ATSUBreakLine
  676. * to perform line breaking. ATSUBreakLine does not return an
  677. * error in this case.
  678. *
  679. * Result:
  680. * On success, noErr is returned. TSUI usually calculates a soft
  681. * line break to be at the beginning of the first word that does ont
  682. * fit on the line. But if ATSUBreakLine calculates the most optimal
  683. * line break to be in the middle of a word, it returns the result
  684. * code kATSULineBreakInWord. Note that ATSUI produces a line break
  685. * in the middle of a word only as a last resort. See MacErrors.h
  686. * for other possible error codes.
  687. *
  688. * Availability:
  689. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
  690. * CarbonLib: in CarbonLib 1.0 and later
  691. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  692. }
  693. function ATSUBreakLine( iTextLayout: ATSUTextLayout; iLineStart: UniCharArrayOffset; iLineWidth: ATSUTextMeasurement; iUseAsSoftLineBreak: Boolean; oLineBreak: UniCharArrayOffsetPtr { can be NULL } ): OSStatus; external name '_ATSUBreakLine';
  694. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
  695. {
  696. * ATSUSetSoftLineBreak() *** DEPRECATED ***
  697. *
  698. * Deprecated:
  699. * Use CTTypesetterSuggestLineBreak,
  700. * CTTypesetterSuggestClusterBreak, or CTTypesetterCreateLine
  701. * instead.
  702. *
  703. * Summary:
  704. * Sets a soft line break at the specified point in a text layout.
  705. *
  706. * Discussion:
  707. * You should typically only call ATSUSetSoftLineBreak to set line
  708. * breaks when you are using your own line-breaking algorithm to
  709. * calculate these breaks. For optimal performance, you should use
  710. * ATSUBatchBreakLines to both calculate and set soft line breaks in
  711. * your text. After calling ATSUSetSoftLineBreak , you should call
  712. * the function ATSUGetUnjustifiedBounds to determine whether the
  713. * characters still fit within the line, which is necessary due to
  714. * end-of-line effects such as swashes.
  715. *
  716. * Parameters:
  717. *
  718. * iTextLayout:
  719. * The layout in which to set the soft break.
  720. *
  721. * iLineBreak:
  722. * An offset into the text buffer specifying the location to set
  723. * the soft break at.
  724. *
  725. * Result:
  726. * On success, noErr is returned. See MacErrors.h for possible error
  727. * codes.
  728. *
  729. * Availability:
  730. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
  731. * CarbonLib: in CarbonLib 1.0 and later
  732. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  733. }
  734. function ATSUSetSoftLineBreak( iTextLayout: ATSUTextLayout; iLineBreak: UniCharArrayOffset ): OSStatus; external name '_ATSUSetSoftLineBreak';
  735. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
  736. {
  737. * ATSUGetSoftLineBreaks() *** DEPRECATED ***
  738. *
  739. * Deprecated:
  740. * Use CTTypesetterSuggestLineBreak,
  741. * CTTypesetterSuggestClusterBreak, or CTTypesetterCreateLine
  742. * instead.
  743. *
  744. * Summary:
  745. * Obtains the soft line breaks that are currently set in a given
  746. * text range.
  747. *
  748. * Discussion:
  749. * Typically you use the function ATSUGetSoftLineBreaks by calling
  750. * it twice, as follows: (1) Pass valid values for the iTextLayout,
  751. * iRangeStart, iRangeLength, and oBreakCount parameters. Pass NULL
  752. * for the oBreaks parameter and 0 for the iMaximumBreaks parameter.
  753. * ATSUGetSoftLineBreaks returns the size of the font array in the
  754. * oBreakCount parameter. (2) Allocate enough space for an array of
  755. * the returned size, then call the function again, passing a valid
  756. * pointer in the oBreaks parameter. On return, the pointer refers
  757. * to an array containing the text range's soft line breaks. If you
  758. * have just called ATSUBatchBreakLines, the oBreakCount parameter
  759. * will give you the value you would normally obtain from step 1,
  760. * allowing you to skip this step in such cases.
  761. *
  762. * Parameters:
  763. *
  764. * iTextLayout:
  765. * A text layout to obtain a list of soft breaks from.
  766. *
  767. * iRangeStart:
  768. * The beginning of the range of text for which to obtain a list
  769. * of softbreaks. To indicate that the specified text range starts
  770. * at the beginning of the text buffer, you can pass the constant
  771. * kATSUFromTextBeginning, To specify the entire text buffer, pass
  772. * kATSUFromTextBeginning in this parameter and kATSUToTextEnd in
  773. * the iRangeLength parameter.
  774. *
  775. * iRangeLength:
  776. * The end of the range of text for which to obtain a list of
  777. * softbreaks. If you want the range of text to extend to the end
  778. * of the text buffer, you can pass the constant kATSUToTextEnd.
  779. *
  780. * iMaximumBreaks:
  781. * The maximum number of soft line breaks to obtain. Typically,
  782. * this is equivalent to the number of UniCharArrayOffset values
  783. * for which you have allocated memory in the oBreaks array. To
  784. * determine this value, see the Discussion.
  785. *
  786. * oBreaks:
  787. * On return, the array contains offsets from the beginning of the
  788. * text buffer to each of the soft line breaks in the text range.
  789. * If you are uncertain of how much memory to allocate for this
  790. * array, see the Discussion.
  791. *
  792. * oBreakCount:
  793. * On return, the number of soft breaks set in iTextLayout. Note
  794. * that this value may be greater than what you pass in for
  795. * iMaximumBreaks.
  796. *
  797. * Result:
  798. * On success, noErr is returned. See MacErrors.h for possible error
  799. * codes.
  800. *
  801. * Availability:
  802. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
  803. * CarbonLib: in CarbonLib 1.0 and later
  804. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  805. }
  806. function ATSUGetSoftLineBreaks( iTextLayout: ATSUTextLayout; iRangeStart: UniCharArrayOffset; iRangeLength: UniCharCount; iMaximumBreaks: ItemCount; oBreaks: {variable-size-array} UniCharArrayOffsetPtr { can be NULL }; oBreakCount: ItemCountPtr { can be NULL } ): OSStatus; external name '_ATSUGetSoftLineBreaks';
  807. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
  808. {
  809. * ATSUClearSoftLineBreaks() *** DEPRECATED ***
  810. *
  811. * Deprecated:
  812. * Use CTTypesetterSuggestLineBreak,
  813. * CTTypesetterSuggestClusterBreak, or CTTypesetterCreateLine
  814. * instead.
  815. *
  816. * Summary:
  817. * Unsets any currently set soft breaks in a range of text.
  818. *
  819. * Discussion:
  820. * This function clears all previously set soft line breaks for the
  821. * specified text range and clears any associated layout caches as
  822. * well.
  823. *
  824. * Parameters:
  825. *
  826. * iTextLayout:
  827. * The text layout object for which to remove line breaks.
  828. *
  829. * iRangeStart:
  830. * The beginning of the text range over which to clear soft line
  831. * breaks. To indicate that the specified text range starts at the
  832. * beginning of the text buffer, you can pass the constant
  833. * kATSUFromTextBeginning . To specify the entire text buffer,
  834. * pass kATSUFromTextBeginning in this parameter and
  835. * kATSUToTextEnd in the iRangeLength parameter.
  836. *
  837. * iRangeLength:
  838. * The length of the text range over which to clear soft line
  839. * breaks. If you want the range of text to extend to the end of
  840. * the text buffer, you can pass the constant kATSUToTextEnd.
  841. *
  842. * Result:
  843. * On success, noErr is returned. See MacErrors.h for possible error
  844. * codes.
  845. *
  846. * Availability:
  847. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
  848. * CarbonLib: in CarbonLib 1.0 and later
  849. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  850. }
  851. function ATSUClearSoftLineBreaks( iTextLayout: ATSUTextLayout; iRangeStart: UniCharArrayOffset; iRangeLength: UniCharCount ): OSStatus; external name '_ATSUClearSoftLineBreaks';
  852. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
  853. { ---------------------------------------------------------------------------- }
  854. { ATSUI highlighting }
  855. { ---------------------------------------------------------------------------- }
  856. {
  857. * ATSUSetHighlightingMethod() *** DEPRECATED ***
  858. *
  859. * Deprecated:
  860. * Use CTLineGetOffsetForStringIndex,
  861. * CTLineGetStringIndexForPosition instead.
  862. *
  863. * Summary:
  864. * Specifies the methods ATSUI will use for highlighting and
  865. * unhighlighting text in a given layout.
  866. *
  867. * Discussion:
  868. * By default, ATSUI highlights text by "inverting" the region
  869. * containing the text, that is, its background color. Although
  870. * inversion provides satisfactory highlighting in most cases, it
  871. * does not always provide the best result for grayscale text. (Mac
  872. * OS X sets a lower threshold for antialiasing, while in Mac OS 9
  873. * grayscale text can be turned off by the user.) In Mac OS X, when
  874. * using a Quartz graphics context, you can instruct ATSUI to use
  875. * the redraw method of highlighting, rather than simple inversion.
  876. * (Note that Cocoa applications always use the redraw method of
  877. * highlighting.) The redraw method allows for accurate highlighting
  878. * of more complex backgrounds, such as those containing multiple
  879. * colors, patterns, or pictures. To set redrawing on, call the
  880. * ATSUSetHighlightingMethod function and specify that the redraw
  881. * method be used (by passing kRedrawHighlighting in the iMethod
  882. * parameter). If you specify the redraw method of highlighting when
  883. * you call ATSUSetHighlightingMethod, then you must also specify
  884. * how the background is to be redrawn when the function
  885. * ATSUUnhighlightText is called. ATSUI can restore the desired
  886. * background in one of two ways, depending on the background's
  887. * complexity: (1) When the background is a single color (such as
  888. * white), ATSUI can readily unhighlight the background. In such a
  889. * case, you specify the background color that ATSUI uses by calling
  890. * ATSUSetHighlightingMethod and setting iUnhighlightData.dataType
  891. * to kATSUBackgroundColor and providing the background color in
  892. * iUnhighlightData.unhighlightData. With these settings defined,
  893. * when you call ATSUUnhighlightText, ATSUI simply calculates the
  894. * previously highlighted area, repaints it with the specified
  895. * background color, and then redraws the text. (2) When the
  896. * background is more complex (containing, for example, multiple
  897. * colors, patterns, or pictures), you must provide a redraw
  898. * background callback function when you call
  899. * ATSUSetHighlightingMethod. You do this by setting
  900. * iUnhighlightData.dataType to kATSUBackgroundCallback and
  901. * providing a RedrawBackgroundUPP in
  902. * iUnhighlightData.unhighlightData . Then when you call
  903. * ATSUUnhighlightText and ATSUI calls your callback, you are
  904. * responsible for redrawing the background of the unhighlighted
  905. * area. If you choose to also redraw the text, then your callback
  906. * should return false as a function result. If your callback
  907. * returns true ATSUI redraws any text that needs to be redrawn. See
  908. * RedrawBackgroundProcPtr for additional information.
  909. *
  910. * Parameters:
  911. *
  912. * iTextLayout:
  913. * The layout to which this highlight method should be applied.
  914. *
  915. * iMethod:
  916. * The type of highlighting to use; inversion
  917. * (kInvertHighlighting) or redrawing (kRedrawHighlighting). The
  918. * default is inversion. If you are happy with that technique
  919. * there is no reason to call this function.
  920. *
  921. * iUnhighlightData:
  922. * Data needed to redraw the background or NULL if inversion is
  923. * being chosen. See the definition of ATSUUnhighlightData for
  924. * more information about the possible contents of this structure.
  925. * Also see the Discussion for this function.
  926. *
  927. * Result:
  928. * On success, noErr is returned. See MacErrors.h for possible error
  929. * codes.
  930. *
  931. * Availability:
  932. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
  933. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
  934. * Non-Carbon CFM: not available
  935. }
  936. function ATSUSetHighlightingMethod( iTextLayout: ATSUTextLayout; iMethod: ATSUHighlightMethod; {const} iUnhighlightData: ATSUUnhighlightDataPtr { can be NULL } ): OSStatus; external name '_ATSUSetHighlightingMethod';
  937. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
  938. {
  939. * ATSUHighlightText() *** DEPRECATED ***
  940. *
  941. * Deprecated:
  942. * Use CTLineGetOffsetForStringIndex,
  943. * CTLineGetStringIndexForPosition instead.
  944. *
  945. * Summary:
  946. * Renders a highlighted range of text at a specified location in a
  947. * QuickDraw graphics port or Quartz graphics context.
  948. *
  949. * Discussion:
  950. * When the user selects a series of glyphs, the characters in
  951. * memory corresponding to the glyphs make up the selection range
  952. * and should be highlighted to indicate where the next editing
  953. * operation is to occur. The characters in a selection range are
  954. * always contiguous in memory, but their corresponding glyphs are
  955. * not necessarily so onscreen. If the selection range crosses a
  956. * direction boundary, it is appropriate to display discontinuous
  957. * highlighting. The ATSUHighlightText function renders a
  958. * highlighted range of text at a specified location in a QuickDraw
  959. * graphics port or Quartz graphics context, using the highlight
  960. * information in the graphics port or context. ATSUHighlightText
  961. * automatically produces discontinuous highlighting, if needed. You
  962. * typically call the ATSUHighlightText function every time you need
  963. * to draw or redraw highlighted text.
  964. *
  965. * Parameters:
  966. *
  967. * iTextLayout:
  968. * A layout containing text to be highlighted.
  969. *
  970. * iTextBasePointX:
  971. * The x-coordinate of the origin (in either the current graphics
  972. * port or in a Quartz graphics context) of the line containing
  973. * the text range. Pass the constant kATSUUseGrafPortPenLoc to
  974. * draw relative to the current pen location in the current
  975. * graphics port.
  976. *
  977. * iTextBasePointY:
  978. * The y-coordinate of the origin (in either the current graphics
  979. * port or in a Quartz graphics context) of the line containing
  980. * the text range. Pass the constant kATSUUseGrafPortPenLoc to
  981. * draw relative to the current pen location in the current
  982. * graphics port.
  983. *
  984. * iHighlightStart:
  985. * The first character of the text range to be highlighted. If the
  986. * text range spans multiple lines, you should call
  987. * ATSUHighlightText for each line, passing the offset
  988. * corresponding to the beginning of the new line to draw with
  989. * each call. To indicate that the specified text range starts at
  990. * the beginning of the text buffer, you can pass the constant
  991. * kATSUFromTextBeginning. To specify the entire text buffer, pass
  992. * kATSUFromTextBeginning in this parameter and kATSUToTextEnd in
  993. * the iHighlightLength parameter.
  994. *
  995. * iHighlightLength:
  996. * The length of the text range to be highlighted. To indicate
  997. * that the text range extends to the end of the text buffer, pass
  998. * the constant kATSUToTextEnd.
  999. *
  1000. * Result:
  1001. * On success, noErr is returned. See MacErrors.h for possible error
  1002. * codes.
  1003. *
  1004. * Availability:
  1005. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
  1006. * CarbonLib: in CarbonLib 1.0 and later
  1007. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  1008. }
  1009. function ATSUHighlightText( iTextLayout: ATSUTextLayout; iTextBasePointX: ATSUTextMeasurement; iTextBasePointY: ATSUTextMeasurement; iHighlightStart: UniCharArrayOffset; iHighlightLength: UniCharCount ): OSStatus; external name '_ATSUHighlightText';
  1010. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
  1011. {
  1012. * ATSUUnhighlightText() *** DEPRECATED ***
  1013. *
  1014. * Deprecated:
  1015. * Use CTLineGetOffsetForStringIndex,
  1016. * CTLineGetStringIndexForPosition instead.
  1017. *
  1018. * Summary:
  1019. * Renders a previously highlighted range of text in an
  1020. * unhighlighted state.
  1021. *
  1022. * Discussion:
  1023. * This function renders a previously highlighted range of text in
  1024. * an unhighlighted state. You should always call
  1025. * ATSUUnhighlightText after calling the function ATSUHighlightText
  1026. * to properly redraw the unhighlighted text and background. If the
  1027. * inversion method of highlighting was used, when you call
  1028. * ATSUUnhighlightText, it merely undoes the inversion and renders
  1029. * the text. If the redraw method of highlighting was used,
  1030. * ATSUUnhighlightText turns off the highlighting and restores the
  1031. * desired background. Depending on the complexity of the
  1032. * background, ATSUI restores the background in one of two ways:
  1033. * filling in a solid color, or repainting the background using a
  1034. * callback. See the function ATSUSetHighlightingMethod and the
  1035. * definition ATSUUnhighlightData for more information.
  1036. *
  1037. * Parameters:
  1038. *
  1039. * iTextLayout:
  1040. * A layout containing text to be unhighlighted.
  1041. *
  1042. * iTextBasePointX:
  1043. * The x-coordinate of the origin (in either the current graphics
  1044. * port or in a Quartz graphics context) of the line containing
  1045. * the text range. Pass the constant kATSUUseGrafPortPenLoc to
  1046. * draw relative to the current pen location in the current
  1047. * graphics port.
  1048. *
  1049. * iTextBasePointY:
  1050. * The y-coordinate of the origin (in either the current graphics
  1051. * port or in a Quartz graphics context) of the line containing
  1052. * the text range. Pass the constant kATSUUseGrafPortPenLoc to
  1053. * draw relative to the current pen location in the current
  1054. * graphics port.
  1055. *
  1056. * iHighlightStart:
  1057. * The first character of the text range to be unhighlighted. If
  1058. * the text range spans multiple lines, you should call
  1059. * ATSUUnhighlightText for each line, passing the offset
  1060. * corresponding to the beginning of the new line to draw with
  1061. * each call. To indicate that the specified text range starts at
  1062. * the beginning of the text buffer, you can pass the constant
  1063. * kATSUFromTextBeginning. To specify the entire text buffer, pass
  1064. * kATSUFromTextBeginning in this parameter and kATSUToTextEnd in
  1065. * the iHighlightLength parameter.
  1066. *
  1067. * iHighlightLength:
  1068. * The length of the text range to be unhighlighted. To indicate
  1069. * that the text range extends to the end of the text buffer, pass
  1070. * the constant kATSUToTextEnd.
  1071. *
  1072. * Result:
  1073. * On success, noErr is returned. See MacErrors.h for possible error
  1074. * codes.
  1075. *
  1076. * Availability:
  1077. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
  1078. * CarbonLib: in CarbonLib 1.0 and later
  1079. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  1080. }
  1081. function ATSUUnhighlightText( iTextLayout: ATSUTextLayout; iTextBasePointX: ATSUTextMeasurement; iTextBasePointY: ATSUTextMeasurement; iHighlightStart: UniCharArrayOffset; iHighlightLength: UniCharCount ): OSStatus; external name '_ATSUUnhighlightText';
  1082. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
  1083. {
  1084. * ATSUGetTextHighlight() *** DEPRECATED ***
  1085. *
  1086. * Deprecated:
  1087. * Use CTLineGetOffsetForStringIndex,
  1088. * CTLineGetStringIndexForPosition instead.
  1089. *
  1090. * Summary:
  1091. * Obtains the highlight region for a range of text.
  1092. *
  1093. * Discussion:
  1094. * Use this function to obtain the screen region that ATSUI would
  1095. * normally highlight automatically when ATSUHighlightText is
  1096. * called. This is useful if you wish to perform your own
  1097. * highlighting.
  1098. *
  1099. * Parameters:
  1100. *
  1101. * iTextLayout:
  1102. * A layout containing text to be highlighted.
  1103. *
  1104. * iTextBasePointX:
  1105. * The x-coordinate of the origin (in either the current graphics
  1106. * port or in a Quartz graphics context) of the line containing
  1107. * the text range. Pass the constant kATSUUseGrafPortPenLoc to
  1108. * draw relative to the current pen location in the current
  1109. * graphics port.
  1110. *
  1111. * iTextBasePointY:
  1112. * The y-coordinate of the origin (in either the current graphics
  1113. * port or in a Quartz graphics context) of the line containing
  1114. * the text range. Pass the constant kATSUUseGrafPortPenLoc to
  1115. * draw relative to the current pen location in the current
  1116. * graphics port.
  1117. *
  1118. * iHighlightStart:
  1119. * The first character of the text range to be highlighted. If the
  1120. * text range spans multiple lines, you should call
  1121. * ATSUGetTextHighlight for each line, passing the offset
  1122. * corresponding to the beginning of the new line to draw with
  1123. * each call. To indicate that the specified text range starts at
  1124. * the beginning of the text buffer, you can pass the constant
  1125. * kATSUFromTextBeginning. To specify the entire text buffer, pass
  1126. * kATSUFromTextBeginning in this parameter and kATSUToTextEnd in
  1127. * the iHighlightLength parameter.
  1128. *
  1129. * iHighlightLength:
  1130. * The length of the text range to be highlighted. To indicate
  1131. * that the text range extends to the end of the text buffer, pass
  1132. * the constant kATSUToTextEnd.
  1133. *
  1134. * oHighlightRegion:
  1135. * On return, ATSUGetTextHighlight produces a MacRegion structure
  1136. * containing the highlight region for the specified range of
  1137. * text. In the case of discontinuous highlighting, the region
  1138. * consists of multiple components, with MacRegion.rgnBBox
  1139. * specifying the bounding box around the entire area of
  1140. * discontinuous highlighting.
  1141. *
  1142. * Result:
  1143. * On success, noErr is returned. See MacErrors.h for possible error
  1144. * codes.
  1145. *
  1146. * Availability:
  1147. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
  1148. * CarbonLib: in CarbonLib 1.0 and later
  1149. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  1150. }
  1151. function ATSUGetTextHighlight( iTextLayout: ATSUTextLayout; iTextBasePointX: ATSUTextMeasurement; iTextBasePointY: ATSUTextMeasurement; iHighlightStart: UniCharArrayOffset; iHighlightLength: UniCharCount; oHighlightRegion: RgnHandle ): OSStatus; external name '_ATSUGetTextHighlight';
  1152. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
  1153. {
  1154. * ATSUHighlightInactiveText() *** DEPRECATED ***
  1155. *
  1156. * Deprecated:
  1157. * Use CTLineGetOffsetForStringIndex,
  1158. * CTLineGetStringIndexForPosition instead.
  1159. *
  1160. * Summary:
  1161. * Highlights text using the standard Mac OS X UI convention for an
  1162. * inactive window or UI pane.
  1163. *
  1164. * Discussion:
  1165. * Use this function to redraw text when a window or UI pane
  1166. * containing highlighted text becomes inactive. Once the window or
  1167. * UI pane becomes active again, call ATSUHighlightText to
  1168. * rehighlight the text in active mode.
  1169. *
  1170. * Parameters:
  1171. *
  1172. * iTextLayout:
  1173. * A layout containing text to be highlighted.
  1174. *
  1175. * iTextBasePointX:
  1176. * The x-coordinate of the origin (in either the current graphics
  1177. * port or in a Quartz graphics context) of the line containing
  1178. * the text range. Pass the constant kATSUUseGrafPortPenLoc to
  1179. * draw relative to the current pen location in the current
  1180. * graphics port.
  1181. *
  1182. * iTextBasePointY:
  1183. * The y-coordinate of the origin (in either the current graphics
  1184. * port or in a Quartz graphics context) of the line containing
  1185. * the text range. Pass the constant kATSUUseGrafPortPenLoc to
  1186. * draw relative to the current pen location in the current
  1187. * graphics port.
  1188. *
  1189. * iHighlightStart:
  1190. * The first character of the text range to be highlighted. If the
  1191. * text range spans multiple lines, you should call
  1192. * ATSUHighlightInactiveText for each line, passing the offset
  1193. * corresponding to the beginning of the new line to draw with
  1194. * each call. To indicate that the specified text range starts at
  1195. * the beginning of the text buffer, you can pass the constant
  1196. * kATSUFromTextBeginning. To specify the entire text buffer, pass
  1197. * kATSUFromTextBeginning in this parameter and kATSUToTextEnd in
  1198. * the iHighlightLength parameter.
  1199. *
  1200. * iHighlightLength:
  1201. * The length of the text range to be highlighted. To indicate
  1202. * that the text range extends to the end of the text buffer, pass
  1203. * the constant kATSUToTextEnd.
  1204. *
  1205. * Result:
  1206. * On success, noErr is returned. See MacErrors.h for possible error
  1207. * codes.
  1208. *
  1209. * Availability:
  1210. * Mac OS X: in version 10.2 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
  1211. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  1212. * Non-Carbon CFM: not available
  1213. }
  1214. function ATSUHighlightInactiveText( iTextLayout: ATSUTextLayout; iTextBasePointX: ATSUTextMeasurement; iTextBasePointY: ATSUTextMeasurement; iHighlightStart: UniCharArrayOffset; iHighlightLength: UniCharCount ): OSStatus; external name '_ATSUHighlightInactiveText';
  1215. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
  1216. { ---------------------------------------------------------------------------- }
  1217. { ATSUI hit-testing }
  1218. { ---------------------------------------------------------------------------- }
  1219. {$endc} {not TARGET_CPU_64}
  1220. {
  1221. * ATSUPositionToOffset() *** DEPRECATED ***
  1222. *
  1223. * Deprecated:
  1224. * Use CTLineGetStringIndexForPosition instead.
  1225. *
  1226. * Summary:
  1227. * Obtains the memory offset for the glyph edge nearest a mouse-down
  1228. * event.
  1229. *
  1230. * Discussion:
  1231. * The process of hit-testing text obtains the location of a
  1232. * mouse-down event relative both to the position of onscreen glyphs
  1233. * and to the corresponding offset between character codes in
  1234. * memory. You can then use the location information obtained by
  1235. * hit-testing to set the insertion point (that is, the caret) or
  1236. * selection range (for highlighting). Hit-testing text is
  1237. * complicated by the fact that a given line of text may be
  1238. * bidirectional. Therefore, the onscreen order of glyphs may not
  1239. * readily correspond to the storage order of the corresponding
  1240. * character codes. And the concept of which glyph comes "first" in
  1241. * a line of text cannot always be limited to the visual terms
  1242. * "left" and "right." Because of these complexities, it is more
  1243. * accurate to speak in terms of "leading" and "trailing" edges to
  1244. * glyphs. A "leading edge" is defined as the edge of a glyph that
  1245. * you first encounter when you read the text that includes that
  1246. * glyph. For example, when reading Roman text, you first encounter
  1247. * the left edge of a Roman glyph. Similarly, the "trailing edge" is
  1248. * defined as the edge of the glyph encountered last. This function
  1249. * produces the memory offset corresponding to the glyph edge
  1250. * nearest the event. If the mouse-down event occurs at a line
  1251. * direction boundary or within a glyph cluster,
  1252. * ATSUPositionToOffset produces two offsets. You can then provide
  1253. * the offset(s) to the ATSUOffsetToPosition function to obtain the
  1254. * actual caret position(s) for the event. When you call the
  1255. * ATSUPositionToOffset function, ATSUI examines the Unicode
  1256. * directionality of the character corresponding to the event
  1257. * location. The ATSUPositionToOffset function produces a value of
  1258. * true in the oIsLeading parameter if the offset is leading (that
  1259. * is, more closely associated with the subsequent character in
  1260. * memory and therefore indicative of a left-to-right line
  1261. * direction). It produces a value of false if the offset is
  1262. * trailing (that is, more closely associated with the preceding
  1263. * character in memory and indicative of a right-to-left line
  1264. * direction). Finally, note that when the event occurs beyond the
  1265. * leftmost or rightmost caret positions of the line (not taking
  1266. * into account line rotation), such that no glyph corresponds to
  1267. * the location of the hit, the ATSUPositionToOffset function
  1268. * produces the primary offset of the closest edge of the line to
  1269. * the input location. The oIsLeading flag depends on the
  1270. * directionality of the closest glyph and the side of the line to
  1271. * which the input location is closest. In this case, the secondary
  1272. * offset is equal to the primary offset, since no glyph was hit.
  1273. *
  1274. * Parameters:
  1275. *
  1276. * iTextLayout:
  1277. * The layout object in which the mouse-down event occurred.
  1278. *
  1279. * iLocationX:
  1280. * The x-coordinate of the event, in local coordinates, relative
  1281. * to the origin of the line where the event occurred. That is, to
  1282. * specify the x-coordinate value, you should subtract the
  1283. * x-coordinate of the line origin from the x-coordinate of the
  1284. * hit point (in local coordinates). You can pass the constant
  1285. * kATSUUseGrafPortPenLoc for the location of the mouse-down event
  1286. * relative to the current pen location in the current graphics
  1287. * port.
  1288. *
  1289. * iLocationY:
  1290. * The y-coordinate of the event, in local coordinates, relative
  1291. * to the origin of the line where the event occurred. That is, to
  1292. * specify the y-coordinate value, you should subtract the
  1293. * y-coordinate of the line origin from the y-coordinate of the
  1294. * hit point (in local coordinates). You can pass the constant
  1295. * kATSUUseGrafPortPenLoc for the location of the mouse-down event
  1296. * relative to the current pen location in the current graphics
  1297. * port.
  1298. *
  1299. * ioPrimaryOffset:
  1300. * On input, a pointer to a UniCharArrayOffset value specifying
  1301. * the offset corresponding to the beginning of the line where the
  1302. * event occurred. On return, the value specifies the offset
  1303. * corresponding to the glyph edge that is visually closest to the
  1304. * event. To determine whether this offset indicates the leading
  1305. * or trailing edge of the glyph, you can examine the value
  1306. * produced in the oIsLeading parameter.
  1307. *
  1308. * oIsLeading:
  1309. * On return, the value indicates whether the offset produced in
  1310. * the ioPrimaryOffset parameter is leading or trailing. The
  1311. * function ATSUPositionToOffset produces a value of true if the
  1312. * offset is leading (that is, more closely associated with the
  1313. * subsequent character in memory). It produces a value of false
  1314. * if the offset is trailing (that is, more closely associated
  1315. * with the preceding character in memory).
  1316. *
  1317. * oSecondaryOffset:
  1318. * On return, the value typically specifies the same offset as
  1319. * that produced in the ioPrimaryOffset parameter, unless the
  1320. * event occurred within a glyph cluster or at a line direction
  1321. * boundary. If so, the value specifies a secondary offset. The
  1322. * secondary offset is associated with the glyph that has a
  1323. * different direction from the primary line direction.
  1324. *
  1325. * Result:
  1326. * On success, noErr is returned. See MacErrors.h for possible error
  1327. * codes.
  1328. *
  1329. * Availability:
  1330. * Mac OS X: in version 10.0 and later in ApplicationServices.framework but deprecated in 10.6
  1331. * CarbonLib: in CarbonLib 1.0 and later
  1332. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  1333. }
  1334. function ATSUPositionToOffset( iTextLayout: ATSUTextLayout; iLocationX: ATSUTextMeasurement; iLocationY: ATSUTextMeasurement; var ioPrimaryOffset: UniCharArrayOffset; var oIsLeading: Boolean; var oSecondaryOffset: UniCharArrayOffset ): OSStatus; external name '_ATSUPositionToOffset';
  1335. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
  1336. {$ifc not TARGET_CPU_64}
  1337. {
  1338. * ATSUOffsetToPosition() *** DEPRECATED ***
  1339. *
  1340. * Deprecated:
  1341. * Use CTLineGetStringIndexForPosition instead.
  1342. *
  1343. * Summary:
  1344. * Obtains the caret position(s) corresponding to a memory offset.
  1345. *
  1346. * Discussion:
  1347. * This function produces two structures of type ATSUCaret. These
  1348. * structures contain the pen positioning information needed to draw
  1349. * the caret(s) for the event, specified relative to the origin of
  1350. * the line in the current graphics port or graphics context.
  1351. * Specifically, the ATSUCaret structures contain x-y coordinates
  1352. * for both the caret's starting and ending pen positions (the
  1353. * latter taking into account line rotation, caret slanting, and
  1354. * split-caret appearances). If the offset you pass to
  1355. * ATSUOffsetToPosition is at a line boundary, the structure
  1356. * produced in the oMainCaret parameter contains the starting and
  1357. * ending pen locations for the high caret, while the oSecondCaret
  1358. * parameter contains the corresponding values for the low caret. If
  1359. * the offset is not at a line boundary, both parameters contain the
  1360. * starting and ending pen locations of the main caret. Because you
  1361. * provide the ATSUOffsetToPosition function an offset relative to
  1362. * the origin of the line where the hit occurred,
  1363. * ATSUOffsetToPosition produces positioning information that is
  1364. * also relative. Therefore, you must transform the positions
  1365. * produced by the ATSUOffsetToPosition function before drawing the
  1366. * caret(s). To transform the caret location(s), add the starting
  1367. * and ending caret coordinates to the coordinates of the origin of
  1368. * the line in which the hit occurred. For example, if
  1369. * ATSUOffsetToPosition produces starting and ending pen locations
  1370. * of (25,0), (25,25) in the oMainCaret parameter (and the
  1371. * oSecondCaret parameter contains the same coordinates, meaning
  1372. * that the caret was not split), you would add these to the
  1373. * position of the origin of the line in the graphics port or
  1374. * context. If the position of the line origin was at (50,50), then
  1375. * the starting and ending pen locations of the caret would be
  1376. * (75,50), (75,75).
  1377. *
  1378. * Parameters:
  1379. *
  1380. * iTextLayout:
  1381. * The layout containing the offset.
  1382. *
  1383. * iOffset:
  1384. * The offset into the text buffer for which you wish to obtain a
  1385. * caret position. To respond to a mouse-down event, pass the
  1386. * offset returned in the ioPrimaryOffset parameter from the
  1387. * function ATSUPositionToOffset. That is, the offset
  1388. * corresponding to the glyph edge closest to the event.
  1389. *
  1390. * iIsLeading:
  1391. * A Boolean value indicating whether the offset corresponds to
  1392. * the leading or trailing edge of the glyph. You can obtain this
  1393. * information from the function ATSUPositionToOffset. This value
  1394. * is relevant if the offset occurs at a line direction boundary
  1395. * or within a glyph cluster.
  1396. *
  1397. * oMainCaret:
  1398. * On return, contains the starting and ending pen locations of
  1399. * the high caret if the value produced in oCaretIsSplit is true.
  1400. * If the value is false, the structure contains the starting and
  1401. * ending pen locations of the main caret.
  1402. *
  1403. * oSecondCaret:
  1404. * On return, contains the starting and ending pen locations of
  1405. * the low caret if the value passed back in the oCaretIsSplit
  1406. * parameter is true. If the value is false, the structure
  1407. * contains the starting and ending pen locations of the main
  1408. * caret (that is, the same values as the oMainCaret parameter).
  1409. *
  1410. * oCaretIsSplit:
  1411. * On return, indicates whether the offset specified in the
  1412. * iOffset parameter occurs at a line direction boundary. If true,
  1413. * the offset occurs at a line direction boundary; otherwise,
  1414. * false.
  1415. *
  1416. * Result:
  1417. * On success, noErr is returned. See MacErrors.h for possible error
  1418. * codes.
  1419. *
  1420. * Availability:
  1421. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
  1422. * CarbonLib: in CarbonLib 1.0 and later
  1423. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  1424. }
  1425. function ATSUOffsetToPosition( iTextLayout: ATSUTextLayout; iOffset: UniCharArrayOffset; iIsLeading: Boolean; var oMainCaret: ATSUCaret; var oSecondCaret: ATSUCaret; var oCaretIsSplit: Boolean ): OSStatus; external name '_ATSUOffsetToPosition';
  1426. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
  1427. {
  1428. * ATSUPositionToCursorOffset() *** DEPRECATED ***
  1429. *
  1430. * Deprecated:
  1431. * Use CTLineGetOffsetForStringIndex instead.
  1432. *
  1433. * Summary:
  1434. * Obtains the memory offset for the glyph edge nearest a mouse-down
  1435. * event, after a move of the specified length.
  1436. *
  1437. * Discussion:
  1438. * This function produces the memory offset for the glyph edge
  1439. * nearest a mouse-down event, after a move of the specified length.
  1440. * This offset corresponds to where an insertion point would be
  1441. * placed after the move.
  1442. *
  1443. * Parameters:
  1444. *
  1445. * iTextLayout:
  1446. * The layout in which the mouse down event occured.
  1447. *
  1448. * iLocationX:
  1449. * The x-coordinate of the event, in local coordinates, relative
  1450. * to the origin of the line where the event occurred. That is, to
  1451. * specify the x-coordinate value, you should subtract the
  1452. * x-coordinate of the line origin from the x-coordinate of the
  1453. * hit point (in local coordinates). You can pass the constant
  1454. * kATSUUseGrafPortPenLoc for the location of the mouse-down event
  1455. * relative to the current pen location in the current graphics
  1456. * port.
  1457. *
  1458. * iLocationY:
  1459. * The y-coordinate of the event, in local coordinates, relative
  1460. * to the origin of the line where the event occurred. That is, to
  1461. * specify the y-coordinate value, you should subtract the
  1462. * y-coordinate of the line origin from the y-coordinate of the
  1463. * hit point (in local coordinates). You can pass the constant
  1464. * kATSUUseGrafPortPenLoc for the location of the mouse-down event
  1465. * relative to the current pen location in the current graphics
  1466. * port.
  1467. *
  1468. * iMovementType:
  1469. * A constant specifying the type of cursor movement to use. See
  1470. * the definition of ATSUCursorMovementType for possible values to
  1471. * pass for this parameter.
  1472. *
  1473. * ioPrimaryOffset:
  1474. * On input, the offset corresponding to the beginning of the line
  1475. * where the event occurred. On return, the offset corresponding
  1476. * to the glyph edge nearest the event, after a movement of the
  1477. * specified type. This offset corresponds to where the insertion
  1478. * point would be placed after the move. To determine whether this
  1479. * offset indicates the leading or trailing edge of the glyph, you
  1480. * can examine the value produced in the oIsLeading parameter.
  1481. *
  1482. * oIsLeading:
  1483. * On return, the value indicates whether the offset produced in
  1484. * the ioPrimaryOffset parameter is leading or trailing. The
  1485. * ATSUPositionToOffset function produces a value of true if the
  1486. * offset is leading (that is, more closely associated with the
  1487. * subsequent character in memory). It produces a value of false
  1488. * if the offset is trailing (that is, more closely associated
  1489. * with the preceding character in memory).
  1490. *
  1491. * oSecondaryOffset:
  1492. * On return, the value typically specifies the same offset as
  1493. * that produced in the ioPrimaryOffset parameter, unless the
  1494. * event occurred within a glyph cluster or at a line direction
  1495. * boundary. If so, the value specifies the secondary offset, for
  1496. * the glyph edge furthest from the event.
  1497. *
  1498. * Result:
  1499. * On success, noErr is returned. See MacErrors.h for possible error
  1500. * codes.
  1501. *
  1502. * Availability:
  1503. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
  1504. * CarbonLib: in CarbonLib 1.5 and later
  1505. * Non-Carbon CFM: in ATSUnicodeLib 9.2.2 and later
  1506. }
  1507. function ATSUPositionToCursorOffset( iTextLayout: ATSUTextLayout; iLocationX: ATSUTextMeasurement; iLocationY: ATSUTextMeasurement; iMovementType: ATSUCursorMovementType; var ioPrimaryOffset: UniCharArrayOffset; var oIsLeading: Boolean; var oSecondaryOffset: UniCharArrayOffset ): OSStatus; external name '_ATSUPositionToCursorOffset';
  1508. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
  1509. {
  1510. * ATSUOffsetToCursorPosition() *** DEPRECATED ***
  1511. *
  1512. * Deprecated:
  1513. * Use CTLineGetOffsetForStringIndex,
  1514. * CTLineGetStringIndexForPosition instead.
  1515. *
  1516. * Summary:
  1517. * Obtains the caret position(s) corresponding to a memory offset,
  1518. * after a move of the specified length.
  1519. *
  1520. * Discussion:
  1521. * Use this function in conjunction with ATSUPositionToCursorOffset
  1522. * to determine where to draw the caret after a mouse-down event.
  1523. * The movement type parameter allows you to have the cursor "snap"
  1524. * to different parts of the text depending on the type of movement
  1525. * selected (i.e., words or characters). See the definition of
  1526. * ATSUCursorMovementType for more information on possible values.
  1527. *
  1528. * Parameters:
  1529. *
  1530. * iTextLayout:
  1531. * The text layout object in which the mouse-down event occurred.
  1532. *
  1533. * iOffset:
  1534. * The offset corresponding to the glyph edge nearest the event,
  1535. * after a movement of the specified type. You can obtain this
  1536. * value by examining the offset produced in the ioPrimaryOffset
  1537. * parameter of the function ATSUPositionToCursorOffset.
  1538. *
  1539. * iIsLeading:
  1540. * A Boolean value indicating whether the specified offset
  1541. * corresponds to the leading or trailing edge of the glyph. You
  1542. * can obtain this information from the function
  1543. * ATSUPositionToCursorOffset . This value is relevant if the
  1544. * offset occurs at a line direction boundary or within a glyph
  1545. * cluster.
  1546. *
  1547. * iMovementType:
  1548. * A constant specifying the unit of cursor movement. See the
  1549. * definition of ATSUCursorMovementType for possible values to
  1550. * pass for this parameter.
  1551. *
  1552. * oMainCaret:
  1553. * On return, the structure contains the starting and ending pen
  1554. * locations of the high caret if the value produced in the
  1555. * oCaretIsSplit parameter is true. If the value is false, the
  1556. * structure contains the starting and ending pen locations of the
  1557. * main caret.
  1558. *
  1559. * oSecondCaret:
  1560. * On return, the structure contains the starting and ending pen
  1561. * locations of the low caret if the value passed back in the
  1562. * oCaretIsSplit parameter is true. If the value is false, the
  1563. * structure contains the starting and ending pen locations of the
  1564. * main caret (that is, the same values as the oMainCaret
  1565. * parameter).
  1566. *
  1567. * oCaretIsSplit:
  1568. * On return, the value indicates whether the offset specified in
  1569. * the iOffset parameter occurs at a line direction boundary. If
  1570. * true, the offset occurs at a line direction boundary;
  1571. * otherwise, false.
  1572. *
  1573. * Result:
  1574. * On success, noErr is returned. See MacErrors.h for possible error
  1575. * codes.
  1576. *
  1577. * Availability:
  1578. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
  1579. * CarbonLib: in CarbonLib 1.5 and later
  1580. * Non-Carbon CFM: in ATSUnicodeLib 9.2.2 and later
  1581. }
  1582. function ATSUOffsetToCursorPosition( iTextLayout: ATSUTextLayout; iOffset: UniCharArrayOffset; iIsLeading: Boolean; iMovementType: ATSUCursorMovementType; var oMainCaret: ATSUCaret; var oSecondCaret: ATSUCaret; var oCaretIsSplit: Boolean ): OSStatus; external name '_ATSUOffsetToCursorPosition';
  1583. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
  1584. { ---------------------------------------------------------------------------- }
  1585. { ATSUI cursor movement }
  1586. { ---------------------------------------------------------------------------- }
  1587. {
  1588. * ATSUNextCursorPosition() *** DEPRECATED ***
  1589. *
  1590. * Deprecated:
  1591. * Use CTLineGetOffsetForStringIndex,
  1592. * CTLineGetStringIndexForPosition instead.
  1593. *
  1594. * Summary:
  1595. * Obtains the memory offset for the insertion point that follows
  1596. * the current insertion point in storage order, as determined by a
  1597. * move of the specified length and type.
  1598. *
  1599. * Discussion:
  1600. * Together with ATSUPreviousCursorPosition, this function allows an
  1601. * application to "walk" the text buffer in storage order, moving
  1602. * the cursor by a specified amount and movement type at each step.
  1603. * To move through the text buffer in screen order, use the
  1604. * functions ATSURightwardCursorPosition and
  1605. * ATSULeftwardCursorPosition.
  1606. *
  1607. * Parameters:
  1608. *
  1609. * iTextLayout:
  1610. * The layout in which to perform the cursor movement.
  1611. *
  1612. * iOldOffset:
  1613. * The previous cursor position.
  1614. *
  1615. * iMovementType:
  1616. * A constant specifying the unit of cursor movement. See the
  1617. * definition of ATSUCursorMovementType for possible values to
  1618. * pass for this parameter.
  1619. *
  1620. * oNewOffset:
  1621. * On return, the new cursor position.
  1622. *
  1623. * Result:
  1624. * On success, noErr is returned. See MacErrors.h for possible error
  1625. * codes.
  1626. *
  1627. * Availability:
  1628. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
  1629. * CarbonLib: in CarbonLib 1.0 and later
  1630. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  1631. }
  1632. function ATSUNextCursorPosition( iTextLayout: ATSUTextLayout; iOldOffset: UniCharArrayOffset; iMovementType: ATSUCursorMovementType; var oNewOffset: UniCharArrayOffset ): OSStatus; external name '_ATSUNextCursorPosition';
  1633. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
  1634. {
  1635. * ATSUPreviousCursorPosition() *** DEPRECATED ***
  1636. *
  1637. * Deprecated:
  1638. * Use CTLineGetOffsetForStringIndex,
  1639. * CTLineGetStringIndexForPosition instead.
  1640. *
  1641. * Summary:
  1642. * Obtains the memory offset for the insertion point that preceeds
  1643. * the current insertion point in storage order, as determined by a
  1644. * move of the specified length and type.
  1645. *
  1646. * Discussion:
  1647. * Together with ATSUNextCursorPosition, this function allows an
  1648. * application to "walk" the text buffer in storage order, moving
  1649. * the cursor by a specified amount and movement type at each step.
  1650. * To move through the text buffer in screen order, use the
  1651. * functions ATSURightwardCursorPosition and
  1652. * ATSULeftwardCursorPosition.
  1653. *
  1654. * Parameters:
  1655. *
  1656. * iTextLayout:
  1657. * The layout in which to perform the cursor movement.
  1658. *
  1659. * iOldOffset:
  1660. * The previous cursor position.
  1661. *
  1662. * iMovementType:
  1663. * A constant specifying the unit of cursor movement. See the
  1664. * definition of ATSUCursorMovementType for possible values to
  1665. * pass for this parameter.
  1666. *
  1667. * oNewOffset:
  1668. * On return, the new cursor position.
  1669. *
  1670. * Result:
  1671. * On success, noErr is returned. See MacErrors.h for possible error
  1672. * codes.
  1673. *
  1674. * Availability:
  1675. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
  1676. * CarbonLib: in CarbonLib 1.0 and later
  1677. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  1678. }
  1679. function ATSUPreviousCursorPosition( iTextLayout: ATSUTextLayout; iOldOffset: UniCharArrayOffset; iMovementType: ATSUCursorMovementType; var oNewOffset: UniCharArrayOffset ): OSStatus; external name '_ATSUPreviousCursorPosition';
  1680. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
  1681. {
  1682. * ATSURightwardCursorPosition() *** DEPRECATED ***
  1683. *
  1684. * Deprecated:
  1685. * Use CTLineGetOffsetForStringIndex,
  1686. * CTLineGetStringIndexForPosition instead.
  1687. *
  1688. * Summary:
  1689. * Obtains the memory offset for the insertion point that is to the
  1690. * right of the current insertion point, as determined by a move of
  1691. * the specified length and type.
  1692. *
  1693. * Discussion:
  1694. * Together with ATSULeftwardCursorPosition, this function allows an
  1695. * application to "walk" the text buffer in screen order, moving the
  1696. * cursor by a specified amount and movement type at each step. To
  1697. * move through the text buffer in storage order, use the functions
  1698. * ATSUNextCursorPosition and ATSUPreviousCursorPosition. Note that
  1699. * if you are drawing the cursor after a cursor move, you should use
  1700. * ATSUOffsetToPosition to obtain an ATSUCaret that determines the
  1701. * on screen location of the new cursor position. Always store the
  1702. * ATSUCaret from the previous cursor position as well, as this can
  1703. * help determine which caret to use in the case of a split caret.
  1704. * When performing leftward and rightward cursor movement, always
  1705. * use the caret closest to the previous caret. This maintains
  1706. * visual order when moving the cursor on screen.
  1707. *
  1708. * Parameters:
  1709. *
  1710. * iTextLayout:
  1711. * The layout in which to perform the cursor movement.
  1712. *
  1713. * iOldOffset:
  1714. * The previous cursor position.
  1715. *
  1716. * iMovementType:
  1717. * A constant specifying the unit of cursor movement. See the
  1718. * definition of ATSUCursorMovementType for possible values to
  1719. * pass for this parameter.
  1720. *
  1721. * oNewOffset:
  1722. * On return, the new cursor position.
  1723. *
  1724. * Result:
  1725. * On success, noErr is returned. See MacErrors.h for possible error
  1726. * codes.
  1727. *
  1728. * Availability:
  1729. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
  1730. * CarbonLib: in CarbonLib 1.0 and later
  1731. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  1732. }
  1733. function ATSURightwardCursorPosition( iTextLayout: ATSUTextLayout; iOldOffset: UniCharArrayOffset; iMovementType: ATSUCursorMovementType; var oNewOffset: UniCharArrayOffset ): OSStatus; external name '_ATSURightwardCursorPosition';
  1734. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
  1735. {
  1736. * ATSULeftwardCursorPosition() *** DEPRECATED ***
  1737. *
  1738. * Deprecated:
  1739. * Use CTLineGetOffsetForStringIndex,
  1740. * CTLineGetStringIndexForPosition instead.
  1741. *
  1742. * Summary:
  1743. * Obtains the memory offset for the insertion point that is to the
  1744. * left of the current insertion point, as determined by a move of
  1745. * the specified length and type.
  1746. *
  1747. * Discussion:
  1748. * Together with ATSURightwardCursorPosition, this function allows
  1749. * an application to "walk" the text buffer in screen order, moving
  1750. * the cursor by a specified amount and movement type at each step.
  1751. * To move through the text buffer in storage order, use the
  1752. * functions ATSUNextCursorPosition and ATSUPreviousCursorPosition.
  1753. * Note that if you are drawing the cursor after a cursor move, you
  1754. * should use ATSUOffsetToPosition to obtain an ATSUCaret that
  1755. * determines the on screen location of the new cursor position.
  1756. * Always store the ATSUCaret from the previous cursor position as
  1757. * well, as this can help determine which caret to use in the case
  1758. * of a split caret. When performing leftward and rightward cursor
  1759. * movement, always use the caret closest to the previous caret.
  1760. * This maintains visual order when moving the cursor on screen.
  1761. *
  1762. * Parameters:
  1763. *
  1764. * iTextLayout:
  1765. * The layout in which to perform the cursor movement.
  1766. *
  1767. * iOldOffset:
  1768. * The previous cursor position.
  1769. *
  1770. * iMovementType:
  1771. * A constant specifying the unit of cursor movement. See the
  1772. * definition of ATSUCursorMovementType for possible values to
  1773. * pass for this parameter.
  1774. *
  1775. * oNewOffset:
  1776. * On return, the new cursor position.
  1777. *
  1778. * Result:
  1779. * On success, noErr is returned. See MacErrors.h for possible error
  1780. * codes.
  1781. *
  1782. * Availability:
  1783. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
  1784. * CarbonLib: in CarbonLib 1.0 and later
  1785. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  1786. }
  1787. function ATSULeftwardCursorPosition( iTextLayout: ATSUTextLayout; iOldOffset: UniCharArrayOffset; iMovementType: ATSUCursorMovementType; var oNewOffset: UniCharArrayOffset ): OSStatus; external name '_ATSULeftwardCursorPosition';
  1788. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
  1789. { Functions listed beyond this point are either deprecated or not recommended }
  1790. {
  1791. * ATSUMeasureText() *** DEPRECATED ***
  1792. *
  1793. * Deprecated:
  1794. * Use ATSUGetUnjustifiedBounds instead.
  1795. *
  1796. * Discussion:
  1797. * This function is no longer recommended. Please use
  1798. * ATSUGetUnjustifiedBounds instead.
  1799. *
  1800. * Availability:
  1801. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.3
  1802. * CarbonLib: in CarbonLib 1.0 and later
  1803. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  1804. }
  1805. function ATSUMeasureText( iTextLayout: ATSUTextLayout; iLineStart: UniCharArrayOffset; iLineLength: UniCharCount; var oTextBefore: ATSUTextMeasurement; var oTextAfter: ATSUTextMeasurement; var oAscent: ATSUTextMeasurement; var oDescent: ATSUTextMeasurement ): OSStatus; external name '_ATSUMeasureText';
  1806. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 *)
  1807. {$endc} {not TARGET_CPU_64}
  1808. {$endc} {TARGET_OS_MAC}
  1809. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  1810. end.
  1811. {$endc} {not MACOSALLINCLUDE}