ReactOS  0.4.13-dev-92-gf251225
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)
 
INIT_FUNCTION 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 110 of file brush.h.

◆ BR_CACHED_IS_SOLID

#define BR_CACHED_IS_SOLID   0x80000000

Definition at line 111 of file brush.h.

◆ BR_DITHER_OK

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

Definition at line 96 of file brush.h.

◆ BR_IS_BITMAP

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

Definition at line 99 of file brush.h.

◆ BR_IS_DEFAULTSTYLE

#define BR_IS_DEFAULTSTYLE   0x00004000

Definition at line 107 of file brush.h.

◆ BR_IS_DIB

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

Definition at line 100 of file brush.h.

◆ BR_IS_DIBPALCOLORS

#define BR_IS_DIBPALCOLORS   0x00001000

Definition at line 105 of file brush.h.

◆ BR_IS_DIBPALINDICES

#define BR_IS_DIBPALINDICES   0x00002000

Definition at line 106 of file brush.h.

◆ BR_IS_GLOBAL

#define BR_IS_GLOBAL   0x00000200 /* Stock objects */

Definition at line 102 of file brush.h.

◆ BR_IS_HATCH

#define BR_IS_HATCH   0x00000020 /* Hatch brush */

Definition at line 98 of file brush.h.

◆ BR_IS_INSIDEFRAME

#define BR_IS_INSIDEFRAME   0x00010000

Definition at line 109 of file brush.h.

◆ BR_IS_MASKING

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

Definition at line 108 of file brush.h.

◆ BR_IS_NULL

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

Definition at line 101 of file brush.h.

◆ BR_IS_OLDSTYLEPEN

#define BR_IS_OLDSTYLEPEN   0x00000800 /* Geometric pen */

Definition at line 104 of file brush.h.

◆ BR_IS_PEN

#define BR_IS_PEN   0x00000400 /* Pen */

Definition at line 103 of file brush.h.

◆ BR_IS_SOLID

#define BR_IS_SOLID   0x00000010 /* Solid brush */

Definition at line 97 of file brush.h.

◆ BR_NEED_BK_CLR

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

Definition at line 95 of file brush.h.

◆ BR_NEED_FG_CLR

#define BR_NEED_FG_CLR   0x00000001

Definition at line 94 of file brush.h.

◆ BRUSH_ShareLockBrush

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

Definition at line 113 of file brush.h.

◆ BRUSH_ShareUnlockBrush

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

Definition at line 114 of file brush.h.

◆ BRUSHOBJ_psoMask

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

Definition at line 178 of file brush.h.

◆ BRUSHOBJ_psoPattern

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

Definition at line 171 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 260 of file brush.cpp.

264 {
265  return pbr->cjGetObject(cjBuffer, plbBuffer);
266 }
_In_ ULONG cjBuffer
Definition: ntgdi.h:2860

Referenced by GreGetObject().

◆ BRUSH_vDeleteObject()

VOID NTAPI BRUSH_vDeleteObject ( PVOID  pvObject)

Definition at line 252 of file brush.cpp.

254 {
255  BRUSH::vDeleteObject(pvObject);
256 }
static VOID vDeleteObject(_In_ PVOID pvObject)
Definition: brush.cpp:80

◆ EBRUSHOBJ_bRealizeBrush()

BOOL NTAPI EBRUSHOBJ_bRealizeBrush ( EBRUSHOBJ pebo,
BOOL  bCallDriver 
)

Definition at line 309 of file engbrush.c.

