home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / mod201j.zip / modula2.exe / os2api / dev.def < prev    next >
Text File  |  1994-07-05  |  13KB  |  332 lines

  1. DEFINITION MODULE DEV;
  2.  
  3. (************************************************************************
  4.   OS/2 2.1 interface for Presentation Manager Device Context support.
  5.  
  6.   Copyright (c) 1992, 1994 by Juergen Neuhoff
  7. *************************************************************************)
  8.  
  9. (*$XL+       Modula-2 language extensions: '_' allowed for symbol names *)
  10. (*$CDECL+    C-style procedures                                         *)
  11. (*$A         default alignment for record fields                        *)
  12.  
  13. IMPORT SYSTEM;
  14. FROM   OS2DEF IMPORT TYPEPREFIX, HAB, HDC, HMF, PDEVOPENDATA, PDRIVDATA;
  15.  
  16. CONST (* General DEV return values *)
  17.   DEV_ERROR                     = 0;
  18.   DEV_OK                        = 1;
  19.  
  20. CONST (* DC type for DevOpenDC *)
  21.   OD_QUEUED                     = 2;
  22.   OD_DIRECT                     = 5;
  23.   OD_INFO                       = 6;
  24.   OD_METAFILE                   = 7;
  25.   OD_MEMORY                     = 8;
  26.   OD_METAFILE_NOQUERY           = 9;
  27.  
  28. CONST (* codes for DevQueryCaps *)
  29.   CAPS_FAMILY                   = 0;
  30.   CAPS_IO_CAPS                  = 1;
  31.   CAPS_TECHNOLOGY               = 2;
  32.   CAPS_DRIVER_VERSION           = 3;
  33.   CAPS_WIDTH                    = 4;      (* pels            *)
  34.   CAPS_HEIGHT                   = 5;      (* pels            *)
  35.   CAPS_WIDTH_IN_CHARS           = 6;
  36.   CAPS_HEIGHT_IN_CHARS          = 7;
  37.   CAPS_HORIZONTAL_RESOLUTION    = 8;      (* pels per meter  *)
  38.   CAPS_VERTICAL_RESOLUTION      = 9;      (* pels per meter  *)
  39.   CAPS_CHAR_WIDTH              = 10;      (* pels            *)
  40.   CAPS_CHAR_HEIGHT             = 11;      (* pels            *)
  41.   CAPS_SMALL_CHAR_WIDTH        = 12;      (* pels            *)
  42.   CAPS_SMALL_CHAR_HEIGHT       = 13;      (* pels            *)
  43.   CAPS_COLORS                  = 14;
  44.   CAPS_COLOR_PLANES            = 15;
  45.   CAPS_COLOR_BITCOUNT          = 16;
  46.   CAPS_COLOR_TABLE_SUPPORT     = 17;
  47.   CAPS_MOUSE_BUTTONS           = 18;
  48.   CAPS_FOREGROUND_MIX_SUPPORT  = 19;
  49.   CAPS_BACKGROUND_MIX_SUPPORT  = 20;
  50.   CAPS_DEVICE_WINDOWING        = 31;
  51.   CAPS_ADDITIONAL_GRAPHICS     = 32;
  52.   CAPS_VIO_LOADABLE_FONTS      = 21;
  53.   CAPS_WINDOW_BYTE_ALIGNMENT   = 22;
  54.   CAPS_BITMAP_FORMATS          = 23;
  55.   CAPS_RASTER_CAPS             = 24;
  56.   CAPS_MARKER_HEIGHT           = 25;      (* pels            *)
  57.   CAPS_MARKER_WIDTH            = 26;      (* pels            *)
  58.   CAPS_DEVICE_FONTS            = 27;
  59.   CAPS_GRAPHICS_SUBSET         = 28;
  60.   CAPS_GRAPHICS_VERSION        = 29;
  61.   CAPS_GRAPHICS_VECTOR_SUBSET  = 30;
  62.   CAPS_PHYS_COLORS             = 33;
  63.   CAPS_COLOR_INDEX             = 34;
  64.   CAPS_GRAPHICS_CHAR_WIDTH     = 35;
  65.   CAPS_GRAPHICS_CHAR_HEIGHT    = 36;
  66.   CAPS_HORIZONTAL_FONT_RES     = 37;
  67.   CAPS_VERTICAL_FONT_RES       = 38;
  68.   CAPS_DEVICE_FONT_SIM         = 39;
  69.   CAPS_LINEWIDTH_THICK         = 40;
  70.   CAPS_DEVICE_POLYSET_POINTS   = 41;
  71.  
  72. CONST (* Constants for CAPS_IO_CAPS *)
  73.   CAPS_IO_DUMMY                = 1;
  74.   CAPS_IO_SUPPORTS_OP          = 2;
  75.   CAPS_IO_SUPPORTS_IP          = 3;
  76.   CAPS_IO_SUPPORTS_IO          = 4;
  77.  
  78. CONST (* Constants for CAPS_TECHNOLOGY *)
  79.   CAPS_TECH_UNKNOWN            = 0;
  80.   CAPS_TECH_VECTOR_PLOTTER     = 1;
  81.   CAPS_TECH_RASTER_DISPLAY     = 2;
  82.   CAPS_TECH_RASTER_PRINTER     = 3;
  83.   CAPS_TECH_RASTER_CAMERA      = 4;
  84.   CAPS_TECH_POSTSCRIPT         = 5;
  85.  
  86. CONST (* Constants for CAPS_COLOR_TABLE_SUPPORT *)
  87.   CAPS_COLTABL_RGB_8           = 1;
  88.   CAPS_COLTABL_RGB_8_PLUS      = 2;
  89.   CAPS_COLTABL_TRUE_MIX        = 4;
  90.   CAPS_COLTABL_REALIZE         = 8;
  91.  
  92. CONST (* Constants for CAPS_FOREGROUND_MIX_SUPPORT *)
  93.   CAPS_FM_OR                   =  1;
  94.   CAPS_FM_OVERPAINT            =  2;
  95.   CAPS_FM_XOR                  =  8;
  96.   CAPS_FM_LEAVEALONE           = 16;
  97.   CAPS_FM_AND                  = 32;
  98.   CAPS_FM_GENERAL_BOOLEAN      = 64;
  99.  
  100. CONST (* Constants for CAPS_BACKGROUND_MIX_SUPPORT *)
  101.   CAPS_BM_OR                   =   1;
  102.   CAPS_BM_OVERPAINT            =   2;
  103.   CAPS_BM_XOR                  =   8;
  104.   CAPS_BM_LEAVEALONE           =  16;
  105.   CAPS_BM_AND                  =  32;
  106.   CAPS_BM_GENERAL_BOOLEAN      =  64;
  107.   CAPS_BM_SRCTRANSPARENT       = 128;
  108.   CAPS_BM_DESTTRANSPARENT      = 256;
  109.  
  110. CONST (* Constants for CAPS_DEVICE_WINDOWING *)
  111.   CAPS_DEV_WINDOWING_SUPPORT   =  1;
  112.  
  113. CONST (* Constants for CAPS_ADDITIONAL_GRAPHICS *)
  114.   CAPS_VDD_DDB_TRANSFER         = 1;
  115.   CAPS_GRAPHICS_KERNING_SUPPORT = 2;
  116.   CAPS_FONT_OUTLINE_DEFAULT     = 4;
  117.   CAPS_FONT_IMAGE_DEFAULT       = 8;
  118.   (* bits represented by values 16 and 32 are reserved *)
  119.   CAPS_SCALED_DEFAULT_MARKERS    = 64;
  120.   CAPS_COLOR_CURSOR_SUPPORT      = 128;
  121.   CAPS_PALETTE_MANAGER           = 256;
  122.   CAPS_COSMETIC_WIDELINE_SUPPORT = 512;
  123.   CAPS_DIRECT_FILL               = 1024;
  124.   CAPS_REBUILD_FILLS             = 2048;
  125.   CAPS_CLIP_FILLS                = 4096;
  126.   CAPS_ENHANCED_FONTMETRICS      = 8192;
  127.  
  128. CONST (* Constants for CAPS_WINDOW_BYTE_ALIGNMENT *)
  129.   CAPS_BYTE_ALIGN_REQUIRED       = 0;
  130.   CAPS_BYTE_ALIGN_RECOMMENDED    = 1;
  131.   CAPS_BYTE_ALIGN_NOT_REQUIRED   = 2;
  132.  
  133. CONST (* Constants for CAPS_RASTER_CAPS *)
  134.   CAPS_RASTER_BITBLT             = 1;
  135.   CAPS_RASTER_BANDING            = 2;
  136.   CAPS_RASTER_BITBLT_SCALING     = 4;
  137.   CAPS_RASTER_SET_PEL            = 16;
  138.   CAPS_RASTER_FONTS              = 32;
  139.   CAPS_RASTER_FLOOD_FILL         = 64;
  140.  
  141. PROCEDURE DevOpenDC
  142. ( AnchorBlockHandle              : HAB;
  143.   Type                           : LONGINT;
  144.   Token                          : ARRAY OF CHAR;
  145.   Count                          : LONGINT;
  146.   Data                           : PDEVOPENDATA;
  147.   CompDevHandle                  : HDC
  148. )                                : HDC;
  149.  
  150. PROCEDURE DevCloseDC
  151. ( DevHandle                      : HDC
  152. )                                : HMF;
  153.  
  154. PROCEDURE DevQueryCaps
  155. ( DCHandle                       : HDC;
  156.   Start                          : LONGINT;
  157.   Count                          : LONGINT;
  158.   Array                          : ARRAY OF LONGINT
  159. )                                : BOOLEAN;
  160.  
  161. TYPE (* structures for DEVESC_QUERYVIOCELLSIZES *)
  162.   VIOSIZECOUNT                   = RECORD  (* vios *)
  163.     CASE                           : TYPEPREFIX OF
  164.     | TRUE                         :
  165.       maxcount                     : LONGINT;
  166.       count                        : LONGINT;
  167.     | FALSE                        :
  168.       MaxCount                     : LONGINT;
  169.       Count                        : LONGINT;
  170.     END;                           END;
  171.   PVIOSIZECOUNT                  = POINTER TO VIOSIZECOUNT;
  172.   VIOFONTCELLSIZE                = RECORD   (* viof *)
  173.     CASE                           : TYPEPREFIX OF
  174.     | TRUE                         :
  175.       cx                           : LONGINT;
  176.       cy                           : LONGINT;
  177.     | FALSE                        :
  178.       xSize                        : LONGINT;
  179.       ySize                        : LONGINT;
  180.     END;                           END;
  181.   PVIOFONTCELLSIZE               = POINTER TO VIOFONTCELLSIZE;
  182.  
  183. TYPE (* structure for DEVESC_GETSCALINGFACTOR *)
  184.   SFACTORS                       = RECORD  (* sfactors *)
  185.     x                              : LONGINT;
  186.     y                              : LONGINT;
  187.                                    END;
  188.   PSFACTORS                      = POINTER TO SFACTORS;
  189.  
  190. TYPE (* structure for DEVESC_NEXTBAND *)
  191.   BANDRECT                       = RECORD  (* bandrect *)
  192.     CASE                           : TYPEPREFIX OF
  193.     | TRUE                         :
  194.       xleft                        : LONGINT;
  195.       ybottom                      : LONGINT;
  196.       xright                       : LONGINT;
  197.       ytop                         : LONGINT;
  198.     | FALSE                        :
  199.       xLeft                        : LONGINT;
  200.       yBottom                      : LONGINT;
  201.       xRight                       : LONGINT;
  202.       yTop                         : LONGINT;
  203.     END;                           END;
  204.   PBANDRECT                      = POINTER TO BANDRECT;
  205.  
  206. CONST (* return codes for DevEscape *)
  207.   DEVESC_ERROR                   = -1;
  208.   DEVESC_NOTIMPLEMENTED          = 0;
  209.  
  210. CONST (* codes for DevEscape *)
  211.   DEVESC_QUERYESCSUPPORT         =     0;
  212.   DEVESC_GETSCALINGFACTOR        =     1;
  213.   DEVESC_QUERYVIOCELLSIZES       =     2;
  214.   DEVESC_GETCP                   =  8000;
  215.   DEVESC_STARTDOC                =  8150;
  216.   DEVESC_ENDDOC                  =  8151;
  217.   DEVESC_NEXTBAND                =  8152;
  218.   DEVESC_ABORTDOC                =  8153;
  219.   DEVESC_NEWFRAME                = 16300;
  220.   DEVESC_DRAFTMODE               = 16301;
  221.   DEVESC_FLUSHOUTPUT             = 16302;
  222.   DEVESC_RAWDATA                 = 16303;
  223.   DEVESC_SETMODE                 = 16304;
  224.   DEVESC_DBE_FIRST               = 24450;
  225.   DEVESC_DBE_LAST                = 24455;
  226.  
  227. CONST (* DevEscape codes for adding extra space to character strings *)
  228.   DEVESC_CHAR_EXTRA              = 16998;
  229.   DEVESC_BREAK_EXTRA             = 16999;
  230.  
  231. CONST (* codes for DevEscape PM_Q_ESC spool files *)
  232.   DEVESC_STD_JOURNAL             = 32600;
  233.  
  234. TYPE (* structure for DEVESC_SETMODE *)
  235.   ESCMODE                        = RECORD   (* em *)
  236.     CASE                           : TYPEPREFIX OF
  237.     | TRUE                         :
  238.       mode                         : LONGCARD;
  239.       modedata                     : ARRAY [0..0] OF SHORTCARD;
  240.     | FALSE                        :
  241.       Node                         : LONGCARD;
  242.       NodeData                     : ARRAY [0..0] OF SHORTCARD;
  243.     END;                           END;
  244.   PESCMODE                       = POINTER TO ESCMODE;
  245.  
  246. CONST (* return codes for DevPostDeviceModes *)
  247.   DPDM_ERROR                     = -1;
  248.   DPDM_NONE                      = 0;
  249.  
  250. CONST (* codes for DevPostDeviceModes *)
  251.   DPDM_POSTJOBPROP               = 0;
  252.   DPDM_CHANGEPROP                = 1;
  253.   DPDM_QUERYJOBPROP              = 2;
  254.  
  255. TYPE (* string types for DevQueryDeviceNames *)
  256.   STR16                          = ARRAY [0..15] OF CHAR;     (* str16 *)
  257.   PSTR16                         = POINTER TO STR16;
  258.   STR32                          = ARRAY [0..31] OF CHAR;     (* str32 *)
  259.   PSTR32                         = POINTER TO STR32;
  260.   STR64                          = ARRAY [0..63] OF CHAR;     (* str64 *)
  261.   PSTR64                         = POINTER TO STR64;
  262.  
  263. CONST (* return code for DevQueryHardcopyCaps *)
  264.   DQHC_ERROR                     = -1;
  265.  
  266. CONST (* codes for DevQueryHardcopyCaps *)
  267.   HCAPS_CURRENT                  = 1;
  268.   HCAPS_SELECTABLE               = 2;
  269.  
  270. TYPE (* structure for DevQueryHardcopyCaps *)
  271.   HCINFO                         = RECORD   (* hci *)
  272.     CASE                           : TYPEPREFIX OF
  273.     | TRUE                         :
  274.       szFormname                   : ARRAY [0..31] OF CHAR;
  275.       cx                           : LONGINT;
  276.       cy                           : LONGINT;
  277.     | FALSE                        :
  278.       Formname                     : ARRAY [0..31] OF CHAR;
  279.       xSize                        : LONGINT;
  280.       ySize                        : LONGINT;
  281.     END;
  282.     xLeftClip                      : LONGINT;
  283.     yBottomClip                    : LONGINT;
  284.     xRightClip                     : LONGINT;
  285.     yTopClip                       : LONGINT;
  286.     xPels                          : LONGINT;
  287.     yPels                          : LONGINT;
  288.     CASE                           : TYPEPREFIX OF
  289.     | TRUE                         :
  290.       flAttributes                 : LONGINT;
  291.     | FALSE                        :
  292.       Attributes                   : LONGINT;
  293.     END;                           END;
  294.   PHCINFO                        = POINTER TO HCINFO;
  295.  
  296. PROCEDURE DevEscape
  297. ( DCHandle                       : HDC;
  298.   Code                           : LONGINT;
  299.   InCount                        : LONGINT;
  300.   InData                         : ARRAY OF SYSTEM.BYTE;
  301.   VAR OutCount                   : LONGINT;
  302.   VAR OutData                    : ARRAY OF SYSTEM.BYTE
  303. )                                : LONGINT;
  304.  
  305. PROCEDURE DevQueryDeviceNames
  306. ( AnchorBlockHandle              : HAB;
  307.   DriverName                     : ARRAY OF CHAR;
  308.   VAR DeviceCount                : LONGINT;
  309.   VAR DeviceName                 : STR32;
  310.   VAR DeviceDesc                 : STR64;
  311.   VAR DataTypeCount              : LONGINT;
  312.   VAR DataType                   : STR16
  313. )                                : BOOLEAN;
  314.  
  315. PROCEDURE DevQueryHardcopyCaps
  316. ( DCHandle                       : HDC;
  317.   StartForm                      : LONGINT;
  318.   Forms                          : LONGINT;
  319.   VAR HCInfo                     : HCINFO
  320. )                                : LONGINT;
  321.  
  322. PROCEDURE DevPostDeviceModes
  323. ( AnchorBlockHandle              : HAB;
  324.   DriverData                     : PDRIVDATA;
  325.   DriverName                     : ARRAY OF CHAR;
  326.   DeviceName                     : ARRAY OF CHAR;
  327.   Name                           : ARRAY OF CHAR;
  328.   Options                        : LONGCARD
  329. )                                : LONGINT;
  330.  
  331. END DEV.
  332.