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.

125 lines
2.0 KiB

  1. /*++
  2. Copyright (c) 1996-1999 Microsoft Corporation
  3. Module Name:
  4. brush.h
  5. Abstract:
  6. Brush object header file
  7. Environment:
  8. Windows NT Unidrv driver
  9. Revision History:
  10. 05/14/96 -amandan-
  11. Created
  12. --*/
  13. #ifndef _BRUSH_H_
  14. #define _BRUSH_H_
  15. #define DBCACHE_INC 16
  16. #define DBCACHE_MAX 256
  17. #define DITHERED_COLOR -1
  18. #define BLACK_COLOR_CMD_INDEX 0
  19. #define MAX_COLOR_SELECTION 8
  20. #define CMD_COLORSELECTION_FIRST CMD_SELECTBLACKCOLOR
  21. #define BRUSH_BLKWHITE 1
  22. #define BRUSH_SHADING 2
  23. #define BRUSH_CROSSHATCH 3
  24. #define BRUSH_USERPATTERN 4
  25. #define BRUSH_PROGCOLOR 5
  26. #define BRUSH_NONPROGCOLOR 6
  27. typedef struct _RECTW {
  28. WORD l;
  29. WORD t;
  30. WORD r;
  31. WORD b;
  32. } RECTW, *PRECTW;
  33. BOOL
  34. Download1BPPHTPattern(
  35. PDEV *pPDev,
  36. SURFOBJ *pso,
  37. DWORD dwPatID
  38. );
  39. WORD
  40. GetBMPChecksum(
  41. SURFOBJ *pso,
  42. PRECTW prcw
  43. );
  44. LONG
  45. FindCachedHTPattern(
  46. PDEV *pPDev,
  47. WORD wChecksum
  48. );
  49. BOOL
  50. BFoundCachedBrush(
  51. PDEV *pPDev,
  52. PDEVBRUSH pDevBrush
  53. );
  54. //
  55. // The following macro return a density value from 1 to 100 where 1 is the
  56. // lightest and 100 is darkest, it will never return 0 (WHITE) because we
  57. // using 23r + 66g + 10b = 99w
  58. //
  59. #define GET_SHADING_PERCENT(dw) (BYTE)(100-((((DWORD)RED_VALUE(dw) * 23) + \
  60. ((DWORD)GREEN_VALUE(dw)* 66) + \
  61. ((DWORD)BLUE_VALUE(dw) * 10) + \
  62. 127) / 255))
  63. #define CACHE_CURRENT_BRUSH(pPDev, pDevBrush) \
  64. pPDev->GState.CurrentBrush.dwBrushType = pDevBrush->dwBrushType; \
  65. pPDev->GState.CurrentBrush.iColor = pDevBrush->iColor; \
  66. #endif // _STATE_H_