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.

140 lines
3.7 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. //
  11. // For debugging.
  12. //
  13. //#define MY_VERBOSE(x) DBGPRINT(DBG_WARNING, x)
  14. #define MY_VERBOSE VERBOSE
  15. //#define DL_VERBOSE MY_VERBOSE
  16. #define DL_VERBOSE VERBOSE
  17. //#define SC_VERBOSE MY_VERBOSE
  18. #define SC_VERBOSE VERBOSE
  19. //#define CM_VERBOSE MY_VERBOSE
  20. #define CM_VERBOSE VERBOSE
  21. //
  22. // Misc definitions follows.
  23. //
  24. #define DOWNLOADFONT 1
  25. //#define DOWNLOADFONT 0
  26. #define DRVGETDRIVERSETTING(p, t, o, s, n, r) \
  27. ((p)->pDrvProcs->DrvGetDriverSetting(p, t, o, s, n, r))
  28. #define DRVGETGPDDATA(p, t, i, b, s, n) \
  29. ((p)->pDrvProcs->DrvGetGPDData(p, t, i, b, s, n))
  30. #define MINIPDEV_DATA(p) ((p)->pdevOEM)
  31. #define MASTER_UNIT 1200
  32. #define DEFAULT_PALETTE_INDEX 0
  33. ////////////////////////////////////////////////////////
  34. // OEM UD Defines
  35. ////////////////////////////////////////////////////////
  36. #define VALID_PDEVOBJ(pdevobj) \
  37. ((pdevobj) && (pdevobj)->dwSize >= sizeof(DEVOBJ) && \
  38. (pdevobj)->hEngine && (pdevobj)->hPrinter && \
  39. (pdevobj)->pPublicDM && (pdevobj)->pDrvProcs )
  40. //
  41. // ASSERT_VALID_PDEVOBJ can be used to verify the passed in "pdevobj". However,
  42. // it does NOT check "pdevOEM" and "pOEMDM" fields since not all OEM DLL's create
  43. // their own pdevice structure or need their own private devmode. If a particular
  44. // OEM DLL does need them, additional checks should be added. For example, if
  45. // an OEM DLL needs a private pdevice structure, then it should use
  46. // ASSERT(VALID_PDEVOBJ(pdevobj) && pdevobj->pdevOEM && ...)
  47. //
  48. #define ASSERT_VALID_PDEVOBJ(pdevobj) ASSERT(VALID_PDEVOBJ(pdevobj))
  49. // Debug text.
  50. #define ERRORTEXT(s) "ERROR " s
  51. ////////////////////////////////////////////////////////
  52. // OEM UD Prototypes
  53. ////////////////////////////////////////////////////////
  54. //VOID DbgPrint(IN LPCTSTR pstrFormat, ...);
  55. //
  56. // OEM Signature and version.
  57. //
  58. #define OEM_SIGNATURE 'CSN4' // EPSON ESC/Page printers
  59. #define OEM_VERSION 0x00010000L
  60. ////////////////////////////////////////////////////////
  61. // OEM UD Type Defines
  62. ////////////////////////////////////////////////////////
  63. typedef struct tag_OEMUD_EXTRADATA {
  64. OEM_DMEXTRAHEADER dmExtraHdr;
  65. } OEMUD_EXTRADATA, *POEMUD_EXTRADATA;
  66. typedef struct {
  67. DWORD fGeneral;
  68. int iEscapement;
  69. short sHeightDiv;
  70. short iDevCharOffset;
  71. BYTE iPaperSource;
  72. BYTE iDuplex;
  73. BYTE iTonerSave;
  74. BYTE iOrientation;
  75. BYTE iResolution;
  76. BYTE iColor;
  77. BYTE iSmoothing;
  78. BYTE iJamRecovery;
  79. BYTE iMediaType;
  80. BYTE iUnitFactor; // factor of master unit
  81. BYTE iDithering;
  82. BYTE iColorMatching;
  83. BYTE iBitFont;
  84. BYTE iCmyBlack;
  85. BYTE iTone;
  86. BYTE iPaperSize;
  87. BYTE iCompress;
  88. WORD Printer;
  89. DEVCOL Col;
  90. WORD wRectWidth, wRectHeight;
  91. #define UNKNOWN_DLFONT_ID (~0)
  92. DWORD dwDLFontID; // device's current font ID
  93. DWORD dwDLSelectFontID; // "SelectFont" font ID
  94. DWORD dwDLSetFontID; // "SetFont" font ID
  95. WORD wCharCode;
  96. } MYPDEV, *PMYPDEV;
  97. // Flags for fGeneral
  98. #define FG_DBCS 0x00000001
  99. #define FG_VERT 0x00000002
  100. #define FG_PROP 0x00000004
  101. #define FG_DOUBLE 0x00000008
  102. #define FG_NULL_PEN 0x00000010
  103. #define FG_BOLD 0x00000020
  104. #define FG_ITALIC 0x00000040
  105. extern BOOL BInitOEMExtraData(POEMUD_EXTRADATA pOEMExtra);
  106. extern BMergeOEMExtraData(POEMUD_EXTRADATA pdmIn, POEMUD_EXTRADATA pdmOut);
  107. #endif // _PDEV_H
  108. // End of File
  109.