[CMAKE]
[reactos.git] / subsystems / win32 / win32k / include / brush.h
1 #pragma once
2
3 #include "gdiobj.h"
4
5 /* Internal interface */
6
7 #define NB_HATCH_STYLES 6
8
9 /*
10 * The layout of this structure is taken from "Windows Graphics Programming"
11 * book written by Feng Yuan.
12 *
13 * DON'T MODIFY THIS STRUCTURE UNLESS REALLY NEEDED AND EVEN THEN ASK ON
14 * A MAILING LIST FIRST.
15 */
16 typedef struct _BRUSH
17 {
18 /* Header for all gdi objects in the handle table.
19 Do not (re)move this. */
20 BASEOBJECT BaseObject;
21
22 ULONG ulStyle;
23 HBITMAP hbmPattern;
24 HANDLE hbmClient;
25 ULONG flAttrs;
26
27 ULONG ulBrushUnique;
28 BRUSH_ATTR *pBrushAttr; // Just like DC_ATTR, pointer to user data
29 BRUSH_ATTR BrushAttr; // " " DCOBJ, internal if pBrushAttr == Zero
30 POINT ptOrigin;
31 ULONG bCacheGrabbed;
32 COLORREF crBack;
33 COLORREF crFore;
34 ULONG ulPalTime;
35 ULONG ulSurfTime;
36 PVOID ulRealization;
37 ULONG Unknown4C[3];
38 POINT ptPenWidth;
39 ULONG ulPenStyle;
40 DWORD *pStyle;
41 ULONG dwStyleCount;
42 ULONG Unknown6C;
43 } BRUSH, *PBRUSH;
44
45 typedef struct _EBRUSHOBJ
46 {
47 BRUSHOBJ BrushObject;
48
49 COLORREF crRealize;
50 ULONG ulRGBColor;
51 PVOID pengbrush;
52 ULONG ulSurfPalTime;
53 ULONG ulDCPalTime;
54 COLORREF crCurrentText;
55 COLORREF crCurrentBack;
56 COLORADJUSTMENT *pca;
57 // DWORD dwUnknown2c;
58 // DWORD dwUnknown30;
59 SURFACE * psurfTrg;
60 struct _PALETTE * ppalSurf;
61 // PALETTE * ppalDC;
62 // PALETTE * ppal3;
63 // DWORD dwUnknown44;
64 BRUSH * pbrush;
65 FLONG flattrs;
66 DWORD ulUnique;
67 // DWORD dwUnknown54;
68 // DWORD dwUnknown58;
69 } EBRUSHOBJ, *PEBRUSHOBJ;
70
71 /* GDI Brush Attributes */
72 #define GDIBRUSH_NEED_FG_CLR 0x0001
73 #define GDIBRUSH_NEED_BK_CLR 0x0002 /* Background color is needed */
74 #define GDIBRUSH_DITHER_OK 0x0004 /* Allow color dithering */
75 #define GDIBRUSH_IS_SOLID 0x0010 /* Solid brush */
76 #define GDIBRUSH_IS_HATCH 0x0020 /* Hatch brush */
77 #define GDIBRUSH_IS_BITMAP 0x0040 /* DDB pattern brush */
78 #define GDIBRUSH_IS_DIB 0x0080 /* DIB pattern brush */
79 #define GDIBRUSH_IS_NULL 0x0100 /* Null/hollow brush */
80 #define GDIBRUSH_IS_GLOBAL 0x0200 /* Stock objects */
81 #define GDIBRUSH_IS_PEN 0x0400 /* Pen */
82 #define GDIBRUSH_IS_OLDSTYLEPEN 0x0800 /* Geometric pen */
83 #define GDIBRUSH_IS_DIBPALCOLORS 0x1000
84 #define GDIBRUSH_IS_DIBPALINDICE 0x2000
85 #define GDIBRUSH_IS_DEFAULTSTYLE 0x4000
86 #define GDIBRUSH_IS_MASKING 0x8000 /* Pattern bitmap is used as transparent mask (?) */
87 #define GDIBRUSH_IS_INSIDEFRAME 0x00010000
88 #define GDIBRUSH_CACHED_ENGINE 0x00040000
89 #define GDIBRUSH_CACHED_IS_SOLID 0x80000000
90
91 #define BRUSH_AllocBrush() ((PBRUSH) GDIOBJ_AllocObj(GDIObjType_BRUSH_TYPE))
92 #define BRUSH_AllocBrushWithHandle() ((PBRUSH) GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_BRUSH, sizeof(BRUSH)))
93 #define BRUSH_FreeBrush(pBrush) GDIOBJ_FreeObj((POBJ)pBrush, GDIObjType_BRUSH_TYPE)
94 #define BRUSH_FreeBrushByHandle(hBrush) GDIOBJ_FreeObjByHandle((HGDIOBJ)hBrush, GDI_OBJECT_TYPE_BRUSH)
95 #define BRUSH_ShareLockBrush(hBrush) ((PBRUSH)GDIOBJ_ShareLockObj((HGDIOBJ)hBrush, GDI_OBJECT_TYPE_BRUSH))
96 #define BRUSH_ShareUnlockBrush(pBrush) GDIOBJ_vDereferenceObject((POBJ)pBrush)
97
98 INT FASTCALL BRUSH_GetObject (PBRUSH GdiObject, INT Count, LPLOGBRUSH Buffer);
99 BOOL INTERNAL_CALL BRUSH_Cleanup(PVOID ObjectBody);
100
101 struct _DC;
102
103 VOID
104 NTAPI
105 EBRUSHOBJ_vInit(EBRUSHOBJ *pebo, PBRUSH pbrush, struct _DC *);
106
107 VOID
108 FASTCALL
109 EBRUSHOBJ_vSetSolidBrushColor(EBRUSHOBJ *pebo, COLORREF crColor);
110
111 VOID
112 NTAPI
113 EBRUSHOBJ_vUpdate(EBRUSHOBJ *pebo, PBRUSH pbrush, struct _DC *pdc);
114
115 BOOL
116 NTAPI
117 EBRUSHOBJ_bRealizeBrush(EBRUSHOBJ *pebo, BOOL bCallDriver);
118
119 VOID
120 NTAPI
121 EBRUSHOBJ_vCleanup(EBRUSHOBJ *pebo);
122
123 PVOID
124 NTAPI
125 EBRUSHOBJ_pvGetEngBrush(EBRUSHOBJ *pebo);
126
127 PVOID FASTCALL AllocateObjectAttr(VOID);
128
129 VOID FASTCALL FreeObjectAttr(PVOID);
130
131 BOOL FASTCALL IntGdiSetBrushOwner(PBRUSH,DWORD);