310 {
311  BOOL bResult;
312  PFN_DrvRealizeBrush pfnRealizeBrush = NULL;
313  PSURFACE psurfPattern;
314  SURFOBJ *psoMask;
315  PPDEVOBJ ppdev;
316  EXLATEOBJ exlo;
317  PPALETTE ppalPattern;
318  PBRUSH pbr = pebo->pbrush;
319  HBITMAP hbmPattern;
320  ULONG iHatch;
321 
322  /* All EBRUSHOBJs have a surface, see EBRUSHOBJ_vInit */
323  ASSERT(pebo->psurfTrg);
324 
325  ppdev = (PPDEVOBJ)pebo->psurfTrg->SurfObj.hdev;
326  if (!ppdev)
327  ppdev = gppdevPrimary;
328 
329  if (bCallDriver)
330  {
331  /* Get the Drv function */
332  pfnRealizeBrush = ppdev->DriverFunctions.RealizeBrush;
333  if (pfnRealizeBrush == NULL)
334  {
335  ERR("No DrvRealizeBrush. Cannot realize brush\n");
336  return FALSE;
337  }
338 
339  /* Get the mask */
340  psoMask = EBRUSHOBJ_psoMask(pebo);
341  }
342  else
343  {
344  /* Use the Eng function */
345  pfnRealizeBrush = EngRealizeBrush;
346 
347  /* We don't handle the mask bitmap here. We do this only on demand */
348  psoMask = NULL;
349  }
350 
351  /* Check if this is a hatch brush */
352  if (pbr->flAttrs & BR_IS_HATCH)
353  {
354  /* Get the hatch brush pattern from the PDEV */
355  hbmPattern = (HBITMAP)ppdev->ahsurf[pbr->iHatch];
356  iHatch = pbr->iHatch;
357  }
358  else
359  {
360  /* Use the brushes pattern */
361  hbmPattern = pbr->hbmPattern;
362  iHatch = -1;
363  }
364 
365  psurfPattern = SURFACE_ShareLockSurface(hbmPattern);
366  ASSERT(psurfPattern);
367  ASSERT(psurfPattern->ppal);
368 
369  /* DIB brushes with DIB_PAL_COLORS usage need a new palette */
370  if (pbr->flAttrs & BR_IS_DIBPALCOLORS)
371  {
372  /* Create a palette with the colors from the DC */
373  ppalPattern = FixupDIBBrushPalette(psurfPattern->ppal, pebo->ppalDC);
374  if (ppalPattern == NULL)
375  {
376  ERR("FixupDIBBrushPalette() failed.\n");
377  return FALSE;
378  }
379 
380  pebo->ppalDIB = ppalPattern;
381  }
382  else
383  {
384  /* The palette is already as it should be */
385  ppalPattern = psurfPattern->ppal;
386  }
387 
388  /* Initialize XLATEOBJ for the brush */
389  EXLATEOBJ_vInitialize(&exlo,
390  ppalPattern,
391  pebo->psurfTrg->ppal,
392  0,
393  pebo->crCurrentBack,
394  pebo->crCurrentText);
395 
396  /* Create the realization */
397  bResult = pfnRealizeBrush(&pebo->BrushObject,
398  &pebo->psurfTrg->SurfObj,
399  &psurfPattern->SurfObj,
400  psoMask,
401  &exlo.xlo,
402  iHatch);
403 
404  /* Cleanup the XLATEOBJ */
405  EXLATEOBJ_vCleanup(&exlo);
406 
407  /* Unlock surface */
408  SURFACE_ShareUnlockSurface(psurfPattern);
409 
410  return bResult;
411 }
#define SURFACE_ShareUnlockSurface(pBMObj)
Definition: surface.h:102
BOOL APIENTRY EngRealizeBrush(BRUSHOBJ *pbo, SURFOBJ *psoDst, SURFOBJ *psoPattern, SURFOBJ *psoMask, XLATEOBJ *pxlo, ULONG iHatch)
Definition: engbrush.c:211
PPDEVOBJ gppdevPrimary
Definition: pdevobj.c:13
struct _PALETTE *const ppal
Definition: surface.h:11
#define SURFACE_ShareLockSurface(hBMObj)
Definition: surface.h:91
SURFACE * psurfTrg
Definition: brush.h:79
struct _PDEVOBJ * PPDEVOBJ
XLATEOBJ xlo
Definition: xlateobj.h:21
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:358
DRIVER_FUNCTIONS DriverFunctions
Definition: pdevobj.h:138
unsigned int BOOL
Definition: ntddk_ex.h:94
struct _PALETTE * ppalDIB
Definition: brush.h:82
PFN_DrvRealizeBrush RealizeBrush
Definition: ntgdityp.h:575
SURFOBJ *NTAPI EBRUSHOBJ_psoMask(EBRUSHOBJ *pebo)
Definition: engbrush.c:446
SURFOBJ SurfObj
Definition: surface.h:8
smooth NULL
Definition: ftsmooth.c:416
PBRUSH pbrush
Definition: brush.h:84
VOID NTAPI EXLATEOBJ_vCleanup(_Inout_ PEXLATEOBJ pexlo)
Definition: xlateobj.c:649
static PPALETTE FixupDIBBrushPalette(_In_ PPALETTE ppalDIB, _In_ PPALETTE ppalDC)
Definition: engbrush.c:269
Definition: types.h:100
if(!(yy_init))
Definition: macro.lex.yy.c:714
COLORREF crCurrentBack
Definition: brush.h:75
BRUSHOBJ BrushObject
Definition: brush.h:67
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
HDEV hdev
Definition: winddi.h:1208
#define BR_IS_HATCH
Definition: brush.h:98
_Inout_ SURFOBJ _In_opt_ SURFOBJ _In_opt_ SURFOBJ _In_opt_ XLATEOBJ _In_ ULONG iHatch
Definition: winddi.h:3959
#define ERR(fmt,...)
Definition: debug.h:109
FN_DrvRealizeBrush * PFN_DrvRealizeBrush
Definition: winddi.h:3964
#define BR_IS_DIBPALCOLORS
Definition: brush.h:105
_In_opt_ SURFOBJ _In_opt_ SURFOBJ * psoMask
Definition: winddi.h:3433
struct _PALETTE * ppalDC
Definition: brush.h:81
unsigned int ULONG
Definition: retypes.h:1
static HBITMAP
Definition: button.c:44
HSURF ahsurf[HS_DDI_MAX]
Definition: pdevobj.h:99
COLORREF crCurrentText
Definition: brush.h:74

