ReactOS 0.4.16-dev-2208-g6350669
brush.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _BRUSHBODY
 
struct  _BRUSH
 
struct  _EBRUSHOBJ
 

Macros

#define NB_HATCH_STYLES   6
 
#define BR_NEED_FG_CLR   0x00000001
 
#define BR_NEED_BK_CLR   0x00000002 /* Background color is needed */
 
#define BR_DITHER_OK   0x00000004 /* Allow color dithering */
 
#define BR_IS_SOLID   0x00000010 /* Solid brush */
 
#define BR_IS_HATCH   0x00000020 /* Hatch brush */
 
#define BR_IS_BITMAP   0x00000040 /* DDB pattern brush */
 
#define BR_IS_DIB   0x00000080 /* DIB pattern brush */
 
#define BR_IS_NULL   0x00000100 /* Null/hollow brush */
 
#define BR_IS_GLOBAL   0x00000200 /* Stock objects */
 
#define BR_IS_PEN   0x00000400 /* Pen */
 
#define BR_IS_OLDSTYLEPEN   0x00000800 /* Geometric pen */
 
#define BR_IS_DIBPALCOLORS   0x00001000
 
#define BR_IS_DIBPALINDICES   0x00002000
 
#define BR_IS_DEFAULTSTYLE   0x00004000
 
#define BR_IS_MASKING   0x00008000 /* Pattern bitmap is used as transparent mask (?) */
 
#define BR_IS_INSIDEFRAME   0x00010000
 
#define BR_CACHED_ENGINE   0x00040000
 
#define BR_CACHED_IS_SOLID   0x80000000
 
#define BRUSH_ShareLockBrush(hBrush)   ((PBRUSH)GDIOBJ_ShareLockObj((HGDIOBJ)hBrush, GDI_OBJECT_TYPE_BRUSH))
 
#define BRUSH_ShareUnlockBrush(pBrush)   GDIOBJ_vDereferenceObject((POBJ)pBrush)
 
#define BRUSHOBJ_psoPattern(pbo)    EBRUSHOBJ_psoPattern(CONTAINING_RECORD(pbo, EBRUSHOBJ, BrushObject))
 
#define BRUSHOBJ_psoMask(pbo)    EBRUSHOBJ_psoMask(CONTAINING_RECORD(pbo, EBRUSHOBJ, BrushObject))
 

Typedefs

typedef struct _BRUSHBODY BRUSHBODY
 
typedef struct _BRUSH BRUSH
 
typedef struct _BRUSHPBRUSH
 
typedef struct _EBRUSHOBJ EBRUSHOBJ
 
typedef struct _EBRUSHOBJPEBRUSHOBJ
 

Functions

INT FASTCALL BRUSH_GetObject (PBRUSH GdiObject, INT Count, LPLOGBRUSH Buffer)
 
VOID NTAPI BRUSH_vDeleteObject (PVOID pvObject)
 
NTSTATUS NTAPI InitBrushImpl (VOID)
 
VOID NTAPI EBRUSHOBJ_vInit (EBRUSHOBJ *pebo, PBRUSH pbrush, struct _SURFACE *, COLORREF, COLORREF, struct _PALETTE *)
 
VOID NTAPI EBRUSHOBJ_vInitFromDC (EBRUSHOBJ *pebo, PBRUSH pbrush, struct _DC *)
 
VOID FASTCALL EBRUSHOBJ_vSetSolidRGBColor (EBRUSHOBJ *pebo, COLORREF crColor)
 
VOID NTAPI EBRUSHOBJ_vUpdateFromDC (EBRUSHOBJ *pebo, PBRUSH pbrush, struct _DC *)
 
BOOL NTAPI EBRUSHOBJ_bRealizeBrush (EBRUSHOBJ *pebo, BOOL bCallDriver)
 
VOID NTAPI EBRUSHOBJ_vCleanup (EBRUSHOBJ *pebo)
 
PVOID NTAPI EBRUSHOBJ_pvGetEngBrush (EBRUSHOBJ *pebo)
 
SURFOBJ *NTAPI EBRUSHOBJ_psoPattern (EBRUSHOBJ *pebo)
 
SURFOBJ *NTAPI EBRUSHOBJ_psoMask (EBRUSHOBJ *pebo)
 
FORCEINLINE ULONG EBRUSHOBJ_iSetSolidColor (EBRUSHOBJ *pebo, ULONG iSolidColor)
 
