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.

160 lines
4.5 KiB

  1. #ifndef _PDEV_H
  2. #define _PDEV_H
  3. //
  4. // Files necessary for OEM plug-in.
  5. //
  6. #include <minidrv.h>
  7. #include <stdio.h>
  8. #include <prcomoem.h>
  9. #include "COLMATCH.H"
  10. #include "DEBUG2.H"
  11. //
  12. // For debugging.
  13. //
  14. #ifndef DEBUG2_FILE
  15. //#define MY_VERBOSE(x) DBGPRINT(DBG_WARNING, x)
  16. #define MY_VERBOSE VERBOSE
  17. //#define DL_VERBOSE MY_VERBOSE
  18. #define DL_VERBOSE VERBOSE
  19. //#define SC_VERBOSE MY_VERBOSE
  20. #define SC_VERBOSE VERBOSE
  21. //#define CM_VERBOSE MY_VERBOSE
  22. #define CM_VERBOSE VERBOSE
  23. #else // DEBUG2_FILE
  24. #define DUMP_VERBOSE(p1,p2) DbgFDump(p1,p2);
  25. #define SB_VERBOSE(no, msg) { DbgFPrint msg; }
  26. #define MY_VERBOSE(msg) SB_VERBOSE(1, msg)
  27. #define DL_VERBOSE(msg) SB_VERBOSE(1, msg)
  28. #define SC_VERBOSE(msg) SB_VERBOSE(1, msg)
  29. #define CM_VERBOSE(msg) SB_VERBOSE(1, msg)
  30. #endif // DEBUG2_FILE
  31. //
  32. // Misc definitions follows.
  33. //
  34. #define DOWNLOADFONT 1
  35. //#define DOWNLOADFONT 0
  36. #define DRVGETDRIVERSETTING(p, t, o, s, n, r) \
  37. ((p)->pDrvProcs->DrvGetDriverSetting(p, t, o, s, n, r))
  38. #define DRVGETGPDDATA(p, t, i, b, s, n) \
  39. ((p)->pDrvProcs->DrvGetGPDData(p, t, i, b, s, n))
  40. #define MINIPDEV_DATA(p) ((p)->pdevOEM)
  41. #define MASTER_UNIT 1200
  42. #define DEFAULT_PALETTE_INDEX 0
  43. ////////////////////////////////////////////////////////
  44. // OEM UD Defines
  45. ////////////////////////////////////////////////////////
  46. #define VALID_PDEVOBJ(pdevobj) \
  47. ((pdevobj) && (pdevobj)->dwSize >= sizeof(DEVOBJ) && \
  48. (pdevobj)->hEngine && (pdevobj)->hPrinter && \
  49. (pdevobj)->pPublicDM && (pdevobj)->pDrvProcs )
  50. //
  51. // ASSERT_VALID_PDEVOBJ can be used to verify the passed in "pdevobj". However,
  52. // it does NOT check "pdevOEM" and "pOEMDM" fields since not all OEM DLL's create
  53. // their own pdevice structure or need their own private devmode. If a particular
  54. // OEM DLL does need them, additional checks should be added. For example, if
  55. // an OEM DLL needs a private pdevice structure, then it should use
  56. // ASSERT(VALID_PDEVOBJ(pdevobj) && pdevobj->pdevOEM && ...)
  57. //
  58. #define ASSERT_VALID_PDEVOBJ(pdevobj) ASSERT(VALID_PDEVOBJ(pdevobj))
  59. // Debug text.
  60. #define ERRORTEXT(s) "ERROR " s
  61. ////////////////////////////////////////////////////////
  62. // OEM UD Prototypes
  63. ////////////////////////////////////////////////////////
  64. //VOID DbgPrint(IN LPCTSTR pstrFormat, ...);
  65. //
  66. // OEM Signature and version.
  67. //
  68. #define OEM_SIGNATURE 'CSN4' // EPSON ESC/Page printers
  69. #define OEM_VERSION 0x00010000L
  70. ////////////////////////////////////////////////////////
  71. // OEM UD Type Defines
  72. ////////////////////////////////////////////////////////
  73. typedef struct tag_OEMUD_EXTRADATA {
  74. OEM_DMEXTRAHEADER dmExtraHdr;
  75. } OEMUD_EXTRADATA, *POEMUD_EXTRADATA;
  76. typedef struct {
  77. DWORD fGeneral;
  78. int iEscapement;
  79. short sHeightDiv;
  80. short iDevCharOffset;
  81. BYTE iPaperSource;
  82. BYTE iDuplex;
  83. BYTE iTonerSave;
  84. BYTE iOrientation;
  85. BYTE iResolution;
  86. BYTE iColor;
  87. BYTE iSmoothing;
  88. BYTE iJamRecovery;
  89. BYTE iMediaType;
  90. BYTE iOutBin; //+N5
  91. BYTE iIcmMode; //+N5
  92. BYTE iUnitFactor; // factor of master unit
  93. BYTE iDithering;
  94. BYTE iColorMatching;
  95. BYTE iBitFont;
  96. BYTE iCmyBlack;
  97. BYTE iTone;
  98. BYTE iPaperSize;
  99. BYTE iCompress;
  100. WORD Printer;
  101. DEVCOL Col;
  102. WORD wRectWidth, wRectHeight;
  103. #define UNKNOWN_DLFONT_ID (~0)
  104. DWORD dwDLFontID; // device's current font ID
  105. DWORD dwDLSelectFontID; // "SelectFont" font ID
  106. DWORD dwDLSetFontID; // "SetFont" font ID
  107. WORD wCharCode;
  108. #if 0 /* OEM doesn't want to fix minidriver */
  109. /* Below is hack code to fix #412276 */
  110. DWORD dwSelectedColor; // Latest selected color descirbe as COLOR_SELECT_xxx
  111. BYTE iColorMayChange; // 1 means called block data callback that may change color
  112. /* End of hack code */
  113. #endif /* OEM doesn't want to fix minidriver */
  114. } MYPDEV, *PMYPDEV;
  115. // Flags for fGeneral
  116. #define FG_DBCS 0x00000001
  117. #define FG_VERT 0x00000002
  118. #define FG_PROP 0x00000004
  119. #define FG_DOUBLE 0x00000008
  120. #define FG_NULL_PEN 0x00000010
  121. #define FG_BOLD 0x00000020
  122. #define FG_ITALIC 0x00000040
  123. extern BOOL BInitOEMExtraData(POEMUD_EXTRADATA pOEMExtra);
  124. extern BMergeOEMExtraData(POEMUD_EXTRADATA pdmIn, POEMUD_EXTRADATA pdmOut);
  125. #endif // _PDEV_H
  126. // End of File