Referenced by BRUSHOBJ_pvGetRbrush(), and EBRUSHOBJ_pvGetEngBrush().

◆ EBRUSHOBJ_iSetSolidColor()

FORCEINLINE ULONG EBRUSHOBJ_iSetSolidColor ( EBRUSHOBJ pebo,
ULONG  iSolidColor 
)

Definition at line 183 of file brush.h.

184 {
185  ULONG iOldColor = pebo->BrushObject.iSolidColor;
186  pebo->BrushObject.iSolidColor = iSolidColor;
187  return iOldColor;
188 }
BRUSHOBJ BrushObject
Definition: brush.h:67
ULONG iSolidColor
Definition: winddi.h:234
unsigned int ULONG
Definition: retypes.h:1

Referenced by NtGdiSetPixel().

◆ EBRUSHOBJ_psoMask()

SURFOBJ* NTAPI EBRUSHOBJ_psoMask ( EBRUSHOBJ pebo)

Definition at line 446 of file engbrush.c.

447 {
448  HBITMAP hbmMask;
449  PSURFACE psurfMask;
450  PPDEVOBJ ppdev;
451 
452  /* Check if we don't have a mask yet */
453  if (pebo->psoMask == NULL)
454  {
455  /* Check if this is a hatch brush */
456  if (pebo->flattrs & BR_IS_HATCH)
457  {
458  /* Get the PDEV */
459  ppdev = (PPDEVOBJ)pebo->psurfTrg->SurfObj.hdev;
460  if (!ppdev)
461  ppdev = gppdevPrimary;
462 
463  /* Use the hatch bitmap as the mask */
464  hbmMask = (HBITMAP)ppdev->ahsurf[pebo->pbrush->iHatch];
465  psurfMask = SURFACE_ShareLockSurface(hbmMask);
466  if (psurfMask == NULL)
467  {
468  ERR("Failed to lock hatch brush for PDEV %p, iHatch %lu\n",
469  ppdev, pebo->pbrush->iHatch);
470  return NULL;
471  }
472 
473  NT_ASSERT(psurfMask->SurfObj.iBitmapFormat == BMF_1BPP);
474  pebo->psoMask = &psurfMask->SurfObj;
475  }
476  }
477 
478  return pebo->psoMask;
479 }
PPDEVOBJ gppdevPrimary
Definition: pdevobj.c:13
SURFOBJ * psoMask
Definition: brush.h:90
ULONG iBitmapFormat
Definition: winddi.h:1215
#define SURFACE_ShareLockSurface(hBMObj)
Definition: surface.h:91
SURFACE * psurfTrg
Definition: brush.h:79
struct _PDEVOBJ * PPDEVOBJ
SURFOBJ SurfObj
Definition: surface.h:8
smooth NULL
Definition: ftsmooth.c:416
PBRUSH pbrush
Definition: brush.h:84
if(!(yy_init))
Definition: macro.lex.yy.c:714
HDEV hdev
Definition: winddi.h:1208
FLONG flattrs
Definition: brush.h:85
#define BR_IS_HATCH
Definition: brush.h:98
#define ERR(fmt,...)
Definition: debug.h:109
Definition: xlate.c:8
static HBITMAP
Definition: button.c:44
HSURF ahsurf[HS_DDI_MAX]
Definition: pdevobj.h:99
#define NT_ASSERT
Definition: rtlfuncs.h:3312