BOOL FASTCALL IntGdiSetBrushOwner (PBRUSH, DWORD)
 
BOOL FASTCALL GreSetBrushOwner (HBRUSH, DWORD)
 
HBRUSH APIENTRY IntGdiCreatePatternBrush (HBITMAP hBitmap)
 
HBRUSH APIENTRY IntGdiCreateSolidBrush (COLORREF Color)
 
HBRUSH APIENTRY IntGdiCreateNullBrush (VOID)
 
VOID NTAPI IntGdiSetSolidBrushColor (_In_ HBRUSH hbr, _In_ COLORREF crColor)
 

Variables

HSURF gahsurfHatch [HS_DDI_MAX]
 

Macro Definition Documentation

◆ BR_CACHED_ENGINE

#define BR_CACHED_ENGINE   0x00040000

Definition at line 114 of file brush.h.

◆ BR_CACHED_IS_SOLID

#define BR_CACHED_IS_SOLID   0x80000000

Definition at line 115 of file brush.h.

◆ BR_DITHER_OK

#define BR_DITHER_OK   0x00000004 /* Allow color dithering */

Definition at line 100 of file brush.h.

◆ BR_IS_BITMAP

#define BR_IS_BITMAP   0x00000040 /* DDB pattern brush */

Definition at line 103 of file brush.h.

◆ BR_IS_DEFAULTSTYLE

#define BR_IS_DEFAULTSTYLE   0x00004000

Definition at line 111 of file brush.h.

◆ BR_IS_DIB

#define BR_IS_DIB   0x00000080 /* DIB pattern brush */

Definition at line 104 of file brush.h.

◆ BR_IS_DIBPALCOLORS

#define BR_IS_DIBPALCOLORS   0x00001000

Definition at line 109 of file brush.h.

◆ BR_IS_DIBPALINDICES

#define BR_IS_DIBPALINDICES   0x00002000

Definition at line 110 of file brush.h.

◆ BR_IS_GLOBAL

#define BR_IS_GLOBAL   0x00000200 /* Stock objects */

Definition at line 106 of file brush.h.

◆ BR_IS_HATCH

#define BR_IS_HATCH   0x00000020 /* Hatch brush */

Definition at line 102 of file brush.h.

◆ BR_IS_INSIDEFRAME

#define BR_IS_INSIDEFRAME   0x00010000

Definition at line 113 of file brush.h.

◆ BR_IS_MASKING

#define BR_IS_MASKING   0x00008000 /* Pattern bitmap is used as transparent mask (?) */

Definition at line 112 of file brush.h.

◆ BR_IS_NULL

#define BR_IS_NULL   0x00000100 /* Null/hollow brush */

Definition at line 105 of file brush.h.

◆ BR_IS_OLDSTYLEPEN

#define BR_IS_OLDSTYLEPEN   0x00000800 /* Geometric pen */

Definition at line 108 of file brush.h.

◆ BR_IS_PEN

#define BR_IS_PEN   0x00000400 /* Pen */

Definition at line 107 of file brush.h.

◆ BR_IS_SOLID

#define BR_IS_SOLID   0x00000010 /* Solid brush */

Definition at line 101 of file brush.h.

◆ BR_NEED_BK_CLR

#define BR_NEED_BK_CLR   0x00000002 /* Background color is needed */

Definition at line 99 of file brush.h.

◆ BR_NEED_FG_CLR

#define BR_NEED_FG_CLR   0x00000001

Definition at line 98 of file brush.h.

◆ BRUSH_ShareLockBrush

#define BRUSH_ShareLockBrush (   hBrush)    ((PBRUSH)GDIOBJ_ShareLockObj((HGDIOBJ)hBrush, GDI_OBJECT_TYPE_BRUSH))

Definition at line 117 of file brush.h.

◆ BRUSH_ShareUnlockBrush

#define BRUSH_ShareUnlockBrush (   pBrush)    GDIOBJ_vDereferenceObject((POBJ)pBrush)

Definition at line 118 of file brush.h.

◆ BRUSHOBJ_psoMask

#define BRUSHOBJ_psoMask (   pbo)     EBRUSHOBJ_psoMask(CONTAINING_RECORD(pbo, EBRUSHOBJ, BrushObject))

Definition at line 182 of file brush.h.

◆ BRUSHOBJ_psoPattern

