GXTypes.h
上传用户:xjjlds
上传日期:2015-12-05
资源大小:22823k
文件大小:69k
源码类别:

多媒体编程

开发平台:

Visual C++

  1. /*
  2.      File:       GXTypes.h
  3.  
  4.      Contains:   QuickDraw GX object and constant definitions
  5.  
  6.      Version:    Technology: Quickdraw GX 1.1
  7.                  Release:    QuickTime 6.0.2
  8.  
  9.      Copyright:  (c) 1994-2001 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:      For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __GXTYPES__
  18. #define __GXTYPES__
  19. #ifndef __MACTYPES__
  20. #include "MacTypes.h"
  21. #endif
  22. #ifndef __MIXEDMODE__
  23. #include "MixedMode.h"
  24. #endif
  25. #ifndef __FIXMATH__
  26. #include "FixMath.h"
  27. #endif
  28. #ifndef __GXMATH__
  29. #include "GXMath.h"
  30. #endif
  31. #if PRAGMA_ONCE
  32. #pragma once
  33. #endif
  34. #ifdef __cplusplus
  35. extern "C" {
  36. #endif
  37. #if PRAGMA_IMPORT
  38. #pragma import on
  39. #endif
  40. #if PRAGMA_STRUCT_ALIGN
  41.     #pragma options align=mac68k
  42. #elif PRAGMA_STRUCT_PACKPUSH
  43.     #pragma pack(push, 2)
  44. #elif PRAGMA_STRUCT_PACK
  45.     #pragma pack(2)
  46. #endif
  47. typedef struct OpaquegxShape*           gxShape;
  48. typedef struct OpaquegxStyle*           gxStyle;
  49. typedef struct OpaquegxInk*             gxInk;
  50. typedef struct OpaquegxTransform*       gxTransform;
  51. typedef struct OpaquegxTag*             gxTag;
  52. typedef struct OpaquegxColorSet*        gxColorSet;
  53. typedef struct OpaquegxColorProfile*    gxColorProfile;
  54. typedef struct OpaquegxGraphicsClient*  gxGraphicsClient;
  55. typedef struct OpaquegxViewGroup*       gxViewGroup;
  56. typedef struct OpaquegxViewPort*        gxViewPort;
  57. typedef struct OpaquegxViewDevice*      gxViewDevice;
  58. typedef long                            gxColorSpace;
  59. /* gxShape enumerations */
  60. enum {
  61.     gxEmptyType                 = 1,
  62.     gxPointType                 = 2,
  63.     gxLineType                  = 3,
  64.     gxCurveType                 = 4,
  65.     gxRectangleType             = 5,
  66.     gxPolygonType               = 6,
  67.     gxPathType                  = 7,
  68.     gxBitmapType                = 8,
  69.     gxTextType                  = 9,
  70.     gxGlyphType                 = 10,
  71.     gxLayoutType                = 11,
  72.     gxFullType                  = 12,
  73.     gxPictureType               = 13
  74. };
  75. typedef long                            gxShapeType;
  76. enum {
  77.     gxNoFill                    = 0,
  78.     gxOpenFrameFill             = 1,
  79.     gxFrameFill                 = gxOpenFrameFill,
  80.     gxClosedFrameFill           = 2,
  81.     gxHollowFill                = gxClosedFrameFill,
  82.     gxEvenOddFill               = 3,
  83.     gxSolidFill                 = gxEvenOddFill,
  84.     gxWindingFill               = 4,
  85.     gxInverseEvenOddFill        = 5,
  86.     gxInverseSolidFill          = gxInverseEvenOddFill,
  87.     gxInverseFill               = gxInverseEvenOddFill,
  88.     gxInverseWindingFill        = 6
  89. };
  90. typedef long                            gxShapeFill;
  91. enum {
  92.     gxNoAttributes              = 0,
  93.     gxDirectShape               = 0x0001,
  94.     gxRemoteShape               = 0x0002,
  95.     gxCachedShape               = 0x0004,
  96.     gxLockedShape               = 0x0008,
  97.     gxGroupShape                = 0x0010,
  98.     gxMapTransformShape         = 0x0020,
  99.     gxUniqueItemsShape          = 0x0040,
  100.     gxIgnorePlatformShape       = 0x0080,
  101.     gxNoMetricsGridShape        = 0x0100,
  102.     gxDiskShape                 = 0x0200,
  103.     gxMemoryShape               = 0x0400
  104. };
  105. typedef long                            gxShapeAttribute;
  106. /* gxShape editing enumerations */
  107. enum {
  108.     gxBreakNeitherEdit          = 0,
  109.     gxBreakLeftEdit             = 0x0001,
  110.     gxBreakRightEdit            = 0x0002,
  111.     gxRemoveDuplicatePointsEdit = 0x0004
  112. };
  113. /* if the new first (or last) point exactly matches the point before it in */
  114. /* the same contour, then remove it) */
  115. typedef long                            gxEditShapeFlag;
  116. enum {
  117.     gxSelectToEnd               = -1
  118. };
  119. #define gxSetToNil  (void *)(-1)
  120. #define gxAnyNumber     1
  121. enum {
  122.     gxCounterclockwiseDirection = 0,
  123.     gxClockwiseDirection        = 1
  124. };
  125. typedef long                            gxContourDirection;
  126. /* gxShape structures */
  127. /* The type 'gxPoint' is defined in "GXMath.h" */
  128. struct gxLine {
  129.     gxPoint                         first;
  130.     gxPoint                         last;
  131. };
  132. typedef struct gxLine                   gxLine;
  133. struct gxCurve {
  134.     gxPoint                         first;
  135.     gxPoint                         control;
  136.     gxPoint                         last;
  137. };
  138. typedef struct gxCurve                  gxCurve;
  139. struct gxRectangle {
  140.     Fixed                           left;
  141.     Fixed                           top;
  142.     Fixed                           right;
  143.     Fixed                           bottom;
  144. };
  145. typedef struct gxRectangle              gxRectangle;
  146. struct gxPolygon {
  147.     long                            vectors;
  148.     gxPoint                         vector[1];
  149. };
  150. typedef struct gxPolygon                gxPolygon;
  151. struct gxPolygons {
  152.     long                            contours;
  153.     gxPolygon                       contour[1];
  154. };
  155. typedef struct gxPolygons               gxPolygons;
  156. struct gxPath {
  157.     long                            vectors;
  158.     long                            controlBits[1];
  159.     gxPoint                         vector[1];
  160. };
  161. typedef struct gxPath                   gxPath;
  162. struct gxPaths {
  163.     long                            contours;
  164.     gxPath                          contour[1];
  165. };
  166. typedef struct gxPaths                  gxPaths;
  167. struct gxBitmap {
  168.     char            *image;     /* pointer to pixels */
  169.     long            width;      /* width in pixels */
  170.     long            height;     /* height in pixels */
  171.     long            rowBytes;   /* width in bytes */
  172.     long            pixelSize;      /* physical bits per pixel */
  173.     gxColorSpace    space;
  174.     gxColorSet      set;
  175.     gxColorProfile  profile;
  176. };
  177. typedef struct gxBitmap gxBitmap;
  178. struct gxLongRectangle {
  179.     long                            left;
  180.     long                            top;
  181.     long                            right;
  182.     long                            bottom;
  183. };
  184. typedef struct gxLongRectangle          gxLongRectangle;
  185. /* gxStyle enumerations */
  186. enum {
  187.     gxCenterFrameStyle          = 0,
  188.     gxSourceGridStyle           = 0x0001,
  189.     gxDeviceGridStyle           = 0x0002,
  190.     gxInsideFrameStyle          = 0x0004,
  191.     gxOutsideFrameStyle         = 0x0008,
  192.     gxAutoInsetStyle            = 0x0010
  193. };
  194. typedef long                            gxStyleAttribute;
  195. enum {
  196.     gxBendDash                  = 0x0001,
  197.     gxBreakDash                 = 0x0002,
  198.     gxClipDash                  = 0x0004,
  199.     gxLevelDash                 = 0x0008,
  200.     gxAutoAdvanceDash           = 0x0010
  201. };
  202. typedef long                            gxDashAttribute;
  203. enum {
  204.     gxPortAlignPattern          = 0x0001,
  205.     gxPortMapPattern            = 0x0002
  206. };
  207. typedef long                            gxPatternAttribute;
  208. enum {
  209.     gxSharpJoin                 = 0x0000,
  210.     gxCurveJoin                 = 0x0001,
  211.     gxLevelJoin                 = 0x0002,
  212.     gxSnapJoin                  = 0x0004
  213. };
  214. typedef long                            gxJoinAttribute;
  215. enum {
  216.     gxLevelStartCap             = 0x0001,
  217.     gxLevelEndCap               = 0x0002
  218. };
  219. typedef long                            gxCapAttribute;
  220. enum {
  221.     gxAutoAdvanceText           = 0x0001,
  222.     gxNoContourGridText         = 0x0002,
  223.     gxNoMetricsGridText         = 0x0004,
  224.     gxAnchorPointsText          = 0x0008,
  225.     gxVerticalText              = 0x0010,
  226.     gxNoOpticalScaleText        = 0x0020
  227. };
  228. typedef long                            gxTextAttribute;
  229. enum {
  230.     gxLeftJustify               = 0,
  231.     gxCenterJustify             = fract1 / 2,
  232.     gxRightJustify              = fract1,
  233.     gxFillJustify               = -1
  234. };
  235. enum {
  236.     gxUnderlineAdvanceLayer     = 0x0001,                       /* a gxLine is drawn through the advances */
  237.     gxSkipWhiteSpaceLayer       = 0x0002,                       /* except characters describing white space */
  238.     gxUnderlineIntervalLayer    = 0x0004,                       /* (+ gxStringLayer) a gxLine is drawn through the gaps between advances */
  239.     gxUnderlineContinuationLayer = 0x0008,                      /* (+ gxStringLayer) join this underline with another face */
  240.     gxWhiteLayer                = 0x0010,                       /* the layer draws to white instead of black */
  241.     gxClipLayer                 = 0x0020,                       /* the characters define a clip */
  242.     gxStringLayer               = 0x0040                        /* all characters in run are combined */
  243. };
  244. typedef long                            gxLayerFlag;
  245. /* gxStyle structures */
  246. struct gxFaceLayer {
  247.     gxShapeFill                     outlineFill;                /* outline framed or filled */
  248.     gxLayerFlag                     flags;                      /* various additional effects */
  249.     gxStyle                         outlineStyle;               /* outline */
  250.     gxTransform                     outlineTransform;           /* italic, condense, extend */
  251.     gxPoint                         boldOutset;                 /* bold */
  252. };
  253. typedef struct gxFaceLayer              gxFaceLayer;
  254. struct gxTextFace {
  255.     long                            faceLayers;                 /* layer to implement shadow */
  256.     gxMapping                       advanceMapping;             /* algorithmic change to advance width */
  257.     gxFaceLayer                     faceLayer[1];               /* zero or more face layers describing the face */
  258. };
  259. typedef struct gxTextFace               gxTextFace;
  260. struct gxJoinRecord {
  261.     gxJoinAttribute                 attributes;
  262.     gxShape                         join;
  263.     Fixed                           miter;
  264. };
  265. typedef struct gxJoinRecord             gxJoinRecord;
  266. struct gxDashRecord {
  267.     gxDashAttribute                 attributes;
  268.     gxShape                         dash;                       /* similar to pattern, except rotated to gxLine slope */
  269.     Fixed                           advance;                    /* specifies repeating frequency of dash */
  270.     Fract                           phase;                      /* specifies offset into the gxPath to start dashing */
  271.     Fixed                           scale;                      /* specifies height of dash to be mapped to penWidth */
  272. };
  273. typedef struct gxDashRecord             gxDashRecord;
  274. struct gxPatternRecord {
  275.     gxPatternAttribute              attributes;
  276.     gxShape                         pattern;
  277.     gxPoint                         u;
  278.     gxPoint                         v;
  279. };
  280. typedef struct gxPatternRecord          gxPatternRecord;
  281. struct gxCapRecord {
  282.     gxCapAttribute                  attributes;
  283.     gxShape                         startCap;
  284.     gxShape                         endCap;
  285. };
  286. typedef struct gxCapRecord              gxCapRecord;
  287. /* gxInk enumerations */
  288. enum {
  289.     gxPortAlignDitherInk        = 0x0001,
  290.     gxForceDitherInk            = 0x0002,
  291.     gxSuppressDitherInk         = 0x0004,
  292.     gxSuppressHalftoneInk       = 0x0008
  293. };
  294. typedef long                            gxInkAttribute;
  295. enum {
  296.     gxNoMode                    = 0,
  297.     gxCopyMode                  = 1,
  298.     gxAddMode                   = 2,
  299.     gxBlendMode                 = 3,
  300.     gxMigrateMode               = 4,
  301.     gxMinimumMode               = 5,
  302.     gxMaximumMode               = 6,
  303.     gxHighlightMode             = 7,
  304.     gxAndMode                   = 8,
  305.     gxOrMode                    = 9,
  306.     gxXorMode                   = 10,
  307.     gxRampAndMode               = 11,
  308.     gxRampOrMode                = 12,
  309.     gxRampXorMode               = 13,
  310.     gxOverMode                  = 14,                           /* Alpha channel modes          */
  311.     gxAtopMode                  = 15,                           /* Note: In England = Beta channel modes   */
  312.     gxExcludeMode               = 16,
  313.     gxFadeMode                  = 17
  314. };
  315. typedef unsigned char                   gxComponentMode;
  316. enum {
  317.     gxRejectSourceTransfer      = 0x0001,                       /* at least one component must be out of range       */
  318.     gxRejectDeviceTransfer      = 0x0002,                       /* at least one component must be out of range       */
  319.     gxSingleComponentTransfer   = 0x0004                        /* duplicate gxTransferComponent[0] for all components in transfer */
  320. };
  321. typedef long                            gxTransferFlag;
  322. enum {
  323.     gxOverResultComponent       = 0x01,                         /* & result gxColor with 0xFFFF before clamping   */
  324.     gxReverseComponent          = 0x02                          /* reverse source and device before moding       */
  325. };
  326. typedef unsigned char                   gxComponentFlag;
  327. /* gxInk structures */
  328. struct gxTransferComponent {
  329.     gxComponentMode                 mode;                       /* how the component is operated upon */
  330.     gxComponentFlag                 flags;                      /* flags for each component   */
  331.     gxColorValue                    sourceMinimum;
  332.     gxColorValue                    sourceMaximum;              /* input filter range */
  333.     gxColorValue                    deviceMinimum;
  334.     gxColorValue                    deviceMaximum;              /* output filter range */
  335.     gxColorValue                    clampMinimum;
  336.     gxColorValue                    clampMaximum;               /* output clamping range */
  337.     gxColorValue                    operand;                    /* ratio for blend, step for migrate, gxColor for highlight   */
  338. };
  339. typedef struct gxTransferComponent      gxTransferComponent;
  340. struct gxTransferMode {
  341.     gxColorSpace        space;          /* the gxColor-space the transfer mode is to operate in */
  342.     gxColorSet          set;
  343.     gxColorProfile      profile;
  344.     Fixed               sourceMatrix[5][4];
  345.     Fixed               deviceMatrix[5][4];
  346.     Fixed               resultMatrix[5][4];
  347.     gxTransferFlag      flags;
  348.     gxTransferComponent component[4];  /* how each component is operated upon           */
  349. };
  350. typedef struct gxTransferMode gxTransferMode;
  351. /* gxColor space enumerations */
  352. enum {
  353.     gxNoColorPacking            = 0x0000,                       /* 16 bits per channel */
  354.     gxAlphaSpace                = 0x0080,                       /* space includes alpha channel */
  355.     gxWord5ColorPacking         = 0x0500,                       /* 5 bits per channel, right-justified */
  356.     gxLong8ColorPacking         = 0x0800,                       /* 8 bits per channel, right-justified */
  357.     gxLong10ColorPacking        = 0x0A00,                       /* 10 bits per channel, right-justified */
  358.     gxAlphaFirstPacking         = 0x1000                        /* alpha channel is the first field in the packed space */
  359. };
  360. enum {
  361.     gxNoSpace                   = 0,
  362.     gxRGBSpace                  = 1,
  363.     gxCMYKSpace                 = 2,
  364.     gxHSVSpace                  = 3,
  365.     gxHLSSpace                  = 4,
  366.     gxYXYSpace                  = 5,
  367.     gxXYZSpace                  = 6,
  368.     gxLUVSpace                  = 7,
  369.     gxLABSpace                  = 8,
  370.     gxYIQSpace                  = 9,
  371.     gxNTSCSpace                 = gxYIQSpace,
  372.     gxPALSpace                  = gxYIQSpace,
  373.     gxGraySpace                 = 10,
  374.     gxIndexedSpace              = 11,
  375.     gxRGBASpace                 = gxRGBSpace + gxAlphaSpace,
  376.     gxGrayASpace                = gxGraySpace + gxAlphaSpace,
  377.     gxRGB16Space                = gxWord5ColorPacking + gxRGBSpace,
  378.     gxRGB32Space                = gxLong8ColorPacking + gxRGBSpace,
  379.     gxARGB32Space               = gxLong8ColorPacking + gxAlphaFirstPacking + gxRGBASpace,
  380.     gxCMYK32Space               = gxLong8ColorPacking + gxCMYKSpace,
  381.     gxHSV32Space                = gxLong10ColorPacking + gxHSVSpace,
  382.     gxHLS32Space                = gxLong10ColorPacking + gxHLSSpace,
  383.     gxYXY32Space                = gxLong10ColorPacking + gxYXYSpace,
  384.     gxXYZ32Space                = gxLong10ColorPacking + gxXYZSpace,
  385.     gxLUV32Space                = gxLong10ColorPacking + gxLUVSpace,
  386.     gxLAB32Space                = gxLong10ColorPacking + gxLABSpace,
  387.     gxYIQ32Space                = gxLong10ColorPacking + gxYIQSpace,
  388.     gxNTSC32Space               = gxYIQ32Space,
  389.     gxPAL32Space                = gxYIQ32Space
  390. };
  391. /* gxColor space structures */
  392. struct gxRGBColor {
  393.     gxColorValue                    red;
  394.     gxColorValue                    green;
  395.     gxColorValue                    blue;
  396. };
  397. typedef struct gxRGBColor               gxRGBColor;
  398. struct gxRGBAColor {
  399.     gxColorValue                    red;
  400.     gxColorValue                    green;
  401.     gxColorValue                    blue;
  402.     gxColorValue                    alpha;
  403. };
  404. typedef struct gxRGBAColor              gxRGBAColor;
  405. struct gxHSVColor {
  406.     gxColorValue                    hue;
  407.     gxColorValue                    saturation;
  408.     gxColorValue                    value;
  409. };
  410. typedef struct gxHSVColor               gxHSVColor;
  411. struct gxHLSColor {
  412.     gxColorValue                    hue;
  413.     gxColorValue                    lightness;
  414.     gxColorValue                    saturation;
  415. };
  416. typedef struct gxHLSColor               gxHLSColor;
  417. struct gxCMYKColor {
  418.     gxColorValue                    cyan;
  419.     gxColorValue                    magenta;
  420.     gxColorValue                    yellow;
  421.     gxColorValue                    black;
  422. };
  423. typedef struct gxCMYKColor              gxCMYKColor;
  424. struct gxXYZColor {
  425.     gxColorValue                    x;
  426.     gxColorValue                    y;
  427.     gxColorValue                    z;
  428. };
  429. typedef struct gxXYZColor               gxXYZColor;
  430. struct gxYXYColor {
  431.     gxColorValue                    capY;
  432.     gxColorValue                    x;
  433.     gxColorValue                    y;
  434. };
  435. typedef struct gxYXYColor               gxYXYColor;
  436. struct gxLUVColor {
  437.     gxColorValue                    l;
  438.     gxColorValue                    u;
  439.     gxColorValue                    v;
  440. };
  441. typedef struct gxLUVColor               gxLUVColor;
  442. struct gxLABColor {
  443.     gxColorValue                    l;
  444.     gxColorValue                    a;
  445.     gxColorValue                    b;
  446. };
  447. typedef struct gxLABColor               gxLABColor;
  448. struct gxYIQColor {
  449.     gxColorValue                    y;
  450.     gxColorValue                    i;
  451.     gxColorValue                    q;
  452. };
  453. typedef struct gxYIQColor               gxYIQColor;
  454. struct gxGrayAColor {
  455.     gxColorValue                    gray;
  456.     gxColorValue                    alpha;
  457. };
  458. typedef struct gxGrayAColor             gxGrayAColor;
  459. typedef long                            gxColorIndex;
  460. struct gxIndexedColor {
  461.     gxColorIndex    index;
  462.     gxColorSet      set;
  463. };
  464. typedef struct gxIndexedColor gxIndexedColor;
  465. struct gxColor {
  466.     gxColorSpace                    space;
  467.     gxColorProfile                  profile;
  468.     union {
  469.         gxCMYKColor                     cmyk;
  470.         gxRGBColor                      rgb;
  471.         gxRGBAColor                     rgba;
  472.         gxHSVColor                      hsv;
  473.         gxHLSColor                      hls;
  474.         gxXYZColor                      xyz;
  475.         gxYXYColor                      yxy;
  476.         gxLUVColor                      luv;
  477.         gxLABColor                      lab;
  478.         gxYIQColor                      yiq;
  479.         gxColorValue                    gray;
  480.         gxGrayAColor                    graya;
  481.         unsigned short                  pixel16;
  482.         unsigned long                   pixel32;
  483.         gxIndexedColor                  indexed;
  484.         gxColorValue                    component[4];
  485.     }                                 element;
  486. };
  487. typedef struct gxColor                  gxColor;
  488. /* gxColorSet structures */
  489. union gxSetColor {
  490.     gxCMYKColor                     cmyk;
  491.     gxRGBColor                      rgb;
  492.     gxRGBAColor                     rgba;
  493.     gxHSVColor                      hsv;
  494.     gxHLSColor                      hls;
  495.     gxXYZColor                      xyz;
  496.     gxYXYColor                      yxy;
  497.     gxLUVColor                      luv;
  498.     gxLABColor                      lab;
  499.     gxYIQColor                      yiq;
  500.     gxColorValue                    gray;
  501.     gxGrayAColor                    graya;
  502.     unsigned short                  pixel16;
  503.     unsigned long                   pixel32;
  504.     gxColorValue                    component[4];
  505. };
  506. typedef union gxSetColor                gxSetColor;
  507. /* gxTransform enumerations */
  508. /* parts of a gxShape considered in hit testing: */
  509. enum {
  510.     gxNoPart                    = 0,                            /* (in order of evaluation) */
  511.     gxBoundsPart                = 0x0001,
  512.     gxGeometryPart              = 0x0002,
  513.     gxPenPart                   = 0x0004,
  514.     gxCornerPointPart           = 0x0008,
  515.     gxControlPointPart          = 0x0010,
  516.     gxEdgePart                  = 0x0020,
  517.     gxJoinPart                  = 0x0040,
  518.     gxStartCapPart              = 0x0080,
  519.     gxEndCapPart                = 0x0100,
  520.     gxDashPart                  = 0x0200,
  521.     gxPatternPart               = 0x0400,
  522.     gxGlyphBoundsPart           = gxJoinPart,
  523.     gxGlyphFirstPart            = gxStartCapPart,
  524.     gxGlyphLastPart             = gxEndCapPart,
  525.     gxSideBearingPart           = gxDashPart,
  526.     gxAnyPart                   = gxBoundsPart | gxGeometryPart | gxPenPart | gxCornerPointPart | gxControlPointPart | gxEdgePart | gxJoinPart | gxStartCapPart | gxEndCapPart | gxDashPart | gxPatternPart
  527. };
  528. typedef long                            gxShapePart;
  529. /* gxTransform structures */
  530. struct gxHitTestInfo {
  531.     gxShapePart                     what;                       /* which part of gxShape */
  532.     long                            index;                      /* control gxPoint index */
  533.     Fixed                           distance;                   /* how far from gxPoint or outside of area click was */
  534.                                                                 /* these fields are only set by GXHitTestPicture */
  535.     gxShape                         which;
  536.     gxShape                         containerPicture;           /* picture which contains gxShape hit */
  537.     long                            containerIndex;             /* the index within that picture  */
  538.     long                            totalIndex;                 /* the total index within the root picture */
  539. };
  540. typedef struct gxHitTestInfo            gxHitTestInfo;
  541. /* gxViewPort enumerations */
  542. enum {
  543.     gxGrayPort                  = 0x0001,
  544.     gxAlwaysGridPort            = 0x0002,
  545.     gxEnableMatchPort           = 0x0004
  546. };
  547. typedef long                            gxPortAttribute;
  548. /* gxViewDevice enumerations */
  549. enum {
  550.     gxDirectDevice              = 0x01,                         /* for the device gxBitmap baseAddr pointer */
  551.     gxRemoteDevice              = 0x02,
  552.     gxInactiveDevice            = 0x04
  553. };
  554. typedef long                            gxDeviceAttribute;
  555. enum {
  556.     gxRoundDot                  = 1,
  557.     gxSpiralDot                 = 2,
  558.     gxSquareDot                 = 3,
  559.     gxLineDot                   = 4,
  560.     gxEllipticDot               = 5,
  561.     gxTriangleDot               = 6,
  562.     gxDispersedDot              = 7,
  563.     gxCustomDot                 = 8
  564. };
  565. typedef long                            gxDotType;
  566. /* gxViewPort structures */
  567. enum {
  568.     gxNoTint                    = 0,
  569.     gxLuminanceTint             = 1,                            /* use the luminance of the gxColor */
  570.     gxAverageTint               = 2,                            /* add all the components and divide by the number of components */
  571.     gxMixtureTint               = 3,                            /* find the closest gxColor on the axis between the foreground and background */
  572.     gxComponent1Tint            = 4,                            /* use the value of the first component of the gxColor */
  573.     gxComponent2Tint            = 5,                            /* ... etc. */
  574.     gxComponent3Tint            = 6,
  575.     gxComponent4Tint            = 7
  576. };
  577. typedef long                            gxTintType;
  578. struct gxHalftone {
  579.     Fixed                           angle;
  580.     Fixed                           frequency;
  581.     gxDotType                       method;
  582.     gxTintType                      tinting;
  583.     gxColor                         dotColor;
  584.     gxColor                         backgroundColor;
  585.     gxColorSpace                    tintSpace;
  586. };
  587. typedef struct gxHalftone               gxHalftone;
  588. struct gxHalftoneMatrix {
  589.     Fixed                           dpiX;                       /* intended resolution */
  590.     Fixed                           dpiY;
  591.     long                            width;                      /* width of matrix (in device pixels) */
  592.     long                            height;                     /* height of matrix (in device pixels) */
  593.     long                            tileShift;                  /* shift amount (in samples) for rectangular tiling */
  594.     unsigned short                  samples[1];                 /* samples from 0..MAX(halftone tintSpace) */
  595. };
  596. typedef struct gxHalftoneMatrix         gxHalftoneMatrix;
  597. /* gxViewGroup enumerations */
  598. #define gxAllViewDevices        ((gxViewGroup) 0)
  599. #define gxScreenViewDevices     ((gxViewGroup) 1)
  600. /* graphics stream constants and structures */
  601. enum {
  602.     gxOpenReadSpool             = 1,
  603.     gxOpenWriteSpool            = 2,
  604.     gxReadSpool                 = 3,
  605.     gxWriteSpool                = 4,
  606.     gxCloseSpool                = 5
  607. };
  608. typedef long                            gxSpoolCommand;
  609. typedef unsigned char                   gxGraphicsOpcode;
  610. typedef struct gxSpoolBlock             gxSpoolBlock;
  611. typedef CALLBACK_API_C( long , gxSpoolProcPtr )(gxSpoolCommand command, gxSpoolBlock *block);
  612. typedef STACK_UPP_TYPE(gxSpoolProcPtr)                          gxSpoolUPP;
  613. struct gxSpoolBlock {
  614.     gxSpoolUPP                      spoolProcedure;             /* these fields are read only */
  615.     void *                          buffer;                     /* source/destination pointer to data */
  616.     long                            bufferSize;                 /* how many bytes for the system to read (flatten) / write (unflatten) */
  617.                                                                 /* these fields are written to (but are not read from) */
  618.     long                            count;                      /* how many bytes for the caller to read (unflatten) /write (flatten) */
  619.     long                            operationSize;              /* operation size (including operand byte) */
  620.     long                            operationOffset;            /* the data offset, if any, within the current operation */
  621.     gxGraphicsOpcode                lastTypeOpcode;             /* type of last created object */
  622.     gxGraphicsOpcode                currentOperation;           /* operation emitted by flatten, or intrepreted by last unflatten */
  623.     gxGraphicsOpcode                currentOperand;             /* e.g., gxTransformTypeOpcode, gxInkTagOpcode */
  624.     unsigned char                   compressed;                 /* one of: gxTwoBitCompressionValues */
  625. };
  626. #if OPAQUE_UPP_TYPES
  627. #if CALL_NOT_IN_CARBON
  628.     EXTERN_API(gxSpoolUPP)
  629.     NewgxSpoolUPP                  (gxSpoolProcPtr          userRoutine);
  630.     EXTERN_API(void)
  631.     DisposegxSpoolUPP              (gxSpoolUPP              userUPP);
  632.     EXTERN_API(long)
  633.     InvokegxSpoolUPP               (gxSpoolCommand          command,
  634.                                     gxSpoolBlock *          block,
  635.                                     gxSpoolUPP              userUPP);
  636. #endif  /* CALL_NOT_IN_CARBON */
  637. #else
  638.     enum { uppgxSpoolProcInfo = 0x000003F1 };                       /* 4_bytes Func(4_bytes, 4_bytes) */
  639.     #define NewgxSpoolUPP(userRoutine)                              (gxSpoolUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppgxSpoolProcInfo, GetCurrentArchitecture())
  640.     #define DisposegxSpoolUPP(userUPP)                              DisposeRoutineDescriptor(userUPP)
  641.     #define InvokegxSpoolUPP(command, block, userUPP)               (long)CALL_TWO_PARAMETER_UPP((userUPP), uppgxSpoolProcInfo, (command), (block))
  642. #endif
  643. /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
  644. #define NewgxSpoolProc(userRoutine)                             NewgxSpoolUPP(userRoutine)
  645. #define CallgxSpoolProc(userRoutine, command, block)            InvokegxSpoolUPP(command, block, userRoutine)
  646. enum {
  647.     gxFontListFlatten           = 0x01,                         /* if set, generate a gxTag containing list of each gxFont referenced */
  648.     gxFontGlyphsFlatten         = 0x02,                         /* if set, generate a gxTag containing the list of glyphs referenced inside the gxFont */
  649.     gxFontVariationsFlatten     = 0x04,                         /* if set, append the gxTag with separate [variation] coordinates */
  650.     gxBitmapAliasFlatten        = 0x08                          /* if set, open bitmap alias files and flatten out their image data */
  651. };
  652. typedef long                            gxFlattenFlag;
  653. /* gxGraphicsClient constants */
  654. #define gxGraphicsSystemClient      (gxGraphicsClient)(-1)
  655. enum {
  656.     gxStaticHeapClient          = 0x0001
  657. };
  658. typedef long                            gxClientAttribute;
  659. /* graphics patching constants */
  660. enum {
  661.     gxOriginalGraphicsFunction  = -1,
  662.     gxOriginalGraphicsIdentifier = FOUR_CHAR_CODE('grfx')
  663. };
  664. struct gxBitmapDataSourceAlias {
  665.     unsigned long                   fileOffset;                 /* file offset (in bytes) of top-left pixel */
  666.     unsigned long                   aliasRecordSize;            /* size of alias record below */
  667.     unsigned char                   aliasRecord[1];             /* the actual alias record data */
  668. };
  669. typedef struct gxBitmapDataSourceAlias  gxBitmapDataSourceAlias;
  670. enum {
  671.     gxBitmapFileAliasTagType    = FOUR_CHAR_CODE('bfil'),
  672.     gxPICTFileAliasTagType      = FOUR_CHAR_CODE('pict'),
  673.     gxBitmapFileAliasImageValue = 1L
  674. };
  675. typedef struct OpaquegxFont*            gxFont;
  676. enum {
  677.     gxNoPlatform                = 0,
  678.     gxNoScript                  = 0,
  679.     gxNoLanguage                = 0,
  680.     gxNoFontName                = 0,
  681.     gxGlyphPlatform             = -1
  682. };
  683. enum {
  684.     gxUnicodePlatform           = 1,
  685.     gxMacintoshPlatform         = 2,
  686.     gxReservedPlatform          = 3,
  687.     gxMicrosoftPlatform         = 4,
  688.     gxCustomPlatform            = 5
  689. };
  690. typedef long                            gxFontPlatform;
  691. enum {
  692.     gxUnicodeDefaultSemantics   = 1,
  693.     gxUnicodeV1_1Semantics      = 2,
  694.     gxISO10646_1993Semantics    = 3
  695. };
  696. enum {
  697.     gxRomanScript               = 1,
  698.     gxJapaneseScript            = 2,
  699.     gxTraditionalChineseScript  = 3,
  700.     gxChineseScript             = gxTraditionalChineseScript,
  701.     gxKoreanScript              = 4,
  702.     gxArabicScript              = 5,
  703.     gxHebrewScript              = 6,
  704.     gxGreekScript               = 7,
  705.     gxCyrillicScript            = 8,
  706.     gxRussian                   = gxCyrillicScript,
  707.     gxRSymbolScript             = 9,
  708.     gxDevanagariScript          = 10,
  709.     gxGurmukhiScript            = 11,
  710.     gxGujaratiScript            = 12,
  711.     gxOriyaScript               = 13,
  712.     gxBengaliScript             = 14,
  713.     gxTamilScript               = 15,
  714.     gxTeluguScript              = 16,
  715.     gxKannadaScript             = 17,
  716.     gxMalayalamScript           = 18,
  717.     gxSinhaleseScript           = 19,
  718.     gxBurmeseScript             = 20,
  719.     gxKhmerScript               = 21,
  720.     gxThaiScript                = 22,
  721.     gxLaotianScript             = 23,
  722.     gxGeorgianScript            = 24,
  723.     gxArmenianScript            = 25,
  724.     gxSimpleChineseScript       = 26,
  725.     gxTibetanScript             = 27,
  726.     gxMongolianScript           = 28,
  727.     gxGeezScript                = 29,
  728.     gxEthiopicScript            = gxGeezScript,
  729.     gxAmharicScript             = gxGeezScript,
  730.     gxSlavicScript              = 30,
  731.     gxEastEuropeanRomanScript   = gxSlavicScript,
  732.     gxVietnameseScript          = 31,
  733.     gxExtendedArabicScript      = 32,
  734.     gxSindhiScript              = gxExtendedArabicScript,
  735.     gxUninterpretedScript       = 33
  736. };
  737. enum {
  738.     gxMicrosoftSymbolScript     = 1,
  739.     gxMicrosoftStandardScript   = 2
  740. };
  741. enum {
  742.     gxCustom8BitScript          = 1,
  743.     gxCustom816BitScript        = 2,
  744.     gxCustom16BitScript         = 3
  745. };
  746. typedef long                            gxFontScript;
  747. enum {
  748.     gxEnglishLanguage           = 1,
  749.     gxFrenchLanguage            = 2,
  750.     gxGermanLanguage            = 3,
  751.     gxItalianLanguage           = 4,
  752.     gxDutchLanguage             = 5,
  753.     gxSwedishLanguage           = 6,
  754.     gxSpanishLanguage           = 7,
  755.     gxDanishLanguage            = 8,
  756.     gxPortugueseLanguage        = 9,
  757.     gxNorwegianLanguage         = 10,
  758.     gxHebrewLanguage            = 11,
  759.     gxJapaneseLanguage          = 12,
  760.     gxArabicLanguage            = 13,
  761.     gxFinnishLanguage           = 14,
  762.     gxGreekLanguage             = 15,
  763.     gxIcelandicLanguage         = 16,
  764.     gxMalteseLanguage           = 17,
  765.     gxTurkishLanguage           = 18,
  766.     gxCroatianLanguage          = 19,
  767.     gxTradChineseLanguage       = 20,
  768.     gxUrduLanguage              = 21,
  769.     gxHindiLanguage             = 22,
  770.     gxThaiLanguage              = 23,
  771.     gxKoreanLanguage            = 24,
  772.     gxLithuanianLanguage        = 25,
  773.     gxPolishLanguage            = 26,
  774.     gxHungarianLanguage         = 27,
  775.     gxEstonianLanguage          = 28,
  776.     gxLettishLanguage           = 29,
  777.     gxLatvianLanguage           = gxLettishLanguage,
  778.     gxSaamiskLanguage           = 30,
  779.     gxLappishLanguage           = gxSaamiskLanguage,
  780.     gxFaeroeseLanguage          = 31,
  781.     gxFarsiLanguage             = 32,
  782.     gxPersianLanguage           = gxFarsiLanguage,
  783.     gxRussianLanguage           = 33,
  784.     gxSimpChineseLanguage       = 34,
  785.     gxFlemishLanguage           = 35,
  786.     gxIrishLanguage             = 36,
  787.     gxAlbanianLanguage          = 37,
  788.     gxRomanianLanguage          = 38,
  789.     gxCzechLanguage             = 39,
  790.     gxSlovakLanguage            = 40,
  791.     gxSlovenianLanguage         = 41,
  792.     gxYiddishLanguage           = 42,
  793.     gxSerbianLanguage           = 43,
  794.     gxMacedonianLanguage        = 44,
  795.     gxBulgarianLanguage         = 45,
  796.     gxUkrainianLanguage         = 46,
  797.     gxByelorussianLanguage      = 47,
  798.     gxUzbekLanguage             = 48,
  799.     gxKazakhLanguage            = 49,
  800.     gxAzerbaijaniLanguage       = 50,
  801.     gxAzerbaijanArLanguage      = 51,
  802.     gxArmenianLanguage          = 52,
  803.     gxGeorgianLanguage          = 53,
  804.     gxMoldavianLanguage         = 54,
  805.     gxKirghizLanguage           = 55,
  806.     gxTajikiLanguage            = 56,
  807.     gxTurkmenLanguage           = 57,
  808.     gxMongolianLanguage         = 58,
  809.     gxMongolianCyrLanguage      = 59,
  810.     gxPashtoLanguage            = 60,
  811.     gxKurdishLanguage           = 61,
  812.     gxKashmiriLanguage          = 62,
  813.     gxSindhiLanguage            = 63,
  814.     gxTibetanLanguage           = 64,
  815.     gxNepaliLanguage            = 65,
  816.     gxSanskritLanguage          = 66,
  817.     gxMarathiLanguage           = 67,
  818.     gxBengaliLanguage           = 68,
  819.     gxAssameseLanguage          = 69,
  820.     gxGujaratiLanguage          = 70,
  821.     gxPunjabiLanguage           = 71,
  822.     gxOriyaLanguage             = 72,
  823.     gxMalayalamLanguage         = 73,
  824.     gxKannadaLanguage           = 74,
  825.     gxTamilLanguage             = 75,
  826.     gxTeluguLanguage            = 76,
  827.     gxSinhaleseLanguage         = 77,
  828.     gxBurmeseLanguage           = 78,
  829.     gxKhmerLanguage             = 79,
  830.     gxLaoLanguage               = 80,
  831.     gxVietnameseLanguage        = 81,
  832.     gxIndonesianLanguage        = 82,
  833.     gxTagalogLanguage           = 83,
  834.     gxMalayRomanLanguage        = 84,
  835.     gxMalayArabicLanguage       = 85,
  836.     gxAmharicLanguage           = 86,
  837.     gxTigrinyaLanguage          = 87,
  838.     gxGallaLanguage             = 88,
  839.     gxOromoLanguage             = gxGallaLanguage,
  840.     gxSomaliLanguage            = 89,
  841.     gxSwahiliLanguage           = 90,
  842.     gxRuandaLanguage            = 91,
  843.     gxRundiLanguage             = 92,
  844.     gxChewaLanguage             = 93,
  845.     gxMalagasyLanguage          = 94,
  846.     gxEsperantoLanguage         = 95,
  847.     gxWelshLanguage             = 129,
  848.     gxBasqueLanguage            = 130,
  849.     gxCatalanLanguage           = 131,
  850.     gxLatinLanguage             = 132,
  851.     gxQuechuaLanguage           = 133,
  852.     gxGuaraniLanguage           = 134,
  853.     gxAymaraLanguage            = 135,
  854.     gxTatarLanguage             = 136,
  855.     gxUighurLanguage            = 137,
  856.     gxDzongkhaLanguage          = 138,
  857.     gxJavaneseRomLanguage       = 139,
  858.     gxSundaneseRomLanguage      = 140
  859. };
  860. typedef long                            gxFontLanguage;
  861. enum {
  862.     gxCopyrightFontName         = 1,
  863.     gxFamilyFontName            = 2,
  864.     gxStyleFontName             = 3,
  865.     gxUniqueFontName            = 4,
  866.     gxFullFontName              = 5,
  867.     gxVersionFontName           = 6,
  868.     gxPostscriptFontName        = 7,
  869.     gxTrademarkFontName         = 8,
  870.     gxManufacturerFontName      = 9,
  871.     gxLastReservedFontName      = 256
  872. };
  873. typedef long                            gxFontName;
  874. typedef long                            gxFontTableTag;
  875. typedef long                            gxFontVariationTag;
  876. typedef long                            gxFontFormatTag;
  877. typedef long                            gxFontStorageTag;
  878. typedef gxFontVariationTag              gxFontDescriptorTag;
  879. struct gxFontVariation {
  880.     gxFontVariationTag              name;
  881.     Fixed                           value;
  882. };
  883. typedef struct gxFontVariation          gxFontVariation;
  884. typedef gxFontVariation                 gxFontDescriptor;
  885. struct gxFontFeatureSetting {
  886.     unsigned short                  setting;
  887.     unsigned short                  nameID;
  888. };
  889. typedef struct gxFontFeatureSetting     gxFontFeatureSetting;
  890. enum {
  891.     gxSystemFontAttribute       = 0x0001,
  892.     gxReadOnlyFontAttribute     = 0x0002
  893. };
  894. typedef long                            gxFontAttribute;
  895. enum {
  896.     gxMutuallyExclusiveFeature  = 0x00008000
  897. };
  898. typedef long                            gxFontFeatureFlag;
  899. typedef long                            gxFontFeature;
  900. enum {
  901.     gxResourceFontStorage       = FOUR_CHAR_CODE('rsrc'),
  902.     gxHandleFontStorage         = FOUR_CHAR_CODE('hndl'),
  903.     gxFileFontStorage           = FOUR_CHAR_CODE('bass'),
  904.     gxNfntFontStorage           = FOUR_CHAR_CODE('nfnt')
  905. };
  906. typedef void *                          gxFontStorageReference;
  907. typedef unsigned short                  gxGlyphcode;
  908. /* single glyph in a font */
  909. /* byte offset within backing store */
  910. typedef long                            gxByteOffset;
  911. /* The actual constants for feature types and selectors have been moved to a library. */
  912. typedef unsigned short                  gxRunFeatureType;
  913. typedef unsigned short                  gxRunFeatureSelector;
  914. /* If tracking is not desired, specify the following value in the track field in the
  915.         gxRunControls record (note that a track of 0 does *not* mean to turn tracking off;
  916.         rather, it means to use normal tracking). */
  917. enum {
  918.     gxNoTracking                = gxNegativeInfinity
  919. };
  920. /* The special "gxNoStake" value is returned by the GXGetLayoutBreakOffset call to
  921.         indicate the absence of a character offset that is stable with respect to
  922.         metamorphosis and contextual kerning. */
  923. enum {
  924.     gxNoStake                   = -1
  925. };
  926. /* A glyph's behavior with respect to other glyphs on its line is defined in part by its
  927.         gxBaselineType. These types allow correct alignment of the baselines of all glyphs on
  928.         the line. */
  929. enum {
  930.     gxRomanBaseline             = 0,
  931.     gxIdeographicCenterBaseline = 1,
  932.     gxIdeographicLowBaseline    = 2,
  933.     gxHangingBaseline           = 3,
  934.     gxMathBaseline              = 4,
  935.     gxLastBaseline              = 31,
  936.     gxNumberOfBaselineTypes     = gxLastBaseline + 1,
  937.     gxNoOverrideBaseline        = 255
  938. };
  939. typedef unsigned long                   gxBaselineType;
  940. typedef Fixed                           gxBaselineDeltas[32];
  941. /* gxJustificationPriority defines the point during the justification process at which a
  942.     glyph will begin to receive deltas before and after itself. */
  943. enum {
  944.     gxKashidaPriority           = 0,
  945.     gxWhiteSpacePriority        = 1,
  946.     gxInterCharPriority         = 2,
  947.     gxNullJustificationPriority = 3,
  948.     gxNumberOfJustificationPriorities = 4
  949. };
  950. typedef unsigned char                   gxJustificationPriority;
  951. /* gxJustificationFlags are used to control which fields of a gxWidthDeltaRecord are to
  952.         be overridden and which are not if a gxPriorityJustificationOverride or
  953.         gxGlyphJustificationOverride (qq.v.) is specified. */
  954. enum {
  955.     gxOverridePriority          = 0x8000,                       /* use priority value from override */
  956.     gxOverrideLimits            = 0x4000,                       /* use limits values from override */
  957.     gxOverrideUnlimited         = 0x2000,                       /* use unlimited flag from override */
  958.     gxUnlimitedGapAbsorption    = 0x1000,                       /* glyph can take unlimited gap */
  959.     gxJustificationPriorityMask = 0x000F,                       /* justification priority */
  960.     gxAllJustificationFlags     = (gxOverridePriority | gxOverrideLimits | gxOverrideUnlimited | gxUnlimitedGapAbsorption | gxJustificationPriorityMask)
  961. };
  962. typedef unsigned short                  gxJustificationFlags;
  963. /* The directional behavior of a glyph can be overridden using a gxDirectionOverride. */
  964. enum {
  965.     gxNoDirectionOverride       = 0,
  966.     gxImposeLeftToRight         = 1,
  967.     gxImposeRightToLeft         = 2,
  968.     gxImposeArabic              = 3
  969. };
  970. typedef unsigned short                  gxDirectionOverride;
  971. /* gxRunControlFlags describe the nonparametric layout options contained in a gxStyle. */
  972. enum {
  973.     gxNoCaretAngle              = 0x40000000,
  974.     gxImposeWidth               = 0x20000000,
  975.     gxNoCrossKerning            = 0x10000000,
  976.     gxNoOpticalAlignment        = 0x08000000,
  977.     gxForceHanging              = 0x04000000,
  978.     gxNoSpecialJustification    = 0x02000000,
  979.     gxDirectionOverrideMask     = 0x00000003,
  980.     gxNoLigatureSplits          = (long)0x80000000
  981. };
  982. enum {
  983.     gxAllRunControlFlags        = (gxNoLigatureSplits | gxNoCaretAngle | gxImposeWidth | gxNoCrossKerning | gxNoOpticalAlignment | gxForceHanging | gxNoSpecialJustification | gxDirectionOverrideMask)
  984. };
  985. typedef unsigned long                   gxRunControlFlags;
  986. /* gxHighlightType is used to distinguish various highlighting methods, both in terms of
  987.         character offset based vs. visual based, and in terms of angled sides vs. non-angled
  988.         sides. */
  989. enum {
  990.     gxHighlightStraight         = 0,                            /* straight-edged simple highlighting */
  991.     gxHighlightAverageAngle     = 1                             /* takes average of two edge angles */
  992. };
  993. typedef unsigned long                   gxHighlightType;
  994. /* gxCaretType is used to control whether the caret that is returned from GXGetLayoutCaret
  995.         is a split caret or a (keyboard-syncronized) single caret. */
  996. enum {
  997.     gxSplitCaretType            = 0,                            /* returns Mac-style split caret (default) */
  998.     gxLeftRightKeyboardCaret    = 1,                            /* single caret in left-right position */
  999.     gxRightLeftKeyboardCaret    = 2                             /* single caret in right-left position */
  1000. };
  1001. typedef unsigned long                   gxCaretType;
  1002. /* gxLayoutOffsetState describes the characteristics of a given gxByteOffset in some
  1003.         layout. It is returned by the GXGetOffsetGlyphs call. Note that the
  1004.         gxOffsetInsideLigature value is returned in addition to the 8/16 (or invalid)
  1005.         indication. */
  1006. enum {
  1007.     gxOffset8_8                 = 0,
  1008.     gxOffset8_16                = 1,
  1009.     gxOffset16_8                = 2,
  1010.     gxOffset16_16               = 3,
  1011.     gxOffsetInvalid             = 4
  1012. };
  1013. enum {
  1014.     gxOffsetInsideLigature      = 0x8000
  1015. };
  1016. typedef unsigned short                  gxLayoutOffsetState;
  1017. /* gxLayoutOptionsFlags are single-bit flags contained in a gxLayoutOptions record. We
  1018.     also define here some utility constants that are useful in setting various fields in
  1019.     the gxLayoutOptions record. */
  1020. enum {
  1021.     gxNoLayoutOptions           = 0,
  1022.     gxLineIsDisplayOnly         = 0x00000001,
  1023.     gxKeepSpacesInMargin        = 0x00000002,
  1024.     gxLimitReorderingToTwoLevels = 0x00000004,
  1025.     gxLineLeftEdgeNotAtMargin   = 0x00000008,
  1026.     gxLineRightEdgeNotAtMargin  = 0x00000010,
  1027.     gxAllLayoutOptionsFlags     = gxLineIsDisplayOnly | gxKeepSpacesInMargin | gxLimitReorderingToTwoLevels | gxLineLeftEdgeNotAtMargin | gxLineRightEdgeNotAtMargin,
  1028.     gxMaxRunLevel               = 15,
  1029.     gxFlushLeft                 = 0,
  1030.     gxFlushCenter               = fract1 / 2,
  1031.     gxFlushRight                = fract1,
  1032.     gxNoJustification           = 0,
  1033.     gxFullJustification         = fract1
  1034. };
  1035. typedef unsigned long                   gxLayoutOptionsFlags;
  1036. /* A gxRunFeature describes a feature and a level for that feature. */
  1037. struct gxRunFeature {
  1038.     gxRunFeatureType                featureType;
  1039.     gxRunFeatureSelector            featureSelector;
  1040. };
  1041. typedef struct gxRunFeature             gxRunFeature;
  1042. /* A gxWidthDeltaRecord contains all of the information needed to describe the behavior of one
  1043.         class of glyphs during the justification process. */
  1044. struct gxWidthDeltaRecord {
  1045.     Fixed                           beforeGrowLimit;            /* ems AW can grow by at most on LT */
  1046.     Fixed                           beforeShrinkLimit;          /* ems AW can shrink by at most on LT */
  1047.     Fixed                           afterGrowLimit;             /* ems AW can grow by at most on RB */
  1048.     Fixed                           afterShrinkLimit;           /* ems AW can shrink by at most on RB */
  1049.     gxJustificationFlags            growFlags;                  /* flags controlling grow case */
  1050.     gxJustificationFlags            shrinkFlags;                /* flags controlling shrink case */
  1051. };
  1052. typedef struct gxWidthDeltaRecord       gxWidthDeltaRecord;
  1053. /* A gxPriorityJustificationOverride contains an array of WidthDeltaRecords, one for each
  1054.         gxJustificationPriority. */
  1055. struct gxPriorityJustificationOverride {
  1056.     gxWidthDeltaRecord              deltas[4];                  /* overrides for each of the priorities */
  1057. };
  1058. typedef struct gxPriorityJustificationOverride gxPriorityJustificationOverride;
  1059. /* A gxGlyphJustificationOverride contains a gxWidthDeltaRecord that is to be used for a
  1060.         specific glyph in a specific run (this limitation is because glyphcodes vary by font). */
  1061. struct gxGlyphJustificationOverride {
  1062.     gxGlyphcode                     glyph;
  1063.     gxWidthDeltaRecord              override;
  1064. };
  1065. typedef struct gxGlyphJustificationOverride gxGlyphJustificationOverride;
  1066. /* gxRunControls contains flags, shifts, imposed widths and overrides for a run. */
  1067. /* NOTE: a value of "gxNoTracking" (see above) in track disables tracking */
  1068. struct gxRunControls {
  1069.     gxRunControlFlags               flags;
  1070.     Fixed                           beforeWithStreamShift;
  1071.     Fixed                           afterWithStreamShift;
  1072.     Fixed                           crossStreamShift;
  1073.     Fixed                           imposedWidth;
  1074.     Fixed                           track;
  1075.     Fract                           hangingInhibitFactor;
  1076.     Fract                           kerningInhibitFactor;
  1077.     Fixed                           decompositionAdjustmentFactor;
  1078.     gxBaselineType                  baselineType;
  1079. };
  1080. typedef struct gxRunControls            gxRunControls;
  1081. /* A gxGlyphSubstitution describes one client-provided substitution that occurs after all
  1082.         other automatic glyph changes have happened. */
  1083. struct gxGlyphSubstitution {
  1084.     gxGlyphcode                     originalGlyph;              /* Whenever you see this glyph... */
  1085.     gxGlyphcode                     substituteGlyph;            /* ...change it to this one. */
  1086. };
  1087. typedef struct gxGlyphSubstitution      gxGlyphSubstitution;
  1088. /* gxKerningAdjustmentFactors specify an adjustment to automatic kerning. The adjustment
  1089.         is ax + b where x is the automatic kerning value, a is scaleFactor, and b is
  1090.         adjustmentPointSizeFactor times the run's point size. */
  1091. struct gxKerningAdjustmentFactors {
  1092.     Fract                           scaleFactor;
  1093.     Fixed                           adjustmentPointSizeFactor;
  1094. };
  1095. typedef struct gxKerningAdjustmentFactors gxKerningAdjustmentFactors;
  1096. /* A gxKerningAdjustment identifies with- and cross-stream kerning adjustments
  1097.         for specific glyph pairs. */
  1098. struct gxKerningAdjustment {
  1099.     gxGlyphcode                     firstGlyph;
  1100.     gxGlyphcode                     secondGlyph;
  1101.     gxKerningAdjustmentFactors      withStreamFactors;
  1102.     gxKerningAdjustmentFactors      crossStreamFactors;
  1103. };
  1104. typedef struct gxKerningAdjustment      gxKerningAdjustment;
  1105. /* A value of gxResetCrossStreamFactor in crossStreamFactors.adjustmentPointSizeFactor
  1106.         will reset the cross-stream kerning to the baseline. */
  1107. enum {
  1108.     gxResetCrossStreamFactor    = gxNegativeInfinity
  1109. };
  1110. /* gxLayoutHitInfo contains the output from the GXHitTestLayout call. */
  1111. struct gxLayoutHitInfo {
  1112.     Fixed                           firstPartialDist;
  1113.     Fixed                           lastPartialDist;
  1114.     gxByteOffset                    hitSideOffset;
  1115.     gxByteOffset                    nonHitSideOffset;
  1116.     Boolean                         leadingEdge;
  1117.     Boolean                         inLoose;
  1118. };
  1119. typedef struct gxLayoutHitInfo          gxLayoutHitInfo;
  1120. /* A gxLineBaselineRecord contains the deltas from 0 to all the different baselines for
  1121.         the layout. It can be filled via a call to GetBaselineDeltas (q.v.). */
  1122. struct gxLineBaselineRecord {
  1123.     gxBaselineDeltas                deltas;
  1124. };
  1125. typedef struct gxLineBaselineRecord     gxLineBaselineRecord;
  1126. /* The gxLayoutOptions type contains information about the layout characteristics of the
  1127.         whole line. */
  1128. struct gxLayoutOptions {
  1129.     Fixed                           width;
  1130.     Fract                           flush;
  1131.     Fract                           just;
  1132.     gxLayoutOptionsFlags            flags;
  1133.     gxLineBaselineRecord *          baselineRec;
  1134. };
  1135. typedef struct gxLayoutOptions          gxLayoutOptions;
  1136. enum {
  1137.     gxNewObjectOpcode           = 0x00,                         /* create new object */
  1138.     gxSetDataOpcode             = 0x40,                         /* add reference to current object */
  1139.     gxSetDefaultOpcode          = 0x80,                         /* replace current default with this object */
  1140.     gxReservedOpcode            = 0xC0,                         /* (may be used in future expansion) */
  1141.     gxNextOpcode                = 0xFF                          /* used by currentOperand field to say opcode is coming */
  1142. };
  1143. /* new object types (new object opcode) */
  1144. enum {
  1145.     gxHeaderTypeOpcode          = 0x00,                         /* byte following new object uses bottom 6 bits for type */
  1146.                                                                 /* gxShape types use values 1 (gxEmptyType) through 13 (gxPictureType) */
  1147.     gxStyleTypeOpcode           = 0x28,
  1148.     gxInkTypeOpcode             = 0x29,
  1149.     gxTransformTypeOpcode       = 0x2A,
  1150.     gxColorProfileTypeOpcode    = 0x2B,
  1151.     gxColorSetTypeOpcode        = 0x2C,
  1152.     gxTagTypeOpcode             = 0x2D,
  1153.     gxBitImageOpcode            = 0x2E,
  1154.     gxFontNameTypeOpcode        = 0x2F,
  1155.     gxTrailerTypeOpcode         = 0x3F
  1156. };
  1157. /* fields of objects (set data opcodes) */
  1158. enum {
  1159.     gxShapeAttributesOpcode     = 0,
  1160.     gxShapeTagOpcode            = 1,
  1161.     gxShapeFillOpcode           = 2
  1162. };
  1163. enum {
  1164.     gxOmitPathPositionXMask     = 0xC0,
  1165.     gxOmitPathPositionYMask     = 0x30,
  1166.     gxOmitPathDeltaXMask        = 0x0C,
  1167.     gxOmitPathDeltaYMask        = 0x03
  1168. };
  1169. enum {
  1170.     gxOmitPathPositionXShift    = 6,
  1171.     gxOmitPathPositionYShift    = 4,
  1172.     gxOmitPathDeltaXShift       = 2,
  1173.     gxOmitPathDeltaYShift       = 0
  1174. };
  1175. enum {
  1176.     gxOmitBitmapImageMask       = 0xC0,
  1177.     gxOmitBitmapWidthMask       = 0x30,
  1178.     gxOmitBitmapHeightMask      = 0x0C,
  1179.     gxOmitBitmapRowBytesMask    = 0x03
  1180. };
  1181. enum {
  1182.     gxOmitBitmapImageShift      = 6,
  1183.     gxOmitBitmapWidthShift      = 4,
  1184.     gxOmitBitmapHeightShift     = 2,
  1185.     gxOmitBitmapRowBytesShift   = 0
  1186. };
  1187. enum {
  1188.     gxOmitBitmapPixelSizeMask   = 0xC0,
  1189.     gxOmitBitmapSpaceMask       = 0x30,
  1190.     gxOmitBitmapSetMask         = 0x0C,
  1191.     gxOmitBitmapProfileMask     = 0x03
  1192. };
  1193. enum {
  1194.     gxOmitBitmapPixelSizeShift  = 6,
  1195.     gxOmitBitmapSpaceShift      = 4,
  1196.     gxOmitBitmapSetShift        = 2,
  1197.     gxOmitBitmapProfileShift    = 0
  1198. };
  1199. enum {
  1200.     gxOmitBitmapPositionXMask   = 0xC0,
  1201.     gxOmitBitmapPositionYMask   = 0x30
  1202. };
  1203. enum {
  1204.     gxOmitBitmapPositionXShift  = 6,
  1205.     gxOmitBitmapPositionYShift  = 4
  1206. };
  1207. enum {
  1208.     gxOmitBitImageRowBytesMask  = 0xC0,
  1209.     gxOmitBitImageHeightMask    = 0x30,
  1210.     gxOmitBitImageDataMask      = 0x08
  1211. };
  1212. enum {
  1213.     gxOmitBitImageRowBytesShift = 6,
  1214.     gxOmitBitImageHeightShift   = 4,
  1215.     gxOmitBitImageDataShift     = 3
  1216. };
  1217. enum {
  1218.     gxCopyBitImageBytesOpcode   = 0x00,
  1219.     gxRepeatBitImageBytesOpcode = 0x40,
  1220.     gxLookupBitImageBytesOpcode = 0x80,
  1221.     gxRepeatBitImageScanOpcode  = 0xC0
  1222. };
  1223. enum {
  1224.     gxOmitTextCharactersMask    = 0xC0,
  1225.     gxOmitTextPositionXMask     = 0x30,
  1226.     gxOmitTextPositionYMask     = 0x0C,
  1227.     gxOmitTextDataMask          = 0x02
  1228. };
  1229. enum {
  1230.     gxOmitTextCharactersShift   = 6,
  1231.     gxOmitTextPositionXShift    = 4,
  1232.     gxOmitTextPositionYShift    = 2,
  1233.     gxOmitTextDataShift         = 1
  1234. };
  1235. enum {
  1236.     gxOmitGlyphCharactersMask   = 0xC0,
  1237.     gxOmitGlyphLengthMask       = 0x30,
  1238.     gxOmitGlyphRunNumberMask    = 0x0C,
  1239.     gxOmitGlyphOnePositionMask  = 0x02,
  1240.     gxOmitGlyphDataMask         = 0x01
  1241. };
  1242. enum {
  1243.     gxOmitGlyphCharactersShift  = 6,
  1244.     gxOmitGlyphLengthShift      = 4,
  1245.     gxOmitGlyphRunNumberShift   = 2,
  1246.     gxOmitGlyphOnePositionShift = 1,
  1247.     gxOmitGlyphDataShift        = 0
  1248. };
  1249. enum {
  1250.     gxOmitGlyphPositionsMask    = 0xC0,
  1251.     gxOmitGlyphAdvancesMask     = 0x20,
  1252.     gxOmitGlyphTangentsMask     = 0x18,
  1253.     gxOmitGlyphRunsMask         = 0x04,
  1254.     gxOmitGlyphStylesMask       = 0x03
  1255. };
  1256. enum {
  1257.     gxOmitGlyphPositionsShift   = 6,
  1258.     gxOmitGlyphAdvancesShift    = 5,
  1259.     gxOmitGlyphTangentsShift    = 3,
  1260.     gxOmitGlyphRunsShift        = 2,
  1261.     gxOmitGlyphStylesShift      = 0
  1262. };
  1263. enum {
  1264.     gxOmitLayoutLengthMask      = 0xC0,
  1265.     gxOmitLayoutPositionXMask   = 0x30,
  1266.     gxOmitLayoutPositionYMask   = 0x0C,
  1267.     gxOmitLayoutDataMask        = 0x02
  1268. };
  1269. enum {
  1270.     gxOmitLayoutLengthShift     = 6,
  1271.     gxOmitLayoutPositionXShift  = 4,
  1272.     gxOmitLayoutPositionYShift  = 2,
  1273.     gxOmitLayoutDataShift       = 1
  1274. };
  1275. enum {
  1276.     gxOmitLayoutWidthMask       = 0xC0,
  1277.     gxOmitLayoutFlushMask       = 0x30,
  1278.     gxOmitLayoutJustMask        = 0x0C,
  1279.     gxOmitLayoutOptionsMask     = 0x03
  1280. };
  1281. enum {
  1282.     gxOmitLayoutWidthShift      = 6,
  1283.     gxOmitLayoutFlushShift      = 4,
  1284.     gxOmitLayoutJustShift       = 2,
  1285.     gxOmitLayoutOptionsShift    = 0
  1286. };
  1287. enum {
  1288.     gxOmitLayoutStyleRunNumberMask = 0xC0,
  1289.     gxOmitLayoutLevelRunNumberMask = 0x30,
  1290.     gxOmitLayoutHasBaselineMask = 0x08,
  1291.     gxOmitLayoutStyleRunsMask   = 0x04,
  1292.     gxOmitLayoutStylesMask      = 0x03
  1293. };
  1294. enum {
  1295.     gxOmitLayoutStyleRunNumberShift = 6,
  1296.     gxOmitLayoutLevelRunNumberShift = 4,
  1297.     gxOmitLayoutHasBaselineShift = 3,
  1298.     gxOmitLayoutStyleRunsShift  = 2,
  1299.     gxOmitLayoutStylesShift     = 0
  1300. };
  1301. enum {
  1302.     gxOmitLayoutLevelRunsMask   = 0x80,
  1303.     gxOmitLayoutLevelsMask      = 0x40
  1304. };
  1305. enum {
  1306.     gxOmitLayoutLevelRunsShift  = 7,
  1307.     gxOmitLayoutLevelsShift     = 6
  1308. };
  1309. enum {
  1310.     gxInkAttributesOpcode       = 0,
  1311.     gxInkTagOpcode              = 1,
  1312.     gxInkColorOpcode            = 2,
  1313.     gxInkTransferModeOpcode     = 3
  1314. };
  1315. enum {
  1316.     gxOmitColorsSpaceMask       = 0xC0,
  1317.     gxOmitColorsProfileMask     = 0x30,
  1318.     gxOmitColorsComponentsMask  = 0x0F,
  1319.     gxOmitColorsIndexMask       = 0x0C,
  1320.     gxOmitColorsIndexSetMask    = 0x03
  1321. };
  1322. enum {
  1323.     gxOmitColorsSpaceShift      = 6,
  1324.     gxOmitColorsProfileShift    = 4,
  1325.     gxOmitColorsComponentsShift = 0,
  1326.     gxOmitColorsIndexShift      = 2,
  1327.     gxOmitColorsIndexSetShift   = 0
  1328. };
  1329. enum {
  1330.     gxOmitTransferSpaceMask     = 0xC0,
  1331.     gxOmitTransferSetMask       = 0x30,
  1332.     gxOmitTransferProfileMask   = 0x0C
  1333. };
  1334. enum {
  1335.     gxOmitTransferSpaceShift    = 6,
  1336.     gxOmitTransferSetShift      = 4,
  1337.     gxOmitTransferProfileShift  = 2
  1338. };
  1339. enum {
  1340.     gxOmitTransferSourceMatrixMask = 0xC0,
  1341.     gxOmitTransferDeviceMatrixMask = 0x30,
  1342.     gxOmitTransferResultMatrixMask = 0x0C,
  1343.     gxOmitTransferFlagsMask     = 0x03
  1344. };
  1345. enum {
  1346.     gxOmitTransferSourceMatrixShift = 6,
  1347.     gxOmitTransferDeviceMatrixShift = 4,
  1348.     gxOmitTransferResultMatrixShift = 2,
  1349.     gxOmitTransferFlagsShift    = 0
  1350. };
  1351. enum {
  1352.     gxOmitTransferComponentModeMask = 0x80,
  1353.     gxOmitTransferComponentFlagsMask = 0x40,
  1354.     gxOmitTransferComponentSourceMinimumMask = 0x30,
  1355.     gxOmitTransferComponentSourceMaximumMask = 0x0C,
  1356.     gxOmitTransferComponentDeviceMinimumMask = 0x03
  1357. };
  1358. enum {
  1359.     gxOmitTransferComponentModeShift = 7,
  1360.     gxOmitTransferComponentFlagsShift = 6,
  1361.     gxOmitTransferComponentSourceMinimumShift = 4,
  1362.     gxOmitTransferComponentSourceMaximumShift = 2,
  1363.     gxOmitTransferComponentDeviceMinimumShift = 0
  1364. };
  1365. enum {
  1366.     gxOmitTransferComponentDeviceMaximumMask = 0xC0,
  1367.     gxOmitTransferComponentClampMinimumMask = 0x30,
  1368.     gxOmitTransferComponentClampMaximumMask = 0x0C,
  1369.     gxOmitTransferComponentOperandMask = 0x03
  1370. };
  1371. enum {
  1372.     gxOmitTransferComponentDeviceMaximumShift = 6,
  1373.     gxOmitTransferComponentClampMinimumShift = 4,
  1374.     gxOmitTransferComponentClampMaximumShift = 2,
  1375.     gxOmitTransferComponentOperandShift = 0
  1376. };
  1377. enum {
  1378.     gxStyleAttributesOpcode     = 0,
  1379.     gxStyleTagOpcode            = 1,
  1380.     gxStyleCurveErrorOpcode     = 2,
  1381.     gxStylePenOpcode            = 3,
  1382.     gxStyleJoinOpcode           = 4,
  1383.     gxStyleDashOpcode           = 5,
  1384.     gxStyleCapsOpcode           = 6,
  1385.     gxStylePatternOpcode        = 7,
  1386.     gxStyleTextAttributesOpcode = 8,
  1387.     gxStyleTextSizeOpcode       = 9,
  1388.     gxStyleFontOpcode           = 10,
  1389.     gxStyleTextFaceOpcode       = 11,
  1390.     gxStylePlatformOpcode       = 12,
  1391.     gxStyleFontVariationsOpcode = 13,
  1392.     gxStyleRunControlsOpcode    = 14,
  1393.     gxStyleRunPriorityJustOverrideOpcode = 15,
  1394.     gxStyleRunGlyphJustOverridesOpcode = 16,
  1395.     gxStyleRunGlyphSubstitutionsOpcode = 17,
  1396.     gxStyleRunFeaturesOpcode    = 18,
  1397.     gxStyleRunKerningAdjustmentsOpcode = 19,
  1398.     gxStyleJustificationOpcode  = 20
  1399. };
  1400. enum {
  1401.     gxOmitDashAttributesMask    = 0xC0,
  1402.     gxOmitDashShapeMask         = 0x30,
  1403.     gxOmitDashAdvanceMask       = 0x0C,
  1404.     gxOmitDashPhaseMask         = 0x03
  1405. };
  1406. enum {
  1407.     gxOmitDashAttributesShift   = 6,
  1408.     gxOmitDashShapeShift        = 4,
  1409.     gxOmitDashAdvanceShift      = 2,
  1410.     gxOmitDashPhaseShift        = 0
  1411. };
  1412. enum {
  1413.     gxOmitDashScaleMask         = 0xC0
  1414. };
  1415. enum {
  1416.     gxOmitDashScaleShift        = 6
  1417. };
  1418. enum {
  1419.     gxOmitPatternAttributesMask = 0xC0,
  1420.     gxOmitPatternShapeMask      = 0x30,
  1421.     gxOmitPatternUXMask         = 0x0C,
  1422.     gxOmitPatternUYMask         = 0x03
  1423. };
  1424. enum {
  1425.     gxOmitPatternAttributesShift = 6,
  1426.     gxOmitPatternShapeShift     = 4,
  1427.     gxOmitPatternUXShift        = 2,
  1428.     gxOmitPatternUYShift        = 0
  1429. };
  1430. enum {
  1431.     gxOmitPatternVXMask         = 0xC0,
  1432.     gxOmitPatternVYMask         = 0x30
  1433. };
  1434. enum {
  1435.     gxOmitPatternVXShift        = 6,
  1436.     gxOmitPatternVYShift        = 4
  1437. };
  1438. enum {
  1439.     gxOmitJoinAttributesMask    = 0xC0,
  1440.     gxOmitJoinShapeMask         = 0x30,
  1441.     gxOmitJoinMiterMask         = 0x0C
  1442. };
  1443. enum {
  1444.     gxOmitJoinAttributesShift   = 6,
  1445.     gxOmitJoinShapeShift        = 4,
  1446.     gxOmitJoinMiterShift        = 2
  1447. };
  1448. enum {
  1449.     gxOmitCapAttributesMask     = 0xC0,
  1450.     gxOmitCapStartShapeMask     = 0x30,
  1451.     gxOmitCapEndShapeMask       = 0x0C
  1452. };
  1453. enum {
  1454.     gxOmitCapAttributesShift    = 6,
  1455.     gxOmitCapStartShapeShift    = 4,
  1456.     gxOmitCapEndShapeShift      = 2
  1457. };
  1458. enum {
  1459.     gxOmitFaceLayersMask        = 0xC0,
  1460.     gxOmitFaceMappingMask       = 0x30
  1461. };
  1462. enum {
  1463.     gxOmitFaceLayersShift       = 6,
  1464.     gxOmitFaceMappingShift      = 4
  1465. };
  1466. enum {
  1467.     gxOmitFaceLayerFillMask     = 0xC0,
  1468.     gxOmitFaceLayerFlagsMask    = 0x30,
  1469.     gxOmitFaceLayerStyleMask    = 0x0C,
  1470.     gxOmitFaceLayerTransformMask = 0x03
  1471. };
  1472. enum {
  1473.     gxOmitFaceLayerFillShift    = 6,
  1474.     gxOmitFaceLayerFlagsShift   = 4,
  1475.     gxOmitFaceLayerStyleShift   = 2,
  1476.     gxOmitFaceLayerTransformShift = 0
  1477. };
  1478. enum {
  1479.     gxOmitFaceLayerBoldXMask    = 0xC0,
  1480.     gxOmitFaceLayerBoldYMask    = 0x30
  1481. };
  1482. enum {
  1483.     gxOmitFaceLayerBoldXShift   = 6,
  1484.     gxOmitFaceLayerBoldYShift   = 4
  1485. };
  1486. enum {
  1487.     gxColorSetReservedOpcode    = 0,
  1488.     gxColorSetTagOpcode         = 1
  1489. };
  1490. enum {
  1491.     gxColorProfileReservedOpcode = 0,
  1492.     gxColorProfileTagOpcode     = 1
  1493. };
  1494. enum {
  1495.     gxTransformReservedOpcode   = 0,
  1496.     gxTransformTagOpcode        = 1,
  1497.     gxTransformClipOpcode       = 2,
  1498.     gxTransformMappingOpcode    = 3,
  1499.     gxTransformPartMaskOpcode   = 4,
  1500.     gxTransformToleranceOpcode  = 5
  1501. };
  1502. enum {
  1503.     gxTypeOpcode                = 0,
  1504.     gxSizeOpcode                = 1
  1505. };
  1506. /* used by currentOperand when currentOperation is gxNextOpcode */
  1507. /*    format of top byte:
  1508. xx yyyyyy   xx == 0x00, 0x40, 0x80, 0xC0: defines graphics operation (see gxGraphicsOperationOpcode)
  1509.             yyyyyy == size of operation in bytes
  1510.             if (yyyyyy == 0), byte size follows. If byte following == 0, word size follows; if == 0, long follows
  1511.             word and long, if present, are specified in high-endian order (first byte is largest magnitude)
  1512.             
  1513. format of byte following size specifiers, if any:
  1514. xx yyyyyy   xx == 0x00, 0x40, 0x80, 0xC0: defines compression level (0 == none, 0xC0 == most)
  1515.             exact method of compression is defined by type of data
  1516.             yyyyyy == data type selector (0 to 63): see gxGraphicsNewOpcode, __DataOpcode
  1517. */
  1518. enum {
  1519.     gxOpcodeShift               = 6,
  1520.     gxObjectSizeMask            = 0x3F,
  1521.     gxCompressionShift          = 6,
  1522.     gxObjectTypeMask            = 0x3F,
  1523.     gxBitImageOpcodeMask        = 0xC0,
  1524.     gxBitImageCountMask         = 0x3F,
  1525.     gxBitImageOpcodeShift       = 6
  1526. };
  1527. enum {
  1528.     gxNoCompression             = 0,
  1529.     gxWordCompression           = 1,
  1530.     gxByteCompression           = 2,
  1531.     gxOmitCompression           = 3,
  1532.     gxCompressionMask           = 0x03
  1533. };
  1534. /*    the following structures define how primitives without a public geometry
  1535.     are stored (their format mirrors that of the New call to create them)   */
  1536. struct gxFlatFontName {
  1537.     unsigned char                   name;                       /* gxFontName */
  1538.     unsigned char                   platform;                   /* gxFontPlatform */
  1539.     unsigned char                   script;                     /* gxFontScript */
  1540.     unsigned char                   language;                   /* gxFontLanguage */
  1541.     short                           length;                     /* byte length */
  1542. };
  1543. typedef struct gxFlatFontName           gxFlatFontName;
  1544. enum {
  1545.     gxFlatFontListItemTag       = FOUR_CHAR_CODE('flst')
  1546. };
  1547. struct gxFlatFontListItem {
  1548.     gxFont                          fontID;                     /*** if we get rid of this, remove #include "font types.h", above */
  1549.     unsigned char                   name;                       /* gxFontName */
  1550.     unsigned char                   platform;                   /* gxFontPlatform */
  1551.     unsigned char                   script;                     /* gxFontScript */
  1552.     unsigned char                   language;                   /* gxFontLanguage */
  1553.     short                           length;                     /* byte length of the name that follows */
  1554.     unsigned short                  glyphCount;                 /* CountFontGlyphs or 0 if gxFontGlyphsFlatten is false */
  1555.     unsigned short                  axisCount;                  /* CountFontVariations or 0 if gxFontVariationsFlatten is false */
  1556.     unsigned short                  variationCount;             /* number of bitsVariationPairs that follow the (optional) glyphBits */
  1557. };
  1558. typedef struct gxFlatFontListItem       gxFlatFontListItem;
  1559. struct gxFlatFontList {
  1560.     long                            count;
  1561.     gxFlatFontListItem              items[1];
  1562. };
  1563. typedef struct gxFlatFontList           gxFlatFontList;
  1564. struct gxFlattenHeader {
  1565.     Fixed                           version;
  1566.     unsigned char                   flatFlags;
  1567.     SInt8                           padding;
  1568. };
  1569. typedef struct gxFlattenHeader          gxFlattenHeader;
  1570. enum {
  1571.     gxOmitPictureShapeMask      = 0xC0,
  1572.     gxOmitOverrideStyleMask     = 0x30,
  1573.     gxOmitOverrideInkMask       = 0x0C,
  1574.     gxOmitOverrideTransformMask = 0x03
  1575. };
  1576. enum {
  1577.     gxOmitPictureShapeShift     = 0x06,
  1578.     gxOmitOverrideStyleShift    = 0x04,
  1579.     gxOmitOverrideInkShift      = 0x02,
  1580.     gxOmitOverrideTransformShift = 0x00
  1581. };
  1582. enum {
  1583.     gxPostScriptTag             = FOUR_CHAR_CODE('post'),
  1584.     gxPostControlTag            = FOUR_CHAR_CODE('psct')
  1585. };
  1586. enum {
  1587.     gxNoSave                    = 1,                            /* don't do save-restore around PS data */
  1588.     gxPSContinueNext            = 2                             /* next shape is continuation of this shape's PS -- only obeyed if gxNoSave is true */
  1589. };
  1590. struct gxPostControl {
  1591.     long                            flags;                      /* PostScript state flags */
  1592. };
  1593. typedef struct gxPostControl            gxPostControl;
  1594. enum {
  1595.     gxDashSynonymTag            = FOUR_CHAR_CODE('sdsh')
  1596. };
  1597. struct gxDashSynonym {
  1598.     long                            size;                       /* number of elements in array */
  1599.     Fixed                           dashLength[1];              /* Array of dash lengths */
  1600. };
  1601. typedef struct gxDashSynonym            gxDashSynonym;
  1602. enum {
  1603.     gxLineCapSynonymTag         = FOUR_CHAR_CODE('lcap')
  1604. };
  1605. enum {
  1606.     gxButtCap                   = 0,
  1607.     gxRoundCap                  = 1,
  1608.     gxSquareCap                 = 2,
  1609.     gxTriangleCap               = 3
  1610. };
  1611. /* gxLine cap type */
  1612. typedef long                            gxLineCapSynonym;
  1613. enum {
  1614.     gxCubicSynonymTag           = FOUR_CHAR_CODE('cubx')
  1615. };
  1616. enum {
  1617.     gxIgnoreFlag                = 0x0000,                       /* Ignore this word, get next one */
  1618.     gxLineToFlag                = 0x0001,                       /* Draw a gxLine to gxPoint following this flag */
  1619.     gxCurveToFlag               = 0x0002,                       /* Draw a gxCurve through the 3 points following this flag */
  1620.     gxMoveToFlag                = 0x0003,                       /* Start a new contour at the gxPoint following this flag */
  1621.     gxClosePathFlag             = 0x0004                        /* Close the contour */
  1622. };
  1623. typedef long                            gxCubicSynonym;
  1624. enum {
  1625.     gxCubicInstructionMask      = 0x000F                        /* low four bits are gxPoint instructions */
  1626. };
  1627. /* Low four bits are instruction (moveto, lineto, curveto, closepath) */
  1628. typedef short                           gxCubicSynonymFlags;
  1629. enum {
  1630.     gxPatternSynonymTag         = FOUR_CHAR_CODE('ptrn')
  1631. };
  1632. enum {
  1633.     gxHatch                     = 0,
  1634.     gxCrossHatch                = 1
  1635. };
  1636. struct gxPatternSynonym {
  1637.     long                            patternType;                /* one of the gxPatterns: gxHatch or gxCrossHatch */
  1638.     Fixed                           angle;                      /* angle at which pattern is drawn */
  1639.     Fixed                           spacing;                    /* distance between two parallel pattern lines */
  1640.     Fixed                           thickness;                  /* thickness of the pattern */
  1641.     gxPoint                         anchorPoint;                /* gxPoint with with respect to which pattern position is calculated */
  1642. };
  1643. typedef struct gxPatternSynonym         gxPatternSynonym;
  1644. enum {
  1645.     gxURLTag                    = FOUR_CHAR_CODE('urlt')
  1646. };
  1647. #if PRAGMA_STRUCT_ALIGN
  1648.     #pragma options align=reset
  1649. #elif PRAGMA_STRUCT_PACKPUSH
  1650.     #pragma pack(pop)
  1651. #elif PRAGMA_STRUCT_PACK
  1652.     #pragma pack()
  1653. #endif
  1654. #ifdef PRAGMA_IMPORT_OFF
  1655. #pragma import off
  1656. #elif PRAGMA_IMPORT
  1657. #pragma import reset
  1658. #endif
  1659. #ifdef __cplusplus
  1660. }
  1661. #endif
  1662. #endif /* __GXTYPES__ */