Leaked source code of windows server 2003
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.

451 lines
16 KiB

  1. /*****************************************************************************\
  2. * *
  3. * print.h - Printing helper functions, types, and definitions *
  4. * *
  5. * Copyright (c) 1985-1994. 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. * NOEXTDEVMODEPROPSHEET - Prevent inclusion of shlobj.h and defs for printer
  12. * property sheet pages
  13. *
  14. \*****************************************************************************/
  15. #ifndef _INC_PRINT
  16. #define _INC_PRINT
  17. #ifndef RC_INVOKED
  18. #pragma pack(1) /* Assume byte packing throughout */
  19. #endif /* !RC_INVOKED */
  20. #ifdef __cplusplus
  21. extern "C" { /* Assume C declarations for C++ */
  22. #endif /* __cplusplus */
  23. #ifdef PRINTDRIVER
  24. #define NOTEXTMETRICS
  25. #define NOGDICAPMASKS
  26. #define NOGDIOBJ
  27. #define NOBITMAP
  28. #define NOSOUND
  29. #define NOTEXTMETRIC
  30. #define NOCOMM
  31. #define NOKANJI
  32. #define NOENHMETAFILE
  33. #include <windows.h>
  34. #undef NOENHMETAFILE
  35. #undef NOTEXTMETRICS
  36. #undef NOGDICAPMASKS
  37. #undef NOGDICAPMASKS
  38. #undef NOGDIOBJ
  39. #undef NOBITMAP
  40. #undef NOSOUND
  41. #undef NOTEXTMETRIC
  42. #undef NOCOMM
  43. #undef NOKANJI
  44. #define NOPTRC /* don't allow gdidefs.inc to redef these */
  45. #define PTTYPE POINT
  46. #define PQERROR (-1)
  47. #ifndef NOPQ
  48. DECLARE_HANDLE(HPQ);
  49. HPQ WINAPI CreatePQ(int);
  50. int WINAPI MinPQ(HPQ);
  51. int WINAPI ExtractPQ(HPQ);
  52. int WINAPI InsertPQ(HPQ, int, int);
  53. int WINAPI SizePQ(HPQ, int);
  54. void WINAPI DeletePQ(HPQ);
  55. #endif /* !NOPQ */
  56. #endif /* !PRINTDRIVER */
  57. /* Spool routines for use by printer drivers */
  58. typedef HANDLE HPJOB;
  59. HPJOB WINAPI OpenJob(LPSTR, LPSTR, HPJOB);
  60. int WINAPI StartSpoolPage(HPJOB);
  61. int WINAPI EndSpoolPage(HPJOB);
  62. int WINAPI WriteSpool(HPJOB, LPSTR, int);
  63. int WINAPI CloseJob(HPJOB);
  64. int WINAPI DeleteJob(HPJOB, int);
  65. int WINAPI WriteDialog(HPJOB, LPSTR, int);
  66. int WINAPI DeleteSpoolPage(HPJOB);
  67. typedef struct tagBANDINFOSTRUCT
  68. {
  69. BOOL fGraphics;
  70. BOOL fText;
  71. RECT rcGraphics;
  72. } BANDINFOSTRUCT, FAR* LPBI;
  73. #define USA_COUNTRYCODE 1
  74. /*
  75. * Printer driver initialization using ExtDeviceMode()
  76. * and DeviceCapabilities().
  77. * This replaces Drivinit.h
  78. */
  79. /* size of a device name string */
  80. #define CCHDEVICENAME 32
  81. #define CCHPAPERNAME 64
  82. #define CCHFORMNAME 32
  83. /* current version of specification */
  84. #define DM_SPECVERSION 0x0400
  85. /* field selection bits */
  86. #define DM_ORIENTATION 0x00000001L
  87. #define DM_PAPERSIZE 0x00000002L
  88. #define DM_PAPERLENGTH 0x00000004L
  89. #define DM_PAPERWIDTH 0x00000008L
  90. #define DM_SCALE 0x00000010L
  91. #define DM_COPIES 0x00000100L
  92. #define DM_DEFAULTSOURCE 0x00000200L
  93. #define DM_PRINTQUALITY 0x00000400L
  94. #define DM_COLOR 0x00000800L
  95. #define DM_DUPLEX 0x00001000L
  96. #define DM_YRESOLUTION 0x00002000L
  97. #define DM_TTOPTION 0x00004000L
  98. #define DM_COLLATE 0x00008000L
  99. #define DM_FORMNAME 0x00010000L
  100. #define DM_UNUSED 0x00020000L
  101. #define DM_BITSPERPEL 0x00040000L
  102. #define DM_PELSWIDTH 0x00080000L
  103. #define DM_PELSHEIGHT 0x00100000L
  104. #define DM_DISPLAYFLAGS 0x00200000L
  105. #define DM_DISPLAYFREQUENCT 0x00400000L
  106. #define DM_ICMMETHOD 0x00800000L
  107. #define DM_ICMINTENT 0x01000000L
  108. #define DM_MEDIATYPE 0x02000000L
  109. #define DM_DITHERTYPE 0x04000000L
  110. /* orientation selections */
  111. #define DMORIENT_PORTRAIT 1
  112. #define DMORIENT_LANDSCAPE 2
  113. /* paper selections */
  114. #define DMPAPER_FIRST DMPAPER_LETTER
  115. #define DMPAPER_LETTER 1 /* Letter 8 1/2 x 11 in */
  116. #define DMPAPER_LETTERSMALL 2 /* Letter Small 8 1/2 x 11 in */
  117. #define DMPAPER_TABLOID 3 /* Tabloid 11 x 17 in */
  118. #define DMPAPER_LEDGER 4 /* Ledger 17 x 11 in */
  119. #define DMPAPER_LEGAL 5 /* Legal 8 1/2 x 14 in */
  120. #define DMPAPER_STATEMENT 6 /* Statement 5 1/2 x 8 1/2 in */
  121. #define DMPAPER_EXECUTIVE 7 /* Executive 7 1/4 x 10 1/2 in */
  122. #define DMPAPER_A3 8 /* A3 297 x 420 mm */
  123. #define DMPAPER_A4 9 /* A4 210 x 297 mm */
  124. #define DMPAPER_A4SMALL 10 /* A4 Small 210 x 297 mm */
  125. #define DMPAPER_A5 11 /* A5 148 x 210 mm */
  126. #define DMPAPER_B4 12 /* B4 (ISO) 250 x 353 mm */
  127. #define DMPAPER_B5 13 /* B5 182 x 257 mm */
  128. #define DMPAPER_FOLIO 14 /* Folio 8 1/2 x 13 in */
  129. #define DMPAPER_QUARTO 15 /* Quarto 215 x 275 mm */
  130. #define DMPAPER_10X14 16 /* 10x14 in */
  131. #define DMPAPER_11X17 17 /* 11x17 in */
  132. #define DMPAPER_NOTE 18 /* Note 8 1/2 x 11 in */
  133. #define DMPAPER_ENV_9 19 /* Envelope #9 3 7/8 x 8 7/8 */
  134. #define DMPAPER_ENV_10 20 /* Envelope #10 4 1/8 x 9 1/2 */
  135. #define DMPAPER_ENV_11 21 /* Envelope #11 4 1/2 x 10 3/8 */
  136. #define DMPAPER_ENV_12 22 /* Envelope #12 4 \276 x 11 */
  137. #define DMPAPER_ENV_14 23 /* Envelope #14 5 x 11 1/2 */
  138. #define DMPAPER_CSHEET 24 /* C size sheet */
  139. #define DMPAPER_DSHEET 25 /* D size sheet */
  140. #define DMPAPER_ESHEET 26 /* E size sheet */
  141. #define DMPAPER_ENV_DL 27 /* Envelope DL 110 x 220mm */
  142. #define DMPAPER_ENV_C5 28 /* Envelope C5 162 x 229 mm */
  143. #define DMPAPER_ENV_C3 29 /* Envelope C3 324 x 458 mm */
  144. #define DMPAPER_ENV_C4 30 /* Envelope C4 229 x 324 mm */
  145. #define DMPAPER_ENV_C6 31 /* Envelope C6 114 x 162 mm */
  146. #define DMPAPER_ENV_C65 32 /* Envelope C65 114 x 229 mm */
  147. #define DMPAPER_ENV_B4 33 /* Envelope B4 250 x 353 mm */
  148. #define DMPAPER_ENV_B5 34 /* Envelope B5 176 x 250 mm */
  149. #define DMPAPER_ENV_B6 35 /* Envelope B6 176 x 125 mm */
  150. #define DMPAPER_ENV_ITALY 36 /* Envelope 110 x 230 mm */
  151. #define DMPAPER_ENV_MONARCH 37 /* Envelope Monarch 3.875 x 7.5 in */
  152. #define DMPAPER_ENV_PERSONAL 38 /* 6 3/4 Envelope 3 5/8 x 6 1/2 in */
  153. #define DMPAPER_FANFOLD_US 39 /* US Std Fanfold 14 7/8 x 11 in */
  154. #define DMPAPER_FANFOLD_STD_GERMAN 40 /* German Std Fanfold 8 1/2 x 12 in */
  155. #define DMPAPER_FANFOLD_LGL_GERMAN 41 /* German Legal Fanfold 8 1/2 x 13 in */
  156. /*
  157. ** the following 5 sizes were added in Chicago per FE group's request.
  158. */
  159. #define DMPAPER_JIS_B4 42 /* B4 257 x 364 mm */
  160. #define DMPAPER_JAPANESE_POSTCARD 43 /* Japanese Postcard 100 x 148 mm */
  161. #define DMPAPER_9X11 44 /* 9 x 11 in */
  162. #define DMPAPER_10X11 45 /* 10 x 11 in */
  163. #define DMPAPER_15X11 46 /* 15 x 11 in */
  164. /*
  165. ** the following 7 sizes were used in PostScript driver during Win3.1 WDL.
  166. ** Unfortunately, we cannot redefine those id's even though there is gap with
  167. ** the rest of standard id's.
  168. */
  169. #define DMPAPER_LETTER_EXTRA 50 /* Letter Extra 9 \275 x 12 in */
  170. #define DMPAPER_LEGAL_EXTRA 51 /* Legal Extra 9 \275 x 15 in */
  171. #define DMPAPER_TABLOID_EXTRA 52 /* Tabloid Extra 11.69 x 18 in */
  172. #define DMPAPER_A4_EXTRA 53 /* A4 Extra 9.27 x 12.69 in */
  173. #define DMPAPER_LETTER_TRANSVERSE 54 /* Letter Transverse 8 \275 x 11 in */
  174. #define DMPAPER_A4_TRANSVERSE 55 /* Transverse 210 x 297 mm */
  175. #define DMPAPER_LETTER_EXTRA_TRANSVERSE 56 /* Letter Extra Transverse 9\275 x 12 in */
  176. #define DMPAPER_LAST DMPAPER_LETTER_EXTRA_TRANSVERSE
  177. #define DMPAPER_USER 256
  178. /* bin selections */
  179. #define DMBIN_FIRST DMBIN_UPPER
  180. #define DMBIN_UPPER 1
  181. #define DMBIN_ONLYONE 1
  182. #define DMBIN_LOWER 2
  183. #define DMBIN_MIDDLE 3
  184. #define DMBIN_MANUAL 4
  185. #define DMBIN_ENVELOPE 5
  186. #define DMBIN_ENVMANUAL 6
  187. #define DMBIN_AUTO 7
  188. #define DMBIN_TRACTOR 8
  189. #define DMBIN_SMALLFMT 9
  190. #define DMBIN_LARGEFMT 10
  191. #define DMBIN_LARGECAPACITY 11
  192. #define DMBIN_CASSETTE 14
  193. #define DMBIN_ROLL 15
  194. #define DMBIN_LAST DMBIN_ROLL
  195. #define DMBIN_USER 256 /* device specific bins start here */
  196. /* print qualities */
  197. #define DMRES_DRAFT (-1)
  198. #define DMRES_LOW (-2)
  199. #define DMRES_MEDIUM (-3)
  200. #define DMRES_HIGH (-4)
  201. /* color enable/disable for color printers */
  202. #define DMCOLOR_MONOCHROME 1
  203. #define DMCOLOR_COLOR 2
  204. /* duplex enable */
  205. #define DMDUP_SIMPLEX 1
  206. #define DMDUP_VERTICAL 2
  207. #define DMDUP_HORIZONTAL 3
  208. #define DMDUP_LAST DMDUP_HORIZONTAL
  209. /* TrueType options */
  210. #define DMTT_BITMAP 1 /* print TT fonts as graphics */
  211. #define DMTT_DOWNLOAD 2 /* download TT fonts as soft fonts */
  212. #define DMTT_SUBDEV 3 /* substitute device fonts for TT fonts */
  213. #define DMTT_DOWNLOAD_OUTLINE 4 /* download TT fonts as outline soft fonts */
  214. #define DMTT_LAST DMTT_DOWNLOAD_OUTLINE
  215. /* Collation selections */
  216. #define DMCOLLATE_TRUE 1 /* Collate multiple output pages */
  217. #define DMCOLLATE_FALSE 0 /* Do not collate multiple output pages */
  218. /* DEVMODE dmDisplayFlags flags */
  219. #define DM_GRAYSCALE 0x00000001L /* Device is non-color */
  220. #define DM_INTERLACED 0x00000002L /* device is interlaced */
  221. /* ICM methods */
  222. #define DMICMMETHOD_SYSTEM 1 /* ICM handled by system */
  223. #define DMICMMETHOD_NONE 2 /* ICM disabled */
  224. #define DMICMMETHOD_DRIVER 3 /* ICM handled by driver */
  225. #define DMICMMETHOD_DEVICE 4 /* ICM handled by device */
  226. #define DMICMMETHOD_LAST DMICMMETHOD_DEVICE
  227. #define DMICMMETHOD_USER 256 /* Device-specific methods start here */
  228. /* ICM Intents */
  229. #define DMICM_SATURATE 1 /* Maximize color saturation */
  230. #define DMICM_CONTRAST 2 /* Maximize color contrast */
  231. #define DMICM_COLORMETRIC 3 /* Use specific color metric */
  232. #define DMICM_LAST DMICM_COLORMETRIC
  233. #define DMICM_USER 256 /* Device-specific intents start here */
  234. /* Media types */
  235. #define DMMEDIA_STANDARD 1 /* Standard paper */
  236. #define DMMEDIA_GLOSSY 2 /* Glossy paper */
  237. #define DMMEDIA_TRANSPARENCY 3 /* Transparency */
  238. #define DMMEDIA_LAST DMMEDIA_TRANSPARENCY
  239. #define DMMEDIA_USER 256 /* Device-specific media start here */
  240. /* Dither types */
  241. #define DMDITHER_NONE 1 /* No dithering */
  242. #define DMDITHER_COARSE 2 /* Dither with a coarse brush */
  243. #define DMDITHER_FINE 3 /* Dither with a fine brush */
  244. #define DMDITHER_LINEART 4 /* LineArt dithering */
  245. #define DMDITHER_GRAYSCALE 5 /* Device does grayscaling */
  246. #define DMDITHER_LAST DMDITHER_GRAYSCALE
  247. #define DMDITHER_USER 256 /* Device-specific dithers start here */
  248. typedef struct tagDEVMODE
  249. {
  250. char dmDeviceName[CCHDEVICENAME];
  251. UINT dmSpecVersion;
  252. UINT dmDriverVersion;
  253. UINT dmSize;
  254. UINT dmDriverExtra;
  255. DWORD dmFields;
  256. int dmOrientation;
  257. int dmPaperSize;
  258. int dmPaperLength;
  259. int dmPaperWidth;
  260. int dmScale;
  261. int dmCopies;
  262. int dmDefaultSource;
  263. int dmPrintQuality;
  264. int dmColor;
  265. int dmDuplex;
  266. int dmYResolution;
  267. int dmTTOption;
  268. int dmCollate;
  269. char dmFormName[CCHFORMNAME];
  270. WORD dmUnusedPadding;
  271. DWORD dmBitsPerPel;
  272. DWORD dmPelsWidth;
  273. DWORD dmPelsHeight;
  274. DWORD dmDisplayFlags;
  275. DWORD dmDisplayFrequency;
  276. DWORD dmICMMethod;
  277. DWORD dmICMIntent;
  278. DWORD dmMediaType;
  279. DWORD dmDitherType;
  280. DWORD dmReserved1;
  281. DWORD dmReserved2;
  282. } DEVMODE;
  283. typedef DEVMODE* PDEVMODE, NEAR* NPDEVMODE, FAR* LPDEVMODE;
  284. /* mode selections for the device mode function */
  285. #define DM_UPDATE 1
  286. #define DM_COPY 2
  287. #define DM_PROMPT 4
  288. #define DM_MODIFY 8
  289. #define DM_IN_BUFFER DM_MODIFY
  290. #define DM_IN_PROMPT DM_PROMPT
  291. #define DM_OUT_BUFFER DM_COPY
  292. #define DM_OUT_DEFAULT DM_UPDATE
  293. /* device capabilities indices */
  294. #define DC_FIELDS 1
  295. #define DC_PAPERS 2
  296. #define DC_PAPERSIZE 3
  297. #define DC_MINEXTENT 4
  298. #define DC_MAXEXTENT 5
  299. #define DC_BINS 6
  300. #define DC_DUPLEX 7
  301. #define DC_SIZE 8
  302. #define DC_EXTRA 9
  303. #define DC_VERSION 10
  304. #define DC_DRIVER 11
  305. #define DC_BINNAMES 12
  306. #define DC_ENUMRESOLUTIONS 13
  307. #define DC_FILEDEPENDENCIES 14
  308. #define DC_TRUETYPE 15
  309. #define DC_PAPERNAMES 16
  310. #define DC_ORIENTATION 17
  311. #define DC_COPIES 18
  312. #define DC_BINADJUST 19
  313. /* bit fields of the return value (DWORD) for DC_TRUETYPE */
  314. #define DCTT_BITMAP 0x0000001L
  315. #define DCTT_DOWNLOAD 0x0000002L
  316. #define DCTT_SUBDEV 0x0000004L
  317. #define DCTT_DOWNLOAD_OUTLINE 0x0000008L
  318. /* return values for DC_BINADJUST */
  319. #define DCBA_FACEUPNONE 0x0000
  320. #define DCBA_FACEUPCENTER 0x0001
  321. #define DCBA_FACEUPLEFT 0x0002
  322. #define DCBA_FACEUPRIGHT 0x0003
  323. #define DCBA_FACEDOWNNONE 0x0100
  324. #define DCBA_FACEDOWNCENTER 0x0101
  325. #define DCBA_FACEDOWNLEFT 0x0102
  326. #define DCBA_FACEDOWNRIGHT 0x0103
  327. /* export ordinal definitions */
  328. #define PROC_EXTDEVICEMODE MAKEINTRESOURCE(90)
  329. #define PROC_DEVICECAPABILITIES MAKEINTRESOURCE(91)
  330. #define PROC_OLDDEVICEMODE MAKEINTRESOURCE(13)
  331. /* define types of pointers to ExtDeviceMode() and DeviceCapabilities()
  332. * functions
  333. */
  334. /* BUGBUG, many of these params are const */
  335. typedef UINT (CALLBACK* LPFNDEVMODE)(HWND, HMODULE, LPDEVMODE,
  336. LPSTR, LPSTR, LPDEVMODE, LPSTR, UINT);
  337. typedef DWORD (CALLBACK* LPFNDEVCAPS)(LPSTR, LPSTR, UINT, LPSTR, LPDEVMODE);
  338. #ifndef NOEXTDEVMODEPROPSHEET
  339. #include <prsht.h> /* for EXTDEVMODEPROPSHEET */
  340. /* these are the names of the exports from the printer drivers */
  341. #define PROCNAME_EXTDEVICEMODE "EXTDEVICEMODE"
  342. #define PROCNAME_EXTDEVMODEPROPSHEET "EXTDEVICEMODEPROPSHEET"
  343. /* this function is similar to ExtDeviceMode(), with the following
  344. ** changes:
  345. **
  346. ** 1) No lpdmIn or lpdmOut. Changes are global
  347. ** 2) UI always displays, changes always saved (wMode is always
  348. ** DM_PROMPT | DM_UPDATE)
  349. ** 3) Driver enumerates property pages back to the caller via
  350. ** lpfnAddPage and lParam.
  351. ** lpfnAddPage is called by the driver to enumerate each HPROPSHEETPAGE
  352. ** lParam is passed back to lpfnAddPage.
  353. */
  354. typedef int (WINAPI *LPFNEXTDEVICEMODEPROPSHEET)(
  355. HWND hWnd,
  356. HINSTANCE hinstDriver,
  357. LPCSTR lpszDevice,
  358. LPCSTR lpszPort,
  359. DWORD dwReserved,
  360. LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam);
  361. /* Ordinal for new entry point */
  362. #define PROC_EXTDEVICEMODEPROPSHEET MAKEINTRESOURCE(95)
  363. #endif /* NOEXTDEVMODEPROPSHEET */
  364. HDC WINAPI ResetDC(HDC, const DEVMODE FAR*);
  365. /* this structure is used by the GETSETSCREENPARAMS escape */
  366. typedef struct tagSCREENPARAMS
  367. {
  368. int angle;
  369. int frequency;
  370. } SCREENPARAMS;
  371. #ifdef __cplusplus
  372. }
  373. #endif /* __cplusplus */
  374. #ifndef RC_INVOKED
  375. #pragma pack()
  376. #endif /* !RC_INVOKED */
  377. #endif /* !_INC_PRINT */
  378.