PageRenderTime 57ms CodeModel.GetById 44ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

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