home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ddkx86v1.zip / DDKX86 / H / PMDDI.H < prev    next >
C/C++ Source or Header  |  1995-04-14  |  43KB  |  1,357 lines

  1. /*DDK*************************************************************************/
  2. /*                                                                           */
  3. /* COPYRIGHT    Copyright (C) 1995 IBM Corporation                           */
  4. /*                                                                           */
  5. /*    The following IBM OS/2 WARP source code is provided to you solely for  */
  6. /*    the purpose of assisting you in your development of OS/2 WARP device   */
  7. /*    drivers. You may use this code in accordance with the IBM License      */
  8. /*    Agreement provided in the IBM Device Driver Source Kit for OS/2. This  */
  9. /*    Copyright statement may not be removed.                                */
  10. /*                                                                           */
  11. /*****************************************************************************/
  12. /****************************** Module Header ******************************\
  13. *
  14. * Module Name: PMDDI.H
  15. *
  16. * OS/2 Presentation Manager entry points, macros, and types for the
  17. * Graphics Engine.
  18. *
  19. *
  20. * ===========================================================================
  21. *
  22. * The following symbols are used in this file for conditional sections.
  23. *
  24. *   #define:                To include:
  25. *
  26. *   INCL_DDIGRE             don't want OS2DEF, PMGPI, and PMDEV included
  27. *   INCL_DDIDEFS            don't want the above, but do want GRE structs
  28. *
  29. * It is expected that callers of the Engine will want to define INCL_DDIGRE
  30. * and possibly INCL_DDIDEFS.  The Engine itself and device drivers define
  31. * neither of these.
  32. *
  33. * Further defines must be made to specify which of the GRE function macros
  34. * should be defined.
  35. *
  36. *   #define:                To include:
  37. *
  38. *   INCL_GREALL           All of the following
  39. *   INCL_GRE_ARCS         Arcs functions
  40. *   INCL_GRE_BITMAPS      Bitmap functions
  41. *   INCL_GRE_CLIP            etc...
  42. *   INCL_GRE_COLORTABLE
  43. *   INCL_GRE_DCS
  44. *   INCL_GRE_DEVICE
  45. *   INCL_GRE_DEVMISC
  46. *   INCL_GRE_DEVSUPPORT
  47. *   INCL_GRE_FONTS
  48. *   INCL_GRE_JOURNALING
  49. *   INCL_GRE_LCID
  50. *   INCL_GRE_LINES
  51. *   INCL_GRE_MARKERS
  52. *   INCL_GRE_PALETTE
  53. *   INCL_GRE_PATHS
  54. *   INCL_GRE_PICK
  55. *   INCL_GRE_POLYGON
  56. *   INCL_GRE_REGIONS
  57. *   INCL_GRE_SCANS
  58. *   INCL_GRE_SETID
  59. *   INCL_GRE_STRINGS
  60. *   INCL_GRE_XFORMS
  61. *
  62. * ===========================================================================
  63. *
  64. * Comments at the end of each typedef line give the name tags used in
  65. * the assembler include version of this file.
  66. *
  67. * The assembler include version of this file excludes lines between NOINC
  68. * and INC comments.
  69. *
  70. #ifndef __IBMC__
  71.    * The public version of this file (as shipped with the OS/2 Toolkit
  72.    * product) excludes all non 32-bit material marked in this file
  73.    * as well as any areas specifically marked with __IBMC__ conditional
  74.    * sections - including this paragraph. The H2IBMH rexx command file
  75.    * removes these sections.
  76. #endif
  77. \***************************************************************************/
  78. /* NOINC */
  79. #ifdef __IBMC__
  80.    #pragma checkout( suspend )
  81.       #ifndef __CHKHDR__
  82.          #pragma checkout( suspend )
  83.       #endif
  84.    #pragma checkout( resume )
  85. #endif
  86. /* INC */
  87.  
  88. #define DDI_INCLUDED
  89.  
  90. #ifndef INCL_32         /* If neither INCL_32 or INCL_16 set already */
  91.    #ifndef INCL_16      /* find out from compiler if 32-bit or not.  */
  92.      #ifdef M_I386
  93.         #define INCL_32 /* Compiling for 32-bit */
  94.      #else
  95.         #define INCL_16 /* Compiling for 16-bit */
  96.      #endif
  97.   #endif
  98. #endif
  99.  
  100. #ifdef INCL_GREALL
  101.    #define INCL_GRE_ARCS
  102.    #define INCL_GRE_BITMAPS
  103.    #define INCL_GRE_CLIP
  104.    #define INCL_GRE_COLORTABLE
  105.    #define INCL_GRE_DCS
  106.    #define INCL_GRE_DEVICE
  107.    #define INCL_GRE_DEVMISC
  108.    #define INCL_GRE_DEVSUPPORT
  109.    #define INCL_GRE_FONTS
  110.    #define INCL_GRE_JOURNALING
  111.    #define INCL_GRE_LCID
  112.    #define INCL_GRE_LINES
  113.    #define INCL_GRE_MARKERS
  114.    #define INCL_GRE_PALETTE
  115.    #define INCL_GRE_PATHS
  116.    #define INCL_GRE_PICK
  117.    #define INCL_GRE_POLYGON
  118.    #define INCL_GRE_REGIONS
  119.    #define INCL_GRE_SCANS
  120.    #define INCL_GRE_SCREEN
  121.    #define INCL_GRE_SETID
  122.    #define INCL_GRE_STRINGS
  123.    #define INCL_GRE_XFORMS
  124. #endif /* INCL_GREALL */
  125.  
  126. #ifdef INCL_GRE_DEVMISC
  127.    #define INCL_GRE_DEVMISC1
  128.    #define INCL_GRE_DEVMISC2
  129.    #define INCL_GRE_DEVMISC3
  130. #endif  /* INCL_GRE_DEVMISC */
  131.  
  132.  
  133. #ifdef INCL_32
  134. /*** Engine dispatch tables ************************************************/
  135.  
  136. #define MAXTABLEENTRIES        223
  137. #define NUMBEROFMAJORFUN       MAXTABLEENTRIES
  138. #define NUMBEROFMINORFUN       86
  139.  
  140. typedef struct _DISPATCHER {  /* dr */
  141.         PFN    pfnTblEntry[MAXTABLEENTRIES];
  142. } DISPATCHER;
  143. typedef DISPATCHER FAR *PDISPATCHER;
  144.  
  145. typedef struct _FUNINFOTABLE {  /* fit */
  146.         BYTE   FunInfo_00[NUMBEROFMAJORFUN];
  147.         BYTE   FunInfo_02[NUMBEROFMINORFUN];
  148. } FUNINFOTABLE;
  149. typedef FUNINFOTABLE FAR *PFUNINFOTABLE;
  150. #endif
  151.  
  152. /*** exported Engine DDI functions *****************************************/
  153.  
  154. LONG  APIENTRY SetDriverInfo(ULONG hDrv,
  155.                              LHANDLE hEng,
  156.                              ULONG ulIndex,
  157.                              HDC hdc);
  158.  
  159. LONG  APIENTRY GetDriverInfo(LHANDLE hEng,
  160.                              ULONG ulIndex,
  161.                              HDC hdc);
  162.  
  163. LONG  APIENTRY PostDeviceModes(PDRIVDATA pDrvData,
  164.                                PSZ pszDrvName,
  165.                                PSZ pszDevName,
  166.                                PSZ pszPrtName,
  167.                                ULONG ulOptions);
  168.  
  169. BOOL  APIENTRY GreInitialize(VOID);
  170.  
  171. #ifdef INCL_32
  172. ULONG APIENTRY SSAllocMem(PVOID ppAddr,
  173.                           ULONG ulSize,
  174.                           ULONG ulReserved);
  175.  
  176. ULONG APIENTRY SSFreeMem(PVOID pAddr);
  177. #endif
  178.  
  179. /*** define common types in the Engine and DDI *****************************/
  180.  
  181. typedef struct _RECTS { /* rcs */
  182.    POINTS pts1;
  183.    POINTS pts2;
  184. } RECTS;
  185. typedef RECTS FAR *PRECTS;
  186.  
  187. /* NOINC */
  188. #ifndef POINTFX_DEFINED
  189.    #define POINTFX_DEFINED
  190.    /* INC */
  191.    typedef struct _POINTFX { /* ptfx */
  192.       FIXED x;
  193.       FIXED y;
  194.    } POINTFX;
  195.    typedef POINTFX FAR *PPOINTFX;
  196.    /* NOINC */
  197. #endif
  198. /* INC */
  199.  
  200. typedef struct _RECTFX { /* rcfx */
  201.    POINTFX ptfx1;
  202.    POINTFX ptfx2;
  203. } RECTFX;
  204. typedef RECTFX FAR *PRECTFX;
  205.  
  206. typedef struct _XFORM { /* xform */
  207.    FIXED fxM11;
  208.    FIXED fxM12;
  209.    FIXED fxM21;
  210.    FIXED fxM22;
  211.    LONG  lM41;
  212.    LONG  lM42;
  213. } XFORM;
  214. typedef XFORM FAR *PXFORM;
  215.  
  216. typedef LONG LCID;      /* locally-coded id */
  217. typedef LCID FAR *PLCID;
  218. typedef LONG PHID;      /* path id */
  219. typedef ULONG HDEVPAL;
  220.  
  221. #ifdef INCL_GRE_HFONT
  222.    typedef LHANDLE HFONT;       /* font handle */
  223. #endif /* INCL_GRE_HFONT */
  224.  
  225. #ifdef INCL_DDICOMFLAGS
  226. #ifdef INCL_32
  227.    #define COM_DRAW16                      0x00000001L
  228.    #define COM_BOUND16                     0x00000002L
  229.    #define COM_CORRELATE16                 0x00000004L
  230.    #define COM_ALT_BOUND16                 0x00000008L
  231.    #define COM_AREA16                      0x00000010L
  232.    #define COM_PATH16                      0x00000020L
  233.    #define COM_TRANSFORM16                 0x00000040L
  234.    #define COM_RECORDING16                 0x00000080L
  235.    #define COM_DEVICE16                    0x00000100L
  236.    #define COM_SCR_BOUND16                 0x00000200L
  237.    #define COM_PRECLIP16                   0x04000000L
  238.  
  239.    #define COM_DRAW                        0x00010000L
  240.    #define COM_BOUND                       0x00020000L
  241.    #define COM_CORRELATE                   0x00040000L
  242.    #define COM_ALT_BOUND                   0x00080000L
  243.    #define COM_AREA                        0x00100000L
  244.    #define COM_PATH                        0x00200000L
  245.    #define COM_TRANSFORM                   0x00400000L
  246.    #define COM_RECORDING                   0x00800000L
  247.    #define COM_DEVICE                      0x01000000L
  248.    #define COM_SCR_BOUND                   0x02000000L
  249.    #define COM_PRECLIP                     0x04000000L
  250. #else
  251.    #define COM_DRAW                            0x0001
  252.    #define COM_BOUND                           0x0002
  253.    #define COM_CORRELATE                       0x0004
  254.    #define COM_ALT_BOUND                       0x0008
  255.    #define COM_AREA                            0x0010
  256.    #define COM_PATH                            0x0020
  257.    #define COM_TRANSFORM                       0x0040
  258.    #define COM_RECORDING                       0x0080
  259.    #define COM_DEVICE                          0x0100
  260.    #define COM_SCR_BOUND                       0x0200
  261.    #define COM_PRECLIP                         0x0400
  262. #endif
  263. #endif /* INCL_DDICOMFLAGS */
  264.  
  265. #ifdef INCL_GRE_ARCS
  266.  
  267.    /* BoxBoundary */
  268.    /* BoxInterior */
  269.    /* BoxBoth */
  270.  
  271.    typedef struct _BOXPARAMS {    /* boxp */
  272.       POINTL ptl;
  273.       SIZEL  sizl;
  274.    } BOXPARAMS;
  275.    typedef BOXPARAMS FAR *PBOXPARAMS;
  276. #endif /* INCL_GRE_ARCS */
  277.  
  278. #ifdef INCL_GRE_CLIP
  279.  
  280.    /* CopyClipRegion */
  281.  
  282.    #define COPYCRGN_ALLINTERSECT        0L
  283.    #define COPYCRGN_VISRGN              1L
  284.    #define COPYCRGN_CLIPRGN             2L
  285.  
  286.    /* SetupDC */
  287.  
  288.    #define SETUPDC_VISRGN               0x00000001L
  289.    #define SETUPDC_ORIGIN               0x00000002L
  290.    #define SETUPDC_ACCUMBOUNDSON        0x00000004L
  291.    #define SETUPDC_ACCUMBOUNDSOFF       0x00000008L
  292.    #define SETUPDC_RECALCCLIP           0x00000010L
  293.    #define SETUPDC_SETOWNER             0x00000020L
  294.    #define SETUPDC_CLEANDC              0x00000040L
  295.  
  296. #endif /* INCL_GRE_CLIP */
  297.  
  298. #ifdef INCL_GRE_XFORMS
  299.  
  300.    /* QueryViewportSize */
  301.    typedef struct _VIEWPORTSIZE { /* vs */
  302.       ULONG cx;
  303.       ULONG cy;
  304.    } VIEWPORTSIZE;
  305.    typedef VIEWPORTSIZE FAR *PVIEWPORTSIZE;
  306.  
  307. #endif /* INCL_GRE_XFORMS */
  308.  
  309. #ifdef INCL_GRE_DEVSUPPORT
  310.  
  311.    /* Constants for GreInitializeAttributes */
  312.  
  313.    #define INAT_DEFAULTATTRIBUTES       1L
  314.    #define INAT_CURRENTATTRIBUTES       2L
  315.  
  316.    /* InvalidateVisRegion */
  317.  
  318.    typedef struct _DC_BLOCK { /* ivr */
  319.       ULONG hdc;
  320.       ULONG hddc;
  321.    } DC_BLOCK;
  322.    typedef DC_BLOCK FAR *PDC_BLOCK;
  323.  
  324. #endif /* INCL_GRE_DEVSUPPORT */
  325.  
  326. #ifdef INCL_DDIMISC
  327.  
  328.    /* Display information resource structure (RT_DISPLAYINFO) */
  329.    typedef struct _DISPLAYINFO {         /* dspinfo */
  330.       USHORT cb;
  331.       SHORT cxIcon;
  332.       SHORT cyIcon;
  333.       SHORT cxPointer;
  334.       SHORT cyPointer;
  335.       SHORT cxBorder;
  336.       SHORT cyBorder;
  337.       SHORT cxHSlider;
  338.       SHORT cyVSlider;
  339.       SHORT cxSizeBorder;
  340.       SHORT cySizeBorder;
  341.       SHORT cxDeviceAlign;
  342.       SHORT cyDeviceAlign;
  343.    } DISPLAYINFO;
  344.    typedef DISPLAYINFO FAR *PDISPLAYINFO;
  345.  
  346.    /* Parameters for the DC Enable function */
  347.  
  348.    typedef struct _DENPARAMS { /* den */
  349.       ULONG ulStateInfo;
  350.       ULONG ulType;
  351.       ULONG ulHDC;
  352.    } DENPARAMS;
  353.    typedef DENPARAMS FAR *PDENPARAMS;
  354.  
  355.  
  356.    typedef struct _STYLERATIO { /* sr */
  357.       BYTE dx;
  358.       BYTE dy;
  359.    } STYLERATIO;
  360.    typedef STYLERATIO FAR *PSTYLERATIO;
  361.  
  362.    /* Options flags for SetGlobalAttribute */
  363.  
  364.    #define GATTR_DEFAULT                   1L
  365.  
  366.    /* Attribute Types for SetGlobalAttribute */
  367.  
  368.    #define ATYPE_COLOR                     1L
  369.    #define ATYPE_BACK_COLOR                2L
  370.    #define ATYPE_MIX_MODE                  3L
  371.    #define ATYPE_BACK_MIX_MODE             4L
  372.  
  373.    /* Options for CharStringPos */
  374.  
  375.    #define CHS_START_XY                    0x00000020L
  376.    #define CHS_ATTR_INFO                   0x00000040L
  377.  
  378.    typedef struct _CSP_INFO { /* csp */
  379.       LONG  cSize;
  380.       LONG  lColor;
  381.       LONG  lBackColor;
  382.    } CSP_INFO;
  383.    typedef CSP_INFO FAR *PCSP_INFO;
  384.  
  385.    /* Set/GetProcessControl */
  386.  
  387.    #define PCTL_DRAW                       0x00000001L
  388.    #define PCTL_BOUND                      0x00000002L
  389.    #define PCTL_CORRELATE                  0x00000004L
  390.    #define PCTL_USERBOUNDS                 0x00000008L
  391.    #define PCTL_AREA                       0x00000010L
  392.  
  393.    /* ResetBounds */
  394.  
  395.    #define RB_GPI                          0x00000001L
  396.    #define RB_USER                         0x00000002L
  397.  
  398.    /* GetBoundsData */
  399.  
  400.    #define GBD_GPI                         0L
  401.    #define GBD_USER                        1L
  402.  
  403.    /* EndArea Cancel Option */
  404.  
  405.    #define EA_DRAW                         0x00000000L
  406.    #define EA_CANCEL                       0x00000001L
  407.  
  408.    /* Bitblt Style */
  409.  
  410.    #define BLTMODE_SRC_BITMAP              0x00010000L
  411.    #define BLTMODE_ATTRS_PRES              0x00020000L
  412.    #define BBO_TARGWORLD                   0x00000100L
  413.  
  414.    typedef struct _BITBLTPARAMETERS { /* bbp */
  415.       RECTL rclTarg;
  416.       RECTL rclSrc;
  417.    } BITBLTPARAMETERS;
  418.    typedef BITBLTPARAMETERS FAR *PBITBLTPARAMETERS;
  419.  
  420.    typedef struct _BITBLTATTRS { /* bba */
  421.       LONG cSize;
  422.       LONG lColor;
  423.       LONG lBackColor;
  424.    } BITBLTATTRS;
  425.    typedef BITBLTATTRS FAR *PBITBLTATTRS;
  426.  
  427.    /* LCIDs */
  428.  
  429.    #define LCID_AVIO_1                     (-2L)
  430.    #define LCID_AVIO_2                     (-3L)
  431.    #define LCID_AVIO_3                     (-4L)
  432.    #define LCID_BITMAP_ID_REQUEST          (-5L)
  433.  
  434.    #define LCID_RANGE_GPI                  1L
  435.    #define LCID_RANGE_AVIO                 2L
  436.    #define LCID_RANGE_BOTH                 3L
  437.    #define LCID_GRAPHICS_MIN               1
  438.    #define LCID_GRAPHICS_MAX               254
  439.  
  440.    #define LCIDT_NONE                      0L
  441.  
  442.    /* ResetDC */
  443.  
  444.    #define RDC_RGBMODE                     0x1L
  445.    #define RDC_SETOWNERTOSHELL             0x2L
  446.  
  447.    /* SetRandomXform */
  448.  
  449.    #define SX_UNITY                        0L
  450.    #define SX_CAT_AFTER                    1L
  451.    #define SX_CAT_BEFORE                   2L
  452.    #define SX_OVERWRITE                    3L
  453.  
  454.    /* transform accelerators                    */
  455.    /*  These bits are only valid if the MATRIX_SIMPLE bit is set.           */
  456.    /*  The X and Y negate flags are only meaningful if MATRIX_UNITS is set.*/
  457.  
  458.    #define MATRIX_SIMPLE            0x0001L  /* two entries are zero */
  459.    #define MATRIX_UNITS             0x0002L  /* all entries are +1 or -1 */
  460.    #define MATRIX_XY_EXCHANGE       0x0004L  /* zeros are on the diagonal*/
  461.    #define MATRIX_X_NEGATE          0x0008L  /* X is hit by negative */
  462.    #define MATRIX_Y_NEGATE          0x0010L  /* Y is hit by negative */
  463.    #define MATRIX_TRANSLATION       0x0020L  /* non-zero translation */
  464.  
  465.    /* NotifyClipChange */
  466.  
  467.    #define NCC_CLEANDC              0x0002L  /* clear DC dirty bit */
  468.  
  469.    /* NotifyTransformChange */
  470.  
  471.    #ifdef INCL_32
  472.       typedef struct _NOTIFYTRANSFORMDATA { /* ntd */
  473.          ULONG  usType;
  474.          XFORM  xform;
  475.       } NOTIFYTRANSFORMDATA;
  476.       typedef NOTIFYTRANSFORMDATA FAR *PNOTIFYTRANSFORMDATA;
  477.    #else
  478.       typedef struct _NOTIFYTRANSFORMDATA { /* ntd */
  479.          USHORT usType;
  480.          XFORM  xform;
  481.       } NOTIFYTRANSFORMDATA;
  482.       typedef NOTIFYTRANSFORMDATA FAR *PNOTIFYTRANSFORMDATA;
  483.    #endif
  484.  
  485.    /* ColorTable */
  486.  
  487.    #define LCOL_SYSCOLORS           0x0010L
  488.  
  489.  
  490.    /* query device caps */
  491.  
  492.    typedef struct _QCDARRAY { /* qcd */
  493.       LONG    iFormat;
  494.       LONG    iSmallest;
  495.       LONG    iLargest;
  496.       LONG    cAvailable;
  497.       LONG    cSpecifiable;
  498.       LONG    iMax;
  499.    } QCDARRAY;
  500.    typedef QCDARRAY FAR *PQCDARRAY;
  501.  
  502.    #define CAPS_MIX_OR                  0x00000001L
  503.    #define CAPS_MIX_COPY                0x00000002L
  504.    #define CAPS_MIX_UNDERPAINT          0x00000004L
  505.    #define CAPS_MIX_XOR                 0x00000008L
  506.    #define CAPS_MIX_INVISIBLE           0x00000010L
  507.    #define CAPS_MIX_AND                 0x00000020L
  508.    #define CAPS_MIX_OTHER               0x00000040L
  509.  
  510.    #define CAPS_DEV_FONT_SIM_BOLD       1L      /* for CAPS_DEVICE_FONT_SIM */
  511.    #define CAPS_DEV_FONT_SIM_ITALIC     2L
  512.    #define CAPS_DEV_FONT_SIM_UNDERSCORE 4L
  513.    #define CAPS_DEV_FONT_SIM_STRIKEOUT  8L
  514.  
  515.    #define CAPS_BACKMIX_OR              0x00000001L
  516.    #define CAPS_BACKMIX_COPY            0x00000002L
  517.    #define CAPS_BACKMIX_UNDERPAINT      0x00000004L
  518.    #define CAPS_BACKMIX_XOR             0x00000008L
  519.    #define CAPS_BACKMIX_INVISIBLE       0x00000010L
  520.  
  521.  
  522.    /*#define CAPS_RASTER_BITBLT         0x00000001L defined in pmdev.h */
  523.    /*#define CAPS_RASTER_BANDING        0x00000002L */
  524.    /*#define CAPS_RASTER_STRETCHBLT     0x00000004L */
  525.    /*#define CAPS_RASTER_SETPEL         0x00000010L */
  526.    #define CAPS_FONT_OUTLINE_MANAGE     16L
  527.    #define CAPS_FONT_IMAGE_MANAGE       32L
  528.    #define SFONT_RASTER                 100
  529.    #define SFONT_OUTLINE                101
  530.    #define FONT              1000       /* must not conflict with RT_XXX */
  531.                                         /* constants in BSEDOS.H */
  532.  
  533.    /* DCCaps */
  534.  
  535.    #define DCCAPS_LINE                  0x0100
  536.    #define DCCAPS_CURVE                 0x0200
  537.    #define DCCAPS_AREA                  0x0400
  538.    #define DCCAPS_MARKER                0x0800
  539.    #define DCCAPS_TEXT                  0x1000
  540.  
  541.    /* DeviceDeleteBitmap */
  542.    #define BITMAP_USAGE_TRANSLATE       0x0004
  543.  
  544.    /* DeleteBitmap return structure */
  545.    typedef struct _DELETERETURN { /* dr */
  546.       ULONG      pInfo;
  547.       ULONG      pBits;
  548.    } DELETERETURN;
  549.    typedef DELETERETURN FAR *PDELETERETURN;
  550.  
  551.    /* Short Line Header */
  552.  
  553.    #define SLH_FORMAT_IS_16_DOT_16 1
  554.    #define PSL_YMAJOR 0x8000    /* bit mask for usStyle */
  555.  
  556. #ifdef INCL_32
  557.    typedef struct _SHORTLINEHEADER { /* slh */
  558.       ULONG  ulStyle;
  559.       ULONG  ulFormat;
  560.       POINTL ptlStart;
  561.       POINTL ptlStop;
  562.       LONG   lxLeft;
  563.       LONG   lxRight;
  564.       struct _SHORTLINEHEADER *pslhNext;
  565.       struct _SHORTLINEHEADER *pslhPrev;
  566.    } SHORTLINEHEADER;
  567.    typedef SHORTLINEHEADER FAR *PSHORTLINEHEADER;
  568.    /* Short Line */
  569.  
  570.    typedef struct _SHORTLINE { /* sl */
  571.       SHORTLINEHEADER slh;
  572.       LONG      ax[1];
  573.    } SHORTLINE;
  574.    typedef SHORTLINE FAR *PSHORTLINE;
  575.  
  576.    /* Bounding rectangle for subpaths. */
  577.  
  578.    typedef struct _BRECTL {        /* brctl */
  579.       POINTL ptl1;
  580.       POINTL ptl2;
  581.    } BRECTL;
  582.    typedef BRECTL FAR *PBRECTL;
  583.  
  584.    typedef struct _RLEHDR { /* rle */
  585.       LONG     lType;
  586.       BRECTL   brectlBounds;
  587.       PVOID    pRLE;
  588.    } RLEHDR;
  589.    typedef RLEHDR *PRLEHDR;
  590.  
  591. #else
  592.    typedef struct _SHORTLINEHEADER { /* slh */
  593.       USHORT     usStyle;
  594.       USHORT     usFormat;
  595.       POINTS     ptsStart;
  596.       POINTS     ptsStop;
  597.       SHORT      sxLeft;
  598.       SHORT      sxRight;
  599.       struct _SHORTLINEHEADER FAR * pslhNext;
  600.       struct _SHORTLINEHEADER FAR * pslhPrev;
  601.    } SHORTLINEHEADER;
  602.    typedef SHORTLINEHEADER FAR *PSHORTLINEHEADER;
  603.    /* Short Line */
  604.  
  605.    typedef struct _SHORTLINE { /* sl */
  606.       SHORTLINEHEADER slh;
  607.       SHORT     ax[1];
  608.    } SHORTLINE;
  609.    typedef SHORTLINE FAR *PSHORTLINE;
  610. #endif
  611.  
  612.    typedef struct _SCANDATA { /* sd */
  613.       PSHORTLINE pslFirstLeft;
  614.       PSHORTLINE pslLastLeft;
  615.       PSHORTLINE pslFirstRight;
  616.       PSHORTLINE pslLastRight;
  617.       ULONG      c;
  618.       RECTL      rclBound;
  619.    } SCANDATA;
  620.    typedef SCANDATA FAR *PSCANDATA;
  621.  
  622.    /* Index for Set/GetDriverInfo */
  623.  
  624.    #define DI_HDC                      0x00000000L
  625.    #define DI_HBITMAP                  0x00000001L
  626.  
  627. #endif  /* INCL_DDIMISC */
  628.  
  629. #ifdef INCL_DDIMISC2
  630.  
  631.    /* RealizeFont */
  632.  
  633.    #define REALIZE_FONT                 1   /* To be removed */
  634.    #define REALIZE_ENGINE_FONT          2
  635.    #define DELETE_FONT                  3
  636.  
  637.    #define RF_DEVICE_FONT               1
  638.    #define RF_LOAD_ENGINE_FONT          2
  639.    #define RF_DELETE_FONT               3
  640.    #define RF_DELETE_ENGINE_FONT        4
  641.  
  642. #endif  /* INCL_DDIMISC2 */
  643.  
  644. #ifdef INCL_DDIBUNDLES
  645.  
  646.    /* Device Line Bundle */
  647.  
  648.    typedef struct _LINEDEFS { /* ldef */
  649.       ULONG      defType;
  650.    } LINEDEFS;
  651.    typedef LINEDEFS FAR *PLINDEFS;
  652.  
  653. #ifdef INCL_32
  654.    typedef struct _DLINEBUNDLE { /* dlbnd */
  655.       LONG       cAttr;
  656.       LONG       cDefs;
  657.       LINEBUNDLE lbnd;
  658.       LINEDEFS   ldef;
  659.    } DLINEBUNDLE;
  660.    typedef DLINEBUNDLE FAR *PDLINEBUNDLE;
  661. #else
  662.    typedef struct _DLINEBUNDLE { /* dlbnd */
  663.       SHORT      cAttr;
  664.       SHORT      cDefs;
  665.       LINEBUNDLE lbnd;
  666.       LINEDEFS   ldef;
  667.    } DLINEBUNDLE;
  668.    typedef DLINEBUNDLE FAR *PDLINEBUNDLE;
  669. #endif
  670.  
  671.    /* Device Area Bundle */
  672.  
  673. #ifdef INCL_32
  674.    typedef struct _AREADEFS { /* adef */
  675.       ULONG      defSet;
  676.       ULONG      fFlags;
  677.       ULONG      CodePage;
  678.    } AREADEFS;
  679.    typedef AREADEFS FAR *PAREADEFS;
  680. #else
  681.    typedef struct _AREADEFS { /* adef */
  682.       ULONG      defSet;
  683.       UINT       fFlags;
  684.       UINT       CodePage;
  685.    } AREADEFS;
  686.    typedef AREADEFS FAR *PAREADEFS;
  687. #endif
  688.  
  689. #ifdef INCL_32
  690.    typedef struct _DAREABUNDLE { /* dabnd */
  691.       LONG       cAttr;
  692.       LONG       cDefs;
  693.       AREABUNDLE abnd;
  694.       AREADEFS   adef;
  695.    } DAREABUNDLE;
  696.    typedef DAREABUNDLE FAR *PDAREABUNDLE;
  697.  
  698.    /* Device Character Bundle */
  699.  
  700.    typedef struct _CHARDEFS { /* cdef */
  701.       ULONG      defSet;
  702.       ULONG      fFlags;
  703.       ULONG      CodePage;
  704.       ULONG      charSpacing;
  705.    } CHARDEFS;
  706.    typedef CHARDEFS FAR *PCHARDEFS;
  707.  
  708.    typedef struct _DCHARBUNDLE { /* dcbnd */
  709.       LONG       cAttr;
  710.       LONG       cDefs;
  711.       CHARBUNDLE cbnd;
  712.       CHARDEFS   cdef;
  713.    } DCHARBUNDLE;
  714.    typedef DCHARBUNDLE FAR *PDCHARBUNDLE;
  715.  
  716.    /* Device Image Bundle */
  717.  
  718.    #ifdef BOGUS
  719.       typedef struct _IMAGEDEFS { /* idef */
  720.       } IMAGEDEFS;
  721.    #endif       /* BOGUS */
  722.  
  723.    typedef struct _DIMAGEBUNDLE { /* dibnd */
  724.       LONG       cAttr;
  725.       LONG       cDefs;
  726.       IMAGEBUNDLE ibnd;
  727.       /* IMAGEDEFS     idef; */
  728.    } DIMAGEBUNDLE;
  729.    typedef DIMAGEBUNDLE FAR *PDIMAGEBUNDLE;
  730.  
  731.    /* Device Marker Bundle */
  732.  
  733.    typedef struct _MARKERDEFS { /* mdef */
  734.       ULONG      defSet;
  735.       ULONG      fFlags;
  736.       ULONG      CodePage;
  737.    } MARKERDEFS;
  738.    typedef MARKERDEFS FAR *PMARKERDEFS;
  739.  
  740.    typedef struct _DMARKERBUNDLE { /* dmbnd */
  741.       LONG       cAttr;
  742.       LONG       cDefs;
  743.       MARKERBUNDLE mbnd;
  744.       MARKERDEFS   mdef;
  745.    } DMARKERBUNDLE;
  746.    typedef DMARKERBUNDLE FAR *PDMARKERBUNDLE;
  747. #else
  748.    typedef struct _DAREABUNDLE { /* dabnd */
  749.       SHORT      cAttr;
  750.       SHORT      cDefs;
  751.       AREABUNDLE abnd;
  752.       AREADEFS   adef;
  753.    } DAREABUNDLE;
  754.    typedef DAREABUNDLE FAR *PDAREABUNDLE;
  755.  
  756.    /* Device Character Bundle */
  757.  
  758.    typedef struct _CHARDEFS { /* cdef */
  759.       ULONG      defSet;
  760.       UINT       fFlags;
  761.       UINT       CodePage;
  762.       UINT       charSpacing;
  763.    } CHARDEFS;
  764.    typedef CHARDEFS FAR *PCHARDEFS;
  765.  
  766.    typedef struct _DCHARBUNDLE { /* dcbnd */
  767.       SHORT      cAttr;
  768.       SHORT      cDefs;
  769.       CHARBUNDLE cbnd;
  770.       CHARDEFS   cdef;
  771.    } DCHARBUNDLE;
  772.    typedef DCHARBUNDLE FAR *PDCHARBUNDLE;
  773.  
  774.    /* Device Image Bundle */
  775.  
  776.    #ifdef BOGUS
  777.       typedef struct _IMAGEDEFS { /* idef */
  778.       } IMAGEDEFS;
  779.    #endif       /* BOGUS */
  780.  
  781.    typedef struct _DIMAGEBUNDLE { /* dibnd */
  782.       SHORT      cAttr;
  783.       SHORT      cDefs;
  784.       IMAGEBUNDLE ibnd;
  785.       /*    IMAGEDEFS     idef; */
  786.    } DIMAGEBUNDLE;
  787.    typedef DIMAGEBUNDLE FAR *PDIMAGEBUNDLE;
  788.  
  789.    /* Device Marker Bundle */
  790.  
  791.    typedef struct _MARKERDEFS { /* mdef */
  792.       ULONG      defSet;
  793.       UINT       fFlags;
  794.       UINT       CodePage;
  795.    } MARKERDEFS;
  796.    typedef MARKERDEFS FAR *PMARKERDEFS;
  797.  
  798.    typedef struct _DMARKERBUNDLE { /* dmbnd */
  799.       SHORT      cAttr;
  800.       SHORT      cDefs;
  801.       MARKERBUNDLE mbnd;
  802.       MARKERDEFS   mdef;
  803.    } DMARKERBUNDLE;
  804.    typedef DMARKERBUNDLE FAR *PDMARKERBUNDLE;
  805. #endif
  806.  
  807.  
  808. #endif /* INCL_DDIBUNDLES */
  809.  
  810. #ifdef INCL_DDIFONTSTRUCS
  811.    #include <pmfont.h>
  812. #endif /* INCL_DDIFONTSTRUCS */
  813.  
  814. #ifdef INCL_DDIBITMAPFILE
  815.    #include <pmbitmap.h>
  816. #endif /* INCL_DDIBITMAPFILE */
  817.  
  818. #ifdef INCL_DDIPATHS
  819. #ifndef INCL_32
  820.    /* Signatures of Path data structures */
  821.  
  822.    #define SUBPATH_IDENTIFIER           0x53
  823.    #define PATH_IDENTIFIER              0x50
  824.    #define PATHSEGMENT_IDENTIFIER       0x5350
  825. #endif
  826.    /* Curve types */
  827.  
  828.    #define CURVE_IDENTIFIER             0x43
  829.    #define LINE_IDENTIFIER              0x4C
  830. #ifndef INCL_32
  831.    #define FILLET_SHARP_IDENTIFIER      0x46
  832.    #define FILLET_EQN_IDENTIFIER        0x45
  833.    #define CURVEATTR_IDENTIFIER         0x41
  834.  
  835.    /* Subpath types */
  836.  
  837.    #define SUBPATH_CLOSED               0x43
  838.    #define SUBPATH_OPEN                 0x4F
  839.  
  840.    /* Path types */
  841.  
  842.    #define BEGINAREA_IDENTIFIER         0x41
  843.    #define BEGINPATH_IDENTIFIER         0x50
  844.    #define PATHSEGMENT_FORMAT_16_16     1
  845.  
  846.    /* Flags for curve data structures */
  847.  
  848.    #define CURVE_FIRST_IN_SUBPATH       0x0001
  849. #endif
  850.    #define CURVE_DO_FIRST_PEL           0x0002
  851. #ifndef INCL_32
  852.    #define CURVE_GOES_UP                0x0004
  853.    #define CURVE_IS_HORIZONTAL          0x0008
  854.    #define CURVE_IS_X_MAJOR             0x0010
  855.    #define CURVE_GOES_LEFT              0x0020
  856.    #define CURVE_FIRST_CARVED           0x0040
  857.    #define CURVE_HALF_COOKED            0x0400
  858.    #define CURVE_IS_ABOVE_OR_RIGHT      0x0800
  859.    /* Flags for SubPath data structures */
  860.  
  861.    #define SUBPATH_DO_FIRST_PEL         0x0002
  862.  
  863.    /* Flags for Path data structures */
  864.  
  865.    #define PATH_HAS_LINES_PRESENT       0x4000
  866.    #define PATH_HAS_CONICS_PRESENT      0x8000
  867.  
  868.    /* Data structures to support the Path API                    */
  869.  
  870.    /* The CURVE, LINE, FILLETSHARP, and FILLETEQN structures     */
  871.    /* must all be the same size.  The reason being is that       */
  872.    /* certain portions of the engine code assume an equivalency  */
  873.    /* in the structure sizes for list manipulations.             */
  874. #endif
  875.  
  876. #ifdef INCL_32
  877.    typedef struct _CURVE { /* cv */
  878.       BYTE        bIdent;             /*  1    1  */
  879.       BYTE        bType;              /*  1    2  */
  880.       USHORT      usReserved;         /*  2    4  */
  881.       ULONG       flStyle;            /*  4    8  */
  882.       ULONG       fl;                 /*  4   12  */
  883.       struct      _CURVE *pcvNext;    /*  4   16  */
  884.       struct      _CURVE *pcvPrev;    /*  4   20  */
  885.       struct      _CURVE *pcvAttrs;   /*  4   24  */
  886.       POINTFX     ptfxA;              /*  8   32  */
  887.       POINTFX     ptfxC;              /*  8   40  */
  888.       BYTE        Reserved2[28];      /* 28   68  */
  889.    } CURVE;
  890.    typedef CURVE FAR *PCURVE;
  891.  
  892.    typedef struct _LINE { /* ln */
  893.       BYTE        bIdent;             /*  1    1  */
  894.       BYTE        bType;              /*  1    2  */
  895.       USHORT      usReserved;         /*  2    4  */
  896.       ULONG       flStyle;            /*  4    8  */
  897.       ULONG       fl;                 /*  4   12  */
  898.       PCURVE      pcvNext;            /*  4   16  */
  899.       PCURVE      pcvPrev;            /*  4   20  */
  900.       PCURVE      pcvAttrs;           /*  4   24  */
  901.       POINTFX     ptfxA;              /*  8   32  */
  902.       POINTFX     ptfxC;              /*  8   40  */
  903.       POINTL      ptlA;               /*  8   48  */
  904.       POINTL      ptlC;               /*  8   56  */
  905.       FIXED       fxRslope;           /*  4   60  */
  906.       BYTE        Reserved1[8];       /*  8   68  */
  907.    } LINE;
  908.    typedef LINE FAR *PLINE;
  909. #else
  910.    typedef struct _CURVE { /* cv */
  911.       BYTE    bIdent;
  912.       BYTE    bType;
  913.       USHORT  usStyle;
  914.       USHORT  fs;
  915.       struct  _CURVE NEAR *npcvNext;
  916.       struct  _CURVE NEAR *npcvPrev;
  917.       struct  _CURVE NEAR *npcvAttrs;
  918.       POINTFX ptfxA;
  919.       POINTFX ptfxC;
  920.       BYTE    Reserved2[16];
  921.    } CURVE;
  922.    typedef CURVE FAR *PCURVE;
  923.    typedef CURVE NEAR *NPCURVE;
  924.  
  925.    typedef struct _LINE { /* ln */
  926.       BYTE    bIdent;
  927.       BYTE    bType;
  928.       USHORT  usStyle;
  929.       USHORT  fs;
  930.       CURVE   NEAR *npcvNext;
  931.       CURVE   NEAR *npcvPrev;
  932.       CURVE   NEAR *npcvAttrs;
  933.       POINTFX ptfxA;
  934.       POINTFX ptfxC;
  935.       POINTS  ptsA;
  936.       POINTS  ptsC;
  937.       FIXED   lRslope;
  938.       BYTE    Reserved2[4];
  939.    } LINE;
  940.    typedef LINE FAR *PLINE;
  941.    typedef LINE NEAR *NPLINE;
  942.  
  943.    typedef struct _FILLETEQN { /* fse */
  944.       BYTE    bIdent;
  945.       BYTE    bType;
  946.       USHORT  usReferences;
  947.       POINTS  ptsA;
  948.       POINTS  ptsC;
  949.       POINTS  ptsB;
  950.       USHORT  usNumerator;
  951.       USHORT  usDenominator;
  952.       LONG    lAlpha;
  953.       LONG    lBeta;
  954.       LONG    lGamma;
  955.       LONG    lDelta;
  956.       LONG    lEpsilon;
  957.       LONG    lZeta;
  958.    } FILLETEQN;
  959.    typedef FILLETEQN FAR *PFILLETEQN;
  960.    typedef FILLETEQN NEAR *NPFILLETEQN;
  961.  
  962.    typedef struct _FILLETSHARP { /* fs */
  963.       BYTE    bIdent;
  964.       BYTE    bType;
  965.       USHORT  usStyle;
  966.       USHORT  fs;
  967.       CURVE   NEAR *npcvNext;
  968.       CURVE   NEAR *npcvPrev;
  969.       CURVE   NEAR *npcvAttrs;
  970.       POINTFX ptfxA;
  971.       POINTFX ptfxC;
  972.       POINTFX ptfxB;
  973.       FIXED   lSharpness;
  974.       FILLETEQN NEAR *npEquation;
  975.       BYTE    Reserved2[2];
  976.    } FILLETSHARP;
  977.    typedef FILLETSHARP FAR *PFILLETSHARP;
  978.    typedef FILLETSHARP NEAR *NPFILLETSHARP;
  979.  
  980.    #ifdef INCL_GPIPRIMITIVES
  981.       typedef struct _CURVEATTR { /* cva */
  982.          BYTE   bIdent;
  983.          BYTE   bType;
  984.          ULONG  flAttrs;        /* which fields have new info */
  985.          BYTE   Reserved1[4];
  986.          CURVE  NEAR *npcvAttrs;
  987.          ULONG  flDefs;         /* which fields have default info */
  988.          LINEBUNDLE     lbnd;   /* the info */
  989.          BYTE   Reserved2[2];
  990.       } CURVEATTR;
  991.       typedef CURVEATTR FAR *PCURVEATTR;
  992.       typedef CURVEATTR NEAR *NPCURVEATTR;
  993.    #endif /* INCL_GPIPRIMITIVES */
  994.  
  995.    typedef struct _SUBPATH { /* sp */
  996.       BYTE    bIdent;
  997.       BYTE    bType;
  998.       USHORT  usStyle;
  999.       USHORT  fs;
  1000.       struct  _SUBPATH NEAR *npspNext;
  1001.       struct  _SUBPATH NEAR *npspPrev;
  1002.       USHORT  ccv;
  1003.       ULONG   flFlags;
  1004.       CURVE   NEAR *npcvFirst;
  1005.       CURVE   NEAR *npcvLast;
  1006.       RECTS   rcsBounding;
  1007.       CURVE   NEAR *npcvAttrs;
  1008.       BYTE    Reserved1[14];
  1009.    } SUBPATH;
  1010.    typedef SUBPATH FAR *PSUBPATH;
  1011.    typedef SUBPATH NEAR *NPSUBPATH;
  1012.  
  1013.    #define PH_FORMAT_IS_16_DOT_16       1
  1014.  
  1015.    typedef struct _PATH { /* ph */
  1016.       BYTE    bIdent;
  1017.       BYTE    bType;
  1018.       USHORT  usFormat;
  1019.       USHORT  usStyle;
  1020.       USHORT  fs;
  1021.       SUBPATH NEAR *npspFirst;
  1022.       SUBPATH NEAR *npspLast;
  1023.       USHORT  csp;
  1024.       ULONG   flFlags;
  1025.       USHORT  usDimension;
  1026.       BYTE    bSubpathType;
  1027.       LONG    alColor;
  1028.       USHORT  ausMixMode;
  1029.       USHORT  ausDefault;
  1030.       POINTL  aptlRefPoint ;
  1031.       CURVE   NEAR *npcvAttrs;
  1032.       BYTE    Reserved1[7];
  1033.    } PATH;
  1034.    typedef PATH FAR *PPATH;
  1035.    typedef PATH NEAR *NPPATH;
  1036.  
  1037.    typedef struct _PATHSEGMENT { /* phs */
  1038.       USHORT  usIdent;
  1039.       SHORT   Reserved0;
  1040.       CURVE   NEAR *npcvFree;
  1041.       USHORT  ccvFree;
  1042.       USHORT  cReferences;
  1043.       USHORT  usSize;
  1044.       PATH    NEAR *npph;
  1045.       BYTE    Reserved1[2];
  1046.       FSRSEM  fsrs;
  1047.    } PATHSEGMENT;
  1048.    typedef PATHSEGMENT FAR *PPATHSEGMENT;
  1049.    typedef PATHSEGMENT NEAR *NPPATHSEGMENT;
  1050.  
  1051.    /* Argument to DrawCookedPath, etc. */
  1052.  
  1053.    typedef struct _PIPELINEINFO { /* pi */
  1054.       CURVE   FAR *pcv;
  1055.       ULONG   ccv;
  1056.    } PIPELINEINFO;
  1057.    typedef PIPELINEINFO FAR *PPIPELINEINFO;
  1058.    typedef PIPELINEINFO NEAR *NPPIPELINEINFO;
  1059.  
  1060. #endif  /* INCL_32 */
  1061.  
  1062. #endif  /* INCL_DDIPATHS */
  1063.  
  1064. #ifdef INCL_GRE_JOURNALING
  1065.    #define JNL_TEMP_FILE            0x00000001L
  1066.    #define JNL_PERM_FILE            0x00000002L
  1067.    #define JNL_ENGINERAM_FILE       0x00000004L
  1068.    #define JNL_USERRAM_FILE         0x00000008L
  1069.    #define JNL_DRAW_OPTIMIZATION    0x00000010L
  1070.    #define JNL_BOUNDS_OPTIMIZATION  0x00000020L
  1071. #endif  /* INCL_GRE_JOURNALING */
  1072.  
  1073.  
  1074. #ifdef INCL_GRE_DEVICE
  1075.  
  1076.    /* QueryDeviceBitmaps */
  1077.  
  1078.    typedef struct _BITMAPFORMAT { /* bmf */
  1079.       ULONG cPlanes;
  1080.       ULONG cBitCount;
  1081.    } BITMAPFORMAT;
  1082.    typedef BITMAPFORMAT FAR *PBITMAPFORMAT;
  1083.  
  1084. #endif /* INCL_GRE_DEVICE */
  1085.  
  1086. #ifdef INCL_GRE_PALETTE
  1087.  
  1088.    typedef struct _PALETTEINFOHEADER { /* palinfohdr */
  1089.         ULONG  flCmd;         /* options from creation                   */
  1090.         ULONG  ulFormat;      /* specifies format of entries at creation */
  1091.         ULONG  cclr;          /* number of elements supplied at creation */
  1092.    } PALETTEINFOHEADER;
  1093.    typedef PALETTEINFOHEADER NEAR *NPPALETTEINFOHEADER;
  1094.    typedef PALETTEINFOHEADER FAR  *PPALETTEINFOHEADER;
  1095.  
  1096.    typedef struct _PALETTEINFO { /* palinfo */
  1097.         ULONG  flCmd;         /* options from creation                   */
  1098.         ULONG  ulFormat;      /* specifies format of entries at creation */
  1099.         ULONG  cclr;          /* number of elements supplied at creation */
  1100.         RGB2   argb[1];       /* the palette entries                     */
  1101.    } PALETTEINFO;
  1102.    typedef PALETTEINFO NEAR *NPPALETTEINFO;
  1103.    typedef PALETTEINFO FAR  *PPALETTEINFO;
  1104.  
  1105.    /* flType values for RealizePalette */
  1106.    #define RP_BACKGROUND                0
  1107.    #define RP_FOREGROUND                1
  1108.    #define RP_DEFAULTSCHANGED           2
  1109.  
  1110. #endif
  1111.  
  1112. #ifdef INCL_GRE_BITMAPS
  1113.    #define LR_CLIPPED   2
  1114.    #define LR_NOTBORDER 0
  1115.    #define LR_BORDER    1
  1116.    #define LR_LEFT      2
  1117.    #define LR_RIGHT     4
  1118. #endif
  1119.  
  1120. /* Flags  for GreOutlinePath */
  1121. #define OPTH_NO_CLIPPING_REQD         0x0001L
  1122. #define OPTH_QRY_PATH_POINTS          0x0002L
  1123.  
  1124. /*** 32-bit cursor/pointer stuff ******************************/
  1125. typedef struct _MCDESCRIPTION { /* mcdesc */
  1126.    PVOID    pMoveCursor;
  1127.    ULONG    ulCodeLength;
  1128.    PVOID    pCursorData;
  1129.    ULONG    ulDataLength;
  1130. }  MCDESCRIPTION;
  1131. typedef MCDESCRIPTION FAR *PMCDESCRIPTION;
  1132.  
  1133. typedef struct _WINCURSORDATA { /* winmc */
  1134.    ULONG      pMoveCursor;
  1135.    ULONG      pMoveCursorAlias;
  1136.    ULONG      pCursorData;
  1137.    ULONG      pCursorDataAlias;
  1138.    ULONG      ulRoutineType;
  1139.    HMODULE    hModDisplay;
  1140.    PVOID      pWCThunkCode;
  1141.    ULONG      ulThunkLen;
  1142.    USHORT     usR0CS;
  1143.    USHORT     usR0DS;
  1144. }  WINCURSORDATA;
  1145. typedef WINCURSORDATA FAR *PWINCURSORDATA;
  1146.  
  1147. #define MC_32BIT   32
  1148. #define MC_16BIT   16
  1149.  
  1150. #ifdef INCL_GRE_SCREEN
  1151.  
  1152. /* GetScreenBits */
  1153.  
  1154. typedef LHANDLE   HSCA;     /* hsca */
  1155. typedef HSCA FAR *PHSCA;
  1156.  
  1157. #define GSB_OPT_4BPP    0x0000L
  1158. #define GSB_OPT_8BPP    0x0001L
  1159. #define GSB_OPT_16BPP   0x0002L
  1160. #define GSB_OPT_LINEAR  0x0000L
  1161. #define GSB_OPT_PLANAR  0x0008L
  1162. #define GSB_OPT_HRGN    0x0010L
  1163.  
  1164. #endif /* INCL_GRE_SCREEN */
  1165.  
  1166. #ifdef INCL_VMANDDI
  1167.  
  1168. #define CAPS_MAX_CAPS    41
  1169. #define DEFAULT_PATTERNS_NUMBER 20
  1170.  
  1171. //*******************************************************************************
  1172. // Halftoning and Dithering support for OS/2     
  1173. //*******************************************************************************
  1174.  
  1175. /******************************************************************************/
  1176. /*    PPOINTL     pptlSrc;            // src left, bottom, width and height.  */
  1177. /*    PPOINTL     pptlDst;            // dst left, bottom, width and height.  */
  1178. /*    ULONG       ulSrcBytesPerLine;  // src bytes per line                   */
  1179. /*    PBYTE       pbSrcBits;          // pointer to src image data            */
  1180. /*    ULONG       ulTrgBytesPerLine;  // dst bytes per line                   */
  1181. /*    PBYTE       pbTrgBits;          // pointer to dst image data            */
  1182. /*    ULONG       ulOptions;          // options                              */
  1183. /*    ULONG       ulcClrs;            // count of colors in rgb2 table        */
  1184. /*    PRGB2       pargb2;             // rgb2 table                           */
  1185. /******************************************************************************/
  1186.  
  1187. typedef struct _IMAGEINFOS {        /* imginfo */
  1188.     PPOINTL     pptlSrc;
  1189.     PPOINTL     pptlDst;
  1190.     ULONG       ulSrcBpp;
  1191.     ULONG       ulSrcBytesPerLine;
  1192.     PBYTE       pbSrcBits;
  1193.     ULONG       ulcSrcClrs;
  1194.     ULONG       ulSrcClrType;
  1195.     PRGB2       pargb2Src;
  1196.     ULONG       ulTrgBpp;
  1197.     ULONG       ulTrgBytesPerLine;
  1198.     PBYTE       pbTrgBits;
  1199.     ULONG       ulcTrgClrs;
  1200.     ULONG       ulTrgClrType;
  1201.     PRGB2       pargb2Trg;
  1202.     ULONG       ulOptions;
  1203. } IMAGEINFOS;
  1204. typedef IMAGEINFOS * PIMAGEINFO;    /* pimginfo */
  1205.  
  1206. #define  GDM_NO_DITHER               0x0000   // No dithering in system
  1207. #define  GDM_USERDEF_DITHER          0x0001   // Users supplies own Dithering routines
  1208. #define  GDM_MATRIX_DITHER           0x0002   // Use System ordered dithering
  1209. #define  GDM_ERRORDIF_DITHER         0x0004   // Use System error diffusion dithering
  1210. #define  GDM_FLOYDSTEIN_DITHER       0x0008   // Use System Floyd-Steinberg dithering
  1211. #define  GDM_ERRORPROP_DITHER        0x0010   // Use System error propigation dithering
  1212.  
  1213. /*******************************************************************************************/
  1214. /*    ULONG       ulLength;      // Length of dither matrix structure                      */
  1215. /*    ULONG       fExt2IntSup;   // Gre Dither Flags for Ext to Int                        */
  1216. /*    PVOID       pExt2IntDI;    // Used for GDM_USERDEF - pointer to users dither info    */
  1217. /*    ULONG       fStretchSup;   // Gre Dither Flags for Stretch Support                   */
  1218. /*    PVOID       pStretchDI;    // Used for GDM_USERDEF - pointer to users dither info    */
  1219. /*    ULONG       fLog2PhysSup;  // Gre Dither Flags for Log to Phys clr mapping           */
  1220. /*    PVOID       pLog2PhysDI;   // Used for GDM_USERDEF - pointer to users dither info    */
  1221. /*    PFN         pfnDither;     // Used for GDM_USERDEF - pointer to users dither function*/
  1222. /*******************************************************************************************/
  1223.  
  1224. typedef struct _DITHERMATRIX { /* dthmtx */
  1225.     ULONG       ulLength;      
  1226.     ULONG       fExt2IntSup;   
  1227.     PVOID       pExt2IntDI;    
  1228.     ULONG       fStretchSup;   
  1229.     PVOID       pStretchDI;    
  1230.     ULONG       fLog2PhysSup;  
  1231.     PVOID       pLog2PhysDI;   
  1232.     PFN         pfnDither;     
  1233. } DITHERMATRIX;
  1234. typedef DITHERMATRIX FAR *PDITHERMATRIX;  /* pdthmtx */
  1235.     
  1236. #define  GDM_EXT2INT_DITHER   0x01
  1237. #define  GDM_STRETCH_DITHER   0x02
  1238. #define  GDM_LOG2PHY_DITHER   0x04
  1239.  
  1240. // pfnDither(PDITHERINFO pdi, PIMAGEINFO pii, ULONG ulFlags);
  1241.  
  1242. /*******************************************************************************************/
  1243. /*    ULONG       ulLength;      // length of structure                 - 88               */
  1244. /*    ULONG       ulType;        // type of dither info structure       - GDM_MATRIX_DITHER*/
  1245. /*    ULONG       fOptions;      // dither info options - DI_MONOINVERT - 00               */
  1246. /*    ULONG       ulIntensity;   // RGB Gama Correction Value           - 00
  1247. /*    BYTE        bRedWt;        // weight of primary color red         - 25               */
  1248. /*    BYTE        bGreenWt;      // weight of primary color green       - 60               */
  1249. /*    BYTE        bBlueWt;       // weight of primary color blue        - 15               */
  1250. /*    BYTE        bPad;          // 4 byte align                        - 00               */
  1251. /*    SIZEL       szMatrix;      // halftone pattern size               - 8                */
  1252. /*    BYTE        bHalftone[];   // array of halftone patterns          - see 32gdata.c    */
  1253. /*******************************************************************************************/
  1254.  
  1255. typedef struct _MATRIXDITHERINFO {    /* mtrxdi */
  1256.     ULONG       ulLength;      
  1257.     ULONG       ulType;        
  1258.     ULONG       fOptions;      
  1259.     ULONG       ulIntensity;
  1260.     BYTE        bRedWt;        
  1261.     BYTE        bGreenWt;      
  1262.     BYTE        bBlueWt;       
  1263.     BYTE        bPad;          
  1264.     SIZEL       szMatrix;      
  1265.     BYTE        bHalftone[1];
  1266. } MATRIXDITHERINFO;
  1267. typedef MATRIXDITHERINFO FAR *PMDI;  /* pmtrxdi */
  1268.  
  1269. typedef struct _DEVICESURFACE  {       /* devsur */
  1270.    ULONG         ulLength;
  1271.    BMAPINFO      SurfaceBmapInfo;
  1272.    ULONG         ulDSFlgs;
  1273.    ULONG         ulStyleRatio;
  1274.    BMAPINFO      abmapinfoDefPattern[DEFAULT_PATTERNS_NUMBER];
  1275.    PVOID         pHWPalette;
  1276.    DITHERMATRIX  DitherMatrix;
  1277.    PFN           pfnDevLockDC;
  1278.    PFN           pfnDevUnLockDC;
  1279.    PFN           pfnBitBlt;
  1280.    PFN           pfnLine;
  1281.    PFN           pfnReserved;
  1282.    PFN           pfnLockPhysDev;
  1283.    PFN           pfnUnLockPhysDev;
  1284.    ULONG         ulReserved[5];
  1285.    ULONG         ulCapsCnt;
  1286.    ULONG         DevCaps[CAPS_MAX_CAPS + 1];
  1287. } DEVICESURFACE; 
  1288. typedef DEVICESURFACE  FAR *PDEVICESURFACE; /* pdevsur */
  1289.  
  1290. APIRET APIENTRY GreSetDitherInfo(HDC hdc, ULONG ulDitherType, PVOID pDitherInfo);
  1291. APIRET APIENTRY SetDeviceSurface(HDC hdc, PDEVICESURFACE pds);
  1292.  
  1293. // Surface definition flags
  1294.  
  1295. #define DS_COLOR_RGB2            0  // color is in RGB2             (default)
  1296. #define DS_COLOR_RGB             1  // color is in RGB 
  1297.  
  1298. #define DS_COLOR_24BIT_BGR       0  // 1st byte=blue,               (default)
  1299.                                     // 2nd byte=green 3rd byte=red
  1300. #define DS_COLOR_24BIT_RGB       1  // 1st byte=red, 2nd byte=green 
  1301.                                     // 3rd byte=blue
  1302.  
  1303. #define DS_COLOR_16BIT_565_BGR   0  // blue - 5 bits,               (default)
  1304.                                     // green - 6 bits, red - 5 bits
  1305.                                     // ---------------------------------
  1306.                                     // |b|b|b|b|b|g|g|g|g|g|g|r|r|r|r|r|
  1307.                                     // ---------------------------------
  1308. #define DS_COLOR_16BIT_565_RGB   1  // red - 5 bits, 
  1309.                                     // green - 6 bits, blue - 5 bits
  1310.                                     // ---------------------------------
  1311.                                     // |r|r|r|r|r|g|g|g|g|g|g|b|b|b|b|b|
  1312.                                     // ---------------------------------
  1313. #define DS_COLOR_16BIT_1555_RGB  2  // overlay - 1, red - 5 bits, 
  1314.                                     // green - 5 bits, blue - 5 bits
  1315.                                     // ---------------------------------
  1316.                                     // |o|r|r|r|r|r|g|g|g|g|g|b|b|b|b|b|
  1317.                                     // ---------------------------------
  1318.  
  1319. #define DS_BOTTOMTOP                0x00010000
  1320. #define DS_TOPBOTTOM                0x00020000
  1321.  
  1322. #define DS_BYTEALIGN                0x00000010
  1323. #define DS_WORDALIGN                0x00000020
  1324. #define DS_DWORDALIGN               0x00000040
  1325.  
  1326. #define DS_KEEP_EXTFORMAT           0x00000100
  1327. #define DS_MONO_INVERT              0x00000200
  1328.  
  1329. #define DS_EXTERNAL_BITMAP_SELECTED 0x00000400  
  1330.  
  1331. #define DS_NOTIFY_LAST_SDBITBLT     0x00000800  
  1332.  
  1333. #define DS_QUEUED_RAW_DEFAULT       0x00001000
  1334.  
  1335. #define DS_BITBLT_BANDING_TOPBOTTOM 0x00010000
  1336. #define DS_BITBLT_ROTATE_90         0x00020000
  1337. #define DS_BITBLT_ROTATE_180        0x00040000
  1338. #define DS_BITBLT_ROTATE_270        0x00080000
  1339.  
  1340.  
  1341.  
  1342. #endif /* INCL_VMANDDI */
  1343.  
  1344. #include <pmddim.h>
  1345.  
  1346. /* NOINC */
  1347. #ifdef __IBMC__
  1348.    #pragma checkout( suspend )
  1349.       #ifndef __CHKHDR__
  1350.          #pragma checkout( resume )
  1351.       #endif
  1352.    #pragma checkout( resume )
  1353. #endif
  1354. /* INC */
  1355.  
  1356. /**************************** end of file **********************************/
  1357.