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