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.

121 lines
3.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. //
  10. // Misc definitions follows.
  11. //
  12. #define DOWNLOADFONT 1
  13. //#define DOWNLOADFONT 0
  14. // Modification of Color-mode command 2002.3.28 >>>
  15. #define DRVGETDRIVERSETTING(p, t, o, s, n, r) \
  16. ((p)->pDrvProcs->DrvGetDriverSetting(p, t, o, s, n, r))
  17. // Modification of Color-mode command 2002.3.28 <<<
  18. #define WRITESPOOLBUF(p, s, n) \
  19. ((p)->pDrvProcs->DrvWriteSpoolBuf(p, s, n))
  20. #define MINIPDEV_DATA(p) ((p)->pdevOEM)
  21. #define MASTER_UNIT 1200
  22. ////////////////////////////////////////////////////////
  23. // OEM UD Defines
  24. ////////////////////////////////////////////////////////
  25. #define VALID_PDEVOBJ(pdevobj) \
  26. ((pdevobj) && (pdevobj)->dwSize >= sizeof(DEVOBJ) && \
  27. (pdevobj)->hEngine && (pdevobj)->hPrinter && \
  28. (pdevobj)->pPublicDM && (pdevobj)->pDrvProcs )
  29. //
  30. // ASSERT_VALID_PDEVOBJ can be used to verify the passed in "pdevobj". However,
  31. // it does NOT check "pdevOEM" and "pOEMDM" fields since not all OEM DLL's create
  32. // their own pdevice structure or need their own private devmode. If a particular
  33. // OEM DLL does need them, additional checks should be added. For example, if
  34. // an OEM DLL needs a private pdevice structure, then it should use
  35. // ASSERT(VALID_PDEVOBJ(pdevobj) && pdevobj->pdevOEM && ...)
  36. //
  37. #define ASSERT_VALID_PDEVOBJ(pdevobj) ASSERT(VALID_PDEVOBJ(pdevobj))
  38. // Debug text.
  39. #define ERRORTEXT(s) "ERROR " s
  40. ////////////////////////////////////////////////////////
  41. // OEM UD Prototypes
  42. ////////////////////////////////////////////////////////
  43. //VOID DbgPrint(IN LPCTSTR pstrFormat, ...);
  44. //
  45. // OEM Signature and version.
  46. //
  47. #define OEM_SIGNATURE 'CSN4' // EPSON ESC/Page printers
  48. #define OEM_VERSION 0x00010000L
  49. ////////////////////////////////////////////////////////
  50. // OEM UD Type Defines
  51. ////////////////////////////////////////////////////////
  52. typedef struct tag_OEMUD_EXTRADATA {
  53. OEM_DMEXTRAHEADER dmExtraHdr;
  54. } OEMUD_EXTRADATA, *POEMUD_EXTRADATA;
  55. typedef struct {
  56. DWORD fGeneral;
  57. int iEscapement;
  58. short iDevCharOffset;
  59. BYTE iPaperSource;
  60. BYTE iDuplex;
  61. BYTE iTonerSave;
  62. BYTE iOrientation;
  63. BYTE iResolution;
  64. BYTE iColor;
  65. BYTE iSmoothing;
  66. BYTE iJamRecovery;
  67. BYTE iMediaType;
  68. BYTE iOutBin; //+CP-E8000
  69. #define UNKNOWN_DLFONT_ID (~0)
  70. DWORD dwDLFontID; // device's current font ID
  71. DWORD dwDLSelectFontID; // "SelectFont" font ID
  72. DWORD dwDLSetFontID; // "SetFont" font ID
  73. WORD wCharCode;
  74. BYTE iUnitFactor; // master vs device scale factor
  75. WORD wRectWidth, wRectHeight;
  76. #if 0 /* OEM doesn't want to fix minidriver */
  77. /* Below is hack code to fix #412276 */
  78. DWORD dwSelectedColor; // Latest selected color descirbe as COLOR_SELECT_xxx
  79. BYTE iColorMayChange; // 1 means called block data callback that may change color
  80. /* End of hack code */
  81. #endif /* OEM doesn't want to fix minidriver */
  82. } MYPDEV, *PMYPDEV;
  83. // Flags for fGeneral
  84. #define FG_DBCS 0x00000001
  85. #define FG_VERT 0x00000002
  86. #define FG_PROP 0x00000004
  87. #define FG_DOUBLE 0x00000008
  88. #define FG_NULL_PEN 0x00000010
  89. #define FG_BOLD 0x00000020
  90. #define FG_ITALIC 0x00000040
  91. extern BOOL BInitOEMExtraData(POEMUD_EXTRADATA pOEMExtra);
  92. extern BMergeOEMExtraData(POEMUD_EXTRADATA pdmIn, POEMUD_EXTRADATA pdmOut);
  93. #endif // _PDEV_H