#define BRUSHOBJ_psoPattern (   pbo)     EBRUSHOBJ_psoPattern(CONTAINING_RECORD(pbo, EBRUSHOBJ, BrushObject))

Definition at line 175 of file brush.h.

◆ NB_HATCH_STYLES

#define NB_HATCH_STYLES   6

Definition at line 5 of file brush.h.

Typedef Documentation

◆ BRUSH

typedef struct _BRUSH BRUSH

◆ BRUSHBODY

◆ EBRUSHOBJ

◆ PBRUSH

typedef struct _BRUSH * PBRUSH

◆ PEBRUSHOBJ

Function Documentation

◆ BRUSH_GetObject()

INT FASTCALL BRUSH_GetObject ( PBRUSH  GdiObject,
INT  Count,
LPLOGBRUSH  Buffer 
)

Definition at line 271 of file brush.cpp.

275{
276 return pbr->cjGetObject(cjBuffer, plbBuffer);
277}
_In_ ULONG cjBuffer
Definition: ntgdi.h:2860

Referenced by GreGetObject().

◆ BRUSH_vDeleteObject()

VOID NTAPI BRUSH_vDeleteObject ( PVOID  pvObject)

Definition at line 263 of file brush.cpp.

265{
266 BRUSH::vDeleteObject(pvObject);
267}
static VOID vDeleteObject(_In_ PVOID pvObject)
Definition: brush.cpp:91

◆ EBRUSHOBJ_bRealizeBrush()

BOOL NTAPI EBRUSHOBJ_bRealizeBrush ( EBRUSHOBJ pebo,
BOOL  bCallDriver 
)

Definition at line 331 of file engbrush.c.