Referenced by EBRUSHOBJ_bRealizeBrush().

◆ EBRUSHOBJ_psoPattern()

SURFOBJ* NTAPI EBRUSHOBJ_psoPattern ( EBRUSHOBJ pebo)

Definition at line 435 of file engbrush.c.

436 {
437  PSURFACE psurfPattern;
438 
439  psurfPattern = EBRUSHOBJ_pvGetEngBrush(pebo);
440 
441  return psurfPattern ? &psurfPattern->SurfObj : NULL;
442 }
SURFOBJ SurfObj
Definition: surface.h:8
smooth NULL
Definition: ftsmooth.c:416
PVOID NTAPI EBRUSHOBJ_pvGetEngBrush(EBRUSHOBJ *pebo)
Definition: engbrush.c:415

◆ EBRUSHOBJ_pvGetEngBrush()

PVOID NTAPI EBRUSHOBJ_pvGetEngBrush ( EBRUSHOBJ pebo)

Definition at line 415 of file engbrush.c.

416 {
417  BOOL bResult;
418 
419  if (!pebo->pengbrush)
420  {
421  bResult = EBRUSHOBJ_bRealizeBrush(pebo, FALSE);
422  if (!bResult)
423  {
424  if (pebo->pengbrush)
426  pebo->pengbrush = NULL;
427  }
428  }
429 
430  return pebo->pengbrush;
431 }
ENGAPI BOOL APIENTRY EngDeleteSurface(_In_ _Post_ptr_invalid_ HSURF hsurf)
Definition: surface.c:564
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
PVOID pengbrush
Definition: brush.h:71
BOOL NTAPI EBRUSHOBJ_bRealizeBrush(EBRUSHOBJ *pebo, BOOL bCallDriver)
Definition: engbrush.c:309

Referenced by EBRUSHOBJ_psoPattern().

◆ EBRUSHOBJ_vCleanup()

VOID NTAPI EBRUSHOBJ_vCleanup ( EBRUSHOBJ pebo)

Definition at line 153 of file engbrush.c.

