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.

200 lines
6.2 KiB

  1. /*++
  2. Copyright (c) 1997-1999 Microsoft Corporation
  3. --*/
  4. //----------------------------------------------------------------------------
  5. // Filename: pdev.h
  6. // This file contains definitions for KPDL mini-driver
  7. //-----------------------------------------------------------------------------
  8. #ifndef _PDEV_H
  9. #define _PDEV_H
  10. #include <minidrv.h>
  11. #include <stdio.h>
  12. #include <prcomoem.h>
  13. #include <strsafe.h>
  14. #define VALID_PDEVOBJ(pdevobj) \
  15. ((pdevobj) && (pdevobj)->dwSize >= sizeof(DEVOBJ) && \
  16. (pdevobj)->hEngine && (pdevobj)->hPrinter && \
  17. (pdevobj)->pPublicDM && (pdevobj)->pDrvProcs )
  18. #define ASSERT_VALID_PDEVOBJ(pdevobj) ASSERT(VALID_PDEVOBJ(pdevobj))
  19. // Debug text.
  20. #define ERRORTEXT(s) "ERROR " DLLTEXT(s)
  21. //
  22. // OEM Signature and version.
  23. //
  24. #define OEM_SIGNATURE 'KPDL'
  25. #define DLLTEXT(s) "KPDL: " s
  26. #define OEM_VERSION 0x00010000L
  27. // kpdlres mini driver device data structure
  28. typedef struct
  29. {
  30. WORD wRes; // resolution 600 or 400 or 240
  31. WORD wCopies; // number of multi copies
  32. short sSBCSX;
  33. short sDBCSX;
  34. short sSBCSXMove; // use to set address mode
  35. short sSBCSYMove; // use to set address mode
  36. short sDBCSXMove; // use to set address mode
  37. short sDBCSYMove; // use to set address mode
  38. short sEscapement; // use to set address mode
  39. BOOL fVertFont; // for TATEGAKI font
  40. WORD wOldFontID;
  41. BOOL fPlus;
  42. WORD wScale;
  43. LONG lPointsx;
  44. LONG lPointsy;
  45. int CursorX;
  46. int CursorY;
  47. // Used for rect-fill operations.
  48. DWORD dwRectX;
  49. DWORD dwRectY;
  50. // Temp. buffer parameters.
  51. DWORD dwBlockX, dwBlockY, dwBlockLen;
  52. PBYTE pTempBuf;
  53. DWORD dwTempBufLen;
  54. DWORD dwTempDataLen;
  55. // Absolute address mode setting.
  56. #define ADDR_MODE_NONE 0
  57. #define ADDR_MODE_SBCS 1
  58. #define ADDR_MODE_DBCS 2
  59. BYTE jAddrMode;
  60. // Color mode values. Sam values also used
  61. // for the command callback IDs.
  62. #define COLOR_24BPP_2 120
  63. #define COLOR_24BPP_4 121
  64. #define COLOR_24BPP_8 122
  65. #define COLOR_3PLANE 123
  66. #define MONOCHROME 124
  67. BYTE jColorMode;
  68. // #308001: Garbage appear on device font
  69. #define PLANE_CYAN 1
  70. #define PLANE_MAGENTA 2
  71. #define PLANE_YELLOW 3
  72. BYTE jCurrentPlane;
  73. // removed #if 0 dead code
  74. } MYDATA, *PMYDATA;
  75. #define MINIDEV_DATA(p) \
  76. ((p)->pdevOEM)
  77. #define IsColorPlanar(p) \
  78. ((MONOCHROME == (p)->jColorMode) \
  79. || (COLOR_3PLANE == (p)->jColorMode))
  80. #define IsColorTrueColor(p) \
  81. (!IsColorPlanar(p))
  82. // removed #if 0 dead code
  83. #define ColorOutDepth(p) \
  84. (((p)->jColorMode == COLOR_24BPP_2)?1:\
  85. (((p)->jColorMode == COLOR_24BPP_4)?2:\
  86. (((p)->jColorMode == COLOR_24BPP_8)?3:1)))
  87. typedef struct
  88. {
  89. OEM_DMEXTRAHEADER dmExtraHdr;
  90. } OEMUD_EXTRADATA, *POEMUD_EXTRADATA;
  91. // NPDL2 command
  92. #define ESC_RESET "\033c1" // software reset
  93. #define ESC_KANJIYOKO "\033K" // kanji yoko mode
  94. #define ESC_KANJITATE "\033t" // kanji yoko mode
  95. #define FS_PAGEMODE "\034d240.", 6 // page mode
  96. #define FS_DRAWMODE "\034\"R.", 4 // draw mode
  97. #define FS_ADDRMODE_ON "\034a%d,%d,0,B." // set address mode
  98. #define FS_GRPMODE_ON "\034Y", 2 // set graphic mode
  99. #define FS_GRPMODE_OFF "\034Z", 2 // reset graphic mode
  100. #define FS_SETMENUNIT "\034<1/%d,i." // select men-mode resolution
  101. #define FS_JIS78 "\03405F2-00", 8 // select JIS78
  102. #define FS_JIS90 "\03405F2-02" // select JIS90
  103. #define FS_ENDPAGE "\034R\034x%d.\015\014" // end page
  104. #define FS_E "\034e%d,%d."
  105. #define FS_RESO "\034&%d."
  106. #define FS_RESO0_RESET "\034&0.\033c1"
  107. #define INIT_DOC "\034<1/%d,i.\034YSU1,%d,0;\034Z"
  108. #define RESO_PAGE_KANJI "\034&%d.\034d240.\033K"
  109. #define FS_I "\034R\034i%d,%d,0,1/1,1/1,%d,%d."
  110. #define FS_I_2 "\034R\034i%d,%d,5,1/1,1/1,%d,%d."
  111. #define FS_I_D "%d,%d."
  112. #define FS_M_Y "\034m1/1,%s."
  113. #define FS_M_T "\034m%s,1/1."
  114. #define FS_12S2 "\03412S2-%04ld-%04ld"
  115. // Command CallBack ID
  116. #define CALLBACK_ID_MAX 255 //
  117. // PAGECONTROL
  118. #define PC_MULT_COPIES_N 1
  119. #define PC_MULT_COPIES_C 2
  120. #define PC_TYPE_F 4
  121. #define PC_END_F 6
  122. #define PC_ENDPAGE 7
  123. #define PC_PRN_DIRECTION 9
  124. // FONTSIMULATION
  125. #define FS_SINGLE_BYTE 20
  126. #define FS_DOUBLE_BYTE 21
  127. // RESOLUTION
  128. #define RES_240 30
  129. #define RES_400 31
  130. #define RES_300 35
  131. #define RES_SENDBLOCK 36
  132. //CURSORMOVE
  133. #define CM_X_ABS 101
  134. #define CM_Y_ABS 102
  135. #define CM_CR 103
  136. #define CM_FF 104
  137. #define CM_LF 105
  138. #define CMD_RECT_WIDTH 130
  139. #define CMD_RECT_HEIGHT 131
  140. #define CMD_WHITE_FILL 132
  141. #define CMD_GRAY_FILL 133
  142. #define CMD_BLACK_FILL 134
  143. // #308001: Garbage appear on device font
  144. #define CMD_SENDCYAN 141
  145. #define CMD_SENDMAGENTA 142
  146. #define CMD_SENDYELLOW 143
  147. extern BOOL BInitOEMExtraData(POEMUD_EXTRADATA pOEMExtra);
  148. extern BMergeOEMExtraData(POEMUD_EXTRADATA pdmIn, POEMUD_EXTRADATA pdmOut);
  149. WORD Ltn1ToAnk( WORD );
  150. static int iDwtoA_FillZero(PBYTE, long, int );
  151. #ifdef __cplusplus
  152. extern "C" {
  153. #endif
  154. BOOL myOEMSendFontCmd( PDEVOBJ pdevobj,PUNIFONTOBJ pUFObj,PFINVOCATION pFInv );
  155. BOOL myOEMOutputCharStr( PDEVOBJ pdevobj, PUNIFONTOBJ pUFObj, DWORD dwType, DWORD dwCount, PVOID pGlyph );
  156. #ifdef __cplusplus
  157. }
  158. #endif
  159. #endif //PDEV_H