home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / d / d020_1_4 / 3.ddi / INC / DRIVINIT.H < prev    next >
Encoding:
C/C++ Source or Header  |  1990-06-01  |  4.7 KB  |  158 lines

  1. /*
  2.  *  drivinit.h
  3.  *
  4.  *  Header file for printer driver initialization using ExtDeviceMode()
  5.  *  and DeviceCapabilities().
  6.  *
  7.  */
  8.  
  9. /* size of a device name string */
  10. #define CCHDEVICENAME 32
  11.  
  12. /* current version of specification */
  13. #define DM_SPECVERSION 0x300
  14.  
  15. /* field selection bits */
  16. #define DM_ORIENTATION        0x0000001L
  17. #define DM_PAPERSIZE        0x0000002L
  18. #define DM_PAPERLENGTH        0x0000004L
  19. #define DM_PAPERWIDTH        0x0000008L
  20. #define DM_SCALE        0x0000010L
  21. #define DM_COPIES        0x0000100L
  22. #define DM_DEFAULTSOURCE    0x0000200L
  23. #define DM_PRINTQUALITY     0x0000400L
  24. #define DM_COLOR        0x0000800L
  25. #define DM_DUPLEX        0x0001000L
  26.  
  27. /* orientation selections */
  28. #define DMORIENT_PORTRAIT   1
  29. #define DMORIENT_LANDSCAPE  2
  30.  
  31. /* paper selections */
  32. #define DMPAPER_FIRST        DMPAPER_LETTER
  33. #define DMPAPER_LETTER        1        // Letter 8 1/2 x 11 in
  34. #define DMPAPER_LETTERSMALL 2        // Letter Small 8 1/2 x 11 in
  35. #define DMPAPER_TABLOID     3        // Tabloid 11 x 17 in
  36. #define DMPAPER_LEDGER        4        // Ledger 17 x 11 in
  37. #define DMPAPER_LEGAL        5        // Legal 8 1/2 x 14 in
  38. #define DMPAPER_STATEMENT   6        // Statement 5 1/2 x 8 1/2 in
  39. #define DMPAPER_EXECUTIVE   7        // Executive"7 1/2 x 10 in
  40. #define DMPAPER_A3        8        // A3 297 x 420 mm
  41. #define DMPAPER_A4        9        // A4 210 x 297 mm
  42. #define DMPAPER_A4SMALL     10        // A4 Small 210 x 297 mm
  43. #define DMPAPER_A5        11        // A5 148 x 210 mm
  44. #define DMPAPER_B4        12        // B4 250 x 354
  45. #define DMPAPER_B5        13        // B5 182 x 257 mm
  46. #define DMPAPER_FOLIO        14        // Folio 8 1/2 x 13 in
  47. #define DMPAPER_QUARTO        15        // Quarto 215 x 275 mm
  48. #define DMPAPER_10X14        16        // 10x14 in
  49. #define DMPAPER_11X17        17        // 11x17 in
  50. #define DMPAPER_NOTE        18        // Note 8 1/2 x 11 in
  51. #define DMPAPER_ENV_9        19        // Envelope #9 3 7/8 x 8 7/8
  52. #define DMPAPER_ENV_10        20        // Envelope #10 4 1/8 x 9 1/2
  53. #define DMPAPER_ENV_11        21        // Envelope #11 4 1/2 x 10 3/8
  54. #define DMPAPER_ENV_12        22        // Envelope #12 4 \276 x 11
  55. #define DMPAPER_ENV_14        23        // Envelope #14 5 x 11 1/2
  56. #define DMPAPER_CSHEET        24        // C size sheet
  57. #define DMPAPER_DSHEET        25        // D size sheet
  58. #define DMPAPER_ESHEET        26        // E size sheet
  59. #define DMPAPER_LAST        DMPAPER_ESHEET
  60.  
  61. #define DMPAPER_USER        256
  62.  
  63. /* bin selections */
  64. #define DMBIN_FIRST        DMBIN_UPPER
  65. #define DMBIN_UPPER        1
  66. #define DMBIN_ONLYONE        1
  67. #define DMBIN_LOWER        2
  68. #define DMBIN_MIDDLE        3
  69. #define DMBIN_MANUAL        4
  70. #define DMBIN_ENVELOPE        5
  71. #define DMBIN_ENVMANUAL     6
  72. #define DMBIN_AUTO        7
  73. #define DMBIN_TRACTOR        8
  74. #define DMBIN_SMALLFMT        9
  75. #define DMBIN_LARGEFMT        10
  76. #define DMBIN_LARGECAPACITY 11
  77. #define DMBIN_CASSETTE      14
  78. #define DMBIN_LAST        DMBIN_CASSETTE
  79.  
  80. #define DMBIN_USER        256     /* device specific bins start here */
  81.  
  82. /* print qualities */
  83. #define DMRES_DRAFT        (-1)
  84. #define DMRES_LOW        (-2)
  85. #define DMRES_MEDIUM        (-3)
  86. #define DMRES_HIGH        (-4)
  87.  
  88. /* color enable/disable for color printers */
  89. #define DMCOLOR_MONOCHROME  1
  90. #define DMCOLOR_COLOR        2
  91.  
  92. /* duplex enable */
  93. #define DMDUP_SIMPLEX     1
  94. #define DMDUP_VERTICAL     2
  95. #define DMDUP_HORIZONTAL 3
  96.  
  97. typedef struct _devicemode {
  98.     char dmDeviceName[CCHDEVICENAME];
  99.     WORD dmSpecVersion;
  100.     WORD dmDriverVersion;
  101.     WORD dmSize;
  102.     WORD dmDriverExtra;
  103.     DWORD dmFields;
  104.     short dmOrientation;
  105.     short dmPaperSize;
  106.     short dmPaperLength;
  107.     short dmPaperWidth;
  108.     short dmScale;
  109.     short dmCopies;
  110.     short dmDefaultSource;
  111.     short dmPrintQuality;
  112.     short dmColor;
  113.     short dmDuplex;
  114. } DEVMODE;
  115.  
  116. typedef DEVMODE * PDEVMODE, NEAR * NPDEVMODE, FAR * LPDEVMODE;
  117.  
  118. /* mode selections for the device mode function */
  119. #define DM_UPDATE        1
  120. #define DM_COPY         2
  121. #define DM_PROMPT        4
  122. #define DM_MODIFY        8
  123.  
  124. #define DM_IN_BUFFER        DM_MODIFY
  125. #define DM_IN_PROMPT        DM_PROMPT
  126. #define DM_OUT_BUFFER        DM_COPY
  127. #define DM_OUT_DEFAULT        DM_UPDATE
  128.  
  129. /* device capabilities indices */
  130. #define DC_FIELDS        1
  131. #define DC_PAPERS        2
  132. #define DC_PAPERSIZE        3
  133. #define DC_MINEXTENT        4
  134. #define DC_MAXEXTENT        5
  135. #define DC_BINS         6
  136. #define DC_DUPLEX        7
  137. #define DC_SIZE         8
  138. #define DC_EXTRA        9
  139. #define DC_VERSION        10
  140. #define DC_DRIVER        11
  141.  
  142. /* export ordinal definitions */
  143. #define PROC_EXTDEVICEMODE    MAKEINTRESOURCE(90)
  144. #define PROC_DEVICECAPABILITIES MAKEINTRESOURCE(91)
  145. #define PROC_OLDDEVICEMODE    MAKEINTRESOURCE(13)
  146.  
  147. /* define types of pointers to ExtDeviceMode() and DeviceCapabilities()
  148.  * functions
  149.  */
  150. typedef WORD FAR PASCAL FNDEVMODE(HWND, HANDLE, LPDEVMODE, LPSTR, LPSTR,
  151.     LPDEVMODE, LPSTR, WORD);
  152.  
  153. typedef FNDEVMODE FAR * LPFNDEVMODE;
  154.  
  155. typedef DWORD FAR PASCAL FNDEVCAPS(LPSTR, LPSTR, WORD, LPSTR, LPDEVMODE);
  156.  
  157. typedef FNDEVCAPS FAR * LPFNDEVCAPS;
  158.