Source code of Windows XP (NT5)
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.

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