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.

108 lines
3.0 KiB

  1. /*++
  2. Copyright (c) 1997-1999 Microsoft Corporation
  3. --*/
  4. #ifndef _PDEV_H
  5. #define _PDEV_H
  6. #include <minidrv.h>
  7. #include <stdio.h>
  8. #include <prcomoem.h>
  9. #include <strsafe.h>
  10. #define VALID_PDEVOBJ(pdevobj) \
  11. ((pdevobj) && (pdevobj)->dwSize >= sizeof(DEVOBJ) && \
  12. (pdevobj)->hEngine && (pdevobj)->hPrinter && \
  13. (pdevobj)->pPublicDM && (pdevobj)->pDrvProcs )
  14. #define ASSERT_VALID_PDEVOBJ(pdevobj) ASSERT(VALID_PDEVOBJ(pdevobj))
  15. #define ERRORTEXT(s) "ERROR " DLLTEXT(s)
  16. //
  17. // OEM Signature and version.
  18. //
  19. #define OEM_SIGNATURE 'PAGS'
  20. #define DLLTEXT(s) "PAGS: " s
  21. #define OEM_VERSION 0x00010000L
  22. #define CCHMAXCMDLEN 128
  23. // Though the data GDI sends to CBFilerGraphics
  24. // is only one line, we allocate maximum image data
  25. // length ESX86 command can handle.
  26. // 0x7fff - 18 = 0x7fed bytes
  27. #define MAXIMGSIZE (0x7fff - 18)
  28. // Use for whether it calls OEMFilterGraphics
  29. #define GRXFILTER_ON 1
  30. #define CURSOR_Y_ABS_MOVE 2
  31. #define CURSOR_Y_REL_DOWN 3
  32. #define CURSOR_X_ABS_MOVE 4
  33. #define CURSOR_X_REL_RIGHT 5
  34. // It's only NetworkPrinter12/17/24 using these definitions
  35. #define CMD_SELECT_RES_300 10
  36. #define CMD_SELECT_RES_600 11
  37. // #278517: Support RectFill
  38. #define CMD_SELECT_RES_240 12
  39. #define CMD_SELECT_RES_360 13
  40. #define CMD_SEND_BLOCKDATA 20
  41. // #278517: RectFill
  42. #define CMD_RECT_WIDTH 30
  43. #define CMD_RECT_HEIGHT 31
  44. #define CMD_RECT_BLACK 32
  45. #define CMD_RECT_WHITE 33
  46. #define CMD_RECT_GRAY 34 // Not used
  47. #define CMD_RECT_BLACK_2 35
  48. #define CMD_RECT_WHITE_2 36
  49. #define CMD_RECT_GRAY_2 37
  50. #define BVERTFONT(p) \
  51. ((p)->ulFontID == 6 || (p)->ulFontID == 8)
  52. ////////////////////////////////////////////////////////
  53. // OEM UD Type Defines
  54. ////////////////////////////////////////////////////////
  55. typedef struct tag_OEM_EXTRADATA {
  56. OEM_DMEXTRAHEADER dmExtraHdr;
  57. // Private extention
  58. BOOL fCallback;
  59. // Using build ESX86 command
  60. WORD wCurrentRes;
  61. LONG lWidthBytes;
  62. LONG lHeightPixels;
  63. #ifdef FONTPOS
  64. // UNIDRV send incorrect Y position when set UPPERLEFT
  65. // We should adjust manually.
  66. WORD wFontHeight; // DevFont height
  67. WORD wYPos; // DevFont Y position
  68. #endif //FONTPOS
  69. // #278517: RectFill
  70. WORD wRectWidth; // Width of Rectangle
  71. WORD wRectHeight; // Height of Rectangle
  72. WORD wUnit; // Resolution in MasterUnit
  73. } OEM_EXTRADATA, *POEM_EXTRADATA;
  74. // NTRAID#NTBUG9-581704-2002/03/19-v-sueyas-: Error handling
  75. // New interface functions with Unidrv callbacks.
  76. #ifdef __cplusplus
  77. extern "C" {
  78. #endif
  79. BOOL APIENTRY bOEMSendFontCmd(PDEVOBJ pdevobj, PUNIFONTOBJ pUFObj, PFINVOCATION pFInv);
  80. BOOL APIENTRY bOEMOutputCharStr(PDEVOBJ pdevobj, PUNIFONTOBJ pUFObj, DWORD dwType, DWORD dwCount, PVOID pGlyph);
  81. #ifdef __cplusplus
  82. }
  83. #endif
  84. #endif // _PDEV_H