154 {
155  /* Check if there's a GDI realisation */
156  if (pebo->pengbrush)
157  {
158  /* Unlock the bitmap again */
160  pebo->pengbrush = NULL;
161  }
162 
163  /* Check if there's a driver's realisation */
164  if (pebo->BrushObject.pvRbrush)
165  {
166  /* Free allocated driver memory */
168  pebo->BrushObject.pvRbrush = NULL;
169  }
170 
171  if (pebo->psoMask != NULL)
172  {
174  pebo->psoMask = NULL;
175  }
176 
177  /* Dereference the palettes */
178  if (pebo->ppalSurf)
179  {
181  }
182  if (pebo->ppalDC)
183  {
185  }
186  if (pebo->ppalDIB)
187  {
189  }
190 }
#define SURFACE_ShareUnlockSurface(pBMObj)
Definition: surface.h:102
#define EngFreeMem
Definition: polytest.cpp:56
SURFOBJ * psoMask
Definition: brush.h:90
struct _PALETTE * ppalDIB
Definition: brush.h:82
smooth NULL
Definition: ftsmooth.c:416
struct _PALETTE * ppalSurf
Definition: brush.h:80
PVOID pengbrush
Definition: brush.h:71
BRUSHOBJ BrushObject
Definition: brush.h:67
PVOID pvRbrush
Definition: winddi.h:235
#define PALETTE_ShareUnlockPalette(ppal)
Definition: palette.h:59
struct _PALETTE * ppalDC
Definition: brush.h:81

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  /* Initialize an XLATEOBJ RGB -> surface */
136  EXLATEOBJ_vInitialize(&exlo,
137  &gpalRGB,
138  pebo->ppalSurf,
139  pebo->crCurrentBack,
140  0,
141  0);
142 
143  /* Translate the brush color to the target format */
144  iSolidColor = XLATEOBJ_iXlate(&exlo.xlo, crColor);
145  pebo->BrushObject.iSolidColor = iSolidColor;
146 
147  /* Clean up the XLATEOBJ */
148  EXLATEOBJ_vCleanup(&exlo);
149 }
#define BR_IS_SOLID
Definition: brush.h:97
XLATEOBJ xlo
Definition: xlateobj.h:21
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:358
VOID NTAPI EXLATEOBJ_vCleanup(_Inout_ PEXLATEOBJ pexlo)
Definition: xlateobj.c:649
struct _PALETTE * ppalSurf
Definition: brush.h:80
COLORREF crCurrentBack
Definition: brush.h:75
BRUSHOBJ BrushObject
Definition: brush.h:67
ULONG ulRGBColor
Definition: brush.h:70
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
FLONG flattrs
Definition: brush.h:85
ULONG iSolidColor
Definition: winddi.h:234
COLORREF crRealize
Definition: brush.h:69
unsigned int ULONG
Definition: retypes.h:1
PALETTE gpalRGB
Definition: palette.c:17
ENGAPI ULONG APIENTRY XLATEOBJ_iXlate(_In_ XLATEOBJ *pxlo, _In_ ULONG iColor)
Definition: xlateobj.c:664

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()

INIT_FUNCTION 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,
42  BMF_1BPP,
43  0,
45  }
46 
47  return STATUS_SUCCESS;
48 }
#define HS_DDI_MAX
Definition: winddi.h:3954
_In_ SIZEL sizl
Definition: winddi.h:3467
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
static const ULONG gaulHatchBrushes[HS_DDI_MAX][8]
Definition: engbrush.c:14
HSURF gahsurfHatch[HS_DDI_MAX]
Definition: engbrush.c:24
typedef HSURF(APIENTRY FN_DrvEnableSurface)(_In_ DHPDEV dhpdev)
Definition: xlate.c:8
unsigned int ULONG
Definition: retypes.h:1
return STATUS_SUCCESS
Definition: btrfs.c:2725
ENGAPI HBITMAP APIENTRY EngCreateBitmap(_In_ SIZEL sizl, _In_ LONG lWidth, _In_ ULONG iFormat, _In_ FLONG fl, _In_opt_ PVOID pvBits)

