ReactOS 0.4.15-dev-8096-ga0eec98
brush.h
Go to the documentation of this file.
1#pragma once
2
3/* Internal interface */
4
5#define NB_HATCH_STYLES 6
6
7/*
8 * The layout of this structure is taken from "Windows Graphics Programming"
9 * book written by Feng Yuan.
10 *
11 * DON'T MODIFY THIS STRUCTURE UNLESS REALLY NEEDED AND EVEN THEN ASK ON
12 * A MAILING LIST FIRST.
13 */
14typedef struct _BRUSHBODY
15{
16 ULONG iHatch; // This is not the brush style, but the hatch style!
20
22 BRUSH_ATTR *pBrushAttr; // Pointer to the currently active brush attribute
23 BRUSH_ATTR BrushAttr; // Internal brush attribute for global brushes
31 HDEV hdev;
32 //DWORD unk054;
33
34 /* The following members are for PENs only */
40 BYTE jJoin; // 0x06c Join styles for geometric wide lines
41 BYTE jEndCap; // end cap style for a geometric wide line
42 //WORD unk06e; // 0x06e
43 INT iBrushStyle; // 0x070
44 //PREGION prgn; // 0x074
45 //DWORD unk078; // 0x078
46 //DWORD unk07c; // 0x07c
50
51#ifndef __cplusplus
52typedef struct _BRUSH
53{
54 /* Header for all gdi objects in the handle table.
55 Do not (re)move this. */
57
60#else
61class BRUSH;
62typedef class BRUSH *PBRUSH;
63#endif
64
65/*
66 * EBRUSHOBJ structure.
67 * See also: https://reactos.org/wiki/Techwiki:Win32k/EBRUSHOBJ
68 */
69typedef struct _EBRUSHOBJ
70{
72
81// DWORD dwUnknown2c;
82// DWORD dwUnknown30;
85 struct _PALETTE * ppalDC;
86 struct _PALETTE * ppalDIB;
87// DWORD dwUnknown44;
91// DWORD dwUnknown54;
92// DWORD dwUnknown58;
93
96
97/* GDI Brush Attributes */
98#define BR_NEED_FG_CLR 0x00000001
99#define BR_NEED_BK_CLR 0x00000002 /* Background color is needed */
100#define BR_DITHER_OK 0x00000004 /* Allow color dithering */
101#define BR_IS_SOLID 0x00000010 /* Solid brush */
102#define BR_IS_HATCH 0x00000020 /* Hatch brush */
103#define BR_IS_BITMAP 0x00000040 /* DDB pattern brush */
104#define BR_IS_DIB 0x00000080 /* DIB pattern brush */
105#define BR_IS_NULL 0x00000100 /* Null/hollow brush */
106#define BR_IS_GLOBAL 0x00000200 /* Stock objects */
107#define BR_IS_PEN 0x00000400 /* Pen */
108#define BR_IS_OLDSTYLEPEN 0x00000800 /* Geometric pen */
109#define BR_IS_DIBPALCOLORS 0x00001000
110#define BR_IS_DIBPALINDICES 0x00002000
111#define BR_IS_DEFAULTSTYLE 0x00004000
112#define BR_IS_MASKING 0x00008000 /* Pattern bitmap is used as transparent mask (?) */
113#define BR_IS_INSIDEFRAME 0x00010000
114#define BR_CACHED_ENGINE 0x00040000
115#define BR_CACHED_IS_SOLID 0x80000000
116
117#define BRUSH_ShareLockBrush(hBrush) ((PBRUSH)GDIOBJ_ShareLockObj((HGDIOBJ)hBrush, GDI_OBJECT_TYPE_BRUSH))
118#define BRUSH_ShareUnlockBrush(pBrush) GDIOBJ_vDereferenceObject((POBJ)pBrush)
119
120INT
123 PBRUSH GdiObject,
124 INT Count,
126
127VOID
128NTAPI
130 PVOID pvObject);
131
133
134struct _SURFACE;
135struct _PALETTE;
136struct _DC;
137
138CODE_SEG("INIT")
140NTAPI
142
143VOID
144NTAPI
146
147VOID
148NTAPI
150
151VOID
154
155VOID
156NTAPI
158
159BOOL
160NTAPI
161EBRUSHOBJ_bRealizeBrush(EBRUSHOBJ *pebo, BOOL bCallDriver);
162
163VOID
164NTAPI
166
167PVOID
168NTAPI
170
171SURFOBJ*
172NTAPI
174
175#define BRUSHOBJ_psoPattern(pbo) \
176 EBRUSHOBJ_psoPattern(CONTAINING_RECORD(pbo, EBRUSHOBJ, BrushObject))
177
178SURFOBJ*
179NTAPI
181
182#define BRUSHOBJ_psoMask(pbo) \
183 EBRUSHOBJ_psoMask(CONTAINING_RECORD(pbo, EBRUSHOBJ, BrushObject))
184
186ULONG
188{
189 ULONG iOldColor = pebo->BrushObject.iSolidColor;
190 pebo->BrushObject.iSolidColor = iSolidColor;
191 return iOldColor;
192}
193
196
197HBRUSH APIENTRY
200
201HBRUSH APIENTRY
204
205HBRUSH APIENTRY
207
208VOID
209NTAPI
211 _In_ HBRUSH hbr,
212 _In_ COLORREF crColor);
#define CODE_SEG(...)
LONG NTSTATUS
Definition: precomp.h:26
Definition: brush.hpp:16
Definition: bufpool.h:45
static HBITMAP hBitmap
Definition: timezone.c:26
#define APIENTRY
Definition: api.h:79
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
HBRUSH APIENTRY IntGdiCreateNullBrush(VOID)
Definition: brush.cpp:281
PVOID NTAPI EBRUSHOBJ_pvGetEngBrush(EBRUSHOBJ *pebo)
Definition: engbrush.c:415
BOOL FASTCALL GreSetBrushOwner(HBRUSH, DWORD)
struct _BRUSH * PBRUSH
BOOL NTAPI EBRUSHOBJ_bRealizeBrush(EBRUSHOBJ *pebo, BOOL bCallDriver)
Definition: engbrush.c:309
SURFOBJ *NTAPI EBRUSHOBJ_psoPattern(EBRUSHOBJ *pebo)
Definition: engbrush.c:435
HBRUSH APIENTRY IntGdiCreatePatternBrush(HBITMAP hBitmap)
Definition: brush.cpp:303
FORCEINLINE ULONG EBRUSHOBJ_iSetSolidColor(EBRUSHOBJ *pebo, ULONG iSolidColor)
Definition: brush.h:187
BOOL FASTCALL IntGdiSetBrushOwner(PBRUSH, DWORD)
VOID NTAPI BRUSH_vDeleteObject(PVOID pvObject)
Definition: brush.cpp:263
VOID NTAPI EBRUSHOBJ_vCleanup(EBRUSHOBJ *pebo)
Definition: engbrush.c:153
NTSTATUS NTAPI InitBrushImpl(VOID)
Definition: engbrush.c:31
VOID NTAPI EBRUSHOBJ_vInitFromDC(EBRUSHOBJ *pebo, PBRUSH pbrush, struct _DC *)
struct _BRUSH BRUSH
struct _EBRUSHOBJ EBRUSHOBJ
struct _EBRUSHOBJ * PEBRUSHOBJ
struct _BRUSHBODY BRUSHBODY
HBRUSH APIENTRY IntGdiCreateSolidBrush(COLORREF Color)
Definition: brush.cpp:290
INT FASTCALL BRUSH_GetObject(PBRUSH GdiObject, INT Count, LPLOGBRUSH Buffer)
Definition: brush.cpp:271
VOID FASTCALL EBRUSHOBJ_vSetSolidRGBColor(EBRUSHOBJ *pebo, COLORREF crColor)
Definition: engbrush.c:122
HSURF gahsurfHatch[HS_DDI_MAX]
Definition: engbrush.c:24
VOID NTAPI EBRUSHOBJ_vInit(EBRUSHOBJ *pebo, PBRUSH pbrush, struct _SURFACE *, COLORREF, COLORREF, struct _PALETTE *)
VOID NTAPI EBRUSHOBJ_vUpdateFromDC(EBRUSHOBJ *pebo, PBRUSH pbrush, struct _DC *)
VOID NTAPI IntGdiSetSolidBrushColor(_In_ HBRUSH hbr, _In_ COLORREF crColor)
Definition: brush.cpp:317
SURFOBJ *NTAPI EBRUSHOBJ_psoMask(EBRUSHOBJ *pebo)
Definition: engbrush.c:446
static HBITMAP
Definition: button.c:44
#define _In_
Definition: ms_sal.h:308
int Count
Definition: noreturn.cpp:7
#define FASTCALL
Definition: nt_native.h:50
unsigned long FLONG
Definition: ntbasedef.h:366
long LONG
Definition: pedump.c:60
ULONG bCacheGrabbed
Definition: brush.h:25
HBITMAP hbmClient
Definition: brush.h:18
HBITMAP hbmPattern
Definition: brush.h:17
ULONG ulPenStyle
Definition: brush.h:37
ULONG ulPalTime
Definition: brush.h:28
INT iBrushStyle
Definition: brush.h:43
LIST_ENTRY ListHead
Definition: brush.h:48
DWORD * pStyle
Definition: brush.h:38
ULONG ulStyleSize
Definition: brush.h:47
COLORREF crBack
Definition: brush.h:26
PVOID pvRBrush
Definition: brush.h:30
ULONG dwStyleCount
Definition: brush.h:39
ULONG flAttrs
Definition: brush.h:19
ULONG ulBrushUnique
Definition: brush.h:21
BRUSH_ATTR BrushAttr
Definition: brush.h:23
BYTE jEndCap
Definition: brush.h:41
LONG lWidth
Definition: brush.h:35
ULONG iHatch
Definition: brush.h:16
HDEV hdev
Definition: brush.h:31
COLORREF crFore
Definition: brush.h:27
POINT ptOrigin
Definition: brush.h:24
FLOATOBJ eWidth
Definition: brush.h:36
BRUSH_ATTR * pBrushAttr
Definition: brush.h:22
BYTE jJoin
Definition: brush.h:40
ULONG ulSurfTime
Definition: brush.h:29
ULONG iSolidColor
Definition: winddi.h:234
Definition: types.h:101
BASEOBJECT BaseObject
Definition: brush.h:56
BRUSHBODY
Definition: brush.h:58
Definition: dc.h:96
PBRUSH pbrush
Definition: brush.h:88
COLORREF crCurrentText
Definition: brush.h:78
ULONG ulSurfPalTime
Definition: brush.h:76
ULONG ulRGBColor
Definition: brush.h:74
struct _PALETTE * ppalSurf
Definition: brush.h:84
PVOID pengbrush
Definition: brush.h:75
BRUSHOBJ BrushObject
Definition: brush.h:71
COLORREF crRealize
Definition: brush.h:73
struct _PALETTE * ppalDC
Definition: brush.h:85
struct _PALETTE * ppalDIB
Definition: brush.h:86
DWORD ulUnique
Definition: brush.h:90
FLONG flattrs
Definition: brush.h:89
SURFOBJ * psoMask
Definition: brush.h:94
SURFACE * psurfTrg
Definition: brush.h:83
ULONG ulDCPalTime
Definition: brush.h:77
COLORREF crCurrentBack
Definition: brush.h:79
COLORADJUSTMENT * pca
Definition: brush.h:80
Definition: typedefs.h:120
#define NTAPI
Definition: typedefs.h:36
int32_t INT
Definition: typedefs.h:58
uint32_t ULONG
Definition: typedefs.h:59
#define FORCEINLINE
Definition: wdftypes.h:67
FLOAT FLOATOBJ
Definition: winddi.h:677
#define HS_DDI_MAX
Definition: winddi.h:3954
typedef HSURF(APIENTRY FN_DrvEnableSurface)(_In_ DHPDEV dhpdev)
DWORD COLORREF
Definition: windef.h:300
unsigned char BYTE
Definition: xxhash.c:193