/packages/univint/src/ATSUnicodeTypes.pas

https://github.com/slibre/freepascal · Pascal · 1500 lines · 276 code · 156 blank · 1068 comment · 0 complexity · 830c2ee553fa0433f188159612d4f0c7 MD5 · raw file

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