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.

208 lines
4.5 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. devmode.h
  5. Abstract:
  6. DEVMODE related declarations and definitions
  7. Environment:
  8. Fax driver, user and kernel mode
  9. Revision History:
  10. 01/09/96 -davidx-
  11. Created it.
  12. dd-mm-yy -author-
  13. description
  14. --*/
  15. #ifndef _DEVMODE_H_
  16. #define _DEVMODE_H_
  17. //
  18. // Driver version number and signatures
  19. //
  20. #include <faxreg.h>
  21. #define DRIVER_VERSION 0x400 // driver version number
  22. #define DRIVER_SIGNATURE 'xafD' // driver signature
  23. #ifndef WIN95
  24. #define DRIVER_NAME FAX_DRIVER_NAME
  25. #else
  26. #define DRIVER_NAME "Microsoft Fax Client"
  27. #endif
  28. //
  29. // Maximum length of some strings in the private portion of devmode
  30. //
  31. #define MAX_SENDER_NAME 64
  32. #define MAX_RECIPIENT_NAME 64
  33. #define MAX_RECIPIENT_NUMBER 64
  34. #define MAX_SUBJECT_LINE 128
  35. #define MAX_EMAIL_ADDRESS 128
  36. //
  37. // Maximum TIFF file size for a single page
  38. //
  39. #define MAX_TIFF_PAGE_SIZE 0x200000 // 2Mb
  40. //
  41. // Preview map file header
  42. //
  43. typedef struct _MAP_TIFF_PAGE_HEADER
  44. {
  45. DWORD cb;
  46. DWORD dwDataSize;
  47. INT iPageCount;
  48. BOOL bPreview;
  49. } MAP_TIFF_PAGE_HEADER, *PMAP_TIFF_PAGE_HEADER;
  50. //
  51. // PostScript driver private devmode fields
  52. //
  53. typedef struct {
  54. DWORD signature; // private devmode signature
  55. DWORD flags; // flag bits
  56. INT sendCoverPage; // whether to send cover page
  57. INT whenToSend; // "Time to send" option
  58. FAX_TIME sendAtTime; // specific time to send
  59. DWORD reserved[8]; // reserved
  60. //
  61. // Private fields used for passing info between kernel and user mode DLLs
  62. // pointer to user mode memory
  63. //
  64. PVOID pUserMem; // PDOCEVENTUSERMEM
  65. //
  66. // Billing code
  67. //
  68. TCHAR billingCode[MAX_USERINFO_BILLING_CODE + 1];
  69. //
  70. // email address for delivery reports
  71. //
  72. TCHAR emailAddress[MAX_EMAIL_ADDRESS];
  73. //
  74. // Mapping file for driver communication (Used by Print preview).
  75. //
  76. TCHAR szMappingFile[MAX_PATH];
  77. } DMPRIVATE, *PDMPRIVATE;
  78. typedef struct {
  79. DEVMODE dmPublic; // public devmode fields
  80. DMPRIVATE dmPrivate; // private devmode fields
  81. } DRVDEVMODE, *PDRVDEVMODE;
  82. //
  83. // Check if a devmode structure is current version
  84. //
  85. #define CurrentVersionDevmode(pDevmode) \
  86. ((pDevmode) != NULL && \
  87. (pDevmode)->dmSpecVersion == DM_SPECVERSION && \
  88. (pDevmode)->dmDriverVersion == DRIVER_VERSION && \
  89. (pDevmode)->dmSize == sizeof(DEVMODE) && \
  90. (pDevmode)->dmDriverExtra == sizeof(DMPRIVATE))
  91. //
  92. // Constant flag bits for DMPRIVATE.flags field
  93. //
  94. #define FAXDM_NO_HALFTONE 0x0001 // don't halftone bitmap images
  95. #define FAXDM_1D_ENCODING 0x0002 // use group3 1D encoding
  96. #define FAXDM_NO_WIZARD 0x0004 // bypass wizard
  97. #define FAXDM_DRIVER_DEFAULT 0x0008 // driver default devmode
  98. //
  99. // Default form names and form sizes
  100. //
  101. #define FORMNAME_LETTER TEXT("Letter")
  102. #define FORMNAME_A4 TEXT("A4")
  103. #define FORMNAME_LEGAL TEXT("Legal")
  104. #define LETTER_WIDTH 215900 // 8.5" in microns
  105. #define LETTER_HEIGHT 279400 // 11" in microns
  106. #define A4_WIDTH 210000 // 210mm in microns
  107. #define A4_HEIGHT 297000 // 297mm in microns
  108. //
  109. // Default resolutions for fax output
  110. //
  111. #define FAXRES_HORIZONTAL 200
  112. #define FAXRES_VERTICAL 200
  113. #define FAXRES_VERTDRAFT 100
  114. //
  115. // Maximum allowable bitmap size (in pixels) for fax output
  116. //
  117. #define MAX_WIDTH_PIXELS 1728
  118. #define MAX_HEIGHT_PIXELS 2800
  119. //
  120. // Retrieve driver default devmode
  121. //
  122. VOID
  123. DriverDefaultDevmode(
  124. PDRVDEVMODE pdm,
  125. LPTSTR pDeviceName,
  126. HANDLE hPrinter
  127. );
  128. //
  129. // Merge the source devmode into the destination devmode
  130. //
  131. BOOL
  132. MergeDevmode(
  133. PDRVDEVMODE pdmDest,
  134. PDEVMODE pdmSrc,
  135. BOOL publicOnly
  136. );
  137. //
  138. // NOTE: These are defined in printers\lib directory. Declare them here to
  139. // avoid including libproto.h and dragging in lots of other junk.
  140. //
  141. LONG
  142. ConvertDevmode(
  143. PDEVMODE pdmIn,
  144. PDEVMODE pdmOut
  145. );
  146. #ifdef KERNEL_MODE
  147. extern DEVHTINFO DefDevHTInfo;
  148. extern COLORADJUSTMENT DefHTClrAdj;
  149. #endif
  150. #endif // !_DEVMODE_H_