home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / bpos13.zip / pmdev.pas < prev    next >
Pascal/Delphi Source File  |  1993-11-24  |  10KB  |  285 lines

  1. {| Unit: pmdev
  2.  | Version: 1.00
  3.  | translated from file pmdev.H
  4.  | Original translation: Peter Sawatzki (ps)
  5.  | Contributing:
  6.  |   (fill in)
  7.  |
  8.  | change history:
  9.  | Date:    Ver: Author:
  10.  | 11/19/93 1.00 ps     original translation by ps
  11. }
  12. Unit pmdev;
  13. Interface
  14. Uses
  15.   Os2Def;
  16. {**************************************************************************\
  17. *
  18. * Module Name: PMDEV.H
  19. *
  20. * OS/2 Presentation Manager Device Context constants, types and
  21. * function declarations
  22. *
  23. \**************************************************************************}
  24.  
  25. Type
  26.   { pointer data for DevOpenDC }
  27.   pDevOpenData = ^PSZ;
  28.  
  29. { General DEV return values }
  30.  
  31. Const
  32.   DEV_ERROR                        = 0 ;
  33.   DEV_OK                           = 1 ;
  34.  
  35. { DC type for DevOpenDC }
  36.   OD_QUEUED                        = 2 ;
  37.   OD_DIRECT                        = 5 ;
  38.   OD_INFO                          = 6 ;
  39.   OD_METAFILE                      = 7 ;
  40.   OD_MEMORY                        = 8 ;
  41.   OD_METAFILE_NOQUERY              = 9 ;
  42.  
  43. { codes for DevQueryCaps }
  44.   CAPS_FAMILY                      = 0 ;
  45.   CAPS_IO_CAPS                     = 1 ;
  46.   CAPS_TECHNOLOGY                  = 2 ;
  47.   CAPS_DRIVER_VERSION              = 3 ;
  48.   CAPS_WIDTH                       = 4 ;                    { pels            }
  49.   CAPS_HEIGHT                      = 5 ;                    { pels            }
  50.   CAPS_WIDTH_IN_CHARS              = 6 ;
  51.   CAPS_HEIGHT_IN_CHARS             = 7 ;
  52.   CAPS_HORIZONTAL_RESOLUTION       = 8 ;                    { pels per meter  }
  53.   CAPS_VERTICAL_RESOLUTION         = 9 ;                    { pels per meter  }
  54.   CAPS_CHAR_WIDTH                  = 10 ;                   { pels            }
  55.   CAPS_CHAR_HEIGHT                 = 11 ;                   { pels            }
  56.   CAPS_SMALL_CHAR_WIDTH            = 12 ;                   { pels            }
  57.   CAPS_SMALL_CHAR_HEIGHT           = 13 ;                   { pels            }
  58.   CAPS_COLORS                      = 14 ;
  59.   CAPS_COLOR_PLANES                = 15 ;
  60.   CAPS_COLOR_BITCOUNT              = 16 ;
  61.   CAPS_COLOR_TABLE_SUPPORT         = 17 ;
  62.   CAPS_MOUSE_BUTTONS               = 18 ;
  63.   CAPS_FOREGROUND_MIX_SUPPORT      = 19 ;
  64.   CAPS_BACKGROUND_MIX_SUPPORT      = 20 ;
  65.   CAPS_DEVICE_WINDOWING            = 31 ;
  66.   CAPS_ADDITIONAL_GRAPHICS         = 32 ;
  67.   CAPS_VIO_LOADABLE_FONTS          = 21 ;
  68.   CAPS_WINDOW_BYTE_ALIGNMENT       = 22 ;
  69.   CAPS_BITMAP_FORMATS              = 23 ;
  70.   CAPS_RASTER_CAPS                 = 24 ;
  71.   CAPS_MARKER_HEIGHT               = 25 ;                   { pels            }
  72.   CAPS_MARKER_WIDTH                = 26 ;                   { pels            }
  73.   CAPS_DEVICE_FONTS                = 27 ;
  74.   CAPS_GRAPHICS_SUBSET             = 28 ;
  75.   CAPS_GRAPHICS_VERSION            = 29 ;
  76.   CAPS_GRAPHICS_VECTOR_SUBSET      = 30 ;
  77.   CAPS_PHYS_COLORS                 = 33 ;
  78.   CAPS_COLOR_INDEX                 = 34 ;
  79.   CAPS_GRAPHICS_CHAR_WIDTH         = 35 ;
  80.   CAPS_GRAPHICS_CHAR_HEIGHT        = 36 ;
  81.   CAPS_HORIZONTAL_FONT_RES         = 37 ;
  82.   CAPS_VERTICAL_FONT_RES           = 38 ;
  83.   CAPS_DEVICE_FONT_SIM             = 39 ;
  84.  
  85. { Constants for CAPS_IO_CAPS }
  86.   CAPS_IO_DUMMY                    = 1 ;
  87.   CAPS_IO_SUPPORTS_OP              = 2 ;
  88.   CAPS_IO_SUPPORTS_IP              = 3 ;
  89.   CAPS_IO_SUPPORTS_IO              = 4 ;
  90.  
  91. { Constants for CAPS_TECHNOLOGY }
  92.   CAPS_TECH_UNKNOWN                = 0 ;
  93.   CAPS_TECH_VECTOR_PLOTTER         = 1 ;
  94.   CAPS_TECH_RASTER_DISPLAY         = 2 ;
  95.   CAPS_TECH_RASTER_PRINTER         = 3 ;
  96.   CAPS_TECH_RASTER_CAMERA          = 4 ;
  97.   CAPS_TECH_POSTSCRIPT             = 5 ;
  98.  
  99. { Constants for CAPS_COLOR_TABLE_SUPPORT }
  100.   CAPS_COLTABL_RGB_8               = 1 ;
  101.   CAPS_COLTABL_RGB_8_PLUS          = 2 ;
  102.   CAPS_COLTABL_TRUE_MIX            = 4 ;
  103.   CAPS_COLTABL_REALIZE             = 8 ;
  104.  
  105. { Constants for CAPS_FOREGROUND_MIX_SUPPORT }
  106.   CAPS_FM_OR                       = 1 ;
  107.   CAPS_FM_OVERPAINT                = 2 ;
  108.   CAPS_FM_XOR                      = 8 ;
  109.   CAPS_FM_LEAVEALONE               = 16 ;
  110.   CAPS_FM_AND                      = 32 ;
  111.   CAPS_FM_GENERAL_BOOLEAN          = 64 ;
  112.  
  113. { Constants for CAPS_BACKGROUND_MIX_SUPPORT }
  114.   CAPS_BM_OR                       = 1 ;
  115.   CAPS_BM_OVERPAINT                = 2 ;
  116.   CAPS_BM_XOR                      = 8 ;
  117.   CAPS_BM_LEAVEALONE               = 16 ;
  118.  
  119. { Constants for CAPS_DEVICE_WINDOWING }
  120.   CAPS_DEV_WINDOWING_SUPPORT       = 1 ;
  121.  
  122. { Constants for CAPS_ADDITIONAL_GRAPHICS }
  123.   CAPS_GRAPHICS_KERNING_SUPPORT    = 2 ;
  124.   CAPS_FONT_OUTLINE_DEFAULT        = 4 ;
  125.   CAPS_FONT_IMAGE_DEFAULT          = 8 ;
  126. { bits represented by values 16L and 32L are reserved }
  127.   CAPS_SCALED_DEFAULT_MARKERS      = 64 ;
  128.  
  129. { Constants for CAPS_WINDOW_BYTE_ALIGNMENT }
  130.   CAPS_BYTE_ALIGN_REQUIRED         = 0 ;
  131.   CAPS_BYTE_ALIGN_RECOMMENDED      = 1 ;
  132.   CAPS_BYTE_ALIGN_NOT_REQUIRED     = 2 ;
  133.  
  134. { Constants for CAPS_RASTER_CAPS }
  135.   CAPS_RASTER_BITBLT               = 1 ;
  136.   CAPS_RASTER_BANDING              = 2 ;
  137.   CAPS_RASTER_BITBLT_SCALING       = 4 ;
  138.   CAPS_RASTER_SET_PEL              = 16 ;
  139.   CAPS_RASTER_FONTS                = 32 ;
  140.  
  141.   Function DevOpenDC (hab: HAB; lType: LongInt; pszToken: PSZ; lCount: LongInt;pdopData: PDEVOPENDATA;
  142.                       hdcComp: HDC): HDC;
  143.   Function DevCloseDC (hdc: HDC): HMF;
  144.   Function DevQueryCaps (hdc: HDC;lStart,lCount: LongInt;alArray: PLONG): BOOL;
  145.  
  146.  
  147. { structures for DEVESC_QUERYVIOCELLSIZES }
  148.  
  149. Type
  150.   VIOSIZECOUNT = Record                 { vios }
  151.     maxcount,
  152.     count: LongInt
  153.   End;
  154.   pVIOSIZECOUNT = ^VIOSIZECOUNT;
  155.  
  156.   VIOFONTCELLSIZE = Record              { viof }
  157.     cx,
  158.     cy: LongInt
  159.   End;
  160.   pVIOFONTCELLSIZE = ^VIOFONTCELLSIZE;
  161.  
  162. { structure for DEVESC_GETCP }
  163.   ESCGETCP = Record                     { escgcp }
  164.     options: ULONG;
  165.     codepage,
  166.     fontid: USHORT
  167.   End;
  168.   pESCGETCP = ^ESCGETCP;
  169.  
  170. { structure for DEVESC_GETSCALINGFACTOR }
  171.   SFACTORS = Record                     { sfactors }
  172.     x,
  173.     y: LongInt
  174.   End;
  175.   pSFACTORS = ^SFACTORS;
  176.  
  177. { structure for DEVESC_NEXTBAND }
  178.   BANDRECT = Record                     { bandrect }
  179.     xleft,
  180.     ybottom,
  181.     xright,
  182.     ytop: LongInt
  183.   End;
  184.   pBANDRECT = ^BANDRECT;
  185.  
  186. { return codes for DevEscape }
  187.  
  188. Const
  189.   DEVESC_ERROR            = (-1 );
  190.   DEVESC_NOTIMPLEMENTED            = 0 ;
  191.  
  192. { codes for DevEscape }
  193.   DEVESC_QUERYESCSUPPORT           = 0 ;
  194.   DEVESC_GETSCALINGFACTOR          = 1 ;
  195.   DEVESC_QUERYVIOCELLSIZES         = 2 ;
  196.   DEVESC_GETCP                     = 8000 ;
  197.  
  198.   DEVESC_STARTDOC                  = 8150 ;
  199.   DEVESC_ENDDOC                    = 8151 ;
  200.   DEVESC_NEXTBAND                  = 8152 ;
  201.   DEVESC_ABORTDOC                  = 8153 ;
  202.  
  203.   DEVESC_NEWFRAME                  = 16300 ;
  204.   DEVESC_DRAFTMODE                 = 16301 ;
  205.   DEVESC_FLUSHOUTPUT               = 16302 ;
  206.   DEVESC_RAWDATA                   = 16303 ;
  207.   DEVESC_SETMODE                   = 16304 ;
  208.   DEVESC_DBE_FIRST                 = 24450 ;
  209.   DEVESC_DBE_LAST                  = 24455 ;
  210.  
  211. { DevEscape codes for adding extra space to character strings }
  212.   DEVESC_CHAR_EXTRA                = 16998 ;
  213.   DEVESC_BREAK_EXTRA               = 16999 ;
  214.  
  215. { codes for DevEscape PM_Q_ESC spool files }
  216.   DEVESC_STD_JOURNAL               = 32600 ;
  217.  
  218. { return codes for DevPostDeviceModes }
  219.   DPDM_ERROR                       = (-1 );
  220.   DPDM_NONE                        = 0 ;
  221.  
  222. { codes for DevPostDeviceModes }
  223.   DPDM_POSTJOBPROP                 = 0 ;
  224.   DPDM_CHANGEPROP                  = 1 ;
  225.   DPDM_QUERYJOBPROP                = 2 ;
  226.  
  227. Type
  228. { string types for DevQueryDeviceNames }
  229.   STR16 = Array[0..15] Of Char;     { str16 }
  230.   pSTR16 = ^STR16;
  231.   STR32 = Array[0..31] Of Char;     { str32 }
  232.   pSTR32 = ^PSTR32;
  233.   STR64 = Array[0..63] Of Char;     { str64 }
  234.   pSTR64 = ^STR64;
  235.  
  236. Const
  237. { return code for DevQueryHardcopyCaps }
  238.   DQHC_ERROR                       = (-1 );
  239. { codes for DevQueryHardcopyCaps }
  240.   HCAPS_CURRENT                    = 1 ;
  241.   HCAPS_SELECTABLE                 = 2 ;
  242.  
  243. { structure for DevQueryHardcopyCaps }
  244.  
  245. Type
  246.   HCINFO = Record                       { hci }
  247.     szFormname: Array[0..31] Of Char;
  248.     cx,
  249.     cy,
  250.     xLeftClip,
  251.     yBottomClip,
  252.     xRightClip,
  253.     yTopClip,
  254.     xPels,
  255.     yPels,
  256.     flAttributes: LongInt
  257.   End;
  258.   pHCINFO = ^HCINFO;
  259.  
  260. { structure for DEVESC_SETMODE }
  261.   ESCSETMODE = Record                   { escsm }
  262.     mode: ULONG;
  263.     codepage: USHORT
  264.   End;
  265.   pESCSETMODE = ^ESCSETMODE;
  266.  
  267.   Function DevEscape (hdc: HDC;lCode,lInCount: LongInt;pbInData: PBYTE;plOutCount: PLONG;pbOutData: PBYTE): LongInt;
  268.   Function DevQueryDeviceNames (hab: HAB;pszDriverName: PSZ;pldn: PLONG;aDeviceName: PSTR32;
  269.                                 aDeviceDesc: PSTR64;pldt: PLONG;aDataType: PSTR16): BOOL;
  270.   Function DevQueryHardcopyCaps (hdc: HDC;lStartForm,lForms: LongInt;phciHcInfo: PHCINFO): LongInt;
  271.   Function DevPostDeviceModes (hab: HAB;pdrivDriverData: PDRIVDATA;pszDriverName,pszDeviceName,
  272.                                pszName: PSZ;flOptions: ULONG): LongInt;
  273.  
  274. { AAB error codes for the DEV - same as GPI errors at present }
  275.  
  276. Implementation
  277.   Function DevCloseDC;                    External 'PMGPI'    Index    2;
  278.   Function DevEscape;                     External 'PMGPI'    Index    4;
  279.   Function DevOpenDC;                     External 'PMGPI'    Index    1;
  280.   Function DevPostDeviceModes;            External 'PMGPI'    Index    3;
  281.   Function DevQueryCaps;                  External 'PMGPI'    Index    6;
  282.   Function DevQueryDeviceNames;           External 'PMGPI'    Index  165;
  283.   Function DevQueryHardcopyCaps;          External 'PMGPI'    Index    5;
  284. End.
  285.