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.

135 lines
3.8 KiB

  1. /*++
  2. Copyright (c) 1997-1999 Microsoft Corporation
  3. --*/
  4. #ifndef _PDEV_H
  5. #define _PDEV_H
  6. // NTRAID#NTBUG9-552017-2002/03/12-yasuho-: Use strsafe.h/PREFAST/buffy
  7. // NTRAID#NTBUG9-572151-2002/03/12-yasuho-: Possible buffer overrun.
  8. #include <minidrv.h>
  9. #include <stdio.h>
  10. #include <prcomoem.h>
  11. #include <strsafe.h>
  12. #define VALID_PDEVOBJ(pdevobj) \
  13. ((pdevobj) && (pdevobj)->dwSize >= sizeof(DEVOBJ) && \
  14. (pdevobj)->hEngine && (pdevobj)->hPrinter && \
  15. (pdevobj)->pPublicDM && (pdevobj)->pDrvProcs )
  16. #define ASSERT_VALID_PDEVOBJ(pdevobj) ASSERT(VALID_PDEVOBJ(pdevobj))
  17. #define ERRORTEXT(s) "ERROR " DLLTEXT(s)
  18. //
  19. // OEM Signature and version.
  20. //
  21. #define OEM_SIGNATURE 'FXAT' // LG GDI x00 series dll
  22. #define DLLTEXT(s) "FXAT: " s
  23. #define OEM_VERSION 0x00010000L
  24. ////////////////////////////////////////////////////////
  25. // OEM UD Type Defines
  26. ////////////////////////////////////////////////////////
  27. #define STRBUFSIZE 1024 // Must be power of 2.
  28. #define MAX_FONTS 25 // Also see the gFonts[] in fxartres.c.
  29. typedef struct tag_OEM_EXTRADATA {
  30. OEM_DMEXTRAHEADER dmExtraHdr;
  31. } OEM_EXTRADATA, *POEM_EXTRADATA;
  32. // NTRAID#NTBUG9-493148-2002/03/12-yasuho-:
  33. // Stress break: PDEV resetting via OEMDevMode().
  34. typedef struct tag_FXPDEV {
  35. // Private extention
  36. POINTL ptlOrg;
  37. POINTL ptlCur;
  38. SIZEL sizlRes;
  39. SIZEL sizlUnit;
  40. WORD iCopies;
  41. CHAR *chOrient;
  42. CHAR *chSize;
  43. BOOL bString;
  44. WORD cFontId;
  45. WORD iFontId;
  46. WORD iFontHeight;
  47. WORD iFontWidth;
  48. WORD iFontWidth2;
  49. LONG aFontId[MAX_FONTS];
  50. POINTL ptlTextCur;
  51. WORD iTextFontId;
  52. WORD iTextFontHeight;
  53. WORD iTextFontWidth;
  54. WORD iTextFontWidth2;
  55. WORD cTextBuf;
  56. BYTE ajTextBuf[STRBUFSIZE];
  57. WORD fFontSim;
  58. BOOL fSort;
  59. BOOL fCallback; //Is OEMFilterGraphics called?
  60. BOOL fPositionReset;
  61. WORD iCurFontId; // id of font currently selected
  62. // NTRAID#NTBUG9-365649-2002/03/12-yasuho-: Invalid font size
  63. WORD iCurFontHeight;
  64. WORD iCurFontWidth;
  65. // For internal calculation of X-pos.
  66. LONG widBuf[STRBUFSIZE];
  67. LONG lInternalXAdd;
  68. WORD wSBCSFontWidth;
  69. // For TIFF compression in fxartres
  70. DWORD dwTiffCompressBufSize;
  71. PBYTE pTiffCompressBuf;
  72. // NTRAID#NTBUG9-208433-2002/03/12-yasuho-:
  73. // Output images are broken on ART2/3 models.
  74. BOOL bART3; // ART2/3 models can't support the TIFF compression.
  75. } FXPDEV, *PFXPDEV;
  76. // For TIFF compression in fxartres
  77. #define TIFFCOMPRESSBUFSIZE 2048 // It may be resize if needed more buffer dynamically.
  78. #define TIFF_MIN_RUN 4 // Minimum repeats before use RLE
  79. #define TIFF_MAX_RUN 128 // Maximum repeats
  80. #define TIFF_MAX_LITERAL 128 // Maximum consecutive literal data
  81. #define NEEDSIZE4TIFF(s) ((s)+(((s)+127) >> 7)) // Buffer for TIFF compression requires a byte
  82. // per 128 bytes in the worst case.
  83. // Device font height and font width values calculated
  84. // form the IFIMETRICS field values. Must be the same way
  85. // what Unidrv is doing to calculate stdandard variables.
  86. // (Please check.)
  87. #define FH_IFI(p) ((p)->fwdUnitsPerEm)
  88. #define FW_IFI(p) ((p)->fwdAveCharWidth)
  89. // New interface functions with Unidrv callbacks.
  90. #ifdef __cplusplus
  91. extern "C" {
  92. #endif
  93. BOOL APIENTRY
  94. bOEMSendFontCmd(
  95. PDEVOBJ pdevobj,
  96. PUNIFONTOBJ pUFObj,
  97. PFINVOCATION pFInv
  98. );
  99. BOOL APIENTRY
  100. bOEMOutputCharStr(
  101. PDEVOBJ pdevobj,
  102. PUNIFONTOBJ pUFObj,
  103. DWORD dwType,
  104. DWORD dwCount,
  105. PVOID pGlyph
  106. );
  107. #ifdef __cplusplus
  108. }
  109. #endif
  110. #endif // _PDEV_H