ReactOS 0.4.15-dev-7961-gdcf9eb0
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
15class BRUSH : public BASEOBJECT, protected _BRUSHBODY
16{
17
18public:
19 _Analysis_mode_(_Analysis_operator_new_null_)
20
21 inline
22 void*
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>(
101 BASEOBJECT::OWNER::NONE));
102 }
103
104 UINT
107 _Out_bytecap_(cjBuffer) PLOGBRUSH plbBuffer) const;
108
109 HBITMAP
111 _Out_ PUINT puUsage) const;
112
113 VOID
115 _In_ COLORREF crColor);
116
118};
119
120/* HACK! */
121extern "C"
#define __cdecl
Definition: accygwin.h:79
PGDI_POOL GetBrushAttrPool(VOID)
static BASEOBJECT * LockShared(HGDIOBJ hobj, GDILOOBJTYPE loobjtype, OWNER owner)
Definition: baseobj.hpp:50
Definition: brush.hpp:16
_Check_return_ _Ret_opt_bytecount_(sizeof(BRUSH)) static inline PBRUSH LockForWrite(_In_ HBRUSH hbr)
Definition: brush.hpp:77
VOID vReleaseAttribute(VOID)
Definition: brush.cpp:80
_Check_return_ _Ret_opt_bytecap_(sizeof(BRUSH)) static inline PBRUSH LockAny(_In_ HBRUSH hbr)
Definition: brush.hpp:91
_Analysis_mode_(_Analysis_operator_new_null_) inline void *__cdecl operator new(_In_ size_t cjSize)
Definition: brush.hpp:19
_Check_return_ _Ret_opt_bytecount_(sizeof(BRUSH)) static inline PBRUSH LockForRead(_In_ HBRUSH hbr)
Definition: brush.hpp:63
BOOL bAllocateBrushAttr(VOID)
Definition: brush.cpp:102
UINT cjGetObject(_In_ UINT cjBuffer, _Out_bytecap_(cjBuffer) PLOGBRUSH plbBuffer) const
Definition: brush.cpp:151
HBITMAP hbmGetBitmapHandle(_Out_ PUINT puUsage) const
Definition: brush.cpp:139
static VOID vDeleteObject(_In_ PVOID pvObject)
Definition: brush.cpp:91
VOID vSetSolidColor(_In_ COLORREF crColor)
Definition: brush.cpp:127
~BRUSH(VOID)
Definition: brush.cpp:55
#define __prefast_operator_new_null
Definition: driverspecs.h:339
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
#define PagedPool
Definition: env_spec_w32.h:308
unsigned int BOOL
Definition: ntddk_ex.h:94
@ GDILoObjType_LO_BRUSH_TYPE
Definition: gdi_private.h:33
enum GDILoObjType GDILOOBJTYPE
static HBITMAP
Definition: button.c:44
#define _Check_return_
Definition: ms_sal.h:557
#define _Out_
Definition: ms_sal.h:345
#define _In_
Definition: ms_sal.h:308
#define _In_opt_
Definition: ms_sal.h:309
#define _Out_bytecap_(size)
Definition: ms_sal.h:854
unsigned int * PUINT
Definition: ndis.h:50
unsigned int UINT
Definition: ndis.h:50
unsigned long FLONG
Definition: ntbasedef.h:366
_In_ ULONG cjBuffer
Definition: ntgdi.h:2860
HBITMAP hbmPattern
Definition: brush.h:17
ULONG flAttrs
Definition: brush.h:19
Definition: types.h:101
uint32_t ULONG
Definition: typedefs.h:59
#define GDITAG_HMGR_BRUSH_TYPE
Definition: tags.h:104
_Inout_ SURFOBJ _In_opt_ SURFOBJ _In_opt_ SURFOBJ _In_opt_ XLATEOBJ _In_ ULONG iHatch
Definition: winddi.h:3963
_In_ ULONG cjSize
Definition: winddi.h:3634
DWORD COLORREF
Definition: windef.h:300