332{
333 BOOL bResult;
334 PFN_DrvRealizeBrush pfnRealizeBrush = NULL;
335 PSURFACE psurfPattern;
337 PPDEVOBJ ppdev;
338 EXLATEOBJ exlo;
339 PPALETTE ppalPattern;
340 PBRUSH pbr = pebo->pbrush;
341 HBITMAP hbmPattern;
343
344 /* All EBRUSHOBJs have a surface, see EBRUSHOBJ_vInit */
345 ASSERT(pebo->psurfTrg);
346
347 ppdev = (PPDEVOBJ)pebo->psurfTrg->SurfObj.hdev;
348 if (!ppdev)
349 ppdev = gpmdev->ppdevGlobal;
350
351 if (bCallDriver)
352 {
353 /* Get the Drv function */
354 pfnRealizeBrush = ppdev->DriverFunctions.RealizeBrush;
355 if (pfnRealizeBrush == NULL)
356 {
357 ERR("No DrvRealizeBrush. Cannot realize brush\n");
358 return FALSE;
359 }
360
361 /* Get the mask */
363 }
364 else
365 {
366 /* Use the Eng function */
367 pfnRealizeBrush = EngRealizeBrush;
368
369 /* We don't handle the mask bitmap here. We do this only on demand */
370 psoMask = NULL;
371 }
372
373 /* Check if this is a hatch brush */
374 if (pbr->flAttrs & BR_IS_HATCH)
375 {
376 /* Get the hatch brush pattern from the PDEV */
377 hbmPattern = (HBITMAP)ppdev->ahsurf[pbr->iHatch];
378 iHatch = pbr->iHatch;
379 }
380 else
381 {
382 /* Use the brushes pattern */
383 hbmPattern = pbr->hbmPattern;
384 iHatch = -1;
385 }
386
387 psurfPattern = SURFACE_ShareLockSurface(hbmPattern);
388 ASSERT(psurfPattern);
389 ASSERT(psurfPattern->ppal);
390
391 /* DIB brushes with DIB_PAL_COLORS usage need a new palette */
392 if (pbr->flAttrs & BR_IS_DIBPALCOLORS)
393 {
394 /* Create a palette with the colors from the DC */
395 ppalPattern = FixupDIBBrushPalette(psurfPattern->ppal, pebo->ppalDC);
396 if (ppalPattern == NULL)
397 {
398 ERR("FixupDIBBrushPalette() failed.\n");
399 return FALSE;
400 }
401
402 pebo->ppalDIB = ppalPattern;
403 }
404 else
405 {
406 /* The palette is already as it should be */
407 ppalPattern = psurfPattern->ppal;
408 }
409
410 /* Initialize XLATEOBJ for the brush */
412 ppalPattern,
413 pebo->psurfTrg->ppal,
414 0,
415 pebo->crCurrentBack,
416 pebo->crCurrentText);
417
418 /* Create the realization */
419 bResult = pfnRealizeBrush(&pebo->BrushObject,
420 &pebo->psurfTrg->SurfObj,
421 &psurfPattern->SurfObj,
422 psoMask,
423 &exlo.xlo,
424 iHatch);
425
426 /* Cleanup the XLATEOBJ */
427 EXLATEOBJ_vCleanup(&exlo);
428
429 /* Unlock surface */
430 SURFACE_ShareUnlockSurface(psurfPattern);
431
432 return bResult;
433}
#define ERR(fmt,...)
Definition: precomp.h:57
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
static PPALETTE FixupDIBBrushPalette(_In_ PPALETTE ppalDIB, _In_ PPALETTE ppalDC)
Definition: engbrush.c:291
BOOL APIENTRY EngRealizeBrush(BRUSHOBJ *pbo, SURFOBJ *psoDst, SURFOBJ *psoPattern, SURFOBJ *psoMask, XLATEOBJ *pxlo, ULONG iHatch)
Definition: engbrush.c:233
SURFOBJ *NTAPI EBRUSHOBJ_psoMask(EBRUSHOBJ *pebo)
Definition: engbrush.c:468
unsigned int BOOL
Definition: ntddk_ex.h:94
#define BR_IS_HATCH
Definition: brush.h:102
#define BR_IS_DIBPALCOLORS
Definition: brush.h:109
if(dx< 0)
Definition: linetemp.h:194
PMDEVOBJ gpmdev
Definition: mdevobj.c:14
struct _PDEVOBJ * PPDEVOBJ
Definition: mdevobj.h:6
#define ASSERT(a)
Definition: mode.c:44
static HBITMAP
Definition: button.c:44
Definition: types.h:101
PFN_DrvRealizeBrush RealizeBrush
Definition: ntgdityp.h:581
PBRUSH pbrush
Definition: brush.h:88
COLORREF crCurrentText
Definition: brush.h:78
BRUSHOBJ BrushObject
Definition: brush.h:71
struct _PALETTE * ppalDC
Definition: brush.h:85
struct _PALETTE * ppalDIB
Definition: brush.h:86
_Notnull_ SURFACE * psurfTrg
Definition: brush.h:83
COLORREF crCurrentBack
Definition: brush.h:79
XLATEOBJ xlo
Definition: xlateobj.h:21
PPDEVOBJ ppdevGlobal
Definition: mdevobj.h:16
HSURF ahsurf[HS_DDI_MAX]
Definition: pdevobj.h:97
DRIVER_FUNCTIONS DriverFunctions
Definition: pdevobj.h:137
SURFOBJ SurfObj
Definition: surface.h:8
struct _PALETTE *const ppal
Definition: surface.h:11
HDEV hdev
Definition: winddi.h:1208
uint32_t ULONG
Definition: typedefs.h:59
#define SURFACE_ShareUnlockSurface(pBMObj)
Definition: surface.h:102
#define SURFACE_ShareLockSurface(hBMObj)
Definition: surface.h:91
_In_opt_ SURFOBJ _In_opt_ SURFOBJ * psoMask
Definition: winddi.h:3434
FN_DrvRealizeBrush * PFN_DrvRealizeBrush
Definition: winddi.h:3964
_Inout_ SURFOBJ _In_opt_ SURFOBJ _In_opt_ SURFOBJ _In_opt_ XLATEOBJ _In_ ULONG iHatch
Definition: winddi.h:3963
VOID NTAPI EXLATEOBJ_vInitialize(_Out_ PEXLATEOBJ pexlo, _In_opt_ PALETTE *ppalSrc, _In_opt_ PALETTE *ppalDst, _In_ COLORREF crSrcBackColor, _In_ COLORREF crDstBackColor, _In_ COLORREF crDstForeColor)
Definition: xlateobj.c:491
VOID NTAPI EXLATEOBJ_vCleanup(_Inout_ PEXLATEOBJ pexlo)
Definition: xlateobj.c:894

Referenced by BRUSHOBJ_pvGetRbrush(), and EBRUSHOBJ_pvGetEngBrush().

◆ EBRUSHOBJ_iSetSolidColor()

FORCEINLINE ULONG EBRUSHOBJ_iSetSolidColor ( EBRUSHOBJ pebo,
ULONG  iSolidColor 
)

