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.

634 lines
27 KiB

  1. /******************************Module*Header*******************************\
  2. * Module Name: driver.h
  3. *
  4. * Contains prototypes for the display driver.
  5. *
  6. * Copyright (c) 1992-1995 Microsoft Corporation
  7. \**************************************************************************/
  8. //////////////////////////////////////////////////////////////////////
  9. // Put all the conditional-compile constants here. There had better
  10. // not be many!
  11. // Multi-board support can be enabled by setting this to 1:
  12. #define MULTI_BOARDS 0
  13. // This is the maximum number of boards we'll support in a single
  14. // virtual driver:
  15. #if MULTI_BOARDS
  16. #define MAX_BOARDS 16
  17. #define IBOARD(ppdev) ((ppdev)->iBoard)
  18. #else
  19. #define MAX_BOARDS 1
  20. #define IBOARD(ppdev) 0
  21. #endif
  22. // Useful for visualizing the 2-d heap:
  23. #define DEBUG_HEAP 0
  24. //////////////////////////////////////////////////////////////////////
  25. // Miscellaneous shared stuff
  26. #define DLL_NAME L"Weitekp9" // Name of the DLL in UNICODE
  27. #define STANDARD_DEBUG_PREFIX "Weitek: " // All debug output is prefixed
  28. // by this string
  29. #define ALLOC_TAG '9pwD' // Dwp9
  30. // Four byte tag (characters in
  31. // reverse order) used for memory
  32. // allocations
  33. #define CLIP_LIMIT 50 // We'll be taking 800 bytes of stack space
  34. #define DRIVER_EXTRA_SIZE 0 // Size of the DriverExtra information in the
  35. // DEVMODE structure
  36. #define TMP_BUFFER_SIZE 8192 // Size in bytes of 'pvTmpBuffer'. Has to
  37. // be at least enough to store an entire
  38. // scan line (i.e., 6400 for 1600x1200x32).
  39. #if defined(ALPHA)
  40. #define XFER_BUFFERS 16 // Defines the maximum number of write buffers
  41. // possible on any Alpha. Must be a power
  42. #else // of two.
  43. #define XFER_BUFFERS 1 // On non-alpha systems, we don't have to
  44. // worry about the chip caching our bus
  45. #endif // writes.
  46. #define XFER_MASK (XFER_BUFFERS - 1)
  47. typedef struct _CLIPENUM {
  48. LONG c;
  49. RECTL arcl[CLIP_LIMIT]; // Space for enumerating complex clipping
  50. } CLIPENUM; /* ce, pce */
  51. typedef struct _PDEV PDEV; // Handy forward declaration
  52. VOID vSetClipping(PDEV*, RECTL*);
  53. VOID vResetClipping(PDEV*);
  54. VOID vPutBits(PDEV*, SURFOBJ*, RECTL*, POINTL*);
  55. VOID vGetBits(PDEV*, SURFOBJ*, RECTL*, POINTL*);
  56. ////////////////////////////////////////////////////////////////////////
  57. // Status flags
  58. typedef enum {
  59. STAT_P9000 = 0x0001, // P9000 running (as opposed to a P9100)
  60. STAT_UNACCELERATED = 0x0002, // P9000 running at 16bpp or higher
  61. STAT_8BPP = 0x0004, // Running at 8bpp
  62. STAT_16BPP = 0x0008, // Running at 16bpp
  63. STAT_24BPP = 0x0010, // Running at 24bpp
  64. STAT_BRUSH_CACHE = 0x0020, // Brush cache successfully allocated
  65. STAT_CIRCLE_CACHE = 0x0040, // Circle cache successfully allocated
  66. } STATUS;
  67. // P9000() returns TRUE if running on a P9000:
  68. #define P9000(ppdev) (ppdev->flStat & STAT_P9000)
  69. //////////////////////////////////////////////////////////////////////
  70. // DriverSpecificAttributeFlags
  71. //
  72. // These flags must match those defined in p9.h for the weitekp9 miniport
  73. //
  74. #define CAPS_WEITEK_CHIPTYPE_IS_P9000 0x0001 // The video card has a p9000
  75. //////////////////////////////////////////////////////////////////////
  76. // Text stuff
  77. BOOL bEnableText(PDEV*);
  78. VOID vDisableText(PDEV*);
  79. VOID vAssertModeText(PDEV*, BOOL);
  80. //////////////////////////////////////////////////////////////////////
  81. // Brush stuff
  82. // 'Slow' brushes are used when we don't have hardware pattern capability,
  83. // and we have to handle patterns using screen-to-screen blts:
  84. #define SLOW_BRUSH_CACHE_DIM 3 // Controls the number of brushes cached
  85. // in off-screen memory, when we don't
  86. // have hardware pattern support.
  87. // We allocate 3 x 3 brushes, so we can
  88. // cache a total of 9 brushes:
  89. #define SLOW_BRUSH_COUNT (SLOW_BRUSH_CACHE_DIM * SLOW_BRUSH_CACHE_DIM)
  90. #define SLOW_BRUSH_DIMENSION 64 // After alignment is taken care of,
  91. // every off-screen brush cache entry
  92. // will be 64 pels in both dimensions
  93. #define SLOW_BRUSH_ALLOCATION (SLOW_BRUSH_DIMENSION + 8)
  94. // Actually allocate 72x72 pels for each
  95. // pattern, using the 8 extra for brush
  96. // alignment
  97. #define RBRUSH_2COLOR 1 // Monochrome brush
  98. #define RBRUSH_4COLOR 2 // 4-colour brush
  99. #define TOTAL_BRUSH_COUNT SLOW_BRUSH_COUNT
  100. // This is the maximum number of brushes
  101. // we can possibly have cached off-screen
  102. #define TOTAL_BRUSH_SIZE 64 // We'll only ever handle 8x8 patterns,
  103. // and this is the number of pels
  104. typedef struct _BRUSHENTRY BRUSHENTRY;
  105. // NOTE: Changes to the RBRUSH or BRUSHENTRY structures must be reflected
  106. // in strucs.inc!
  107. typedef struct _RBRUSH {
  108. FLONG fl; // Type flags
  109. ULONG ulColor[4]; // 0 -- background colour if 2-colour brush
  110. // 1 -- foreground colour if 2-colour brush
  111. // 2 -- 3rd colour if 4-colour brush
  112. // 3 -- 4th colour if 4-colour brush
  113. BRUSHENTRY* apbe[MAX_BOARDS];// Points to brush-entry that keeps track
  114. // of the cached off-screen brush bits
  115. ULONG aulPattern[1]; // Open-ended array for keeping copy of the
  116. // Don't put anything // actual pattern bits in case the brush
  117. // after here, or // origin changes, or someone else steals
  118. // you'll be sorry! // our brush entry (declared as a ULONG
  119. // for proper dword alignment)
  120. } RBRUSH; /* rb, prb */
  121. typedef struct _BRUSHENTRY {
  122. RBRUSH* prbVerify; // We never dereference this pointer to
  123. // find a brush realization; it is only
  124. // ever used in a compare to verify
  125. // that for a given realized brush, our
  126. // off-screen brush entry is still valid.
  127. LONG x; // x-position of cached pattern
  128. LONG y; // y-position of cached pattern
  129. } BRUSHENTRY; /* be, pbe */
  130. typedef union _RBRUSH_COLOR {
  131. RBRUSH* prb;
  132. ULONG iSolidColor;
  133. } RBRUSH_COLOR; /* rbc, prbc */
  134. #define CIRCLE_DIMENSION 32 // Maximum size of a cached circle
  135. #define CIRCLE_ALLOCATION_CX (CIRCLE_DIMENSION + 4)
  136. #define CIRCLE_ALLOCATION_CY (CIRCLE_DIMENSION)
  137. // Actually allocate 36x32 pels for each
  138. // circle, using the 4 extra for dword
  139. // alignment
  140. #define TOTAL_CIRCLE_COUNT 4 // Number of cached circles
  141. typedef struct _CIRCLEENTRY {
  142. LONG x; // x-position of off-screen circle allocation
  143. LONG y; // y-position of off-screen circle allocation
  144. LONG xCached; // x-position in allocation where circle starts
  145. LONG yCached; // y-position in allocation where circle starts
  146. RECTFX rcfxCircle; // Normalized bound-box of circle
  147. BOOL bStroke; // TRUE if stroked, FALSE if filled
  148. } CIRCLEENTRY;
  149. VOID vSlowPatRealize(PDEV*, RBRUSH*);
  150. BOOL bEnableBrushCache(PDEV*);
  151. VOID vDisableBrushCache(PDEV*);
  152. VOID vAssertModeBrushCache(PDEV*, BOOL);
  153. //////////////////////////////////////////////////////////////////////
  154. // Stretch stuff
  155. typedef struct _STR_BLT {
  156. PDEV* ppdev;
  157. PBYTE pjSrcScan;
  158. LONG lDeltaSrc;
  159. LONG XSrcStart;
  160. PBYTE pjDstScan;
  161. LONG lDeltaDst;
  162. LONG XDstStart;
  163. LONG XDstEnd;
  164. LONG YDstStart;
  165. LONG YDstCount;
  166. ULONG ulXDstToSrcIntCeil;
  167. ULONG ulXDstToSrcFracCeil;
  168. ULONG ulYDstToSrcIntCeil;
  169. ULONG ulYDstToSrcFracCeil;
  170. ULONG ulXFracAccumulator;
  171. ULONG ulYFracAccumulator;
  172. } STR_BLT;
  173. typedef VOID (*PFN_DIRSTRETCH)(STR_BLT*);
  174. VOID vDirectStretch8Narrow(STR_BLT*);
  175. VOID vDirectStretch8(STR_BLT*);
  176. VOID vDirectStretch16(STR_BLT*);
  177. VOID vDirectStretch32(STR_BLT*);
  178. //////////////////////////////////////////////////////////////////////
  179. // Dither stuff
  180. // Describes a single colour tetrahedron vertex for dithering:
  181. typedef struct _VERTEX_DATA {
  182. ULONG ulCount; // Number of pixels in this vertex
  183. ULONG ulVertex; // Vertex number
  184. } VERTEX_DATA; /* vd, pv */
  185. VERTEX_DATA* vComputeSubspaces(ULONG, VERTEX_DATA*);
  186. VOID vDitherColor(ULONG*, VERTEX_DATA*, VERTEX_DATA*, ULONG);
  187. VOID vRealize4ColorDither(RBRUSH*, ULONG);
  188. /////////////////////////////////////////////////////////////////////////
  189. // Heap stuff
  190. typedef enum {
  191. OFL_INUSE = 1, // The device bitmap is no longer located in
  192. // off-screen memory; it's been converted to
  193. // a DIB
  194. OFL_AVAILABLE = 2, // Space is in-use
  195. OFL_PERMANENT = 4 // Space is available
  196. } OHFLAGS; // Space is permanently allocated; never free it
  197. typedef struct _DSURF DSURF;
  198. typedef struct _OH OH;
  199. typedef struct _OH
  200. {
  201. OHFLAGS ofl; // OH_ flags
  202. LONG x; // x-coordinate of left edge of allocation
  203. LONG y; // y-coordinate of top edge of allocation
  204. LONG cx; // Width in pixels of allocation
  205. LONG cy; // Height in pixels of allocation
  206. OH* pohNext; // When OFL_AVAILABLE, points to the next free node,
  207. // in ascending cxcy value. This is kept as a
  208. // circular doubly-linked list with a sentinel
  209. // at the end.
  210. // When OFL_INUSE, points to the next most recently
  211. // blitted allocation. This is kept as a circular
  212. // doubly-linked list so that the list can be
  213. // quickly be updated on every blt.
  214. OH* pohPrev; // Opposite of 'pohNext'
  215. ULONG cxcy; // Width and height in a dword for searching
  216. OH* pohLeft; // Adjacent allocation when in-use or available
  217. OH* pohUp;
  218. OH* pohRight;
  219. OH* pohDown;
  220. DSURF* pdsurf; // Points to our DSURF structure
  221. VOID* pvScan0; // Points to start of first scan-line
  222. }; /* oh, poh */
  223. // This is the smallest structure used for memory allocations:
  224. typedef struct _OHALLOC OHALLOC;
  225. typedef struct _OHALLOC
  226. {
  227. OHALLOC* pohaNext;
  228. OH aoh[1];
  229. } OHALLOC; /* oha, poha */
  230. typedef struct _HEAP
  231. {
  232. LONG cxMax; // Largest possible free space by area
  233. LONG cyMax;
  234. OH ohAvailable; // Head of available list (pohNext points to
  235. // smallest available rectangle, pohPrev
  236. // points to largest available rectangle,
  237. // sorted by cxcy)
  238. OH ohDfb; // Head of the list of all DFBs currently in
  239. // offscreen memory that are eligible to be
  240. // tossed out of the heap (pohNext points to
  241. // the most recently blitted; pohPrev points
  242. // to least recently blitted)
  243. OH* pohFreeList; // List of OH node data structures available
  244. OHALLOC* pohaChain; // Chain of allocations
  245. } HEAP; /* heap, pheap */
  246. typedef enum {
  247. DT_SCREEN, // Surface is kept in screen memory
  248. DT_DIB // Surface is kept as a DIB
  249. } DSURFTYPE; /* dt, pdt */
  250. typedef struct _DSURF
  251. {
  252. DSURFTYPE dt; // DSURF status (whether off-screen or in a DIB)
  253. SIZEL sizl; // Size of the original bitmap (could be smaller
  254. // than poh->sizl)
  255. PDEV* ppdev; // Need this for deleting the bitmap
  256. union {
  257. OH* poh; // If DT_SCREEN, points to off-screen heap node
  258. SURFOBJ* pso; // If DT_DIB, points to locked GDI surface
  259. };
  260. // The following are used for DT_DIB only...
  261. ULONG cBlt; // Counts down the number of blts necessary at
  262. // the current uniqueness before we'll consider
  263. // putting the DIB back into off-screen memory
  264. ULONG iUniq; // Tells us whether there have been any heap
  265. // 'free's since the last time we looked at
  266. // this DIB
  267. } DSURF; /* dsurf, pdsurf */
  268. // GDI expects dword alignment for any bitmaps on which it is expected
  269. // to draw. Since we occasionally ask GDI to draw directly on our off-
  270. // screen bitmaps, this means that any off-screen bitmaps must be dword
  271. // aligned in the frame buffer. We enforce this merely by ensuring that
  272. // all off-screen bitmaps are four-pel aligned (we may waste a couple of
  273. // pixels at the higher colour depths):
  274. #define HEAP_X_ALIGNMENT 4
  275. // Number of blts necessary before we'll consider putting a DIB DFB back
  276. // into off-screen memory:
  277. #define HEAP_COUNT_DOWN 6
  278. // Flags for 'pohAllocate':
  279. typedef enum {
  280. FLOH_ONLY_IF_ROOM = 0x00000001, // Don't kick stuff out of off-
  281. // screen memory to make room
  282. } FLOH;
  283. BOOL bEnableOffscreenHeap(PDEV*);
  284. VOID vDisableOffscreenHeap(PDEV*);
  285. BOOL bAssertModeOffscreenHeap(PDEV*, BOOL);
  286. OH* pohMoveOffscreenDfbToDib(PDEV*, OH*);
  287. BOOL bMoveDibToOffscreenDfbIfRoom(PDEV*, DSURF*);
  288. OH* pohAllocatePermanent(PDEV*, LONG, LONG);
  289. BOOL bMoveAllDfbsFromOffscreenToDibs(PDEV* ppdev);
  290. /////////////////////////////////////////////////////////////////////////
  291. // Pointer stuff
  292. BOOL bEnablePointer(PDEV*);
  293. VOID vDisablePointer(PDEV*);
  294. VOID vAssertModePointer(PDEV*, BOOL);
  295. /////////////////////////////////////////////////////////////////////////
  296. // Palette stuff
  297. BOOL bEnablePalette(PDEV*);
  298. VOID vDisablePalette();
  299. VOID vAssertModePalette(PDEV*, BOOL);
  300. BOOL bInitializePalette(PDEV*, DEVINFO*);
  301. VOID vUninitializePalette(PDEV*);
  302. #define MAX_CLUT_SIZE (sizeof(VIDEO_CLUT) + (sizeof(ULONG) * 256))
  303. //////////////////////////////////////////////////////////////////////
  304. // Low-level blt function prototypes
  305. typedef VOID (FNFILL)(PDEV*, LONG, RECTL*, ULONG, RBRUSH_COLOR, POINTL*);
  306. typedef VOID (FNXFER)(PDEV*, LONG, RECTL*, ULONG, SURFOBJ*, POINTL*,
  307. RECTL*, XLATEOBJ*);
  308. typedef VOID (FNCOPY)(PDEV*, LONG, RECTL*, ULONG, POINTL*, RECTL*);
  309. typedef BOOL (FNFASTFILL)(PDEV*, LONG, POINTFIX*, ULONG, ULONG, RBRUSH*, POINTL*);
  310. FNFILL vFillPat;
  311. FNFILL vFillSolid;
  312. FNFILL vFillSolidP9000HighColor;
  313. FNXFER vXfer1bpp;
  314. FNXFER vXfer4bpp;
  315. FNXFER vXferNative;
  316. FNCOPY vCopyBlt;
  317. FNFASTFILL bFastFill;
  318. ////////////////////////////////////////////////////////////////////////
  319. // Capabilities flags
  320. //
  321. // These are private flags passed to us from the miniport. They
  322. // come from the high word of the 'AttributeFlags' field of the
  323. // 'VIDEO_MODE_INFORMATION' structure (found in 'ntddvdeo.h') passed
  324. // to us via an 'VIDEO_QUERY_AVAIL_MODES' or 'VIDEO_QUERY_CURRENT_MODE'
  325. // IOCTL.
  326. //
  327. // NOTE: These definitions must match those in the miniport's header!
  328. typedef enum {
  329. } CAPS;
  330. ////////////////////////////////////////////////////////////////////////
  331. // The Physical Device data structure
  332. typedef struct _PDEV
  333. {
  334. LONG xOffset;
  335. LONG yOffset;
  336. BYTE* pjBase; // Points to coprocessor base address
  337. BYTE* pjScreen; // Points to base screen address
  338. LONG lDelta; // Distance from one scan to the next.
  339. LONG iBoard; // Logical multi-board identifier
  340. // (zero by default)
  341. ULONG iBitmapFormat; // BMF_8BPP, BMF_16BPP, BMF_24BPP or
  342. // BMF_32BPP (our current colour
  343. // depth)
  344. VOID* pvTmpBuffer; // General purpose temporary buffer,
  345. // TMP_BUFFER_SIZE bytes in size
  346. // (Remember to synchronize if you
  347. // use this for device bitmaps or
  348. // async pointers)
  349. // -------------------------------------------------------------------
  350. // NOTE: Changes up to here in the PDEV structure must be reflected in
  351. // i386\strucs.inc (assuming you're on an x86, of course)!
  352. BOOL bEnabled; // In graphics mode (not full-screen)
  353. CAPS flCaps; // Capabilities flags
  354. STATUS flStat; // Status flags
  355. LONG cjScreen; // Screen size in bytes
  356. HANDLE hDriver; // Handle to \Device\Screen
  357. HDEV hdevEng; // Engine's handle to PDEV
  358. HSURF hsurfScreen; // Engine's handle to screen surface
  359. DSURF* pdsurfScreen; // Our private DSURF for the screen
  360. LONG cxScreen; // Visible screen width
  361. LONG cyScreen; // Visible screen height
  362. LONG cxMemory; // Width of Video RAM
  363. LONG cyMemory; // Height of Video RAM
  364. LONG cBitsPerPel; // Bits per pel (8, 15, 16, 24 or 32)
  365. ULONG ulMode; // Mode the mini-port driver is in.
  366. FLONG flHooks; // What we're hooking from GDI
  367. LONG cjPel; // Number of bytes per pel
  368. ULONG ulWhite; // 0xff if 8bpp, 0xffff if 16bpp,
  369. // 0xffffffff if 32bpp
  370. UCHAR* pucCsrBase; // Mapped IO port base for this PDEV
  371. ////////// Low-level blt function pointers:
  372. FNFILL* pfnFillSolid;
  373. FNFILL* pfnFillPat;
  374. FNXFER* pfnXfer1bpp;
  375. FNXFER* pfnXfer4bpp;
  376. FNXFER* pfnXferNative;
  377. FNCOPY* pfnCopyBlt;
  378. ////////// Palette stuff:
  379. PALETTEENTRY* pPal; // The palette if palette managed
  380. HPALETTE hpalDefault; // GDI handle to the default palette.
  381. FLONG flRed; // Red mask for 16/32bpp bitfields
  382. FLONG flGreen; // Green mask for 16/32bpp bitfields
  383. FLONG flBlue; // Blue mask for 16/32bpp bitfields
  384. ULONG cPaletteShift; // number of bits the 8-8-8 palette must
  385. // be shifted by to fit in the hardware
  386. // palette.
  387. ////////// Heap stuff:
  388. HEAP heap; // All our off-screen heap data
  389. ULONG iHeapUniq; // Incremented every time room is freed
  390. // in the off-screen heap
  391. SURFOBJ* psoPunt; // Wrapper surface for having GDI draw
  392. // on off-screen bitmaps
  393. SURFOBJ* psoPunt2; // Another one for off-screen to off-
  394. // screen blts
  395. OH* pohScreen; // Off-screen heap structure for the
  396. // visible screen
  397. ////////// Pointer stuff:
  398. ULONG cjPointerAttributes; // Size of pPointerAttributes buffer
  399. BOOL bHwPointerActive; // Currently using the h/w pointer?
  400. POINTL ptlHotSpot; // For remembering pointer hot spot
  401. VIDEO_POINTER_CAPABILITIES PointerCapabilities;
  402. VIDEO_POINTER_ATTRIBUTES* pPointerAttributes;
  403. ////////// Brush stuff:
  404. LONG iBrushCache; // Index for next brush to be allocated
  405. LONG cBrushCache; // Total number of brushes cached
  406. BRUSHENTRY abe[TOTAL_BRUSH_COUNT]; // Keeps track of brush cache
  407. LONG iCircleCache; // Index for next circle to be allocated
  408. CIRCLEENTRY ace[TOTAL_CIRCLE_COUNT];// Keeps track of circle cache
  409. } PDEV, *PPDEV;
  410. /////////////////////////////////////////////////////////////////////////
  411. // Miscellaneous prototypes:
  412. BOOL bIntersect(RECTL*, RECTL*, RECTL*);
  413. LONG cIntersect(RECTL*, RECTL*, LONG);
  414. DWORD getAvailableModes(HANDLE, PVIDEO_MODE_INFORMATION*, DWORD*);
  415. BOOL bInitializeModeFields(PDEV*, GDIINFO*, DEVINFO*, DEVMODEW*);
  416. BOOL bEnableHardware(PDEV*);
  417. VOID vDisableHardware(PDEV*);
  418. BOOL bAssertModeHardware(PDEV*, BOOL);
  419. extern BYTE gaRop3FromMix[];
  420. extern BYTE gabMixNeedsPattern[];
  421. extern BYTE gabRopNeedsPattern[];
  422. extern ULONG gaulP9000OpaqueFromRop2[];
  423. extern ULONG gaulP9000TransparentFromRop2[];
  424. /////////////////////////////////////////////////////////////////////////
  425. // The x86 C compiler insists on making a divide and modulus operation
  426. // into two DIVs, when it can in fact be done in one. So we use this
  427. // macro.
  428. //
  429. // Note: QUOTIENT_REMAINDER implicitly takes unsigned arguments.
  430. #if defined(i386)
  431. #define QUOTIENT_REMAINDER(ulNumerator, ulDenominator, ulQuotient, ulRemainder) \
  432. { \
  433. __asm mov eax, ulNumerator \
  434. __asm sub edx, edx \
  435. __asm div ulDenominator \
  436. __asm mov ulQuotient, eax \
  437. __asm mov ulRemainder, edx \
  438. }
  439. #else
  440. #define QUOTIENT_REMAINDER(ulNumerator, ulDenominator, ulQuotient, ulRemainder) \
  441. { \
  442. ulQuotient = (ULONG) ulNumerator / (ULONG) ulDenominator; \
  443. ulRemainder = (ULONG) ulNumerator % (ULONG) ulDenominator; \
  444. }
  445. #endif
  446. /////////////////////////////////////////////////////////////////////////
  447. // OVERLAP - Returns TRUE if the same-size lower-right exclusive
  448. // rectangles defined by 'pptl' and 'prcl' overlap:
  449. #define OVERLAP(prcl, pptl) \
  450. (((prcl)->right > (pptl)->x) && \
  451. ((prcl)->bottom > (pptl)->y) && \
  452. ((prcl)->left < ((pptl)->x + (prcl)->right - (prcl)->left)) && \
  453. ((prcl)->top < ((pptl)->y + (prcl)->bottom - (prcl)->top)))
  454. //////////////////////////////////////////////////////////////////////
  455. // These Mul prototypes are thunks for multi-board support:
  456. ULONG MulGetModes(HANDLE, ULONG, DEVMODEW*);
  457. DHPDEV MulEnablePDEV(DEVMODEW*, PWSTR, ULONG, HSURF*, ULONG, ULONG*,
  458. ULONG, DEVINFO*, HDEV, PWSTR, HANDLE);
  459. VOID MulCompletePDEV(DHPDEV, HDEV);
  460. HSURF MulEnableSurface(DHPDEV);
  461. BOOL MulStrokePath(SURFOBJ*, PATHOBJ*, CLIPOBJ*, XFORMOBJ*, BRUSHOBJ*,
  462. POINTL*, LINEATTRS*, MIX);
  463. BOOL MulFillPath(SURFOBJ*, PATHOBJ*, CLIPOBJ*, BRUSHOBJ*, POINTL*,
  464. MIX, FLONG);
  465. BOOL MulBitBlt(SURFOBJ*, SURFOBJ*, SURFOBJ*, CLIPOBJ*, XLATEOBJ*,
  466. RECTL*, POINTL*, POINTL*, BRUSHOBJ*, POINTL*, ROP4);
  467. VOID MulDisablePDEV(DHPDEV);
  468. VOID MulDisableSurface(DHPDEV);
  469. BOOL MulAssertMode(DHPDEV, BOOL);
  470. VOID MulMovePointer(SURFOBJ*, LONG, LONG, RECTL*);
  471. ULONG MulSetPointerShape(SURFOBJ*, SURFOBJ*, SURFOBJ*, XLATEOBJ*, LONG,
  472. LONG, LONG, LONG, RECTL*, FLONG);
  473. ULONG MulDitherColor(DHPDEV, ULONG, ULONG, ULONG*);
  474. BOOL MulSetPalette(DHPDEV, PALOBJ*, FLONG, ULONG, ULONG);
  475. BOOL MulCopyBits(SURFOBJ*, SURFOBJ*, CLIPOBJ*, XLATEOBJ*, RECTL*, POINTL*);
  476. BOOL MulTextOut(SURFOBJ*, STROBJ*, FONTOBJ*, CLIPOBJ*, RECTL*, RECTL*,
  477. BRUSHOBJ*, BRUSHOBJ*, POINTL*, MIX);
  478. VOID MulDestroyFont(FONTOBJ*);
  479. BOOL MulPaint(SURFOBJ*, CLIPOBJ*, BRUSHOBJ*, POINTL*, MIX);
  480. BOOL MulRealizeBrush(BRUSHOBJ*, SURFOBJ*, SURFOBJ*, SURFOBJ*, XLATEOBJ*,
  481. ULONG);
  482. HBITMAP MulCreateDeviceBitmap(DHPDEV, SIZEL, ULONG);
  483. VOID MulDeleteDeviceBitmap(DHSURF);
  484. BOOL MulStretchBlt(SURFOBJ*, SURFOBJ*, SURFOBJ*, CLIPOBJ*, XLATEOBJ*,
  485. COLORADJUSTMENT*, POINTL*, RECTL*, RECTL*, POINTL*,
  486. ULONG);
  487. VOID MulSynchronize(DHPDEV, RECTL*);
  488. // These Dbg prototypes are thunks for debugging:
  489. ULONG DbgGetModes(HANDLE, ULONG, DEVMODEW*);
  490. DHPDEV DbgEnablePDEV(DEVMODEW*, PWSTR, ULONG, HSURF*, ULONG, ULONG*,
  491. ULONG, DEVINFO*, HDEV, PWSTR, HANDLE);
  492. VOID DbgCompletePDEV(DHPDEV, HDEV);
  493. HSURF DbgEnableSurface(DHPDEV);
  494. BOOL DbgStrokePath(SURFOBJ*, PATHOBJ*, CLIPOBJ*, XFORMOBJ*, BRUSHOBJ*,
  495. POINTL*, LINEATTRS*, MIX);
  496. BOOL DbgFillPath(SURFOBJ*, PATHOBJ*, CLIPOBJ*, BRUSHOBJ*, POINTL*,
  497. MIX, FLONG);
  498. BOOL DbgBitBlt(SURFOBJ*, SURFOBJ*, SURFOBJ*, CLIPOBJ*, XLATEOBJ*,
  499. RECTL*, POINTL*, POINTL*, BRUSHOBJ*, POINTL*, ROP4);
  500. VOID DbgDisablePDEV(DHPDEV);
  501. VOID DbgDisableSurface(DHPDEV);
  502. BOOL DbgAssertMode(DHPDEV, BOOL);
  503. VOID DbgMovePointer(SURFOBJ*, LONG, LONG, RECTL*);
  504. ULONG DbgSetPointerShape(SURFOBJ*, SURFOBJ*, SURFOBJ*, XLATEOBJ*, LONG,
  505. LONG, LONG, LONG, RECTL*, FLONG);
  506. ULONG DbgDitherColor(DHPDEV, ULONG, ULONG, ULONG*);
  507. BOOL DbgSetPalette(DHPDEV, PALOBJ*, FLONG, ULONG, ULONG);
  508. BOOL DbgCopyBits(SURFOBJ*, SURFOBJ*, CLIPOBJ*, XLATEOBJ*, RECTL*, POINTL*);
  509. BOOL DbgTextOut(SURFOBJ*, STROBJ*, FONTOBJ*, CLIPOBJ*, RECTL*, RECTL*,
  510. BRUSHOBJ*, BRUSHOBJ*, POINTL*, MIX);
  511. VOID DbgDestroyFont(FONTOBJ*);
  512. BOOL DbgPaint(SURFOBJ*, CLIPOBJ*, BRUSHOBJ*, POINTL*, MIX);
  513. BOOL DbgRealizeBrush(BRUSHOBJ*, SURFOBJ*, SURFOBJ*, SURFOBJ*, XLATEOBJ*,
  514. ULONG);
  515. HBITMAP DbgCreateDeviceBitmap(DHPDEV, SIZEL, ULONG);
  516. VOID DbgDeleteDeviceBitmap(DHSURF);
  517. BOOL DbgStretchBlt(SURFOBJ*, SURFOBJ*, SURFOBJ*, CLIPOBJ*, XLATEOBJ*,
  518. COLORADJUSTMENT*, POINTL*, RECTL*, RECTL*, POINTL*,
  519. ULONG);
  520. VOID DbgSynchronize(DHPDEV, RECTL*);
  521. ULONG DbgEscape(SURFOBJ*, ULONG, ULONG, VOID*, ULONG, VOID*);