11#if defined(BI_MULTI_THREAD_RTL)
15#if defined(__BORLANDC__)
60#if defined(BI_MULTI_THREAD_RTL)
70TBrushCache& GetBrushCache();
79TBrushCache& GetBrushCache()
89#if defined(BI_MULTI_THREAD_RTL)
90#define LOCKCACHE(l,s) TMRSWSection::TLock __lock(l,s)
98TBrushCache::TBrushCache()
102 memset(Entries,0,
sizeof(Entries));
109TBrushCache::~TBrushCache()
111 for (
int i = 0;
i < Size;
i++){
112 if (Entries[
i].Handle) {
113 TGdiObject::RefDec(Entries[
i].Handle,
false);
116 Entries[
i].Handle =
nullptr;
117 Entries[
i].Color = 0;
118 Entries[
i].RefCnt = 0;
127TBrushCache::Float(
int i)
132 int refCnt = Entries[
i].RefCnt;
138 memmove(Entries+1, Entries,
sizeof(TEntry)*
i);
139 Entries[0].Handle =
handle;
140 Entries[0].Color =
color;
141 Entries[0].RefCnt =
refCnt;
158 if (Entries[Size-1].Handle){
162 if(!Entries[
i].RefCnt){
163 TGdiObject::RefDec(Entries[
i].Handle,
true);
167 Entries[
i].RefCnt = 1;
177 memmove(Entries+1, Entries,
sizeof(TEntry)*(Size-1));
178 Entries[0].Handle =
handle;
179 Entries[0].Color =
color;
180 Entries[0].RefCnt = 1;
183 TGdiObject::RefAdd(
handle, TGdiObject::Brush);
194 for (
int i = 0;
i < Size && Entries[
i].Handle;
i++){
195 if (
handle == Entries[
i].Handle) {
197 _T(
"): found ") <<
_T(
" @") <<
i);
199 CHECK(Entries[
i].RefCnt >= 0);
211 for (
int i = 0;
i < Size && Entries[
i].Handle;
i++){
212 if (
handle == Entries[
i].Handle) {
214 static_cast<void*
>(Entries[
i].Handle) <<
_T(
" @") <<
i);
229 for (
int i = 0;
i < Size && Entries[
i].Handle;
i++){
230 if (
color == Entries[
i].Color) {
232 _T(
"): found ") <<
static_cast<void*
>(Entries[
i].Handle) <<
_T(
" @") <<
i);
235 return Entries[0].Handle;
260 GetBrushCache().CheckHandle(
Handle);
262 _T(
" with handle ") <<
static_cast<void*
>(
handle));
281 if (
color.IsSysColor())
292 if (!
color.IsSysColor())
330 _T(
", style 0x") << style);
341 static_cast<void*
>(
pattern.GetHandle()));
345 _T(
" from bitmap ") <<
static_cast<const void*
>(
pattern.GetHandle()));
359 <<
_T(
" from logBrush @") <<
static_cast<const void*
>(&
logBrush));
362#if defined(OWL5_COMPAT)
376 _T(
" from logBrush @") <<
static_cast<const void*
>(
logBrush));
388#if !defined(NO_GDI_SHARE_HANDLES)
401 _T(
" from TBrush @") << (
void*)&
src);
411 GetBrushCache().DecRef(
Handle);
422 static_cast<void*
>(
pattern.GetHandle()));
426 _T(
" from DIB ") <<
static_cast<void*
>(
pattern.GetHandle()));
481 for (
int i = 0;
i < 8;
i++)
503 0x99, 0x33, 0x66, 0xCC, 0x99, 0x33, 0x66, 0xCC
507 0x88, 0x11, 0x22, 0x44, 0x88, 0x11, 0x22, 0x44
511 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55
515 0xCC, 0x66, 0x33, 0x99, 0xCC, 0x66, 0x33, 0x99
519 0x44, 0x22, 0x11, 0x88, 0x44, 0x22, 0x11, 0x88
#define WARNX(group, condition, level, message)
#define PRECONDITION(condition)
#define DIAG_DECLARE_GROUP(group)
#define TRACEX(group, level, message)
TBitmap is the GDI bitmap class derived from TGdiObject.
The GDI Brush class is derived from TGdiObject.
LOGBRUSH GetObject() const
Retrieves information about this brush object and places it in the given LOGBRUSH structure.
HBRUSH GetHandle() const
Returns the handle of the brush with type HBRUSH.
TBrush(HBRUSH handle, TAutoDelete autoDelete=NoAutoDelete)
TBrush encapsulates an HBRUSH.
Class wrapper for management of color values.
Pseudo-GDI object Device Independent Bitmap (DIB) class.
GdiObject is the root, pseudo-abstract base class for ObjectWindows' GDI (Graphics Device Interface) ...
static void RefDec(HANDLE handle, bool wantDelete)
Decrements this object's reference count by 1 and deletes the object when the reference count reaches...
void CheckValid(uint resId=IDS_GDIFAILURE)
static void _CheckValid(HANDLE handle, uint resId=IDS_GDIFAILURE)
int GetObject(int count, void *object) const
Retrieve the object's attributes into a buffer.
bool ShouldDelete
Should object delete GDI handle in dtor?
static void RefAdd(HANDLE handle, TType type)
RefAdd adds a reference entry for the object with the given handle and type.
HANDLE Handle
GDI handle of this object.
static const uint8 Hatch11F1[8]
The static array Hatch11F1[8] holds the logical hatched brush pattern of one pixel on and one pixel o...
static const uint8 Hatch13F1[8]
The static array Hatch13F1[8] holds a hatched brush pattern of one pixel on and three pixels off in f...
void Reconstruct(const uint8 hatch[], const TColor &fgColor, const TColor &bgColor)
Reconstructs the hatched brush with a new pattern or new set of colors.
static const uint8 Hatch22F1[8]
The static array Hatch22F1[8] holds a monochrome hatched brush pattern of two pixels on and two off i...
static const uint8 Hatch13B1[8]
The static array Hatch13B1[8] holds a hatched brush pattern of one pixel on and three pixels off in b...
THatch8x8Brush(const uint8 hatch[], const TColor &fgColor=TColor::White, const TColor &bgColor=TColor::Black)
Constructs a THatchBrush object with the specified hatched pattern and colors.
static const uint8 Hatch22B1[8]
The static array Hatch22B1[8] holds a hatched brush pattern of two pixels on and two off in backward ...
Describes an exception resulting from GDI failures such as creating too many TWindow device contexts ...
Definition of abstract GDI object class and derived classes.
TAutoDelete
Flag for Handle ctors to control Handle deletion in dtor.
Object Windows Library (OWLNext Core)