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.

197 lines
4.2 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. #define DRIVER_VERSION 0x400 // driver version number
  21. #define DRIVER_SIGNATURE 'xafD' // driver signature
  22. #ifndef WIN95
  23. #define DRIVER_NAME L"Windows NT Fax Driver"
  24. #else
  25. #define DRIVER_NAME "Microsoft Fax Client"
  26. typedef struct _FAX_TIME {
  27. WORD hour; // hour: 0 - 23
  28. WORD minute; // minute: 0 - 59
  29. } FAX_TIME, *PFAX_TIME;
  30. #endif
  31. //
  32. // Maximum length of some strings in the private portion of devmode
  33. //
  34. #define MAX_BILLING_CODE 16
  35. #define MAX_SENDER_NAME 64
  36. #define MAX_RECIPIENT_NAME 64
  37. #define MAX_RECIPIENT_NUMBER 64
  38. #define MAX_SUBJECT_LINE 128
  39. #define MAX_EMAIL_ADDRESS 128
  40. //
  41. // PostScript driver private devmode fields
  42. //
  43. typedef struct {
  44. DWORD signature; // private devmode signature
  45. DWORD flags; // flag bits
  46. INT sendCoverPage; // whether to send cover page
  47. INT whenToSend; // "Time to send" option
  48. FAX_TIME sendAtTime; // specific time to send
  49. DWORD reserved[8]; // reserved
  50. //
  51. // Private fields used for passing info between kernel and user mode DLLs
  52. // pointer to user mode memory
  53. //
  54. PVOID pUserMem;
  55. //
  56. // Billing code
  57. //
  58. WCHAR billingCode[MAX_BILLING_CODE];
  59. //
  60. // email address for delivery reports
  61. //
  62. WCHAR emailAddress[MAX_EMAIL_ADDRESS];
  63. } DMPRIVATE, *PDMPRIVATE;
  64. typedef struct {
  65. DEVMODE dmPublic; // public devmode fields
  66. DMPRIVATE dmPrivate; // private devmode fields
  67. } DRVDEVMODE, *PDRVDEVMODE;
  68. //
  69. // Check if a devmode structure is current version
  70. //
  71. #define CurrentVersionDevmode(pDevmode) \
  72. ((pDevmode) != NULL && \
  73. (pDevmode)->dmSpecVersion == DM_SPECVERSION && \
  74. (pDevmode)->dmDriverVersion == DRIVER_VERSION && \
  75. (pDevmode)->dmSize == sizeof(DEVMODE) && \
  76. (pDevmode)->dmDriverExtra == sizeof(DMPRIVATE))
  77. //
  78. // Constants representing different "Time to send" option
  79. //
  80. #define SENDFAX_ASAP 0 // send as soon as possible
  81. #define SENDFAX_AT_CHEAP 1 // send during discount rate hours
  82. #define SENDFAX_AT_TIME 2 // send at specific time
  83. //
  84. // Constant flag bits for DMPRIVATE.flags field
  85. //
  86. #define FAXDM_NO_HALFTONE 0x0001 // don't halftone bitmap images
  87. #define FAXDM_1D_ENCODING 0x0002 // use group3 1D encoding
  88. #define FAXDM_NO_WIZARD 0x0004 // bypass wizard
  89. #define FAXDM_DRIVER_DEFAULT 0x0008 // driver default devmode
  90. //
  91. // Default form names and form sizes
  92. //
  93. #define FORMNAME_LETTER TEXT("Letter")
  94. #define FORMNAME_A4 TEXT("A4")
  95. #define LETTER_WIDTH 215900 // 8.5" in microns
  96. #define LETTER_HEIGHT 279400 // 11" in microns
  97. #define A4_WIDTH 210000 // 210mm in microns
  98. #define A4_HEIGHT 297000 // 297mm in microns
  99. //
  100. // Default resolutions for fax output
  101. //
  102. #define FAXRES_HORIZONTAL 200
  103. #define FAXRES_VERTICAL 200
  104. #define FAXRES_VERTDRAFT 100
  105. //
  106. // Maximum allowable bitmap size (in pixels) for fax output
  107. //
  108. #define MAX_WIDTH_PIXELS 1728
  109. #define MAX_HEIGHT_PIXELS 2800
  110. //
  111. // Retrieve driver default devmode
  112. //
  113. VOID
  114. DriverDefaultDevmode(
  115. PDRVDEVMODE pdm,
  116. LPTSTR pDeviceName,
  117. HANDLE hPrinter
  118. );
  119. //
  120. // Merge the source devmode into the destination devmode
  121. //
  122. BOOL
  123. MergeDevmode(
  124. PDRVDEVMODE pdmDest,
  125. PDEVMODE pdmSrc,
  126. BOOL publicOnly
  127. );
  128. //
  129. // NOTE: These are defined in printers\lib directory. Declare them here to
  130. // avoid including libproto.h and dragging in lots of other junk.
  131. //
  132. LONG
  133. ConvertDevmode(
  134. PDEVMODE pdmIn,
  135. PDEVMODE pdmOut
  136. );
  137. #ifdef KERNEL_MODE
  138. extern DEVHTINFO DefDevHTInfo;
  139. extern COLORADJUSTMENT DefHTClrAdj;
  140. #endif
  141. #endif // !_DEVMODE_H_