Referenced by DriverEntry().

◆ IntGdiCreateNullBrush()

HBRUSH APIENTRY IntGdiCreateNullBrush ( VOID  )

Definition at line 270 of file brush.cpp.

272 {
273  /* Call the internal function */
275 }
smooth NULL
Definition: ftsmooth.c:416
#define BR_IS_NULL
Definition: brush.h:101
#define BR_IS_GLOBAL
Definition: brush.h:102
static HBRUSH CreateBrushInternal(_In_ ULONG flAttrs, _In_ COLORREF crColor, _In_ ULONG iHatch, _In_opt_ HBITMAP hbmPattern, _In_opt_ PVOID pvClient)
Definition: brush.cpp:191

Referenced by CreateStockObjects().

◆ IntGdiCreatePatternBrush()

HBRUSH APIENTRY IntGdiCreatePatternBrush ( HBITMAP  hBitmap)

Definition at line 292 of file brush.cpp.

294 {
295  NT_ASSERT(hbmPattern != NULL);
296  GreSetBitmapOwner(hbmPattern, BASEOBJECT::OWNER::PUBLIC);
298  0,
299  0,
300  hbmPattern,
301  NULL);
302 }
#define BR_IS_BITMAP
Definition: brush.h:99
smooth NULL
Definition: ftsmooth.c:416
BOOL NTAPI GreSetBitmapOwner(_In_ HBITMAP hbmp, _In_ ULONG ulOwner)
Definition: bitmaps.c:17
#define BR_IS_GLOBAL
Definition: brush.h:102
static HBRUSH CreateBrushInternal(_In_ ULONG flAttrs, _In_ COLORREF crColor, _In_ ULONG iHatch, _In_opt_ HBITMAP hbmPattern, _In_opt_ PVOID pvClient)
Definition: brush.cpp:191
#define NT_ASSERT
Definition: rtlfuncs.h:3312

Referenced by UserInitialize().

◆ IntGdiCreateSolidBrush()

HBRUSH APIENTRY IntGdiCreateSolidBrush ( COLORREF  Color)

Definition at line 279 of file brush.cpp.

281 {
282  /* Call the internal function */
284  crColor,
285  0,
286  NULL,
287  NULL);
288 }
#define BR_IS_SOLID
Definition: brush.h:97
smooth NULL
Definition: ftsmooth.c:416
#define BR_IS_GLOBAL
Definition: brush.h:102
static HBRUSH CreateBrushInternal(_In_ ULONG flAttrs, _In_ COLORREF crColor, _In_ ULONG iHatch, _In_opt_ HBITMAP hbmPattern, _In_opt_ PVOID pvClient)
Definition: brush.cpp:191

Referenced by CreateStockObjects(), and CreateSysColorObjects().

◆ IntGdiSetBrushOwner()

BOOL FASTCALL IntGdiSetBrushOwner ( PBRUSH  ,
DWORD   
)

◆ IntGdiSetSolidBrushColor()

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

Definition at line 306 of file brush.cpp.

309 {
310  PBRUSH pbr;
311 
312  /* Lock the brush */
313  pbr = BRUSH::LockAny(hbr);
314  if (pbr == NULL)
315  {
316  ERR("Failed to lock brush %p\n", hbr);
317  return;
318  }
319 
320  /* Call the member function */
321  pbr->vSetSolidColor(crColor);
322 
323  /* Unlock the brush */
324  pbr->vUnlock();
325 }
smooth NULL
Definition: ftsmooth.c:416
Definition: types.h:100
#define ERR(fmt,...)
Definition: debug.h:109

Referenced by IntSetSysColors().

Variable Documentation

◆ gahsurfHatch

HSURF gahsurfHatch[HS_DDI_MAX]

Definition at line 24 of file engbrush.c.

Referenced by InitBrushImpl(), and PDEVOBJ_bEnablePDEV().