ReactOS  0.4.14-dev-49-gfb4591c
brush.hpp
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: See COPYING in the top level directory
3  * PROJECT: ReactOS win32 subsystem
4  * PURPOSE: BRUSH class definition
5  * PROGRAMER: Timo Kreuzer (timo.kreuzer@reactos.org)
6  */
7 
8 #pragma once
9 
10 #include <win32k.h>
11 #include "baseobj.hpp"
12 
14 
15 class BRUSH : public BASEOBJECT, protected _BRUSHBODY
16 {
17 
18 public:
19  _Analysis_mode_(_Analysis_operator_new_null_)
20 
21  inline
22  void*
23  __cdecl
24  operator new(
25  _In_ size_t cjSize) throw()
26  {
28  //return BASEOBJECT::pvAllocate(GDIObjType_BRUSH_TYPE, cjSize);
29  }
30 
31  inline
32  void
33  operator delete(
34  void *pvObject)
35  {
37  ExFreePool(pvObject);
38  //ExFreePoolWithTag(pvObject, GDITAG_HMGR_BRUSH_TYPE);
39  //BASEOBJECT::pvFree(GDIObjType_BRUSH_TYPE, cjSize);
40  }
41 
42  BRUSH(
44  _In_ COLORREF crColor,
47  _In_opt_ PVOID pvClient,
48  _In_ GDILOOBJTYPE objtype);
49 
50  ~BRUSH(
51  VOID);
52 
53  static
54  VOID
56  _In_ PVOID pvObject);
57 
58  BOOL
60  VOID);
61 
64  static
65  inline
66  PBRUSH
67  LockForRead(
68  _In_ HBRUSH hbr)
69  {
70  return static_cast<PBRUSH>(
73  BASEOBJECT::OWNER::PUBLIC));
74  }
75 
78  static
79  inline
80  PBRUSH
81  LockForWrite(
82  _In_ HBRUSH hbr)
83  {
84  return static_cast<PBRUSH>(
87  BASEOBJECT::OWNER::POWNED));
88  }
89 
92  static
93  inline
94  PBRUSH
95  LockAny(
96  _In_ HBRUSH hbr)
97  {
98  return static_cast<PBRUSH>(
102  }
103 
104  UINT
105  cjGetObject(
107  _Out_bytecap_(cjBuffer) PLOGBRUSH plbBuffer) const;
108 
109  HBITMAP
111  _Out_ PUINT puUsage) const;
112 
113  VOID
115  _In_ COLORREF crColor);
116 };
117 
118 /* HACK! */
119 extern "C"
120 PGDI_POOL
BOOL bAllocateBrushAttr(VOID)
Definition: brush.cpp:91
~BRUSH(VOID)
Definition: brush.cpp:55
#define __cdecl
Definition: accygwin.h:79
_Check_return_ _Ret_opt_bytecap_(sizeof(BRUSH)) static inline PBRUSH LockAny(_In_ HBRUSH hbr)
Definition: brush.hpp:91
static VOID vDeleteObject(_In_ PVOID pvObject)
Definition: brush.cpp:80
PGDI_POOL GetBrushAttrPool(VOID)
HACK!
Definition: gdiobj.c:1609
#define _Check_return_
Definition: no_sal2.h:13
ULONG flAttrs
Definition: brush.h:19
_Analysis_mode_(_Analysis_operator_new_null_) inline void *__cdecl operator new(_In_ size_t cjSize)
Definition: brush.hpp:19
#define _In_opt_
Definition: no_sal2.h:213
unsigned int BOOL
Definition: ntddk_ex.h:94
#define GDITAG_HMGR_BRUSH_TYPE
Definition: tags.h:103
#define _Out_
Definition: no_sal2.h:323
unsigned long FLONG
Definition: ntbasedef.h:373
Definition: types.h:100
DWORD COLORREF
Definition: windef.h:285
Definition: brush.hpp:15
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
_Check_return_ _Ret_opt_bytecount_(sizeof(BRUSH)) static inline PBRUSH LockForWrite(_In_ HBRUSH hbr)
Definition: brush.hpp:77
_Inout_ SURFOBJ _In_opt_ SURFOBJ _In_opt_ SURFOBJ _In_opt_ XLATEOBJ _In_ ULONG iHatch
Definition: winddi.h:3959
#define _In_
Definition: no_sal2.h:204
_Check_return_ _Ret_opt_bytecount_(sizeof(BRUSH)) static inline PBRUSH LockForRead(_In_ HBRUSH hbr)
Definition: brush.hpp:63
static BASEOBJECT * LockShared(HGDIOBJ hobj, GDILOOBJTYPE loobjtype, OWNER owner)
Definition: baseobj.hpp:50
unsigned int UINT
Definition: ndis.h:50
#define _Out_bytecap_(size)
Definition: no_sal2.h:325
BRUSH(_In_ FLONG flAttrs, _In_ COLORREF crColor, _In_ ULONG iHatch, _In_opt_ HBITMAP hbmPattern, _In_opt_ PVOID pvClient, _In_ GDILOOBJTYPE objtype)
Definition: brush.cpp:14
unsigned int ULONG
Definition: retypes.h:1
_In_ ULONG cjSize
Definition: winddi.h:3634
_In_ ULONG cjBuffer
Definition: ntgdi.h:2860
#define __prefast_operator_new_null
Definition: no_sal2.h:668
static HBITMAP
Definition: button.c:44
UINT cjGetObject(_In_ UINT cjBuffer, _Out_bytecap_(cjBuffer) PLOGBRUSH plbBuffer) const
Definition: brush.cpp:140
enum GDILoObjType GDILOOBJTYPE
HBITMAP hbmPattern
Definition: brush.h:17
HBITMAP hbmGetBitmapHandle(_Out_ PUINT puUsage) const
Definition: brush.cpp:128
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
unsigned int * PUINT
Definition: ndis.h:50
xD9 x84 xD8 xAD xD9 x80 xF0 x90 xAC x9A xE0 xA7 xA6 xE0 xA7 xAA xF0 x91 x84 xA4 xF0 x91 x84 x89 xF0 x91 x84 x9B xF0 x90 x8A xAB xF0 x90 x8B x89 xE2 xB2 x9E xE2 xB2 x9F xD0 xBE xD0 x9E xF0 x90 x90 x84 xF0 x90 x90 xAC xE1 x83 x98 xE1 x83 x94 xE1 x83 x90 xE2 xB0 x95 xE2 xB1 x85 xCE xBF xCE x9F xE0 xA8 xA0 xE0 xA8 xB0 xE0 xA9 xA6 Kayah xEA xA4 x8D xEA xA4 x80 Khmer xE1 xA7 xA1 xE1 xA7 xAA xE0 xBB x90 Latin Subscript xE2 x82 x92 xE2 x82 x80 xEA x93 xB3 xE1 x80 x9D xE1 x80 x84 xE1 x80 x82 NONE
Definition: afscript.h:258
VOID vSetSolidColor(_In_ COLORREF crColor)
Definition: brush.cpp:116