11#if defined(__BORLANDC__)
67 if (width == 1 && style == PS_SOLID &&
70 Handle = ::GetStockObject(BLACK_PEN);
72 Handle = ::GetStockObject(WHITE_PEN);
76 Handle = ::CreatePen(style, width, color);
77 WARNX(OwlGDI, !
Handle, 0,
"Cannot create TPen (" << color <<
" " << width <<
88 Handle = ::CreatePenIndirect(&logPen);
89 WARNX(OwlGDI, !
Handle, 0,
"Cannot create TPen from logPen @" <<
static_cast<const void*
>(&logPen));
94#if defined(OWL5_COMPAT)
103 Handle = ::CreatePenIndirect((LPLOGPEN)logPen);
104 WARNX(OwlGDI, !
Handle, 0,
"Cannot create TPen from logPen @" <<
static_cast<const void*
>(logPen));
118#if !defined(NO_GDI_SHARE_HANDLES)
125 Handle = ::CreatePenIndirect(&logPen);
126 WARNX(OwlGDI, !
Handle, 0,
"Cannot create TPen from TPen @" <<
127 hex <<
uint32(LPVOID(&src)));
140 Handle = ::ExtCreatePen(penStyle, width, &logBrush, styleCount, (
const DWORD*)style);
141 WARNX(OwlGDI, !
Handle, 0,
"Cannot create TPen from brush " <<
static_cast<void*
>(brush.
GetHandle()));
152 Handle = ::ExtCreatePen(penStyle, width, (LPLOGBRUSH)&logBrush, styleCount, (
const DWORD*)style);
153 WARNX(OwlGDI, !
Handle, 0,
"Cannot create TPen from logBrush @" <<
static_cast<const void*
>(&logBrush));
#define WARNX(group, condition, level, message)
#define PRECONDITION(condition)
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.
Class wrapper for management of color values.
static const TColor White
Static TColor object with fixed Value set by RGB(255, 255, 255).
static const TColor Black
Static TColor object with fixed Value set by RGB(0, 0, 0).
void CheckValid(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.
TGdiObject()
This default constructor sets Handle to 0 and ShouldDelete to true.
HANDLE Handle
GDI handle of this object.
TPen(HPEN handle, TAutoDelete autoDelete=NoAutoDelete)
Alias an existing pen handle. Assume ownership if autoDelete says so.
LOGPEN GetObject() const
Retrieves information about this pen object and places it in the given LOGPEN structure.
TXGdi(uint resId=IDS_GDIFAILURE, HANDLE handle=0)
Constructs a TXGdi object with a default IDS_GDIFAILURE message.
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).
DIAG_DECLARE_GROUP(OwlThread)