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.
16 /* Header for all gdi objects in the handle table.
17 Do not (re)move this. */
18 BASEOBJECT BaseObject
;
26 BRUSH_ATTR
*pBrushAttr
; // Just like DC_ATTR, pointer to user data
27 BRUSH_ATTR BrushAttr
; // " " DCOBJ, internal if pBrushAttr == Zero
43 typedef struct _EBRUSHOBJ
52 COLORREF crCurrentText
;
53 COLORREF crCurrentBack
;
58 struct _PALETTE
* ppalSurf
;
59 struct _PALETTE
* ppalDC
;
60 struct _PALETTE
* ppalDIB
;
67 } EBRUSHOBJ
, *PEBRUSHOBJ
;
69 /* GDI Brush Attributes */
70 #define BR_NEED_FG_CLR 0x00000001
71 #define BR_NEED_BK_CLR 0x00000002 /* Background color is needed */
72 #define BR_DITHER_OK 0x00000004 /* Allow color dithering */
73 #define BR_IS_SOLID 0x00000010 /* Solid brush */
74 #define BR_IS_HATCH 0x00000020 /* Hatch brush */
75 #define BR_IS_BITMAP 0x00000040 /* DDB pattern brush */
76 #define BR_IS_DIB 0x00000080 /* DIB pattern brush */
77 #define BR_IS_NULL 0x00000100 /* Null/hollow brush */
78 #define BR_IS_GLOBAL 0x00000200 /* Stock objects */
79 #define BR_IS_PEN 0x00000400 /* Pen */
80 #define BR_IS_OLDSTYLEPEN 0x00000800 /* Geometric pen */
81 #define BR_IS_DIBPALCOLORS 0x00001000
82 #define BR_IS_DIBPALINDICE 0x00002000
83 #define BR_IS_DEFAULTSTYLE 0x00004000
84 #define BR_IS_MASKING 0x00008000 /* Pattern bitmap is used as transparent mask (?) */
85 #define BR_IS_INSIDEFRAME 0x00010000
86 #define BR_CACHED_ENGINE 0x00040000
87 #define BR_CACHED_IS_SOLID 0x80000000
89 #define BRUSH_AllocBrush() ((PBRUSH) GDIOBJ_AllocObj(GDIObjType_BRUSH_TYPE))
90 #define BRUSH_AllocBrushWithHandle() ((PBRUSH) GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_BRUSH, sizeof(BRUSH)))
91 #define BRUSH_FreeBrush(pBrush) GDIOBJ_FreeObj((POBJ)pBrush, GDIObjType_BRUSH_TYPE)
92 #define BRUSH_FreeBrushByHandle(hBrush) GDIOBJ_FreeObjByHandle((HGDIOBJ)hBrush, GDI_OBJECT_TYPE_BRUSH)
93 #define BRUSH_ShareLockBrush(hBrush) ((PBRUSH)GDIOBJ_ShareLockObj((HGDIOBJ)hBrush, GDI_OBJECT_TYPE_BRUSH))
94 #define BRUSH_ShareUnlockBrush(pBrush) GDIOBJ_vDereferenceObject((POBJ)pBrush)
96 INT FASTCALL
BRUSH_GetObject (PBRUSH GdiObject
, INT Count
, LPLOGBRUSH Buffer
);
97 BOOL NTAPI
BRUSH_Cleanup(PVOID ObjectBody
);
99 extern HSURF gahsurfHatch
[HS_DDI_MAX
];
112 EBRUSHOBJ_vInit(EBRUSHOBJ
*pebo
, PBRUSH pbrush
, struct _SURFACE
*, COLORREF
, COLORREF
, struct _PALETTE
*);
116 EBRUSHOBJ_vInitFromDC(EBRUSHOBJ
*pebo
, PBRUSH pbrush
, struct _DC
*);
120 EBRUSHOBJ_vSetSolidRGBColor(EBRUSHOBJ
*pebo
, COLORREF crColor
);
124 EBRUSHOBJ_vUpdateFromDC(EBRUSHOBJ
*pebo
, PBRUSH pbrush
, struct _DC
*);
128 EBRUSHOBJ_bRealizeBrush(EBRUSHOBJ
*pebo
, BOOL bCallDriver
);
132 EBRUSHOBJ_vCleanup(EBRUSHOBJ
*pebo
);
136 EBRUSHOBJ_pvGetEngBrush(EBRUSHOBJ
*pebo
);
140 EBRUSHOBJ_psoPattern(EBRUSHOBJ
*pebo
);
142 #define BRUSHOBJ_psoPattern(pbo) \
143 EBRUSHOBJ_psoPattern(CONTAINING_RECORD(pbo, EBRUSHOBJ, BrushObject))
147 EBRUSHOBJ_iSetSolidColor(EBRUSHOBJ
*pebo
, ULONG iSolidColor
)
149 ULONG iOldColor
= pebo
->BrushObject
.iSolidColor
;
150 pebo
->BrushObject
.iSolidColor
= iSolidColor
;
154 BOOL FASTCALL
IntGdiSetBrushOwner(PBRUSH
,DWORD
);
155 BOOL FASTCALL
GreSetBrushOwner(HBRUSH
,DWORD
);
158 IntGdiCreatePatternBrush(
162 IntGdiCreateSolidBrush(
166 IntGdiCreateNullBrush(VOID
);
169 IntGdiSetSolidBrushColor(HBRUSH hBrush
, COLORREF Color
);