summaryrefslogtreecommitdiff
path: root/common/quicktime_win32/ATSLayoutTypes.h
blob: a04fb4f1893a5c620632cbde69ff7135ba74d2e1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
/*
     File:       ATSLayoutTypes.h
 
     Contains:   Apple Type Services layout public structures and constants.
 
     Version:    QuickTime 7.3
 
     Copyright:  (c) 2007 (c) 1994-2001 by Apple Computer, Inc., all rights reserved.
 
     Bugs?:      For bug reports, consult the following page on
                 the World Wide Web:
 
                     http://developer.apple.com/bugreporter/
 
*/
#ifndef __ATSLAYOUTTYPES__
#define __ATSLAYOUTTYPES__

#ifndef __MACTYPES__
#include <MacTypes.h>
#endif

#ifndef __SFNTLAYOUTTYPES__
#include <SFNTLayoutTypes.h>
#endif

#ifndef __ATSTYPES__
#include <ATSTypes.h>
#endif




#if PRAGMA_ONCE
#pragma once
#endif

#ifdef __cplusplus
extern "C" {
#endif

#if PRAGMA_IMPORT
#pragma import on
#endif

#if PRAGMA_STRUCT_ALIGN
    #pragma options align=mac68k
#elif PRAGMA_STRUCT_PACKPUSH
    #pragma pack(push, 2)
#elif PRAGMA_STRUCT_PACK
    #pragma pack(2)
#endif

/* --------------------------------------------------------------------------- */
/* CONSTANTS and related scalar types */
/* --------------------------------------------------------------------------- */
/* --------------------------------------------------------------------------- */
/* Miscellaneous Constants */
/* --------------------------------------------------------------------------- */
enum {
  kATSUseGlyphAdvance           = 0x7FFFFFFF, /* assignment to use natural glyph advance value */
  kATSUseLineHeight             = 0x7FFFFFFF, /* assignment to use natural line ascent/descent values */
  kATSNoTracking                = (long)0x80000000 /* negativeInfinity */
};

/* --------------------------------------------------------------------------- */

/*
 *  Summary:
 *    These values are passed into the ATSUGetGlyphBounds function to
 *    indicate whether the width of the resulting typographic glyph
 *    bounds will be determined using the caret origin, glyph origin in
 *    device space, or glyph origin in fractional absolute positions
 */
enum {

  /*
   * Specifies that the width of the typographic glyph bounds will be
   * determined using the caret origin. The caret origin is halfway
   * between two characters.
   */
  kATSUseCaretOrigins           = 0,

  /*
   * Specifies that the width of the typographic glyph bounds will be
   * determined using the glyph origin in device space. This is useful
   * for adjusting text on the screen.
   */
  kATSUseDeviceOrigins          = 1,

  /*
   * Specifies that the width of the typographic glyph bounds will be
   * determined using the glyph origin in fractional absolute
   * positions, which are uncorrected for device display. This provides
   * the ideal position of laid-out text and is useful for scaling text
   * on the screen. This origin is also used to get the width of the
   * typographic bounding rectangle when you call ATSUMeasureText.
   */
  kATSUseFractionalOrigins      = 2,
  kATSUseOriginFlags            = 3
};

/* ---------------------------------------------------------------------------- */

/*
 *  ATSULayoutOperationSelector
 *  
 *  Summary:
 *    This is used to select which operations to override, or which
 *    operation is currently being run.
 */
typedef UInt32 ATSULayoutOperationSelector;
enum {

  /*
   * No Layout operation is currently selected.
   */
  kATSULayoutOperationNone      = 0x00000000,

  /*
   * Select the Justification operation.
   */
  kATSULayoutOperationJustification = 0x00000001,

  /*
   * Select the character morphing operation.
   */
  kATSULayoutOperationMorph     = 0x00000002,

  /*
   * Select the kerning adjustment operation.
   */
  kATSULayoutOperationKerningAdjustment = 0x00000004,

  /*
   * Select the baseline adjustment operation.
   */
  kATSULayoutOperationBaselineAdjustment = 0x00000008,

  /*
   * Select the tracking adjustment operation.
   */
  kATSULayoutOperationTrackingAdjustment = 0x00000010,

  /*
   * Select the period of time after ATSUI has finished all of it's
   * layout operations.
   */
  kATSULayoutOperationPostLayoutAdjustment = 0x00000020,
  kATSULayoutOperationAppleReserved = (unsigned long)0xFFFFFFC0
};

/* ---------------------------------------------------------------------------- */

/*
 *  ATSULayoutOperationCallbackStatus
 *  
 *  Summary:
 *    One of these must be returned by a
 *    ATSUDLayoutOperationOverrideUPP callback function in order to
 *    indicate ATSUI's status.
 */
typedef UInt32 ATSULayoutOperationCallbackStatus;
enum {

  /*
   * Return this if the callback function has totally handled the
   * operation which triggered the callback and does not need ATSUI to
   * run any further processing for the operation.
   */
  kATSULayoutOperationCallbackStatusHandled = 0x00000000,

  /*
   * Return this if the callback function has not totally handled the
   * operation which triggered the callback and needs ATSUI to run it's
   * own processing.
   */
  kATSULayoutOperationCallbackStatusContinue = 0x00000001
};

/* ---------------------------------------------------------------------------- */

/*
 *  ATSLineLayoutOptions
 *  
 *  Summary:
 *    ATSLineLayoutOptions are normally set in an ATSUTextLayout object
 *    via the kATSULineLayoutOptionsTag layout control attribute. They
 *    can also be set in an ATSLineLayoutParams structure and passed
 *    into the ATSLayoutText function for finer control over the line
 *    layout.
 */
typedef UInt32 ATSLineLayoutOptions;
enum {

  /*
   * No options specified.
   */
  kATSLineNoLayoutOptions       = 0x00000000,

  /*
   * This line option is no longer used.
   */
  kATSLineIsDisplayOnly         = 0x00000001, /* obsolete option*/

  /*
   * Specifies that no hangers to be formed on the line.
   */
  kATSLineHasNoHangers          = 0x00000002,

  /*
   * Specifies that no optical alignment to be performed on the line.
   */
  kATSLineHasNoOpticalAlignment = 0x00000004,

  /*
   * Specifies that space charcters should not be treated as hangers.
   */
  kATSLineKeepSpacesOutOfMargin = 0x00000008,

  /*
   * Specifies no post-compensation justification is to be performed.
   */
  kATSLineNoSpecialJustification = 0x00000010,

  /*
   * Specifies that if the line is the last of a paragraph, it will not
   * get justified.
   */
  kATSLineLastNoJustification   = 0x00000020,

  /*
   * Specifies that the displayed line glyphs will adjust for device
   * metrics.
   */
  kATSLineFractDisable          = 0x00000040,

  /*
   * Specifies that the carets at the ends of the line will be
   * guarenteed to be perpendicular to the baseline.
   */
  kATSLineImposeNoAngleForEnds  = 0x00000080,

  /*
   * Highlights for the line end characters will be extended to 0 and
   * the specified line width.
   */
  kATSLineFillOutToWidth        = 0x00000100,

  /*
   * Specifies that the tab character width will be automatically
   * adjusted to fit the specified line width.
   */
  kATSLineTabAdjustEnabled      = 0x00000200,

  /*
   * Specifies that any leading value specified by a font will be
   * ignored.
   */
  kATSLineIgnoreFontLeading     = 0x00000400,

  /*
   * Specifies that ATS produce antialiased glyph images despite system
   * preferences or CGContext settings.
   */
  kATSLineApplyAntiAliasing     = 0x00000800,

  /*
   * Specifies that ATS turn-off antialiasing glyph imaging despite
   * system preferences or CGContext settings (negates
   * kATSLineApplyAntiAliasing bit if set).
   */
  kATSLineNoAntiAliasing        = 0x00001000,

  /*
   * Specifies that if the line width is not sufficient to hold all its
   * glyphs, glyph positions are allowed to extend beyond the line's
   * assigned width so negative justification is not used.
   */
  kATSLineDisableNegativeJustification = 0x00002000,

  /*
   * Specifies that lines with any integer glyph positioning (due to
   * either any character non-antialiased or kATSLineFractDisable
   * specified), not automatically esthetically adjust individual
   * character positions while rendering to display.
   */
  kATSLineDisableAutoAdjustDisplayPos = 0x00004000,

  /*
   * Specifies that rendering be done through Quickdraw (default
   * rendering in ATSUI is through CoreGraphics on MacOSX).
   */
  kATSLineUseQDRendering        = 0x00008000,

  /*
   * Specifies that any Justification operations will not be run.
   */
  kATSLineDisableAllJustification = 0x00010000,

  /*
   * Specifies that any glyph morphing operations will not be run.
   */
  kATSLineDisableAllGlyphMorphing = 0x00020000,

  /*
   * Specifies that any kerning adjustment operations will not be run.
   */
  kATSLineDisableAllKerningAdjustments = 0x00040000,

  /*
   * Specifies that any baseline adjustment operations will not be run.
   */
  kATSLineDisableAllBaselineAdjustments = 0x00080000,

  /*
   * Specifies that any tracking adjustment operations will not be run.
   */
  kATSLineDisableAllTrackingAdjustments = 0x00100000,

  /*
   * Convenience constant for turning-off all adjustments.
   */
  kATSLineDisableAllLayoutOperations = kATSLineDisableAllJustification | kATSLineDisableAllGlyphMorphing | kATSLineDisableAllKerningAdjustments | kATSLineDisableAllBaselineAdjustments | kATSLineDisableAllTrackingAdjustments,

  /*
   * Specifies to optimize for displaying text only.  Note, rounded
   * device metrics will be used instead of fractional path metrics.
   */
  kATSLineUseDeviceMetrics      = 0x01000000,

  /*
   * These bits are reserved by Apple and will result in a invalid
   * value error if attemped to set. Obsolete constants:
   */
  kATSLineAppleReserved         = (unsigned long)0xFEE00000
};

/* --------------------------------------------------------------------------- */

/*
 *  ATSStyleRenderingOptions
 *  
 *  Summary:
 *    ATSStyleRenderingOptions are set in the ATSUStyle object via the
 *    attribute tag kATSUStyleRenderingOptions. They provide finer
 *    control over how the style is rendered.
 */
typedef UInt32 ATSStyleRenderingOptions;
enum {

  /*
   * No options specified.
   */
  kATSStyleNoOptions            = 0x00000000,

  /*
   * Specifies that ATS produce "unhinted" glyph outlines (default is
   * hinted glyph outlines).
   */
  kATSStyleNoHinting            = 0x00000001,

  /*
   * Specifies that ATS produce antialiased glyph images despite system
   * preferences or CGContext settings.
   */
  kATSStyleApplyAntiAliasing    = 0x00000002,

  /*
   * Specifies that ATS turn-off antialiasing glyph imaging despite
   * system preferences or CGContext settings (negates
   * kATSStyleApplyAntiAliasing bit if set).
   */
  kATSStyleNoAntiAliasing       = 0x00000004,

  /*
   * These bits are reserved by Apple and will result in a invalid
   * value error if attemped to set.
   */
  kATSStyleAppleReserved        = (unsigned long)0xFFFFFFF8,

  /*
   * (OBSOLETE) Specifies that ATS produce "hinted" glyph outlines (the
   * default behavior). THIS NAME IS OBSOLETE. DO NOT USE. It's only
   * left in for backwards compatibility.
   */
  kATSStyleApplyHints           = kATSStyleNoOptions
};

/* --------------------------------------------------------------------------- */



/*
 *  ATSGlyphInfoFlags
 *  
 *  Summary:
 *    ATSGlyphInfoFlags are set in the individual ATSLayoutRecord
 *    structures and apply only to the ATSGlyphRef in that structure.
 *    The are used by the layout engine to flag a glyph with specific
 *    properties.
 */
typedef UInt32 ATSGlyphInfoFlags;
enum {

  /*
   * These bits are Apple reserved and may result in an invalid value
   * error if attempted to set.
   */
  kATSGlyphInfoAppleReserved    = 0x1FFBFFE8,

  /*
   * The glyph attaches to another glyph.
   */
  kATSGlyphInfoIsAttachment     = (unsigned long)0x80000000,

  /*
   * The glyph can hang off left/top edge of line.
   */
  kATSGlyphInfoIsLTHanger       = 0x40000000,

  /*
   * The glyph can hang off right/bottom edge of line.
   */
  kATSGlyphInfoIsRBHanger       = 0x20000000,

  /*
   * The glyph is not really a glyph at all, but an end-marker designed
   * to allow the calculation of the previous glyph's advance.
   */
  kATSGlyphInfoTerminatorGlyph  = 0x00080000,

  /*
   * The glyph is a white space glyph.
   */
  kATSGlyphInfoIsWhiteSpace     = 0x00040000,

  /*
   * Glyph has a style specified imposed width (i.e. advance)
   */
  kATSGlyphInfoHasImposedWidth  = 0x00000010,

  /*
   * A three-bit mask, that can be used to get the size of the original
   * character that spawned this glyph. When a logical 'and' operation
   * with this mask and an ATSGlyphInfoFlags variable, it will yield
   * the size in bytes of the original character (0 - 7 bytes possible).
   */
  kATSGlyphInfoByteSizeMask     = 0x00000007
};

/* --------------------------------------------------------------------------- */
/* STRUCTURED TYPES and related constants */
/* --------------------------------------------------------------------------- */

/*
 *  ATSLayoutRecord
 *  
 *  Summary:
 *    The ATSLayoutRecord structure defines all the needed info for a
 *    single glyph during the layout process.  This struct must be
 *    declared as the first element of an enclosing glyph record struct
 *    defined by ATSUI DirectAccess clients.
 */
struct ATSLayoutRecord {

  /*
   * The glyph ID reference.
   */
  ATSGlyphRef         glyphID;

  /*
   * These flags describe the individual state of the glyph (see above).
   */
  ATSGlyphInfoFlags   flags;

  /*
   * The byte offset of the original character that spawned this glyph.
   */
  ByteCount           originalOffset;

  /*
   * This is the real position that the glyph sits.
   */
  Fixed               realPos;
};
typedef struct ATSLayoutRecord          ATSLayoutRecord;
/* --------------------------------------------------------------------------- */

/*
 *  ATSTrapezoid
 *  
 *  Summary:
 *    The ATSTrapezoid structure supplies a convenient container for
 *    glyph bounds in trapezoidal form.
 */
struct ATSTrapezoid {
  FixedPoint          upperLeft;
  FixedPoint          upperRight;
  FixedPoint          lowerRight;
  FixedPoint          lowerLeft;
};
typedef struct ATSTrapezoid             ATSTrapezoid;
/* --------------------------------------------------------------------------- */

/*
 *  ATSJustWidthDeltaEntryOverride
 *  
 *  Summary:
 *    The JustWidthDeltaEntryOverride structure specifies values for
 *    the grow and shrink case during justification, both on the left
 *    and on the right. It also contains flags.  This particular
 *    structure is used for passing justification overrides to LLC. For
 *    further sfnt resource 'just' table constants and structures, see
 *    SFNTLayoutTypes.h.
 */
struct ATSJustWidthDeltaEntryOverride {

  /*
   * ems AW can grow by at most on LT
   */
  Fixed               beforeGrowLimit;

  /*
   * ems AW can shrink by at most on LT
   */
  Fixed               beforeShrinkLimit;

  /*
   * ems AW can grow by at most on RB
   */
  Fixed               afterGrowLimit;

  /*
   * ems AW can shrink by at most on RB
   */
  Fixed               afterShrinkLimit;

  /*
   * flags controlling grow case
   */
  JustificationFlags  growFlags;

  /*
   * flags controlling shrink case
   */
  JustificationFlags  shrinkFlags;
};
typedef struct ATSJustWidthDeltaEntryOverride ATSJustWidthDeltaEntryOverride;
/* The JustPriorityOverrides type is an array of 4 width delta records, one per priority level override. */
typedef ATSJustWidthDeltaEntryOverride  ATSJustPriorityWidthDeltaOverrides[4];
/* ---------------------------------------------------------------------------- */

/*
 *  ATSULineRef
 *  
 *  Summary:
 *    A reference to a line that is being laid out. This is passed into
 *    the ATSUDirectLayoutOperationOverrideUPP callback function to be
 *    used by the ATSUDirectGetLayoutDataArrayPtrFromLineRef function.
 *    The only way to get a line ref is inside of the callback. The
 *    only time the line ref is valid is inside of the callback.
 */
typedef struct ATSGlyphVector*          ATSULineRef;
/* ---------------------------------------------------------------------------- */
/* DirectAccess Layout Callback Definitions                                     */
/* ---------------------------------------------------------------------------- */

/*
 *  ATSUDirectLayoutOperationOverrideProcPtr
 *  
 *  Summary:
 *    Callback definition for a low-level adjustment routine hook.
 *  
 *  Discussion:
 *    This callback can be set in an ATSUTextLayout object by setting
 *    the attribute tag kATSULayoutOperationOverrideUPP and passing in
 *    a ATSULayoutOperationOverrideSpecifier structure into
 *    ATSUSetLayoutAttribute. This callback will be called whenever an
 *    ATSUI call triggers a re-layout for each operation it is
 *    installed for. The operation that triggered the callback will be
 *    set in the iCurrentOperation parameter. The callback function
 *    defined by the developer is only required to do one thing: return
 *    it's status to ATSUI as to what it has done. This is done via the
 *    oCallbackStatus parameter. It needs to tell ATSUI if it had
 *    handled the layout operation or if it still needs ATSUI to run
 *    it's own processes. iOperationCallbackParameterPtr is there in
 *    case there are ever any ATSUDirectLayoutOperationSelector which
 *    require extra parameters to be passed into the callback function.
 *    It is currently unused and will always be set to NULL. iRefCon is
 *    the constant that is set in the ATSUTextLayout object that
 *    spawned the operation by the ATSUSetTextLayoutRefCon() API.
 *    Within the context of the callback itself, only a limited subset
 *    of ATSUI APIs may be called. Basically, only the APIs that have
 *    no chance of triggering a re-layout are allowed to be called. The
 *    reason for this restriction is to prevent runaway recursion. Most
 *    of the APIs that have "create", "get", or "copy" are safe. Any
 *    attempt to call one of the restricted APIs will result in an
 *    immediate return with the kATSUInvalidCallInsideCallbackErr
 *    error. ATSULayoutOperationSelector and
 *    ATSULayoutOperationCallbackStatus are defined in ATSLayoutTypes.i.
 */
typedef CALLBACK_API_C( OSStatus , ATSUDirectLayoutOperationOverrideProcPtr )(ATSULayoutOperationSelector iCurrentOperation, ATSULineRef iLineRef, UInt32 iRefCon, void *iOperationCallbackParameterPtr, ATSULayoutOperationCallbackStatus *oCallbackStatus);
typedef TVECTOR_UPP_TYPE(ATSUDirectLayoutOperationOverrideProcPtr)  ATSUDirectLayoutOperationOverrideUPP;
/*
 *  NewATSUDirectLayoutOperationOverrideUPP()
 *  
 *  Availability:
 *    Non-Carbon CFM:   available as macro/inline
 *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
 *    Mac OS X:         in version 10.2 and later
 */
EXTERN_API_C( ATSUDirectLayoutOperationOverrideUPP )
NewATSUDirectLayoutOperationOverrideUPP(ATSUDirectLayoutOperationOverrideProcPtr userRoutine);
#if !OPAQUE_UPP_TYPES
  enum { uppATSUDirectLayoutOperationOverrideProcInfo = 0x0000FFF1 };  /* 4_bytes Func(4_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes) */
  #ifdef __cplusplus
    inline DEFINE_API_C(ATSUDirectLayoutOperationOverrideUPP) NewATSUDirectLayoutOperationOverrideUPP(ATSUDirectLayoutOperationOverrideProcPtr userRoutine) { return userRoutine; }
  #else
    #define NewATSUDirectLayoutOperationOverrideUPP(userRoutine) (userRoutine)
  #endif
#endif

/*
 *  DisposeATSUDirectLayoutOperationOverrideUPP()
 *  
 *  Availability:
 *    Non-Carbon CFM:   available as macro/inline
 *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
 *    Mac OS X:         in version 10.2 and later
 */
EXTERN_API_C( void )
DisposeATSUDirectLayoutOperationOverrideUPP(ATSUDirectLayoutOperationOverrideUPP userUPP);
#if !OPAQUE_UPP_TYPES
  #ifdef __cplusplus
      inline DEFINE_API_C(void) DisposeATSUDirectLayoutOperationOverrideUPP(ATSUDirectLayoutOperationOverrideUPP) {}
  #else
      #define DisposeATSUDirectLayoutOperationOverrideUPP(userUPP)
  #endif
#endif

/*
 *  InvokeATSUDirectLayoutOperationOverrideUPP()
 *  
 *  Availability:
 *    Non-Carbon CFM:   available as macro/inline
 *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
 *    Mac OS X:         in version 10.2 and later
 */
EXTERN_API_C( OSStatus )
InvokeATSUDirectLayoutOperationOverrideUPP(
  ATSULayoutOperationSelector           iCurrentOperation,
  ATSULineRef                           iLineRef,
  UInt32                                iRefCon,
  void *                                iOperationCallbackParameterPtr,
  ATSULayoutOperationCallbackStatus *   oCallbackStatus,
  ATSUDirectLayoutOperationOverrideUPP  userUPP);
#if !OPAQUE_UPP_TYPES
  #ifdef __cplusplus
      inline DEFINE_API_C(OSStatus) InvokeATSUDirectLayoutOperationOverrideUPP(ATSULayoutOperationSelector iCurrentOperation, ATSULineRef iLineRef, UInt32 iRefCon, void * iOperationCallbackParameterPtr, ATSULayoutOperationCallbackStatus * oCallbackStatus, ATSUDirectLayoutOperationOverrideUPP userUPP) { return (*userUPP)(iCurrentOperation, iLineRef, iRefCon, iOperationCallbackParameterPtr, oCallbackStatus); }
  #else
      #define InvokeATSUDirectLayoutOperationOverrideUPP(iCurrentOperation, iLineRef, iRefCon, iOperationCallbackParameterPtr, oCallbackStatus, userUPP) (*userUPP)(iCurrentOperation, iLineRef, iRefCon, iOperationCallbackParameterPtr, oCallbackStatus)
  #endif
#endif

/* ---------------------------------------------------------------------------- */

/*
 *  ATSULayoutOperationOverrideSpecifier
 *  
 *  Summary:
 *    This structure is used to install a callback for one or more
 *    ATSUI operations. To do this, simply passed one of these
 *    structure into the ATSUSetLayoutControls call with the
 *    kATSULayoutOperationOverrideUPP tag.
 */
struct ATSULayoutOperationOverrideSpecifier {


  /*
   * A bitfield containing the selector for the operations in which the
   * callback will be installed for.
   */
  ATSULayoutOperationSelector  operationSelector;
  ATSUDirectLayoutOperationOverrideUPP  overrideUPP;

};
typedef struct ATSULayoutOperationOverrideSpecifier ATSULayoutOperationOverrideSpecifier;

#if PRAGMA_STRUCT_ALIGN
    #pragma options align=reset
#elif PRAGMA_STRUCT_PACKPUSH
    #pragma pack(pop)
#elif PRAGMA_STRUCT_PACK
    #pragma pack()
#endif

#ifdef PRAGMA_IMPORT_OFF
#pragma import off
#elif PRAGMA_IMPORT
#pragma import reset
#endif

#ifdef __cplusplus
}
#endif

#endif /* __ATSLAYOUTTYPES__ */