home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / warphead.zip / H / PMDDI.H < prev    next >
C/C++ Source or Header  |  1997-08-17  |  48KB  |  1,432 lines

  1. /****************************** Module Header ******************************\
  2. *
  3. * Module Name: PMDDI.H
  4. *
  5. * OS/2 Presentation Manager entry points, macros, and types for the
  6. * Graphics Engine.
  7. *
  8. * Copyright (c) International Business Machines Corporation 1981, 1988-1992
  9. *
  10. * ===========================================================================
  11. *
  12. * The following symbols are used in this file for conditional sections.
  13. *
  14. *   #define:                To include:
  15. *
  16. *   INCL_DDIGRE             don't want OS2DEF, PMGPI, and PMDEV included
  17. *   INCL_DDIDEFS            don't want the above, but do want GRE structs
  18. *
  19. * It is expected that callers of the Engine will want to define INCL_DDIGRE
  20. * and possibly INCL_DDIDEFS.  The Engine itself and device drivers define
  21. * neither of these.
  22. *
  23. * Further defines must be made to specify which of the GRE function macros
  24. * should be defined.
  25. *
  26. *   #define:                To include:
  27. *
  28. *   INCL_GREALL           All of the following
  29. *   INCL_GRE_ARCS         Arcs functions
  30. *   INCL_GRE_BITMAPS      Bitmap functions
  31. *   INCL_GRE_CLIP            etc...
  32. *   INCL_GRE_COLORTABLE
  33. *   INCL_GRE_DCS
  34. *   INCL_GRE_PAX
  35. *   INCL_GRE_DEVICE
  36. *   INCL_GRE_DEVMISC
  37. *   INCL_GRE_DEVSUPPORT
  38. *   INCL_GRE_FONTS
  39. *   INCL_GRE_INKPATH
  40. *   INCL_GRE_JOURNALING
  41. *   INCL_GRE_LCID
  42. *   INCL_GRE_LINES
  43. *   INCL_GRE_MARKERS
  44. *   INCL_GRE_PALETTE
  45. *   INCL_GRE_PATHS
  46. *   INCL_GRE_PICK
  47. *   INCL_GRE_POLYGON
  48. *   INCL_GRE_REGIONS
  49. *   INCL_GRE_SCANS
  50. *   INCL_GRE_SETID
  51. *   INCL_GRE_STRINGS
  52. *   INCL_GRE_XFORMS
  53. *
  54. * ===========================================================================
  55. *
  56. * Comments at the end of each typedef line give the name tags used in
  57. * the assembler include version of this file.
  58. *
  59. * The assembler include version of this file excludes lines between NOINC
  60. * and INC comments.
  61. *
  62. \***************************************************************************/
  63. /* NOINC */
  64. #if __IBMC__ || __IBMCPP__
  65.    #pragma info( none )
  66.    #ifndef __CHKHDR__
  67.       #pragma info( none )
  68.    #endif
  69.    #pragma info( restore )
  70. #endif
  71. #ifdef __cplusplus
  72.       extern "C" {
  73. #endif
  74. /* INC */
  75.  
  76. #define DDI_INCLUDED
  77.  
  78.  
  79. #ifdef INCL_GREALL
  80.    #define INCL_GRE_ARCS
  81.    #define INCL_GRE_BITMAPS
  82.    #define INCL_GRE_CLIP
  83.    #define INCL_GRE_COLORTABLE
  84.    #define INCL_GRE_DCS
  85.    #define INCL_GRE_PAX
  86.    #define INCL_GRE_DEVICE
  87.    #define INCL_GRE_DEVMISC
  88.    #define INCL_GRE_DEVSUPPORT
  89.    #define INCL_GRE_FONTS
  90.    #define INCL_GRE_INKPATH
  91.    #define INCL_GRE_JOURNALING
  92.    #define INCL_GRE_LCID
  93.    #define INCL_GRE_LINES
  94.    #define INCL_GRE_MARKERS
  95.    #define INCL_GRE_PALETTE
  96.    #define INCL_GRE_PATHS
  97.    #define INCL_GRE_PICK
  98.    #define INCL_GRE_POLYGON
  99.    #define INCL_GRE_REGIONS
  100.    #define INCL_GRE_SCANS
  101.    #define INCL_GRE_SCREEN
  102.    #define INCL_GRE_SETID
  103.    #define INCL_GRE_STRINGS
  104.    #define INCL_GRE_XFORMS
  105. #endif /* INCL_GREALL */
  106.  
  107. #ifdef INCL_GRE_DEVMISC
  108.    #define INCL_GRE_DEVMISC1
  109.    #define INCL_GRE_DEVMISC2
  110.    #define INCL_GRE_DEVMISC3
  111. #endif  /* INCL_GRE_DEVMISC */
  112.  
  113.  
  114. /*** Engine dispatch tables ************************************************/
  115.  
  116. #define MAXTABLEENTRIES        223
  117. #define NUMBEROFMAJORFUN       MAXTABLEENTRIES
  118. #define NUMBEROFMINORFUN       86
  119.  
  120. typedef struct _DISPATCHER    /* dr */
  121. {
  122.    PFN    pfnTblEntry[MAXTABLEENTRIES];
  123. } DISPATCHER;
  124. typedef DISPATCHER *PDISPATCHER;
  125.  
  126. typedef struct _FUNINFOTABLE    /* fit */
  127. {
  128.    BYTE   FunInfo_00[NUMBEROFMAJORFUN];
  129.    BYTE   FunInfo_02[NUMBEROFMINORFUN];
  130. } FUNINFOTABLE;
  131. typedef FUNINFOTABLE *PFUNINFOTABLE;
  132.  
  133. /*** exported Engine DDI functions *****************************************/
  134.  
  135. LONG  APIENTRY SetDriverInfo(ULONG hDrv,
  136.                              LHANDLE hEng,
  137.                              ULONG ulIndex,
  138.                              HDC hdc);
  139.  
  140. LONG  APIENTRY GetDriverInfo(LHANDLE hEng,
  141.                              ULONG ulIndex,
  142.                              HDC hdc);
  143.  
  144. #ifdef __cplusplus
  145. LONG  APIENTRY PostDeviceModes(PDRIVDATA pDrvData,
  146.                                PCSZ  pszDrvName,
  147.                                PCSZ  pszDevName,
  148.                                PCSZ  pszPrtName,
  149.                                ULONG ulOptions);
  150. #else
  151. LONG  APIENTRY PostDeviceModes(PDRIVDATA pDrvData,
  152.                                PSZ pszDrvName,
  153.                                PSZ pszDevName,
  154.                                PSZ pszPrtName,
  155.                                ULONG ulOptions);
  156. #endif
  157.  
  158. #ifdef __cplusplus
  159. LONG  APIENTRY PostEscape(PCSZ  pszDrvName,
  160.                           PCSZ  pszDevName,
  161.                           PCSZ  pszQueueName,
  162.                           PCSZ  pszSplPrinterName,
  163.                           ULONG ulFuncNum,
  164.                           ULONG cbParm1,
  165.                           PBYTE pbParm1,
  166.                           ULONG cpParm2,
  167.                           PBYTE pbParm2);
  168. #else
  169. LONG  APIENTRY PostEscape(PSZ pszDrvName,
  170.                           PSZ pszDevName,
  171.                           PSZ pszQueueName,
  172.                           PSZ pszSplPrinterName,
  173.                           ULONG ulFuncNum,
  174.                           ULONG cbParm1,
  175.                           PBYTE pbParm1,
  176.                           ULONG cpParm2,
  177.                           PBYTE pbParm2);
  178. #endif
  179.  
  180. BOOL  APIENTRY GreInitialize(VOID);
  181.  
  182. ULONG APIENTRY SSAllocMem(PVOID ppAddr,
  183.                           ULONG ulSize,
  184.                           ULONG ulReserved);
  185.  
  186. ULONG APIENTRY SSFreeMem(PVOID pAddr);
  187.  
  188. /*** define common types in the Engine and DDI *****************************/
  189.  
  190. typedef struct _RECTS   /* rcs */
  191. {
  192.    POINTS pts1;
  193.    POINTS pts2;
  194. } RECTS;
  195. typedef RECTS *PRECTS;
  196.  
  197. /* NOINC */
  198. #ifndef POINTFX_DEFINED
  199.    #define POINTFX_DEFINED
  200.    /* INC */
  201.    typedef struct _POINTFX   /* ptfx */
  202.    {
  203.       FIXED x;
  204.       FIXED y;
  205.    } POINTFX;
  206.    typedef POINTFX *PPOINTFX;
  207.    /* NOINC */
  208. #endif
  209. /* INC */
  210.  
  211. typedef struct _RECTFX   /* rcfx */
  212. {
  213.    POINTFX ptfx1;
  214.    POINTFX ptfx2;
  215. } RECTFX;
  216. typedef RECTFX *PRECTFX;
  217.  
  218. typedef struct _XFORM   /* xform */
  219. {
  220.    FIXED fxM11;
  221.    FIXED fxM12;
  222.    FIXED fxM21;
  223.    FIXED fxM22;
  224.    LONG  lM41;
  225.    LONG  lM42;
  226. } XFORM;
  227. typedef XFORM *PXFORM;
  228.  
  229. typedef LONG LCID;      /* locally-coded id */
  230. typedef LCID *PLCID;
  231. typedef LONG PHID;      /* path id */
  232. typedef ULONG HDEVPAL;
  233.  
  234. #ifdef INCL_GRE_HFONT
  235.    typedef LHANDLE HFONT;       /* font handle */
  236. #endif /* INCL_GRE_HFONT */
  237.  
  238. #ifdef INCL_DDICOMFLAGS
  239.    #define COM_DRAW16                      0x00000001L
  240.    #define COM_BOUND16                     0x00000002L
  241.    #define COM_CORRELATE16                 0x00000004L
  242.    #define COM_ALT_BOUND16                 0x00000008L
  243.    #define COM_AREA16                      0x00000010L
  244.    #define COM_PATH16                      0x00000020L
  245.    #define COM_TRANSFORM16                 0x00000040L
  246.    #define COM_RECORDING16                 0x00000080L
  247.    #define COM_DEVICE16                    0x00000100L
  248.    #define COM_SCR_BOUND16                 0x00000200L
  249.    #define COM_PRECLIP16                   0x04000000L
  250.    
  251.    #define COM_DRAW                        0x00010000L
  252.    #define COM_BOUND                       0x00020000L
  253.    #define COM_CORRELATE                   0x00040000L
  254.    #define COM_ALT_BOUND                   0x00080000L
  255.    #define COM_AREA                        0x00100000L
  256.    #define COM_PATH                        0x00200000L
  257.    #define COM_TRANSFORM                   0x00400000L
  258.    #define COM_RECORDING                   0x00800000L
  259.    #define COM_DEVICE                      0x01000000L
  260.    #define COM_SCR_BOUND                   0x02000000L
  261.    #define COM_PRECLIP                     0x04000000L
  262. #endif /* INCL_DDICOMFLAGS */
  263.  
  264. #ifdef INCL_GRE_ARCS
  265.    
  266.    /* BoxBoundary */
  267.    /* BoxInterior */
  268.    /* BoxBoth */
  269.    
  270.    typedef struct _BOXPARAMS      /* boxp */
  271.    {
  272.       POINTL ptl;
  273.       SIZEL  sizl;
  274.    } BOXPARAMS;
  275.    typedef BOXPARAMS *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.    {
  303.       ULONG cx;
  304.       ULONG cy;
  305.    } VIEWPORTSIZE;
  306.    typedef VIEWPORTSIZE *PVIEWPORTSIZE;
  307.    
  308. #endif /* INCL_GRE_XFORMS */
  309.  
  310. #ifdef INCL_GRE_DEVSUPPORT
  311.    
  312.    /* Constants for GreInitializeAttributes */
  313.    
  314.    #define INAT_DEFAULTATTRIBUTES       1L
  315.    #define INAT_CURRENTATTRIBUTES       2L
  316.    
  317.    /* InvalidateVisRegion */
  318.    
  319.    typedef struct _DC_BLOCK   /* ivr */
  320.    {
  321.       ULONG hdc;
  322.       ULONG hddc;
  323.    } DC_BLOCK;
  324.    typedef DC_BLOCK *PDC_BLOCK;
  325.    
  326.    /* Constants for DeviceEnableYInversion */
  327.    
  328.    #define CAP_YINVERT_NONE                 0x00000000L
  329.    #define CAP_YINVERT_CHARSTRINGPOS        0x00000001L
  330.    #define CAP_YINVERT_CHARSTRING           0x00000002L
  331.    #define CAP_YINVERT_QUERYTEXTBOX         0x00000004L
  332.    #define CAP_YINVERT_QUERYCHARPOSITIONS   0x00000008L
  333.    #define CAP_YINVERT_DONTCARE             0x80000000L
  334.    #define CAP_YINVERT_IMPLEMENTED          CAP_YINVERT_CHARSTRINGPOS
  335.    
  336. #endif /* INCL_GRE_DEVSUPPORT */
  337.  
  338. #ifdef INCL_GRE_FONTS
  339.    
  340.    /* QueryCodePageObject */
  341.    
  342.    typedef ULONG GLYPH;
  343.    typedef ULONG *PGLYPH;
  344.    
  345.    /* NOINC */
  346.    typedef  ULONG (* APIENTRY PXLATECHAR)(PVOID object,
  347.                    ULONG ulCod,
  348.                    PGLYPH pGly);
  349.    typedef  ULONG (* APIENTRY PXLATESTRING)(PVOID object,
  350.                    PUCHAR pchCod,
  351.                    ULONG  ulCodLen,
  352.                    PGLYPH pGly,
  353.                    PULONG pulGlyLen,
  354.                    ULONG flOptions);
  355.    typedef  ULONG (* APIENTRY PINVXLATECHAR)(PVOID object,
  356.                    GLYPH gGly,
  357.                    PULONG pulCod);
  358.    typedef  ULONG (* APIENTRY PINVXLATESTRING)(PVOID object,
  359.                    PGLYPH pGly,
  360.                    ULONG ulGlyLen,
  361.                    PUCHAR pchCod,
  362.                    PULONG pulCodLen,
  363.                    ULONG flOptions);
  364.    typedef struct _CPOBJMEMBERS    /* cpm */
  365.    {
  366.       PXLATECHAR  pfnXlateChar;
  367.       PXLATESTRING pfnXlateString;
  368.       PINVXLATECHAR pfnInvXlateChar;
  369.       PINVXLATESTRING pfnInvXlateString;
  370.    } CPOBJMEMBERS;
  371.    typedef CPOBJMEMBERS *PCPOBJMEMBERS;
  372.    
  373.    typedef struct _CODEPAGEOBJECT    /* cpo */
  374.    {
  375.       ULONG    Identity;
  376.       ULONG    ulCodePage;
  377.       UCHAR    szGlyphList[16];
  378.       ULONG    fl;
  379.       PUCHAR   pDbcsEnv;
  380.       ULONG    ulReserved;
  381.       CPOBJMEMBERS Member;
  382.    } CODEPAGEOBJECT;
  383.    typedef CODEPAGEOBJECT *PCODEPAGEOBJECT;
  384.    /* INC */
  385.    
  386.    #define  CPO_SBCS_CODEPAGE    0x00000001L
  387.    #define  CPO_MBCS_CODEPAGE    0x00000002L
  388.    #define  CPO_DBCS_CODEPAGE    0x00000004L
  389.    
  390. #endif /* INCL_GRE_FONTS */
  391.  
  392. #ifdef INCL_GRE_STRINGS
  393.    
  394.    /* QueryCharoutline */
  395.    
  396.    #define  QCO_FORMAT_GOCA      0x00000001L
  397.    #define  QCO_FORMAT_IFI       0x00000002L
  398.    #define  QCO_NO_TRANSFORM     0x00000004L
  399.    #define  QCO_UNICODE          0x00000008L
  400.    
  401.    /* QueryCharMetricsTable */
  402.    
  403.    typedef struct _CHARMETRICS    /* cm */
  404.    {
  405.       LONG     lA;
  406.       ULONG    ulB;
  407.       LONG     lC;
  408.       RECTL    rclBoundBox;
  409.    } CHARMETRICS;
  410.    typedef CHARMETRICS *PCHARMETRICS;
  411.    
  412.    #define QCMT_NO_TRANSFORM     0x00000001L
  413.    
  414.    /* RealizeString */
  415.    
  416.    #define RS_NO_TRANSLATION     0x00000001L
  417.    #define RS_UNICODE            0x00000002L
  418.    #define RS_FONT_CACHE         0x00000004L
  419.    #define RS_CREATE_FTA         0x00000008L
  420.    #define RS_DESTROY_FTA        0x00000010L
  421.    #define RS_DELETE_CHARS       0x00000020L
  422.    #define RS_COPY_CHARS         0x00000040L
  423.    
  424. #endif /* INCL_GRE_STRINGS */
  425.  
  426. #ifdef INCL_DDIMISC
  427.    
  428.    /* Display information resource structure (RT_DISPLAYINFO) */
  429.    typedef struct _DISPLAYINFO           /* dspinfo */
  430.    {
  431.       USHORT cb;
  432.       SHORT cxIcon;
  433.       SHORT cyIcon;
  434.       SHORT cxPointer;
  435.       SHORT cyPointer;
  436.       SHORT cxBorder;
  437.       SHORT cyBorder;
  438.       SHORT cxHSlider;
  439.       SHORT cyVSlider;
  440.       SHORT cxSizeBorder;
  441.       SHORT cySizeBorder;
  442.       SHORT cxDeviceAlign;
  443.       SHORT cyDeviceAlign;
  444.    } DISPLAYINFO;
  445.    typedef DISPLAYINFO *PDISPLAYINFO;
  446.    
  447.    /* Parameters for the DC Enable function */
  448.    
  449.    typedef struct _DENPARAMS   /* den */
  450.    {
  451.       ULONG ulStateInfo;
  452.       ULONG ulType;
  453.       ULONG ulHDC;
  454.    } DENPARAMS;
  455.    typedef DENPARAMS *PDENPARAMS;
  456.    
  457.    
  458.    typedef struct _STYLERATIO   /* sr */
  459.    {
  460.       BYTE dx;
  461.       BYTE dy;
  462.    } STYLERATIO;
  463.    typedef STYLERATIO *PSTYLERATIO;
  464.    
  465.    /* Options flags for SetGlobalAttribute */
  466.    
  467.    #define GATTR_DEFAULT                   1L
  468.    
  469.    /* Attribute Types for SetGlobalAttribute */
  470.    
  471.    #define ATYPE_COLOR                     1L
  472.    #define ATYPE_BACK_COLOR                2L
  473.    #define ATYPE_MIX_MODE                  3L
  474.    #define ATYPE_BACK_MIX_MODE             4L
  475.    
  476.    /* Options for CharStringPos */
  477.    
  478.    #define CHS_START_XY                    0x00000020L
  479.    #define CHS_ATTR_INFO                   0x00000040L
  480.    
  481.    typedef struct _CSP_INFO   /* csp */
  482.    {
  483.       LONG  cSize;
  484.       LONG  lColor;
  485.       LONG  lBackColor;
  486.    } CSP_INFO;
  487.    typedef CSP_INFO *PCSP_INFO;
  488.    
  489.    /* Set/GetProcessControl */
  490.    
  491.    #define PCTL_DRAW                       0x00000001L
  492.    #define PCTL_BOUND                      0x00000002L
  493.    #define PCTL_CORRELATE                  0x00000004L
  494.    #define PCTL_USERBOUNDS                 0x00000008L
  495.    #define PCTL_AREA                       0x00000010L
  496.    
  497.    /* ResetBounds */
  498.    
  499.    #define RB_GPI                          0x00000001L
  500.    #define RB_USER                         0x00000002L
  501.    
  502.    /* GetBoundsData */
  503.    
  504.    #define GBD_GPI                         0L
  505.    #define GBD_USER                        1L
  506.    
  507.    /* EndArea Cancel Option */
  508.    
  509.    #define EA_DRAW                         0x00000000L
  510.    #define EA_CANCEL                       0x00000001L
  511.    
  512.    /* Bitblt Style */
  513.    
  514.    #define BLTMODE_SRC_BITMAP              0x00010000L
  515.    #define BLTMODE_ATTRS_PRES              0x00020000L
  516.    #define BBO_TARGWORLD                   0x00000100L
  517.    
  518.    typedef struct _BITBLTPARAMETERS   /* bbp */
  519.    {
  520.       RECTL rclTarg;
  521.       RECTL rclSrc;
  522.    } BITBLTPARAMETERS;
  523.    typedef BITBLTPARAMETERS *PBITBLTPARAMETERS;
  524.    
  525.    typedef struct _BITBLTATTRS   /* bba */
  526.    {
  527.       LONG cSize;
  528.       LONG lColor;
  529.       LONG lBackColor;
  530.    } BITBLTATTRS;
  531.    typedef BITBLTATTRS *PBITBLTATTRS;
  532.    
  533.    /* LCIDs */
  534.    
  535.    #define LCID_AVIO_1                     (-2L)
  536.    #define LCID_AVIO_2                     (-3L)
  537.    #define LCID_AVIO_3                     (-4L)
  538.    #define LCID_BITMAP_ID_REQUEST          (-5L)
  539.    
  540.    #define LCID_RANGE_GPI                  1L
  541.    #define LCID_RANGE_AVIO                 2L
  542.    #define LCID_RANGE_BOTH                 3L
  543.    #define LCID_GRAPHICS_MIN               1
  544.    #define LCID_GRAPHICS_MAX               254
  545.    
  546.    #define LCIDT_NONE                      0L
  547.    
  548.    /* ResetDC */
  549.    
  550.    #define RDC_RGBMODE                     0x1L
  551.    #define RDC_SETOWNERTOSHELL             0x2L
  552.    
  553.    /* SetRandomXform */
  554.    
  555.    #define SX_UNITY                        0L
  556.    #define SX_CAT_AFTER                    1L
  557.    #define SX_CAT_BEFORE                   2L
  558.    #define SX_OVERWRITE                    3L
  559.    
  560.    /* transform accelerators                    */
  561.    /*  These bits are only valid if the MATRIX_SIMPLE bit is set.           */
  562.    /*  The X and Y negate flags are only meaningful if MATRIX_UNITS is set.*/
  563.    
  564.    #define MATRIX_SIMPLE            0x0001L  /* two entries are zero */
  565.    #define MATRIX_UNITS             0x0002L  /* all entries are +1 or -1 */
  566.    #define MATRIX_XY_EXCHANGE       0x0004L  /* zeros are on the diagonal*/
  567.    #define MATRIX_X_NEGATE          0x0008L  /* X is hit by negative */
  568.    #define MATRIX_Y_NEGATE          0x0010L  /* Y is hit by negative */
  569.    #define MATRIX_TRANSLATION       0x0020L  /* non-zero translation */
  570.    
  571.    /* NotifyClipChange */
  572.    
  573.    #define NCC_CLEANDC              0x0002L  /* clear DC dirty bit */
  574.    
  575.    /* NotifyTransformChange */
  576.    
  577.    typedef struct _NOTIFYTRANSFORMDATA   /* ntd */
  578.    {
  579.       ULONG  usType;
  580.       XFORM  xform;
  581.    } NOTIFYTRANSFORMDATA;
  582.    typedef NOTIFYTRANSFORMDATA *PNOTIFYTRANSFORMDATA;
  583.    
  584.    /* ColorTable */
  585.    
  586.    #define LCOL_SYSCOLORS           0x0010L
  587.    
  588.    
  589.    /* query device caps */
  590.    
  591.    typedef struct _QCDARRAY   /* qcd */
  592.    {
  593.       LONG    iFormat;
  594.       LONG    iSmallest;
  595.       LONG    iLargest;
  596.       LONG    cAvailable;
  597.       LONG    cSpecifiable;
  598.       LONG    iMax;
  599.    } QCDARRAY;
  600.    typedef QCDARRAY *PQCDARRAY;
  601.    
  602.    #define CAPS_MIX_OR                  0x00000001L
  603.    #define CAPS_MIX_COPY                0x00000002L
  604.    #define CAPS_MIX_UNDERPAINT          0x00000004L
  605.    #define CAPS_MIX_XOR                 0x00000008L
  606.    #define CAPS_MIX_INVISIBLE           0x00000010L
  607.    #define CAPS_MIX_AND                 0x00000020L
  608.    #define CAPS_MIX_OTHER               0x00000040L
  609.    
  610.    #define CAPS_DEV_FONT_SIM_BOLD       1L      /* for CAPS_DEVICE_FONT_SIM */
  611.    #define CAPS_DEV_FONT_SIM_ITALIC     2L
  612.    #define CAPS_DEV_FONT_SIM_UNDERSCORE 4L
  613.    #define CAPS_DEV_FONT_SIM_STRIKEOUT  8L
  614.    
  615.    #define CAPS_BACKMIX_OR              0x00000001L
  616.    #define CAPS_BACKMIX_COPY            0x00000002L
  617.    #define CAPS_BACKMIX_UNDERPAINT      0x00000004L
  618.    #define CAPS_BACKMIX_XOR             0x00000008L
  619.    #define CAPS_BACKMIX_INVISIBLE       0x00000010L
  620.    
  621.    
  622.    /*#define CAPS_RASTER_BITBLT         0x00000001L defined in pmdev.h */
  623.    /*#define CAPS_RASTER_BANDING        0x00000002L */
  624.    /*#define CAPS_RASTER_STRETCHBLT     0x00000004L */
  625.    /*#define CAPS_RASTER_SETPEL         0x00000010L */
  626.    #define CAPS_FONT_OUTLINE_MANAGE     16L
  627.    #define CAPS_FONT_IMAGE_MANAGE       32L
  628.    #define SFONT_RASTER                 100
  629.    #define SFONT_OUTLINE                101
  630.    #define FONT              1000       /* must not conflict with RT_XXX */
  631.    /* constants in BSEDOS.H */
  632.    
  633.    /* DCCaps */
  634.    
  635.    #define DCCAPS_LINE                  0x0100
  636.    #define DCCAPS_CURVE                 0x0200
  637.    #define DCCAPS_AREA                  0x0400
  638.    #define DCCAPS_MARKER                0x0800
  639.    #define DCCAPS_TEXT                  0x1000
  640.    
  641.    /* DeviceDeleteBitmap */
  642.    #define BITMAP_USAGE_TRANSLATE       0x0004
  643.    
  644.    /* DeleteBitmap return structure */
  645.    typedef struct _DELETERETURN   /* dr */
  646.    {
  647.       ULONG      pInfo;
  648.       ULONG      pBits;
  649.    } DELETERETURN;
  650.    typedef DELETERETURN *PDELETERETURN;
  651.    
  652.    /* Short Line Header */
  653.    
  654.    #define SLH_FORMAT_IS_16_DOT_16 1
  655.    #define PSL_YMAJOR 0x8000    /* bit mask for usStyle */
  656.    
  657.    typedef struct _SHORTLINEHEADER   /* slh */
  658.    {
  659.       ULONG  ulStyle;
  660.       ULONG  ulFormat;
  661.       POINTL ptlStart;
  662.       POINTL ptlStop;
  663.       LONG   lxLeft;
  664.       LONG   lxRight;
  665.       struct _SHORTLINEHEADER *pslhNext;
  666.       struct _SHORTLINEHEADER *pslhPrev;
  667.    } SHORTLINEHEADER;
  668.    typedef SHORTLINEHEADER *PSHORTLINEHEADER;
  669.    /* Short Line */
  670.    
  671.    typedef struct _SHORTLINE   /* sl */
  672.    {
  673.       SHORTLINEHEADER slh;
  674.       LONG      ax[1];
  675.    } SHORTLINE;
  676.    typedef SHORTLINE *PSHORTLINE;
  677.    
  678.    /* Bounding rectangle for subpaths. */
  679.    
  680.    typedef struct _BRECTL          /* brctl */
  681.    {
  682.       POINTL ptl1;
  683.       POINTL ptl2;
  684.    } BRECTL;
  685.    typedef BRECTL *PBRECTL;
  686.    
  687.    typedef struct _RLEHDR   /* rle */
  688.    {
  689.       LONG     lType;
  690.       BRECTL   brectlBounds;
  691.       PVOID    pRLE;
  692.    } RLEHDR;
  693.    typedef RLEHDR *PRLEHDR;
  694.    
  695.    
  696.    typedef struct _SCANDATA   /* sd */
  697.    {
  698.       PSHORTLINE pslFirstLeft;
  699.       PSHORTLINE pslLastLeft;
  700.       PSHORTLINE pslFirstRight;
  701.       PSHORTLINE pslLastRight;
  702.       ULONG      c;
  703.       RECTL      rclBound;
  704.    } SCANDATA;
  705.    typedef SCANDATA *PSCANDATA;
  706.    
  707.    /* Index for Set/GetDriverInfo */
  708.    
  709.    #define DI_HDC                      0x00000000L
  710.    #define DI_HBITMAP                  0x00000001L
  711.    
  712. #endif  /* INCL_DDIMISC */
  713.  
  714. #ifdef INCL_DDIMISC2
  715.    
  716.    /* RealizeFont */
  717.    
  718.    #define REALIZE_FONT                 1
  719.    #define REALIZE_ENGINE_FONT          2
  720.    #define DELETE_FONT                  3
  721.    
  722.    #define RF_DEVICE_FONT               1
  723.    #define RF_LOAD_ENGINE_FONT          2
  724.    #define RF_DELETE_FONT               3
  725.    #define RF_DELETE_ENGINE_FONT        4
  726.    
  727. #endif  /* INCL_DDIMISC2 */
  728.  
  729. #ifdef INCL_DDIBUNDLES
  730.    
  731.    /* Device Line Bundle */
  732.    
  733.    typedef struct _LINEDEFS   /* ldef */
  734.    {
  735.       ULONG      defType;
  736.    } LINEDEFS;
  737.    typedef LINEDEFS *PLINDEFS;
  738.    
  739.    typedef struct _DLINEBUNDLE   /* dlbnd */
  740.    {
  741.       LONG       cAttr;
  742.       LONG       cDefs;
  743.       LINEBUNDLE lbnd;
  744.       LINEDEFS   ldef;
  745.    } DLINEBUNDLE;
  746.    typedef DLINEBUNDLE *PDLINEBUNDLE;
  747.    
  748.    /* Device Area Bundle */
  749.    
  750.    typedef struct _AREADEFS   /* adef */
  751.    {
  752.       ULONG      defSet;
  753.       ULONG      fFlags;
  754.       ULONG      CodePage;
  755.    } AREADEFS;
  756.    typedef AREADEFS *PAREADEFS;
  757.    
  758.    typedef struct _DAREABUNDLE   /* dabnd */
  759.    {
  760.       LONG       cAttr;
  761.       LONG       cDefs;
  762.       AREABUNDLE abnd;
  763.       AREADEFS   adef;
  764.    } DAREABUNDLE;
  765.    typedef DAREABUNDLE *PDAREABUNDLE;
  766.    
  767.    /* Device Character Bundle */
  768.    
  769.    typedef struct _CHARDEFS   /* cdef */
  770.    {
  771.       ULONG      defSet;
  772.       ULONG      fFlags;
  773.       ULONG      CodePage;
  774.       ULONG      charSpacing;
  775.    } CHARDEFS;
  776.    typedef CHARDEFS *PCHARDEFS;
  777.    
  778.    typedef struct _DCHARBUNDLE   /* dcbnd */
  779.    {
  780.       LONG       cAttr;
  781.       LONG       cDefs;
  782.       CHARBUNDLE cbnd;
  783.       CHARDEFS   cdef;
  784.    } DCHARBUNDLE;
  785.    typedef DCHARBUNDLE *PDCHARBUNDLE;
  786.    
  787.    /* Device Image Bundle */
  788.    
  789.    #ifdef BOGUS
  790.       typedef struct _IMAGEDEFS   /* idef */
  791.       {
  792.       } IMAGEDEFS;
  793.    #endif       /* BOGUS */
  794.    
  795.    typedef struct _DIMAGEBUNDLE   /* dibnd */
  796.    {
  797.       LONG       cAttr;
  798.       LONG       cDefs;
  799.       IMAGEBUNDLE ibnd;
  800.       /* IMAGEDEFS     idef; */
  801.    } DIMAGEBUNDLE;
  802.    typedef DIMAGEBUNDLE *PDIMAGEBUNDLE;
  803.    
  804.    /* Device Marker Bundle */
  805.    
  806.    typedef struct _MARKERDEFS   /* mdef */
  807.    {
  808.       ULONG      defSet;
  809.       ULONG      fFlags;
  810.       ULONG      CodePage;
  811.    } MARKERDEFS;
  812.    typedef MARKERDEFS *PMARKERDEFS;
  813.    
  814.    typedef struct _DMARKERBUNDLE   /* dmbnd */
  815.    {
  816.       LONG       cAttr;
  817.       LONG       cDefs;
  818.       MARKERBUNDLE mbnd;
  819.       MARKERDEFS   mdef;
  820.    } DMARKERBUNDLE;
  821.    typedef DMARKERBUNDLE *PDMARKERBUNDLE;
  822.    
  823.    
  824. #endif /* INCL_DDIBUNDLES */
  825.  
  826. #ifdef INCL_DDIFONTSTRUCS
  827.    #include <pmfont.h>
  828. #endif /* INCL_DDIFONTSTRUCS */
  829.  
  830. #ifdef INCL_DDIBITMAPFILE
  831.    #include <pmbitmap.h>
  832. #endif /* INCL_DDIBITMAPFILE */
  833.  
  834. #ifdef INCL_DDIPATHS
  835.    /* Curve types */
  836.    
  837.    #define CURVE_IDENTIFIER             0x43
  838.    #define LINE_IDENTIFIER              0x4C
  839.    #define CURVE_DO_FIRST_PEL           0x0002
  840.    
  841.    typedef struct _CURVE   /* cv */
  842.    {
  843.       BYTE        bIdent;             /*  1    1  */
  844.       BYTE        bType;              /*  1    2  */
  845.       USHORT      usReserved;         /*  2    4  */
  846.       ULONG       flStyle;            /*  4    8  */
  847.       ULONG       fl;                 /*  4   12  */
  848.       struct      _CURVE *pcvNext;    /*  4   16  */
  849.       struct      _CURVE *pcvPrev;    /*  4   20  */
  850.       struct      _CURVE *pcvAttrs;   /*  4   24  */
  851.       POINTFX     ptfxA;              /*  8   32  */
  852.       POINTFX     ptfxC;              /*  8   40  */
  853.       BYTE        Reserved2[28];      /* 28   68  */
  854.    } CURVE;
  855.    typedef CURVE *PCURVE;
  856.    
  857.    typedef struct _LINE   /* ln */
  858.    {
  859.       BYTE        bIdent;             /*  1    1  */
  860.       BYTE        bType;              /*  1    2  */
  861.       USHORT      usReserved;         /*  2    4  */
  862.       ULONG       flStyle;            /*  4    8  */
  863.       ULONG       fl;                 /*  4   12  */
  864.       PCURVE      pcvNext;            /*  4   16  */
  865.       PCURVE      pcvPrev;            /*  4   20  */
  866.       PCURVE      pcvAttrs;           /*  4   24  */
  867.       POINTFX     ptfxA;              /*  8   32  */
  868.       POINTFX     ptfxC;              /*  8   40  */
  869.       POINTL      ptlA;               /*  8   48  */
  870.       POINTL      ptlC;               /*  8   56  */
  871.       FIXED       fxRslope;           /*  4   60  */
  872.       BYTE        Reserved1[8];       /*  8   68  */
  873.    } LINE;
  874.    typedef LINE *PLINE;
  875.    
  876. #endif  /* INCL_DDIPATHS */
  877.  
  878. #ifdef INCL_GRE_JOURNALING
  879.    #define JNL_TEMP_FILE            0x00000001L
  880.    #define JNL_PERM_FILE            0x00000002L
  881.    #define JNL_ENGINERAM_FILE       0x00000004L
  882.    #define JNL_USERRAM_FILE         0x00000008L
  883.    #define JNL_DRAW_OPTIMIZATION    0x00000010L
  884.    #define JNL_BOUNDS_OPTIMIZATION  0x00000020L
  885. #endif  /* INCL_GRE_JOURNALING */
  886.  
  887.  
  888. #ifdef INCL_GRE_DEVICE
  889.    
  890.    /* QueryDeviceBitmaps */
  891.    
  892.    typedef struct _BITMAPFORMAT   /* bmf */
  893.    {
  894.       ULONG cPlanes;
  895.       ULONG cBitCount;
  896.    } BITMAPFORMAT;
  897.    typedef BITMAPFORMAT *PBITMAPFORMAT;
  898.    
  899. #endif /* INCL_GRE_DEVICE */
  900.  
  901. #ifdef INCL_GRE_PALETTE
  902.    
  903.    typedef struct _PALETTEINFOHEADER   /* palinfohdr */
  904.    {
  905.       ULONG  flCmd;         /* options from creation                   */
  906.       ULONG  ulFormat;      /* specifies format of entries at creation */
  907.       ULONG  cclr;          /* number of elements supplied at creation */
  908.    } PALETTEINFOHEADER;
  909.    typedef PALETTEINFOHEADER *NPPALETTEINFOHEADER;
  910.    typedef PALETTEINFOHEADER *PPALETTEINFOHEADER;
  911.    
  912.    typedef struct _PALETTEINFO   /* palinfo */
  913.    {
  914.       ULONG  flCmd;         /* options from creation                   */
  915.       ULONG  ulFormat;      /* specifies format of entries at creation */
  916.       ULONG  cclr;          /* number of elements supplied at creation */
  917.       RGB2   argb[1];       /* the palette entries                     */
  918.    } PALETTEINFO;
  919.    typedef PALETTEINFO *NPPALETTEINFO;
  920.    typedef PALETTEINFO *PPALETTEINFO;
  921.    
  922.    /* flType values for RealizePalette */
  923.    #define RP_BACKGROUND                0
  924.    #define RP_FOREGROUND                1
  925.    #define RP_DEFAULTSCHANGED           2
  926.    
  927. #endif
  928.  
  929. #ifdef INCL_GRE_BITMAPS
  930.    #define LR_CLIPPED   2
  931.    #define LR_NOTBORDER 0
  932.    #define LR_BORDER    1
  933.    #define LR_LEFT      2
  934.    #define LR_RIGHT     4
  935. #endif
  936.  
  937. /* Flags  for GreOutlinePath */
  938. #define OPTH_NO_CLIPPING_REQD         0x0001L
  939. #define OPTH_QRY_PATH_POINTS          0x0002L
  940.  
  941. /*** 32-bit cursor/pointer stuff ******************************/
  942. typedef struct _MCDESCRIPTION   /* mcdesc */
  943. {
  944.    PVOID    pMoveCursor;
  945.    ULONG    ulCodeLength;
  946.    PVOID    pCursorData;
  947.    ULONG    ulDataLength;
  948. }  MCDESCRIPTION;
  949. typedef MCDESCRIPTION *PMCDESCRIPTION;
  950.  
  951. typedef struct _WINCURSORDATA   /* winmc */
  952. {
  953.    ULONG      pMoveCursor;
  954.    ULONG      pMoveCursorAlias;
  955.    ULONG      pCursorData;
  956.    ULONG      pCursorDataAlias;
  957.    ULONG      ulRoutineType;
  958.    HMODULE    hModDisplay;
  959.    PVOID      pWCThunkCode;
  960.    ULONG      ulThunkLen;
  961.    USHORT     usR0CS;
  962.    USHORT     usR0DS;
  963. }  WINCURSORDATA;
  964. typedef WINCURSORDATA *PWINCURSORDATA;
  965.  
  966. #define MC_32BIT   32
  967. #define MC_16BIT   16
  968.  
  969. #ifdef INCL_GRE_SCREEN
  970.    
  971.    /* GetScreenBits */
  972.    
  973.    typedef LHANDLE   HSCA;     /* hsca */
  974.    typedef HSCA *PHSCA;
  975.    
  976.    #define GSB_OPT_4BPP    0x0000L
  977.    #define GSB_OPT_8BPP    0x0001L
  978.    #define GSB_OPT_16BPP   0x0002L
  979.    #define GSB_OPT_LINEAR  0x0000L
  980.    #define GSB_OPT_PLANAR  0x0008L
  981.    #define GSB_OPT_HRGN    0x0010L
  982.    
  983. #endif /* INCL_GRE_SCREEN */
  984.  
  985. #ifdef INCL_VMANDDI
  986.    
  987.    #define CAPS_MAX_CAPS    41
  988.    #define DEFAULT_PATTERNS_NUMBER 20
  989.    
  990.    //*******************************************************************************
  991.    // Halftoning and Dithering support for OS/2
  992.    //*******************************************************************************
  993.    
  994.    /******************************************************************************/
  995.    /*    PPOINTL     pptlSrc;            // src left, bottom, width and height.  */
  996.    /*    PPOINTL     pptlDst;            // dst left, bottom, width and height.  */
  997.    /*    ULONG       ulSrcBytesPerLine;  // src bytes per line                   */
  998.    /*    PBYTE       pbSrcBits;          // pointer to src image data            */
  999.    /*    ULONG       ulTrgBytesPerLine;  // dst bytes per line                   */
  1000.    /*    PBYTE       pbTrgBits;          // pointer to dst image data            */
  1001.    /*    ULONG       ulOptions;          // options                              */
  1002.    /*    ULONG       ulcClrs;            // count of colors in rgb2 table        */
  1003.    /*    PRGB2       pargb2;             // rgb2 table                           */
  1004.    /******************************************************************************/
  1005.    
  1006.    typedef struct _IMAGEINFOS          /* imginfo */
  1007.    {
  1008.       PPOINTL     pptlSrc;
  1009.       PPOINTL     pptlDst;
  1010.       ULONG       ulSrcBpp;
  1011.       ULONG       ulSrcBytesPerLine;
  1012.       PBYTE       pbSrcBits;
  1013.       ULONG       ulcSrcClrs;
  1014.       ULONG       ulSrcClrType;
  1015.       PRGB2       pargb2Src;
  1016.       ULONG       ulTrgBpp;
  1017.       ULONG       ulTrgBytesPerLine;
  1018.       PBYTE       pbTrgBits;
  1019.       ULONG       ulcTrgClrs;
  1020.       ULONG       ulTrgClrType;
  1021.       PRGB2       pargb2Trg;
  1022.       ULONG       ulOptions;
  1023.    } IMAGEINFOS;
  1024.    typedef IMAGEINFOS * PIMAGEINFO;    /* pimginfo */
  1025.    
  1026.    //
  1027.    // ulSrcClrType, ulTrgClrType
  1028.    // color RGB types.
  1029.    //
  1030.    #define COLOR_RGB2            0x0000  // color is in RGB2              (default)
  1031.    #define COLOR_RGB             0x0001  // color is in RGB
  1032.    
  1033.    #define COLOR_24BIT_BGR       0x0000  // 1st byte=blue, 2nd byte=green (default)
  1034.    // 3rd byte=red
  1035.    #define COLOR_24BIT_RGB       0x0001  // 1st byte=red,  2nd byte=green
  1036.    // 3rd byte=blue
  1037.    
  1038.    #define COLOR_16BIT_565_BGR   0x0000  // blue - 5 bits,                (default)
  1039.    // green - 6 bits, red - 5 bits
  1040.    // ---------------------------------
  1041.    // |b|b|b|b|b|g|g|g|g|g|g|r|r|r|r|r|
  1042.    // ---------------------------------
  1043.    #define COLOR_16BIT_565_RGB   0x0001  // red - 5 bits,
  1044.    // green - 6 bits, blue - 5 bits
  1045.    // ---------------------------------
  1046.    // |r|r|r|r|r|g|g|g|g|g|g|b|b|b|b|b|
  1047.    // ---------------------------------
  1048.    #define COLOR_16BIT_1555_BGR  0x0002  // overlay - 1, red - 5 bits,
  1049.    // green - 5 bits, blue - 5 bits
  1050.    // ---------------------------------
  1051.    // |o|b|b|b|b|b|g|g|g|g|g|r|r|r|r|r|
  1052.    // ---------------------------------
  1053.    #define COLOR_16BIT_1555_RGB  0x0004  // overlay - 1, red - 5 bits,
  1054.    // green - 5 bits, blue - 5 bits
  1055.    // ---------------------------------
  1056.    // |o|r|r|r|r|r|g|g|g|g|g|b|b|b|b|b|
  1057.    // ---------------------------------
  1058.    #define COLOR_32BIT_BGR       0x0000  // 1st byte=blue, 2nd byte=green (default)
  1059.    // 3rd byte=red,  4th byte=not used.
  1060.    #define COLOR_32BIT_RGB       0x0001  // 1st byte=red,  2nd byte=green
  1061.    // 3rd byte=blue, 4th byte=not used.
  1062.    
  1063.    //
  1064.    // ulOptions
  1065.    //
  1066.    //   Exact color match.
  1067.    //     source pels that are the target BG color become target BG color.
  1068.    //     All other pels become target FG color.
  1069.    #define IMAGEINFO_CLR_TO_MONO_BG_EXACT     0x00000001 // src pels that are trg BG clr -> 1
  1070.    // all other pels               -> 0
  1071.    #define IMAGEINFO_CLR_TO_MONO_BG_EXACT_INV 0x00000002 // src pels that are trg BG clr -> 0
  1072.    // all other pels               -> 1
  1073.    //   Nearest color match.
  1074.    //     source pels that are close to target BG color become target BG color.
  1075.    //     All other pels become target FG color.
  1076.    #define IMAGEINFO_CLR_TO_MONO_BG_MAP       0x00000004 // src pels that are close to trg BG clr -> 1
  1077.    // all other pels                        -> 0
  1078.    #define IMAGEINFO_CLR_TO_MONO_BG_MAP_INV   0x00000008 // src pels that are close to trg BG clr -> 0
  1079.    // all other pels                        -> 1
  1080.    #define IMAGEINFO_SRC_Y_FLIP               0x00000010 // source is going Y negative direction
  1081.    // i.e. second line = first line - ulBytesPerLine.
  1082.    #define IMAGEINFO_TRG_Y_FLIP               0x00000020 // target is going Y negative direction
  1083.    
  1084.    /*******************************************************************************************/
  1085.    /*    ULONG       ulLength;      // Length of dither matrix structure                      */
  1086.    /*    ULONG       fExt2IntSup;   // Gre Dither Flags for Ext to Int                        */
  1087.    /*    PVOID       pExt2IntDI;    // Used for GDM_USERDEF - pointer to users dither info    */
  1088.    /*    ULONG       fStretchSup;   // Gre Dither Flags for Stretch Support                   */
  1089.    /*    PVOID       pStretchDI;    // Used for GDM_USERDEF - pointer to users dither info    */
  1090.    /*    ULONG       fLog2PhysSup;  // Gre Dither Flags for Log to Phys clr mapping           */
  1091.    /*    PVOID       pLog2PhysDI;   // Used for GDM_USERDEF - pointer to users dither info    */
  1092.    /*    PFN         pfnDither;     // Used for GDM_USERDEF - pointer to users dither function*/
  1093.    /*******************************************************************************************/
  1094.    
  1095.    typedef struct _DITHERMATRIX   /* dthmtx */
  1096.    {
  1097.       ULONG       ulLength;
  1098.       ULONG       fExt2IntSup;
  1099.       PVOID       pExt2IntDI;
  1100.       ULONG       fStretchSup;
  1101.       PVOID       pStretchDI;
  1102.       ULONG       fLog2PhysSup;
  1103.       PVOID       pLog2PhysDI;
  1104.       PFN         pfnDither;
  1105.    } DITHERMATRIX;
  1106.    typedef DITHERMATRIX *PDITHERMATRIX;  /* pdthmtx */
  1107.    
  1108.    //
  1109.    // fExt2IntSup/fLog2IntSup
  1110.    //
  1111.    #define  GDM_NO_DITHER               0x0000   // No dithering in system
  1112.    #define  GDM_USERDEF_DITHER          0x0001   // Users supplies own Dithering routines
  1113.    #define  GDM_MATRIX_DITHER           0x0002   // Use System ordered dithering
  1114.    #define  GDM_ERRORDIF_DITHER         0x0004   // Use System error diffusion dithering
  1115.    #define  GDM_DITHER_BEGIN            0x0008   // Use System Floyd-Steinberg dithering
  1116.    #define  GDM_DITHER_END              0x0010   // Use System error propigation dithering
  1117.    #define  GDM_COLOR_CONVERT           0x0020   // Use device's clr mapping functions
  1118.    
  1119.    typedef struct _COLORCONVERTINFO             /* cci  */
  1120.    {
  1121.       ULONG              ulLength;
  1122.       ULONG              ulType;
  1123.       ULONG              ulOptions;
  1124.       ULONG (* APIENTRY pfnRGB2ToPhyIndex) () ;
  1125.       ULONG (* APIENTRY pfnPhyIndexToRGB2) () ;
  1126.       ULONG (* APIENTRY pfnConvert)        () ;
  1127.    } COLORCONVERTINFO;
  1128.    typedef COLORCONVERTINFO *PCOLORCONVERTINFO; /* pcci */
  1129.    
  1130.    ULONG (* APIENTRY pfnRGB2ToPhyIndex) (ULONG ulClr) ;
  1131.    ULONG (* APIENTRY pfnPhyIndexToRGB2) (ULONG ulClr) ;
  1132.    ULONG (* APIENTRY pfnConvert)        (PIMAGEINFO pimginfo);
  1133.    
  1134.    // pfnDither(PDITHERINFO pdi, PIMAGEINFO pii, ULONG ulFlags);
  1135.    
  1136.    #define  GDM_EXT2INT_DITHER   0x01
  1137.    #define  GDM_STRETCH_DITHER   0x02
  1138.    #define  GDM_LOG2PHY_DITHER   0x04
  1139.    
  1140.    /*******************************************************************************************/
  1141.    /*    ULONG       ulLength;      // length of structure                 - 88               */
  1142.    /*    ULONG       ulType;        // type of dither info structure       - GDM_MATRIX_DITHER*/
  1143.    /*    ULONG       fOptions;      // dither info options - DI_MONOINVERT - 00               */
  1144.    /*    ULONG       ulIntensity;   // RGB Gama Correction Value           - 00               */
  1145.    /*    BYTE        bRedWt;        // weight of primary color red         - 25               */
  1146.    /*    BYTE        bGreenWt;      // weight of primary color green       - 60               */
  1147.    /*    BYTE        bBlueWt;       // weight of primary color blue        - 15               */
  1148.    /*    BYTE        bPad;          // 4 byte align                        - 00               */
  1149.    /*    SIZEL       szMatrix;      // halftone pattern size               - 8                */
  1150.    /*    BYTE        bHalftone[];   // array of halftone patterns          - see 32gdata.c    */
  1151.    /*******************************************************************************************/
  1152.    
  1153.    typedef struct _MATRIXDITHERINFO      /* mtrxdi */
  1154.    {
  1155.       ULONG       ulLength;
  1156.       ULONG       ulType;
  1157.       ULONG       fOptions;
  1158.       ULONG       ulIntensity;
  1159.       BYTE        bRedWt;
  1160.       BYTE        bGreenWt;
  1161.       BYTE        bBlueWt;
  1162.       BYTE        bPad;
  1163.       SIZEL       szMatrix;
  1164.       BYTE        bHalftone[1];
  1165.    } MATRIXDITHERINFO;
  1166.    typedef MATRIXDITHERINFO *PMDI;  /* pmtrxdi */
  1167.    
  1168.    #define STUCKI_DIF 0x01
  1169.    #define JJN_DIF    0x02
  1170.    #define RND_DIF    0x04
  1171.    #define USER_DIF   0x08
  1172.    
  1173.    typedef struct _DIFFUSIONDITHERINFO      /* difdi */
  1174.    {
  1175.       ULONG       ulLength;
  1176.       ULONG       ulType;        // Stucki, J,J & N, RANDOM, User defined
  1177.       ULONG       fOptions;
  1178.       ULONG       ulIntensity;
  1179.       BYTE        bRedWt;
  1180.       BYTE        bGreenWt;
  1181.       BYTE        bBlueWt;
  1182.       BYTE        bPad;
  1183.       PBYTE       pBuffer;
  1184.       SIZEL       szFilter;
  1185.       BYTE        bFilterArry[1];
  1186.       
  1187.    } DIFFUSIONDITHERINFO;
  1188.    typedef DIFFUSIONDITHERINFO *PDDI;  /* pdifdi */
  1189.    
  1190.    typedef struct _DEVICESURFACE          /* devsur */
  1191.    {
  1192.       ULONG         ulLength;
  1193.       BMAPINFO      SurfaceBmapInfo;
  1194.       ULONG         ulDSFlgs;
  1195.       ULONG         ulStyleRatio;
  1196.       BMAPINFO      abmapinfoDefPattern[DEFAULT_PATTERNS_NUMBER];
  1197.       PVOID         pHWPalette;
  1198.       DITHERMATRIX  DitherMatrix;
  1199.       PFN           pfnDevLockDC;
  1200.       PFN           pfnDevUnLockDC;
  1201.       PFN           pfnBitBlt;
  1202.       PFN           pfnLine;
  1203.       #ifdef DEV_FNT_SUP
  1204.          PFN           pfnTextBlt;
  1205.       #else
  1206.          PFN           pfnReserved;
  1207.       #endif
  1208.       PFN           pfnLockPhysDev;
  1209.       PFN           pfnUnLockPhysDev;
  1210.       ULONG         hddc;
  1211.       ULONG         ulReserved[4];
  1212.       ULONG         ulCapsCnt;
  1213.       ULONG         DevCaps[CAPS_MAX_CAPS + 1];
  1214.    } DEVICESURFACE;
  1215.    typedef DEVICESURFACE *PDEVICESURFACE; /* pdevsur */
  1216.    
  1217.    APIRET APIENTRY GreSetDitherInfo(HDC hdc,
  1218.                                     ULONG ulDitherType,
  1219.                                     PVOID pDitherInfo);
  1220.    APIRET APIENTRY SetDeviceSurface(HDC hdc,
  1221.                                     PDEVICESURFACE pds);
  1222.    
  1223.    // Surface definition flags
  1224.    //
  1225.    #define DS_MEMORY                      0x00000001  // memory DS for a memory DC.
  1226.    #define DS_ROTATION                    0x00000002  // 90 degree rotation.
  1227.    
  1228.    #define DS_HORIZONTAL_SCAN             0x00000004  // horizontal scan DS.
  1229.    #define DS_VERTICAL_SCAN               0x00000008  // vertical scan DS.
  1230.    // DS must be TOPBOTTOM.
  1231.    #define DS_BYTEALIGN                   0x00000010  // DS scan line alignment.
  1232.    #define DS_WORDALIGN                   0x00000020  // DS scan line alignment
  1233.    #define DS_DWORDALIGN                  0x00000040  // DS scan line alignment
  1234.    
  1235.    #define DS_KEEP_EXTFORMAT              0x00000100  // bitmaps are created
  1236.    // in the external format.
  1237.    #define DS_MONO_INVERT                 0x00000200  // mono ROPs are inverted.
  1238.    #define DS_EXTERNAL_BITMAP_SELECTED    0x00000400  // Reserved.
  1239.    #define DS_NOTIFY_LAST_SDBITBLT        0x00000800  //
  1240.    #define DS_QUEUED_RAW_DEFAULT          0x00001000  //
  1241.    
  1242.    #define DS_DOWNLOAD_FONTS              0x00002000  // Device Supports Downloaded Fonts
  1243.    #define DS_FONT_CLIP_SUPPORT           0x00004000  // Device will clip fonts
  1244.    #define DS_DEVICE_FONTS                0x00008000  // Device has Hardware Fonts
  1245.    
  1246.    #define DS_BOTTOMTOP                   0x00010000  // bottom to top is Y positive.
  1247.    #define DS_TOPBOTTOM                   0x00020000  // top to bottom is Y positive.
  1248.    
  1249.    // textblt clipping option
  1250.    #define DS_CLIP_100_RULE               0x00000000  // draw character if 100% is in clip rect
  1251.    #define DS_CLIP_66_RULE                0x00040000  // draw character if 2/3 is in clip rect
  1252.    #define DS_CLIP_PRECISE_RULE           0x00080000  // precise clipping
  1253.    
  1254.    // rows along Y and scans along X are default.
  1255.    // row positive and scan positive are default.
  1256.    #define DS_BITBLT_XROW_YSCAN           0x00100000  // rows along X and scans are along Y.
  1257.    #define DS_BITBLT_ROW_NEGATIVE         0x00200000  // next row = this row - bytes per row.
  1258.    #define DS_BITBLT_SCAN_NEGATIVE        0x00400000  // next pel = this pel - bytes per pel.
  1259.    
  1260.    #define DS_COLOR_RGB2                  0x00000000  // color is in RGB2             (default)
  1261.    #define DS_COLOR_RGB                   0x10000000  // color is in RGB
  1262.    
  1263.    #define DS_COLOR_24BIT_BGR             0x00000000  // 1st byte=blue,               (default)
  1264.    // 2nd byte=green 3rd byte=red
  1265.    #define DS_COLOR_24BIT_RGB             0x10000000  // 1st byte=red, 2nd byte=green
  1266.    // 3rd byte=blue
  1267.    
  1268.    #define DS_COLOR_16BIT_565_BGR         0x00000000  // blue - 5 bits,               (default)
  1269.    // green - 6 bits, red - 5 bits
  1270.    // ---------------------------------
  1271.    // |b|b|b|b|b|g|g|g|g|g|g|r|r|r|r|r|
  1272.    // ---------------------------------
  1273.    #define DS_COLOR_16BIT_565_RGB         0x10000000  // red - 5 bits,
  1274.    // green - 6 bits, blue - 5 bits
  1275.    // ---------------------------------
  1276.    // |r|r|r|r|r|g|g|g|g|g|g|b|b|b|b|b|
  1277.    // ---------------------------------
  1278.    #define DS_COLOR_16BIT_1555_BGR        0x20000000  // overlay - 1, red - 5 bits,
  1279.    // green - 5 bits, blue - 5 bits
  1280.    // ---------------------------------
  1281.    // |o|b|b|b|b|b|g|g|g|g|g|r|r|r|r|r|
  1282.    // ---------------------------------
  1283.    #define DS_COLOR_16BIT_1555_RGB        0x40000000  // overlay - 1, red - 5 bits,
  1284.    // green - 5 bits, blue - 5 bits
  1285.    // ---------------------------------
  1286.    // |o|r|r|r|r|r|g|g|g|g|g|b|b|b|b|b|
  1287.    // ---------------------------------
  1288.    
  1289.    #define DS_COLOR_32BIT_BGR             0x00000000  // 1st byte=blue, 2nd byte=green  (default)
  1290.    // 3rd byte=red,  4th byte = not used.
  1291.    #define DS_COLOR_32BIT_RGB             0x10000000  // 1st byte=red,  2nd byte=green
  1292.    // 3rd byte=blue  4th byte = not used.
  1293.    
  1294.    #ifndef FONTDEFFONT1
  1295.       #include <pmfont.h>
  1296.    #endif
  1297.    
  1298.    #ifndef VMANDDI_INCLUDED
  1299.       #include <ddi.h>
  1300.    #endif
  1301.    
  1302.    typedef struct _DEVFONTMETRICS                        /* dfm */
  1303.    {
  1304.       ULONG                  flOptions;
  1305.       PFOCAFONT              pFoca;
  1306.       PVOID                  pUniPanhose;
  1307.       char                   achFileName[260];
  1308.       PSZ                    pszFullFamilyName;
  1309.       PSZ                    pszFullFaceName;
  1310.       char                   achGlyphListName[16];
  1311.       PFN                    pfnDevQueryCodePage;
  1312.       LONG                   lDevMatch;
  1313.    } DEVFONTMETRICS;
  1314.    typedef DEVFONTMETRICS *PDEVFONTMETRICS;
  1315.    
  1316.    // options for flOptions of DEVFONTMETRICS
  1317.    #define DEVFONT_DEFAULT  0x00010000         /* default device font          */
  1318.    
  1319.    typedef struct _FONTINFO       /* fntinfo */
  1320.    {
  1321.       DEVFONTINFO            dfi;
  1322.       FOCAFONT               foca;
  1323.    } FONTINFO;
  1324.    typedef FONTINFO *PFONTINFO;
  1325.    
  1326.    typedef struct _PHYSBND        /* physbnd */
  1327.    {
  1328.       ULONG  ulColor;            /* foreground color physical index         */
  1329.       ULONG  ulBackColor;        /* background color physical index         */
  1330.       ULONG  ulrgb2LogColor;     /* foreground logical color rgb, see below */
  1331.       ULONG  ulrgb2LogBackColor; /* background logical color rgb, see below */
  1332.       ULONG  ulMix;              /* forground ROP                           */
  1333.       ULONG  ulBackMix;          /* background ROP                          */
  1334.    } PHYSBND;
  1335.    typedef PHYSBND *PPHYSBND;
  1336.    
  1337.    #define COLOR_LOG_TO_PHY_MAPPED  0x80
  1338.    
  1339.    typedef struct _STATEINFO2         /* stateinfo2 */
  1340.    {
  1341.       POINTL   ptlOrigin;             /* long version of DC origin                       */
  1342.       
  1343.       XFORM    xformWD;               /* WORLD to DEVICE xform                           */
  1344.       ULONG    xform_flags;           /* the flags from NotifyXformChange                */
  1345.       
  1346.       /* Settable defaults information. */
  1347.       
  1348.       PVOID    pDAttr;                /* defaults if they've changed                     */
  1349.       
  1350.       ULONG    ulCodePage;            /* current code page.                              */
  1351.       
  1352.       POINTL   ptlCurPosWorld;        /* current postion in world coordinates.           */
  1353.       POINTL   ptlCurPosScreen;       /* current postion in screen coordinates.          */
  1354.       ULONG    ulLineStyle;           /* line style                                      */
  1355.       /* ┌─────────────────────────────────────────────┐ */
  1356.       /* │    high word   │  5 bits  │ 3 bits │ 8 bits │ */
  1357.       /* └─────────────────────────────────────────────┘ */
  1358.       /* │ first/last pel │ not used │ mask   │ error  │ */
  1359.       
  1360.    } STATEINFO2;
  1361.    typedef STATEINFO2 *PSTATEINFO2;   /* pstateinfo2 */
  1362.    
  1363.    typedef struct _STATEINFO1    /*stateinfo1 */
  1364.    {
  1365.       
  1366.       LONG     hddc;
  1367.       PSTATEINFO2     pStateInfo2;
  1368.       
  1369.       /* RDC without the DMATRIX's   */
  1370.       /* *** Arcs Component Data *** */
  1371.       
  1372.       ARCPARAMS     arc_parameters;
  1373.       LONG          norm;
  1374.       LONG          direction;
  1375.       
  1376.       /* Attribute Bundles */
  1377.       
  1378.       DLINEBUNDLE   line_bundle;
  1379.       DAREABUNDLE   pat_bundle;
  1380.       DCHARBUNDLE   char_bundle;
  1381.       DIMAGEBUNDLE  image_bundle;
  1382.       DMARKERBUNDLE marker_bundle;
  1383.       
  1384.       LONG          line_default;     /* line defaults mask                     */
  1385.       LONG          char_default;     /* char defaults mask                     */
  1386.       LONG          marker_default;   /* marker defaults mask                   */
  1387.       LONG          pat_default;      /* pat  defaults mask                     */
  1388.       LONG          image_default;    /* image defaults mask                    */
  1389.       
  1390.       ULONG         ulOldDriver;      /* Flags for old drivers, see 32const.h   */
  1391.       /* End RDC                                */
  1392.       
  1393.       ULONG    flPattern ;            /* flag                                   */
  1394.       /* PATTERN_SOLID                          */
  1395.       /* PATTERN_DEFAULT_SOLID                  */
  1396.       /* PATTERN_BITS_ALLOCATED                 */
  1397.       /* PATTERN_REF_POINT_SCREEN_DIRTY         */
  1398.       
  1399.       BMAPINFO bmapinfoPattern;       /* currently selected pattern bitmap info.*/
  1400.       POINTL   ptlPatRefPointWorld;   /* pattern origin in world coordinates.   */
  1401.       POINTL   ptlPatRefPointScreen;  /* pattern origin in screen coordinates.  */
  1402.       
  1403.       ULONG    ulLineType;            /* line type.                             */
  1404.       
  1405.       PHYSBND  physChar;
  1406.       PHYSBND  physLine;
  1407.       PHYSBND  physMarker;
  1408.       PHYSBND  physImage;
  1409.       PHYSBND  physArea;
  1410.       
  1411.    } STATEINFO1;
  1412.    typedef STATEINFO1 *PSTATEINFO1;   /* pstateinfo1 */
  1413.    
  1414. #endif /* INCL_VMANDDI */
  1415.  
  1416. #include <pmddim.h>
  1417.  
  1418. /* NOINC */
  1419. #ifdef __cplusplus
  1420.         }
  1421. #endif
  1422. #if __IBMC__ || __IBMCPP__
  1423.    #pragma info( none )
  1424.    #ifndef __CHKHDR__
  1425.       #pragma info( restore )
  1426.    #endif
  1427.    #pragma info( restore )
  1428. #endif
  1429. /* INC */
  1430.  
  1431. /**************************** end of file **********************************/
  1432.