ReactOS  0.4.13-dev-99-g7e18b6d
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  */
14 typedef 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
48  LIST_ENTRY ListHead; // 0x080
49 } BRUSHBODY;
50 
51 #ifndef __cplusplus
52 typedef struct _BRUSH
53 {
54  /* Header for all gdi objects in the handle table.
55  Do not (re)move this. */
57 
59 } BRUSH, *PBRUSH;
60 #else
61 class BRUSH;
62 typedef class BRUSH *PBRUSH;
63 #endif
64 
65 typedef struct _EBRUSHOBJ
66 {
68 
77 // DWORD dwUnknown2c;
78 // DWORD dwUnknown30;
80  struct _PALETTE * ppalSurf;
81  struct _PALETTE * ppalDC;
82  struct _PALETTE * ppalDIB;
83 // DWORD dwUnknown44;
87 // DWORD dwUnknown54;
88 // DWORD dwUnknown58;
89 
92 
93 /* GDI Brush Attributes */
94 #define BR_NEED_FG_CLR 0x00000001
95 #define BR_NEED_BK_CLR 0x00000002 /* Background color is needed */
96 #define BR_DITHER_OK 0x00000004 /* Allow color dithering */
97 #define BR_IS_SOLID 0x00000010 /* Solid brush */
98 #define BR_IS_HATCH 0x00000020 /* Hatch brush */
99 #define BR_IS_BITMAP 0x00000040 /* DDB pattern brush */
100 #define BR_IS_DIB 0x00000080 /* DIB pattern brush */
101 #define BR_IS_NULL 0x00000100 /* Null/hollow brush */
102 #define BR_IS_GLOBAL 0x00000200 /* Stock objects */
103 #define BR_IS_PEN 0x00000400 /* Pen */
104 #define BR_IS_OLDSTYLEPEN 0x00000800 /* Geometric pen */
105 #define BR_IS_DIBPALCOLORS 0x00001000
106 #define BR_IS_DIBPALINDICES 0x00002000
107 #define BR_IS_DEFAULTSTYLE 0x00004000
108 #define BR_IS_MASKING 0x00008000 /* Pattern bitmap is used as transparent mask (?) */
109 #define BR_IS_INSIDEFRAME 0x00010000
110 #define BR_CACHED_ENGINE 0x00040000
111 #define BR_CACHED_IS_SOLID 0x80000000
112 
113 #define BRUSH_ShareLockBrush(hBrush) ((PBRUSH)GDIOBJ_ShareLockObj((HGDIOBJ)hBrush, GDI_OBJECT_TYPE_BRUSH))
114 #define BRUSH_ShareUnlockBrush(pBrush) GDIOBJ_vDereferenceObject((POBJ)pBrush)
115 
116 INT
117 FASTCALL
119  PBRUSH GdiObject,
120  INT Count,
122 
123 VOID
124 NTAPI
126  PVOID pvObject);
127 
129 
130 struct _SURFACE;
131 struct _PALETTE;
132 struct _DC;
133 
134 INIT_FUNCTION
135 NTSTATUS
136 NTAPI
138 
139 VOID
140 NTAPI
141 EBRUSHOBJ_vInit(EBRUSHOBJ *pebo, PBRUSH pbrush, struct _SURFACE *, COLORREF, COLORREF, struct _PALETTE *);
142 
143 VOID
144 NTAPI
145 EBRUSHOBJ_vInitFromDC(EBRUSHOBJ *pebo, PBRUSH pbrush, struct _DC *);
146 
147 VOID
148 FASTCALL
150 
151 VOID
152 NTAPI
153 EBRUSHOBJ_vUpdateFromDC(EBRUSHOBJ *pebo, PBRUSH pbrush, struct _DC *);
154 
155 BOOL
156 NTAPI
157 EBRUSHOBJ_bRealizeBrush(EBRUSHOBJ *pebo, BOOL bCallDriver);
158 
159 VOID
160 NTAPI
162 
163 PVOID
164 NTAPI
166 
167 SURFOBJ*
168 NTAPI
170 
171 #define BRUSHOBJ_psoPattern(pbo) \
172  EBRUSHOBJ_psoPattern(CONTAINING_RECORD(pbo, EBRUSHOBJ, BrushObject))
173 
174 SURFOBJ*
175 NTAPI
177 
178 #define BRUSHOBJ_psoMask(pbo) \
179  EBRUSHOBJ_psoMask(CONTAINING_RECORD(pbo, EBRUSHOBJ, BrushObject))
180 
182 ULONG
184 {
185  ULONG iOldColor = pebo->BrushObject.iSolidColor;
186  pebo->BrushObject.iSolidColor = iSolidColor;
187  return iOldColor;
188 }
189 
192 
193 HBRUSH APIENTRY
195  HBITMAP hBitmap);
196 
197 HBRUSH APIENTRY
199  COLORREF Color);
200 
201 HBRUSH APIENTRY
203 
204 VOID
205 NTAPI
207  _In_ HBRUSH hbr,
208  _In_ COLORREF crColor);
BRUSH_ATTR * pBrushAttr
Definition: brush.h:22
VOID FASTCALL EBRUSHOBJ_vSetSolidRGBColor(EBRUSHOBJ *pebo, COLORREF crColor)
Definition: engbrush.c:122
struct _EBRUSHOBJ EBRUSHOBJ
#define HS_DDI_MAX
Definition: winddi.h:3954
struct _BRUSH * PBRUSH
ULONG dwStyleCount
Definition: brush.h:39
LONG lWidth
Definition: brush.h:35
ULONG ulSurfTime
Definition: brush.h:29
VOID NTAPI EBRUSHOBJ_vCleanup(EBRUSHOBJ *pebo)
Definition: engbrush.c:153
Definition: dc.h:92
BRUSHBODY
Definition: brush.h:58
PVOID pvRBrush
Definition: brush.h:30
ULONG ulDCPalTime
Definition: brush.h:73
LONG NTSTATUS
Definition: precomp.h:26
ULONG ulBrushUnique
Definition: brush.h:21
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
COLORADJUSTMENT * pca
Definition: brush.h:76
SURFOBJ * psoMask
Definition: brush.h:90
SURFACE * psurfTrg
Definition: brush.h:79
ULONG flAttrs
Definition: brush.h:19
ULONG ulPalTime
Definition: brush.h:28
#define FASTCALL
Definition: nt_native.h:50
SURFOBJ *NTAPI EBRUSHOBJ_psoPattern(EBRUSHOBJ *pebo)
Definition: engbrush.c:435
struct _BRUSHBODY BRUSHBODY
int32_t INT
Definition: typedefs.h:56
ULONG ulStyleSize
Definition: brush.h:47
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
unsigned int BOOL
Definition: ntddk_ex.h:94
struct _PALETTE * ppalDIB
Definition: brush.h:82
long LONG
Definition: pedump.c:60
VOID NTAPI EBRUSHOBJ_vInit(EBRUSHOBJ *pebo, PBRUSH pbrush, struct _SURFACE *, COLORREF, COLORREF, struct _PALETTE *)
ULONG iHatch
Definition: brush.h:16
POINT ptOrigin
Definition: brush.h:24
PBRUSH pbrush
Definition: brush.h:84
#define FORCEINLINE
Definition: ntbasedef.h:221
BYTE jEndCap
Definition: brush.h:41
VOID NTAPI EBRUSHOBJ_vUpdateFromDC(EBRUSHOBJ *pebo, PBRUSH pbrush, struct _DC *)
Definition: bufpool.h:45
PVOID NTAPI EBRUSHOBJ_pvGetEngBrush(EBRUSHOBJ *pebo)
Definition: engbrush.c:415
unsigned long FLONG
Definition: ntbasedef.h:373
typedef HSURF(APIENTRY FN_DrvEnableSurface)(_In_ DHPDEV dhpdev)
Definition: types.h:100
struct _PALETTE * ppalSurf
Definition: brush.h:80
INT iBrushStyle
Definition: brush.h:43
PVOID pengbrush
Definition: brush.h:71
DWORD ulUnique
Definition: brush.h:86
BYTE jJoin
Definition: brush.h:40
HSURF gahsurfHatch[HS_DDI_MAX]
Definition: engbrush.c:24
FLOAT FLOATOBJ
Definition: winddi.h:677
COLORREF crCurrentBack
Definition: brush.h:75
DWORD COLORREF
Definition: windef.h:285
BRUSHOBJ BrushObject
Definition: brush.h:67
SURFOBJ *NTAPI EBRUSHOBJ_psoMask(EBRUSHOBJ *pebo)
Definition: engbrush.c:446
Definition: brush.hpp:15
HBITMAP hbmClient
Definition: brush.h:18
BOOL FASTCALL GreSetBrushOwner(HBRUSH, DWORD)
HDEV hdev
Definition: brush.h:31
unsigned long DWORD
Definition: ntddk_ex.h:95
ULONG ulRGBColor
Definition: brush.h:70
struct _BRUSH BRUSH
VOID NTAPI IntGdiSetSolidBrushColor(_In_ HBRUSH hbr, _In_ COLORREF crColor)
Definition: brush.cpp:306
BOOL NTAPI EBRUSHOBJ_bRealizeBrush(EBRUSHOBJ *pebo, BOOL bCallDriver)
Definition: engbrush.c:309
FLONG flattrs
Definition: brush.h:85
ULONG iSolidColor
Definition: winddi.h:234
HBRUSH APIENTRY IntGdiCreateNullBrush(VOID)
Definition: brush.cpp:270
unsigned char BYTE
Definition: mem.h:68
HBRUSH APIENTRY IntGdiCreateSolidBrush(COLORREF Color)
Definition: brush.cpp:279
ULONG ulPenStyle
Definition: brush.h:37
Definition: typedefs.h:117
VOID NTAPI BRUSH_vDeleteObject(PVOID pvObject)
Definition: brush.cpp:252
INIT_FUNCTION NTSTATUS NTAPI InitBrushImpl(VOID)
Definition: engbrush.c:31
VOID NTAPI EBRUSHOBJ_vInitFromDC(EBRUSHOBJ *pebo, PBRUSH pbrush, struct _DC *)
ULONG ulSurfPalTime
Definition: brush.h:72
#define _In_
Definition: no_sal2.h:204
HBRUSH APIENTRY IntGdiCreatePatternBrush(HBITMAP hBitmap)
Definition: brush.cpp:292
COLORREF crBack
Definition: brush.h:26
COLORREF crFore
Definition: brush.h:27
struct _PALETTE * ppalDC
Definition: brush.h:81
COLORREF crRealize
Definition: brush.h:69
unsigned int ULONG
Definition: retypes.h:1
FORCEINLINE ULONG EBRUSHOBJ_iSetSolidColor(EBRUSHOBJ *pebo, ULONG iSolidColor)
Definition: brush.h:183
BRUSH_ATTR BrushAttr
Definition: brush.h:23
DWORD * pStyle
Definition: brush.h:38
static HBITMAP
Definition: button.c:44
INT FASTCALL BRUSH_GetObject(PBRUSH GdiObject, INT Count, LPLOGBRUSH Buffer)
Definition: brush.cpp:260
BASEOBJECT BaseObject
Definition: brush.h:56
LIST_ENTRY ListHead
Definition: brush.h:48
COLORREF crCurrentText
Definition: brush.h:74
struct _EBRUSHOBJ * PEBRUSHOBJ
ULONG bCacheGrabbed
Definition: brush.h:25
HBITMAP hbmPattern
Definition: brush.h:17
static HBITMAP hBitmap
Definition: timezone.c:35
FLOATOBJ eWidth
Definition: brush.h:36
#define APIENTRY
Definition: api.h:79
BOOL FASTCALL IntGdiSetBrushOwner(PBRUSH, DWORD)