Definition at line 187 of file brush.h.

188{
189 ULONG iOldColor = pebo->BrushObject.iSolidColor;
190 pebo->BrushObject.iSolidColor = iSolidColor;
191 return iOldColor;
192}
ULONG iSolidColor
Definition: winddi.h:234

Referenced by NtGdiSetPixel().

◆ EBRUSHOBJ_psoMask()

SURFOBJ *NTAPI EBRUSHOBJ_psoMask ( EBRUSHOBJ pebo)

Definition at line 468 of file engbrush.c.

469{
470 HBITMAP hbmMask;
471 PSURFACE psurfMask;
472 PPDEVOBJ ppdev;
473
474 /* Check if we don't have a mask yet */
475 if (pebo->psoMask == NULL)
476 {
477 /* Check if this is a hatch brush */
478 if (pebo->flattrs & BR_IS_HATCH)
479 {
480 /* Get the PDEV */
481 ppdev = (PPDEVOBJ)pebo->psurfTrg->SurfObj.hdev;
482 if (!ppdev)
483 ppdev = gpmdev->ppdevGlobal;
484
485 /* Use the hatch bitmap as the mask */
486 hbmMask = (HBITMAP)ppdev->ahsurf[pebo->pbrush->iHatch];
487 psurfMask = SURFACE_ShareLockSurface(hbmMask);
488 if (psurfMask == NULL)
489 {
490 ERR("Failed to lock hatch brush for PDEV %p, iHatch %lu\n",
491 ppdev, pebo->pbrush->iHatch);
492 return NULL;
493 }
494
496 pebo->psoMask = &psurfMask->SurfObj;
497 }
498 }
499
500 return pebo->psoMask;
501}
FLONG flattrs
Definition: brush.h:89
SURFOBJ * psoMask
Definition: brush.h:94
ULONG iBitmapFormat
Definition: winddi.h:1215
#define BMF_1BPP
Definition: winddi.h:355
#define NT_ASSERT
Definition: rtlfuncs.h:3327

Referenced by EBRUSHOBJ_bRealizeBrush().

◆ EBRUSHOBJ_psoPattern()

SURFOBJ *NTAPI EBRUSHOBJ_psoPattern ( EBRUSHOBJ pebo)

Definition at line 457 of file engbrush.c.

458{
459 PSURFACE psurfPattern;
460
461 psurfPattern = EBRUSHOBJ_pvGetEngBrush(pebo);
462
463 return psurfPattern ? &psurfPattern->SurfObj : NULL;
464}
PVOID NTAPI EBRUSHOBJ_pvGetEngBrush(EBRUSHOBJ *pebo)
Definition: engbrush.c:437

◆ EBRUSHOBJ_pvGetEngBrush()

PVOID NTAPI EBRUSHOBJ_pvGetEngBrush ( EBRUSHOBJ pebo)

Definition at line 437 of file engbrush.c.

438{
439 BOOL bResult;
440
441 if (!pebo->pengbrush)
442 {
443 bResult = EBRUSHOBJ_bRealizeBrush(pebo, FALSE);
444 if (!bResult)
445 {
446 if (pebo->pengbrush)
448 pebo->pengbrush = NULL;
449 }
450 }
451
452 return pebo->pengbrush;
453}
BOOL NTAPI EBRUSHOBJ_bRealizeBrush(EBRUSHOBJ *pebo, BOOL bCallDriver)
Definition: engbrush.c:331
PVOID pengbrush
Definition: brush.h:75
ENGAPI BOOL APIENTRY EngDeleteSurface(_In_ _Post_ptr_invalid_ HSURF hsurf)
Definition: surface.c:567

Referenced by EBRUSHOBJ_psoPattern().

◆ EBRUSHOBJ_vCleanup()

VOID NTAPI EBRUSHOBJ_vCleanup ( EBRUSHOBJ pebo)

Definition at line 175 of file engbrush.c.

