3 /* Internal interface */
5 #define NB_HATCH_STYLES 6
8 * The layout of this structure is taken from "Windows Graphics Programming"
9 * book written by Feng Yuan.
11 * DON'T MODIFY THIS STRUCTURE UNLESS REALLY NEEDED AND EVEN THEN ASK ON
12 * A MAILING LIST FIRST.
14 typedef struct _BRUSHBODY
16 ULONG iHatch
; // This is not the brush style, but the hatch style!
22 BRUSH_ATTR
*pBrushAttr
; // Pointer to the currently active brush attribute
23 BRUSH_ATTR BrushAttr
; // Internal brush attribute for global brushes
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
54 /* Header for all gdi objects in the handle table.
55 Do not (re)move this. */
56 BASEOBJECT BaseObject
;
62 typedef class BRUSH
*PBRUSH
;
65 typedef struct _EBRUSHOBJ
74 COLORREF crCurrentText
;
75 COLORREF crCurrentBack
;
80 struct _PALETTE
* ppalSurf
;
81 struct _PALETTE
* ppalDC
;
82 struct _PALETTE
* ppalDIB
;
91 } EBRUSHOBJ
, *PEBRUSHOBJ
;
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
113 #define BRUSH_ShareLockBrush(hBrush) ((PBRUSH)GDIOBJ_ShareLockObj((HGDIOBJ)hBrush, GDI_OBJECT_TYPE_BRUSH))
114 #define BRUSH_ShareUnlockBrush(pBrush) GDIOBJ_vDereferenceObject((POBJ)pBrush)
128 extern HSURF gahsurfHatch
[HS_DDI_MAX
];
141 EBRUSHOBJ_vInit(EBRUSHOBJ
*pebo
, PBRUSH pbrush
, struct _SURFACE
*, COLORREF
, COLORREF
, struct _PALETTE
*);
145 EBRUSHOBJ_vInitFromDC(EBRUSHOBJ
*pebo
, PBRUSH pbrush
, struct _DC
*);
149 EBRUSHOBJ_vSetSolidRGBColor(EBRUSHOBJ
*pebo
, COLORREF crColor
);
153 EBRUSHOBJ_vUpdateFromDC(EBRUSHOBJ
*pebo
, PBRUSH pbrush
, struct _DC
*);
157 EBRUSHOBJ_bRealizeBrush(EBRUSHOBJ
*pebo
, BOOL bCallDriver
);
161 EBRUSHOBJ_vCleanup(EBRUSHOBJ
*pebo
);
165 EBRUSHOBJ_pvGetEngBrush(EBRUSHOBJ
*pebo
);
169 EBRUSHOBJ_psoPattern(EBRUSHOBJ
*pebo
);
171 #define BRUSHOBJ_psoPattern(pbo) \
172 EBRUSHOBJ_psoPattern(CONTAINING_RECORD(pbo, EBRUSHOBJ, BrushObject))
176 EBRUSHOBJ_psoMask(EBRUSHOBJ
*pebo
);
178 #define BRUSHOBJ_psoMask(pbo) \
179 EBRUSHOBJ_psoMask(CONTAINING_RECORD(pbo, EBRUSHOBJ, BrushObject))
183 EBRUSHOBJ_iSetSolidColor(EBRUSHOBJ
*pebo
, ULONG iSolidColor
)
185 ULONG iOldColor
= pebo
->BrushObject
.iSolidColor
;
186 pebo
->BrushObject
.iSolidColor
= iSolidColor
;
190 BOOL FASTCALL
IntGdiSetBrushOwner(PBRUSH
,DWORD
);
191 BOOL FASTCALL
GreSetBrushOwner(HBRUSH
,DWORD
);
194 IntGdiCreatePatternBrush(
198 IntGdiCreateSolidBrush(
202 IntGdiCreateNullBrush(VOID
);
206 IntGdiSetSolidBrushColor(
208 _In_ COLORREF crColor
);