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.

619 lines
25 KiB

  1. /******************************Module*Header*******************************\
  2. * Module Name: driver.h
  3. *
  4. * Contains prototypes for the display driver.
  5. *
  6. * Copyright (c) 1992-1994 Microsoft Corporation
  7. \**************************************************************************/
  8. //////////////////////////////////////////////////////////////////////
  9. // Put all the conditional-compile constants here. There had better
  10. // not be many!
  11. // Set this bit when GDI's HOOK_SYNCHRONIZEACCESS works so that we don't
  12. // have to worry about synchronizing device-bitmap access. Note that
  13. // this wasn't an option in the first release of NT:
  14. #define SYNCHRONIZEACCESS_WORKS 1
  15. // We have no hardware patterns:
  16. #define FASTFILL_PATTERNS 0
  17. #define SLOWFILL_PATTERNS 1
  18. // This is the maximum number of boards we'll support in a single
  19. // virtual driver:
  20. #define MAX_BOARDS 1
  21. // We don't do any banking with the 8514/A:
  22. #define GDI_BANKING 0
  23. // Useful for visualizing the 2-d heap:
  24. #define DEBUG_HEAP 0
  25. //////////////////////////////////////////////////////////////////////
  26. // Miscellaneous shared stuff
  27. #define DLL_NAME L"8514a" // Name of the DLL in UNICODE
  28. #define STANDARD_DEBUG_PREFIX "8514/A: " // All debug output is prefixed
  29. // by this string
  30. #define ALLOC_TAG '158D' // D851
  31. // Four byte tag (characters in
  32. // reverse order) used for memory
  33. // allocations
  34. #define CLIP_LIMIT 50 // We'll be taking 800 bytes of stack space
  35. #define DRIVER_EXTRA_SIZE 0 // Size of the DriverExtra information in the
  36. // DEVMODE structure
  37. #define TMP_BUFFER_SIZE 8192 // Size in bytes of 'pvTmpBuffer'. Has to
  38. // be at least enough to store an entire
  39. // scan line
  40. typedef struct _CLIPENUM {
  41. LONG c;
  42. RECTL arcl[CLIP_LIMIT]; // Space for enumerating complex clipping
  43. } CLIPENUM; /* ce, pce */
  44. typedef struct _PDEV PDEV; // Handy forward declaration
  45. extern BYTE gaRop3FromMix[];
  46. VOID vSetClipping(PDEV*, RECTL*);
  47. VOID vResetClipping(PDEV*);
  48. VOID vDataPortOut(PDEV*, VOID*, ULONG);
  49. VOID vDataPortOutB(PDEV*, VOID*, ULONG);
  50. VOID vDataPortIn(PDEV*, VOID*, ULONG);
  51. //////////////////////////////////////////////////////////////////////
  52. // Text stuff
  53. typedef struct _XLATECOLORS { // Specifies foreground and background
  54. ULONG iBackColor; // colours for faking a 1bpp XLATEOBJ
  55. ULONG iForeColor;
  56. } XLATECOLORS; /* xlc, pxlc */
  57. BOOL bEnableText(PDEV*);
  58. VOID vDisableText(PDEV*);
  59. VOID vAssertModeText(PDEV*, BOOL);
  60. VOID vFastText(GLYPHPOS*, ULONG, BYTE*, ULONG, ULONG, RECTL*, RECTL*,
  61. FLONG, RECTL*, RECTL*);
  62. VOID vClearMemDword(ULONG*, ULONG);
  63. //////////////////////////////////////////////////////////////////////
  64. // Dither stuff
  65. // Describes a single colour tetrahedron vertex for dithering:
  66. typedef struct _VERTEX_DATA {
  67. ULONG ulCount; // Number of pixels in this vertex
  68. ULONG ulVertex; // Vertex number
  69. } VERTEX_DATA; /* vd, pv */
  70. VERTEX_DATA* vComputeSubspaces(ULONG, VERTEX_DATA*);
  71. VOID vDitherColor(ULONG*, VERTEX_DATA*, VERTEX_DATA*, ULONG);
  72. //////////////////////////////////////////////////////////////////////
  73. // Brush stuff
  74. // 'Slow' brushes are used when we don't have hardware pattern capability,
  75. // and we have to handle patterns using screen-to-screen blts:
  76. #define SLOW_BRUSH_CACHE_DIM 3 // Controls the number of brushes cached
  77. // in off-screen memory, when we don't
  78. // have the S3 hardware pattern support.
  79. // We allocate 3 x 3 brushes, so we can
  80. // cache a total of 9 brushes:
  81. #define SLOW_BRUSH_COUNT (SLOW_BRUSH_CACHE_DIM * SLOW_BRUSH_CACHE_DIM)
  82. #define SLOW_BRUSH_DIMENSION 64 // After alignment is taken care of,
  83. // every off-screen brush cache entry
  84. // will be 64 pels in both dimensions
  85. #define SLOW_BRUSH_ALLOCATION (SLOW_BRUSH_DIMENSION + 8)
  86. // Actually allocate 72x72 pels for each
  87. // pattern, using the 8 extra for brush
  88. // alignment
  89. // 'Fast' brushes are used when we have hardware pattern capability:
  90. #define FAST_BRUSH_COUNT 16 // Total number of non-hardware brushes
  91. // cached off-screen
  92. #define FAST_BRUSH_DIMENSION 8 // Every off-screen brush cache entry
  93. // is 8 pels in both dimensions
  94. #define FAST_BRUSH_ALLOCATION 8 // We have to align ourselves, so this is
  95. // the dimension of each brush allocation
  96. // Common to both implementations:
  97. #define RBRUSH_2COLOR 1 // For RBRUSH flags
  98. #define TOTAL_BRUSH_COUNT max(FAST_BRUSH_COUNT, SLOW_BRUSH_COUNT)
  99. // This is the maximum number of brushes
  100. // we can possibly have cached off-screen
  101. #define TOTAL_BRUSH_SIZE 64 // We'll only ever handle 8x8 patterns,
  102. // and this is the number of pels
  103. typedef struct _BRUSHENTRY BRUSHENTRY;
  104. // NOTE: Changes to the RBRUSH or BRUSHENTRY structures must be reflected
  105. // in strucs.inc!
  106. typedef struct _RBRUSH {
  107. FLONG fl; // Type flags
  108. BOOL bTransparent; // TRUE if brush was realized for a transparent
  109. // blt (meaning colours are white and black),
  110. // FALSE if not (meaning it's already been
  111. // colour-expanded to the correct colours).
  112. // Value is undefined if the brush isn't
  113. // 2 colour.
  114. BRUSHENTRY* pbe; // Points to brush-entry that keeps track
  115. // of the cached off-screen brush bits
  116. ULONG ulForeColor; // Foreground colour if 1bpp
  117. ULONG ulBackColor; // Background colour if 1bpp
  118. POINTL ptlBrushOrg; // Brush origin of cached pattern. Initial
  119. // value should be -1
  120. ULONG aulPattern[1]; // Open-ended array for keeping copy of the
  121. // Don't put anything // actual pattern bits in case the brush
  122. // after here, or // origin changes, or someone else steals
  123. // you'll be sorry! // our brush entry (declared as a ULONG
  124. // for proper dword alignment)
  125. } RBRUSH; /* rb, prb */
  126. typedef struct _BRUSHENTRY {
  127. RBRUSH* prbVerify; // We never dereference this pointer to
  128. // find a brush realization; it is only
  129. // ever used in a compare to verify
  130. // that for a given realized brush, our
  131. // off-screen brush entry is still valid.
  132. LONG x; // x-position of cached pattern
  133. LONG y; // y-position of cached pattern
  134. } BRUSHENTRY; /* be, pbe */
  135. typedef union _RBRUSH_COLOR {
  136. RBRUSH* prb;
  137. ULONG iSolidColor;
  138. } RBRUSH_COLOR; /* rbc, prbc */
  139. BOOL bEnableBrushCache(PDEV*);
  140. VOID vDisableBrushCache(PDEV*);
  141. VOID vAssertModeBrushCache(PDEV*, BOOL);
  142. /////////////////////////////////////////////////////////////////////////
  143. // Heap stuff
  144. typedef enum {
  145. OFL_INUSE = 1, // The device bitmap is no longer located in
  146. // off-screen memory; it's been converted to
  147. // a DIB
  148. OFL_AVAILABLE = 2, // Space is in-use
  149. OFL_PERMANENT = 4 // Space is available
  150. } OHFLAGS; // Space is permanently allocated; never free it
  151. typedef struct _DSURF DSURF;
  152. typedef struct _OH OH;
  153. typedef struct _OH
  154. {
  155. OHFLAGS ofl; // OH_ flags
  156. LONG x; // x-coordinate of left edge of allocation
  157. LONG y; // y-coordinate of top edge of allocation
  158. LONG cx; // Width in pixels of allocation
  159. LONG cy; // Height in pixels of allocation
  160. OH* pohNext; // When OFL_AVAILABLE, points to the next free node,
  161. // in ascending cxcy value. This is kept as a
  162. // circular doubly-linked list with a sentinel
  163. // at the end.
  164. // When OFL_INUSE, points to the next most recently
  165. // blitted allocation. This is kept as a circular
  166. // doubly-linked list so that the list can be
  167. // quickly be updated on every blt.
  168. OH* pohPrev; // Opposite of 'pohNext'
  169. ULONG cxcy; // Width and height in a dword for searching
  170. OH* pohLeft; // Adjacent allocation when in-use or available
  171. OH* pohUp;
  172. OH* pohRight;
  173. OH* pohDown;
  174. DSURF* pdsurf; // Points to our DSURF structure
  175. }; /* oh, poh */
  176. // This is the smallest structure used for memory allocations:
  177. typedef struct _OHALLOC OHALLOC;
  178. typedef struct _OHALLOC
  179. {
  180. OHALLOC* pohaNext;
  181. OH aoh[1];
  182. } OHALLOC; /* oha, poha */
  183. typedef struct _HEAP
  184. {
  185. LONG cxMax; // Largest possible free space by area
  186. LONG cyMax;
  187. OH ohAvailable; // Head of available list (pohNext points to
  188. // smallest available rectangle, pohPrev
  189. // points to largest available rectangle,
  190. // sorted by cxcy)
  191. OH ohDfb; // Head of the list of all DFBs currently in
  192. // offscreen memory that are eligible to be
  193. // tossed out of the heap (pohNext points to
  194. // the most recently blitted; pohPrev points
  195. // to least recently blitted)
  196. OH* pohFreeList; // List of OH node data structures available
  197. OHALLOC* pohaChain; // Chain of allocations
  198. } HEAP; /* heap, pheap */
  199. typedef enum {
  200. DT_SCREEN, // Surface is kept in screen memory
  201. DT_DIB // Surface is kept as a DIB
  202. } DSURFTYPE; /* dt, pdt */
  203. typedef struct _DSURF
  204. {
  205. DSURFTYPE dt; // DSURF status (whether off-screen or in a DIB)
  206. SIZEL sizl; // Size of the original bitmap (could be smaller
  207. // than poh->sizl)
  208. PDEV* ppdev; // Need this for deleting the bitmap
  209. union {
  210. OH* poh; // If DT_SCREEN, points to off-screen heap node
  211. SURFOBJ* pso; // If DT_DIB, points to locked GDI surface
  212. };
  213. // The following are used for DT_DIB only...
  214. ULONG cBlt; // Counts down the number of blts necessary at
  215. // the current uniqueness before we'll consider
  216. // putting the DIB back into off-screen memory
  217. ULONG iUniq; // Tells us whether there have been any heap
  218. // 'free's since the last time we looked at
  219. // this DIB
  220. } DSURF; /* dsurf, pdsurf */
  221. // Off-screen heap allocations have no 'x' alignment:
  222. #define HEAP_X_ALIGNMENT 1
  223. // Number of blts necessary before we'll consider putting a DIB DFB back
  224. // into off-screen memory:
  225. #define HEAP_COUNT_DOWN 6
  226. // Flags for 'pohAllocate':
  227. typedef enum {
  228. FLOH_ONLY_IF_ROOM = 0x00000001, // Don't kick stuff out of off-
  229. // screen memory to make room
  230. } FLOH;
  231. BOOL bEnableOffscreenHeap(PDEV*);
  232. VOID vDisableOffscreenHeap(PDEV*);
  233. BOOL bAssertModeOffscreenHeap(PDEV*, BOOL);
  234. OH* pohMoveOffscreenDfbToDib(PDEV*, OH*);
  235. BOOL bMoveDibToOffscreenDfbIfRoom(PDEV*, DSURF*);
  236. OH* pohAllocatePermanent(PDEV*, LONG, LONG);
  237. BOOL bMoveAllDfbsFromOffscreenToDibs(PDEV* ppdev);
  238. /////////////////////////////////////////////////////////////////////////
  239. // Pointer stuff
  240. BOOL bEnablePointer(PDEV*);
  241. VOID vDisablePointer(PDEV*);
  242. VOID vAssertModePointer(PDEV*, BOOL);
  243. /////////////////////////////////////////////////////////////////////////
  244. // Palette stuff
  245. BOOL bEnablePalette(PDEV*);
  246. VOID vDisablePalette();
  247. VOID vAssertModePalette(PDEV*, BOOL);
  248. BOOL bInitializePalette(PDEV*, DEVINFO*);
  249. VOID vUninitializePalette(PDEV*);
  250. #define MAX_CLUT_SIZE (sizeof(VIDEO_CLUT) + (sizeof(ULONG) * 256))
  251. //////////////////////////////////////////////////////////////////////
  252. // Low-level blt function prototypes
  253. typedef VOID (FNFILL)(PDEV*, LONG, RECTL*, ULONG, ULONG, RBRUSH_COLOR, POINTL*);
  254. typedef VOID (FNXFER)(PDEV*, LONG, RECTL*, ULONG, ULONG, SURFOBJ*, POINTL*,
  255. RECTL*, XLATEOBJ*);
  256. typedef VOID (FNCOPY)(PDEV*, LONG, RECTL*, ULONG, POINTL*, RECTL*);
  257. typedef VOID (FNMASK)(PDEV*, LONG, RECTL*, ULONG, ULONG, SURFOBJ*, POINTL*,
  258. SURFOBJ*, POINTL*, RECTL*, ULONG, RBRUSH*, POINTL*,
  259. XLATEOBJ*);
  260. typedef VOID (FNFASTLINE)(PDEV*, PATHOBJ*, RECTL*, PFNSTRIP*, LONG, ULONG,
  261. ULONG);
  262. typedef BOOL (FNFASTFILL)(PDEV*, LONG, POINTFIX*, ULONG, ULONG, ULONG, RBRUSH*);
  263. FNFILL vIoFillPatFast;
  264. FNFILL vIoFillPatSlow;
  265. FNFILL vIoFillSolid;
  266. FNXFER vIoXfer1bpp;
  267. FNXFER vIoXfer1bppPacked;
  268. FNXFER vIoXfer4bpp;
  269. FNXFER vIoXferNative;
  270. FNCOPY vIoCopyBlt;
  271. FNMASK vIoMaskCopy;
  272. FNFASTLINE vIoFastLine;
  273. FNFASTFILL bIoFastFill;
  274. VOID vPutBits(PDEV*, SURFOBJ*, RECTL*, POINTL*);
  275. VOID vGetBits(PDEV*, SURFOBJ*, RECTL*, POINTL*);
  276. VOID vIoSlowPatRealize(PDEV*, RBRUSH*, BOOL);
  277. ////////////////////////////////////////////////////////////////////////
  278. // Capabilities flags
  279. typedef enum {
  280. CAPS_MASKBLT_CAPABLE = 0x0001, // Hardware is capable of maskblts
  281. CAPS_SW_POINTER = 0x0002, // No hardware pointer; use software
  282. // simulation
  283. CAPS_MINIPORT_POINTER = 0x0004, // Use miniport hardware pointer
  284. } CAPS;
  285. // Status flags
  286. typedef enum {
  287. STAT_GLYPH_CACHE = 0x0001, // Glyph cache successfully allocated
  288. STAT_BRUSH_CACHE = 0x0002, // Brush cache successfully allocated
  289. } STATUS;
  290. ////////////////////////////////////////////////////////////////////////
  291. // The Physical Device data structure
  292. typedef struct _PDEV
  293. {
  294. LONG xOffset;
  295. LONG yOffset;
  296. ULONG iBitmapFormat; // BMF_8BPP or BMF_16BPP or BMF_32BPP
  297. // (our current colour depth)
  298. // Enhanced mode register addresses.
  299. ULONG ioCur_y;
  300. ULONG ioCur_x;
  301. ULONG ioDesty_axstp;
  302. ULONG ioDestx_diastp;
  303. ULONG ioErr_term;
  304. ULONG ioMaj_axis_pcnt;
  305. ULONG ioGp_stat_cmd;
  306. ULONG ioShort_stroke;
  307. ULONG ioBkgd_color;
  308. ULONG ioFrgd_color;
  309. ULONG ioWrt_mask;
  310. ULONG ioRd_mask;
  311. ULONG ioColor_cmp;
  312. ULONG ioBkgd_mix;
  313. ULONG ioFrgd_mix;
  314. ULONG ioMulti_function;
  315. ULONG ioPix_trans;
  316. CAPS flCaps; // CAPS_ capabilities flags
  317. STATUS flStatus; // STAT_ status flags
  318. BOOL bEnabled; // In graphics mode (not full-screen)
  319. // -------------------------------------------------------------------
  320. // NOTE: Changes up to here in the PDEV structure must be reflected in
  321. // i386\strucs.inc (assuming you're on an x86, of course)!
  322. LONG iBoard; // Logical multi-board identifier
  323. HANDLE hDriver; // Handle to \Device\Screen
  324. HDEV hdevEng; // Engine's handle to PDEV
  325. HSURF hsurfScreen; // Engine's handle to screen surface
  326. DSURF* pdsurfScreen; // Our private DSURF for the screen
  327. BYTE* pjScreen; // Points to base screen address
  328. BYTE* pjMmBase; // Start of memory mapped I/O
  329. LONG cxScreen; // Visible screen width
  330. LONG cyScreen; // Visible screen height
  331. LONG cxMemory; // Width of Video RAM
  332. LONG cyMemory; // Height of Video RAM
  333. ULONG ulMode; // Mode the mini-port driver is in.
  334. LONG lDelta; // Distance from one scan to the next.
  335. FLONG flHooks; // What we're hooking from GDI
  336. LONG cPelSize; // 0 if 8bpp, 1 if 16bpp, 2 if 32bpp
  337. ULONG ulWhite; // 0xff if 8bpp, 0xffff if 16bpp,
  338. // 0xffffffff if 32bpp
  339. VOID* pvTmpBuffer; // General purpose temporary buffer,
  340. // TMP_BUFFER_SIZE bytes in size
  341. // (Remember to synchronize if you
  342. // use this for device bitmaps or
  343. // async pointers)
  344. ////////// Low-level blt function pointers:
  345. FNFILL* pfnFillSolid;
  346. FNFILL* pfnFillPat;
  347. FNXFER* pfnXfer1bpp;
  348. FNXFER* pfnXfer4bpp;
  349. FNXFER* pfnXferNative;
  350. FNCOPY* pfnCopyBlt;
  351. FNMASK* pfnMaskCopy;
  352. FNFASTLINE* pfnFastLine;
  353. FNFASTFILL* pfnFastFill;
  354. ////////// Palette stuff:
  355. PALETTEENTRY* pPal; // The palette if palette managed
  356. HPALETTE hpalDefault; // GDI handle to the default palette.
  357. FLONG flRed; // Red mask for 16/32bpp bitfields
  358. FLONG flGreen; // Green mask for 16/32bpp bitfields
  359. FLONG flBlue; // Blue mask for 16/32bpp bitfields
  360. ULONG cPaletteShift; // number of bits the 8-8-8 palette must
  361. // be shifted by to fit in the hardware
  362. // palette.
  363. ////////// Heap stuff:
  364. HEAP heap; // All our off-screen heap data
  365. ULONG iHeapUniq; // Incremented every time room is freed
  366. // in the off-screen heap
  367. ////////// Brush stuff:
  368. BOOL bRealizeTransparent; // Hint to DrvRealizeBrush for whether
  369. // the brush should be realized as
  370. // transparent or not
  371. LONG iBrushCache; // Index for next brush to be allocated
  372. LONG cBrushCache; // Total number of brushes cached
  373. BRUSHENTRY abe[TOTAL_BRUSH_COUNT]; // Keeps track of brush cache
  374. ////////// Font Stuff
  375. #define GLYPH_CACHE_X (ppdev->ptlGlyphCache.x)
  376. #define GLYPH_CACHE_Y (ppdev->ptlGlyphCache.y)
  377. #define GLYPH_CACHE_CX 32
  378. #define GLYPH_CACHE_CY 32
  379. #define CACHED_GLYPHS_ROWS 4
  380. #define GLYPHS_PER_ROW (512 / GLYPH_CACHE_CX)
  381. BYTE ajGlyphAllocBitVector[CACHED_GLYPHS_ROWS][GLYPHS_PER_ROW];
  382. CLIPOBJ *pcoDefault; // ptr to a default clip obj
  383. POINTL ptlGlyphCache;
  384. } PDEV, *PPDEV;
  385. /////////////////////////////////////////////////////////////////////////
  386. // Miscellaneous prototypes:
  387. BOOL bIntersect(RECTL*, RECTL*, RECTL*);
  388. LONG cIntersect(RECTL*, RECTL*, LONG);
  389. BOOL bFastFill(PDEV*, LONG, POINTFIX*, ULONG, ULONG);
  390. DWORD getAvailableModes(HANDLE, PVIDEO_MODE_INFORMATION*, DWORD*);
  391. BOOL bInitializeModeFields(PDEV*, GDIINFO*, DEVINFO*, DEVMODEW*);
  392. BOOL bEnableHardware(PDEV*);
  393. VOID vDisableHardware(PDEV*);
  394. BOOL bAssertModeHardware(PDEV*, BOOL);
  395. extern BYTE gajHwMixFromMix[];
  396. /////////////////////////////////////////////////////////////////////////
  397. // The x86 C compiler insists on making a divide and modulus operation
  398. // into two DIVs, when it can in fact be done in one. So we use this
  399. // macro.
  400. //
  401. // Note: QUOTIENT_REMAINDER implicitly takes unsigned arguments.
  402. #if defined(i386)
  403. #define QUOTIENT_REMAINDER(ulNumerator, ulDenominator, ulQuotient, ulRemainder) \
  404. { \
  405. __asm mov eax, ulNumerator \
  406. __asm sub edx, edx \
  407. __asm div ulDenominator \
  408. __asm mov ulQuotient, eax \
  409. __asm mov ulRemainder, edx \
  410. }
  411. #else
  412. #define QUOTIENT_REMAINDER(ulNumerator, ulDenominator, ulQuotient, ulRemainder) \
  413. { \
  414. ulQuotient = (ULONG) ulNumerator / (ULONG) ulDenominator; \
  415. ulRemainder = (ULONG) ulNumerator % (ULONG) ulDenominator; \
  416. }
  417. #endif
  418. /////////////////////////////////////////////////////////////////////////
  419. // OVERLAP - Returns TRUE if the same-size lower-right exclusive
  420. // rectangles defined by 'pptl' and 'prcl' overlap:
  421. #define OVERLAP(prcl, pptl) \
  422. (((prcl)->right > (pptl)->x) && \
  423. ((prcl)->bottom > (pptl)->y) && \
  424. ((prcl)->left < ((pptl)->x + (prcl)->right - (prcl)->left)) && \
  425. ((prcl)->top < ((pptl)->y + (prcl)->bottom - (prcl)->top)))
  426. // These Dbg prototypes are thunks for debugging:
  427. VOID DbgDisableDriver(VOID);
  428. ULONG DbgGetModes(HANDLE, ULONG, DEVMODEW*);
  429. DHPDEV DbgEnablePDEV(DEVMODEW*, PWSTR, ULONG, HSURF*, ULONG, ULONG*,
  430. ULONG, DEVINFO*, HDEV, PWSTR, HANDLE);
  431. VOID DbgCompletePDEV(DHPDEV, HDEV);
  432. HSURF DbgEnableSurface(DHPDEV);
  433. BOOL DbgStrokePath(SURFOBJ*, PATHOBJ*, CLIPOBJ*, XFORMOBJ*, BRUSHOBJ*,
  434. POINTL*, LINEATTRS*, MIX);
  435. BOOL DbgFillPath(SURFOBJ*, PATHOBJ*, CLIPOBJ*, BRUSHOBJ*, POINTL*,
  436. MIX, FLONG);
  437. BOOL DbgBitBlt(SURFOBJ*, SURFOBJ*, SURFOBJ*, CLIPOBJ*, XLATEOBJ*,
  438. RECTL*, POINTL*, POINTL*, BRUSHOBJ*, POINTL*, ROP4);
  439. VOID DbgDisablePDEV(DHPDEV);
  440. VOID DbgDisableSurface(DHPDEV);
  441. BOOL DbgAssertMode(DHPDEV, BOOL);
  442. VOID DbgMovePointer(SURFOBJ*, LONG, LONG, RECTL*);
  443. ULONG DbgSetPointerShape(SURFOBJ*, SURFOBJ*, SURFOBJ*, XLATEOBJ*, LONG,
  444. LONG, LONG, LONG, RECTL*, FLONG);
  445. ULONG DbgDitherColor(DHPDEV, ULONG, ULONG, ULONG*);
  446. BOOL DbgSetPalette(DHPDEV, PALOBJ*, FLONG, ULONG, ULONG);
  447. BOOL DbgCopyBits(SURFOBJ*, SURFOBJ*, CLIPOBJ*, XLATEOBJ*, RECTL*, POINTL*);
  448. BOOL DbgTextOut(SURFOBJ*, STROBJ*, FONTOBJ*, CLIPOBJ*, RECTL*, RECTL*,
  449. BRUSHOBJ*, BRUSHOBJ*, POINTL*, MIX);
  450. VOID DbgDestroyFont(FONTOBJ*);
  451. BOOL DbgPaint(SURFOBJ*, CLIPOBJ*, BRUSHOBJ*, POINTL*, MIX);
  452. BOOL DbgRealizeBrush(BRUSHOBJ*, SURFOBJ*, SURFOBJ*, SURFOBJ*, XLATEOBJ*,
  453. ULONG);
  454. HBITMAP DbgCreateDeviceBitmap(DHPDEV, SIZEL, ULONG);
  455. VOID DbgDeleteDeviceBitmap(DHSURF);
  456. BOOL DbgStretchBlt(SURFOBJ*, SURFOBJ*, SURFOBJ*, CLIPOBJ*, XLATEOBJ*,
  457. COLORADJUSTMENT*, POINTL*, RECTL*, RECTL*, POINTL*,
  458. ULONG);
  459. //////////////////////////////////////////////////////////////////////////
  460. typedef struct {
  461. LONG x;
  462. LONG y;
  463. LONG z;
  464. } XYZPOINTL;
  465. typedef XYZPOINTL *PXYZPOINTL;
  466. typedef XYZPOINTL XYZPOINT;
  467. typedef XYZPOINT *PXYZPOINT;
  468. // Font & Text stuff
  469. typedef struct _cachedGlyph {
  470. HGLYPH hg;
  471. struct _cachedGlyph *pcgCollisionLink;
  472. ULONG fl;
  473. POINTL ptlOrigin;
  474. SIZEL sizlBitmap;
  475. ULONG BmPitchInPels;
  476. ULONG BmPitchInBytes;
  477. XYZPOINTL xyzGlyph;
  478. } CACHEDGLYPH, *PCACHEDGLYPH;
  479. #define VALID_GLYPH 0x01
  480. #define END_COLLISIONS 0
  481. typedef struct _cachedFont {
  482. struct _cachedFont *pcfNext;
  483. ULONG iUniq;
  484. ULONG cGlyphs;
  485. ULONG cjMaxGlyph1;
  486. PCACHEDGLYPH pCachedGlyphs;
  487. } CACHEDFONT, *PCACHEDFONT;
  488. // Clipping Control Stuff
  489. typedef struct {
  490. ULONG c;
  491. RECTL arcl[8];
  492. } ENUMRECTS8;
  493. typedef ENUMRECTS8 *PENUMRECTS8;