13#if defined(BI_MULTI_THREAD_RTL)
50 return other.Handle == Handle;
53 return other.Handle < Handle;
60#if defined(BI_MULTI_THREAD_RTL)
64#if defined(BI_MULTI_THREAD_RTL)
65#define LOCKOBJECTBAG(s) TMRSWSection::TLock __lock(*__ObjInfoBagLock,s)
67#define LOCKOBJECTBAG(s)
74 _T(
"?"),
_T(
"Pen"),
_T(
"Brush"),
_T(
"Font"),
_T(
"Palette"),
75 _T(
"Bitmap"),
_T(
"TextBrush"), 0
80static void createObjInfoBag()
89#if defined(BI_MULTI_THREAD_RTL)
96static void destroyObjInfoBag()
99 if(__ObjInfoBag==
nullptr || __ObjInfoBag->Size()>0)
105#if defined(BI_MULTI_THREAD_RTL)
108 __ObjInfoBag =
nullptr;
121 if (
handle && __ObjInfoBag)
124 const auto pos = __ObjInfoBag->Find(TObjInfo(
handle));
125 if (
pos != __ObjInfoBag->NPOS)
126 return &((*__ObjInfoBag)[
pos]);
140#if !defined(NO_GDI_SHARE_HANDLES)
169 __ObjInfoBag->DestroyItem(TObjInfo(
handle));
212 static_cast<void*
>(
member->Handle) <<
"Deleted");
216 static_cast<void*
>(
member->Handle) <<
"Orphan");
230 __ObjInfoBag->DestroyItem(*
member);
257#if defined(__TRACE) || defined(__WARN)
#define TRACEX(group, level, message)
#define DIAG_DEFINE_GROUP_INIT(f, g, e, l)
Root and abstract class for Windows object wrappers.
GdiObject is the root, pseudo-abstract base class for ObjectWindows' GDI (Graphics Device Interface) ...
static void RefInc(HANDLE handle)
Increments by 1 the reference count of the object associated with the given handle.
static TObjInfo * RefFind(HANDLE object)
Searches for the given object handle.
~TGdiObject()
Decrement the reference count on this object.
static void RefDec(HANDLE handle, bool wantDelete)
Decrements this object's reference count by 1 and deletes the object when the reference count reaches...
TType
This enumeration is used to store the object type in the struct TObjInfo.
static void RefRemove(HANDLE handle)
Removes the reference entry to the object with the given handle.
static int RefCount(HANDLE handle)
Returns this object's current reference count or -1 if the object is not found.
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.
TGdiObject()
This default constructor sets Handle to 0 and ShouldDelete to true.
HANDLE Handle
GDI handle of this object.
Multiple Read, Single Write section.
static void Raise(uint resId=IDS_GDIFAILURE, HANDLE handle=0)
Throws the exception.
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)
owl::opstream & operator<<(owl::opstream &os, const TColor &c)
Insert the color value into a persistent output stream.
TSortedObjectArray< TObjInfo > TObjInfoBag
void InUse(const T &arg)
Handy utility to avoid compiler warnings about unused parameters.
Definition of container classes used and made available by OWL.