home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ddkx86v1.zip / DDKX86 / IBMH / PMDEV.H < prev    next >
C/C++ Source or Header  |  1995-04-14  |  15KB  |  390 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: PMDEV.H
  15. *
  16. * OS/2 Presentation Manager Device Context constants, types and
  17. * function declarations
  18. *
  19. *
  20. * ===========================================================================
  21. *
  22. * The following symbols are used in this file for conditional sections.
  23. *
  24. *   #define:                To include:
  25. *
  26. *   INCL_DEVERRORS          error definitions
  27. *   INCL_DEV                Dev APIs and structures
  28. *
  29. * There is a symbol used in this file called INCL_DDIDEFS. This is used to
  30. * include only the definitions for the DDI. The programmer using the GPI
  31. * can ignore this symbol
  32. *
  33. * There is a symbol used in this file called INCL_SAADEFS. This is used to
  34. * include only the definitions for the SAA. The programmer using the GPI
  35. * can ignore this symbol
  36. *
  37. * ===========================================================================
  38. *
  39. * Comments at the end of each typedef line give the name tags used in
  40. * the assembler include version of this file.
  41. *
  42. * The assembler include version of this file excludes lines between NOINC
  43. * and INC comments.
  44. *
  45. \***************************************************************************/
  46.  
  47. #ifdef __IBMC__
  48.    #pragma checkout( suspend )
  49.    #ifndef __CHKHDR__
  50.       #pragma checkout( suspend )
  51.    #endif
  52.    #pragma checkout( resume )
  53. #endif
  54.  
  55. #define DEV_INCLUDED
  56.  
  57.  
  58. #ifdef INCL_ERRORS /* if errors are required then allow DEV errors */
  59.    #define INCL_DEVERRORS
  60. #endif /* INCL_ERRORS */
  61.  
  62. #ifdef INCL_DDIDEFS /* if only DDI required then enable all of DEV */
  63.    #define INCL_DEV
  64. #endif /* INCL_DDIDEFS */
  65.  
  66. #ifdef INCL_SAADEFS /* if only SAA required then enable all of DEV */
  67.    #define INCL_DEV
  68. #endif /* INCL_SAADEFS */
  69.  
  70. #if (defined(INCL_DEV) || !defined(INCL_NOCOMMON))
  71.    
  72.    /* General DEV return values */
  73.    #define DEV_ERROR                       0L
  74.    #define DEV_OK                          1L
  75.    
  76.    /* DC type for DevOpenDC */
  77.    #define OD_QUEUED                       2L
  78.    #define OD_DIRECT                       5L
  79.    #define OD_INFO                         6L
  80.    #define OD_METAFILE                     7L
  81.    #define OD_MEMORY                       8L
  82.    #define OD_METAFILE_NOQUERY             9L
  83.    
  84.    /* codes for DevQueryCaps */
  85.    #define CAPS_FAMILY                     0L
  86.    #define CAPS_IO_CAPS                    1L
  87.    #define CAPS_TECHNOLOGY                 2L
  88.    #define CAPS_DRIVER_VERSION             3L
  89.    #define CAPS_WIDTH                      4L      /* pels            */
  90.    #define CAPS_HEIGHT                     5L      /* pels            */
  91.    #define CAPS_WIDTH_IN_CHARS             6L
  92.    #define CAPS_HEIGHT_IN_CHARS            7L
  93.    #define CAPS_HORIZONTAL_RESOLUTION      8L      /* pels per meter  */
  94.    #define CAPS_VERTICAL_RESOLUTION        9L      /* pels per meter  */
  95.    #define CAPS_CHAR_WIDTH                10L      /* pels            */
  96.    #define CAPS_CHAR_HEIGHT               11L      /* pels            */
  97.    #define CAPS_SMALL_CHAR_WIDTH          12L      /* pels            */
  98.    #define CAPS_SMALL_CHAR_HEIGHT         13L      /* pels            */
  99.    #define CAPS_COLORS                    14L
  100.    #define CAPS_COLOR_PLANES              15L
  101.    #define CAPS_COLOR_BITCOUNT            16L
  102.    #define CAPS_COLOR_TABLE_SUPPORT       17L
  103.    #define CAPS_MOUSE_BUTTONS             18L
  104.    #define CAPS_FOREGROUND_MIX_SUPPORT    19L
  105.    #define CAPS_BACKGROUND_MIX_SUPPORT    20L
  106.    #define CAPS_DEVICE_WINDOWING          31L
  107.    #define CAPS_ADDITIONAL_GRAPHICS       32L
  108.    #define CAPS_VIO_LOADABLE_FONTS        21L
  109.    #define CAPS_WINDOW_BYTE_ALIGNMENT     22L
  110.    #define CAPS_BITMAP_FORMATS            23L
  111.    #define CAPS_RASTER_CAPS               24L
  112.    #define CAPS_MARKER_HEIGHT             25L      /* pels            */
  113.    #define CAPS_MARKER_WIDTH              26L      /* pels            */
  114.    #define CAPS_DEVICE_FONTS              27L
  115.    #define CAPS_GRAPHICS_SUBSET           28L
  116.    #define CAPS_GRAPHICS_VERSION          29L
  117.    #define CAPS_GRAPHICS_VECTOR_SUBSET    30L
  118.    #define CAPS_PHYS_COLORS               33L
  119.    #define CAPS_COLOR_INDEX               34L
  120.    #define CAPS_GRAPHICS_CHAR_WIDTH       35L
  121.    #define CAPS_GRAPHICS_CHAR_HEIGHT      36L
  122.    #define CAPS_HORIZONTAL_FONT_RES       37L
  123.    #define CAPS_VERTICAL_FONT_RES         38L
  124.    #define CAPS_DEVICE_FONT_SIM           39L
  125.    #define CAPS_LINEWIDTH_THICK           40L
  126.    #define CAPS_DEVICE_POLYSET_POINTS     41L
  127.    
  128.    /* Constants for CAPS_IO_CAPS */
  129.    #define CAPS_IO_DUMMY                   1L
  130.    #define CAPS_IO_SUPPORTS_OP             2L
  131.    #define CAPS_IO_SUPPORTS_IP             3L
  132.    #define CAPS_IO_SUPPORTS_IO             4L
  133.    
  134.    /* Constants for CAPS_TECHNOLOGY */
  135.    #define CAPS_TECH_UNKNOWN               0L
  136.    #define CAPS_TECH_VECTOR_PLOTTER        1L
  137.    #define CAPS_TECH_RASTER_DISPLAY        2L
  138.    #define CAPS_TECH_RASTER_PRINTER        3L
  139.    #define CAPS_TECH_RASTER_CAMERA         4L
  140.    #define CAPS_TECH_POSTSCRIPT            5L
  141.    
  142.    /* Constants for CAPS_COLOR_TABLE_SUPPORT */
  143.    #define CAPS_COLTABL_RGB_8              1L
  144.    #define CAPS_COLTABL_RGB_8_PLUS         2L
  145.    #define CAPS_COLTABL_TRUE_MIX           4L
  146.    #define CAPS_COLTABL_REALIZE            8L
  147.    
  148.    /* Constants for CAPS_FOREGROUND_MIX_SUPPORT */
  149.    #define CAPS_FM_OR                      1L
  150.    #define CAPS_FM_OVERPAINT               2L
  151.    #define CAPS_FM_XOR                     8L
  152.    #define CAPS_FM_LEAVEALONE             16L
  153.    #define CAPS_FM_AND                    32L
  154.    #define CAPS_FM_GENERAL_BOOLEAN        64L
  155.    
  156.    /* Constants for CAPS_BACKGROUND_MIX_SUPPORT */
  157.    #define CAPS_BM_OR                      1L
  158.    #define CAPS_BM_OVERPAINT               2L
  159.    #define CAPS_BM_XOR                     8L
  160.    #define CAPS_BM_LEAVEALONE             16L
  161.    #define CAPS_BM_AND                    32L
  162.    #define CAPS_BM_GENERAL_BOOLEAN        64L
  163.    #define CAPS_BM_SRCTRANSPARENT        128L
  164.    #define CAPS_BM_DESTTRANSPARENT       256L
  165.    
  166.    /* Constants for CAPS_DEVICE_WINDOWING */
  167.    #define CAPS_DEV_WINDOWING_SUPPORT      1L
  168.    
  169.    /* Constants for CAPS_DEV_FONT_SIM     */
  170.    #define CAPS_DEV_FONT_SIM_BOLD          1L
  171.    #define CAPS_DEV_FONT_SIM_ITALIC        2L
  172.    #define CAPS_DEV_FONT_SIM_UNDERSCORE    4L
  173.    #define CAPS_DEV_FONT_SIM_STRIKEOUT     8L
  174.    
  175.    /* Constants for CAPS_ADDITIONAL_GRAPHICS */
  176.    #define CAPS_VDD_DDB_TRANSFER            1L
  177.    #define CAPS_GRAPHICS_KERNING_SUPPORT    2L
  178.    #define CAPS_FONT_OUTLINE_DEFAULT        4L
  179.    #define CAPS_FONT_IMAGE_DEFAULT          8L
  180.    /* bits represented by values 16L and 32L are reserved */
  181.    #define CAPS_SCALED_DEFAULT_MARKERS     64L
  182.    #define CAPS_COLOR_CURSOR_SUPPORT      128L
  183.    #define CAPS_PALETTE_MANAGER           256L
  184.    #define CAPS_COSMETIC_WIDELINE_SUPPORT 512L
  185.    #define CAPS_DIRECT_FILL              1024L
  186.    #define CAPS_REBUILD_FILLS            2048L
  187.    #define CAPS_CLIP_FILLS               0x00001000 /* 4096L  */
  188.    #define CAPS_ENHANCED_FONTMETRICS     0x00002000 /* 8192L  */
  189.    #define CAPS_TRANSFORM_SUPPORT        0x00004000 /* 16384L */
  190.    #define CAPS_EXTERNAL_16_BITCOUNT     0x00008000 /* 32768L */
  191.    
  192.    #ifndef INCL_SAADEFS
  193.       
  194.       /* Constants for CAPS_WINDOW_BYTE_ALIGNMENT */
  195.       #define CAPS_BYTE_ALIGN_REQUIRED        0L
  196.       #define CAPS_BYTE_ALIGN_RECOMMENDED     1L
  197.       #define CAPS_BYTE_ALIGN_NOT_REQUIRED    2L
  198.    #endif /* no INCL_SAADEFS */
  199.    
  200.    /* Constants for CAPS_RASTER_CAPS */
  201.    #define CAPS_RASTER_BITBLT              1L
  202.    #define CAPS_RASTER_BANDING             2L
  203.    #define CAPS_RASTER_BITBLT_SCALING      4L
  204.    #define CAPS_RASTER_SET_PEL            16L
  205.    #define CAPS_RASTER_FONTS              32L
  206.    #define CAPS_RASTER_FLOOD_FILL         64L
  207.    
  208.    #ifndef INCL_DDIDEFS
  209.       
  210.       HDC  APIENTRY DevOpenDC(HAB hab,
  211.                               LONG lType,
  212.                               PSZ pszToken,
  213.                               LONG lCount,
  214.                               PDEVOPENDATA pdopData,
  215.                               HDC hdcComp);
  216.       
  217.       HMF  APIENTRY DevCloseDC(HDC hdc);
  218.       
  219.       BOOL  APIENTRY DevQueryCaps(HDC hdc,
  220.                                   LONG lStart,
  221.                                   LONG lCount,
  222.                                   PLONG alArray);
  223.    #endif /* no INCL_DDIDEFS */
  224.    
  225. #endif /* common DEV */
  226.  
  227. #ifdef INCL_DEV
  228.    
  229.    #ifndef INCL_SAADEFS
  230.       
  231.       /* structures for DEVESC_QUERYVIOCELLSIZES */
  232.       typedef struct _VIOSIZECOUNT    /* vios */
  233.       {
  234.          LONG maxcount;
  235.          LONG count;
  236.       } VIOSIZECOUNT;
  237.       typedef VIOSIZECOUNT *PVIOSIZECOUNT;
  238.       
  239.       typedef struct _VIOFONTCELLSIZE    /* viof */
  240.       {
  241.          LONG cx;
  242.          LONG cy;
  243.       } VIOFONTCELLSIZE;
  244.       typedef VIOFONTCELLSIZE *PVIOFONTCELLSIZE;
  245.       
  246.       /* structure for DEVESC_GETSCALINGFACTOR */
  247.       typedef struct _SFACTORS    /* sfactors */
  248.       {
  249.          LONG x;
  250.          LONG y;
  251.       } SFACTORS;
  252.       typedef SFACTORS *PSFACTORS;
  253.       
  254.       /* structure for DEVESC_NEXTBAND */
  255.       typedef struct _BANDRECT    /* bandrect */
  256.       {
  257.          LONG  xleft;
  258.          LONG  ybottom;
  259.          LONG  xright;
  260.          LONG  ytop;
  261.       } BANDRECT;
  262.       typedef BANDRECT *PBANDRECT;
  263.       
  264.       /* return codes for DevEscape */
  265.       #define DEVESC_ERROR                  (-1L)
  266.       #define DEVESC_NOTIMPLEMENTED           0L
  267.       
  268.       /* codes for DevEscape */
  269.       #define DEVESC_QUERYESCSUPPORT          0L
  270.       #define DEVESC_GETSCALINGFACTOR         1L
  271.       #define DEVESC_QUERYVIOCELLSIZES        2L
  272.       #define DEVESC_GETCP                 8000L
  273.       
  274.       #define DEVESC_STARTDOC              8150L
  275.       #define DEVESC_ENDDOC                8151L
  276.       #define DEVESC_NEXTBAND              8152L
  277.       #define DEVESC_ABORTDOC              8153L
  278.       
  279.       #define DEVESC_NEWFRAME             16300L
  280.       #define DEVESC_DRAFTMODE            16301L
  281.       #define DEVESC_FLUSHOUTPUT          16302L
  282.       #define DEVESC_RAWDATA              16303L
  283.       #define DEVESC_SETMODE              16304L
  284.       
  285.       #define DEVESC_DBE_FIRST            24450L
  286.       #define DEVESC_DBE_LAST             24455L
  287.       
  288.       /* DevEscape codes for adding extra space to character strings */
  289.       #define DEVESC_CHAR_EXTRA           16998L
  290.       #define DEVESC_BREAK_EXTRA          16999L
  291.       
  292.       /* codes for DevEscape PM_Q_ESC spool files */
  293.       #define DEVESC_STD_JOURNAL          32600L
  294.       
  295.       /* structure for DEVESC_SETMODE */
  296.       typedef struct _ESCMODE     /* em */
  297.       {
  298.          ULONG mode;
  299.          BYTE  modedata[1];
  300.       } ESCMODE;
  301.       typedef ESCMODE *PESCMODE;
  302.       
  303.       /* return codes for DevPostDeviceModes */
  304.       #define DPDM_ERROR                    (-1L)
  305.       #define DPDM_NONE                       0L
  306.       
  307.       /* codes for DevPostDeviceModes */
  308.       #define DPDM_POSTJOBPROP                0L
  309.       #define DPDM_CHANGEPROP                 1L
  310.       #define DPDM_QUERYJOBPROP               2L
  311.       
  312.       /* string types for DevQueryDeviceNames */
  313.       typedef CHAR STR16[16];     /* str16 */
  314.       typedef STR16 *PSTR16;
  315.       typedef CHAR STR32[32];     /* str32 */
  316.       typedef STR32 *PSTR32;
  317.       typedef CHAR STR64[64];     /* str64 */
  318.       typedef STR64 *PSTR64;
  319.       
  320.       /* return code for DevQueryHardcopyCaps */
  321.       #define DQHC_ERROR                    (-1L)
  322.       
  323.       /* codes for DevQueryHardcopyCaps */
  324.       #define HCAPS_CURRENT                   1L
  325.       #define HCAPS_SELECTABLE                2L
  326.       
  327.       /* structure for DevQueryHardcopyCaps */
  328.       typedef struct _HCINFO           /* hci */
  329.       {
  330.          CHAR   szFormname[32];
  331.          LONG   cx;
  332.          LONG   cy;
  333.          LONG   xLeftClip;
  334.          LONG   yBottomClip;
  335.          LONG   xRightClip;
  336.          LONG   yTopClip;
  337.          LONG   xPels;
  338.          LONG   yPels;
  339.          LONG   flAttributes;
  340.       } HCINFO;
  341.       typedef HCINFO *PHCINFO;
  342.       
  343.       /* Device Context Functions */
  344.       #ifndef INCL_DDIDEFS
  345.          
  346.          LONG  APIENTRY DevEscape(HDC hdc,
  347.                                   LONG lCode,
  348.                                   LONG lInCount,
  349.                                   PBYTE pbInData,
  350.                                   PLONG plOutCount,
  351.                                   PBYTE pbOutData);
  352.          
  353.          BOOL  APIENTRY DevQueryDeviceNames(HAB hab,
  354.                                             PSZ pszDriverName,
  355.                                             PLONG pldn,
  356.                                             PSTR32 aDeviceName,
  357.                                             PSTR64 aDeviceDesc,
  358.                                             PLONG pldt,
  359.                                             PSTR16 aDataType);
  360.          
  361.          LONG  APIENTRY DevQueryHardcopyCaps(HDC hdc,
  362.                                              LONG lStartForm,
  363.                                              LONG lForms,
  364.                                              PHCINFO phciHcInfo);
  365.          
  366.          LONG  APIENTRY DevPostDeviceModes(HAB hab,
  367.                                            PDRIVDATA pdrivDriverData ,
  368.                                            PSZ pszDriverName,
  369.                                            PSZ pszDeviceName,
  370.                                            PSZ pszName,
  371.                                            ULONG flOptions);
  372.          
  373.       #endif /* no INCL_DDIDEFS */
  374.    #endif /* no INCL_SAADEFS */
  375. #endif /* non-common DEV */
  376.  
  377. #ifdef INCL_DEVERRORS
  378.    /* AAB error codes for the DEV - same as GPI errors at present */
  379. #endif /* INCL_DEVERRORS */
  380.  
  381. #ifdef __IBMC__
  382.    #pragma checkout( suspend )
  383.    #ifndef __CHKHDR__
  384.       #pragma checkout( resume )
  385.    #endif
  386.    #pragma checkout( resume )
  387. #endif
  388.  
  389. /**************************** end of file **********************************/
  390.