9#if !defined(OWL_GDIOBJEC_H)
13#if defined(BI_HAS_PRAGMA_ONCE)
81 int GetObject(
int count,
void *
object)
const;
87 bool IsGDIObject()
const;
88 uint32 GetObjectType()
const;
104 None, Pen, Brush, Font, Palette,
Bitmap, TextBrush
107 static TObjInfo* RefFind(
HANDLE object);
115 using TGdiBase::CheckValid;
116 using TGdiBase::_CheckValid;
117 using TGdiBase::Handle;
118 using TGdiBase::ShouldDelete;
157 HPEN GetHandle()
const;
158 operator HPEN()
const;
162#if defined(OWL5_COMPAT)
204#if defined(OWL5_COMPAT)
335 HFONT GetHandle()
const;
336 operator HFONT()
const;
337 operator LOGFONT()
const {
return GetObject();}
351 int GetHeight()
const;
352 int GetHeight(
TDC& dc)
const;
353 int GetAveWidth()
const;
354 int GetAveWidth(
TDC& dc)
const;
355 int GetMaxWidth()
const;
356 int GetMaxWidth(
TDC& dc)
const;
360 uint8 GetPitchAndFamily()
const;
364#if defined(OWL5_COMPAT)
435 {Init(&
entries[0],
static_cast<int>(
N));}
452 uint16 GetNumEntries()
const;
457 bool UnrealizeObject();
463#if defined(OWL5_COMPAT)
544 int BitsPixel()
const;
547 bool GetBitmapDimension(
TSize& size)
const;
548 TSize GetBitmapDimension()
const;
556#if defined(OWL5_COMPAT)
627 HRGN GetHandle()
const;
628 operator HRGN()
const;
632 auto Release() ->
HRGN;
641 TRect GetRgnBox()
const;
690 HICON GetHandle()
const;
691 operator HICON()
const;
704 auto GetInfo() const ->
TInfo;
709#if defined(OWL5_COMPAT)
763 auto GetInfo() const ->
TInfo;
768#if defined(OWL5_COMPAT)
828 const uint16 * GetIndices()
const;
830 const void * GetBits()
const;
855 int FlippedY(
int y)
const;
857 int BitsPixel()
const;
859 uint32 Compression()
const;
862 long NumColors()
const;
863 uint StartScan()
const;
864 uint NumScans()
const;
865 int32 SizeColors()
const;
869 int XOffset(
uint16 x)
const;
870 int YOffset(
uint16 y)
const;
891 int FindIndex(
uint16 index);
926 virtual void Skip(
long size) = 0;
934 using TGdiBase::CheckValid;
935 using TGdiBase::Handle;
936 using TGdiBase::ShouldDelete;
943 void InfoFromHandle();
945 void ResToMemHandle();
957 static int ScanBytes(
long w,
int bpp);
995 palette.ToClipboard(clipboard);
1004 bitmap.ToClipboard(clipboard);
1013 dib.ToClipboard(clipboard);
1030 return GetGdiHandle();
1053# if defined(UNICODE)
1054 return ::GetObjectW(
Handle, count,
object);
1056 return ::GetObjectA(
Handle, count,
object);
1093#if defined(OWL5_COMPAT)
1124#if defined(OWL5_COMPAT)
1156#if defined(OWL5_COMPAT)
1243 return ::UnrealizeObject(
Handle);
1327 return ::GetNearestPaletteIndex(
GetHandle(), Color);
1392 return ::GetBitmapDimensionEx(
GetHandle(), &size);
1427 ShouldDelete =
false;
1435inline TRegion::operator
HRGN()
const{
1596#if defined(OWL5_COMPAT)
1680 return &Info->bmiHeader;
1689 return &Info->bmiHeader;
1713 return reinterpret_cast<const uint16*
>(Colors);
1721 return reinterpret_cast<uint16*
>(Colors);
1781 return GetInfoHeader();
1789 return GetInfoHeader();
1815 return Info !=
nullptr;
1834 return static_cast<int>(Info->bmiHeader.biWidth);
1842 return static_cast<int>(Info->bmiHeader.biHeight);
1850 return static_cast<int>(Info->bmiHeader.biHeight) - 1 - y;
1867 return static_cast<int>((
w*
bpp+31)&(~31))/8;
1875 return Info->bmiHeader.biBitCount;
1892 return Info->bmiHeader.biCompression;
1900 return Info->bmiHeader.biSizeImage;
1947 return static_cast<uint32>((
reinterpret_cast<char*
>(Bits) +
SizeImage()) -
reinterpret_cast<char*
>(Info));
#define PRECONDITION(condition)
TBitmap is the GDI bitmap class derived from TGdiObject.
uint32 GetBitmapBits(uint32 count, void *bits) const
Copies up to count bits of this bitmap to the buffer bits.
uint32 SetBitmapBits(uint32 count, const void *bits)
Copies up to count bits from the bits buffer to this bitmap.
HBITMAP THandle
TBitmap encapsulates an HBITMAP.
HBITMAP GetHandle() const
Returns the handle of the bitmap of type BITMAP.
bool SetBitmapDimension(const TSize &size, TSize *oldSize=nullptr)
Sets the size of this bitmap from the given size argument (width and height, measured in tenths of mi...
TSize GetBitmapDimension() const
Functional-style overload.
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.
The clipboard class encapsulates the methods for the clipboard object of Windows.
Class wrapper for management of color values.
TCursor, derived from TGdiBase, represents the GDI cursor object class.
bool operator==(const TCursor &other) const
Returns true if this cursor equals other; otherwise returns false.
HCURSOR GetHandle() const
Returns the handle of the cursor with type HCURSOR.
HCURSOR THandle
TCursor encapsulates an HCURSOR.
auto GetIconInfo() const -> ICONINFO
Retrieves information about this cursor.
TDC is the root class for GDI DC wrappers.
Encapsulates the system font used for a specific GUI element, e.g. icon, caption, menu,...
TSystemFontId
Defines the various GUI elements for which a default font can be created.
@ sfiCaption
Represents NONCLIENTMETRICS::lfCaptionFont.
@ sfiStatus
Represents NONCLIENTMETRICS::lfStatusFont.
@ sfiLegacyDefault
Represents the font returned by GetStockObject (DEFAULT_GUI_FONT).
@ sfiMenu
Represents NONCLIENTMETRICS::lfMenuFont.
@ sfiSmallCaption
Represents NONCLIENTMETRICS::lfSmCaptionFont.
@ sfiIcon
Represents ICONMETRICS::lfFont.
Internal DIB file Reda/Write functions talk to these interfaces.
virtual void Skip(long size)=0
virtual long Read(void *buffer, long size)=0
virtual bool Write(void *buffer, long size)=0
Pseudo-GDI object Device Independent Bitmap (DIB) class.
uint NumScans() const
Returns the number of scans in this DIB.
int BitsPixel() const
Return the number of bits (2, 4, 8, 16, 24, or 32) used to store a pixel for the DIB.
uint16 Usage() const
Returns the Mode for this DIB.
uint32 SizeDib() const
Size of dib is measured as the end of the bits minus the start of the block.
const uint16 * GetIndices() const
Returns the bmiColors indexes of this DIB.
HANDLE THandle
TDib encapsulates an memory HANDLE w/ a DIB.
bool IsPM() const
Returns true if IsCore is true; that is, if the DIB is an old-style PM DIB using core headers.
int32 SizeColors() const
Return number of colors times the size of each entry in the table, whether it is an RGB color table o...
bool IsOK() const
Returns false if Info is 0, otherwise returns true.
void ResToMemHandle()
Under Win32, resources are read-only.
void CopyOnWrite()
Copies the DIB.
const BITMAPINFOHEADER * GetInfoHeader() const
Returns this DIB's bmiHeader field of the BITMAPINFO structure contains information about the color a...
void * PixelPtr(uint16 x, uint16 y)
Returns the byte of where the pixel is located.
int Pitch() const
Size of scan in bytes = Pixel Width * bits per pixel rounded up to a uint32 boundary.
int XOffset(uint16 x) const
Returns the byte offset from the start of the scan line to the xth pixel.
const BITMAPINFO * GetInfo() const
Returns this DIB's Info field.
int Width() const
Returns the width of the DIB.
static int ScanBytes(long w, int bpp)
Width+bpp to dword aligned bytes.
int Height() const
Returns the height of the DIB.
TSize Size() const
Returns TSize(W,H), the size of this DIB.
bool operator==(const TDib &other) const
Compares two handles and returns true if this DIB's handle equals the other (other) DIB's handle.
int YOffset(uint16 y) const
Returns the starting position of the scan line.
uint StartScan() const
Returns the starting scan line.
HANDLE Handle
GDI handle of this object.
long NumColors() const
Returns NumClrs, the number of colors in this DIB's palette.
int FlippedY(int y) const
Returns the coordinate of y if the direction of the y-axis was reversed.
uint32 SizeImage() const
Returns number of bytes used to store the image.
uint32 Compression() const
Returns type of compression and encoding for bottom-up DIBs.
const void * GetBits() const
Returns the Bits data member for this DIB.
const TRgbQuad * GetColors() const
Returns the bmiColors value of this DIB.
HANDLE GetHandle() const
Returns the handle of the DIB with type HANDLE.
The TFile class encapsulates standard file characteristics and operations.
TFont derived from TGdiObject provides constructors for creating font objects from explicit informati...
HFONT GetHandle() const
Returns the handle of the font with type HFONT.
int GetHeight() const
Returns the height of the font.
LOGFONT GetObject() const
Returns information about this font object.
TEXTMETRIC GetTextMetrics() const
Retrieves information about this font when selected in a screen DC.
int GetMaxWidth() const
Returns the maximum width of the characters in the font.
int GetAveWidth() const
Returns the average width of the characters in the font.
Root and abstract class for Windows object wrappers.
HANDLE Handle
GDI handle of this object.
GdiObject is the root, pseudo-abstract base class for ObjectWindows' GDI (Graphics Device Interface) ...
bool IsGDIObject() const
Returns true if this represents a real GDI object.
HGDIOBJ GetGdiHandle() const
Returns the handle of the GDI object.
TType
This enumeration is used to store the object type in the struct TObjInfo.
uint32 GetObjectType() const
Returns the type of the GDI object.
int GetObject(int count, void *object) const
Retrieve the object's attributes into a buffer.
bool operator==(const TGdiObject &other) const
Returns true if the handles are equal. This is a binary compare.
HANDLE Handle
GDI handle of this object.
auto IsHandleOwner() const -> bool
Returns true if handle lifetime is managed.
HGDIOBJ THandle
TGdiObject encapsulates an HGDIOBJ.
Derived from TBrush, THatch8x8Brush defines a small, 8x8, monochrome, configurable hatch brush.
TIcon, derived from TGdiObject, represents the GDI object icon class.
auto GetIconInfo() const -> ICONINFO
Retrieves information about this icon.
bool operator==(const TIcon &other) const
Returns true if the handles of two icons are identical.
HICON GetHandle() const
Returns the handle of the icon with type HICON.
HICON THandle
TIcon encapsulates an HICON.
TPalette is the GDI Palette class derived from TGdiObject.
void AnimatePalette(uint start, uint count, const PALETTEENTRY *entries)
Animate palette from entry 'start' for 'count' entries.
HPALETTE THandle
TPalette encapsulates an HPALETTE.
uint SetPaletteEntry(uint16 index, const PALETTEENTRY &entry)
Sets the RGB color value at index in this palette from the entry argument.
uint GetPaletteEntries(uint16 start, uint16 count, PALETTEENTRY *entries) const
Retrieves a range of entries in this logical palette and places them in the entries array.
uint GetNearestPaletteIndex(const TColor &color) const
Returns the index of the color entry that represents the closest color in this palette to the given c...
uint SetPaletteEntries(uint16 start, uint16 count, const PALETTEENTRY *entries)
Sets the RGB color values in this palette from the entries array of PALETTEENTRY structures.
uint GetPaletteEntry(uint16 index, PALETTEENTRY &entry) const
Retrieves the entry in this logical palette at index and places it in the entries array.
bool GetObject(uint16 &numEntries) const
Finds the number of entries in this logical palette and sets the value in the numEntries argument.
HPALETTE GetHandle() const
Returns the handle of the palette.
uint16 GetNumEntries() const
Returns the number of entries in this palette, or 0 if the call fails.
bool UnrealizeObject()
Directs the GDI to completely remap the logical palette to the system palette on the next RealizePale...
TPalette(const PALETTEENTRY(&entries)[N])
Creates a TPalette object with the entries from the given array.
bool ResizePalette(uint numEntries)
Changes the size of this logical palette to the number given by numEntries.
TPen is derived from TGdiObject.
LOGPEN GetObject() const
Retrieves information about this pen object and places it in the given LOGPEN structure.
HPEN GetHandle() const
Returns the handle of the pen with type HPEN.
TPoint is a support class, derived from tagPOINT.
TRect is a mathematical class derived from tagRect.
TRegion, derived from TGdiObject, represents GDI abstract shapes or regions.
bool Contains(const TPoint &point) const
Returns true if this region contains the given point.
TRegion(const TPoint *points, const int(&polyCounts)[N], int fillMode)
Creates a filled TRegion object from the poly-polygons given by points and fillMode.
TRegion & operator|=(const TRegion &source)
Creates the union of this region and the given source region , and returns a reference to the result.
bool Touches(const TRect &rect) const
Returns true if this region touches the given rectangle.
auto Release() -> HRGN
Returns the encapsulated handle of the region and relinquishes ownership.
TRegion & operator+=(const TSize &delta)
Adds the given delta to each point of this region to displace (translate) it by delta....
TEllipse
Defines the class-specific constant Ellipse, used to distinguish the ellipse constructor from the rec...
TRegion & operator&=(const TRegion &source)
Creates the intersection of this region with the given source region and returns a reference to the r...
TRegion & operator^=(const TRegion &source)
Creates the exclusive-or of this region and the given source region.
TRegion & operator=(const TRegion &source)
Assigns the source region to this region.
TRegion(const TPoint(&points)[N], int fillMode)
Creates a filled TRegion object from the polygon given by an array of points and fillMode.
TRect GetRgnBox() const
Returns the bounding rectangle of the region.
void SetRectRgn(const TRect &rect)
Creates a rectangle of the size given by rect.
bool operator==(const TRegion &other) const
Returns true if the regions are identical (equal in size and shape).
HRGN GetHandle() const
Returns the handle of the region with type HREGION.
bool operator!=(const TRegion &other) const
Returns true if this region is not equal to the other region.
HRGN THandle
TRegion encapsulates an HRGN.
TRegion & operator-=(const TSize &delta)
Subtracts the given delta from each point of this region to displace (translate) it by -delta....
Wrapper for Windows' RBGQUAD type.
The TRiffFile class is used for reading and writing RIFF files.
The tagSIZE struct is defined as.
Definition of classes for clipboard Encapsulation.
Definition of GDI DC encapsulation classes: TDC, TWindowDC, TScreenDC, TDesktopDC,...
Definition of base most abstract GDI object class, and associated exception class.
Classes for window system geometry.
TAutoDelete
Flag for Handle ctors to control Handle deletion in dtor.
TDefaultGuiFont TDefaultGUIFont
Deprecated alias.
Object Windows Library (OWLNext Core)
owl::opstream & operator<<(owl::opstream &os, const TColor &c)
Insert the color value into a persistent output stream.