home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ddih.zip / DDI.H
Text File  |  1999-11-22  |  37KB  |  942 lines

  1. /*****************************************************************************
  2.  *
  3.  * SOURCE FILE NAME = DDI.H
  4.  *
  5.  * DESCRIPTIVE NAME = Video and Printer DDI Structures and defines
  6.  *
  7.  * Copyright : COPYRIGHT IBM CORPORATION, 1993
  8.  *             LICENSED MATERIAL - PROGRAM PROPERTY OF IBM
  9.  *             REFER TO COPYRIGHT INSTRUCTION FORM#G120-2083
  10.  *             RESTRICTED MATERIALS OF IBM
  11.  *             IBM CONFIDENTIAL
  12.  *
  13.  * ==========================================================================
  14.  *
  15.  * The folowing symbols are used in this file for conditional sections.
  16.  *
  17.  *   #define:                To include:
  18.  *
  19.  *   INCL_VMANDDI            Include all VMI interface definitions
  20.  *   INCL_VMANWIN            Include VMAN to VDD interface definitions
  21.  *   INCL_VMANHELP           Include VMAN Helper definitions and prototypes
  22.  *
  23.  * ==========================================================================
  24.  *
  25.  * VERSION = V2.1
  26.  *
  27.  * DESCRIPTION
  28.  *      This file contains all of the defines and
  29.  *      data structures that are shared between the
  30.  *      video manager and the translation layers.
  31.  *
  32.  * FUNCTIONS
  33.  *
  34.  * NOTES
  35.  *
  36.  * STRUCTURES
  37.  *
  38.  * EXTERNAL REFERENCES
  39.  *
  40.  * EXTERNAL FUNCTIONS
  41.  *
  42.  * CHANGE ACTIVITY =
  43.  *  DATE      FLAG        APAR   CHANGE DESCRIPTION
  44.  *  --------  ----------  -----  --------------------------------------
  45.  *  mm/dd/yy  @Vr.mpppxx  xxxxx  xxxxxxx
  46.  *
  47.  ****************************************************************************/
  48.  
  49. /* NOINC */
  50. #ifndef DDI_INCLUDED
  51. /* INC */
  52.  
  53.   #define DDI_INCLUDED
  54.  
  55.   /**  Possible return codes from the individual DDI's
  56.   */
  57.   #define RC_SUCCESS                   0
  58.   #define RC_SIMULATE                  1
  59.   #define RC_UNSUPPORTED               2
  60.   #define RC_ERROR                     3
  61.   #define RC_ERROR_IN_BACKGROUND       4
  62.   #define RC_ERROR_NO_HANDLE           5
  63.   #define RC_ERROR_RESOURCE_NOT_FOUND  6
  64.   #define RC_ERROR_INVALID_PARAMETER   7
  65.   #define RC_ERROR_OUT_OF_MEMORY       8
  66.   #define RC_DISABLED                  9
  67.   #define RC_ENABLED                   10
  68.  
  69.  
  70.   /*
  71.   **  Defines and structures for the GHI_CMD_BITBLT DDI
  72.   */
  73.   typedef struct _BMAPINFO {        /* bmapinfo */
  74.      ULONG  ulLength;
  75.      ULONG  ulType;
  76.      ULONG  ulWidth;
  77.      ULONG  ulHeight;
  78.      ULONG  ulBpp;
  79.      ULONG  ulBytesPerLine;
  80.      PBYTE  pBits;
  81.   } BMAPINFO;
  82.   typedef BMAPINFO  *PBMAPINFO;
  83.  
  84.   typedef struct _BLTRECT {         /* bltrect */
  85.      ULONG  ulXOrg;
  86.      ULONG  ulYOrg;
  87.      ULONG  ulXExt;
  88.      ULONG  ulYExt;
  89.   } BLTRECT;
  90.   typedef BLTRECT  *PBLTRECT;
  91.  
  92.   /*
  93.   **  Defines for the ulType field of the BMAPINFO data structure
  94.   */
  95.   #define BMAP_VRAM            0x00000000
  96.   #define BMAP_MEMORY          0x00000001
  97.   #define BMAP_BANKED          0x00000010
  98.   #define BMAP_ALPHA_CHANNEL   0x00000020   // see below(Reserved, not used now)
  99.   #define BMAP_ALPHA_PREMUL    0x00000040   // see below(Reserved, not used now)
  100.   #define BMAP_ALPHA_RASTER    0x00000080   // see below(Reserved, not used now)
  101.   #define BMAP_16BPP_1555      0x00000100
  102.   #define BMAP_VERTICAL_SCAN   0x10000000
  103.   #define BMAP_FOCAFONT        0x20000000
  104.  
  105.   // BMAP_ALPHA_CHANNEL - valid only for 4, 8 and 32 bpp
  106.   //   This flag indicates that the high byte of pBits for 32BPP or
  107.   //   the high byte of pulColors for 8/4 bpp contains alpha value.
  108.   //   Otherwise, that byte is ignored.
  109.   //
  110.   // BMAP_ALPHA_PREMUL - BMAP_ALPHA_CHANNEL must be set.
  111.   //   This flag indicates that the color value is premultiplied by the alpha.
  112.   //
  113.   // BMAP_ALPHA_RASTER - valid only for 8 bpp.
  114.   //   This flag indicates that the 8bit value is alpha.
  115.  
  116.  
  117.   /* Bank info passed to SD from GRE2VMAN       */
  118.   /* Passed in Overloaded 2nd function param    */
  119.   #define TYPE_GRDBNKINFO     0x00000001
  120.   #define TYPE_CMYKINFO       0x00000002
  121.  
  122.   typedef struct _GRDBNKINFO {       /* gbi */
  123.      ULONG ulLength;                 /* denotes length of ver. x                   */
  124.      ULONG ulType;                   /* 2nd parameter structure type               */
  125.      ULONG ulAperture;               /* Aperture Size for banked devices           */
  126.      ULONG ulGID;                    /* Graphics Adapter ID used by VMAN           */
  127.      ULONG ulCurrBank;               /* Current bank (to avoid unnecessary change) */
  128.      ULONG ulReserved;               /* System Reserved ulong                      */
  129.      PFN   pfnBankSwitch;            /* Function Pointer to Bank Switching Routine */
  130.      PVOID pvReserved;               /* System Reserved Pointer                    */
  131.   }  GRDBNKINFO;
  132.   typedef GRDBNKINFO *PGRDBNKINFO;
  133.  
  134.   #define CMYK_DEVICE          0x00000002
  135.   #define CMY_ONLY             0x00000004
  136.   #define CMYK_INTERLEAVE      0x00000008
  137.  
  138.   typedef struct _BITBLTINFO {      /* bitbltinfo */
  139.      ULONG        ulLength;
  140.      ULONG        ulBltFlags;
  141.      ULONG        cBlits;
  142.      ULONG        ulROP;
  143.      ULONG        ulMonoBackROP;
  144.      ULONG        ulSrcFGColor;
  145.      ULONG        ulSrcBGColor;
  146.      ULONG        ulPatFGColor;
  147.      ULONG        ulPatBGColor;
  148.      PBYTE        abColors;
  149.      PBMAPINFO    pSrcBmapInfo;
  150.      PBMAPINFO    pDstBmapInfo;
  151.      PBMAPINFO    pPatBmapInfo;
  152.      PPOINTL      aptlSrcOrg;
  153.      PPOINTL      aptlPatOrg;
  154.      PBLTRECT     abrDst;
  155.      PRECTL       prclSrcBounds;    /* incl/excl bounds. */
  156.      PRECTL       prclDstBounds;    /* incl/excl bounds. */
  157.   } BITBLTINFO;
  158.   typedef BITBLTINFO *PBITBLTINFO;
  159.  
  160.  
  161.   // Reserved, not used now
  162.   //
  163.   // Alpha Compositing Rules
  164.   //
  165.   // Alpha compositing rules for combining source and destination
  166.   // pixels to achieve blending and transparency effects
  167.   // with graphics and images.
  168.   //
  169.   // The rules are described in
  170.   // T. Porter and T. Duff, "Compositing Digital Images",
  171.   // SIGGRAPH 84, 253-259.
  172.   //
  173.   // If any input does not have an alpha channel,
  174.   // an alpha value of 1.0 (completely opaque) is assumed for all pixels.
  175.   //
  176.   // A constant alpha value can also be specified to be
  177.   // multiplied with the alpha value of the source pixels.
  178.   //
  179.   // The following abbreviations are used in the description of the rules:
  180.   // Cs = one of the Color components of the Source Pixel.
  181.   // Cd = one of the Color components of the Destination Pixel.
  182.   // As = Alpha component of the Source Pixel.
  183.   // Ad = Alpha component of the Destination Pixel.
  184.   // Fs = fraction of the Source Pixel which contributes to the output.
  185.   // Fd = fraction of the input Destination Pixel which contributes to the output.
  186.   //
  187.   // The color and alpha components produced by the compositing operation are
  188.   // calculated as follows:
  189.   //
  190.   //     Cd = Cs*Fs + Cd*Fd
  191.   //     Ad = As*Fs + Ad*Fd
  192.   //
  193.   // where Fs and Fd are specified by each rule.  The above equations assume
  194.   // that both source and destination pixels have the color components
  195.   // premultiplied by the alpha component.  Similarly, the equations expressed
  196.   // in the definitions of compositing rules below assume premultiplied alpha.
  197.   //
  198.   #define ALPHA_RULE_DST            0x00000000 // 0 == Leave alone
  199.   #define ALPHA_RULE_CLEAR          0x00000001 // java.awt.AlphaComposite.CLEAR
  200.   #define ALPHA_RULE_SRC            0x00000002 // java.awt.AlphaComposite.SRC
  201.   #define ALPHA_RULE_SRC_OVER_DST   0x00000003 // java.awt.AlphaComposite.SRC_OVER
  202.   #define ALPHA_RULE_DST_OVER_SRC   0x00000004 // java.awt.AlphaComposite.DST_OVER
  203.   #define ALPHA_RULE_SRC_IN_DST     0x00000005 // java.awt.AlphaComposite.SRC_IN
  204.   #define ALPHA_RULE_DST_IN_SRC     0x00000006 // java.awt.AlphaComposite.DST_IN
  205.   #define ALPHA_RULE_SRC_OUT_DST    0x00000007 // java.awt.AlphaComposite.SRC_OUT
  206.   #define ALPHA_RULE_DST_OUT_SRC    0x00000008 // java.awt.AlphaComposite.SRC_OVER
  207.   #define ALPHA_RULE_SRC_ATOP_DST   0x00000009
  208.   #define ALPHA_RULE_DST_ATOP_SRC   0x0000000A
  209.   #define ALPHA_RULE_SRC_XOR_DST    0x0000000B
  210.  
  211.   // Reserved, not used now
  212.   //=====================================================================
  213.   // AlphaBitBltInfo structure
  214.   //
  215.   //   14 APR 98 - STJONES
  216.   //
  217.   // The length of this structure will differentiate it from the old
  218.   // BITBLTINFO structure.  As much as possible, fields with similar
  219.   // functions will remain at the same offset relative to the start of
  220.   // the structure.
  221.   //=====================================================================
  222.   typedef struct _ALPHABITBLTINFO         /* abbi */
  223.   {
  224.      ULONG        ulLength;             // unchanged
  225.      ULONG        ulBltFlags;           // unchanged
  226.      ULONG        cBlits;               // unchanged
  227.      ULONG        ulRule;               // Rule vs ROP
  228.  
  229.      ULONG        ulXORColor;           // redefined
  230.      ULONG        ulFGColor;            // similar
  231.      ULONG        ulBGColor;            // similar
  232.      ULONG        ulGradColor1;         // redefined
  233.      ULONG        ulGradColor2;         // redefined
  234.  
  235.      PBYTE        abColors;             // unchanged
  236.      PBMAPINFO    pSrcBmapInfo;         // unchanged
  237.      PBMAPINFO    pDstBmapInfo;         // unchanged
  238.  
  239.      PBMAPINFO    pPatBmapInfo;         // unchanged (gradient info?)
  240.      PPOINTL      aptlSrcOrg;           // unchanged
  241.      PPOINTL      aptlPatOrg;           // unchanged (gradient info?)
  242.      PBLTRECT     abrDst;               // unchanged
  243.  
  244.      ULONG        ulExtraAlpha;         // redefined
  245.      PULONG       pulDstClrInvLUT;      // redefined
  246.  
  247.   } ALPHABITBLTINFO;
  248.   typedef ALPHABITBLTINFO *PALPHABITBLTINFO;
  249.  
  250.   /*
  251.   ** Defines for ulBltFlags field of the BITBLTINFO data structure
  252.   **
  253.   ** The default state of the flags are as follows:
  254.   **
  255.   ** DIRECTION      = Left to right - top to bottom
  256.   ** TRANSPARENCY   = NONE
  257.   ** PATTERN STYLE  = UNKNOWN
  258.   ** BACKGROUND ROP = INVALID
  259.   */
  260.  
  261.   #define BF_DEFAULT_STATE          0x00000000  // blt dir X and Y positive.
  262.  
  263.   #define BF_DIR_X_NEGATIVE         0x00000001
  264.   #define BF_DIR_RIGHT_LEFT         BF_DIR_X_NEGATIVE
  265.  
  266.   #define BF_DIR_Y_NEGATIVE         0x00000002
  267.   #define BF_DIR_BOTTOM_TOP         BF_DIR_Y_NEGATIVE
  268.  
  269.   #define BF_ROP_INCL_SRC           0x00000004
  270.   #define BF_ROP_INCL_PAT           0x00000008
  271.  
  272.   #define BF_SRC_TRANSPARENT        0x00000010
  273.   #define BF_DST_TRANSPARENT        0x00000020
  274.   #define BF_PAT_TRANSPARENT        0x00000040
  275.  
  276.   #define BF_PAT_SOLID              0x00000080
  277.   #define BF_PAT_HOLLOW             0x00000100
  278.  
  279.   #define BF_APPLY_BACK_ROP         0x00000200
  280.  
  281.   #define BF_SRC_MONOINVERT         0x00000400
  282.   #define BF_PAT_MONOINVERT         0x00000800
  283.   #define BF_SRC_CONVERT            0x00001000
  284.   #define BF_SRC_BITS_EXTERNAL      BF_SRC_CONVERT
  285.   #define BF_LAST_BLT               0x00002000
  286.   #define BF_SRC_Y_FLIP             0x00004000
  287.   #define BF_SRC_X_FLIP             0x00008000
  288.   #define BF_SRC_VERTICAL_SCAN      0x00010000
  289.   #define BF_DST_MONOINVERT         0x00020000
  290.  
  291.   #define BF_ALPHA_BLENDING         0x00040000  // see below(Reserved, not used now)
  292.   #define BF_ALPHA_RASTER           0x00080000  // see below(Reserved, not used now)
  293.   #define BF_ALPHA_ANTIALIAS        0x00100000  // see below(Reserved, not used now)
  294.   #define BF_STROKE_FILL            0x00200000
  295.   #define BF_SRC_STRETCH            0x00400000  // see below
  296.   #define BF_SRC_STRETCH_AND        0x00800000  // see below
  297.   #define BF_SRC_STRETCH_IGNORE     0x01000000  // see below
  298.   #define BF_CLIP                   0x02000000  // see below
  299.  
  300.   //---------------------------------------------------------------------
  301.   // The BF_ALPHA_BLENDING indicates that this is an AlphaBlending RULE
  302.   // rather than a BitBlt ROP.  The ulExtraAlpha field is always valid
  303.   // for an AlphaBlending RULE.
  304.   //---------------------------------------------------------------------
  305.   //
  306.   // BF_ALPHA_RASTER
  307.   //   Contains alpha raster in SrcBmapInfo (but BF_ROP_INCL_SRC shuold not be set).
  308.   //   SrcBmap must be 8bpp.
  309.   //   FG clr and FG alpha will be mixed with destination using alpha
  310.   //
  311.   // BF_ALPHA_ANTIALIASED
  312.   //    valid if BF_ALPHA_RASTER is also set.
  313.   //    if set alpha values are in the range 0(transparent) - 255(opaque).
  314.   //    if not set, alpha vaues are either transparent (alpha=0) otherwise opaque.
  315.   //
  316.   // Apply ulBGColor to transparent pixel in the source bitmap.
  317.   // A pixel is transparent if pixel's alpha is 0.
  318.   // BF_SRC_CONVERT or BF_ALPHA_BLENDING  must be set.
  319.   #define BF_TRANS_PIXEL_COLOR       BF_APPLY_BACK_ROP    // Reserved, not used now
  320.  
  321.   // BF_SRC_STRETCH
  322.   //   src is stretched or compressed from source to target bltrect.
  323.   //   the source and target bltrects are passed in
  324.   //   (PBLTRECT)aptlSrcOrg.
  325.   //
  326.   //   if src is compressed, then any eliminated rows and colums are ORed,
  327.   //   unless either BF_SRC_STRETCH_AND or BF_SRC_STRETCH_IGNORE is set
  328.   //
  329.   // BF_SRC_STRETCH_AND
  330.   //   if src is compressed, then any eliminated rows and colums are ANDed.
  331.   //
  332.   // BF_SRC_STRETCH_IGNORE
  333.   //   if src is compressed, then any eliminated rows and colums are ignored.
  334.   //
  335.  
  336.   // BF_CLIP              
  337.   //   clip polygons for pfnPolygon and
  338.   //   source bitmap for pfnBitblt with BF_SRC_STRETCH.
  339.   //   abrDst will contain cBlits clip rects. These clip rects are
  340.   //   Y ordered and X ordered in device surface coordinate system.
  341.  
  342.   /*
  343.   **  Defines and structures for the GHI_CMD_LINE DDI
  344.   */
  345.   typedef struct _LINEPACK {           /* linepack */
  346.      ULONG            ulStyleStep;
  347.      ULONG            ulStyleValue;
  348.      ULONG            ulFlags;
  349.      struct _LINEPACK * plpkNext;
  350.      ULONG            ulAbsDeltaX;
  351.      ULONG            ulAbsDeltaY;
  352.      POINTL           ptlClipStart;
  353.      POINTL           ptlClipEnd;
  354.      POINTL           ptlStart;
  355.      POINTL           ptlEnd;
  356.      LONG             lClipStartError; /* Bresenham error at the clip start.*/
  357.                                        /* not valid for horizontal or       */
  358.                                        /* vertical lines.                   */
  359.   } LINEPACK;    /* lpk */
  360.   typedef LINEPACK  *PLINEPACK;   /* plpk */
  361.  
  362.  
  363.   /*
  364.   **  Defines for the ulFlags field of the LINEPACK/LINEINFO2 data structure
  365.   */
  366.   #define LINE_DO_FIRST_PEL      0x00000002
  367.   #define LINE_DIR_Y_POSITIVE    0x00000004
  368.   #define LINE_HORIZONTAL        0x00000008
  369.   #define LINE_X_MAJOR           0x00000010
  370.   #define LINE_DIR_X_POSITIVE    0x00000020
  371.   #define LINE_VERTICAL          0x00001000
  372.   #define LINE_STYLE_X_MAJOR     0x00002000
  373.   #define LINE_DO_LAST_PEL       0x00004000
  374.   #define LINE_MONO_INVERT       0x00008000  /* need to set for the first              */
  375.                                              /* line only, if required.                */
  376.   #define LINE_START_CLIP        0x00010000  /* first line in LINEINFO2 is clipped     */
  377.   #define LINE_END_CLIP          0x00020000  /* last line in LINEINFO2 is clipped      */
  378.   #define LINE_Y_FLIP            0x00040000  /* flip Y for all lines in LINEINFO2      */
  379.   #define LINE_ALL_RADIAL        0x00080000  /* all lines in LINEINFO2 are vertical    */
  380.                                              /* or horizontal or 45/135/225/315 degree */
  381.   #define LINE_DISJOINT          0x00100000  /* disjoint lines                         */
  382.  
  383.   /*  Line drawing
  384.   **
  385.   **    The line starts from ptlStart and ends at ptlEnd(inclusive).
  386.   **    The device can do the Bresenham either from ptlStart or
  387.   **    from the ptlClipStart using the lClipStartError and
  388.   **    will only set the pels from ptlClipStart to ptlClipEnd(inclusive).
  389.   **
  390.   **  ulAbsDeltaX :
  391.   **    absolute (ptlStart.x - ptlEnd.x)
  392.   **
  393.   **  ulAbsDeltaY :
  394.   **    absolute (ptlStart.y - ptlEnd.y)
  395.   **
  396.   **  lClipStartError:
  397.   **
  398.   **    This is the standard Bresenham error at the clipped start point.
  399.   **    This is calculated from the initial error at the start point and
  400.   **    the error increments for major step and diagonal step.
  401.   **
  402.   **    The initial error and the error increments are:
  403.   **
  404.   **    MAX           = maximum (ulAbsDeltaX, ulAbsDeltaY)
  405.   **    MIN           = minimum (ulAbsDeltaX, ulAbsDeltaY)
  406.   **    Major Inc.    = Increment to the error for
  407.   **                    stepping along the major axis.
  408.   **                  = 2 * MIN
  409.   **    Diagonal Inc. = Increment to the error for
  410.   **                    stepping along the major and minor axis.
  411.   **                  = 2 * MIN - 2 * MAX
  412.   **    Initial error = Error at the start point.
  413.   **                  = 2 * MIN - MAX  if LINE_DIR_X_POSITIVE is on
  414.   **                  = 2 * MIN - MAX - 1 if LINE_DIR_X_POSITIVE is off.
  415.   **
  416.   **   Horizontal and vertical lines.
  417.   **      The line is drawn from the clipped start to clipped end.
  418.   **      The lClipStartError will not be given.
  419.   **
  420.   **   First pel consideration.
  421.   **      Set the the first pel at the ptlStart (not ptlClipStart) only
  422.   **      if LINE_DO_FIRST_PEL is set and the first pel is not clipped out.
  423.   **
  424.   **   Last pel consideration.
  425.   **      Set the the last pel at the ptlEnd (not ptlClipEnd) only
  426.   **      if LINE_DO_LAST_PEL is set and the last pel is not clipped out.
  427.   **
  428.   **
  429.   **   Styling.
  430.   **      Lines are styled using the ulStyleMask, ulStyleStep and ulStyleValue.
  431.   **
  432.   **      ulStyleMask:
  433.   **         A 32 bit style mask.
  434.   **
  435.   **      ulStyleStep:
  436.   **         The value to be added to ulStyleValue
  437.   **         on each pel stepped along the style major direction.
  438.   **
  439.   **      ulStyleValue:
  440.   **         The style value at the current pel.
  441.   **         it is composed of an error value and a mask position as :
  442.   **
  443.   **         ┌────────────────────────────────────────────────────┐
  444.   **         │    high word   │  3 bits  │  5 bits  │   8 bits    │
  445.   **         └────────────────────────────────────────────────────┘
  446.   **         │    not used    │ not used │ mask pos │ error value │
  447.   **
  448.   **      Error Value :
  449.   **         Error value at the current pel.
  450.   **
  451.   **      Mask Position :
  452.   **         Bit position of the ulStyleMask.
  453.   **         if this bit is on,
  454.   **            set the current pel to the ulFGColor through usForeROP,
  455.   **         otherwise
  456.   **            set the current pel to the ulBGColor through usBackRop
  457.   **
  458.   */
  459.   typedef struct _LINEINFO {        /* linfo */
  460.      ULONG          ulLength;
  461.      ULONG          ulType;
  462.      ULONG          ulStyleMask;
  463.      ULONG          cLines;
  464.      ULONG          ulFGColor;
  465.      ULONG          ulBGColor;
  466.      USHORT         usForeROP;
  467.      USHORT         usBackROP;
  468.      PBMAPINFO      pDstBmapInfo;
  469.      PLINEPACK      alpkLinePack;
  470.      PRECTL         prclBounds;     /* incl/incl bounds. */
  471.   } LINEINFO;      /* linfo */
  472.   typedef  LINEINFO *PLINEINFO;     /* plinfo */
  473.  
  474.   typedef struct _LINEINFO2 {       /* linfo2 */
  475.      ULONG          ulLength;       /* same as lineinfo */
  476.      ULONG          ulType;         /* same as lineinfo */
  477.      ULONG          ulStyleMask;    /* same as lineinfo */
  478.      ULONG          cLines;         /* same as lineinfo */
  479.      ULONG          ulFGColor;      /* same as lineinfo */
  480.      ULONG          ulBGColor;      /* same as lineinfo */
  481.      USHORT         usForeROP;      /* same as lineinfo */
  482.      USHORT         usBackROP;      /* same as lineinfo */
  483.      PBMAPINFO      pDstBmapInfo;   /* same as lineinfo */
  484.      ULONG          ulFlags;        /* LINE_* see above */
  485.      ULONG          ulXYStyleStep;  /* low byte of low word: x style, high byte of low word: y style */
  486.      PULONG         pulStyleValue;  /* style value at start point */
  487.      POINTL         ptlOrigin;      /* origin           */
  488.      PPOINTL        pptlStart;      /* start point      */
  489.      PPOINTL        pptlLines;      /* points array     */
  490.      POINTL         ptlClipStart;   /* clipped start point if it is clipped */
  491.      POINTL         ptlClipEnd;     /* clipped end point if it is clipped   */
  492.      LONG           lClipStartError;/* Bresenham error at the clip start.   */
  493.                                     /* for first line.                      */
  494.                                     /* not valid for horizontal or          */
  495.                                     /* vertical lines.                      */
  496.      PRECTL         prclBounds;     /* incl/incl bounds.*/
  497.  
  498.   } LINEINFO2;      /* linfo2 */
  499.   typedef  LINEINFO2 *PLINEINFO2;   /* plinfo2 */
  500.  
  501.   /*
  502.   **  Defines for the ulType field of the LINEINFO data structure
  503.   */
  504.   #define LINE_SOLID       0x01
  505.   #define LINE_INVISIBLE   0x02
  506.   #define LINE_ALTERNATE   0x03
  507.  
  508.  
  509.   /*
  510.   ** Defines for 2 way Line ROPS
  511.   */
  512.                                     /* PATTERN = 0xC and DEST = 0xA */
  513.   #define LR_ZERO               0   /* 0x0                          */
  514.   #define LR_INVERTMERGEPAT     1   /* ~(LR_DEST | LR_PATTERN)      */
  515.   #define LR_MASKINVERTPAT      2   /* (~LR_PATTERN) & LR_DEST      */
  516.   #define LR_INVERTCOPYPAT      3   /* ~LR_PATTERN                  */
  517.   #define LR_MASKPATINVERT      4   /* (~LR_DEST) & LR_PATTERN      */
  518.   #define LR_INVERT             5   /* ~LR_DEST                     */
  519.   #define LR_XORPAT             6   /* LR_DEST ^ LR_PATTERN         */
  520.   #define LR_INVERTMASKPAT      7   /* ~(LR_DEST & LR_PATTERN)      */
  521.   #define LR_MASKPAT            8   /* LR_DEST & LR_PATTERN         */
  522.   #define LR_INVERTXORPAT       9   /* ~(LR_DEST ^ LR_PATTERN)      */
  523.   #define LR_LEAVEALONE        10   /* LR_DEST                      */
  524.   #define LR_MERGEINVERTPAT    11   /* (~LR_PATTERN) | LR_DEST      */
  525.   #define LR_PATCOPY           12   /* LR_PATTERN                   */
  526.   #define LR_MERGEPATINVERT    13   /* (~LR_DEST) | LR_PATTERN      */
  527.   #define LR_MERGEPAT          14   /* LR_PATTERN | LR_DEST         */
  528.   #define LR_ONE               15   /* 0x0F                         */
  529.  
  530.   #ifndef FLOAT
  531.      typedef float  FLOAT;           /* f   */
  532.      typedef FLOAT  *PFLOAT;         /* pf  */
  533.   #endif
  534.   #ifndef DOUBLE
  535.      typedef double DOUBLE;          /* d   */
  536.      typedef DOUBLE *PDOUBLE;        /* pd  */
  537.   #endif
  538.   //
  539.   // VERTEXDATA
  540.   //
  541.   typedef struct _VERTEXDATA
  542.   {
  543.      USHORT usDataType;        // see below
  544.      USHORT usStride;          // stride in bytes for next data
  545.      union
  546.      {
  547.         PBYTE   pbData;        // signed byte  (8 bits)
  548.         PSHORT  psData;        // signed short (16 bits)
  549.         PLONG   plData;        // signed long  (32 bits)
  550.         PFLOAT  pfData;        // float        (32 bits)
  551.         PDOUBLE pdData;        // double       (64 bits)
  552.      };
  553.   } VERTEXDATA;
  554.   typedef VERTEXDATA *PVERTEXDATA;
  555.  
  556.   //
  557.   // usDataType for VERTEXDATA
  558.   //
  559.   #define VERTEXDATA_BYTE    0x01   // byte   (8 bits)
  560.   #define VERTEXDATA_SHORT   0x02   // short  (16 bits)
  561.   #define VERTEXDATA_LONG    0x03   // long   (32 bits)
  562.   #define VERTEXDATA_FLOAT   0x04   // float  (32 bits)
  563.   #define VERTEXDATA_DOUBLE  0x05   // double (64 bits)
  564.  
  565.   //
  566.   // POLYGON2D
  567.   //
  568.   typedef struct _POLYGON2D
  569.   {
  570.      ULONG      cVertex;       // number of vertices
  571.      ULONG      ulTessType;    // tessellation type, see below
  572.      ULONG      ulVertexMask;  // see below
  573.      VERTEXDATA vdx;           // vertex x coordinate data
  574.      VERTEXDATA vdy;           // vertex y coordinate data
  575.      VERTEXDATA vda;           // vertex color alpha data
  576.      VERTEXDATA vdr;           // vertex color red data
  577.      VERTEXDATA vdg;           // vertex color green data
  578.      VERTEXDATA vdb;           // vertex color blue data
  579.   } POLYGON2D;
  580.   typedef POLYGON2D *PPOLYGON2D;
  581.  
  582.   //
  583.   // POLYGON3D
  584.   //
  585.   typedef struct _POLYGON3D
  586.   {
  587.      ULONG      cVertex;       // number of vertices
  588.      ULONG      ulTessType;    // tessellation type, see below
  589.      ULONG      ulVertexMask;  // see below
  590.      VERTEXDATA vdx;           // vertex x coordinate data
  591.      VERTEXDATA vdy;           // vertex y coordinate data
  592.      VERTEXDATA vdz;           // vertex z coordinate data
  593.      VERTEXDATA vdw;           // vertex w data
  594.      VERTEXDATA vda;           // vertex color alpha data
  595.      VERTEXDATA vdr;           // vertex color red data
  596.      VERTEXDATA vdg;           // vertex color green data
  597.      VERTEXDATA vdb;           // vertex color blue data
  598.      VERTEXDATA vddx;          // vertex normal vector dx data
  599.      VERTEXDATA vddy;          // vertex normal vector dy data
  600.      VERTEXDATA vddz;          // vertex normal vector dz data
  601.      VERTEXDATA vddw;          // vertex normal vector dw data
  602.      VERTEXDATA vdtx;          // vertex texture x coordinate data
  603.      VERTEXDATA vdty;          // vertex texture y coordinate data
  604.      VERTEXDATA vdtz;          // vertex texture z coordinate data
  605.      VERTEXDATA vdtw;          // vertex texture w coordinate data
  606.   } POLYGON3D;
  607.   typedef POLYGON3D *PPOLYGON3D;
  608.  
  609.   //
  610.   // ulTessType for  POLYGON2D and POLYGON3D
  611.   //
  612.   #define POLYGON_GENERAL        0x01 // convex or concave polygon of 
  613.                                       // any cVertex sides.
  614.  
  615.   #define POLYGON_TRIANGLE       0x02 // series of triangles using vertices
  616.                                       // v1,v2,v3 then
  617.                                       // v4,v5,v6 and so on.
  618.                                       // cVertex should be of minimum 3
  619.                                       // if cVertex isn't an exact multiple of 3,
  620.                                       // the final one or two vertices are ignored
  621.  
  622.   #define POLYGON_TRIANGLE_STRIP 0x03 // series of triangles using vertices
  623.                                       // v1,v2,v3 then
  624.                                       // v3,v2,v4(note the order), then
  625.                                       // v3,v4,v5 and so on.
  626.                                       // the ordering is to ensure that the
  627.                                       // triangles are all drawn with
  628.                                       // same orientation so that the strip
  629.                                       // can correctly form part of a surface.
  630.                                       // cVertex should be of minimum 3
  631.  
  632.  
  633.   #define POLYGON_TRIANGLE_FAN   0x04 // first vertex (v1) is center of fan.
  634.                                       // series of triangles using vertices
  635.                                       // v1,v2,v3 then
  636.                                       // v1,v3,v4 then
  637.                                       // v1,v4,v5 and so on.
  638.                                       // the ordering is to ensure that the
  639.                                       // triangles are all drawn with
  640.                                       // same orientation so that the fan
  641.                                       // can correctly form part of a surface.
  642.                                       // cVertex should be of minimum 3
  643.  
  644.   #define POLYGON_QUAD           0x05 // series of quadrilaterals using vertices
  645.                                       // v1,v2,v3,v4 then
  646.                                       // v5,v6,v7,v8 and so on.
  647.                                       // cVertex should be of minimum 4
  648.                                       // if cVertex isn't an exact multiple of 4,
  649.                                       // the final one, two or three vertices are ignored
  650.                                       // Note: Quads may be concave or bow-tie.
  651.  
  652.   #define POLYGON_QUAD_STRIP     0x06 // series of quadrilaterals using vertices
  653.                                       // v1,v2,v4,v3 then
  654.                                       // v3,v4,v6,v5 then
  655.                                       // v5,v6,v8,v7 and so on.
  656.                                       // the ordering is to ensure that the
  657.                                       // quadrilaterals are all drawn with
  658.                                       // same orientation so that the strip
  659.                                       // can correctly form part of a surface
  660.                                       // cVertex should be of minimum 4.
  661.                                       // if cVertex isn't even, the final vertex is ignored.
  662.                                       // Note: Quads may be concave or bow-tie.
  663.  
  664.  
  665.  
  666.  
  667.   // ulVertexMask for POLYGON2D and POLYGON3D
  668.   // VERTEXDATAs in POLYGON2D/3D contain valid data,
  669.   // if ulVertexMask has the corresponding VERTEX_HAS_* bit set.
  670.   //
  671.   #define VERTEX_HAS_X     0x0001
  672.   #define VERTEX_HAS_Y     0x0002
  673.   #define VERTEX_HAS_Z     0x0004
  674.   #define VERTEX_HAS_W     0x0008
  675.   #define VERTEX_HAS_A     0x0010
  676.   #define VERTEX_HAS_R     0x0020
  677.   #define VERTEX_HAS_G     0x0040
  678.   #define VERTEX_HAS_B     0x0080
  679.   #define VERTEX_HAS_DX    0x0100
  680.   #define VERTEX_HAS_DY    0x0200
  681.   #define VERTEX_HAS_DZ    0x0400
  682.   #define VERTEX_HAS_DW    0x0800
  683.   #define VERTEX_HAS_TX    0x1000
  684.   #define VERTEX_HAS_TY    0x2000
  685.   #define VERTEX_HAS_TZ    0x4000
  686.   #define VERTEX_HAS_TW    0x8000
  687.  
  688.   //
  689.   // POLYSINFO
  690.   //
  691.   typedef struct _POLYSINFO
  692.   {
  693.      ULONG cPolys;                 // number of polys
  694.      ULONG ulPolyType;             // POLYGON_2D or POLYGON_3D
  695.      union
  696.      {
  697.         PPOLYGON2D abPolygon2d;    // array of polygon2ds
  698.         PPOLYGON3D abPolygon3d;    // array of polygon3ds
  699.      };
  700.   } POLYSINFO;
  701.   typedef POLYSINFO *PPOLYSINFO;
  702.  
  703.   //
  704.   // ulPolyType for POLYSINFO
  705.   //
  706.   #define POLYGON_2D  0x01
  707.   #define POLYGON_3D  0x02
  708.  
  709.   //
  710.   // POLYGONINFO
  711.   //
  712.   typedef struct _POLYGONINFO
  713.   {
  714.      ULONG        ulLength;
  715.      ULONG        ulBltFlags;
  716.      ULONG        cBlits;          // number of bltrects in abrDst
  717.      ULONG        ulROP;
  718.      ULONG        ulMonoBackROP;
  719.      ULONG        ulSrcFGColor;
  720.      ULONG        ulSrcBGColor;
  721.      ULONG        ulPatFGColor;
  722.      ULONG        ulPatBGColor;
  723.      PBYTE        abColors;
  724.      PPOLYSINFO   pPolysInfo;      // polys info
  725.      PBMAPINFO    pDstBmapInfo;
  726.      PBMAPINFO    pPatBmapInfo;
  727.      PPOINTL      pptlBounds;     // minimum and maximum points
  728.      PPOINTL      aptlPatOrg;
  729.      PBLTRECT     abrDst;
  730.      PVOID        pvReserved1;
  731.      PVOID        pvReserved2;
  732.   } POLYGONINFO;
  733.   typedef POLYGONINFO *PPOLYGONINFO;
  734.  
  735.   //
  736.   // softdraw function pointer defintion
  737.   //
  738.   typedef APIRET (APIENTRY SDFN) (PVOID, PVOID);
  739.   typedef SDFN *PSDFN;
  740.  
  741.  
  742.   //
  743.   // SDCALLBACK
  744.   //
  745.   typedef struct _SDCALLBACK     // softdraw call back for SDPOLYGON
  746.   {
  747.      PSDFN        psdfnCallBack;
  748.      PVOID        pOutput;
  749.   } SDCALLBACK;
  750.   typedef SDCALLBACK *PSDCALLBACK;
  751.  
  752.  
  753.   /*
  754.   **  Defines and structures for the TextBlt
  755.   */
  756.   typedef struct _GLYPHINFO {                  /* glphyinfo */
  757.           char      bAspace;
  758.           char      bBspace;
  759.           char      bCspace;
  760.           char      bPad;
  761.           BMAPINFO  bmapinfo;
  762.   } GLYPHINFO;                                /* glyphinfo */
  763.   typedef GLYPHINFO *PGLYPHINFO;              /* pglyphinfo */
  764.  
  765.  
  766.   typedef struct _GLBTBL {                     /* glbtbl */
  767.           PGLYPHINFO          pGlyphInfo[1];   // Up to 256 entries per table
  768.   } GLBTBL;
  769.   typedef GLBTBL *PGLBTBL;
  770.  
  771.   typedef struct _GHBTBL {                     /* ghbtbl */
  772.           PGLBTBL             pglbTbl[1];      // Up to 256 entries per table
  773.   } GHBTBL;
  774.   typedef GHBTBL *PGHBTBL;
  775.  
  776.   // A subset of FontInfo ( pmddi.h ) for TextBlt
  777.   typedef struct _DEVFONTINFO {                      /* dfi */
  778.           ULONG                  ulFntCnt;           // Maximum glyphs contained in this font.
  779.           ULONG                  fFontInfo;          // Flags
  780.           ULONG                  ulEngTag;           // Renderer Tag - i.e. 'GRE'
  781.           ULONG                  ulUniqueFntID;
  782.           ULONG                  ulMaxHeight;
  783.           ULONG                  ulMaxWidth;
  784.           PGHBTBL                pghbTbl;
  785.           ULONG                  ulHalfWidth;
  786.           CHAR                   szGlyphlist[16];
  787.           ULONG                  ulReserved1;
  788.           ULONG                  ulReserved2;
  789.   } DEVFONTINFO;
  790.   typedef DEVFONTINFO *PDEVFONTINFO;
  791.  
  792.   #define  GRETAG     ('G' + ('R'<<8) + ('E'<<16) + ('_'<<24))    // "GRE_"
  793.   #define  WINTAG     ('W' + ('I'<<8) + ('N'<<16) + ('_'<<24))    // "WIN_"
  794.  
  795.   #define  DFI_FIXED_FONT        0x00000001
  796.   #define  DFI_DBCS_FONT         0x00000002
  797.  
  798.   typedef struct _TEXTBLTINFO {                /* tbi */
  799.           ULONG               ulLength;
  800.           ULONG               flOptions;
  801.           ULONG               lGlyphCnt;
  802.           PLONG               pGlyphIndices;
  803.           ULONG               ulFGMix;
  804.           ULONG               ulBGMix;
  805.           ULONG               ulFGColor;
  806.           ULONG               ulBGColor;
  807.           PBMAPINFO           pDstBmapInfo;
  808.           PDEVFONTINFO        pDevFntInfo;
  809.           ULONG               ulClpCnt;        // Non Clipping Drivers Ignore
  810.           PBLTRECT            abrClipRects;    // Non Clipping Drivers Ignore
  811.           PPOINTL             aptlSrcOrg;      // Clipping Drivers Ignore
  812.           PBLTRECT            abrDst;          // Clipping Drivers Ignore .ulXExt & ulYExt
  813.   } TEXTBLTINFO;
  814.   typedef TEXTBLTINFO *PTEXTBLTINFO;
  815.  
  816.  
  817.   /*
  818.   **  Defines and structures for the GHI_CMD_PALETTE
  819.   */
  820.   typedef struct _HWPALETTEINFO { /* hwpaletteinfo */
  821.      ULONG  ulLength;
  822.      ULONG  fFlags;               /* Get/Set palette                      */
  823.      ULONG  ulStartIndex;         /*                                      */
  824.      ULONG  ulNumEntries;         /*                                      */
  825.      PRGB2  pRGBs;                /*                                      */
  826.   } HWPALETTEINFO;
  827.   typedef HWPALETTEINFO *PHWPALETTEINFO;
  828.  
  829.   #define PALETTE_GET             0x0001
  830.   #define PALETTE_SET             0x0002
  831.  
  832.   /*
  833.   **  Defines and structures for the GHI_CMD_MOVEPTR DDI
  834.   */
  835.   typedef struct _HWMOVEPTRIN {     /* hwmoveptrin */
  836.      ULONG  ulLength;
  837.      POINTL ptlPos;
  838.   } HWMOVEPTRIN;
  839.   typedef HWMOVEPTRIN *PHWMOVEPTRIN;
  840.  
  841.  
  842.   /*
  843.   **  Defines and structures for the GHI_CMD_SETPTR DDI
  844.   */
  845.   typedef struct _HWSETPTRIN {      /* hwsetptrin */
  846.      ULONG  ulLength;
  847.      PBYTE  pbANDMask;
  848.      PBYTE  pbXORMask;
  849.      PBYTE  pbBits;
  850.      ULONG  ulBpp;
  851.      ULONG  ulWidth;
  852.      ULONG  ulHeight;
  853.      POINTL ptlHotspot;
  854.   } HWSETPTRIN;
  855.   typedef HWSETPTRIN *PHWSETPTRIN;
  856.  
  857.   typedef struct _HWSETPTROUT {      /* hwsetptrout */
  858.      ULONG ulLength;
  859.      ULONG ulStatus;
  860.   } HWSETPTROUT;
  861.   typedef HWSETPTROUT *PHWSETPTROUT;
  862.  
  863.   /*
  864.   ** Defines for the ulStatus field of the HWSETPTROUT structure
  865.   */
  866.   #define POINTER_VISIBLE       0x0001
  867.   #define POINTER_COLOR         0x0002
  868.  
  869.   /*
  870.   ** This flag is set by the GRADD if the pointer just set in
  871.   ** via the GHI_CMD_SETPTR command is not a hardware sprite.
  872.   ** VMAN uses this flag to determine whether it must remove
  873.   ** the pointer on drawing operations that overlap the pointer.
  874.   */
  875.   #define POINTER_SOFTWARE      0x0004
  876.  
  877.   /*
  878.   ** This flag is set by the GRADD if the pointer just set in
  879.   ** via the GHI_CMD_SETPTR command does not require serialization
  880.   ** with the normal drawing operations.  This flag will typically
  881.   ** be set if GRADD is using a hardware sprite, since moving
  882.   ** a sprite often only requires changing registers which do not
  883.   ** effect the drawing engine. When this flag is set, pointer
  884.   ** movement performance is drastically improved.
  885.   */
  886.   #define POINTER_FAST          0x0008
  887.  
  888.   /*
  889.   **  Defines and structures for the GHI_CMD_SHOWPTR DDI
  890.   */
  891.  
  892.   typedef struct _HWSHOWPTRIN {     /* hwshowptrin */
  893.      ULONG ulLength;
  894.      BOOL  fShow;
  895.   } HWSHOWPTRIN;
  896.   typedef HWSHOWPTRIN *PHWSHOWPTRIN;
  897.  
  898.   /*
  899.   **  Defines and structures for the GHI_CMD_REQUESTHW command
  900.   */
  901.   /*
  902.   ** Defines for the ulFlags field of HWREQIN
  903.   */
  904.   #define REQUEST_HW               0x1
  905.   #define REQUEST_SEM_ONLY         0x2
  906.  
  907.   typedef struct _HWREQIN {        /* hwreqin */
  908.      ULONG  ulLength;
  909.      ULONG  ulFlags;
  910.      ULONG  cScrChangeRects;
  911.      PRECTL arectlScreen;
  912.   } HWREQIN;
  913.   typedef HWREQIN *PHWREQIN;
  914.  
  915.  
  916.   /*
  917.   **  Defines and structures for the GHI_CMD_BANK command
  918.   */
  919.   typedef struct _HWBANKIN {       /* hwbankin  */
  920.      ULONG  ulLength;
  921.      ULONG  ulFlags;               /* Get/Set bank */
  922.      ULONG  ulBank;                /* Bank number  */
  923.   } HWBANKIN;
  924.   typedef HWBANKIN *PHWBANKIN;
  925.  
  926.   /*
  927.   **  Defines for the ulFlags field of the HWBANKIN data structure.
  928.   */
  929.   #define BANK_SET                     1
  930.   #define BANK_GET                     2
  931.  
  932.   typedef struct _HWBANKOUT {      /* hwbankout */
  933.      ULONG  ulLength;
  934.      ULONG  ulBank;                /* Bank number  */
  935.   } HWBANKOUT;
  936.   typedef HWBANKOUT *PHWBANKOUT;
  937.  
  938. /* NOINC */
  939. #endif /* DDI_INCLUDED */
  940. /* INC */
  941.  
  942.