Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

302 lines
10 KiB

  1. /*****************************************************************************\
  2. * *
  3. * print.h - Printing helper functions, types, and definitions *
  4. * *
  5. * Copyright (c) 1985-1992. Microsoft Corp. All rights reserved.*
  6. * *
  7. *******************************************************************************
  8. *
  9. * PRINTDRIVER - For inclusion with a printer driver
  10. * NOPQ - Prevent inclusion of priority queue APIs
  11. *
  12. \*****************************************************************************/
  13. #ifndef _INC_PRINT
  14. #define _INC_PRINT
  15. #ifndef RC_INVOKED
  16. #pragma pack(1) /* Assume byte packing throughout */
  17. #endif /* !RC_INVOKED */
  18. #ifdef __cplusplus
  19. extern "C" { /* Assume C declarations for C++ */
  20. #endif /* __cplusplus */
  21. #ifdef PRINTDRIVER
  22. #define NORASTEROPS
  23. #define NOTEXTMETRICS
  24. #define NOGDICAPMASKS
  25. #define NOGDIOBJ
  26. #define NOBITMAP
  27. #define NOSOUND
  28. #define NOTEXTMETRIC
  29. #define NOCOMM
  30. #define NOKANJI
  31. #include <windows.h>
  32. #undef NORASTEROPS
  33. #undef NOTEXTMETRICS
  34. #undef NOGDICAPMASKS
  35. #undef NOGDICAPMASKS
  36. #undef NOGDIOBJ
  37. #undef NOBITMAP
  38. #undef NOSOUND
  39. #undef NOTEXTMETRIC
  40. #undef NOCOMM
  41. #undef NOKANJI
  42. #define NOPTRC /* don't allow gdidefs.inc to redef these */
  43. #define PTTYPE POINT
  44. #define PQERROR (-1)
  45. #ifndef NOPQ
  46. DECLARE_HANDLE(HPQ);
  47. HPQ WINAPI CreatePQ(int);
  48. int WINAPI MinPQ(HPQ);
  49. int WINAPI ExtractPQ(HPQ);
  50. int WINAPI InsertPQ(HPQ, int, int);
  51. int WINAPI SizePQ(HPQ, int);
  52. void WINAPI DeletePQ(HPQ);
  53. #endif /* !NOPQ */
  54. /* Spool routines for use by printer drivers */
  55. DECLARE_HANDLE(HPJOB);
  56. HPJOB WINAPI OpenJob(LPSTR, LPSTR, HPJOB);
  57. int WINAPI StartSpoolPage(HPJOB);
  58. int WINAPI EndSpoolPage(HPJOB);
  59. int WINAPI WriteSpool(HPJOB, LPSTR, int);
  60. int WINAPI CloseJob(HPJOB);
  61. int WINAPI DeleteJob(HPJOB, int);
  62. int WINAPI WriteDialog(HPJOB, LPSTR, int);
  63. int WINAPI DeleteSpoolPage(HPJOB);
  64. #endif /* !PRINTDRIVER */
  65. typedef struct tagBANDINFOSTRUCT
  66. {
  67. BOOL fGraphics;
  68. BOOL fText;
  69. RECT rcGraphics;
  70. } BANDINFOSTRUCT, FAR* LPBI;
  71. #define USA_COUNTRYCODE 1
  72. /*
  73. * Printer driver initialization using ExtDeviceMode()
  74. * and DeviceCapabilities().
  75. * This replaces Drivinit.h
  76. */
  77. /* size of a device name string */
  78. #define CCHDEVICENAME 32
  79. #define CCHPAPERNAME 64
  80. /* current version of specification */
  81. #define DM_SPECVERSION 0x30A
  82. /* field selection bits */
  83. #define DM_ORIENTATION 0x0000001L
  84. #define DM_PAPERSIZE 0x0000002L
  85. #define DM_PAPERLENGTH 0x0000004L
  86. #define DM_PAPERWIDTH 0x0000008L
  87. #define DM_SCALE 0x0000010L
  88. #define DM_COPIES 0x0000100L
  89. #define DM_DEFAULTSOURCE 0x0000200L
  90. #define DM_PRINTQUALITY 0x0000400L
  91. #define DM_COLOR 0x0000800L
  92. #define DM_DUPLEX 0x0001000L
  93. #define DM_YRESOLUTION 0x0002000L
  94. #define DM_TTOPTION 0x0004000L
  95. /* orientation selections */
  96. #define DMORIENT_PORTRAIT 1
  97. #define DMORIENT_LANDSCAPE 2
  98. /* paper selections */
  99. /* Warning: The PostScript driver mistakingly uses DMPAPER_ values between
  100. * 50 and 56. Don't use this range when defining new paper sizes.
  101. */
  102. #define DMPAPER_FIRST DMPAPER_LETTER
  103. #define DMPAPER_LETTER 1 /* Letter 8 1/2 x 11 in */
  104. #define DMPAPER_LETTERSMALL 2 /* Letter Small 8 1/2 x 11 in */
  105. #define DMPAPER_TABLOID 3 /* Tabloid 11 x 17 in */
  106. #define DMPAPER_LEDGER 4 /* Ledger 17 x 11 in */
  107. #define DMPAPER_LEGAL 5 /* Legal 8 1/2 x 14 in */
  108. #define DMPAPER_STATEMENT 6 /* Statement 5 1/2 x 8 1/2 in */
  109. #define DMPAPER_EXECUTIVE 7 /* Executive 7 1/4 x 10 1/2 in */
  110. #define DMPAPER_A3 8 /* A3 297 x 420 mm */
  111. #define DMPAPER_A4 9 /* A4 210 x 297 mm */
  112. #define DMPAPER_A4SMALL 10 /* A4 Small 210 x 297 mm */
  113. #define DMPAPER_A5 11 /* A5 148 x 210 mm */
  114. #define DMPAPER_B4 12 /* B4 250 x 354 */
  115. #define DMPAPER_B5 13 /* B5 182 x 257 mm */
  116. #define DMPAPER_FOLIO 14 /* Folio 8 1/2 x 13 in */
  117. #define DMPAPER_QUARTO 15 /* Quarto 215 x 275 mm */
  118. #define DMPAPER_10X14 16 /* 10x14 in */
  119. #define DMPAPER_11X17 17 /* 11x17 in */
  120. #define DMPAPER_NOTE 18 /* Note 8 1/2 x 11 in */
  121. #define DMPAPER_ENV_9 19 /* Envelope #9 3 7/8 x 8 7/8 */
  122. #define DMPAPER_ENV_10 20 /* Envelope #10 4 1/8 x 9 1/2 */
  123. #define DMPAPER_ENV_11 21 /* Envelope #11 4 1/2 x 10 3/8 */
  124. #define DMPAPER_ENV_12 22 /* Envelope #12 4 \276 x 11 */
  125. #define DMPAPER_ENV_14 23 /* Envelope #14 5 x 11 1/2 */
  126. #define DMPAPER_CSHEET 24 /* C size sheet */
  127. #define DMPAPER_DSHEET 25 /* D size sheet */
  128. #define DMPAPER_ESHEET 26 /* E size sheet */
  129. #define DMPAPER_ENV_DL 27 /* Envelope DL 110 x 220mm */
  130. #define DMPAPER_ENV_C5 28 /* Envelope C5 162 x 229 mm */
  131. #define DMPAPER_ENV_C3 29 /* Envelope C3 324 x 458 mm */
  132. #define DMPAPER_ENV_C4 30 /* Envelope C4 229 x 324 mm */
  133. #define DMPAPER_ENV_C6 31 /* Envelope C6 114 x 162 mm */
  134. #define DMPAPER_ENV_C65 32 /* Envelope C65 114 x 229 mm */
  135. #define DMPAPER_ENV_B4 33 /* Envelope B4 250 x 353 mm */
  136. #define DMPAPER_ENV_B5 34 /* Envelope B5 176 x 250 mm */
  137. #define DMPAPER_ENV_B6 35 /* Envelope B6 176 x 125 mm */
  138. #define DMPAPER_ENV_ITALY 36 /* Envelope 110 x 230 mm */
  139. #define DMPAPER_ENV_MONARCH 37 /* Envelope Monarch 3.875 x 7.5 in */
  140. #define DMPAPER_ENV_PERSONAL 38 /* 6 3/4 Envelope 3 5/8 x 6 1/2 in */
  141. #define DMPAPER_FANFOLD_US 39 /* US Std Fanfold 14 7/8 x 11 in */
  142. #define DMPAPER_FANFOLD_STD_GERMAN 40 /* German Std Fanfold 8 1/2 x 12 in */
  143. #define DMPAPER_FANFOLD_LGL_GERMAN 41 /* German Legal Fanfold 8 1/2 x 13 in */
  144. #define DMPAPER_LAST DMPAPER_FANFOLD_LGL_GERMAN
  145. #define DMPAPER_USER 256
  146. /* bin selections */
  147. #define DMBIN_FIRST DMBIN_UPPER
  148. #define DMBIN_UPPER 1
  149. #define DMBIN_ONLYONE 1
  150. #define DMBIN_LOWER 2
  151. #define DMBIN_MIDDLE 3
  152. #define DMBIN_MANUAL 4
  153. #define DMBIN_ENVELOPE 5
  154. #define DMBIN_ENVMANUAL 6
  155. #define DMBIN_AUTO 7
  156. #define DMBIN_TRACTOR 8
  157. #define DMBIN_SMALLFMT 9
  158. #define DMBIN_LARGEFMT 10
  159. #define DMBIN_LARGECAPACITY 11
  160. #define DMBIN_CASSETTE 14
  161. #define DMBIN_LAST DMBIN_CASSETTE
  162. #define DMBIN_USER 256 /* device specific bins start here */
  163. /* print qualities */
  164. #define DMRES_DRAFT (-1)
  165. #define DMRES_LOW (-2)
  166. #define DMRES_MEDIUM (-3)
  167. #define DMRES_HIGH (-4)
  168. /* color enable/disable for color printers */
  169. #define DMCOLOR_MONOCHROME 1
  170. #define DMCOLOR_COLOR 2
  171. /* duplex enable */
  172. #define DMDUP_SIMPLEX 1
  173. #define DMDUP_VERTICAL 2
  174. #define DMDUP_HORIZONTAL 3
  175. /* TrueType options */
  176. #define DMTT_BITMAP 1 /* print TT fonts as graphics */
  177. #define DMTT_DOWNLOAD 2 /* download TT fonts as soft fonts */
  178. #define DMTT_SUBDEV 3 /* substitute device fonts for TT fonts */
  179. typedef struct tagDEVMODE
  180. {
  181. char dmDeviceName[CCHDEVICENAME];
  182. UINT dmSpecVersion;
  183. UINT dmDriverVersion;
  184. UINT dmSize;
  185. UINT dmDriverExtra;
  186. DWORD dmFields;
  187. int dmOrientation;
  188. int dmPaperSize;
  189. int dmPaperLength;
  190. int dmPaperWidth;
  191. int dmScale;
  192. int dmCopies;
  193. int dmDefaultSource;
  194. int dmPrintQuality;
  195. int dmColor;
  196. int dmDuplex;
  197. int dmYResolution;
  198. int dmTTOption;
  199. } DEVMODE;
  200. typedef DEVMODE* PDEVMODE, NEAR* NPDEVMODE, FAR* LPDEVMODE;
  201. /* mode selections for the device mode function */
  202. #define DM_UPDATE 1
  203. #define DM_COPY 2
  204. #define DM_PROMPT 4
  205. #define DM_MODIFY 8
  206. #define DM_IN_BUFFER DM_MODIFY
  207. #define DM_IN_PROMPT DM_PROMPT
  208. #define DM_OUT_BUFFER DM_COPY
  209. #define DM_OUT_DEFAULT DM_UPDATE
  210. /* device capabilities indices */
  211. #define DC_FIELDS 1
  212. #define DC_PAPERS 2
  213. #define DC_PAPERSIZE 3
  214. #define DC_MINEXTENT 4
  215. #define DC_MAXEXTENT 5
  216. #define DC_BINS 6
  217. #define DC_DUPLEX 7
  218. #define DC_SIZE 8
  219. #define DC_EXTRA 9
  220. #define DC_VERSION 10
  221. #define DC_DRIVER 11
  222. #define DC_BINNAMES 12
  223. #define DC_ENUMRESOLUTIONS 13
  224. #define DC_FILEDEPENDENCIES 14
  225. #define DC_TRUETYPE 15
  226. #define DC_PAPERNAMES 16
  227. #define DC_ORIENTATION 17
  228. #define DC_COPIES 18
  229. /* bit fields of the return value (DWORD) for DC_TRUETYPE */
  230. #define DCTT_BITMAP 0x0000001L
  231. #define DCTT_DOWNLOAD 0x0000002L
  232. #define DCTT_SUBDEV 0x0000004L
  233. /* export ordinal definitions */
  234. #define PROC_EXTDEVICEMODE MAKEINTRESOURCE(90)
  235. #define PROC_DEVICECAPABILITIES MAKEINTRESOURCE(91)
  236. #define PROC_OLDDEVICEMODE MAKEINTRESOURCE(13)
  237. /* define types of pointers to ExtDeviceMode() and DeviceCapabilities()
  238. * functions
  239. */
  240. typedef UINT (CALLBACK* LPFNDEVMODE)(HWND, HMODULE, DEVMODE FAR*,
  241. LPSTR, LPSTR, DEVMODE FAR*, LPSTR, UINT);
  242. typedef DWORD (CALLBACK* LPFNDEVCAPS)(LPSTR, LPSTR, UINT, LPSTR, DEVMODE FAR*);
  243. HDC WINAPI ResetDC(HDC, const DEVMODE FAR*);
  244. /* this structure is used by the GETSETSCREENPARAMS escape */
  245. typedef struct tagSCREENPARAMS
  246. {
  247. int angle;
  248. int frequency;
  249. } SCREENPARAMS;
  250. #ifdef __cplusplus
  251. }
  252. #endif /* __cplusplus */
  253. #ifndef RC_INVOKED
  254. #pragma pack()
  255. #endif /* !RC_INVOKED */
  256. #endif /* !_INC_PRINT */