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.

235 lines
6.9 KiB

  1. #ifndef _PDEV_H
  2. #define _PDEV_H
  3. // NTRAID#NTBUG9-553889-2002/03/13-yasuho-: strsafe.h/PREFAST/buffy
  4. //
  5. // Files necessary for OEM plug-in.
  6. //
  7. #include <minidrv.h>
  8. #include <stdio.h>
  9. #include <prcomoem.h>
  10. #include <strsafe.h>
  11. #define OEM_DRIVER_VERSION 0x0500
  12. ////////////////////////////////////////////////////////
  13. // OEM UD Defines
  14. ////////////////////////////////////////////////////////
  15. #define VALID_PDEVOBJ(pdevobj) \
  16. ((pdevobj) && (pdevobj)->dwSize >= sizeof(DEVOBJ) && \
  17. (pdevobj)->hEngine && (pdevobj)->hPrinter && \
  18. (pdevobj)->pPublicDM && (pdevobj)->pDrvProcs )
  19. //
  20. // ASSERT_VALID_PDEVOBJ can be used to verify the passed in "pdevobj". However,
  21. // it does NOT check "pdevOEM" and "pOEMDM" fields since not all OEM DLL's create
  22. // their own pdevice structure or need their own private devmode. If a particular
  23. // OEM DLL does need them, additional checks should be added. For example, if
  24. // an OEM DLL needs a private pdevice structure, then it should use
  25. // ASSERT(VALID_PDEVOBJ(pdevobj) && pdevobj->pdevOEM && ...)
  26. //
  27. #define ASSERT_VALID_PDEVOBJ(pdevobj) ASSERT(VALID_PDEVOBJ(pdevobj))
  28. // Debug text.
  29. #define ERRORTEXT(s) "ERROR " DLLTEXT(s)
  30. ////////////////////////////////////////////////////////
  31. // OEM UD Prototypes
  32. ////////////////////////////////////////////////////////
  33. //
  34. // OEM Signature and version.
  35. //
  36. #define OEM_SIGNATURE 'FMPR' // FMPR printers
  37. #define DLLTEXT(s) "FMPR: " s
  38. #define OEM_VERSION 0x00010000L
  39. //------------------------------------------------------ FMPR private devmode
  40. typedef struct tag_OEMUD_EXTRADATA {
  41. OEM_DMEXTRAHEADER dmExtraHdr;
  42. } OEMUD_EXTRADATA, *POEMUD_EXTRADATA;
  43. typedef struct {
  44. WORD wPaperSource; // The current paper source
  45. BOOL bFirstPage; // This is TRUE when First Page is Printing.
  46. BYTE jColor; // Current text color
  47. BYTE jOldColor; // Last ribbon color
  48. } DEVICE_DATA;
  49. //--------------------------------------------------------- command structure
  50. typedef struct esccmd{
  51. WORD cbSize;
  52. PBYTE pEscStr;
  53. } ESCCMD, FAR * PESCCMD;
  54. #define LOCENTRY near pascal
  55. //------------------------- Command callback id#s. for fmlbp GPC and PFM data
  56. //------------------------- 1-255
  57. #define CMDID_BEGINPAGE 1 // Entered in PAGECONTROL.PC_OCD_BEGINDOC as %1
  58. #define CMDID_ENDPAGE 2
  59. #define CMDID_BEGINDOC 3
  60. #define CMDID_ENDDOC 4
  61. #define CMDID_MIN24L 10
  62. #define CMDID_MIN48H 11
  63. #define CMDID_GOT48H 12
  64. #define CMDID_MIN24LV 13
  65. #define CMDID_U_MIN24LV 14
  66. #define CMDID_MIN48HV 15
  67. #define CMDID_U_MIN48HV 16
  68. #define CMDID_GOT48HV 17
  69. #define CMDID_U_GOT48HV 18
  70. #define CMDID_MAN180 20
  71. #define CMDID_TRA180 21
  72. #define CMDID_180BIN1 22
  73. #define CMDID_180BIN2 23
  74. #define CMDID_MAN360 24
  75. #define CMDID_360BIN1 25
  76. #define CMDID_360BIN2 26
  77. #define CMDID_FI_TRACTOR 27
  78. #define CMDID_FI_FRONT 28
  79. #define CMDID_SUIHEI_BIN1 29
  80. #define CMDID_TAMOKUTEKI_BIN1 30
  81. #define CMDID_SELECT_BLACK_COLOR 40
  82. #define CMDID_SELECT_BLUE_COLOR 41
  83. #define CMDID_SELECT_CYAN_COLOR 42
  84. #define CMDID_SELECT_GREEN_COLOR 43
  85. #define CMDID_SELECT_MAGENTA_COLOR 44
  86. #define CMDID_SELECT_RED_COLOR 45
  87. #define CMDID_SELECT_WHITE_COLOR 46
  88. #define CMDID_SELECT_YELLOW_COLOR 47
  89. #define CMDID_SEND_BLACK_COLOR 50
  90. #define CMDID_SEND_CYAN_COLOR 51
  91. #define CMDID_SEND_MAGENTA_COLOR 52
  92. #define CMDID_SEND_YELLOW_COLOR 53
  93. typedef unsigned short USHORT;
  94. typedef WCHAR * PWSZ; // pwsz, 0x0000 terminated UNICODE strings only
  95. #ifdef _FUPRJRES_C
  96. #define ESCCMDDEF(n,s) ESCCMD n = {sizeof(s)-1, s};
  97. #else // _FUPRJRES_C
  98. #define ESCCMDDEF(n,s) extern ESCCMD n;
  99. #endif // _FUPRJRES_C
  100. //------------------------------------------------- Paper Feed & Output Command
  101. ESCCMDDEF(ecCSFBPAGE, "\x1BQ0 [")
  102. ESCCMDDEF(ecCSFEPAGE, "\x1BQ1 [")
  103. ESCCMDDEF(ecTRCTBPAGE, "\x1BQ22 B")
  104. ESCCMDDEF(ecManual2P, "\x0C")
  105. //--------------------------------------------------------- Char Select Command
  106. ESCCMDDEF(ecDBCS, "\x1B$B")
  107. ESCCMDDEF(ecSBCS, "\x1B(H")
  108. ESCCMDDEF(ecVWF, "\x1CJ\x1BQ1 q")
  109. ESCCMDDEF(ecHWF, "\x1CK")
  110. //--------------------------------------------------------- mode change command
  111. ESCCMDDEF(ecESCP2FM, "\x1B/\xB2@\x7F")
  112. ESCCMDDEF(ecFM2ESCP, "\x1B\x7F\x00\x00\x01\x05")
  113. ESCCMDDEF(ecFMEnddoc, "\x0D\x1B\x63")
  114. //---------------------------------------------- font select & unselect command
  115. ESCCMDDEF(ec24Min, "\x1C(a")
  116. ESCCMDDEF(ec48Min, "\x1C(ap")
  117. ESCCMDDEF(ec48Got, "\x1C(aq")
  118. ESCCMDDEF(ec26Pitch, "\x1C$\x22v")
  119. ESCCMDDEF(ec52Pitch, "\x1C$%r")
  120. ESCCMDDEF(ecHankaku, "\x1BQ1\x20|")
  121. ESCCMDDEF(ecTate1, "\x1CJ")
  122. ESCCMDDEF(ecTate2, "\x1BQ1\x20q")
  123. ESCCMDDEF(ecYoko, "\x1CK")
  124. //---------------------------------------------- Paper Source Selection Command
  125. ESCCMDDEF(ecSelectBIN1, "\x1BQ20\x20[")
  126. ESCCMDDEF(ecSelectBIN2, "\x1BQ21\x20[")
  127. ESCCMDDEF(ecSelectFTRCT, "\x1BQ10\x20\\")
  128. ESCCMDDEF(ecSelectFFRNT, "\x1BQ11\x20\\")
  129. //------ This NUMBER have to be changed when GPC file (or FMPR.RC) is modified.
  130. #define DMBIN_180BIN1 269
  131. #define DMBIN_180BIN2 270
  132. #define DMBIN_360BIN1 271
  133. #define DMBIN_360BIN2 272
  134. #define DMBIN_FI_TRACTOR 273 // Tractor (FI2 FMPR-359F1)
  135. #define DMBIN_FI_FRONT 274 // Front inserter (FI2 FMPR-359F1)
  136. #define DMBIN_SUIHEI_BIN1 275 // Suihei printer BIN1 (FMPR601)
  137. #define DMBIN_TAMOKUTEKI_BIN1 276 // Tamokuteki printer BIN1 (FMPR671, 654)
  138. // NTRAID#NTBUG9-588420-2002/04/09-yasuho-: Device "Mincho" can not print out.
  139. #define TEXT_COLOR_UNKNOWN 0
  140. #define TEXT_COLOR_YELLOW 1
  141. #define TEXT_COLOR_MAGENTA 2
  142. #define TEXT_COLOR_RED (TEXT_COLOR_YELLOW|TEXT_COLOR_MAGENTA)
  143. #define TEXT_COLOR_CYAN 4
  144. #define TEXT_COLOR_GREEN (TEXT_COLOR_YELLOW|TEXT_COLOR_CYAN)
  145. #define TEXT_COLOR_BLUE (TEXT_COLOR_MAGENTA|TEXT_COLOR_CYAN)
  146. #define TEXT_COLOR_BLACK 8
  147. #define TEXT_COLOR_BANDW (0xFF) // for monochrome case
  148. VOID
  149. SetRibbonColor(
  150. PDEVOBJ pdevobj,
  151. BYTE jColor);
  152. //
  153. // Minidriver device data block which we maintain.
  154. // Its address is saved in the DEVOBJ.pdevOEM of
  155. // OEM customiztion I/F.
  156. //
  157. typedef struct {
  158. VOID *pData; // Minidriver private data.
  159. VOID *pIntf; // a.k.a. pOEMHelp
  160. } MINIDEV;
  161. //
  162. // Easy access to the OEM data and the printer
  163. // driver helper functions.
  164. //
  165. #ifdef __cplusplus
  166. extern "C" {
  167. #endif // __cplusplus
  168. extern
  169. HRESULT
  170. XXXDrvWriteSpoolBuf(
  171. VOID *pIntf,
  172. PDEVOBJ pDevobj,
  173. PVOID pBuffer,
  174. DWORD cbSize,
  175. DWORD *pdwResult);
  176. #ifdef __cplusplus
  177. }
  178. #endif // __cplusplus
  179. #define MINIDEV_DATA(p) \
  180. (((MINIDEV *)(p)->pdevOEM)->pData)
  181. #define MINIDEV_INTF(p) \
  182. (((MINIDEV *)(p)->pdevOEM)->pIntf)
  183. #define WRITESPOOLBUF(p, b, n, r) \
  184. XXXDrvWriteSpoolBuf(MINIDEV_INTF(p), (p), (b), (n), (r))
  185. #ifdef __cplusplus
  186. extern "C" {
  187. #endif // __cplusplus
  188. BOOL myOEMOutputCharStr( PDEVOBJ pdevobj,PUNIFONTOBJ pUFObj,DWORD dwType,DWORD dwCount,PVOID pGlyph );
  189. #ifdef __cplusplus
  190. }
  191. #endif // __cplusplus
  192. #endif // _PDEV_H