ATSUnicodeTypes.pas 46 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466
  1. {
  2. File: QD/ATSUnicodeTypes.h
  3. Contains: ATSUI types and constants.
  4. Version: Quickdraw-150~1
  5. Copyright: © 2003 by Apple Computer, Inc., all rights reserved.
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://www.freepascal.org/bugs.html
  9. }
  10. { Pascal Translation: Peter N Lewis, <[email protected]>, 2004 }
  11. {
  12. Modified for use with Free Pascal
  13. Version 210
  14. Please report any bugs to <[email protected]>
  15. }
  16. {$mode macpas}
  17. {$packenum 1}
  18. {$macro on}
  19. {$inline on}
  20. {$calling mwpascal}
  21. unit ATSUnicodeTypes;
  22. interface
  23. {$setc UNIVERSAL_INTERFACES_VERSION := $0342}
  24. {$setc GAP_INTERFACES_VERSION := $0210}
  25. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  26. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  27. {$endc}
  28. {$ifc defined CPUPOWERPC and defined CPUI386}
  29. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  30. {$endc}
  31. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  32. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  33. {$endc}
  34. {$ifc not defined __ppc__ and defined CPUPOWERPC}
  35. {$setc __ppc__ := 1}
  36. {$elsec}
  37. {$setc __ppc__ := 0}
  38. {$endc}
  39. {$ifc not defined __i386__ and defined CPUI386}
  40. {$setc __i386__ := 1}
  41. {$elsec}
  42. {$setc __i386__ := 0}
  43. {$endc}
  44. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  45. {$error Conflicting definitions for __ppc__ and __i386__}
  46. {$endc}
  47. {$ifc defined __ppc__ and __ppc__}
  48. {$setc TARGET_CPU_PPC := TRUE}
  49. {$setc TARGET_CPU_X86 := FALSE}
  50. {$elifc defined __i386__ and __i386__}
  51. {$setc TARGET_CPU_PPC := FALSE}
  52. {$setc TARGET_CPU_X86 := TRUE}
  53. {$elsec}
  54. {$error Neither __ppc__ nor __i386__ is defined.}
  55. {$endc}
  56. {$setc TARGET_CPU_PPC_64 := FALSE}
  57. {$ifc defined FPC_BIG_ENDIAN}
  58. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  59. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  60. {$elifc defined FPC_LITTLE_ENDIAN}
  61. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  62. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  63. {$elsec}
  64. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  65. {$endc}
  66. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  67. {$setc CALL_NOT_IN_CARBON := FALSE}
  68. {$setc OLDROUTINENAMES := FALSE}
  69. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  70. {$setc OPAQUE_UPP_TYPES := TRUE}
  71. {$setc OTCARBONAPPLICATION := TRUE}
  72. {$setc OTKERNEL := FALSE}
  73. {$setc PM_USE_SESSION_APIS := TRUE}
  74. {$setc TARGET_API_MAC_CARBON := TRUE}
  75. {$setc TARGET_API_MAC_OS8 := FALSE}
  76. {$setc TARGET_API_MAC_OSX := TRUE}
  77. {$setc TARGET_CARBON := TRUE}
  78. {$setc TARGET_CPU_68K := FALSE}
  79. {$setc TARGET_CPU_MIPS := FALSE}
  80. {$setc TARGET_CPU_SPARC := FALSE}
  81. {$setc TARGET_OS_MAC := TRUE}
  82. {$setc TARGET_OS_UNIX := FALSE}
  83. {$setc TARGET_OS_WIN32 := FALSE}
  84. {$setc TARGET_RT_MAC_68881 := FALSE}
  85. {$setc TARGET_RT_MAC_CFM := FALSE}
  86. {$setc TARGET_RT_MAC_MACHO := TRUE}
  87. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  88. {$setc TYPE_BOOL := FALSE}
  89. {$setc TYPE_EXTENDED := FALSE}
  90. {$setc TYPE_LONGLONG := TRUE}
  91. uses MacTypes,MacMemory,ATSLayoutTypes,Fonts,Quickdraw,SFNTTypes,SFNTLayoutTypes,ATSTypes,TextCommon;
  92. {$ALIGN MAC68K}
  93. { See also ATSLayoutTypes.h for more ATSUI-related types and constants }
  94. { ---------------------------------------------------------------------------- }
  95. { ATSUI types and related constants }
  96. { ---------------------------------------------------------------------------- }
  97. {
  98. * ATSUTextLayout
  99. *
  100. * Discussion:
  101. * Text layout objects are the heart of ATSUI. These opaque objects
  102. * associate Unicode text with style runs, store information about
  103. * softbreaks, line and layout controls, and other information about
  104. * the text. Text drawing is done by passing a valid layout object
  105. * and a range of text to draw to the function ATSUDrawText, after
  106. * initial setup work on the layout has been done. See the
  107. * definitions of the functions ATSUCreateTextLayout and
  108. * ATSUCreateTextLayoutWithTextPtr for more information about
  109. * creating layouts.
  110. }
  111. type
  112. ATSUTextLayout = ^SInt32; { an opaque 32-bit type }
  113. {
  114. * ATSUStyle
  115. *
  116. * Discussion:
  117. * Style objects retain information about text such as font, point
  118. * size, color and other attributes. Styles are associated with text
  119. * through a layout object. See the definitions of the functions
  120. * ATSUSetRunStyle and ATSUCreateTextLayoutWithTextPtr for more
  121. * information about assigning styles to runs of text in a layout
  122. * object. See the definitions of the functions ATSUCreateStyle and
  123. * ATSUSetAttributes for more information on creating and
  124. * manipulating styles.
  125. }
  126. type
  127. ATSUStyle = ^SInt32; { an opaque 32-bit type }
  128. ATSUStylePtr = ^ATSUStyle;
  129. {
  130. * ATSUFontFallbacks
  131. *
  132. * Discussion:
  133. * ATSUFontFallbacks objects are used to store the desired font
  134. * fallback mode, list, and associated cache information. See the
  135. * definitions of ATSUFontFallbackMethod and ATSUSetObjFontFallbacks
  136. * for more information about setting up font fallbacks.
  137. }
  138. type
  139. ATSUFontFallbacks = ^SInt32; { an opaque 32-bit type }
  140. {
  141. * ATSUTextMeasurement
  142. *
  143. * Discussion:
  144. * ATSUTextMeasurement is specific to ATSUI in that measurement
  145. * quantities are in fractional Fixed format instead of shorts used
  146. * in QuickDraw Text. This provides exact outline metrics and line
  147. * specifications such as line width, ascent, descent, and so on.
  148. * See FixMath.h for conversion functions for Fixed numbers.
  149. }
  150. type
  151. ATSUTextMeasurement = Fixed;
  152. ATSUTextMeasurementPtr = ^ATSUTextMeasurement;
  153. {
  154. * ATSUFontID
  155. *
  156. * Discussion:
  157. * ATSUFontID indicates a particular font family and face.
  158. * ATSUFontID's are not guaranteed to remain constant across
  159. * sessions. Clients should use the font's unique name to get a font
  160. * token to store in documents which is guaranteed to remain
  161. * constant across sessions.
  162. }
  163. type
  164. ATSUFontID = FMFont;
  165. ATSUFontIDPtr = ^ATSUFontID;
  166. {
  167. * ATSUFontFeatureType
  168. *
  169. * Discussion:
  170. * Used to identify a font feature type for a particular font. See
  171. * the definitions of the functions ATSUGetAllFontFeatures and
  172. * ATSUGetFontFeature for more information about font features.
  173. }
  174. type
  175. ATSUFontFeatureType = UInt16;
  176. ATSUFontFeatureTypePtr = ^ATSUFontFeatureType;
  177. {
  178. * ATSUFontFeatureSelector
  179. *
  180. * Discussion:
  181. * Used to identify a font feature selector for a particular font.
  182. * See the definitions of the functions ATSUGetAllFontFeatures and
  183. * ATSUGetFontFeature for more information about font features.
  184. }
  185. type
  186. ATSUFontFeatureSelector = UInt16;
  187. ATSUFontFeatureSelectorPtr = ^ATSUFontFeatureSelector;
  188. {
  189. * ATSUFontVariationAxis
  190. *
  191. * Discussion:
  192. * Used to identify a font variation axis for a particular font. See
  193. * the definitions of the functions ATSUGetAllFontVariations and
  194. * ATSUGetFontVariation for more information about font variations.
  195. }
  196. type
  197. ATSUFontVariationAxis = FourCharCode;
  198. ATSUFontVariationAxisPtr = ^ATSUFontVariationAxis;
  199. {
  200. * ATSUFontVariationValue
  201. *
  202. * Discussion:
  203. * Used to identify a font variation value for a particular font.
  204. * See the definitions of the functions ATSUGetAllFontVariations and
  205. * ATSUGetFontVariation for more information about font variations.
  206. }
  207. type
  208. ATSUFontVariationValue = Fixed;
  209. ATSUFontVariationValuePtr = ^ATSUFontVariationValue;
  210. {
  211. * ATSUAttributeTag
  212. *
  213. * Summary:
  214. * Constants used for style attributes, line controls, and layout
  215. * controls.
  216. *
  217. * Discussion:
  218. * The following constants are used to change settings in text
  219. * layout and style objects. Use the functions ATSUSetLineControls,
  220. * ATSUSetLayoutControls, and ATSUSetAttributes to set these values
  221. * in lines, layouts, and styles, respectively. Apple reserves tag
  222. * values 0 to 65535 (0 to 0x0000FFFF). ATSUI clients may create
  223. * their own tags with any other value.
  224. }
  225. type
  226. ATSUAttributeTag = UInt32;
  227. ATSUAttributeTagPtr = ^ATSUAttributeTag;
  228. const
  229. {
  230. * (Type: ATSUTextMeasurement) (Default value: 0) Must not be less
  231. * than zero. May be set as a line or layout control.
  232. }
  233. kATSULineWidthTag = 1;
  234. {
  235. * (Type: Fixed) (Default value: 0) Angle is specified in degrees in
  236. * right-handed coordinate system. May be set as a line control.
  237. }
  238. kATSULineRotationTag = 2;
  239. {
  240. * (Type: Boolean) (Default value: GetSysDirection()) Must be 0 or 1.
  241. * See below for convenience constants. May be set as a line or
  242. * layout control.
  243. }
  244. kATSULineDirectionTag = 3;
  245. {
  246. * (Type: Fract) (Default value: kATSUNoJustification) May be set as
  247. * a line or layout control.
  248. }
  249. kATSULineJustificationFactorTag = 4;
  250. {
  251. * (Type: Fract) (Default value: kATSUStartAlignment) May be set as a
  252. * line or layout control.
  253. }
  254. kATSULineFlushFactorTag = 5;
  255. {
  256. * (Type: BslnBaselineRecord) (Default value: all zeros) Calculated
  257. * from other style attributes (e.g., font and point size). May be
  258. * set as a line or layout control.
  259. }
  260. kATSULineBaselineValuesTag = 6;
  261. {
  262. * (Type: ATSLineLayoutOptions) (Default value: all zeros) See
  263. * ATSLayoutTypes.h for a definition of the ATSLineLayoutOptions type
  264. * and a list of possible values. May be set as a line or layout
  265. * control.
  266. }
  267. kATSULineLayoutOptionsTag = 7;
  268. {
  269. * (Type: ATSUTextMeasurement) (Default value: determined by font(s))
  270. * Must not be less than zero. Starting in Mac OS X 10.2, you can
  271. * retrieve this value as a line or layout control, even if you have
  272. * not explicitly set it. This makes it easy to calculate line
  273. * height. May be set as a line or layout control.
  274. }
  275. kATSULineAscentTag = 8;
  276. {
  277. * (Type: ATSUTextMeasurement) (Default value: determined by font(s))
  278. * Must not be less than zero. Starting in Mac OS X, you can retrieve
  279. * this value as a line or layout control, even if you have not
  280. * explicitly set it. This makes it easy to calculate line height.
  281. * May be set as a line or layout control.
  282. }
  283. kATSULineDescentTag = 9;
  284. {
  285. * (Type: RegionCode) (Default value: kTextRegionDontCare) See
  286. * Script.h for possible values. May be set as a line or layout
  287. * control.
  288. }
  289. kATSULineLangRegionTag = 10;
  290. {
  291. * (Type: TextBreakLocatorRef) (Default value: NULL) See
  292. * UnicodeUtilities.h for more information on creating a
  293. * TextBreakLocator. May be set as a line or layout control.
  294. }
  295. kATSULineTextLocatorTag = 11;
  296. {
  297. * (Type: ATSULineTruncation) (Default value: kATSUTruncateNone) See
  298. * the definition of ATSULineTruncation for possible values. May be
  299. * set as a line or layout control.
  300. }
  301. kATSULineTruncationTag = 12;
  302. {
  303. * (Type: ATSUFontFallbacks) (Default value: current global fallback
  304. * state) The current global fallback state is determined using the
  305. * ATSUSetFontFallbacks function. The use of this function is not
  306. * recommended. Instead, use the functions ATSUCreateFontFallbacks
  307. * and ATSUSetObjFontFallbacks to create a ATSUFontFallbacks object,
  308. * and then use the kATSULineFontFallbacksTag attribute to set the
  309. * font fallbacks object as a layout control. See the definition of
  310. * ATSUFontFallbacks for more information. May be set as a layout
  311. * control.
  312. }
  313. kATSULineFontFallbacksTag = 13;
  314. {
  315. * (Type: CFStringRef) (Default value: user setting in System
  316. * Preferences) Indicates current setting for the decimal separator.
  317. * This affects the behavior of decimal tabs. May be set as a line or
  318. * layout control.
  319. }
  320. kATSULineDecimalTabCharacterTag = 14;
  321. {
  322. * (Type: ATSULayoutOperationOverrideSpecifier) (Default value: NULL)
  323. * See ATSUnicodeDirectAccess.h for a definition of the
  324. * ATSULayoutOperationOverrideSpecifier type. May be set as a layout
  325. * control.
  326. }
  327. kATSULayoutOperationOverrideTag = 15;
  328. {
  329. * (Type: CGColorRef) (Default value: user setting in System
  330. * Preferences) Indicates current setting for the highlight color.
  331. * May be set as a line or layout control.
  332. }
  333. kATSULineHighlightCGColorTag = 17;
  334. {
  335. * This is just for convenience. It is the upper limit of the line
  336. * and layout tags.
  337. }
  338. kATSUMaxLineTag = 18;
  339. {
  340. * This tag is obsolete. Please use kATSULineLangRegionTag instead.
  341. }
  342. kATSULineLanguageTag = 10;
  343. {
  344. * (Type: CGContextRef) (Default value: NULL) Use this tag to produce
  345. * Quartz rendering with ATSUI. See the definitions of the functions
  346. * QDBeginCGContext and QDEndCGContext in Quickdraw.h for more
  347. * information about creating a CGContext from a graphics port. May
  348. * be set as a layout control.
  349. }
  350. kATSUCGContextTag = 32767;
  351. {
  352. * (Type: Boolean) (Default value: false) For compatability purposes
  353. * only. Choosing typographic styles from font families is preferred.
  354. * Note this tag will produce a synthetic style for fonts that do not
  355. * have a typographic style. May be set as a style attribute.
  356. }
  357. kATSUQDBoldfaceTag = 256;
  358. {
  359. * (Type: Boolean) (Default value: false) For compatability purposes
  360. * only. Choosing typographic styles from font families is preferred.
  361. * Note this tag will produce a synthetic style for fonts that do not
  362. * have a typographic style. May be set as a style attribute.
  363. }
  364. kATSUQDItalicTag = 257;
  365. {
  366. * (Type: Boolean) (Default value: false) For compatability purposes
  367. * only. May be set as a style attribute.
  368. }
  369. kATSUQDUnderlineTag = 258;
  370. {
  371. * (Type: Boolean) (Default value: false) For compatability purposes
  372. * only. May be set as a style attribute.
  373. }
  374. kATSUQDCondensedTag = 259;
  375. {
  376. * (Type: Boolean) (Default value: false) For compatability purposes
  377. * only. May be set as a style attribute.
  378. }
  379. kATSUQDExtendedTag = 260;
  380. {
  381. * (Type: ATSUFontID) (Default value: LMGetApFontID() or if not
  382. * valid, LMGetSysFontFam()) May be set as a style attribute.
  383. }
  384. kATSUFontTag = 261;
  385. {
  386. * (Type: Fixed) (Default value: Long2Fix(LMGetSysFontSize())) May be
  387. * set as a style attribute.
  388. }
  389. kATSUSizeTag = 262;
  390. {
  391. * (Type: RGBColor) (Default value: (0, 0, 0)) May be set as a style
  392. * attribute.
  393. }
  394. kATSUColorTag = 263;
  395. {
  396. * (Type: RegionCode) (Default value:
  397. * GetScriptManagerVariable(smRegionCode)) See Script.h for a list of
  398. * possible values. May be set as a style attribute.
  399. }
  400. kATSULangRegionTag = 264;
  401. {
  402. * (Type: ATSUVerticalCharacterType) (Default value:
  403. * kATSUStronglyHorizontal) See the definition of
  404. * ATSUVerticalCharacterType for a list of possible values. May be
  405. * set as a style attribute.
  406. }
  407. kATSUVerticalCharacterTag = 265;
  408. {
  409. * (Type: ATSUTextMeasurement) (Default value: kATSUseGlyphAdvance)
  410. * Must not be less than zero. May be set as a style attribute.
  411. }
  412. kATSUImposeWidthTag = 266;
  413. {
  414. * (Type: Fixed) (Default value: 0) May be set as a style attribute.
  415. }
  416. kATSUBeforeWithStreamShiftTag = 267;
  417. {
  418. * (Type: Fixed) (Default value: 0) May be set as a style attribute.
  419. }
  420. kATSUAfterWithStreamShiftTag = 268;
  421. {
  422. * (Type: Fixed) (Default value: 0) May be set as a style attribute.
  423. }
  424. kATSUCrossStreamShiftTag = 269;
  425. {
  426. * (Type: Fixed) (Default value: kATSNoTracking) May be set as a
  427. * style attribute.
  428. }
  429. kATSUTrackingTag = 270;
  430. {
  431. * (Type: Fract) (Default value: 0) May be set as a style attribute.
  432. }
  433. kATSUHangingInhibitFactorTag = 271;
  434. {
  435. * (Type: Fract) (Default value: 0) May be set as a style attribute.
  436. }
  437. kATSUKerningInhibitFactorTag = 272;
  438. {
  439. * (Type: Fixed) (Default value: 0) Must be between -1.0 and 1.0. May
  440. * be set as a style attribute.
  441. }
  442. kATSUDecompositionFactorTag = 273;
  443. {
  444. * (Type: BslnBaselineClass) (Default value: kBSLNRomanBaseline) See
  445. * SFNTLayoutTypes.h for more information. Use the constant
  446. * kBSLNNoBaselineOverride to use intrinsic baselines. May be set as
  447. * a style attribute.
  448. }
  449. kATSUBaselineClassTag = 274;
  450. {
  451. * (Type: ATSJustPriorityWidthDeltaOverrides) (Default value: all
  452. * zeros) See ATSLayoutTypes.h for more information. May be set as a
  453. * style attribute.
  454. }
  455. kATSUPriorityJustOverrideTag = 275;
  456. {
  457. * (Type: Boolean) (Default value: false) When set to true, ligatures
  458. * and compound characters will not have divisable components. May be
  459. * set as a style attribute.
  460. }
  461. kATSUNoLigatureSplitTag = 276;
  462. {
  463. * (Type: Boolean) (Default value: false) When set to true, ATSUI
  464. * will not use a glyph's angularity to determine its boundaries. May
  465. * be set as a style attribute.
  466. }
  467. kATSUNoCaretAngleTag = 277;
  468. {
  469. * (Type: Boolean) (Default value: false) When set to true, ATSUI
  470. * will suppress automatic cross kerning (defined by font). May be
  471. * set as a style attribute.
  472. }
  473. kATSUSuppressCrossKerningTag = 278;
  474. {
  475. * (Type: Boolean) (Default value: false) When set to true, ATSUI
  476. * will suppress glyphs' automatic optical positional alignment. May
  477. * be set as a style attribute.
  478. }
  479. kATSUNoOpticalAlignmentTag = 279;
  480. {
  481. * (Type: Boolean) (Default value: false) When set to true, ATSUI
  482. * will force glyphs to hang beyond the line boundaries. May be set
  483. * as a style attribute.
  484. }
  485. kATSUForceHangingTag = 280;
  486. {
  487. * (Type: Boolean) (Default value: false) When set to true, ATSUI
  488. * will not perform post-compensation justification if needed. May be
  489. * set as a style attribute.
  490. }
  491. kATSUNoSpecialJustificationTag = 281;
  492. {
  493. * (Type: TextBreakLocatorRef) (Default value: NULL) See
  494. * UnicodeUtilities.h for more information about creating a
  495. * TextBreakLocator. May be set as a style attribute.
  496. }
  497. kATSUStyleTextLocatorTag = 282;
  498. {
  499. * (Type: ATSStyleRenderingOptions) (Default value:
  500. * kATSStyleNoOptions) See ATSLayoutTypes.h for a definition of
  501. * ATSStyleRenderingOptions and a list of possible values. May be set
  502. * as a style attribute.
  503. }
  504. kATSUStyleRenderingOptionsTag = 283;
  505. {
  506. * (Type: ATSUTextMeasurement) (Default value: determined by font)
  507. * Must not be less than zero. Starting in Mac OS X 10.2, you can
  508. * retrieve a value for this attribute, even if you have not
  509. * explicitly set it. This can make calculating line height easier.
  510. * May be set as a style attribute.
  511. }
  512. kATSUAscentTag = 284;
  513. {
  514. * (Type: ATSUTextMeasurement) (Default value: determined by font)
  515. * Must not be less than zero. Starting in Mac OS X 10.2, you can
  516. * retrieve a value for this attribute, even if you have not
  517. * explicitly set it. This can make calculating line height easier.
  518. * May be set as a style attribute.
  519. }
  520. kATSUDescentTag = 285;
  521. {
  522. * (Type: ATSUTextMeasurement) (Default value: determined by font)
  523. * Must not be less than zero. Starting in Mac OS X 10.2, you can
  524. * retrieve a value for this attribute, even if you have not
  525. * explicitly set it. This can make calculating line height easier.
  526. * May be set as a style attribute.
  527. }
  528. kATSULeadingTag = 286;
  529. {
  530. * (Type: ATSUGlyphSelector) (Default value: 0) See the definition of
  531. * ATSUGlyphSelector for more information and a list of possible
  532. * values. May be set as a style attribute.
  533. }
  534. kATSUGlyphSelectorTag = 287;
  535. {
  536. * (Type: ATSURGBAlphaColor) (Default value: (0, 0, 0, 1)) See the
  537. * definition of ATSURGBAlphaColor for more information. May be set
  538. * as a style attribute.
  539. }
  540. kATSURGBAlphaColorTag = 288;
  541. {
  542. * (Type: CGAffineTransform) (Default value:
  543. * CGAffineTransformIdentity) See the definition of CGAffineTransform
  544. * in CGAffineTransform.h for more information. May be set as a style
  545. * attribute.
  546. }
  547. kATSUFontMatrixTag = 289;
  548. {
  549. * (Type: ATSUStyleLineCountType) (Default value:
  550. * kATSUStyleSingleLineCount) Used to specify the number of strokes
  551. * to be drawn for an underline. May be set as a style attribute.
  552. }
  553. kATSUStyleUnderlineCountOptionTag = 290;
  554. {
  555. * (Type: CGColorRef) (Default value: NULL) Used to specify the color
  556. * of the strokes to draw for an underlined run of text. If NULL, the
  557. * text color is used. May be set as a style attribute.
  558. }
  559. kATSUStyleUnderlineColorOptionTag = 291;
  560. {
  561. * (Type: Boolean) (Default value: false) Used to specify
  562. * strikethrough style. May be set as a style attribute.
  563. }
  564. kATSUStyleStrikeThroughTag = 292;
  565. {
  566. * (Type: ATSUStyleLineCountType) (Default value:
  567. * kATSUStyleSingleLineCount) Used to specify the number of strokes
  568. * to be drawn for a strikethrough. May be set as a style attribute.
  569. }
  570. kATSUStyleStrikeThroughCountOptionTag = 293;
  571. {
  572. * (Type: CGColorRef) (Default value: NULL) Used to specify the color
  573. * of the strokes to draw for a strikethrough style. If NULL, the
  574. * text color is used. May be set as a style attribute.
  575. }
  576. kATSUStyleStrikeThroughColorOptionTag = 294;
  577. {
  578. * (Type: Boolean) (Default value: false) Used to specify if text
  579. * should be drawn with a drop shadow. Only takes effect if a
  580. * CGContext is used for drawing. May be set as a style attribute.
  581. }
  582. kATSUStyleDropShadowTag = 295;
  583. {
  584. * (Type: float) (Default value: 0.0) Used to specify the amount of
  585. * blur for a dropshadow. May be set as a style attribute.
  586. }
  587. kATSUStyleDropShadowBlurOptionTag = 296;
  588. {
  589. * (Type: CGSize) (Default value: (3.0, -3.0)) Used to specify the
  590. * amount of offset from the text to be used when drawing a
  591. * dropshadow. May be set as a style attribute.
  592. }
  593. kATSUStyleDropShadowOffsetOptionTag = 297;
  594. {
  595. * (Type: CGColorRef) (Default value: NULL) Used to specify the color
  596. * of the dropshadow. May be set as a style attribute.
  597. }
  598. kATSUStyleDropShadowColorOptionTag = 298;
  599. {
  600. * This is just for convenience. It is the upper limit of the style
  601. * tags.
  602. }
  603. kATSUMaxStyleTag = 299;
  604. {
  605. * This tag is obsolete. Please use kATSULangRegionTag instead. This
  606. * is the maximum Apple ATSUI reserved tag value. Client defined
  607. * tags must be larger.
  608. }
  609. kATSULanguageTag = 264;
  610. kATSUMaxATSUITagValue = 65535;
  611. {
  612. * ATSUAttributeValuePtr
  613. *
  614. * Summary:
  615. * Used to provide generic access for storage of attribute values,
  616. * which vary in size.
  617. }
  618. type
  619. ATSUAttributeValuePtr = Ptr;
  620. ConstATSUAttributeValuePtr = Ptr;
  621. ATSUAttributeValuePtrPtr = ^ATSUAttributeValuePtr;
  622. {
  623. * ATSUAttributeInfo
  624. *
  625. * Discussion:
  626. * ATSUAttributeInfo is used to provide a tag/size pairing. This
  627. * makes it possible to provide the client information about all the
  628. * attributes for a given range of text. This structure is only
  629. * used to return to the client information about a complete set of
  630. * attributes. An array of ATSUAttributeInfos is passed as a
  631. * parameter so that the client can find out what attributes are set
  632. * and what their individual sizes are; with that information, they
  633. * can then query about the values of the attributes they're
  634. * interested in. Because arrays of ATSUAttributeInfos are used as
  635. * parameters to functions, they have to be of a fixed size, hence
  636. * the value is not included in the structure.
  637. }
  638. type
  639. ATSUAttributeInfo = record
  640. fTag: ATSUAttributeTag;
  641. fValueSize: ByteCount;
  642. end;
  643. ATSUAttributeInfoPtr = ^ATSUAttributeInfo;
  644. {
  645. * ATSUCaret
  646. *
  647. * Discussion:
  648. * Contains the complete information needed to render a caret. fX
  649. * and fY is the position of one of the caret's ends relative to the
  650. * origin position of the line the caret belongs. fDeltaX and
  651. * fDeltaY is the position of the caret's other end. Hence, to draw
  652. * a caret, simply call MoveTo(fX, fY) followed by LineTo(fDeltaX,
  653. * fDeltaY) or equivalent. The ATSUCaret will contain the positions
  654. * needed to draw carets on angled lines and reflect angled carets
  655. * and leading/trailing split caret appearances.
  656. }
  657. type
  658. ATSUCaret = record
  659. fX: Fixed;
  660. fY: Fixed;
  661. fDeltaX: Fixed;
  662. fDeltaY: Fixed;
  663. end;
  664. ATSUCaretPtr = ^ATSUCaret;
  665. {
  666. * ATSUCursorMovementType
  667. *
  668. * Discussion:
  669. * Used to indicate how much to move the cursor when using the ATSUI
  670. * cusor movement routines. Note that kATSUByCharacterCluster is
  671. * only available in Mac OS X and in CarbonLib versions 1.3 and
  672. * later.
  673. }
  674. type ATSUCursorMovementType = UInt16;
  675. const
  676. {
  677. * Cursor movement based on individual characters. The cursor will
  678. * step through individual characters within ligatures.
  679. }
  680. kATSUByCharacter = 0;
  681. {
  682. * Like kATSUByCharacter, but the cursor will treat ligatures as
  683. * single entities.
  684. }
  685. kATSUByTypographicCluster = 1;
  686. {
  687. * Cursor movement by whole words.
  688. }
  689. kATSUByWord = 2;
  690. {
  691. * Cursor movement by clusters based on characters only.
  692. }
  693. kATSUByCharacterCluster = 3;
  694. {
  695. * Obsolete name for kATSUByTypographicCluster; do not use.
  696. }
  697. kATSUByCluster = 1;
  698. {
  699. * ATSULineTruncation
  700. *
  701. * Summary:
  702. * Constants used with the kATSULineTruncationTag layout and line
  703. * control.
  704. *
  705. * Discussion:
  706. * The constants kATSUTruncateNone, kATSUTruncateStart,
  707. * kATSUTruncateEnd, and kATSUTruncateMiddle represent different
  708. * places in the text where glyphs should be replaced with an
  709. * elipsis should the text not fit within the width set by the
  710. * kATSULineWidthTag line and layout control. The constant
  711. * kATSUTruncFeatNoSquishing is special and can be bitwise OR'd with
  712. * any of the other constants. It indicates that ATSUI should not
  713. * perform negative justification to make the text fit. This can be
  714. * desirable for situations such as live resize, to prevent the text
  715. * from "wiggling".
  716. }
  717. type ATSULineTruncation = UInt32;
  718. const
  719. kATSUTruncateNone = 0;
  720. kATSUTruncateStart = 1;
  721. kATSUTruncateEnd = 2;
  722. kATSUTruncateMiddle = 3;
  723. kATSUTruncateSpecificationMask = $00000007;
  724. kATSUTruncFeatNoSquishing = $00000008;
  725. {
  726. * ATSUStyleLineCountType
  727. *
  728. * Discussion:
  729. * ATSUStyleLineCountType is used to designate how many lines will
  730. * be drawn for a given style type. Currently only the underline
  731. * and strikethrough styles support this type.
  732. }
  733. type ATSUStyleLineCountType = UInt16;
  734. const
  735. kATSUStyleSingleLineCount = 1;
  736. kATSUStyleDoubleLineCount = 2;
  737. {
  738. * ATSUVerticalCharacterType
  739. *
  740. * Discussion:
  741. * Use these constants along with the kATSUVerticalCharacterTag
  742. * layout control to determine whether the vertical or horizontal
  743. * forms of glyphs should be used. Note that this is independent of
  744. * line rotation.
  745. }
  746. type ATSUVerticalCharacterType = UInt16;
  747. const
  748. kATSUStronglyHorizontal = 0;
  749. kATSUStronglyVertical = 1;
  750. {
  751. * ATSUStyleComparison
  752. *
  753. * Discussion:
  754. * ATSUStyleComparison is an enumeration with four values, and is
  755. * used by ATSUCompareStyles() to indicate if the first style
  756. * parameter contains as a proper subset, is equal to, or is
  757. * contained by the second style parameter.
  758. }
  759. type ATSUStyleComparison = UInt16;
  760. const
  761. kATSUStyleUnequal = 0;
  762. kATSUStyleContains = 1;
  763. kATSUStyleEquals = 2;
  764. kATSUStyleContainedBy = 3;
  765. {
  766. * ATSUFontFallbackMethod
  767. *
  768. * Discussion:
  769. * ATSUFontFallbackMethod type defines the method by which ATSUI
  770. * will try to find an appropriate font for a character if the
  771. * assigned font does not contain the needed glyph(s) to represent
  772. * it. This affects ATSUMatchFontsToText and font selection during
  773. * layout and drawing when ATSUSetTransientFontMatching is set ON.
  774. }
  775. type ATSUFontFallbackMethod = UInt16;
  776. const
  777. {
  778. * When this constant is specified, all fonts on the system are
  779. * searched for substitute glyphs.
  780. }
  781. kATSUDefaultFontFallbacks = 0;
  782. {
  783. * This constant specifies that only the special last resort font be
  784. * used for substitute glyphs.
  785. }
  786. kATSULastResortOnlyFallback = 1;
  787. {
  788. * This constant specifies that a font list you provide should be
  789. * sequentially searched for substitute glyphs before the ATSUI
  790. * searches through all available fonts on the system. You specify
  791. * this list through the iFonts parameter to the
  792. * ATSUSetObjFontFallbacks function.
  793. }
  794. kATSUSequentialFallbacksPreferred = 2;
  795. {
  796. * This constants specifies that only the font list you provide
  797. * should be sequentially searched for substitute glyphs. All other
  798. * fonts on the system are ignored, except for the special last
  799. * resort font. You specify the list of fonts you want ATSUI to use
  800. * by passing it to the iFonts parameter of the
  801. * ATSUSetObjFontFallbacks function.
  802. }
  803. kATSUSequentialFallbacksExclusive = 3;
  804. {
  805. * ATSUTabType
  806. *
  807. * Discussion:
  808. * ATSUTabType type defines the characteristic of ATSUI tabs. A Left
  809. * tab type specifies that the left side of affected text is to be
  810. * maintained flush against the tab stop. A Right tab type
  811. * specifies that the right side of affected text is to be
  812. * maintained flush against the tab stop. A Center tab type
  813. * specifies that the affected text centered about the tab stop. A
  814. * Decimal tab type specifies that the affected text will be aligned
  815. * such that the decimal character will by flush against the tab
  816. * stop. The default decimal character is defined in System
  817. * Preferences. A different decimal character can be defined by
  818. * using the ATSUAttributeTag kATSULineDecimalTabCharacterTag.
  819. }
  820. type ATSUTabType = UInt16;
  821. const
  822. kATSULeftTab = 0;
  823. kATSUCenterTab = 1;
  824. kATSURightTab = 2;
  825. kATSUDecimalTab = 3;
  826. kATSUNumberTabTypes = 4;
  827. {
  828. * ATSUTab
  829. *
  830. * Discussion:
  831. * ATSUTab specifies the position and type of tab stop to be applied
  832. * to a ATSUTextLayout set through the ATSUI routine ATSUSetTabArray
  833. * and returned through ATSUGetTabArray.
  834. }
  835. type
  836. ATSUTab = record
  837. tabPosition: ATSUTextMeasurement;
  838. tabType: ATSUTabType;
  839. end;
  840. ATSUTabPtr = ^ATSUTab;
  841. {
  842. * ATSURGBAlphaColor
  843. *
  844. * Discussion:
  845. * Use this structure with the kATSURGBAlphaColorTag attribute to
  846. * specify color for your text in an ATSUStyle. All values range
  847. * from 0.0 to 1.0.
  848. }
  849. type
  850. ATSURGBAlphaColor = record
  851. red: Float32;
  852. green: Float32;
  853. blue: Float32;
  854. alpha: Float32;
  855. end;
  856. ATSURGBAlphaColorPtr = ^ATSURGBAlphaColor;
  857. {
  858. * GlyphCollection
  859. *
  860. * Discussion:
  861. * GlyphCollection types represent the specific character
  862. * collection. If the value is zero, kGlyphCollectionGID, then this
  863. * indicates that the glyph value represents the actual glyphID of a
  864. * specific font. Adobe collections are based on CID, rather than
  865. * glyph ID.
  866. }
  867. type GlyphCollection = UInt16;
  868. const
  869. kGlyphCollectionGID = 0;
  870. kGlyphCollectionAdobeCNS1 = 1;
  871. kGlyphCollectionAdobeGB1 = 2;
  872. kGlyphCollectionAdobeJapan1 = 3;
  873. kGlyphCollectionAdobeJapan2 = 4;
  874. kGlyphCollectionAdobeKorea1 = 5;
  875. kGlyphCollectionUnspecified = $FF;
  876. {
  877. * ATSUGlyphSelector
  878. *
  879. * Discussion:
  880. * ATSUGlyphSelector can direct ATSUI to use a specific glyph
  881. * instead of the one that ATSUI normally derives. The glyph can be
  882. * specified either as a glyphID (specific to the font used) or CID
  883. * from a specfic collection defined by the collection entry.
  884. }
  885. type
  886. ATSUGlyphSelector = record
  887. {
  888. * A glyph collection constant. See the definition of GlyphCollection
  889. * for possible values for this field.
  890. }
  891. collection: GlyphCollection;
  892. {
  893. * The glyph ID of the glyph (when collection is
  894. * kGlyphCollectionGID). For Adobe glyph collections, this value
  895. * represents a CID
  896. }
  897. glyphID: GlyphID_fix;
  898. end;
  899. ATSUGlyphSelectorPtr = ^ATSUGlyphSelector;
  900. type ATSUCustomAllocFunc = function( refCon: UnivPtr; howMuch: ByteCount ): Ptr;
  901. type ATSUCustomFreeFunc = procedure( refCon: UnivPtr; doomedBlock: UnivPtr );
  902. type ATSUCustomGrowFunc = function( refCon: UnivPtr; oldBlock: UnivPtr; oldSize: ByteCount; newSize: ByteCount ): Ptr;
  903. {
  904. * ATSUMemoryCallbacks
  905. *
  906. * Discussion:
  907. * ATSUMemoryCallbacks is a union struct that allows the ATSUI
  908. * client to specify a specific heap for ATSUI use or allocation
  909. * callbacks of which ATSUI is to use each time ATSUI performs a
  910. * memory operation (alloc, grow, free).
  911. }
  912. type
  913. ATSUMemoryCallbacks = record
  914. case SInt16 of
  915. 1: (
  916. callbacks: record
  917. Alloc: ATSUCustomAllocFunc;
  918. Free: ATSUCustomFreeFunc;
  919. Grow: ATSUCustomGrowFunc;
  920. memoryRefCon: Ptr;
  921. end;
  922. );
  923. 2: (
  924. heapToUse: THz;
  925. );
  926. end;
  927. ATSUMemoryCallbacksPtr = ^ATSUMemoryCallbacks;
  928. {
  929. * ATSUHeapSpec
  930. *
  931. * Discussion:
  932. * ATSUHeapSpec provides the ATSUI client a means of specifying the
  933. * heap from which ATSUI should allocate its dynamic memory or
  934. * specifying that ATSUI should use the memory callback provided by
  935. * the client.
  936. }
  937. type ATSUHeapSpec = UInt16;
  938. const
  939. kATSUUseCurrentHeap = 0;
  940. kATSUUseAppHeap = 1;
  941. kATSUUseSpecificHeap = 2;
  942. kATSUUseCallbacks = 3;
  943. {
  944. * ATSUMemorySetting
  945. *
  946. * Discussion:
  947. * ATSUMemorySetting is used to store the results from a
  948. * ATSUSetMemoryAlloc or a ATSUGetCurrentMemorySetting call. It can
  949. * also be used to change the current ATSUMemorySetting by passing
  950. * it into the ATSUSetCurrentMemorySetting call.
  951. }
  952. type
  953. ATSUMemorySetting = ^SInt32; { an opaque 32-bit type }
  954. {
  955. * ATSUGlyphInfo
  956. *
  957. * Summary:
  958. * Structure returned by ATSUGetGlyphInfo
  959. *
  960. * Discussion:
  961. * ATSUGetGlyphInfo will return an array of these structs, one for
  962. * each glyph in the specified range. You can then make changes to
  963. * the data before drawing it with ATSUDrawGlyphInfo. These
  964. * functions are no longer recommended; see ATSUnicodeDirectAccess.h
  965. * for replacement functions.
  966. }
  967. type
  968. ATSUGlyphInfo = record
  969. glyphID: GlyphID_fix;
  970. reserved: UInt16;
  971. layoutFlags: UInt32;
  972. charIndex: UniCharArrayOffset;
  973. style: ATSUStyle;
  974. deltaY: Float32;
  975. idealX: Float32;
  976. screenX: SInt16;
  977. caretX: SInt16;
  978. end;
  979. ATSUGlyphInfoPtr = ^ATSUGlyphInfo;
  980. {
  981. * ATSUGlyphInfoArray
  982. *
  983. * Summary:
  984. * Structure returned by ATSUGetGlyphInfo
  985. *
  986. * Discussion:
  987. * This data structure is returned by ATSUGetGlyphInfo. layout is
  988. * the same layout you pass in to ATSUGetGlyphInfo, numGlyphs is the
  989. * number of glyphs stored in the array glyphs. See the definition
  990. * of ATSUGlyphInfo for more information about the data structures
  991. * contained in the glyphs array. The ATSUGetGlyphInfo function is
  992. * no longer recommended; see ATSUnicodeDirectAccess.h for
  993. * replacement functions.
  994. }
  995. type
  996. ATSUGlyphInfoArray = record
  997. layout: ATSUTextLayout;
  998. numGlyphs: ItemCount;
  999. glyphs: array[0..0] of ATSUGlyphInfo;
  1000. end;
  1001. ATSUGlyphInfoArrayPtr = ^ATSUGlyphInfoArray;
  1002. {*******************************************************************************}
  1003. { ATSUI highlighting method constants and typedefs }
  1004. {*******************************************************************************}
  1005. {
  1006. * ATSUHighlightMethod
  1007. *
  1008. * Discussion:
  1009. * Use the constants with the function ATSUSetHighlightingMethod to
  1010. * determine the method of highlighting to use. kInvertHighlighting
  1011. * will cause ATSUI to perform a simple color inversion on the area
  1012. * around the text. Although this method requires the least work, it
  1013. * does not produce the best visual results. kRedrawHighlighting
  1014. * will cause ATSUI to redraw the text whenever highlighting or
  1015. * unhighlighting it. This method produces the best visual results,
  1016. * but it does require you to specify a way for ATSUI to redraw the
  1017. * background behind the text after an unhighlight operation. See
  1018. * the definitions of ATSUUnhighlightData, ATSUBackgroundData,
  1019. * ATSUBackgroundDataType, and RedrawBackgroundProcPtr for more
  1020. * information.
  1021. }
  1022. type ATSUHighlightMethod = UInt32;
  1023. const
  1024. kInvertHighlighting = 0;
  1025. kRedrawHighlighting = 1;
  1026. {
  1027. * ATSUBackgroundDataType
  1028. *
  1029. * Discussion:
  1030. * Use these constants for the dataType field in the
  1031. * ATSUUnhighlightData structure. kATSUBackgroundColor refers to a
  1032. * solid color background, while kATSUBackgroundCallback refers to a
  1033. * redrawing callback function. Note that if you specify
  1034. * kATSUBackgroundCallback, you must provide a callback function.
  1035. }
  1036. type ATSUBackgroundDataType = UInt32;
  1037. const
  1038. kATSUBackgroundColor = 0;
  1039. kATSUBackgroundCallback = 1;
  1040. {
  1041. * ATSUBackgroundColor
  1042. *
  1043. * Discussion:
  1044. * A background color used by ATSUI to redraw the background after a
  1045. * call to ATSUUnhighlight text when the highlighting method is set
  1046. * to kRedrawHighlighting. See the definitions of ATSUBackgroundData
  1047. * and ATSUUnhighlightData for more information.
  1048. }
  1049. type ATSUBackgroundColor = ATSURGBAlphaColor;
  1050. {
  1051. * RedrawBackgroundProcPtr
  1052. *
  1053. * Discussion:
  1054. * RedrawBackgroundProcPtr is a pointer to a client-supplied
  1055. * callback function (e.g. MyRedrawBackgroundProc) for redrawing
  1056. * complex backgrounds (and optionally the text as well) that can be
  1057. * called by ATSUI for highlighting if the client has called
  1058. * ATSUSetHighlightingMethod with kRedrawHighlighting for the
  1059. * iMethod parameter. In order for ATSUI to call the client
  1060. * function, the client must (1) pass a pointer to the client
  1061. * function to NewRedrawBackgroundUPP() in order to obtain a
  1062. * RedrawBackgroundUPP, and (2) pass the RedrawBackgroundUPP in the
  1063. * unhighlightData.backgroundUPP field of the iUnhighlightData
  1064. * parameter for the ATSUSetHighlightingMethod call. When finished,
  1065. * the client should call DisposeRedrawBackgroundUPP with the
  1066. * RedrawBackgroundUPP.
  1067. *
  1068. * Parameters:
  1069. *
  1070. * iLayout:
  1071. * The layout to which the highlighting is being applied. The
  1072. * client function can use this to redraw the text.
  1073. *
  1074. * iTextOffset:
  1075. * The offset of the text that is being highlighted; can be used
  1076. * by the client function to redraaw the text.
  1077. *
  1078. * iTextLength:
  1079. * The length of the text that is being highlighted; can be used
  1080. * by the client function to redraaw the text.
  1081. *
  1082. * iUnhighlightArea:
  1083. * An array of ATSTrapezoids that describes the highlight area.
  1084. * The ATSTrapezoid array is ALWAYS in QD coordinates.
  1085. *
  1086. * iTrapezoidCount:
  1087. * The count of ATSTrapezoids in iUnhighlightArea.
  1088. *
  1089. * Result:
  1090. * A Boolean result indicating whether ATSUI should redraw the text.
  1091. * If the client function redraws the text, it should return false,
  1092. * otherwise it should return true to have ATSUI redraw any text
  1093. * that needs to be redrawn.
  1094. }
  1095. type RedrawBackgroundProcPtr = function( iLayout: ATSUTextLayout; iTextOffset: UniCharArrayOffset; iTextLength: UniCharCount; iUnhighlightArea: ATSTrapezoidPtr; iTrapezoidCount: ItemCount ): Boolean;
  1096. // typedef STACK_UPP_TYPE(RedrawBackgroundProcPtr) RedrawBackgroundUPP;
  1097. // Beats me what this translates to. If someone finds out they can tell me and we'll update it
  1098. type RedrawBackgroundUPP = Ptr;
  1099. {
  1100. * NewRedrawBackgroundUPP()
  1101. *
  1102. * Availability:
  1103. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1104. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
  1105. * Non-Carbon CFM: not available
  1106. }
  1107. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  1108. function NewRedrawBackgroundUPP( userRoutine: RedrawBackgroundProcPtr ): RedrawBackgroundUPP; external name '_NewRedrawBackgroundUPP';
  1109. {
  1110. * DisposeRedrawBackgroundUPP()
  1111. *
  1112. * Availability:
  1113. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1114. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
  1115. * Non-Carbon CFM: not available
  1116. }
  1117. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  1118. procedure DisposeRedrawBackgroundUPP( userUPP: RedrawBackgroundUPP ); external name '_DisposeRedrawBackgroundUPP';
  1119. {
  1120. * InvokeRedrawBackgroundUPP()
  1121. *
  1122. * Availability:
  1123. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1124. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
  1125. * Non-Carbon CFM: not available
  1126. }
  1127. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  1128. function InvokeRedrawBackgroundUPP( iLayout: ATSUTextLayout; iTextOffset: UniCharArrayOffset; iTextLength: UniCharCount; iUnhighlightArea: ATSTrapezoidPtr; iTrapezoidCount: ItemCount; userUPP: RedrawBackgroundUPP ): Boolean; external name '_InvokeRedrawBackgroundUPP';
  1129. {
  1130. * ATSUBackgroundData
  1131. *
  1132. * Summary:
  1133. * Data describing one of two methods for ATSUI to unhighlight text.
  1134. *
  1135. * Discussion:
  1136. * When you call ATSUUnhighlightText and the highlighting method
  1137. * used is kRedrawHighlighting, ATSUI must redraw the text,
  1138. * including the background, when unhighlighting. The two ways of
  1139. * doing this are by telling ATSUI to (1) use a solid color to
  1140. * repaint the background (2) use a callback function to repaint the
  1141. * background. This union provides that information to ATSUI. See
  1142. * the definitions of ATSUUnhighlightData, RedrawBackgroundProcPtr,
  1143. * and ATSUSetHighlightingMethod for more information.
  1144. }
  1145. type
  1146. ATSUBackgroundData = record
  1147. case SInt16 of
  1148. 1: (
  1149. {
  1150. * Specifies a color for ATSUI to repaint the background.
  1151. }
  1152. backgroundColor: ATSUBackgroundColor;
  1153. );
  1154. 2: (
  1155. {
  1156. * Specifies a Universal Procedure Pointer for ATSUI to call to
  1157. * redraw the background.
  1158. }
  1159. backgroundUPP: RedrawBackgroundUPP;
  1160. );
  1161. end;
  1162. ATSUBackgroundDataPtr = ^ATSUBackgroundData;
  1163. {
  1164. * ATSUUnhighlightData
  1165. *
  1166. * Summary:
  1167. * Struct for defining a method for ATSUI to unhighlight text.
  1168. *
  1169. * Discussion:
  1170. * There are two methods of highlighting available on Mac OS X:
  1171. * invert and redraw. For the invert method, no unhighlight method
  1172. * needs to be specified. ATSUI will simply higlight text by
  1173. * performing a color inversion on the area surrounding the test.
  1174. * However, for best results, the redraw method is perferred. With
  1175. * this method, ATSUI will redraw text with a new background when
  1176. * highlighting, and redraw it again when unhighlighting. When using
  1177. * the redraw method, ATSUI needs to know how to restore the
  1178. * backround when unhighlighting text. That is where the unhighlight
  1179. * data comes in. This struct tells ATSUI how to restore the
  1180. * background after a highlight. There are two methods for
  1181. * specifying this information to ATSUI. One is by specifying a
  1182. * solid color, the other by providing a callback for redrawing part
  1183. * of the background.
  1184. }
  1185. type
  1186. ATSUUnhighlightData = record
  1187. {
  1188. * Determines which method to use for restoring the background after
  1189. * a highlight; solid color (kATSUBackgroundColor), or drawing
  1190. * callback (kATSUBackgroundCallback). See also the definition of
  1191. * ATSUBackgroundDataType.
  1192. }
  1193. dataType: ATSUBackgroundDataType;
  1194. {
  1195. * This union provides the actual data for ATSUI to use when
  1196. * redrawing the background. See the definition of ATSUBackgroundData
  1197. * for more information.
  1198. }
  1199. unhighlightData: ATSUBackgroundData;
  1200. end;
  1201. ATSUUnhighlightDataPtr = ^ATSUUnhighlightData;
  1202. {******************************************************************************}
  1203. { Other ATSUI constants }
  1204. {******************************************************************************}
  1205. {
  1206. * Summary:
  1207. * Line direction types
  1208. *
  1209. * Discussion:
  1210. * These constants are used with the kATSULineDirectionTag control
  1211. * to determine overall line direction.
  1212. }
  1213. const
  1214. {
  1215. * Imposes left-to-right or top-to-bottom dominant direction.
  1216. }
  1217. kATSULeftToRightBaseDirection = 0;
  1218. {
  1219. * Impose right-to-left or bottom-to-top dominant direction.
  1220. }
  1221. kATSURightToLeftBaseDirection = 1;
  1222. const
  1223. kATSUStartAlignment = Fract($00000000);
  1224. kATSUEndAlignment = Fract($40000000);
  1225. kATSUCenterAlignment = Fract($20000000);
  1226. kATSUNoJustification = Fract($00000000);
  1227. kATSUFullJustification = Fract($40000000);
  1228. {
  1229. * Summary:
  1230. * This constant will be returned from ATSUFindFontFromName if no
  1231. * valid font can be found. If you pass this constant to
  1232. * ATSUSetAttributes, it will produce an error.
  1233. }
  1234. const
  1235. kATSUInvalidFontID = 0;
  1236. {
  1237. * Summary:
  1238. * Pass this constant to line breaking functions (i.e.,
  1239. * ATSUBreakLine, ATSUBatchBreakLines) if you have already set a
  1240. * line width as a layout control via the kATSULineWidthTag
  1241. * attribute.
  1242. }
  1243. const
  1244. kATSUUseLineControlWidth = $7FFFFFFF;
  1245. {
  1246. * Summary:
  1247. * Pass this constant to the iSelector parameter of the
  1248. * ATSUGetFontFeatureNameCode function if you wish to obtain the
  1249. * name code for a feature type rather than a feature selector.
  1250. }
  1251. const
  1252. kATSUNoSelector = $0000FFFF;
  1253. {
  1254. * Summary:
  1255. * Text buffer convenience constants.
  1256. *
  1257. * Discussion:
  1258. * These constants refer to the beginning and end of a text buffer.
  1259. * Functions which accept these constants are marked below. Do not
  1260. * pass these constants to functions which do not explicity state
  1261. * they will accept them.
  1262. }
  1263. const
  1264. {
  1265. * Refers to the beginning of a text buffer.
  1266. }
  1267. kATSUFromTextBeginning = $FFFFFFFF;
  1268. {
  1269. * Refers to the end of a text buffer.
  1270. }
  1271. kATSUToTextEnd = $FFFFFFFF;
  1272. {
  1273. * Used for bidi cursor movement between paragraphs.
  1274. }
  1275. kATSUFromPreviousLayout = $FFFFFFFE;
  1276. {
  1277. * Used for bidi cursor movement between paragraphs.
  1278. }
  1279. kATSUFromFollowingLayout = $FFFFFFFD;
  1280. {
  1281. * Summary:
  1282. * Other convenience constants.
  1283. }
  1284. const
  1285. {
  1286. * Pass this constant to functions that require a set of coordinates
  1287. * (i.e., ATSUDrawText, ATSUHighlightText) if you want ATSUI to use
  1288. * the current Quickdraw graphics port pen location.
  1289. }
  1290. kATSUUseGrafPortPenLoc = $FFFFFFFF;
  1291. {
  1292. * Pass this constant to functions such as ATSUClearAttributes and
  1293. * ATSUClearLayoutControls if you wish to clear all settings instead
  1294. * of a specific array of settings.
  1295. }
  1296. kATSUClearAll = $FFFFFFFF;
  1297. end.