home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / warphead.zip / H / DDI.H < prev    next >
Text File  |  1997-04-10  |  30KB  |  928 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. #ifdef INCL_VMANDDI
  50.  
  51. /* NOINC */
  52. #ifndef VMANDDI_INCLUDED
  53.  
  54. /* INC */
  55.   #define VMANDDI_INCLUDED
  56.  
  57.   /*
  58.   **  Prototype declarations for low level driver function call table.
  59.   */
  60.  
  61.   typedef ULONG CID;             /* Chain ID */
  62.   typedef ULONG GID;             /* Gradd ID */
  63.  
  64.   typedef ULONG  (EXPENTRY FNHWCMD)(PVOID, PVOID);
  65.   typedef ULONG  (EXPENTRY FNHWIOPL)(FNHWCMD *, PVOID, PVOID);
  66.   typedef ULONG  (EXPENTRY FNHWENTRY)(GID, ULONG, PVOID, PVOID);
  67.   typedef ULONG  (EXPENTRY FNSDBITBLT)(PVOID, PVOID);
  68.   typedef ULONG  (EXPENTRY FNSDLINE)(PVOID, PVOID);
  69.   typedef ULONG  (EXPENTRY FNVDDENTRY)(ULONG, PVOID, PVOID);
  70.  
  71.   typedef FNHWENTRY *  PFNHWENTRY;
  72.  
  73.   typedef struct _GDDMODEINFO {     /* gddmodeinfo */
  74.      ULONG  ulLength;
  75.      ULONG  ulModeId;               /* used to make SETMODE request     */
  76.      ULONG  ulBpp;                  /* no of colors (bpp)               */
  77.      ULONG  ulHorizResolution;      /* horizontal pels                  */
  78.      ULONG  ulVertResolution;       /* vertical scan lines              */
  79.      ULONG  ulRefreshRate;          /* in Hz (0 if not available)       */
  80.      PBYTE  pbVRAMPhys;             /* physical address of VRAM         */
  81.      ULONG  ulApertureSize;         /* size of VRAM in bytes            */
  82.      ULONG  ulScanLineSize;         /* size (in bytes) of one scan line */
  83.   } GDDMODEINFO;
  84.   typedef GDDMODEINFO *PGDDMODEINFO;
  85.  
  86.  
  87.  
  88.   /*
  89.   **  Structure for HWEntry router, see gdddata.c for array.
  90.   */
  91.  
  92.   typedef struct _HWCMD {           /* hwcmd */
  93.           FNHWCMD         *pfnHWCmd;
  94.           ULONG           ulRc;
  95.   } HWCMD;
  96.   typedef HWCMD *PHWCMD;
  97.  
  98.   /*
  99.   **  Possible return codes from the individual DDI's
  100.   */
  101.   #define RC_SUCCESS              0
  102.   #define RC_SIMULATE             1
  103.   #define RC_UNSUPPORTED          2
  104.   #define RC_ERROR                3
  105.  
  106.  
  107.   /*
  108.   ** Place holder for data fields which don't apply
  109.   */
  110.   #define DONTCARE                0
  111.  
  112.   /*
  113.   **  Prototype declarations for low level driver routines
  114.   */
  115.  
  116.   FNHWIOPL  HWCallIOPL;
  117.   FNHWENTRY HWEntry;
  118.  
  119.   /*
  120.   **  Graphics Hardware Interface (GHI) commands
  121.   */
  122.   #define GHI_CMD_INIT           0
  123.   #define GHI_CMD_INITPROC       1
  124.   #define GHI_CMD_TERM           2
  125.   #define GHI_CMD_TERMPROC       3
  126.   #define GHI_CMD_QUERYCAPS      4
  127.   #define GHI_CMD_QUERYMODES     5
  128.   #define GHI_CMD_SETMODE        6
  129.   #define GHI_CMD_PALETTE        7
  130.   #define GHI_CMD_BITBLT         8
  131.   #define GHI_CMD_LINE           9
  132.   #define GHI_CMD_MOVEPTR        10
  133.   #define GHI_CMD_SETPTR         11
  134.   #define GHI_CMD_SHOWPTR        12
  135.   #define GHI_CMD_VRAMALLOC      13
  136.   #define GHI_CMD_REQUESTHW      14
  137.   #define GHI_CMD_RESERVED       15
  138.   #define GHI_CMD_EXTENSION      16
  139.   #define GHI_CMD_MAX            17
  140.  
  141.   /*
  142.   **  Defines and structures for the GHI_CMD_INIT DDI
  143.   */
  144.  
  145.   typedef struct _GDDINITIN {         /* gddinitin */
  146.      ULONG        ulLength;
  147.      PFNHWENTRY   pfnChainedHWEntry;
  148.   } GDDINITIN;
  149.   typedef GDDINITIN  *PGDDINITIN;
  150.  
  151.   typedef struct _GDDINITOUT {        /* gddinitout */
  152.      ULONG        ulLength;
  153.      ULONG        cFunctionClasses;
  154.   } GDDINITOUT;
  155.   typedef GDDINITOUT  *PGDDINITOUT;
  156.  
  157.   /*
  158.   **  Defines and structures for the GHI_CMD_INITPROC DDI
  159.   */
  160.  
  161.   typedef struct _INITPROCOUT {         /* initprocout */
  162.      ULONG        ulLength;
  163.      ULONG        ulVRAMVirt;
  164.   } INITPROCOUT;
  165.   typedef INITPROCOUT  *PINITPROCOUT;
  166.  
  167.   /*
  168.   **  Defines and structures for the GHI_CMD_QUERYCAPS DDI
  169.   */
  170.  
  171.   typedef struct _CAPSINFO {          /* capsinfo */
  172.      ULONG        ulLength;           /* sizeof CAPSINFO structure      */
  173.      PSZ          pszFunctionClassID; /* Name describing function set   */
  174.      PVOID        pCaps;              /* Function set specific caps     */
  175.   } CAPSINFO;
  176.   typedef CAPSINFO  *PCAPSINFO;
  177.  
  178.   typedef struct _BASECAPS {          /* basecaps */
  179.      ULONG        ulLength;           /* sizeof BASECAPS structure      */
  180.      ULONG        ulHWFlags;          /* Base caps flags                */
  181.   } BASECAPS;
  182.   typedef BASECAPS  *PBASECAPS;
  183.  
  184.   /*
  185.   ** Flag definitions for the ulHWFlags field of BASECAPS
  186.   ** data structure.
  187.   */
  188.  
  189.   /*
  190.   ** Setting this bit ON allows VRAM access to be shared between
  191.   ** the GRADD and SOFTDRAW WITHOUT semaphore protection.  If the
  192.   ** graphics coprocessor allows direct writing to VRAM while it
  193.   ** is busy, you should set this bit because performance will be improved.
  194.   */
  195.   #define HWF_SHARE_VRAM_ACCESS         0x0001
  196.  
  197.   /*
  198.   ** Set this bit if no linear frame buffer is available.
  199.   */
  200.   #define HWF_NOFRAMEBUFFER             0x0002
  201.  
  202.   /*
  203.   ** Set this bit if your GRADD needs to see bitblts which do not
  204.   ** involve VRAM.
  205.   */
  206.   #define HWF_SEND_MEM_TO_MEM           0x0004
  207.  
  208.   /*
  209.   ** Set this bit if your GRADD needs bank switching.
  210.   */
  211.   #define HWF_BANK_DEVICE               0x0008
  212.  
  213.  
  214.   /*
  215.   **  Defines and structures for the GHI_CMD_QUERYMODES and GHI_CMD_SETMODE
  216.   */
  217.  
  218.   typedef struct _GDDMODERETURN {   /* gddmodereturn */
  219.      ULONG  ulLength;
  220.      PBYTE  pbVRAMVirt;
  221.      PBYTE  pbVRAMPhys;
  222.      ULONG  ulApertureSize;
  223.      ULONG  ulScanLineSize;
  224.      ULONG  ulBankSize;
  225.   } GDDMODERETURN;
  226.   typedef GDDMODERETURN *PGDDMODERETURN;
  227.  
  228.   #define QUERYMODE_NUM_MODES     0x0001
  229.   #define QUERYMODE_MODE_DATA     0x0002
  230.   #define QUERYMODE_VALID         (QUERYMODE_NUM_MODES|QUERYMODE_MODE_DATA)
  231.  
  232.   /*
  233.   **  Defines and structures for the GHI_CMD_BITBLT DDI
  234.   */
  235.  
  236.   typedef struct _BMAPINFO {        /* bmapinfo */
  237.      ULONG  ulLength;
  238.      ULONG  ulType;
  239.      ULONG  ulWidth;
  240.      ULONG  ulHeight;
  241.      ULONG  ulBpp;
  242.      ULONG  ulBytesPerLine;
  243.      PBYTE  pBits;
  244.   } BMAPINFO;
  245.   typedef BMAPINFO  *PBMAPINFO;
  246.  
  247.   typedef struct _BLTRECT {         /* bltrect */
  248.      ULONG  ulXOrg;
  249.      ULONG  ulYOrg;
  250.      ULONG  ulXExt;
  251.      ULONG  ulYExt;
  252.   } BLTRECT;
  253.   typedef BLTRECT  *PBLTRECT;
  254.  
  255.   /*
  256.   **  Defines for the ulType field of the BMAPINFO data structure
  257.   */
  258.  
  259.   #define BMAP_VRAM            0x00000000
  260.   #define BMAP_MEMORY          0x00000001
  261.  
  262.   /*********************************************************************************/
  263.  
  264.   #define BMAP_BANKED          0x00000010
  265.  
  266.   /* Bank info passed to SD from GRE2VMAN       */
  267.   /* Passed in Overloaded 2nd function param    */
  268.  
  269.   #define TYPE_GRDBNKINFO     0x00000001
  270.   #define TYPE_CMYKINFO       0x00000002
  271.  
  272.   typedef struct _GRDBNKINFO {       /* gbi */
  273.      ULONG ulLength;                 /* denotes length of ver. x                   */
  274.      ULONG ulType;                   /* 2nd parameter structure type               */
  275.      ULONG ulAperature;              /* Aperature Size for banked devices          */
  276.      ULONG ulGID;                    /* Graphics Adapter ID used by VMAN           */
  277.      ULONG ulReserved[2];            /* System Reserved ulongs                     */
  278.      PFN   pfnBankSwitch;            /* Function Pointer to Bank Switching Routine */
  279.      PVOID pvReserved;               /* System Reserved Pointer                    */
  280.   }  GRDBNKINFO;
  281.   typedef GRDBNKINFO *PGRDBNKINFO;
  282.  
  283.   /*********************************************************************************/
  284.  
  285.   #define CMYK_DEVICE          0x00000002
  286.   #define CMY_ONLY             0x00000004
  287.   #define CMYK_INTERLEAVE      0x00000008
  288.  
  289.   #define BMAP_VERTICAL_SCAN   0x10000000
  290.   #define BMAP_FOCAFONT        0x20000000
  291.  
  292.   typedef struct _BITBLTINFO {      /* bitbltinfo */
  293.      ULONG        ulLength;
  294.      ULONG        ulBltFlags;
  295.      ULONG        cBlits;
  296.      ULONG        ulROP;
  297.      ULONG        ulMonoBackROP;
  298.      ULONG        ulSrcFGColor;
  299.      ULONG        ulSrcBGColor;
  300.      ULONG        ulPatFGColor;
  301.      ULONG        ulPatBGColor;
  302.      PBYTE        abColors;
  303.      PBMAPINFO    pSrcBmapInfo;
  304.      PBMAPINFO    pDstBmapInfo;
  305.      PBMAPINFO    pPatBmapInfo;
  306.      PPOINTL      aptlSrcOrg;
  307.      PPOINTL      aptlPatOrg;
  308.      PBLTRECT     abrDst;
  309.      PRECTL       prclSrcBounds;    /* incl/excl bounds. */
  310.      PRECTL       prclDstBounds;    /* incl/excl bounds. */
  311.   } BITBLTINFO;
  312.   typedef BITBLTINFO *PBITBLTINFO;
  313.  
  314.   /*
  315.   ** Defines for ulBltFlags field of the BITBLTINFO data structure
  316.   **
  317.   ** The default state of the flags are as follows:
  318.   **
  319.   ** DIRECTION      = Left to right - top to bottom
  320.   ** TRANSPARENCY   = NONE
  321.   ** PATTERN STYLE  = UNKNOWN
  322.   ** BACKGROUND ROP = INVALID
  323.   */
  324.  
  325.   #define BF_DEFAULT_STATE          0x00000000  // blt dir X and Y positive.
  326.  
  327.   #define BF_DIR_X_NEGATIVE         0x00000001
  328.   #define BF_DIR_RIGHT_LEFT         BF_DIR_X_NEGATIVE
  329.  
  330.   #define BF_DIR_Y_NEGATIVE         0x00000002
  331.   #define BF_DIR_BOTTOM_TOP         BF_DIR_Y_NEGATIVE
  332.  
  333.   #define BF_ROP_INCL_SRC           0x00000004
  334.   #define BF_ROP_INCL_PAT           0x00000008
  335.  
  336.   #define BF_SRC_TRANSPARENT        0x00000010
  337.   #define BF_DST_TRANSPARENT        0x00000020
  338.   #define BF_PAT_TRANSPARENT        0x00000040
  339.  
  340.   #define BF_PAT_SOLID              0x00000080
  341.   #define BF_PAT_HOLLOW             0x00000100
  342.  
  343.   #define BF_APPLY_BACK_ROP         0x00000200
  344.  
  345.   #define BF_SRC_MONOINVERT         0x00000400
  346.   #define BF_PAT_MONOINVERT         0x00000800
  347.   #define BF_DST_MONOINVERT         0x00020000
  348.  
  349.   #define BF_SRC_BITS_EXTERNAL      0x00001000
  350.  
  351.   #define BF_LAST_BLT               0x00002000
  352.   #define BF_SRC_Y_FLIP             0x00004000
  353.  
  354.   #define BF_SRC_X_FLIP             0x00008000
  355.   #define BF_SRC_VERTICAL_SCAN      0x00010000
  356.  
  357.   /*
  358.   **  Defines and structures for the GHI_CMD_LINE DDI
  359.   */
  360.  
  361.   typedef struct _LINEPACK {           /* linepack */
  362.      ULONG            ulStyleStep;
  363.      ULONG            ulStyleValue;
  364.      ULONG            ulFlags;
  365.      struct _LINEPACK * plpkNext;
  366.      ULONG            ulAbsDeltaX;
  367.      ULONG            ulAbsDeltaY;
  368.      POINTL           ptlClipStart;
  369.      POINTL           ptlClipEnd;
  370.      POINTL           ptlStart;
  371.      POINTL           ptlEnd;
  372.      LONG             lClipStartError; /* Bresenham error at the clip start.*/
  373.                                        /* not valid for horizontal or       */
  374.                                        /* vertical lines.                   */
  375.   } LINEPACK;    /* lpk */
  376.   typedef LINEPACK  *PLINEPACK;   /* plpk */
  377.  
  378.  
  379.   /*
  380.   **  Defines for the ulFlags field of the LINEPACK data structure
  381.   */
  382.   #define LINE_DO_FIRST_PEL      0x00000002
  383.   #define LINE_DIR_Y_POSITIVE    0x00000004
  384.   #define LINE_HORIZONTAL        0x00000008
  385.   #define LINE_X_MAJOR           0x00000010
  386.   #define LINE_DIR_X_POSITIVE    0x00000020
  387.   #define LINE_VERTICAL          0x00001000
  388.   #define LINE_STYLE_X_MAJOR     0x00002000
  389.   #define LINE_DO_LAST_PEL       0x00004000
  390.   #define LINE_MONO_INVERT       0x00008000  /* need to set for the first  */
  391.                                              /* line only, if required.         */
  392.  
  393.   /*  Line drawing
  394.   **
  395.   **    The line starts from ptlStart and ends at ptlEnd(inclusive).
  396.   **    The device can do the Bresenham either from ptlStart or
  397.   **    from the ptlClipStart using the lClipStartError and
  398.   **    will only set the pels from ptlClipStart to ptlClipEnd(inclusive).
  399.   **
  400.   **  ulAbsDeltaX :
  401.   **    absolute (ptlStart.x - ptlEnd.x)
  402.   **
  403.   **  ulAbsDeltaY :
  404.   **    absolute (ptlStart.y - ptlEnd.y)
  405.   **
  406.   **  lClipStartError:
  407.   **
  408.   **    This is the standard Bresenham error at the clipped start point.
  409.   **    This is calculated from the initial error at the start point and
  410.   **    the error increments for major step and diagonal step.
  411.   **
  412.   **    The initial error and the error increments are:
  413.   **
  414.   **    MAX           = maximum (ulAbsDeltaX, ulAbsDeltaY)
  415.   **    MIN           = minimum (ulAbsDeltaX, ulAbsDeltaY)
  416.   **    Major Inc.    = Increment to the error for
  417.   **                    stepping along the major axis.
  418.   **                  = 2 * MIN
  419.   **    Diagonal Inc. = Increment to the error for
  420.   **                    stepping along the major and minor axis.
  421.   **                  = 2 * MIN - 2 * MAX
  422.   **    Initial error = Error at the start point.
  423.   **                  = 2 * MIN - MAX  if LINE_DIR_X_POSITIVE is on
  424.   **                  = 2 * MIN - MAX - 1 if LINE_DIR_X_POSITIVE is off.
  425.   **
  426.   **   Horizontal and vertical lines.
  427.   **      The line is drawn from the clipped start to clipped end.
  428.   **      The lClipStartError will not be given.
  429.   **
  430.   **   First pel consideration.
  431.   **      Set the the first pel at the ptlStart (not ptlClipStart) only
  432.   **      if LINE_DO_FIRST_PEL is set and the first pel is not clipped out.
  433.   **
  434.   **   Last pel consideration.
  435.   **      Set the the last pel at the ptlEnd (not ptlClipEnd) only
  436.   **      if LINE_DO_LAST_PEL is set and the last pel is not clipped out.
  437.   **
  438.   **
  439.   **   Styling.
  440.   **      Lines are styled using the ulStyleMask, ulStyleStep and ulStyleValue.
  441.   **
  442.   **      ulStyleMask:
  443.   **         A 32 bit style mask.
  444.   **
  445.   **      ulStyleStep:
  446.   **         The value to be added to ulStyleValue
  447.   **         on each pel stepped along the style major direction.
  448.   **
  449.   **      ulStyleValue:
  450.   **         The style value at the current pel.
  451.   **         it is composed of an error value and a mask position as :
  452.   **
  453.   **         ┌────────────────────────────────────────────────────┐
  454.   **         │    high word   │  3 bits  │  5 bits  │   8 bits    │
  455.   **         └────────────────────────────────────────────────────┘
  456.   **         │    not used    │ not used │ mask pos │ error value │
  457.   **
  458.   **      Error Value :
  459.   **         Error value at the current pel.
  460.   **
  461.   **      Mask Position :
  462.   **         Bit position of the ulStyleMask.
  463.   **         if this bit is on,
  464.   **            set the current pel to the ulFGColor through usForeROP,
  465.   **         otherwise
  466.   **            set the current pel to the ulBGColor through usBackRop
  467.   **
  468.   */
  469.  
  470.   typedef struct _LINEINFO {        /* linfo */
  471.      ULONG          ulLength;
  472.      ULONG          ulType;
  473.      ULONG          ulStyleMask;
  474.      ULONG          cLines;
  475.      ULONG          ulFGColor;
  476.      ULONG          ulBGColor;
  477.      USHORT         usForeROP;
  478.      USHORT         usBackROP;
  479.      PBMAPINFO      pDstBmapInfo;
  480.      PLINEPACK      alpkLinePack;
  481.      PRECTL         prclBounds;     /* incl/incl bounds. */
  482.   } LINEINFO;      /* linfo */
  483.   typedef  LINEINFO *PLINEINFO;     /* plinfo */
  484.  
  485.  
  486.   /*
  487.   **  Defines for the ulType field of the LINEINFO data structure
  488.   */
  489.   #define LINE_SOLID       0x01
  490.   #define LINE_INVISIBLE   0x02
  491.   #define LINE_ALTERNATE   0x03
  492.  
  493.  
  494.   /*
  495.   ** Defines for 2 way Line ROPS
  496.   */
  497.                                     /* PATTERN = 0xC and DEST = 0xA */
  498.   #define LR_ZERO               0   /* 0x0                          */
  499.   #define LR_INVERTMERGEPAT     1   /* ~(LR_DEST | LR_PATTERN)      */
  500.   #define LR_MASKINVERTPAT      2   /* (~LR_PATTERN) & LR_DEST      */
  501.   #define LR_INVERTCOPYPAT      3   /* ~LR_PATTERN                  */
  502.   #define LR_MASKPATINVERT      4   /* (~LR_DEST) & LR_PATTERN      */
  503.   #define LR_INVERT             5   /* ~LR_DEST                     */
  504.   #define LR_XORPAT             6   /* LR_DEST ^ LR_PATTERN         */
  505.   #define LR_INVERTMASKPAT      7   /* ~(LR_DEST & LR_PATTERN)      */
  506.   #define LR_MASKPAT            8   /* LR_DEST & LR_PATTERN         */
  507.   #define LR_INVERTXORPAT       9   /* ~(LR_DEST ^ LR_PATTERN)      */
  508.   #define LR_LEAVEALONE        10   /* LR_DEST                      */
  509.   #define LR_MERGEINVERTPAT    11   /* (~LR_PATTERN) | LR_DEST      */
  510.   #define LR_PATCOPY           12   /* LR_PATTERN                   */
  511.   #define LR_MERGEPATINVERT    13   /* (~LR_DEST) | LR_PATTERN      */
  512.   #define LR_MERGEPAT          14   /* LR_PATTERN | LR_DEST         */
  513.   #define LR_ONE               15   /* 0x0F                         */
  514.  
  515.   /*
  516.   **  Defines and structures for the TextBlt
  517.   */
  518.  
  519.   typedef struct _GLYPHINFO {                  /* glphyinfo */
  520.           char      bAspace;
  521.           char      bBspace;
  522.           char      bCspace;
  523.           char      bPad;
  524.           BMAPINFO  bmapinfo;
  525.   } GLYPHINFO;                                /* glyphinfo */
  526.   typedef GLYPHINFO *PGLYPHINFO;              /* pglyphinfo */
  527.  
  528.  
  529.   typedef struct _GLBTBL {                     /* glbtbl */
  530.           PGLYPHINFO          pGlyphInfo[1];   // Up to 256 entries per table
  531.   } GLBTBL;
  532.   typedef GLBTBL *PGLBTBL;
  533.  
  534.   typedef struct _GHBTBL {                     /* ghbtbl */
  535.           PGLBTBL             pglbTbl[1];      // Up to 256 entries per table
  536.   } GHBTBL;
  537.   typedef GHBTBL *PGHBTBL;
  538.  
  539.   // A subset of FontInfo ( pmddi.h ) for TextBlt
  540.   typedef struct _DEVFONTINFO {                      /* dfi */
  541.           ULONG                  ulFntCnt;           // Maximum glyphs contained in this font.
  542.           ULONG                  fFontInfo;          // Flags
  543.           ULONG                  ulEngTag;           // Renderer Tag - i.e. 'GRE'
  544.           ULONG                  ulUniqueFntID;
  545.           ULONG                  ulMaxHeight;
  546.           ULONG                  ulMaxWidth;
  547.           PGHBTBL                pghbTbl;
  548.           ULONG                  ulHalfWidth;
  549.           CHAR                   szGlyphlist[16];
  550.           ULONG                  ulReserved1;
  551.           ULONG                  ulReserved2;
  552.   } DEVFONTINFO;
  553.   typedef DEVFONTINFO *PDEVFONTINFO;
  554.  
  555.   #define  GRETAG     ('G' + ('R'<<8) + ('E'<<16) + ('_'<<24))    // "GRE_"
  556.   #define  WINTAG     ('W' + ('I'<<8) + ('N'<<16) + ('_'<<24))    // "WIN_"
  557.  
  558.   #define  DFI_FIXED_FONT        0x00000001
  559.   #define  DFI_DBCS_FONT         0x00000002
  560.  
  561.   typedef struct _TEXTBLTINFO {                /* tbi */
  562.           ULONG               ulLength;
  563.           ULONG               flOptions;
  564.           ULONG               lGlyphCnt;
  565.           PLONG               pGlyphIndices;
  566.           ULONG               ulFGMix;
  567.           ULONG               ulBGMix;
  568.           ULONG               ulFGColor;
  569.           ULONG               ulBGColor;
  570.           PBMAPINFO           pDstBmapInfo;
  571.           PDEVFONTINFO        pDevFntInfo;
  572.           ULONG               ulClpCnt;        // Non Clipping Drivers Ignore
  573.           PBLTRECT            abrClipRects;    // Non Clipping Drivers Ignore
  574.           PPOINTL             aptlSrcOrg;      // Clipping Drivers Ignore
  575.           PBLTRECT            abrDst;          // Clipping Drivers Ignore .ulXExt & ulYExt
  576.   } TEXTBLTINFO;
  577.   typedef TEXTBLTINFO *PTEXTBLTINFO;
  578.  
  579.  
  580.  
  581.   /*
  582.   **  Defines and structures for the GHI_CMD_PALETTE
  583.   */
  584.  
  585.   typedef struct _HWPALETTEINFO { /* hwpaletteinfo */
  586.      ULONG  ulLength;
  587.      ULONG  fFlags;               /* Get/Set palette                      */
  588.      ULONG  ulStartIndex;         /*                                      */
  589.      ULONG  ulNumEntries;         /*                                      */
  590.      PRGB2  pRGBs;                /*                                      */
  591.   } HWPALETTEINFO;
  592.   typedef HWPALETTEINFO *PHWPALETTEINFO;
  593.  
  594.   #define PALETTE_GET             0x0001
  595.   #define PALETTE_SET             0x0002
  596.  
  597.   /*
  598.   **  Defines and structures for the GHI_CMD_MOVEPTR DDI
  599.   */
  600.  
  601.   typedef struct _HWMOVEPTRIN {     /* hwmoveptrin */
  602.      ULONG  ulLength;
  603.      POINTL ptlPos;
  604.   } HWMOVEPTRIN;
  605.   typedef HWMOVEPTRIN *PHWMOVEPTRIN;
  606.  
  607.  
  608.   /*
  609.   **  Defines and structures for the GHI_CMD_SETPTR DDI
  610.   */
  611.  
  612.   typedef struct _HWSETPTRIN {      /* hwsetptrin */
  613.      ULONG  ulLength;
  614.      PBYTE  pbANDMask;
  615.      PBYTE  pbXORMask;
  616.      PBYTE  pbBits;
  617.      ULONG  ulBpp;
  618.      ULONG  ulWidth;
  619.      ULONG  ulHeight;
  620.      POINTL ptlHotspot;
  621.   } HWSETPTRIN;
  622.   typedef HWSETPTRIN *PHWSETPTRIN;
  623.  
  624.   typedef struct _HWSETPTROUT {      /* hwsetptrout */
  625.      ULONG ulLength;
  626.      ULONG ulStatus;
  627.   } HWSETPTROUT;
  628.   typedef HWSETPTROUT *PHWSETPTROUT;
  629.  
  630.   /*
  631.   ** Defines for the ulStatus field of the HWSETPTROUT structure
  632.   */
  633.  
  634.   #define POINTER_VISIBLE       0x0001
  635.   #define POINTER_COLOR         0x0002
  636.   #define POINTER_SOFTWARE      0x0004
  637.  
  638.   /*
  639.   **  Defines and structures for the GHI_CMD_SHOWPTR DDI
  640.   */
  641.  
  642.   typedef struct _HWSHOWPTRIN {     /* hwshowptrin */
  643.      ULONG ulLength;
  644.      BOOL  fShow;
  645.   } HWSHOWPTRIN;
  646.   typedef HWSHOWPTRIN *PHWSHOWPTRIN;
  647.  
  648.  
  649.   /*
  650.   **  Defines and structures for the GHI_CMD_VRAMALLOC
  651.   */
  652.  
  653.   typedef struct _HWVRAMALLOCIN {    /* hwvramallocin */
  654.      ULONG ulLength;
  655.      ULONG ulAllocType;
  656.      ULONG ulStart;
  657.      ULONG ulSize;
  658.   } HWVRAMALLOCIN;
  659.   typedef HWVRAMALLOCIN *PHWVRAMALLOCIN;
  660.  
  661.   typedef struct _HWVRAMALLOCOUT {     /* hwvramallocout */
  662.      ULONG ulLength;
  663.      ULONG ulStart;
  664.      ULONG ulSize;
  665.   } HWVRAMALLOCOUT;
  666.   typedef HWVRAMALLOCOUT *PHWVRAMALLOCOUT;
  667.  
  668.   /*
  669.   **  Defines for the ulAllocType field of the HWVRAMALLOCIN
  670.   **  data structure.
  671.   */
  672.  
  673.   #define VRAM_ALLOC               0
  674.   #define VRAM_DEALLOC             1
  675.   #define VRAM_QUERY               2
  676.  
  677.   /*
  678.   **  Defines and structures for the GHI_CMD_REQUESTHW command
  679.   */
  680.  
  681.   typedef struct _HWREQIN {        /* hwreqin */
  682.      ULONG  ulLength;
  683.      BOOL   fRequest;              /* TRUE == Request - FALSE == Release */
  684.      ULONG  cScrChangeRects;
  685.      PRECTL arectlScreen;
  686.   } HWREQIN;
  687.   typedef HWREQIN *PHWREQIN;
  688.  
  689.  
  690.   /*
  691.   **  Defines and structures for the GHI_CMD_BANK command
  692.   */
  693.  
  694.   typedef struct _HWBANKIN {       /* hwbankin  */
  695.      ULONG  ulLength;
  696.      ULONG  fFlags;                /* Get/Set bank */
  697.      ULONG  ulBank;                /* Bank number  */
  698.   } HWBANKIN;
  699.   typedef HWBANKIN *PHWBANKIN;
  700.  
  701.   #define BANK_GET             0x0001
  702.   #define BANK_SET             0x0002
  703.  
  704.   typedef struct _HWBANKOUT {      /* hwbankout */
  705.      ULONG  ulLength;
  706.      ULONG  ulBank;                /* Bank number  */
  707.   } HWBANKOUT;
  708.   typedef HWBANKOUT *PHWBANKOUT;
  709.  
  710.  
  711.   /*
  712.   **  Defines and structures for the GHI_CMD_EXTENSION command
  713.   */
  714.  
  715.   typedef struct _HWEXTENSION {          /* hwextension */
  716.      ULONG  ulLength;
  717.      ULONG  cScrChangeRects;
  718.      PRECTL arectlScreen;
  719.      ULONG  ulXFlags;
  720.      PVOID  pXP1;
  721.   } HWEXTENSION;
  722.   typedef HWEXTENSION *PHWEXTENSION;
  723.  
  724.   /*
  725.   **  Defines for the ulXFlags field of the HWEXTENSION data structure.
  726.   */
  727.  
  728.   #define X_REQUESTHW  1
  729.  
  730.   /*
  731.   **  Prototype declarations for Video Manager Interface (VMI)
  732.   */
  733.   typedef ULONG (EXPENTRY FNVMIENTRY)(GID, ULONG, PVOID, PVOID);
  734.  
  735.   /*
  736.   **  VMI commands which map directly to GRADD commands
  737.   */
  738.   #define VMI_CMD_INIT             GHI_CMD_INIT
  739.   #define VMI_CMD_INITPROC         GHI_CMD_INITPROC
  740.   #define VMI_CMD_TERM             GHI_CMD_TERM
  741.   #define VMI_CMD_TERMPROC         GHI_CMD_TERMPROC
  742.   #define VMI_CMD_QUERYCAPS        GHI_CMD_QUERYCAPS
  743.   #define VMI_CMD_QUERYMODES       GHI_CMD_QUERYMODES
  744.   #define VMI_CMD_SETMODE          GHI_CMD_SETMODE
  745.   #define VMI_CMD_PALETTE          GHI_CMD_PALETTE
  746.   #define VMI_CMD_BITBLT           GHI_CMD_BITBLT
  747.   #define VMI_CMD_LINE             GHI_CMD_LINE
  748.   #define VMI_CMD_MOVEPTR          GHI_CMD_MOVEPTR
  749.   #define VMI_CMD_SETPTR           GHI_CMD_SETPTR
  750.   #define VMI_CMD_SHOWPTR          GHI_CMD_SHOWPTR
  751.   #define VMI_CMD_VRAMALLOC        GHI_CMD_VRAMALLOC
  752.   #define VMI_CMD_REQUESTHW        GHI_CMD_REQUESTHW
  753.   #define VMI_CMD_RESERVED         GHI_CMD_RESERVED
  754.   #define VMI_CMD_EXTENSION        GHI_CMD_EXTENSION
  755.  
  756.   /*
  757.   **  VMI commands unique to the video manager
  758.   */
  759.   #define VMI_CMD_QUERYCHAININFO   GHI_CMD_MAX
  760.   #define VMI_CMD_INITPROCESS      GHI_CMD_MAX + 1
  761.   #define VMI_CMD_TERMPROCESS      GHI_CMD_MAX + 2
  762.   #define VMI_CMD_MAX              GHI_CMD_MAX + 3
  763.  
  764.   /*
  765.   **  Defines and structures for VMI_QUERYCHAININFO
  766.   */
  767.  
  768.   typedef struct _GRADDINFO {       /* graddinfo */
  769.           GID                   gid;
  770.           PSZ                   pszGraddName;
  771.           PFNHWENTRY            pGraddEntry;
  772.           PFNHWENTRY            pChainEntry;
  773.           ULONG                 cModes;
  774.           GDDMODERETURN         ModeRet;
  775.           struct _GDDMODEINFO * pModeInfo;
  776.           struct _CAPSINFO *    pCapsInfo;
  777.           struct _GRADDINFO *   pNextGraddInfo;
  778.   } GRADDINFO ;
  779.   typedef GRADDINFO *PGRADDINFO;
  780.  
  781.   typedef struct _CHAININFO {       /* chaininfo */
  782.           CID                   cid;
  783.           PSZ                   pszChainName;
  784.           PFNHWENTRY            pChainHWEntry;
  785.           PGRADDINFO            pGraddList;
  786.           struct _CHAININFO *   pNextChainInfo;
  787.   } CHAININFO ;
  788.   typedef CHAININFO *PCHAININFO;
  789.  
  790.  
  791.   typedef struct _VMIQCI {          /* vmiqci */
  792.      ULONG        ulLength;
  793.      PCHAININFO   pciHead;                /* Head of the GRADD chain      */
  794.   } VMIQCI;
  795.   typedef VMIQCI  *PVMIQCI;
  796.  
  797.  
  798.   /* NOINC */
  799.   #endif /* VMANDDI_INCLUDED */
  800.   /* INC */
  801.  
  802. #endif  /* INCL_VMANDDI */
  803.  
  804. #ifdef INCL_VMANWIN
  805.  
  806.   /* NOINC */
  807.   #ifndef VMANWIN_INCLUDED
  808.  
  809.   #define VMANWIN_INCLUDED
  810.   /* INC */
  811.  
  812.   /*
  813.   **  Structures for communication with VMANWIN VDD.
  814.   */
  815.  
  816.   #define       VMWNAME                 "VMANWIN"
  817.   #define       VMWSYSREQ_WAITDATA      1
  818.  
  819.   typedef struct _VMANWINVMAN {             /* vmanwinvman */
  820.     ULONG       gid;
  821.     ULONG       ulFn;
  822.     PVOID       pIn;
  823.     PVOID       pOut;
  824.   } VMANWINVMAN;
  825.   typedef VMANWINVMAN *PVMANWINVMAN;
  826.  
  827.   typedef struct _VMANWINALLOCMEMORY {      /* vmanwinallocmemory */
  828.     ULONG       ulSize;
  829.     PVOID       pAddress16;
  830.     PVOID       pAddress32;
  831.   } VMANWINALLOCMEMORY;
  832.   typedef VMANWINALLOCMEMORY *PVMANWINALLOCMEMORY;
  833.  
  834.   typedef struct _VMANWINFREEMEMORY {       /* vmanwinfreememory */
  835.     PVOID       pAddress32;
  836.   } VMANWINFREEMEMORY;
  837.   typedef VMANWINFREEMEMORY *PVMANWINFREEMEMORY;
  838.  
  839.   typedef struct _VMANWINCONVERTPTR {       /* vmanwinconvertptr */
  840.     PVOID       pAddress16;
  841.     PVOID       pAddress32;
  842.   } VMANWINCONVERTPTR;
  843.   typedef VMANWINCONVERTPTR *PVMANWINCONVERTPTR;
  844.  
  845.   typedef struct _VMANWINPARMS {            /* vmanwinparms */
  846.     PVOID       pOut;
  847.     PVOID       pIn;
  848.     ULONG       ulFn;
  849.   } VMANWINPARMS;
  850.   typedef VMANWINPARMS *PVMANWINPARMS;
  851.  
  852.   /*
  853.   ** Defines for ulFn in struct VMANWINPARMS
  854.   */
  855.   #define       VMWCMD_VMAN          0  /* Call VMAN                     */
  856.   #define       VMWCMD_ALLOC         1  /* Allocate Global Shared memory */
  857.   #define       VMWCMD_FREE          2  /* Free Global Shared memory     */
  858.   #define       VMWCMD_CONVERTPTR    3  /* Convert 16:16 or 0:32 pointer */
  859.  
  860.   /* NOINC */
  861.   #endif  /* VMANWIN_INCLUDED */
  862.   /* INC */
  863.  
  864. #endif  /* INCL_VMANWIN */
  865.  
  866.  
  867. #ifdef INCL_VMANHELP
  868.  
  869.   /* NOINC */
  870.   #ifndef VMANHELP_INCLUDED
  871.  
  872.   #define VMANHELP_INCLUDED
  873.   /* INC */
  874.  
  875.   typedef struct _MEMINFO    {   /* meminfo */
  876.     ULONG       ulPhysAddr;
  877.     ULONG       ulMemLen;
  878.     ULONG       ulVirtAddr;
  879.     PVOID       pNextMI;
  880.   } MEMINFO;
  881.   typedef MEMINFO *PMEMINFO;
  882.  
  883.   PVOID VHAllocMem( ULONG );
  884.   ULONG VHFreeMem( PVOID );
  885.   ULONG VHPhysToVirt( PMEMINFO );
  886.   int _Optlink VHPrintf(const char *, ...);
  887.  
  888.   /* NOINC */
  889.   #endif  /* VMANHELP_INCLUDED */
  890.   /* INC */
  891.  
  892. #endif  /* INCL_VMANHELP */
  893.  
  894. #ifdef INCL_GRADDIO
  895.  
  896.   /* NOINC */
  897.   #ifndef GRADDIO_INCLUDED
  898.  
  899.   #define GRADDIO_INCLUDED
  900.   /* INC */
  901.  
  902.   /*
  903.   **  General port IO routines
  904.   */
  905.  
  906.   typedef unsigned long   DWORD;
  907.   typedef unsigned short  WORD;
  908.   typedef unsigned short  IOPORT;
  909.  
  910.   BYTE  EXPENTRY HWInpByte(IOPORT);
  911.   WORD  EXPENTRY HWInpWord(IOPORT);
  912.   DWORD EXPENTRY HWInpDWord(IOPORT);
  913.   VOID  EXPENTRY HWOutpByte(IOPORT, BYTE);
  914.   VOID  EXPENTRY HWOutpWord(IOPORT, WORD);
  915.   VOID  EXPENTRY HWOutpDWord(IOPORT, DWORD);
  916.   VOID  EXPENTRY HWOutpString(IOPORT, DWORD, PBYTE);
  917.   VOID  EXPENTRY HWOutpRect(IOPORT, DWORD, DWORD, PBYTE, DWORD);
  918.   VOID  EXPENTRY HWOutpBitRect(IOPORT, DWORD, DWORD, PBYTE, DWORD);
  919.   VOID  EXPENTRY HWOutpTransRect(IOPORT, DWORD, DWORD, PBYTE, DWORD, PBYTE);
  920.   VOID  EXPENTRY HWInpString(IOPORT, DWORD, PBYTE);
  921.  
  922.   /* NOINC */
  923.   #endif /* GRADDIO_INCLUDED */
  924.   /* INC */
  925.  
  926. #endif  /* INCL_GRADDIO */
  927.  
  928.