home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ddkx86v1.zip / DDKX86 / IBMH / PMDDI.H < prev    next >
C/C++ Source or Header  |  1995-04-14  |  34KB  |  1,058 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. \***************************************************************************/
  71. /* NOINC */
  72. #ifdef __IBMC__
  73.    #pragma checkout( suspend )
  74.    #ifndef __CHKHDR__
  75.       #pragma checkout( suspend )
  76.    #endif
  77.    #pragma checkout( resume )
  78. #endif
  79. /* INC */
  80.  
  81. #define DDI_INCLUDED
  82.  
  83.  
  84. #ifdef INCL_GREALL
  85.    #define INCL_GRE_ARCS
  86.    #define INCL_GRE_BITMAPS
  87.    #define INCL_GRE_CLIP
  88.    #define INCL_GRE_COLORTABLE
  89.    #define INCL_GRE_DCS
  90.    #define INCL_GRE_DEVICE
  91.    #define INCL_GRE_DEVMISC
  92.    #define INCL_GRE_DEVSUPPORT
  93.    #define INCL_GRE_FONTS
  94.    #define INCL_GRE_JOURNALING
  95.    #define INCL_GRE_LCID
  96.    #define INCL_GRE_LINES
  97.    #define INCL_GRE_MARKERS
  98.    #define INCL_GRE_PALETTE
  99.    #define INCL_GRE_PATHS
  100.    #define INCL_GRE_PICK
  101.    #define INCL_GRE_POLYGON
  102.    #define INCL_GRE_REGIONS
  103.    #define INCL_GRE_SCANS
  104.    #define INCL_GRE_SCREEN
  105.    #define INCL_GRE_SETID
  106.    #define INCL_GRE_STRINGS
  107.    #define INCL_GRE_XFORMS
  108. #endif /* INCL_GREALL */
  109.  
  110. #ifdef INCL_GRE_DEVMISC
  111.    #define INCL_GRE_DEVMISC1
  112.    #define INCL_GRE_DEVMISC2
  113.    #define INCL_GRE_DEVMISC3
  114. #endif  /* INCL_GRE_DEVMISC */
  115.  
  116.  
  117. /*** Engine dispatch tables ************************************************/
  118.  
  119. #define MAXTABLEENTRIES        223
  120. #define NUMBEROFMAJORFUN       MAXTABLEENTRIES
  121. #define NUMBEROFMINORFUN       86
  122.  
  123. typedef struct _DISPATCHER    /* dr */
  124. {
  125.    PFN    pfnTblEntry[MAXTABLEENTRIES];
  126. } DISPATCHER;
  127. typedef DISPATCHER *PDISPATCHER;
  128.  
  129. typedef struct _FUNINFOTABLE    /* fit */
  130. {
  131.    BYTE   FunInfo_00[NUMBEROFMAJORFUN];
  132.    BYTE   FunInfo_02[NUMBEROFMINORFUN];
  133. } FUNINFOTABLE;
  134. typedef FUNINFOTABLE *PFUNINFOTABLE;
  135.  
  136. /*** exported Engine DDI functions *****************************************/
  137.  
  138. LONG  APIENTRY SetDriverInfo(ULONG hDrv,
  139.                              LHANDLE hEng,
  140.                              ULONG ulIndex,
  141.                              HDC hdc);
  142.  
  143. LONG  APIENTRY GetDriverInfo(LHANDLE hEng,
  144.                              ULONG ulIndex,
  145.                              HDC hdc);
  146.  
  147. LONG  APIENTRY PostDeviceModes(PDRIVDATA pDrvData,
  148.                                PSZ pszDrvName,
  149.                                PSZ pszDevName,
  150.                                PSZ pszPrtName,
  151.                                ULONG ulOptions);
  152.  
  153. BOOL  APIENTRY GreInitialize(VOID);
  154.  
  155. ULONG APIENTRY SSAllocMem(PVOID ppAddr,
  156.                           ULONG ulSize,
  157.                           ULONG ulReserved);
  158.  
  159. ULONG APIENTRY SSFreeMem(PVOID pAddr);
  160.  
  161. /*** define common types in the Engine and DDI *****************************/
  162.  
  163. typedef struct _RECTS   /* rcs */
  164. {
  165.    POINTS pts1;
  166.    POINTS pts2;
  167. } RECTS;
  168. typedef RECTS *PRECTS;
  169.  
  170. /* NOINC */
  171. #ifndef POINTFX_DEFINED
  172.    #define POINTFX_DEFINED
  173.    /* INC */
  174.    typedef struct _POINTFX   /* ptfx */
  175.    {
  176.       FIXED x;
  177.       FIXED y;
  178.    } POINTFX;
  179.    typedef POINTFX *PPOINTFX;
  180.    /* NOINC */
  181. #endif
  182. /* INC */
  183.  
  184. typedef struct _RECTFX   /* rcfx */
  185. {
  186.    POINTFX ptfx1;
  187.    POINTFX ptfx2;
  188. } RECTFX;
  189. typedef RECTFX *PRECTFX;
  190.  
  191. typedef struct _XFORM   /* xform */
  192. {
  193.    FIXED fxM11;
  194.    FIXED fxM12;
  195.    FIXED fxM21;
  196.    FIXED fxM22;
  197.    LONG  lM41;
  198.    LONG  lM42;
  199. } XFORM;
  200. typedef XFORM *PXFORM;
  201.  
  202. typedef LONG LCID;      /* locally-coded id */
  203. typedef LCID *PLCID;
  204. typedef LONG PHID;      /* path id */
  205. typedef ULONG HDEVPAL;
  206.  
  207. #ifdef INCL_GRE_HFONT
  208.    typedef LHANDLE HFONT;       /* font handle */
  209. #endif /* INCL_GRE_HFONT */
  210.  
  211. #ifdef INCL_DDICOMFLAGS
  212.    #define COM_DRAW16                      0x00000001L
  213.    #define COM_BOUND16                     0x00000002L
  214.    #define COM_CORRELATE16                 0x00000004L
  215.    #define COM_ALT_BOUND16                 0x00000008L
  216.    #define COM_AREA16                      0x00000010L
  217.    #define COM_PATH16                      0x00000020L
  218.    #define COM_TRANSFORM16                 0x00000040L
  219.    #define COM_RECORDING16                 0x00000080L
  220.    #define COM_DEVICE16                    0x00000100L
  221.    #define COM_SCR_BOUND16                 0x00000200L
  222.    #define COM_PRECLIP16                   0x04000000L
  223.    
  224.    #define COM_DRAW                        0x00010000L
  225.    #define COM_BOUND                       0x00020000L
  226.    #define COM_CORRELATE                   0x00040000L
  227.    #define COM_ALT_BOUND                   0x00080000L
  228.    #define COM_AREA                        0x00100000L
  229.    #define COM_PATH                        0x00200000L
  230.    #define COM_TRANSFORM                   0x00400000L
  231.    #define COM_RECORDING                   0x00800000L
  232.    #define COM_DEVICE                      0x01000000L
  233.    #define COM_SCR_BOUND                   0x02000000L
  234.    #define COM_PRECLIP                     0x04000000L
  235. #endif /* INCL_DDICOMFLAGS */
  236.  
  237. #ifdef INCL_GRE_ARCS
  238.    
  239.    /* BoxBoundary */
  240.    /* BoxInterior */
  241.    /* BoxBoth */
  242.    
  243.    typedef struct _BOXPARAMS      /* boxp */
  244.    {
  245.       POINTL ptl;
  246.       SIZEL  sizl;
  247.    } BOXPARAMS;
  248.    typedef BOXPARAMS *PBOXPARAMS;
  249. #endif /* INCL_GRE_ARCS */
  250.  
  251. #ifdef INCL_GRE_CLIP
  252.    
  253.    /* CopyClipRegion */
  254.    
  255.    #define COPYCRGN_ALLINTERSECT        0L
  256.    #define COPYCRGN_VISRGN              1L
  257.    #define COPYCRGN_CLIPRGN             2L
  258.    
  259.    /* SetupDC */
  260.    
  261.    #define SETUPDC_VISRGN               0x00000001L
  262.    #define SETUPDC_ORIGIN               0x00000002L
  263.    #define SETUPDC_ACCUMBOUNDSON        0x00000004L
  264.    #define SETUPDC_ACCUMBOUNDSOFF       0x00000008L
  265.    #define SETUPDC_RECALCCLIP           0x00000010L
  266.    #define SETUPDC_SETOWNER             0x00000020L
  267.    #define SETUPDC_CLEANDC              0x00000040L
  268.    
  269. #endif /* INCL_GRE_CLIP */
  270.  
  271. #ifdef INCL_GRE_XFORMS
  272.    
  273.    /* QueryViewportSize */
  274.    typedef struct _VIEWPORTSIZE   /* vs */
  275.    {
  276.       ULONG cx;
  277.       ULONG cy;
  278.    } VIEWPORTSIZE;
  279.    typedef VIEWPORTSIZE *PVIEWPORTSIZE;
  280.    
  281. #endif /* INCL_GRE_XFORMS */
  282.  
  283. #ifdef INCL_GRE_DEVSUPPORT
  284.    
  285.    /* Constants for GreInitializeAttributes */
  286.    
  287.    #define INAT_DEFAULTATTRIBUTES       1L
  288.    #define INAT_CURRENTATTRIBUTES       2L
  289.    
  290.    /* InvalidateVisRegion */
  291.    
  292.    typedef struct _DC_BLOCK   /* ivr */
  293.    {
  294.       ULONG hdc;
  295.       ULONG hddc;
  296.    } DC_BLOCK;
  297.    typedef DC_BLOCK *PDC_BLOCK;
  298.    
  299. #endif /* INCL_GRE_DEVSUPPORT */
  300.  
  301. #ifdef INCL_DDIMISC
  302.    
  303.    /* Display information resource structure (RT_DISPLAYINFO) */
  304.    typedef struct _DISPLAYINFO           /* dspinfo */
  305.    {
  306.       USHORT cb;
  307.       SHORT cxIcon;
  308.       SHORT cyIcon;
  309.       SHORT cxPointer;
  310.       SHORT cyPointer;
  311.       SHORT cxBorder;
  312.       SHORT cyBorder;
  313.       SHORT cxHSlider;
  314.       SHORT cyVSlider;
  315.       SHORT cxSizeBorder;
  316.       SHORT cySizeBorder;
  317.       SHORT cxDeviceAlign;
  318.       SHORT cyDeviceAlign;
  319.    } DISPLAYINFO;
  320.    typedef DISPLAYINFO *PDISPLAYINFO;
  321.    
  322.    /* Parameters for the DC Enable function */
  323.    
  324.    typedef struct _DENPARAMS   /* den */
  325.    {
  326.       ULONG ulStateInfo;
  327.       ULONG ulType;
  328.       ULONG ulHDC;
  329.    } DENPARAMS;
  330.    typedef DENPARAMS *PDENPARAMS;
  331.    
  332.    
  333.    typedef struct _STYLERATIO   /* sr */
  334.    {
  335.       BYTE dx;
  336.       BYTE dy;
  337.    } STYLERATIO;
  338.    typedef STYLERATIO *PSTYLERATIO;
  339.    
  340.    /* Options flags for SetGlobalAttribute */
  341.    
  342.    #define GATTR_DEFAULT                   1L
  343.    
  344.    /* Attribute Types for SetGlobalAttribute */
  345.    
  346.    #define ATYPE_COLOR                     1L
  347.    #define ATYPE_BACK_COLOR                2L
  348.    #define ATYPE_MIX_MODE                  3L
  349.    #define ATYPE_BACK_MIX_MODE             4L
  350.    
  351.    /* Options for CharStringPos */
  352.    
  353.    #define CHS_START_XY                    0x00000020L
  354.    #define CHS_ATTR_INFO                   0x00000040L
  355.    
  356.    typedef struct _CSP_INFO   /* csp */
  357.    {
  358.       LONG  cSize;
  359.       LONG  lColor;
  360.       LONG  lBackColor;
  361.    } CSP_INFO;
  362.    typedef CSP_INFO *PCSP_INFO;
  363.    
  364.    /* Set/GetProcessControl */
  365.    
  366.    #define PCTL_DRAW                       0x00000001L
  367.    #define PCTL_BOUND                      0x00000002L
  368.    #define PCTL_CORRELATE                  0x00000004L
  369.    #define PCTL_USERBOUNDS                 0x00000008L
  370.    #define PCTL_AREA                       0x00000010L
  371.    
  372.    /* ResetBounds */
  373.    
  374.    #define RB_GPI                          0x00000001L
  375.    #define RB_USER                         0x00000002L
  376.    
  377.    /* GetBoundsData */
  378.    
  379.    #define GBD_GPI                         0L
  380.    #define GBD_USER                        1L
  381.    
  382.    /* EndArea Cancel Option */
  383.    
  384.    #define EA_DRAW                         0x00000000L
  385.    #define EA_CANCEL                       0x00000001L
  386.    
  387.    /* Bitblt Style */
  388.    
  389.    #define BLTMODE_SRC_BITMAP              0x00010000L
  390.    #define BLTMODE_ATTRS_PRES              0x00020000L
  391.    #define BBO_TARGWORLD                   0x00000100L
  392.    
  393.    typedef struct _BITBLTPARAMETERS   /* bbp */
  394.    {
  395.       RECTL rclTarg;
  396.       RECTL rclSrc;
  397.    } BITBLTPARAMETERS;
  398.    typedef BITBLTPARAMETERS *PBITBLTPARAMETERS;
  399.    
  400.    typedef struct _BITBLTATTRS   /* bba */
  401.    {
  402.       LONG cSize;
  403.       LONG lColor;
  404.       LONG lBackColor;
  405.    } BITBLTATTRS;
  406.    typedef BITBLTATTRS *PBITBLTATTRS;
  407.    
  408.    /* LCIDs */
  409.    
  410.    #define LCID_AVIO_1                     (-2L)
  411.    #define LCID_AVIO_2                     (-3L)
  412.    #define LCID_AVIO_3                     (-4L)
  413.    #define LCID_BITMAP_ID_REQUEST          (-5L)
  414.    
  415.    #define LCID_RANGE_GPI                  1L
  416.    #define LCID_RANGE_AVIO                 2L
  417.    #define LCID_RANGE_BOTH                 3L
  418.    #define LCID_GRAPHICS_MIN               1
  419.    #define LCID_GRAPHICS_MAX               254
  420.    
  421.    #define LCIDT_NONE                      0L
  422.    
  423.    /* ResetDC */
  424.    
  425.    #define RDC_RGBMODE                     0x1L
  426.    #define RDC_SETOWNERTOSHELL             0x2L
  427.    
  428.    /* SetRandomXform */
  429.    
  430.    #define SX_UNITY                        0L
  431.    #define SX_CAT_AFTER                    1L
  432.    #define SX_CAT_BEFORE                   2L
  433.    #define SX_OVERWRITE                    3L
  434.    
  435.    /* transform accelerators                    */
  436.    /*  These bits are only valid if the MATRIX_SIMPLE bit is set.           */
  437.    /*  The X and Y negate flags are only meaningful if MATRIX_UNITS is set.*/
  438.    
  439.    #define MATRIX_SIMPLE            0x0001L  /* two entries are zero */
  440.    #define MATRIX_UNITS             0x0002L  /* all entries are +1 or -1 */
  441.    #define MATRIX_XY_EXCHANGE       0x0004L  /* zeros are on the diagonal*/
  442.    #define MATRIX_X_NEGATE          0x0008L  /* X is hit by negative */
  443.    #define MATRIX_Y_NEGATE          0x0010L  /* Y is hit by negative */
  444.    #define MATRIX_TRANSLATION       0x0020L  /* non-zero translation */
  445.    
  446.    /* NotifyClipChange */
  447.    
  448.    #define NCC_CLEANDC              0x0002L  /* clear DC dirty bit */
  449.    
  450.    /* NotifyTransformChange */
  451.    
  452.    typedef struct _NOTIFYTRANSFORMDATA   /* ntd */
  453.    {
  454.       ULONG  usType;
  455.       XFORM  xform;
  456.    } NOTIFYTRANSFORMDATA;
  457.    typedef NOTIFYTRANSFORMDATA *PNOTIFYTRANSFORMDATA;
  458.    
  459.    /* ColorTable */
  460.    
  461.    #define LCOL_SYSCOLORS           0x0010L
  462.    
  463.    
  464.    /* query device caps */
  465.    
  466.    typedef struct _QCDARRAY   /* qcd */
  467.    {
  468.       LONG    iFormat;
  469.       LONG    iSmallest;
  470.       LONG    iLargest;
  471.       LONG    cAvailable;
  472.       LONG    cSpecifiable;
  473.       LONG    iMax;
  474.    } QCDARRAY;
  475.    typedef QCDARRAY *PQCDARRAY;
  476.    
  477.    #define CAPS_MIX_OR                  0x00000001L
  478.    #define CAPS_MIX_COPY                0x00000002L
  479.    #define CAPS_MIX_UNDERPAINT          0x00000004L
  480.    #define CAPS_MIX_XOR                 0x00000008L
  481.    #define CAPS_MIX_INVISIBLE           0x00000010L
  482.    #define CAPS_MIX_AND                 0x00000020L
  483.    #define CAPS_MIX_OTHER               0x00000040L
  484.    
  485.    #define CAPS_DEV_FONT_SIM_BOLD       1L      /* for CAPS_DEVICE_FONT_SIM */
  486.    #define CAPS_DEV_FONT_SIM_ITALIC     2L
  487.    #define CAPS_DEV_FONT_SIM_UNDERSCORE 4L
  488.    #define CAPS_DEV_FONT_SIM_STRIKEOUT  8L
  489.    
  490.    #define CAPS_BACKMIX_OR              0x00000001L
  491.    #define CAPS_BACKMIX_COPY            0x00000002L
  492.    #define CAPS_BACKMIX_UNDERPAINT      0x00000004L
  493.    #define CAPS_BACKMIX_XOR             0x00000008L
  494.    #define CAPS_BACKMIX_INVISIBLE       0x00000010L
  495.    
  496.    
  497.    /*#define CAPS_RASTER_BITBLT         0x00000001L defined in pmdev.h */
  498.    /*#define CAPS_RASTER_BANDING        0x00000002L */
  499.    /*#define CAPS_RASTER_STRETCHBLT     0x00000004L */
  500.    /*#define CAPS_RASTER_SETPEL         0x00000010L */
  501.    #define CAPS_FONT_OUTLINE_MANAGE     16L
  502.    #define CAPS_FONT_IMAGE_MANAGE       32L
  503.    #define SFONT_RASTER                 100
  504.    #define SFONT_OUTLINE                101
  505.    #define FONT              1000       /* must not conflict with RT_XXX */
  506.    /* constants in BSEDOS.H */
  507.    
  508.    /* DCCaps */
  509.    
  510.    #define DCCAPS_LINE                  0x0100
  511.    #define DCCAPS_CURVE                 0x0200
  512.    #define DCCAPS_AREA                  0x0400
  513.    #define DCCAPS_MARKER                0x0800
  514.    #define DCCAPS_TEXT                  0x1000
  515.    
  516.    /* DeviceDeleteBitmap */
  517.    #define BITMAP_USAGE_TRANSLATE       0x0004
  518.    
  519.    /* DeleteBitmap return structure */
  520.    typedef struct _DELETERETURN   /* dr */
  521.    {
  522.       ULONG      pInfo;
  523.       ULONG      pBits;
  524.    } DELETERETURN;
  525.    typedef DELETERETURN *PDELETERETURN;
  526.    
  527.    /* Short Line Header */
  528.    
  529.    #define SLH_FORMAT_IS_16_DOT_16 1
  530.    #define PSL_YMAJOR 0x8000    /* bit mask for usStyle */
  531.    
  532.    typedef struct _SHORTLINEHEADER   /* slh */
  533.    {
  534.       ULONG  ulStyle;
  535.       ULONG  ulFormat;
  536.       POINTL ptlStart;
  537.       POINTL ptlStop;
  538.       LONG   lxLeft;
  539.       LONG   lxRight;
  540.       struct _SHORTLINEHEADER *pslhNext;
  541.       struct _SHORTLINEHEADER *pslhPrev;
  542.    } SHORTLINEHEADER;
  543.    typedef SHORTLINEHEADER *PSHORTLINEHEADER;
  544.    /* Short Line */
  545.    
  546.    typedef struct _SHORTLINE   /* sl */
  547.    {
  548.       SHORTLINEHEADER slh;
  549.       LONG      ax[1];
  550.    } SHORTLINE;
  551.    typedef SHORTLINE *PSHORTLINE;
  552.    
  553.    /* Bounding rectangle for subpaths. */
  554.    
  555.    typedef struct _BRECTL          /* brctl */
  556.    {
  557.       POINTL ptl1;
  558.       POINTL ptl2;
  559.    } BRECTL;
  560.    typedef BRECTL *PBRECTL;
  561.    
  562.    typedef struct _RLEHDR   /* rle */
  563.    {
  564.       LONG     lType;
  565.       BRECTL   brectlBounds;
  566.       PVOID    pRLE;
  567.    } RLEHDR;
  568.    typedef RLEHDR *PRLEHDR;
  569.    
  570.    
  571.    typedef struct _SCANDATA   /* sd */
  572.    {
  573.       PSHORTLINE pslFirstLeft;
  574.       PSHORTLINE pslLastLeft;
  575.       PSHORTLINE pslFirstRight;
  576.       PSHORTLINE pslLastRight;
  577.       ULONG      c;
  578.       RECTL      rclBound;
  579.    } SCANDATA;
  580.    typedef SCANDATA *PSCANDATA;
  581.    
  582.    /* Index for Set/GetDriverInfo */
  583.    
  584.    #define DI_HDC                      0x00000000L
  585.    #define DI_HBITMAP                  0x00000001L
  586.    
  587. #endif  /* INCL_DDIMISC */
  588.  
  589. #ifdef INCL_DDIMISC2
  590.    
  591.    /* RealizeFont */
  592.    
  593.    #define REALIZE_FONT                 1   /* To be removed */
  594.    #define REALIZE_ENGINE_FONT          2
  595.    #define DELETE_FONT                  3
  596.    
  597.    #define RF_DEVICE_FONT               1
  598.    #define RF_LOAD_ENGINE_FONT          2
  599.    #define RF_DELETE_FONT               3
  600.    #define RF_DELETE_ENGINE_FONT        4
  601.    
  602. #endif  /* INCL_DDIMISC2 */
  603.  
  604. #ifdef INCL_DDIBUNDLES
  605.    
  606.    /* Device Line Bundle */
  607.    
  608.    typedef struct _LINEDEFS   /* ldef */
  609.    {
  610.       ULONG      defType;
  611.    } LINEDEFS;
  612.    typedef LINEDEFS *PLINDEFS;
  613.    
  614.    typedef struct _DLINEBUNDLE   /* dlbnd */
  615.    {
  616.       LONG       cAttr;
  617.       LONG       cDefs;
  618.       LINEBUNDLE lbnd;
  619.       LINEDEFS   ldef;
  620.    } DLINEBUNDLE;
  621.    typedef DLINEBUNDLE *PDLINEBUNDLE;
  622.    
  623.    /* Device Area Bundle */
  624.    
  625.    typedef struct _AREADEFS   /* adef */
  626.    {
  627.       ULONG      defSet;
  628.       ULONG      fFlags;
  629.       ULONG      CodePage;
  630.    } AREADEFS;
  631.    typedef AREADEFS *PAREADEFS;
  632.    
  633.    typedef struct _DAREABUNDLE   /* dabnd */
  634.    {
  635.       LONG       cAttr;
  636.       LONG       cDefs;
  637.       AREABUNDLE abnd;
  638.       AREADEFS   adef;
  639.    } DAREABUNDLE;
  640.    typedef DAREABUNDLE *PDAREABUNDLE;
  641.    
  642.    /* Device Character Bundle */
  643.    
  644.    typedef struct _CHARDEFS   /* cdef */
  645.    {
  646.       ULONG      defSet;
  647.       ULONG      fFlags;
  648.       ULONG      CodePage;
  649.       ULONG      charSpacing;
  650.    } CHARDEFS;
  651.    typedef CHARDEFS *PCHARDEFS;
  652.    
  653.    typedef struct _DCHARBUNDLE   /* dcbnd */
  654.    {
  655.       LONG       cAttr;
  656.       LONG       cDefs;
  657.       CHARBUNDLE cbnd;
  658.       CHARDEFS   cdef;
  659.    } DCHARBUNDLE;
  660.    typedef DCHARBUNDLE *PDCHARBUNDLE;
  661.    
  662.    /* Device Image Bundle */
  663.    
  664.    #ifdef BOGUS
  665.       typedef struct _IMAGEDEFS   /* idef */
  666.       {
  667.       } IMAGEDEFS;
  668.    #endif       /* BOGUS */
  669.    
  670.    typedef struct _DIMAGEBUNDLE   /* dibnd */
  671.    {
  672.       LONG       cAttr;
  673.       LONG       cDefs;
  674.       IMAGEBUNDLE ibnd;
  675.       /* IMAGEDEFS     idef; */
  676.    } DIMAGEBUNDLE;
  677.    typedef DIMAGEBUNDLE *PDIMAGEBUNDLE;
  678.    
  679.    /* Device Marker Bundle */
  680.    
  681.    typedef struct _MARKERDEFS   /* mdef */
  682.    {
  683.       ULONG      defSet;
  684.       ULONG      fFlags;
  685.       ULONG      CodePage;
  686.    } MARKERDEFS;
  687.    typedef MARKERDEFS *PMARKERDEFS;
  688.    
  689.    typedef struct _DMARKERBUNDLE   /* dmbnd */
  690.    {
  691.       LONG       cAttr;
  692.       LONG       cDefs;
  693.       MARKERBUNDLE mbnd;
  694.       MARKERDEFS   mdef;
  695.    } DMARKERBUNDLE;
  696.    typedef DMARKERBUNDLE *PDMARKERBUNDLE;
  697.    
  698.    
  699. #endif /* INCL_DDIBUNDLES */
  700.  
  701. #ifdef INCL_DDIFONTSTRUCS
  702.    #include <pmfont.h>
  703. #endif /* INCL_DDIFONTSTRUCS */
  704.  
  705. #ifdef INCL_DDIBITMAPFILE
  706.    #include <pmbitmap.h>
  707. #endif /* INCL_DDIBITMAPFILE */
  708.  
  709. #ifdef INCL_DDIPATHS
  710.    /* Curve types */
  711.    
  712.    #define CURVE_IDENTIFIER             0x43
  713.    #define LINE_IDENTIFIER              0x4C
  714.    #define CURVE_DO_FIRST_PEL           0x0002
  715.    
  716.    typedef struct _CURVE   /* cv */
  717.    {
  718.       BYTE        bIdent;             /*  1    1  */
  719.       BYTE        bType;              /*  1    2  */
  720.       USHORT      usReserved;         /*  2    4  */
  721.       ULONG       flStyle;            /*  4    8  */
  722.       ULONG       fl;                 /*  4   12  */
  723.       struct      _CURVE *pcvNext;    /*  4   16  */
  724.       struct      _CURVE *pcvPrev;    /*  4   20  */
  725.       struct      _CURVE *pcvAttrs;   /*  4   24  */
  726.       POINTFX     ptfxA;              /*  8   32  */
  727.       POINTFX     ptfxC;              /*  8   40  */
  728.       BYTE        Reserved2[28];      /* 28   68  */
  729.    } CURVE;
  730.    typedef CURVE *PCURVE;
  731.    
  732.    typedef struct _LINE   /* ln */
  733.    {
  734.       BYTE        bIdent;             /*  1    1  */
  735.       BYTE        bType;              /*  1    2  */
  736.       USHORT      usReserved;         /*  2    4  */
  737.       ULONG       flStyle;            /*  4    8  */
  738.       ULONG       fl;                 /*  4   12  */
  739.       PCURVE      pcvNext;            /*  4   16  */
  740.       PCURVE      pcvPrev;            /*  4   20  */
  741.       PCURVE      pcvAttrs;           /*  4   24  */
  742.       POINTFX     ptfxA;              /*  8   32  */
  743.       POINTFX     ptfxC;              /*  8   40  */
  744.       POINTL      ptlA;               /*  8   48  */
  745.       POINTL      ptlC;               /*  8   56  */
  746.       FIXED       fxRslope;           /*  4   60  */
  747.       BYTE        Reserved1[8];       /*  8   68  */
  748.    } LINE;
  749.    typedef LINE *PLINE;
  750.    
  751. #endif  /* INCL_DDIPATHS */
  752.  
  753. #ifdef INCL_GRE_JOURNALING
  754.    #define JNL_TEMP_FILE            0x00000001L
  755.    #define JNL_PERM_FILE            0x00000002L
  756.    #define JNL_ENGINERAM_FILE       0x00000004L
  757.    #define JNL_USERRAM_FILE         0x00000008L
  758.    #define JNL_DRAW_OPTIMIZATION    0x00000010L
  759.    #define JNL_BOUNDS_OPTIMIZATION  0x00000020L
  760. #endif  /* INCL_GRE_JOURNALING */
  761.  
  762.  
  763. #ifdef INCL_GRE_DEVICE
  764.    
  765.    /* QueryDeviceBitmaps */
  766.    
  767.    typedef struct _BITMAPFORMAT   /* bmf */
  768.    {
  769.       ULONG cPlanes;
  770.       ULONG cBitCount;
  771.    } BITMAPFORMAT;
  772.    typedef BITMAPFORMAT *PBITMAPFORMAT;
  773.    
  774. #endif /* INCL_GRE_DEVICE */
  775.  
  776. #ifdef INCL_GRE_PALETTE
  777.    
  778.    typedef struct _PALETTEINFOHEADER   /* palinfohdr */
  779.    {
  780.       ULONG  flCmd;         /* options from creation                   */
  781.       ULONG  ulFormat;      /* specifies format of entries at creation */
  782.       ULONG  cclr;          /* number of elements supplied at creation */
  783.    } PALETTEINFOHEADER;
  784.    typedef PALETTEINFOHEADER *NPPALETTEINFOHEADER;
  785.    typedef PALETTEINFOHEADER *PPALETTEINFOHEADER;
  786.    
  787.    typedef struct _PALETTEINFO   /* palinfo */
  788.    {
  789.       ULONG  flCmd;         /* options from creation                   */
  790.       ULONG  ulFormat;      /* specifies format of entries at creation */
  791.       ULONG  cclr;          /* number of elements supplied at creation */
  792.       RGB2   argb[1];       /* the palette entries                     */
  793.    } PALETTEINFO;
  794.    typedef PALETTEINFO *NPPALETTEINFO;
  795.    typedef PALETTEINFO *PPALETTEINFO;
  796.    
  797.    /* flType values for RealizePalette */
  798.    #define RP_BACKGROUND                0
  799.    #define RP_FOREGROUND                1
  800.    #define RP_DEFAULTSCHANGED           2
  801.    
  802. #endif
  803.  
  804. #ifdef INCL_GRE_BITMAPS
  805.    #define LR_CLIPPED   2
  806.    #define LR_NOTBORDER 0
  807.    #define LR_BORDER    1
  808.    #define LR_LEFT      2
  809.    #define LR_RIGHT     4
  810. #endif
  811.  
  812. /* Flags  for GreOutlinePath */
  813. #define OPTH_NO_CLIPPING_REQD         0x0001L
  814. #define OPTH_QRY_PATH_POINTS          0x0002L
  815.  
  816. /*** 32-bit cursor/pointer stuff ******************************/
  817. typedef struct _MCDESCRIPTION   /* mcdesc */
  818. {
  819.    PVOID    pMoveCursor;
  820.    ULONG    ulCodeLength;
  821.    PVOID    pCursorData;
  822.    ULONG    ulDataLength;
  823. }  MCDESCRIPTION;
  824. typedef MCDESCRIPTION *PMCDESCRIPTION;
  825.  
  826. typedef struct _WINCURSORDATA   /* winmc */
  827. {
  828.    ULONG      pMoveCursor;
  829.    ULONG      pMoveCursorAlias;
  830.    ULONG      pCursorData;
  831.    ULONG      pCursorDataAlias;
  832.    ULONG      ulRoutineType;
  833.    HMODULE    hModDisplay;
  834.    PVOID      pWCThunkCode;
  835.    ULONG      ulThunkLen;
  836.    USHORT     usR0CS;
  837.    USHORT     usR0DS;
  838. }  WINCURSORDATA;
  839. typedef WINCURSORDATA *PWINCURSORDATA;
  840.  
  841. #define MC_32BIT   32
  842. #define MC_16BIT   16
  843.  
  844. #ifdef INCL_GRE_SCREEN
  845.    
  846.    /* GetScreenBits */
  847.    
  848.    typedef LHANDLE   HSCA;     /* hsca */
  849.    typedef HSCA *PHSCA;
  850.    
  851.    #define GSB_OPT_4BPP    0x0000L
  852.    #define GSB_OPT_8BPP    0x0001L
  853.    #define GSB_OPT_16BPP   0x0002L
  854.    #define GSB_OPT_LINEAR  0x0000L
  855.    #define GSB_OPT_PLANAR  0x0008L
  856.    #define GSB_OPT_HRGN    0x0010L
  857.    
  858. #endif /* INCL_GRE_SCREEN */
  859.  
  860. #ifdef INCL_VMANDDI
  861.    
  862.    #define CAPS_MAX_CAPS    41
  863.    #define DEFAULT_PATTERNS_NUMBER 20
  864.    
  865.    //*******************************************************************************
  866.    // Halftoning and Dithering support for OS/2
  867.    //*******************************************************************************
  868.    
  869.    /******************************************************************************/
  870.    /*    PPOINTL     pptlSrc;            // src left, bottom, width and height.  */
  871.    /*    PPOINTL     pptlDst;            // dst left, bottom, width and height.  */
  872.    /*    ULONG       ulSrcBytesPerLine;  // src bytes per line                   */
  873.    /*    PBYTE       pbSrcBits;          // pointer to src image data            */
  874.    /*    ULONG       ulTrgBytesPerLine;  // dst bytes per line                   */
  875.    /*    PBYTE       pbTrgBits;          // pointer to dst image data            */
  876.    /*    ULONG       ulOptions;          // options                              */
  877.    /*    ULONG       ulcClrs;            // count of colors in rgb2 table        */
  878.    /*    PRGB2       pargb2;             // rgb2 table                           */
  879.    /******************************************************************************/
  880.    
  881.    typedef struct _IMAGEINFOS          /* imginfo */
  882.    {
  883.       PPOINTL     pptlSrc;
  884.       PPOINTL     pptlDst;
  885.       ULONG       ulSrcBpp;
  886.       ULONG       ulSrcBytesPerLine;
  887.       PBYTE       pbSrcBits;
  888.       ULONG       ulcSrcClrs;
  889.       ULONG       ulSrcClrType;
  890.       PRGB2       pargb2Src;
  891.       ULONG       ulTrgBpp;
  892.       ULONG       ulTrgBytesPerLine;
  893.       PBYTE       pbTrgBits;
  894.       ULONG       ulcTrgClrs;
  895.       ULONG       ulTrgClrType;
  896.       PRGB2       pargb2Trg;
  897.       ULONG       ulOptions;
  898.    } IMAGEINFOS;
  899.    typedef IMAGEINFOS * PIMAGEINFO;    /* pimginfo */
  900.    
  901.    #define  GDM_NO_DITHER               0x0000   // No dithering in system
  902.    #define  GDM_USERDEF_DITHER          0x0001   // Users supplies own Dithering routines
  903.    #define  GDM_MATRIX_DITHER           0x0002   // Use System ordered dithering
  904.    #define  GDM_ERRORDIF_DITHER         0x0004   // Use System error diffusion dithering
  905.    #define  GDM_FLOYDSTEIN_DITHER       0x0008   // Use System Floyd-Steinberg dithering
  906.    #define  GDM_ERRORPROP_DITHER        0x0010   // Use System error propigation dithering
  907.    
  908.    /*******************************************************************************************/
  909.    /*    ULONG       ulLength;      // Length of dither matrix structure                      */
  910.    /*    ULONG       fExt2IntSup;   // Gre Dither Flags for Ext to Int                        */
  911.    /*    PVOID       pExt2IntDI;    // Used for GDM_USERDEF - pointer to users dither info    */
  912.    /*    ULONG       fStretchSup;   // Gre Dither Flags for Stretch Support                   */
  913.    /*    PVOID       pStretchDI;    // Used for GDM_USERDEF - pointer to users dither info    */
  914.    /*    ULONG       fLog2PhysSup;  // Gre Dither Flags for Log to Phys clr mapping           */
  915.    /*    PVOID       pLog2PhysDI;   // Used for GDM_USERDEF - pointer to users dither info    */
  916.    /*    PFN         pfnDither;     // Used for GDM_USERDEF - pointer to users dither function*/
  917.    /*******************************************************************************************/
  918.    
  919.    typedef struct _DITHERMATRIX   /* dthmtx */
  920.    {
  921.       ULONG       ulLength;
  922.       ULONG       fExt2IntSup;
  923.       PVOID       pExt2IntDI;
  924.       ULONG       fStretchSup;
  925.       PVOID       pStretchDI;
  926.       ULONG       fLog2PhysSup;
  927.       PVOID       pLog2PhysDI;
  928.       PFN         pfnDither;
  929.    } DITHERMATRIX;
  930.    typedef DITHERMATRIX *PDITHERMATRIX;  /* pdthmtx */
  931.    
  932.    #define  GDM_EXT2INT_DITHER   0x01
  933.    #define  GDM_STRETCH_DITHER   0x02
  934.    #define  GDM_LOG2PHY_DITHER   0x04
  935.    
  936.    // pfnDither(PDITHERINFO pdi, PIMAGEINFO pii, ULONG ulFlags);
  937.    
  938.    /*******************************************************************************************/
  939.    /*    ULONG       ulLength;      // length of structure                 - 88               */
  940.    /*    ULONG       ulType;        // type of dither info structure       - GDM_MATRIX_DITHER*/
  941.    /*    ULONG       fOptions;      // dither info options - DI_MONOINVERT - 00               */
  942.    /*    ULONG       ulIntensity;   // RGB Gama Correction Value           - 00
  943.    /*    BYTE        bRedWt;        // weight of primary color red         - 25               */
  944.    /*    BYTE        bGreenWt;      // weight of primary color green       - 60               */
  945.    /*    BYTE        bBlueWt;       // weight of primary color blue        - 15               */
  946.    /*    BYTE        bPad;          // 4 byte align                        - 00               */
  947.    /*    SIZEL       szMatrix;      // halftone pattern size               - 8                */
  948.    /*    BYTE        bHalftone[];   // array of halftone patterns          - see 32gdata.c    */
  949.    /*******************************************************************************************/
  950.    
  951.    typedef struct _MATRIXDITHERINFO      /* mtrxdi */
  952.    {
  953.       ULONG       ulLength;
  954.       ULONG       ulType;
  955.       ULONG       fOptions;
  956.       ULONG       ulIntensity;
  957.       BYTE        bRedWt;
  958.       BYTE        bGreenWt;
  959.       BYTE        bBlueWt;
  960.       BYTE        bPad;
  961.       SIZEL       szMatrix;
  962.       BYTE        bHalftone[1];
  963.    } MATRIXDITHERINFO;
  964.    typedef MATRIXDITHERINFO *PMDI;  /* pmtrxdi */
  965.    
  966.    typedef struct _DEVICESURFACE          /* devsur */
  967.    {
  968.       ULONG         ulLength;
  969.       BMAPINFO      SurfaceBmapInfo;
  970.       ULONG         ulDSFlgs;
  971.       ULONG         ulStyleRatio;
  972.       BMAPINFO      abmapinfoDefPattern[DEFAULT_PATTERNS_NUMBER];
  973.       PVOID         pHWPalette;
  974.       DITHERMATRIX  DitherMatrix;
  975.       PFN           pfnDevLockDC;
  976.       PFN           pfnDevUnLockDC;
  977.       PFN           pfnBitBlt;
  978.       PFN           pfnLine;
  979.       PFN           pfnReserved;
  980.       PFN           pfnLockPhysDev;
  981.       PFN           pfnUnLockPhysDev;
  982.       ULONG         ulReserved[5];
  983.       ULONG         ulCapsCnt;
  984.       ULONG         DevCaps[CAPS_MAX_CAPS + 1];
  985.    } DEVICESURFACE;
  986.    typedef DEVICESURFACE *PDEVICESURFACE; /* pdevsur */
  987.    
  988.    APIRET APIENTRY GreSetDitherInfo(HDC hdc,
  989.                                     ULONG ulDitherType,
  990.                                     PVOID pDitherInfo);
  991.    APIRET APIENTRY SetDeviceSurface(HDC hdc,
  992.                                     PDEVICESURFACE pds);
  993.    
  994.    // Surface definition flags
  995.    
  996.    #define DS_COLOR_RGB2            0  // color is in RGB2             (default)
  997.    #define DS_COLOR_RGB             1  // color is in RGB
  998.    
  999.    #define DS_COLOR_24BIT_BGR       0  // 1st byte=blue,               (default)
  1000.    // 2nd byte=green 3rd byte=red
  1001.    #define DS_COLOR_24BIT_RGB       1  // 1st byte=red, 2nd byte=green
  1002.    // 3rd byte=blue
  1003.    
  1004.    #define DS_COLOR_16BIT_565_BGR   0  // blue - 5 bits,               (default)
  1005.    // green - 6 bits, red - 5 bits
  1006.    // ---------------------------------
  1007.    // |b|b|b|b|b|g|g|g|g|g|g|r|r|r|r|r|
  1008.    // ---------------------------------
  1009.    #define DS_COLOR_16BIT_565_RGB   1  // red - 5 bits,
  1010.    // green - 6 bits, blue - 5 bits
  1011.    // ---------------------------------
  1012.    // |r|r|r|r|r|g|g|g|g|g|g|b|b|b|b|b|
  1013.    // ---------------------------------
  1014.    #define DS_COLOR_16BIT_1555_RGB  2  // overlay - 1, red - 5 bits,
  1015.    // green - 5 bits, blue - 5 bits
  1016.    // ---------------------------------
  1017.    // |o|r|r|r|r|r|g|g|g|g|g|b|b|b|b|b|
  1018.    // ---------------------------------
  1019.    
  1020.    #define DS_BOTTOMTOP                0x00010000
  1021.    #define DS_TOPBOTTOM                0x00020000
  1022.    
  1023.    #define DS_BYTEALIGN                0x00000010
  1024.    #define DS_WORDALIGN                0x00000020
  1025.    #define DS_DWORDALIGN               0x00000040
  1026.    
  1027.    #define DS_KEEP_EXTFORMAT           0x00000100
  1028.    #define DS_MONO_INVERT              0x00000200
  1029.    
  1030.    #define DS_EXTERNAL_BITMAP_SELECTED 0x00000400
  1031.    
  1032.    #define DS_NOTIFY_LAST_SDBITBLT     0x00000800
  1033.    
  1034.    #define DS_QUEUED_RAW_DEFAULT       0x00001000
  1035.    
  1036.    #define DS_BITBLT_BANDING_TOPBOTTOM 0x00010000
  1037.    #define DS_BITBLT_ROTATE_90         0x00020000
  1038.    #define DS_BITBLT_ROTATE_180        0x00040000
  1039.    #define DS_BITBLT_ROTATE_270        0x00080000
  1040.    
  1041.    
  1042.    
  1043. #endif /* INCL_VMANDDI */
  1044.  
  1045. #include <pmddim.h>
  1046.  
  1047. /* NOINC */
  1048. #ifdef __IBMC__
  1049.    #pragma checkout( suspend )
  1050.    #ifndef __CHKHDR__
  1051.       #pragma checkout( resume )
  1052.    #endif
  1053.    #pragma checkout( resume )
  1054. #endif
  1055. /* INC */
  1056.  
  1057. /**************************** end of file **********************************/
  1058.