176{
177 /* Check if there's a GDI realisation */
178 if (pebo->pengbrush)
179 {
180 /* Unlock the bitmap again */
182 pebo->pengbrush = NULL;
183 }
184
185 /* Check if there's a driver's realisation */
186 if (pebo->BrushObject.pvRbrush)
187 {
188 /* Free allocated driver memory */
190 pebo->BrushObject.pvRbrush = NULL;
191 }
192
193 if (pebo->psoMask != NULL)
194 {
196 pebo->psoMask = NULL;
197 }
198
199 /* Dereference the palettes */
200 if (pebo->ppalSurf)
201 {
203 }
204 if (pebo->ppalDC)
205 {
207 }
208 if (pebo->ppalDIB)
209 {
211 }
212}
#define EngFreeMem
Definition: polytest.cpp:56
PVOID pvRbrush
Definition: winddi.h:235
_Notnull_ struct _PALETTE * ppalSurf
Definition: brush.h:84
#define PALETTE_ShareUnlockPalette(ppal)
Definition: palette.h:59

Referenced by DC_vCleanup(), EBRUSHOBJ_vUpdateFromDC(), GdiFlushUserBatch(), IntGdiPolyPatBlt(), and UserDrawIconEx().

◆ EBRUSHOBJ_vInit()

VOID NTAPI EBRUSHOBJ_vInit ( EBRUSHOBJ pebo,
PBRUSH  pbrush,
struct _SURFACE ,
COLORREF  ,
COLORREF  ,
struct _PALETTE  
)

◆ EBRUSHOBJ_vInitFromDC()

VOID NTAPI EBRUSHOBJ_vInitFromDC ( EBRUSHOBJ pebo,
PBRUSH  pbrush,
struct _DC  
)

◆ EBRUSHOBJ_vSetSolidRGBColor()

VOID FASTCALL EBRUSHOBJ_vSetSolidRGBColor ( EBRUSHOBJ pebo,
COLORREF  crColor 
)

Definition at line 122 of file engbrush.c.

123{
124 ULONG iSolidColor;
125 EXLATEOBJ exlo;
126
127 /* Never use with non-solid brushes */
128 ASSERT(pebo->flattrs & BR_IS_SOLID);
129
130 /* Set the RGB color */
131 crColor &= 0xFFFFFF;
132 pebo->crRealize = crColor;
133 pebo->ulRGBColor = crColor;
134
135 /* Special handling for mono-surfaces */
136 if (pebo->ppalSurf->flFlags & PAL_MONOCHROME)
137 {
138 /* Determine the indices for back and fore color */
139 ULONG iBackIndex =
141 ULONG iForeIndex = iBackIndex ^ 1;
142
143 /* Get the translated back color */
144 ULONG rgbBack = PALETTE_ulGetRGBColorFromIndex(pebo->ppalSurf, iBackIndex);
145
146 /* Match the pen color against RGB and translated background color */
147 if ((crColor == rgbBack) || (crColor == pebo->crCurrentBack))
148 pebo->BrushObject.iSolidColor = iBackIndex;
149 else
150 pebo->BrushObject.iSolidColor = iForeIndex;
151
152 pebo->flattrs |= BR_NEED_BK_CLR;
153 }
154 else
155 {
156 /* Initialize an XLATEOBJ RGB -> surface */
158 &gpalRGB,
159 pebo->ppalSurf,
160 pebo->crCurrentBack,
161 0,
162 0);
163
164 /* Translate the brush color to the target format */
165 iSolidColor = XLATEOBJ_iXlate(&exlo.xlo, crColor);
166 pebo->BrushObject.iSolidColor = iSolidColor;
167
168 /* Clean up the XLATEOBJ */
169 EXLATEOBJ_vCleanup(&exlo);
170 }
171}
#define BR_IS_SOLID
Definition: brush.h:101
#define BR_NEED_BK_CLR
Definition: brush.h:99
ULONG ulRGBColor
Definition: brush.h:74
COLORREF crRealize
Definition: brush.h:73
PALETTE gpalRGB
Definition: palette.c:20
ULONG NTAPI PALETTE_ulGetNearestPaletteIndex(PALETTE *ppal, ULONG iColor)
Definition: palette.c:264
@ PAL_MONOCHROME
Definition: palette.h:22
FORCEINLINE ULONG PALETTE_ulGetRGBColorFromIndex(PPALETTE ppal, ULONG ulIndex)
Definition: palette.h:142
ENGAPI ULONG APIENTRY XLATEOBJ_iXlate(_In_ XLATEOBJ *pxlo, _In_ ULONG iColor)
Definition: xlateobj.c:909

Referenced by DC_vUpdateBackgroundBrush(), DC_vUpdateFillBrush(), DC_vUpdateLineBrush(), DC_vUpdateTextBrush(), and EBRUSHOBJ_vInit().

◆ EBRUSHOBJ_vUpdateFromDC()

