ATSUnicodeDrawing.pas 84 KB

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