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