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.

123 lines
3.3 KiB

  1. /*++
  2. Copyright (c) 1997-1999 Microsoft Corporation
  3. --*/
  4. #ifndef _PDEV_H
  5. #define _PDEV_H
  6. #include <minidrv.h>
  7. #include <stdio.h>
  8. #include <prcomoem.h>
  9. #define VALID_PDEVOBJ(pdevobj) \
  10. ((pdevobj) && (pdevobj)->dwSize >= sizeof(DEVOBJ) && \
  11. (pdevobj)->hEngine && (pdevobj)->hPrinter && \
  12. (pdevobj)->pPublicDM && (pdevobj)->pDrvProcs )
  13. #define ASSERT_VALID_PDEVOBJ(pdevobj) ASSERT(VALID_PDEVOBJ(pdevobj))
  14. // Debug text.
  15. #define ERRORTEXT(s) "ERROR " DLLTEXT(s)
  16. //
  17. // OEM Signature and version.
  18. //
  19. #define OEM_SIGNATURE 'CNRS' // Canon/Qnix resource DLL
  20. #define DLLTEXT(s) "CNRS: " s
  21. #define OEM_VERSION 0x00010000L
  22. ////////////////////////////////////////////////////////
  23. // OEM UD Type Defines
  24. ////////////////////////////////////////////////////////
  25. typedef struct tag_OEM_EXTRADATA {
  26. OEM_DMEXTRAHEADER dmExtraHdr;
  27. // Private extention
  28. WORD wMediaType;
  29. WORD wPrintQuality;
  30. WORD wInputBin;
  31. } OEM_EXTRADATA, *POEM_EXTRADATA;
  32. ////////////////////////////////////////////////////////
  33. // OEM Command Callback ID definition
  34. ////////////////////////////////////////////////////////
  35. // Job Setup
  36. #define CMD_BEGIN_PAGE 1
  37. // Media Type
  38. #define CMD_MEDIA_PLAIN 20 // Plain Paper
  39. #define CMD_MEDIA_COAT 21 // Coated Paper
  40. #define CMD_MEDIA_OHP 22 // Transparency
  41. #define CMD_MEDIA_BPF 23 // Back Print Film
  42. #define CMD_MEDIA_FABRIC 24 // Fabric Sheet
  43. #define CMD_MEDIA_GLOSSY 25 // Glossy Paper
  44. #define CMD_MEDIA_HIGHGLOSS 26 // High Gloss Paper
  45. #define CMD_MEDIA_HIGHRESO 27 // High Resolution Paper
  46. #define CMD_MEDIA_BJ 28 // BJ Cross
  47. #define CMD_MEDIA_JPNPST 29 // JapanesePostcard
  48. // Print Quality
  49. #define CMD_QUALITY_NORMAL 30
  50. #define CMD_QUALITY_HIGHQUALITY 31
  51. #define CMD_QUALITY_DRAFT 32
  52. // Input Bin
  53. #define CMD_INPUTBIN_AUTO 40
  54. #define CMD_INPUTBIN_MANUAL 41
  55. ////////////////////////////////////////////////////////
  56. // OEM private extention index
  57. ////////////////////////////////////////////////////////
  58. // Media Type Index
  59. #define NUM_MEDIA 8
  60. #define MEDIATYPE_PLAIN 0
  61. #define MEDIATYPE_COAT 1
  62. #define MEDIATYPE_OHP 2
  63. #define MEDIATYPE_BPF 3
  64. #define MEDIATYPE_FABRIC 4
  65. #define MEDIATYPE_GLOSSY 5
  66. #define MEDIATYPE_HIGHGLOSS 6
  67. #define MEDIATYPE_HIGHRESO 7
  68. #define MEDIATYPE_START CMD_MEDIA_PLAIN
  69. // PrintQuality Index
  70. #define NUM_QUALITY 3
  71. #define PRINTQUALITY_NORMAL 0
  72. #define PRINTQUALITY_HIGHQUALITY 1
  73. #define PRINTQUALITY_DRAFT 2
  74. #define PRINTQUALITY_START CMD_QUALITY_NORMAL
  75. // Input Bin Index
  76. #define NUM_INPUTBIN 2
  77. #define INPUTBIN_AUTO 0
  78. #define INPUTBIN_MANUAL 1
  79. ////////////////////////////////////////////////////////
  80. // Command parameter table
  81. ////////////////////////////////////////////////////////
  82. static BYTE bPrintModeParamTable[NUM_QUALITY][NUM_MEDIA] =
  83. {
  84. // Quality Normal
  85. {
  86. 0x00, 0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70
  87. },
  88. // Quality High Quality
  89. {
  90. 0x01, 0x11, 0x21, 0x31, 0x41, 0x51, 0x61, 0x71
  91. },
  92. // Quality Draft
  93. {
  94. 0x02, 0x12, 0x22, 0x32, 0x42, 0x52, 0x62, 0x72
  95. }
  96. };
  97. static BYTE bInputBinMediaParamTable[NUM_MEDIA] =
  98. {
  99. 0x00, 0x10, 0x20, 0x20, 0x00, 0x10, 0x10, 0x00
  100. };
  101. #endif // _PDEV_H