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.

171 lines
4.4 KiB

  1. /*++
  2. Copyright (c) 1995 Microsoft Corporation
  3. Module Name:
  4. faxdrv.h
  5. Abstract:
  6. Fax driver graphics DLL header file
  7. [Environment:]
  8. Fax driver, kernel mode
  9. Revision History:
  10. 01/09/96 -davidx-
  11. Created it.
  12. 20/10/99 -danl-
  13. Organize DEVDATA for 95 use.
  14. dd/mm/yy -author-
  15. description
  16. --*/
  17. #ifndef _FAXDRV_H_
  18. #define _FAXDRV_H_
  19. #include "faxlib.h"
  20. //
  21. // Data structure maintained by the fax driver graphics DLL
  22. //
  23. typedef struct {
  24. PVOID startDevData; // data structure signature
  25. HANDLE hPrinter; // handle to printer
  26. #ifdef USERMODE_DRIVER
  27. HANDLE hPreviewFile; // handle to print preview mapping file
  28. #endif
  29. HANDLE hPreviewMapping;// handle to print preview mapping object
  30. PMAP_TIFF_PAGE_HEADER pTiffPageHeader; // points to the header of the mapping file
  31. LPBYTE pbTiffPageFP; // The mapping virutal 'File Pointer'.
  32. BOOL bPrintPreview; // Indicates print preview is requested
  33. DRVDEVMODE dm; // devmode information
  34. INT pageCount; // number of pages printed
  35. LONG lineOffset; // bitmap scanline byte offset
  36. DWORD flags; // flag bits
  37. SIZEL imageSize; // image size measured in pixels
  38. #ifndef WIN__95
  39. HDEV hdev; // handle to GDI device
  40. HANDLE hpal; // handle to default palette
  41. SIZEL paperSize; // paper size measured in pixels
  42. RECTL imageArea; // imageable area measured in pixels
  43. LONG xres, yres; // x- and y-resolution
  44. HSURF hbitmap; // handle to bitmap surface
  45. DWORD jobId; // job ID
  46. #endif //WIN__95
  47. DWORD fileOffset; // output byte count for current document
  48. PBYTE pCompBits; // buffer to hold G4 compressed bitmap data
  49. PBYTE pCompBufPtr; // pointer to next free byte in the buffer
  50. PBYTE pCompBufMark; // high-water mark
  51. DWORD compBufSize; // size of compressed bitmap data buffer
  52. DWORD compBufInc; // increment to enlarge the buffer when necessary
  53. PBYTE prefline; // raster data for the reference line
  54. INT bitcnt; // these two fields are used for assembling variable-length
  55. DWORD bitdata; // compressed bits into byte stream
  56. PVOID pFaxIFD; // IFD entries for each page
  57. PVOID endDevData; // data structure signature
  58. } DEVDATA, *PDEVDATA;
  59. //
  60. // Constants for DEVDATA.flags field
  61. //
  62. #define PDEV_CANCELLED 0x0001 // current job has been cancelled
  63. #define PDEV_RESETPDEV 0x0002 // DrvResetPDEV has been called
  64. #define PDEV_WITHINPAGE 0x0004 // drawing on a page
  65. //
  66. // Check if a DEVDATA structure is valid
  67. //
  68. #define ValidDevData(pdev) \
  69. ((pdev) && (pdev)->startDevData == (pdev) && (pdev)->endDevData == (pdev))
  70. //
  71. // Color values and indices
  72. //
  73. #define RGB_BLACK RGB(0, 0, 0)
  74. #define RGB_WHITE RGB(255, 255, 255)
  75. #define BLACK_INDEX 0
  76. #define WHITE_INDEX 1
  77. //
  78. // Number of bits consisting a BYTE and a DWORD
  79. //
  80. #define BYTEBITS 8
  81. #define DWORDBITS (sizeof(DWORD) * BYTEBITS)
  82. //
  83. // Pad bit scanline data to N-byte boundary
  84. //
  85. #define PadBitsToBytes(bits, N) \
  86. ((((bits) + ((N) * BYTEBITS - 1)) / ((N) * BYTEBITS)) * (N))
  87. //
  88. // Macros for manipulating ROP4s and ROP3s
  89. //
  90. #define GetForegroundRop3(rop4) ((rop4) & 0xFF)
  91. #define GetBackgroundRop3(rop4) (((rop4) >> 8) & 0xFF)
  92. #define Rop3NeedPattern(rop3) (((rop3 >> 4) & 0x0F) != (rop3 & 0x0F))
  93. #define Rop3NeedSource(rop3) (((rop3 >> 2) & 0x33) != (rop3 & 0x33))
  94. #define Rop3NeedDest(rop3) (((rop3 >> 1) & 0x55) != (rop3 & 0x55))
  95. //
  96. // Determine whether the page is in landscape mode
  97. //
  98. #define IsLandscapeMode(pdev) ((pdev)->dm.dmPublic.dmOrientation == DMORIENT_LANDSCAPE)
  99. //
  100. // Returns the length of the hypotenouse of a right triangle
  101. //
  102. LONG
  103. CalcHypot(
  104. LONG x,
  105. LONG y
  106. );
  107. //
  108. // Output a completed page bitmap to the spooler
  109. //
  110. BOOL
  111. OutputPageBitmap(
  112. PDEVDATA pdev,
  113. PBYTE pBitmapData
  114. );
  115. //
  116. // Output document trailer information to the spooler
  117. //
  118. BOOL
  119. OutputDocTrailer(
  120. PDEVDATA pdev
  121. );
  122. #endif // !_FAXDRV_H_