VOID NTAPI EBRUSHOBJ_vUpdateFromDC ( EBRUSHOBJ pebo,
PBRUSH  pbrush,
struct _DC  
)

◆ GreSetBrushOwner()

BOOL FASTCALL GreSetBrushOwner ( HBRUSH  ,
DWORD   
)

◆ InitBrushImpl()

NTSTATUS NTAPI InitBrushImpl ( VOID  )

Internal functions

Definition at line 31 of file engbrush.c.

32{
33 ULONG i;
34 SIZEL sizl = {8, 8};
35
36 /* Loop all hatch styles */
37 for (i = 0; i < HS_DDI_MAX; i++)
38 {
39 /* Create a default hatch bitmap */
41 0,
43 0,
45 }
46
47 return STATUS_SUCCESS;
48}
static const ULONG gaulHatchBrushes[HS_DDI_MAX][8]
Definition: engbrush.c:14
HSURF gahsurfHatch[HS_DDI_MAX]
Definition: engbrush.c:24
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define STATUS_SUCCESS
Definition: shellext.h:65
ENGAPI HBITMAP APIENTRY EngCreateBitmap(_In_ SIZEL sizl, _In_ LONG lWidth, _In_ ULONG iFormat, _In_ FLONG fl, _In_opt_ PVOID pvBits)
#define HS_DDI_MAX
Definition: winddi.h:3954
typedef HSURF(APIENTRY FN_DrvEnableSurface)(_In_ DHPDEV dhpdev)
_In_ SIZEL sizl
Definition: winddi.h:3467

Referenced by DriverEntry().

◆ IntGdiCreateNullBrush()

HBRUSH APIENTRY IntGdiCreateNullBrush ( VOID  )

Definition at line 281 of file brush.cpp.

283{
284 /* Call the internal function */
286}
static HBRUSH CreateBrushInternal(_In_ ULONG flAttrs, _In_ COLORREF crColor, _In_ ULONG iHatch, _In_opt_ HBITMAP hbmPattern, _In_opt_ PVOID pvClient)
Definition: brush.cpp:202
#define BR_IS_GLOBAL
Definition: brush.h:106
#define BR_IS_NULL
Definition: brush.h:105

Referenced by CreateStockObjects().

◆ IntGdiCreatePatternBrush()

HBRUSH APIENTRY IntGdiCreatePatternBrush ( HBITMAP  hBitmap)

Definition at line 303 of file brush.cpp.

305{
306 NT_ASSERT(hbmPattern != NULL);
307 GreSetBitmapOwner(hbmPattern, BASEOBJECT::OWNER::PUBLIC);
309 0,
310 0,
311 hbmPattern,
312 NULL);
313}
BOOL NTAPI GreSetBitmapOwner(_In_ HBITMAP hbmp, _In_ ULONG ulOwner)
Definition: bitmaps.c:17
#define BR_IS_BITMAP
Definition: brush.h:103

Referenced by UserInitialize().

◆ IntGdiCreateSolidBrush()

HBRUSH APIENTRY IntGdiCreateSolidBrush ( COLORREF  Color)

Definition at line 290 of file brush.cpp.

292{
293 /* Call the internal function */
295 crColor,
296 0,
297 NULL,
298 NULL);
299}

Referenced by CreateStockObjects(), and CreateSysColorObjects().

◆ IntGdiSetBrushOwner()

BOOL FASTCALL IntGdiSetBrushOwner ( PBRUSH  ,
DWORD   
)

◆ IntGdiSetSolidBrushColor()

VOID NTAPI IntGdiSetSolidBrushColor ( _In_ HBRUSH  hbr,
_In_ COLORREF  crColor 
)

Definition at line 317 of file brush.cpp.

320{
321 PBRUSH pbr;
322
323 /* Lock the brush */
324 pbr = BRUSH::LockAny(hbr);
325 if (pbr == NULL)
326 {
327 ERR("Failed to lock brush %p\n", hbr);
328 return;
329 }
330
331 /* Call the member function */
332 pbr->vSetSolidColor(crColor);
333
334 /* Unlock the brush */
335 pbr->vUnlock();
336}

Referenced by IntSetSysColors().

Variable Documentation

◆ gahsurfHatch

HSURF gahsurfHatch[HS_DDI_MAX]
extern

Definition at line 24 of file engbrush.c.

Referenced by InitBrushImpl(), and PDEVOBJ_bEnablePDEV().