OWLNext    7.0
Borland's Object Windows Library for the modern age
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
gdiobjec.h
Go to the documentation of this file.
1//----------------------------------------------------------------------------
2// ObjectWindows
3// Copyright (c) 1992, 1996 by Borland International, All Rights Reserved
4//
5/// \file
6/// Definition of abstract GDI object class and derived classes
7//----------------------------------------------------------------------------
8
9#if !defined(OWL_GDIOBJEC_H)
10#define OWL_GDIOBJEC_H
11
12#include <owl/private/defs.h>
13#if defined(BI_HAS_PRAGMA_ONCE)
14# pragma once
15#endif
16
17#include <owl/gdibase.h>
18#include <owl/geometry.h>
19
20namespace owl {
21
22/// \addtogroup gdi
23/// @{
24
25class _OWLCLASS TDC;
26class _OWLCLASS TFile;
27class _OWLCLASS TBrush;
28class _OWLCLASS TBitmap;
29class _OWLCLASS TDib;
30class _OWLCLASS TPalette;
31class _OWLCLASS TClipboard;
32class _OWLCLASS TMetaFilePict;
33class _OWLCLASS TXGdi;
34class _OWLCLASS TRiffFile;
35class _OWLCLASS TResId;
36//
37// Define to not share handles in copy ctors, otherwise these classes may act
38// as envelopes and treat the handles as ref counted letters
39//
40//#define NO_GDI_SHARE_HANDLES
41
42//
43/// GDI Orphan control element
44//
45struct TObjInfo;
46
47#include <owl/preclass.h>
48
49//
50/// \class TGdiObject
51// ~~~~~ ~~~~~~~~~~
52/// GdiObject is the root, pseudo-abstract base class for ObjectWindows' GDI
53/// (Graphics Device Interface) wrappers. The TGdiOject-based classes let you work
54/// with a GDI handle and construct a C++ object with an aliased handle. Some GDI
55/// objects are also based on TGdiObject for handle management. Generally, the
56/// TGdiObject-based class hierarchy handles all GDI objects apart from the DC
57/// (Device Context) objects handled by the TDC-based tree.
58///
59/// The five DC selectable classes (TPen, TBrush, TFont, TPalette, and TBitmap), and
60/// the TIcon, TCursor, TDib, and TRegion classes, are all derived directly from
61/// TGdiObject.
62///
63/// TGdiObject maintains the GDI handle and a ShouldDelete flag that determines if
64/// and when the handle and object should be destroyed. Protected constructors are
65/// provided for use by the derived classes: one for borrowed handles, and one for
66/// normal use.
67//
68class _OWLCLASS TGdiObject : private TGdiBase {
69public:
70 // Class scoped types
71 //
72 typedef HGDIOBJ THandle; ///< TGdiObject encapsulates an HGDIOBJ
73
74 // Destructor
75 //
76 ~TGdiObject(); // GDI classes are not polymorphic, & dtor is not virtual
77
78 HGDIOBJ GetGdiHandle() const;
79 operator HGDIOBJ() const;
80
81 int GetObject(int count, void * object) const;
82 bool operator ==(const TGdiObject& other) const;
83
84 /// not implemented just to make happy STL
85 bool operator <(const TGdiObject& other) const;
86
87 bool IsGDIObject() const;
88 uint32 GetObjectType() const;
89
90 // GDI handle management & orphan control
91 //
92
93 //
94 /// Returns true if handle lifetime is managed.
95 /// Note that many objects may share a handle. If a handle is owned, reference-counting is used
96 /// to ensure that the handle is deleted when the last owner is destructed.
97 //
98 auto IsHandleOwner() const -> bool { return ShouldDelete; }
99
100/// This enumeration is used to store the object type in the struct TObjInfo. This
101/// internal structure is used to track object reference counts during debugging
102/// sessions.
103 enum TType {
104 None, Pen, Brush, Font, Palette, Bitmap, TextBrush
105 };
106
107 static TObjInfo* RefFind(HANDLE object);
108 static void RefAdd(HANDLE handle, TType type);
109 static void RefRemove(HANDLE handle);
110 static void RefInc(HANDLE handle);
111 static void RefDec(HANDLE handle, bool wantDelete);
112 static int RefCount(HANDLE handle);
113
114protected:
115 using TGdiBase::CheckValid; // make this function available to derivatives
116 using TGdiBase::_CheckValid; // make this function available to derivatives
117 using TGdiBase::Handle; // and these members too
118 using TGdiBase::ShouldDelete;
119
120 // Constructors for use by derived classes only
121 //
122 TGdiObject();
124
125private:
126 TGdiObject(const TGdiObject&); // Protect against copying of GDI objects
128
129};
130
131//
132/// \class TPen
133// ~~~~~ ~~~~
134/// TPen is derived from TGdiObject. It encapsulates the GDI pen tool. Pens can be
135/// constructed from explicit information or indirectly. TPen relies on the base
136/// class's destructor, ~TGdiObject.
137//
138class _OWLCLASS TPen : public TGdiObject {
139public:
140 // Class scoped types
141 //
142 typedef HPEN THandle; // TPen encapsulates an HPEN
143
144 // Constructors
145 //
146 TPen(HPEN handle, TAutoDelete autoDelete = NoAutoDelete);
147 TPen(const TColor& color, int width=1, int style=PS_SOLID);
148 TPen(const LOGPEN& logPen);
149 TPen(const TPen& src);
151 const uint32* style);
153 uint32 styleCount, const uint32* style);
154
155 // Type Accessor & Conversion Operator
156 //
157 HPEN GetHandle() const;
158 operator HPEN() const;
159
160 LOGPEN GetObject() const;
161
162#if defined(OWL5_COMPAT)
163
164 TPen(const LOGPEN* logPen);
165 bool GetObject(LOGPEN & logPen) const;
166
167#endif
168
169private:
170 TPen& operator =(const TPen&);
171};
172
173//
174/// \class TBrush
175// ~~~~~ ~~~~~~
176/// The GDI Brush class is derived from TGdiObject. TBrush provides constructors for
177/// creating solid, styled, or patterned brushes from explicit information. It can
178/// also create a brush indirectly from a borrowed handle.
179//
181public:
182 // Class scoped types
183 //
184 typedef HBRUSH THandle; /// TBrush encapsulates an HBRUSH
185
186 // Constructors
187 //
188 TBrush(HBRUSH handle, TAutoDelete autoDelete = NoAutoDelete);
189 TBrush(const TColor& color, bool useCache = true);
190 TBrush(const TColor& color, int style);
191 TBrush(const LOGBRUSH& logBrush);
192 TBrush(const TBitmap& pattern);
193 TBrush(const TDib& pattern);
194 TBrush(const TBrush& src);
195 ~TBrush();
196
197 // Type Accessor & Conversion Operator
198 //
199 HBRUSH GetHandle() const;
200 operator HBRUSH() const;
201
202 LOGBRUSH GetObject() const;
203
204#if defined(OWL5_COMPAT)
205
206 TBrush(const LOGBRUSH* logBrush);
207 bool GetObject(LOGBRUSH & logBrush) const;
208
209#endif
210
211private:
212 TBrush& operator =(const TBrush&);
213};
214
215//
216/// \class THatch8x8Brush
217// ~~~~~ ~~~~~~~~~~~~~~
218/// Derived from TBrush, THatch8x8Brush defines a small, 8x8, monochrome,
219/// configurable hatch brush. Because the hatch brush is a logical brush created
220/// from device-independent bitmaps (DIBs), it can be passed to any device context
221/// (DC), which then renders the brush into the appropriate form for the device.
222///
223/// Although the default brush color is a white foreground and a black background,
224/// you can vary the colors of the hatched brush. The colors can be any one of the
225/// TColor object encapsulated colors, namely the standard RGB values.
226///
227/// THatch8x8Brush contains static arrays that define common hatched brush patterns.
228/// The hatched brush patterns you can select are
229///
230/// Standard
231/// \image html bm156.png
232///
233/// Forward diagonal 1
234/// \image html bm161.png
235///
236/// Forward diagonal 2
237/// \image html bm171.png
238///
239/// Backward diagonal 1
240/// \image html bm172.png
241///
242/// Backward diagonal 2
243/// \image html bm181.png
244///
245///
246/// You can use THatch8x8Brush to design a variety of hatched brush border patterns
247/// around a simple rectangle or an OLE container. You can also use THatch8x8Brush
248/// in conjunction with TUIHandle.
249//
251public:
252 THatch8x8Brush(const uint8 hatch[], const TColor& fgColor=TColor::White,
253 const TColor& bgColor=TColor::Black);
254 void Reconstruct(const uint8 hatch[], const TColor& fgColor, const TColor& bgColor);
255
256/// The static array Hatch22F1[8] holds a monochrome hatched brush pattern of two
257/// pixels on and two off in forward diagonal hatch marks, offset one per row as the
258/// following pattern illustrates:
259/// \image html bm203.png
260 static const uint8 Hatch22F1[8];
261
262/// The static array Hatch13F1[8] holds a hatched brush pattern of one pixel on and
263/// three pixels off in forward diagonal hatch marks, offset one per row as the
264/// following pattern illustrates:
265/// \image html bm192.png
266 static const uint8 Hatch13F1[8];
267
268/// The static array Hatch11F1[8] holds the logical hatched brush pattern of one
269/// pixel on and one pixel off in monochrome, offset one per row as the following
270/// pattern illustrates:
271/// \image html bm182.png
272 static const uint8 Hatch11F1[8];
273
274/// The static array Hatch22B1[8] holds a hatched brush pattern of two pixels on and
275/// two off in backward diagonal hatch marks, offset one per row as the following
276/// pattern illustrates:
277/// \image html bm198.png
278 static const uint8 Hatch22B1[8];
279
280/// The static array Hatch13B1[8] holds a hatched brush pattern of one pixel on and
281/// three pixels off in backward diagonal hatch marks, offset one per row as the
282/// following pattern illustrates:
283/// \image html bm187.png
284 static const uint8 Hatch13B1[8];
285
286private:
287 static HBRUSH Create(const uint8 hatch[], const TColor& fgColor, const TColor& bgColor);
288};
289
290//
291/// \class TFont
292// ~~~~~ ~~~~~
293/// TFont derived from TGdiObject provides constructors for creating font objects
294/// from explicit information or indirectly.
295//
296class _OWLCLASS TFont : public TGdiObject {
297public:
298 // Class scoped types
299 //
300 typedef HFONT THandle; /// TFont encapsulates an HFONT
301
302 // Constructors
303 //
304 TFont(HFONT handle, TAutoDelete autoDelete = NoAutoDelete);
305
306 // Convenient font ctor
307 //
308 TFont(const tstring& facename = tstring(),
309 int height=0, int width=0, int escapement=0, int orientation=0,
310 int weight=FW_NORMAL,
312 uint8 italic=false, uint8 underline=false, uint8 strikeout=false,
313 uint8 charSet=1, // DEFAULT_CHARSET or UNICODE_CHARSET
317
318 // CreateFont() matching font ctor
319 //
320 TFont(int height, int width, int escapement=0, int orientation=0,
321 int weight=FW_NORMAL,
322 uint8 italic=false, uint8 underline=false, uint8 strikeout=false,
323 uint8 charSet=1, // DEFAULT_CHARSET or UNICODE_CHARSET
328 const tstring& facename = tstring());
329
330 TFont(const LOGFONT& logFont);
331 TFont(const TFont& src);
332
333 // Type Accessor & Conversion Operator
334 //
335 HFONT GetHandle() const;
336 operator HFONT() const;
337 operator LOGFONT() const {return GetObject();}
338
339 // Retrieves info about this font when selected in the specified dc
340 //
341 TEXTMETRIC GetTextMetrics(TDC& dc) const;
342 void GetTextMetrics(TEXTMETRIC& tm, TDC& dc) const;
343
344 // Retrieves info about this font when selected in a screen DC
345 //
346 TEXTMETRIC GetTextMetrics() const;
347 void GetTextMetrics(TEXTMETRIC& tm) const;
348
349 // Retrieves specific attribute of font
350 //
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;
357 TSize GetTextExtent(const tstring& text) const;
358 TSize GetTextExtent(TDC& dc, const tstring& text) const;
359 tstring GetFaceName() const;
360 uint8 GetPitchAndFamily() const;
361
362 LOGFONT GetObject() const;
363
364#if defined(OWL5_COMPAT)
365
366 TFont(const LOGFONT* logFont);
367 bool GetObject(LOGFONT& logFont) const;
368
369#endif
370
371private:
372 TFont& operator =(const TFont&);
373};
374
375//
376/// Encapsulates the system font used for a specific GUI element, e.g. icon, caption, menu, message.
377//
379 : public TFont
380{
381public:
382
383 //
384 /// Defines the various GUI elements for which a default font can be created.
385 //
387 {
388 sfiLegacyDefault, ///< Represents the font returned by GetStockObject (DEFAULT_GUI_FONT).
389 sfiIcon, ///< Represents ICONMETRICS::lfFont.
390 sfiCaption, ///< Represents NONCLIENTMETRICS::lfCaptionFont.
391 sfiSmallCaption, ///< Represents NONCLIENTMETRICS::lfSmCaptionFont.
392 sfiMenu, ///< Represents NONCLIENTMETRICS::lfMenuFont.
393 sfiStatus, ///< Represents NONCLIENTMETRICS::lfStatusFont.
394 sfiMessage ///< Represents NONCLIENTMETRICS::lfMessageFont.
395 };
396
397 TDefaultGuiFont(TSystemFontId = sfiLegacyDefault);
398
399};
400
401//
402/// Deprecated alias
403//
405
406//
407/// \class TPalette
408// ~~~~~ ~~~~~~~~
409/// TPalette is the GDI Palette class derived from TGdiObject. The TPalette
410/// constructors can create palettes from explicit information or indirectly from
411/// various color table types that are used by DIBs.
412//
414public:
415 // Class scoped types
416 //
417 typedef HPALETTE THandle; ///< TPalette encapsulates an HPALETTE
418
419 // Constructors
420 //
422 TPalette(const TClipboard&);
423 TPalette(const TPalette& src); ///< Deep copy whole palette
425 TPalette(const PALETTEENTRY* entries, int count);
426 TPalette(const BITMAPINFO& info, uint flags=0); ///< Win 3.0 DIB hdr
427 TPalette(const TDib& dib, uint flags=0); ///< DIB object
428 TPalette(const tchar * fileName); ///< read from file: *.dib,*.bmp,*.pal,*.aco,*.act
429
430 //
431 /// Creates a TPalette object with the entries from the given array.
432 //
433 template <size_t N>
435 {Init(&entries[0], static_cast<int>(N));}
436
437 // Type Accessor & Conversion Operator
438 //
439 HPALETTE GetHandle() const;
440 operator HPALETTE() const;
441
442 // Palette functions
443 //
444 bool ResizePalette(uint numEntries);
445 void AnimatePalette(uint start, uint count, const PALETTEENTRY * entries);
446 uint SetPaletteEntries(uint16 start, uint16 count, const PALETTEENTRY * entries);
447 uint SetPaletteEntry(uint16 index, const PALETTEENTRY & entry);
448 uint GetPaletteEntries(uint16 start, uint16 count, PALETTEENTRY * entries) const;
449 uint GetPaletteEntry(uint16 index, PALETTEENTRY & entry) const;
450 uint GetNearestPaletteIndex(const TColor& color) const;
451 bool GetObject(uint16 & numEntries) const;
452 uint16 GetNumEntries() const;
453
454 // Put this palette onto the clipboard
455 //
456 void ToClipboard(TClipboard& Clipboard);
457 bool UnrealizeObject();
458
459 // Write this palette into file: *.dib,*.bmp,*.pal,*.aco,*.act
460 //
461 bool Write(const tchar * fileName);
462
463#if defined(OWL5_COMPAT)
464
466 TPalette(const BITMAPINFO* info, uint flags=0); ///< Win 3.0 DIB hdr
467
468#endif
469
470protected:
471 void Create(const BITMAPINFO * info, uint flags);
472
473 /// Read palette from file.
474 bool Read(const tchar * fileName);
475
476 /// Read Microsoft palette from file.
477 bool Read_PAL(TRiffFile& file);
478 /// Write Microsoft palette to file.
479 bool Write_PAL(TRiffFile& file);
480
481 /// Read Adobe palette from file.
482 bool Read_ACO(TRiffFile& file);
483 /// Write Adobe palette to file.
484 bool Write_ACO(TRiffFile& file);
485
486 /// Read Adobe palette from file.
487 bool Read_ACT(TRiffFile& file);
488 /// Write Adobe palette to file.
489 bool Write_ACT(TRiffFile& file);
490
491 /// Read palette from BMP file.
492 bool Read_BMP(TRiffFile& file);
493 /// Write palette to BMP 1x1 file.
494 bool Write_BMP(TRiffFile& file);
495
496private:
498 void Init(const PALETTEENTRY* entries, int count);
499};
500
501//
502/// \class TBitmap
503// ~~~~~ ~~~~~~~
504/// TBitmap is the GDI bitmap class derived from TGdiObject. TBitMap can construct a
505/// bitmap from many sources. TBitmap objects are DDBs (device-dependent bitmaps),
506/// which are different from the DIBs (device-independent bitmaps) represented by
507/// TDib objects. This bitmap is the lowest level object that is actually selected
508/// into a DC.
509//
511public:
512 // Class scoped types
513 //
514 typedef HBITMAP THandle; ///< TBitmap encapsulates an HBITMAP
515
516 // Constructors
517 //
519 TBitmap(const TClipboard& clipboard);
520 TBitmap(const TBitmap& bitmap);
521 TBitmap(int width, int height, uint8 planes=1, uint8 bitCount=1, const void * bits=nullptr);
522 TBitmap(const BITMAP& bitmap);
523 TBitmap(const TDC&, int width, int height, bool discardable = false);
524 TBitmap(const TDC&, const TDib& dib, uint32 usage=CBM_INIT);
525 TBitmap(const TMetaFilePict& metaFile, TPalette& palette, const TSize& size);
526 TBitmap(const TDib& dib, const TPalette* palette = nullptr);
527
529 ~TBitmap();
530
531 // Type Accessor & Conversion Operator
532 //
533 HBITMAP GetHandle() const;
534 operator HBITMAP() const;
535
536 // Get/set GDI Object information
537 //
538 bool GetObject(BITMAP & bitmap) const;
539 BITMAP GetObject() const;
540 int Width() const;
541 int Height() const;
542 TSize Size() const;
543 int Planes() const;
544 int BitsPixel() const;
545 uint32 GetBitmapBits(uint32 count, void * bits) const;
546 uint32 SetBitmapBits(uint32 count, const void * bits);
547 bool GetBitmapDimension(TSize& size) const;
548 TSize GetBitmapDimension() const;
549 bool SetBitmapDimension(const TSize& size, TSize * oldSize=nullptr);
550
551 // Put this bitmap onto the clipboard
552 //
553 void ToClipboard(TClipboard& clipboard);
554
555
556#if defined(OWL5_COMPAT)
557
558 TBitmap(const BITMAP* bitmap);
559
560#endif
561
562protected:
563 TBitmap();
564
565 // Create a bitmap & fill in it's Handle
566 //
567 void Create(const TDib& dib, const TPalette& palette);
568 void Create(const TBitmap& src);
569
570private:
571 TBitmap& operator =(const TBitmap&);
572};
573
574//
575/// \class TRegion
576// ~~~~~ ~~~~~~~
577/// TRegion, derived from TGdiObject, represents GDI abstract shapes or regions.
578/// TRegion can construct region objects with various shapes. Several operators are
579/// provided for combining and comparing regions.
580//
581class _OWLCLASS TRegion : private TGdiBase {
582public:
583 // Class scoped types
584 //
585 typedef HRGN THandle; ///< TRegion encapsulates an HRGN
586
587 // Constructors
588 //
589 TRegion();
590 TRegion(HRGN handle, TAutoDelete autoDelete = NoAutoDelete);
591 TRegion(const TRegion& region);
592 TRegion(const TRect& rect);
593
594/// Defines the class-specific constant Ellipse, used to distinguish the ellipse
595/// constructor from the rectangle copy constructor.
596 enum TEllipse {Ellipse};
597
598 TRegion(const TRect& e, TEllipse);
599 TRegion(const TRect& rect, const TSize& corner);
600 TRegion(const TPoint* points, int count, int fillMode);
601 TRegion(const TPoint* points, const int* polyCounts, int count, int fillMode);
602
603 //
604 /// Creates a filled TRegion object from the polygon given by an array of points and fillMode.
605 //
606 template <size_t N>
608 {Init(&points[0], static_cast<int>(N), fillMode);}
609
610 //
611 /// Creates a filled TRegion object from the poly-polygons given by points and fillMode.
612 /// The 'points' argument should point into an array of points for all the polygons, and
613 /// polyCounts should contain the number of points in each polygon.
614 //
615 template <size_t N>
616 TRegion(const TPoint* points, const int (&polyCounts)[N], int fillMode)
617 {Init(points, &polyCounts[0], static_cast<int>(N), fillMode);}
618
619 ~TRegion();
620
621 // Other initialization
622 //
623 void SetRectRgn(const TRect& rect);
624
625 // Type Accessor & Conversion Operator
626 //
627 HRGN GetHandle() const;
628 operator HRGN() const;
629
630 // Handle ownership
631 //
632 auto Release() -> HRGN;
633
634 // Test and information functions/operators
635 //
636 bool operator ==(const TRegion& other) const;
637 bool operator !=(const TRegion& other) const;
638 bool Contains(const TPoint& point) const;
639 bool Touches(const TRect& rect) const;
640 int GetRgnBox(TRect& box) const;
641 TRect GetRgnBox() const;
642
643 // Assignment operators
644 //
655
656private:
657
658 void Init(const TPoint* points, int count, int fillMode);
659 void Init(const TPoint* points, const int* polyCounts, int count, int fillMode);
660};
661
662//
663/// \class TIcon
664// ~~~~~ ~~~~~
665/// TIcon, derived from TGdiObject, represents the GDI object icon class. TIcon
666/// constructors can create icons from a resource or from explicit information.
667/// Because icons are not real GDI objects, the TIcon destructor overloads the base
668/// destructor, ~TGdiObject.
669//
670class _OWLCLASS TIcon : private TGdiBase {
671public:
672 // Class scoped types
673 //
674 typedef HICON THandle; ///< TIcon encapsulates an HICON
675
676 // Constructors
677 //
678 TIcon(HICON handle, TAutoDelete autoDelete = NoAutoDelete);
679 TIcon(HINSTANCE, const TIcon& icon);
681 TIcon(HINSTANCE, const tstring& filename, int index);
682 TIcon(HINSTANCE, const TSize& size, int planes, int bitsPixel,
683 const void * andBits, const void * xorBits);
684 TIcon(const void* resBits, uint32 resSize);
685 TIcon(const ICONINFO& iconInfo);
686 ~TIcon();
687
688 // Type Accessor & Conversion Operator
689 //
690 HICON GetHandle() const;
691 operator HICON() const;
692
693 bool operator ==(const TIcon& other) const;
694
704 auto GetInfo() const -> TInfo;
705
706 auto GetIconInfo() const -> ICONINFO;
707 auto GetIconInfoEx() const -> ICONINFOEX;
708
709#if defined(OWL5_COMPAT)
710
711 TIcon(const ICONINFO* iconInfo);
712 bool GetIconInfo(ICONINFO* iconInfo) const;
713
714#endif
715
716private:
717 TIcon(const TIcon&); // Protect against copying of icons
718 TIcon& operator =(const TIcon&);
719
720};
721
722//
723/// \class TCursor
724// ~~~~~ ~~~~~~~
725/// TCursor, derived from TGdiBase, represents the GDI cursor object class. TCursor
726/// constructors can create cursors from a resource or from explicit information.
727/// Because cursors are not real GDI objects, the TCursor destructor overrides the
728/// base destructor, ~TGdiBase.
729//
730class _OWLCLASS TCursor : public TGdiBase {
731public:
732 // Class scoped types
733 //
734 typedef HCURSOR THandle; ///< TCursor encapsulates an HCURSOR
735
736 // Constructors
737 //
742 const TSize& size, void * andBits, void * xorBits);
743 TCursor(const void* resBits, uint32 resSize);
744 TCursor(const ICONINFO& iconInfo);
745 ~TCursor();
746
747 // Type Accessor & Conversion Operator
748 //
749 HCURSOR GetHandle() const;
750 operator HCURSOR() const;
751
752 bool operator ==(const TCursor& other) const;
753
763 auto GetInfo() const -> TInfo;
764
765 auto GetIconInfo() const -> ICONINFO;
766 auto GetIconInfoEx() const -> ICONINFOEX;
767
768#if defined(OWL5_COMPAT)
769
770 TCursor(const ICONINFO* iconInfo);
771 bool GetIconInfo(ICONINFO* iconInfo) const;
772
773#endif
774
775private:
776 TCursor(const TCursor&); // Protect against copying of cursors
777 TCursor& operator =(const TCursor&);
778
779};
780
781//
782/// \class TDib
783// ~~~~~ ~~~~
784/// Pseudo-GDI object Device Independent Bitmap (DIB) class. DIBs really have
785/// no Window's handle, they are just a structure containing format and palette
786/// information and a collection of bits (pixels). This class provides a very
787/// convenient way to work with DIBs like any other GDI object.
788/// The memory for the DIB is in one GlobalAlloc'd chunk so it can be passed to
789/// the Clipboard, OLE, etc.
790/// Overloads the destructor since it is not a real GDI object.
791///
792/// This is what is really inside a .BMP file, what is in bitmap resources, and
793/// what is put on the clipboard as a DIB.
794//
795class _OWLCLASS TDib : private TGdiBase {
796public:
797 // Class scoped types
798 //
799 typedef HANDLE THandle; ///< TDib encapsulates an memory HANDLE w/ a DIB
800
801 // Constructors and destructor
802 //
803 explicit TDib(HGLOBAL handle, TAutoDelete autoDelete = NoAutoDelete);
804 explicit TDib(const TClipboard& clipboard);
805 TDib(const TDib& src);
806
807 TDib(int width, int height, uint32 nColors, uint16 mode=DIB_RGB_COLORS);
808 TDib(HINSTANCE module, TResId resid);
809 explicit TDib(LPCTSTR filename);
810 explicit TDib(const tstring& filename);
811 explicit TDib(TFile& file, bool readFileHeader = true);
812 explicit TDib(std::istream& is, bool readFileHeader = false);
813 explicit TDib(const TBitmap& bitmap, const TPalette* pal = nullptr);
814 virtual ~TDib();
815
816 // Comparison operator
817 //
818 bool operator ==(const TDib& other) const;
819
820 // Access to the internal structures of the dib
821 //
822 const BITMAPINFO * GetInfo() const;
823 BITMAPINFO * GetInfo();
824 const BITMAPINFOHEADER *GetInfoHeader() const;
825 BITMAPINFOHEADER * GetInfoHeader();
826 const TRgbQuad * GetColors() const;
827 TRgbQuad * GetColors();
828 const uint16 * GetIndices() const;
829 uint16 * GetIndices();
830 const void * GetBits() const;
831 void * GetBits();
832
833 // Type convert this dib by returning pointers to internal structures
834 //
835 HANDLE GetHandle() const;
836 operator HANDLE() const;
837
838 operator const BITMAPINFO *() const;
839 operator BITMAPINFO *();
840 operator const BITMAPINFOHEADER *() const;
841 operator BITMAPINFOHEADER *();
842 operator const TRgbQuad *() const;
843 operator TRgbQuad *();
844
845 // Put this Dib onto the clipboard
846 //
847 void ToClipboard(TClipboard& clipboard);
848
849 // Get info about this Dib
850 //
851 bool IsOK() const; // Is DIB OK & info available
852 bool IsPM() const; // Is DIB stored in PM core format
853 int Width() const; // Width in pixels
854 int Height() const; // Height in pixels
855 int FlippedY(int y) const;// Y flipped the other direction
856 TSize Size() const; // Width & Height in pixels
857 int BitsPixel() const; // Bits per pixel: 2, 4, 8, 16, 24, 32
858 int Pitch() const; // Width in bytes, or bytes per scan
859 uint32 Compression() const; // Compression & encoding flags
860 uint32 SizeImage() const; // Size of the DIB image bits in bytes
861
862 long NumColors() const; // Number of colors in color table
863 uint StartScan() const; // Starting scan line
864 uint NumScans() const; // Number of scans
865 int32 SizeColors() const; // Size of the color table in bytes.
866 uint32 SizeDib() const; // Memory size of DIB in bytes
867 uint16 Usage() const; // The mode or usage of the color table
868
869 int XOffset(uint16 x) const;
870 int YOffset(uint16 y) const;
871
872 void * PixelPtr(uint16 x, uint16 y);
873
874 // Write this dib to a file by name, to file object or to an ostream
875 //
876 bool WriteFile(const tstring& filename);
877 bool Write(TFile& file, bool writeFileHeader = false);
878 bool Write(std::ostream& os, bool writeFileHeader = false);
879
880 // Work with the color table in RGB mode
881 //
882 TColor GetColor(int entry) const;
883 void SetColor(int entry, const TColor& color);
884 int FindColor(const TColor& color);
885 int MapColor(const TColor& fromColor, const TColor& toColor, bool doAll = false);
886
887 // Work with the color table in Palette relative mode
888 //
889 uint16 GetIndex(int entry) const;
890 void SetIndex(int entry, uint16 index);
891 int FindIndex(uint16 index);
892 int MapIndex(uint16 fromIndex, uint16 toIndex, bool doAll = false);
893
894 // Change from RGB to Palette, or from Palette to RGB color table mode
895 //
896 bool ChangeModeToPal(const TPalette& pal);
897 bool ChangeModeToRGB(const TPalette& pal);
898
899 /// Map colors in color table matching stock UI colors to current UI colors
900 //
901 /// Enumerates the values for the part of the window whose color is to be set. You
902 /// can OR these together to control the colors used for face shading on push
903 /// buttons, the color of a selected control button, the edge shading on push
904 /// buttons, text on push buttons, the color of the window frame, and the background
905 /// color of the various parts of a window. The function MapUIColors uses one of
906 /// these values to map the colors of various parts of a window to a specified
907 /// color.
908 //
909 enum {
910 MapFace = 0x01, // Or these together to control colors to map
911 MapText = 0x02, // to current SysColor values
912 MapShadow = 0x04,
913 MapHighlight = 0x08,
914 MapFrame = 0x10
915 };
916 void MapUIColors(uint mapColors, const TColor* bkColor = nullptr);
917
918
919 void MapToPalette(const TPalette& pal);
920
921 /// Internal DIB file Reda/Write functions talk to these interfaces
922 //
924 public:
925 virtual long Read(void * buffer, long size) = 0;
926 virtual void Skip(long size) = 0;
927 };
929 public:
930 virtual bool Write(void * buffer, long size) = 0;
931 };
932
933protected:
934 using TGdiBase::CheckValid; // make this function available to derivatives
935 using TGdiBase::Handle; // and these members too
936 using TGdiBase::ShouldDelete;
937
938 /// Protected ctor- derived classes need to fill in handle & get info
939 //
940 TDib();
941
942 void InfoFromHeader(const BITMAPINFOHEADER& infoHeader);
943 void InfoFromHandle(); // Get info & members from handle
944 void CopyOnWrite(); // Make sure we can write on info
945 void ResToMemHandle(); // Perform RO res handle to mem handle copy
946
947 bool ReadFile(const tstring& name);
948 bool Read(TFile& file, bool readFileHeader = false);
949 bool Read(std::istream& is, bool readFileHeader = false);
950
951 bool LoadResource(HINSTANCE, TResId);
952
953 // virtuals for derived classes
954 virtual bool Read(IFileIn& in, bool readFileHeader = false);
955 virtual bool Write(IFileOut& out, bool writeFileHeader = false);
956
957 static int ScanBytes(long w, int bpp); ///< Width+bpp to dword aligned bytes
958
960 BITMAPINFO * Info; ///< Locked global alloc'd block, has sub ptrs:
961 uint32 * Mask; ///< Color mask[3] for 16 & 32 bpp bmps
962 TRgbQuad * Colors; ///< Color table[NumClrs] for any bmp
963 void * Bits; ///< Pointer to bits (pixels)
964 long NumClrs; ///< Number of colors in color table
965 uint16 Mode; ///< Palette or RGB based pixels
966 bool IsResHandle;///< Is Handle a resource handle (vs. Memory)
967
968private:
969 // Prevent accidental copying of object
970 //
971 TDib& operator =(const TDib&);
972
973};
974
975/// @}
976
977#include <owl/posclass.h>
978
979} // OWL namespace
980
981//----------------------------------------------------------------------------
982// Inline implementations for abstract GDI object class and derived classes.
983//
984
985#include <owl/dc.h>
986#include <owl/clipboar.h>
987
988namespace owl {
989
990//
991/// Get the palette object from the clipboard.
992//
994{
995 palette.ToClipboard(clipboard);
996 return clipboard;
997}
998
999//
1000/// Get the bitmap object from the clipboard.
1001//
1003{
1004 bitmap.ToClipboard(clipboard);
1005 return clipboard;
1006}
1007
1008//
1009/// Get the DIB from the clipboard.
1010//
1012{
1013 dib.ToClipboard(clipboard);
1014 return clipboard;
1015}
1016
1017//
1018/// Returns the handle of the GDI object.
1019//
1021{
1022 return HGDIOBJ(Handle);
1023}
1024
1025//
1026/// Typecasting operator that converts this GDI object handle to type HGDIOBJ.
1027//
1028inline TGdiObject::operator HGDIOBJ() const
1029{
1030 return GetGdiHandle();
1031}
1032
1033//
1034/// Returns true if the handles are equal. This is a binary compare.
1035//
1037{
1038 return Handle == other.Handle;
1039}
1040
1041//
1042/// Retrieve the object's attributes into a buffer.
1043//
1044/// Obtains information about this GDI object and places it in the object buffer. If
1045/// the call succeeds and object is not 0, GetObject returns the number of bytes
1046/// copied to the object buffer. If the call succeeds and object is 0, GetObject
1047/// returns the number of bytes needed in the object buffer for the type of object
1048/// being queried. Depending on what type of GDI object is derived, this function
1049/// retrieves a LOGPEN, LOGBRUSH, LOGFONT, or BITMAP structure through object.
1050//
1051inline int TGdiObject::GetObject(int count, void * object) const
1052{
1053# if defined(UNICODE)
1054 return ::GetObjectW(Handle, count, object);
1055# else
1056 return ::GetObjectA(Handle, count, object);
1057# endif
1058}
1059
1060//
1061/// Returns the type of the GDI object.
1062//
1064{
1065 return ::GetObjectType(GetGdiHandle());
1066}
1067
1068//
1069/// Returns true if this represents a real GDI object.
1070//
1071inline bool TGdiObject::IsGDIObject() const
1072{
1073 return GetObjectType() != 0;
1074}
1075
1076//
1077/// Returns the handle of the pen with type HPEN.
1078//
1079inline HPEN TPen::GetHandle() const
1080{
1081 return HPEN(GetGdiHandle());
1082}
1083
1084//
1085/// Typecasting operator. Converts this pen's Handle to type HPEN (the data type
1086/// representing the handle to a logical pen).
1087//
1088inline TPen::operator HPEN() const
1089{
1090 return GetHandle();
1091}
1092
1093#if defined(OWL5_COMPAT)
1094
1095//
1096/// Retrieves information about this pen object and places it in the given LOGPEN
1097/// structure. Returns true if the call is successful, otherwise false.
1098/// This overload is deprecated. Use the overload that returns a LOGPEN instead.
1099//
1100inline bool TPen::GetObject(LOGPEN & logPen) const
1101{
1102 return TGdiObject::GetObject(sizeof(logPen), &logPen) != 0;
1103}
1104
1105#endif
1106
1107//
1108/// Returns the handle of the brush with type HBRUSH.
1109//
1111{
1112 return HBRUSH(GetGdiHandle());
1113}
1114
1115//
1116/// Typecasting operator. Converts this brush's Handle to type HBRUSH (the data type
1117/// representing the handle to a physical brush).
1118//
1119inline TBrush::operator HBRUSH() const
1120{
1121 return GetHandle();
1122}
1123
1124#if defined(OWL5_COMPAT)
1125
1126//
1127/// Retrieves information about this brush object and places it in the given
1128/// LOGBRUSH structure. Returns true if the call is successful; otherwise returns false.
1129/// This overload is deprecated. Use the overload that returns a LOGBRUSH instead.
1130//
1131inline bool TBrush::GetObject(LOGBRUSH & logBrush) const
1132{
1133 return TGdiObject::GetObject(sizeof(logBrush), &logBrush) != 0;
1134}
1135
1136#endif
1137
1138
1139//
1140/// Returns the handle of the font with type HFONT.
1141//
1143{
1144 return HFONT(GetGdiHandle());
1145}
1146
1147//
1148/// Typecasting operator that converts this font's Handle to type HFONT (the data
1149/// type representing the handle to a physical font).
1150//
1151inline TFont::operator HFONT() const
1152{
1153 return GetHandle();
1154}
1155
1156#if defined(OWL5_COMPAT)
1157
1158//
1159/// Retrieves information about this font object and places it in the given LOGFONT
1160/// structure. Returns true if successful and false if unsuccessful.
1161/// This overload is deprecated; use the overload that returns a LOGFONT instead.
1162//
1163inline bool TFont::GetObject(LOGFONT & logFont) const
1164{
1165 return TGdiObject::GetObject(sizeof(logFont), &logFont) != 0;
1166}
1167
1168#endif
1169
1170//
1171/// Returns the height of the font.
1172//
1173inline int TFont::GetHeight() const
1174{
1175 return int(GetTextMetrics().tmHeight);
1176}
1177
1178//
1179/// Returns the height of the font if selected into the DC.
1180//
1181inline int TFont::GetHeight(TDC& dc) const
1182{
1183 return int(GetTextMetrics(dc).tmHeight);
1184}
1185
1186//
1187/// Returns the average width of the characters in the font.
1188//
1189inline int TFont::GetAveWidth() const
1190{
1192}
1193
1194//
1195/// Returns the average width of the characters in the font if selected into the DC.
1196//
1197inline int TFont::GetAveWidth(TDC& dc) const
1198{
1199 return int(GetTextMetrics(dc).tmAveCharWidth);
1200}
1201
1202//
1203/// Returns the maximum width of the characters in the font.
1204//
1205inline int TFont::GetMaxWidth() const
1206{
1208}
1209
1210//
1211/// Returns the maximum width of the characters in the font if selected into
1212/// the DC.
1213//
1214inline int TFont::GetMaxWidth(TDC& dc) const
1215{
1216 return int(GetTextMetrics(dc).tmMaxCharWidth);
1217}
1218
1219//
1220/// Returns the handle of the palette.
1221//
1223{
1224 return HPALETTE(GetGdiHandle());
1225}
1226
1227//
1228/// Typecasting operator. Converts this palette's Handle to type HPALETTE, which is
1229/// the data type representing the handle to a logical palette.
1230//
1231inline TPalette::operator HPALETTE() const
1232{
1233 return GetHandle();
1234}
1235
1236//
1237/// Directs the GDI to completely remap the logical palette to the system palette on
1238/// the next RealizePalette(HDC) or TDC::RealizePalette call. Returns true if the
1239/// call is successful; otherwise false.
1240//
1242{
1243 return ::UnrealizeObject(Handle);
1244}
1245
1246//
1247/// Changes the size of this logical palette to the number given by numEntries.
1248/// Returns true if the call is successful; otherwise returns false.
1249//
1251{
1252 return ::ResizePalette(GetHandle(), numEntries);
1253}
1254
1255//
1256/// Animate palette from entry 'start' for 'count' entries.
1257//
1258/// Replaces entries in this logical palette from the entries array of PALETTEENTRY
1259/// structures. The parameter start specifies the first entry to be animated, and
1260/// count gives the number of entries to be animated. The new entries are mapped
1261/// into the system palette immediately.
1262//
1264{
1266}
1267
1268//
1269/// Sets the RGB color values in this palette from the entries array of PALETTEENTRY
1270/// structures. The start parameter specifies the first entry to be animated, and
1271/// count gives the number of entries to be animated. Returns the number of entries
1272/// actually set, or 0 if the call fails.
1273//
1275{
1276 //JJH - this is not very nice workaround... :o(, but good ones seems to be expensive
1277#ifdef WINELIB
1278 return ::SetPaletteEntries(GetHandle(), start, count, (PALETTEENTRY *)entries);
1279#else
1280 return ::SetPaletteEntries(GetHandle(), start, count, entries);
1281#endif
1282}
1283
1284//
1285/// Sets the RGB color value at index in this palette from the entry argument. The
1286/// start parameter specifies the first entry to be animated, and count gives the
1287/// number of entries to be animated. Returns 1, the number of entries actually set
1288/// if successful, or 0 if the call fails.
1289//
1291{
1292 //JJH - this is not very nice workaround... :o(, but good ones seems to be expensive
1293#ifdef WINELIB
1294 return ::SetPaletteEntries(GetHandle(), index, 1, (PALETTEENTRY *)&entry);
1295#else
1296 return ::SetPaletteEntries(GetHandle(), index, 1, &entry);
1297#endif
1298}
1299
1300//
1301/// Retrieves a range of entries in this logical palette and places them in the
1302/// entries array. The start parameter specifies the first entry to be retrieved,
1303/// and count gives the number of entries to be retrieved. Returns the number of
1304/// entries actually retrieved, or 0 if the call fails.
1305//
1307{
1308 return ::GetPaletteEntries(GetHandle(), start, count, entries);
1309}
1310
1311//
1312/// Retrieves the entry in this logical palette at index and places it in the
1313/// entries array. Returns the number of entries actually retrieved: 1 if successful
1314/// or 0 if the call fails.
1315//
1317{
1318 return ::GetPaletteEntries(GetHandle(), index, 1, &entry);
1319}
1320
1321//
1322/// Returns the index of the color entry that represents the closest color in this
1323/// palette to the given color.
1324//
1326{
1327 return ::GetNearestPaletteIndex(GetHandle(), Color);
1328}
1329
1330//
1331/// Finds the number of entries in this logical palette and sets the value in the
1332/// numEntries argument. To find the entire LOGPALETTE structure, use
1333/// GetPaletteEntries. Returns true if the call is successful; otherwise returns
1334/// false.
1335//
1337{
1339}
1340
1341//
1342/// Returns the number of entries in this palette, or 0 if the call fails.
1343//
1345{
1348 return numEntries;
1349 return 0;
1350}
1351
1352//
1353/// Returns the handle of the bitmap of type BITMAP.
1354//
1356{
1357 return HBITMAP(GetGdiHandle());
1358}
1359
1360//
1361/// Typecasting operator. Converts this bitmap's Handle to type HBITMAP (the data
1362/// type representing the handle to a physical bitmap).
1363//
1364inline TBitmap::operator HBITMAP() const
1365{
1366 return GetHandle();
1367}
1368
1369//
1370/// Copies up to count bits of this bitmap to the buffer bits.
1371//
1372inline uint32 TBitmap::GetBitmapBits(uint32 count, void * bits) const
1373{
1374 return ::GetBitmapBits(GetHandle(), count, bits);
1375}
1376
1377//
1378/// Copies up to count bits from the bits buffer to this bitmap.
1379//
1380inline uint32 TBitmap::SetBitmapBits(uint32 count, const void * bits)
1381{
1382 return ::SetBitmapBits(GetHandle(), count, bits);
1383}
1384
1385//
1386/// Retrieves the size of this bitmap (width and height, measured in tenths of
1387/// millimeters) and sets it in the size argument. Returns true if the call is
1388/// successful; otherwise returns false.
1389//
1390inline bool TBitmap::GetBitmapDimension(TSize& size) const
1391{
1392 return ::GetBitmapDimensionEx(GetHandle(), &size);
1393}
1394
1395//
1396/// Sets the size of this bitmap from the given size argument (width and height,
1397/// measured in tenths of millimeters). The previous size is set in the oldSize
1398/// argument. Returns true if the call is successful; otherwise returns false.
1399//
1401{
1402 return ::SetBitmapDimensionEx(GetHandle(), size.cx, size.cy, oldSize);
1403}
1404
1405//
1406/// Retrieves data (width, height, and color format) for this bitmap and sets it in
1407/// the given BITMAP structure. To retrieve the bit pattern, use GetBitmapBits.
1408//
1409inline bool TBitmap::GetObject(BITMAP & Bitmap) const
1410{
1411 return TGdiObject::GetObject(sizeof(Bitmap), &Bitmap) != 0;
1412}
1413
1414//
1415/// Returns the handle of the region with type HREGION.
1416//
1418 return HRGN(Handle);
1419}
1420
1421//
1422/// Returns the encapsulated handle of the region and relinquishes ownership.
1423//
1424inline auto TRegion::Release() -> HRGN
1425{
1426 PRECONDITION(ShouldDelete);
1427 ShouldDelete = false;
1428 return GetHandle();
1429}
1430
1431//
1432/// Typecast operator. HRGN is the data type representing the handle to a physical
1433/// region.
1434//
1435inline TRegion::operator HRGN() const{
1436 return GetHandle();
1437}
1438
1439//
1440/// Creates a rectangle of the size given by rect.
1441//
1442inline void TRegion::SetRectRgn(const TRect& rect)
1443{
1444 ::SetRectRgn(GetHandle(), rect.left, rect.top, rect.right, rect.bottom);
1445}
1446
1447//
1448/// Returns true if the regions are identical (equal in size and shape).
1449//
1450inline bool TRegion::operator ==(const TRegion& other) const
1451{
1452 return ::EqualRgn(GetHandle(), other);
1453}
1454
1455//
1456/// Returns true if this region is not equal to the other region.
1457//
1458inline bool TRegion::operator !=(const TRegion& other) const
1459{
1460 return !::EqualRgn(GetHandle(), other);
1461}
1462
1463//
1464/// Returns true if this region contains the given point.
1465//
1466inline bool TRegion::Contains(const TPoint& point) const
1467{
1468 return ::PtInRegion(GetHandle(), point.x, point.y);
1469}
1470
1471//
1472/// Returns true if this region touches the given rectangle.
1473//
1474inline bool TRegion::Touches(const TRect& rect) const
1475{
1476 return ::RectInRegion(GetHandle(), const_cast<TRect*>(&rect)); // API <const> typecast
1477}
1478
1479//
1480/// Finds the bounding rectangle (the minimum rectangle containing this region). The
1481/// resulting rectangle is placed in box and the returned values are as follows:
1482/// - \c \b COMPLEXREGION Region has overlapping borders.
1483/// - \c \b NULLREGION Region is empty.
1484/// - \c \b SIMPLEREGION Region has no overlapping borders.
1485//
1486inline int TRegion::GetRgnBox(TRect& box) const
1487{
1488 return ::GetRgnBox(GetHandle(), &box);
1489}
1490
1491//
1492/// Returns the bounding rectangle of the region.
1493//
1495{
1496 TRect box;
1498 return box;
1499}
1500
1501//
1502/// Assigns the source region to this region. A reference to the result is returned,
1503/// allowing chained assignments.
1504//
1506{
1507 ::CombineRgn(GetHandle(), source, nullptr, RGN_COPY);
1508 return *this;
1509}
1510
1511//
1512/// Adds the given delta to each point of this region to displace (translate) it by
1513/// delta.x and delta.y. Returns a reference to the resulting region.
1514//
1516{
1517 ::OffsetRgn(GetHandle(), delta.cx, delta.cy);
1518 return *this;
1519}
1520
1521//
1522/// Subtracts the given delta from each point of this region to
1523/// displace (translate) it by -delta.x and -delta.y. Returns a reference to the resulting region.
1524//
1526{
1527 ::OffsetRgn(GetHandle(), -delta.cx, -delta.cy);
1528 return *this;
1529}
1530
1531//
1532/// Creates a "difference" region consisting of all parts of this region that are not parts of
1533/// the source region. Returns a reference to the resulting region.
1534//
1536{
1538 return *this;
1539}
1540
1541//
1542/// Creates the intersection of this region with the given source region
1543/// and returns a reference to the result.
1544//
1546{
1548 return *this;
1549}
1550
1551//
1552/// Creates the union of this region and the given source region , and
1553/// returns a reference to the result.
1554//
1556{
1558 return *this;
1559}
1560
1561//
1562/// Creates the exclusive-or of this region and the given source region.
1563/// Returns a reference to the resulting region object.
1564//
1566{
1568 return *this;
1569}
1570
1571//
1572/// Returns the handle of the icon with type HICON.
1573//
1575{
1576 return HICON(Handle);
1577}
1578
1579//
1580/// Typecasting operator that converts this icon's Handle to type HICON (the data
1581/// type representing the handle to an icon resource).
1582//
1583inline TIcon::operator HICON() const
1584{
1585 return GetHandle();
1586}
1587
1588//
1589/// Returns true if the handles of two icons are identical.
1590//
1591inline bool TIcon::operator ==(const TIcon& other) const
1592{
1593 return Handle == other.Handle;
1594}
1595
1596#if defined(OWL5_COMPAT)
1597
1598//
1599/// Retrieves information about this icon and copies it into the given ICONINFO
1600/// structure. Returns true if the call is successful; otherwise returns false.
1601/// This overload is deprecated. Use the overload that returns ICONINFO instead.
1602//
1603inline bool TIcon::GetIconInfo(ICONINFO* IconInfo) const
1604{
1605 return ::GetIconInfo(GetHandle(), IconInfo);
1606}
1607
1608//
1609/// Retrieves information about this cursor and copies it into the given ICONINFO
1610/// structure. Returns true if the call is successful; otherwise returns false.
1611/// This overload is deprecated. Use the overload that returns ICONINFO instead.
1612//
1613inline bool TCursor::GetIconInfo(ICONINFO* IconInfo) const
1614{
1615 return ::GetIconInfo((HICON)GetHandle(), IconInfo);
1616}
1617
1618#endif
1619
1620//
1621/// Returns the handle of the cursor with type HCURSOR.
1622//
1624{
1625 return HCURSOR(Handle);
1626}
1627
1628//
1629/// An inline typecasting operator. Converts this cursor's Handle to type HCURSOR
1630/// (the data type representing the handle to a cursor resource).
1631//
1632inline TCursor::operator HCURSOR() const
1633{
1634 return GetHandle();
1635}
1636
1637//
1638/// Returns true if this cursor equals other; otherwise returns false.
1639//
1640inline bool TCursor::operator ==(const TCursor& other) const
1641{
1642 return Handle == other.Handle;
1643}
1644
1645//
1646/// Compares two handles and returns true if this DIB's handle equals the other
1647/// (other) DIB's handle.
1648//
1649inline bool TDib::operator ==(const TDib& other) const
1650{
1651 return Handle == other.Handle;
1652}
1653
1654//
1655/// Returns this DIB's Info field. A DIB's BITMAPINFO structure contains information
1656/// about the dimensions and color of the DIB and specifies an array of data types
1657/// that define the colors in the bitmap.
1658//
1659inline const BITMAPINFO * TDib::GetInfo() const
1660{
1661 return Info;
1662}
1663
1664//
1665/// Returns this DIB's Info field. A DIB's BITMAPINFO structure contains information
1666/// about the dimensions and color of the DIB and specifies an array of data types
1667/// that define the colors in the bitmap.
1668//
1670{
1671 return Info;
1672}
1673
1674//
1675/// Returns this DIB's bmiHeader field of the BITMAPINFO structure contains
1676/// information about the color and dimensions of this DIB.
1677//
1679{
1680 return &Info->bmiHeader;
1681}
1682
1683//
1684/// Returns this DIB's bmiHeader field of the BITMAPINFO structure contains
1685/// information about the color and dimensions of this DIB.
1686//
1688{
1689 return &Info->bmiHeader;
1690}
1691
1692//
1693/// Returns the bmiColors value of this DIB.
1694//
1695inline const TRgbQuad * TDib::GetColors() const
1696{
1697 return Colors;
1698}
1699
1700//
1701/// Returns the bmiColors value of this DIB.
1702//
1704{
1705 return Colors;
1706}
1707
1708//
1709/// Returns the bmiColors indexes of this DIB.
1710//
1711inline const uint16 * TDib::GetIndices() const
1712{
1713 return reinterpret_cast<const uint16*>(Colors);
1714}
1715
1716//
1717/// Returns the bmiColors indexes of this DIB.
1718//
1720{
1721 return reinterpret_cast<uint16*>(Colors);
1722}
1723
1724//
1725/// Returns the Bits data member for this DIB.
1726//
1727inline const void * TDib::GetBits() const
1728{
1729 return Bits;
1730}
1731
1732//
1733/// Returns the Bits data member for this DIB.
1734//
1735inline void * TDib::GetBits()
1736{
1737 return Bits;
1738}
1739
1740//
1741/// Returns the handle of the DIB with type HANDLE.
1742//
1744{
1745 return Handle;
1746}
1747
1748//
1749/// Return the handle of the DIB with type HANDLE.
1750//
1751inline TDib::operator HANDLE() const
1752{
1753 return GetHandle();
1754}
1755
1756//
1757/// Typecasts this DIB by returning a pointer to its bitmap information structure
1758/// (BITMAPINFO) which contains information about this DIB's color format and
1759/// dimensions (size, width, height, resolution, and so on).
1760//
1761inline TDib::operator const BITMAPINFO *() const
1762{
1763 return GetInfo();
1764}
1765
1766//
1767/// Typecasts this DIB by returning a pointer to its bitmap information structure
1768/// (BITMAPINFO) which contains information about this DIB's color format and
1769/// dimensions (size, width, height, resolution, and so on).
1770//
1771inline TDib::operator BITMAPINFO *()
1772{
1773 return GetInfo();
1774}
1775
1776//
1777/// Typecasts this DIB by returning a pointer to its bitmap info header.
1778//
1779inline TDib::operator const BITMAPINFOHEADER *() const
1780{
1781 return GetInfoHeader();
1782}
1783
1784//
1785/// Typecasts this DIB by returning a pointer to its bitmap info header.
1786//
1787inline TDib::operator BITMAPINFOHEADER *()
1788{
1789 return GetInfoHeader();
1790}
1791
1792//
1793/// Typecasts this DIB by returning a pointer to its colors structure.
1794//
1795inline TDib::operator const TRgbQuad *() const
1796{
1797 return GetColors();
1798}
1799
1800//
1801/// Typecasts this DIB by returning a pointer to its colors structure.
1802//
1803inline TDib::operator TRgbQuad *()
1804{
1805 return GetColors();
1806}
1807
1808//
1809/// Returns false if Info is 0, otherwise returns true. If there is a problem with
1810/// the construction of the DIB, memory is freed and Info is set to 0. Therefore,
1811/// using Info is a reliable way to determine if the DIB is constructed correctly.
1812//
1813inline bool TDib::IsOK() const
1814{
1815 return Info != nullptr;
1816}
1817
1818//
1819/// Returns true if IsCore is true; that is, if the DIB is an old-style PM DIB using
1820/// core headers. Otherwise returns false.
1821///
1822/// \note Returns false always since PM bitmaps are not supported.
1823//
1824inline bool TDib::IsPM() const
1825{
1826 return false;
1827}
1828
1829//
1830/// Returns the width of the DIB.
1831//
1832inline int TDib::Width() const
1833{
1834 return static_cast<int>(Info->bmiHeader.biWidth);
1835}
1836
1837//
1838/// Returns the height of the DIB.
1839//
1840inline int TDib::Height() const
1841{
1842 return static_cast<int>(Info->bmiHeader.biHeight);
1843}
1844
1845//
1846/// Returns the coordinate of y if the direction of the y-axis was reversed.
1847//
1848inline int TDib::FlippedY(int y) const
1849{
1850 return static_cast<int>(Info->bmiHeader.biHeight) - 1 - y;
1851}
1852
1853//
1854/// Returns TSize(W,H), the size of this DIB.
1855//
1856inline TSize TDib::Size() const
1857{
1858 return TSize(Width(), Height());
1859}
1860
1861//
1862/// Returns the number of bytes used to store a scanline for the DIB.
1863/// Rounded up to the nearest 32-bit boundary.
1864//
1865inline int TDib::ScanBytes(long w, int bpp)
1866{
1867 return static_cast<int>((w*bpp+31)&(~31))/8;
1868}
1869
1870//
1871/// Return the number of bits (2, 4, 8, 16, 24, or 32) used to store a pixel for the DIB.
1872//
1873inline int TDib::BitsPixel() const
1874{
1875 return Info->bmiHeader.biBitCount;
1876}
1877
1878//
1879/// Size of scan in bytes =
1880/// Pixel Width * bits per pixel rounded up to a uint32 boundary
1881//
1882inline int TDib::Pitch() const
1883{
1884 return ScanBytes(Width(), BitsPixel());
1885}
1886
1887//
1888/// Returns type of compression and encoding for bottom-up DIBs.
1889//
1891{
1892 return Info->bmiHeader.biCompression;
1893}
1894
1895//
1896/// Returns number of bytes used to store the image.
1897//
1899{
1900 return Info->bmiHeader.biSizeImage;
1901}
1902
1903//
1904/// Returns NumClrs, the number of colors in this DIB's palette.
1905//
1906inline long TDib::NumColors() const
1907{
1908 return NumClrs;
1909}
1910
1911//
1912/// Returns the starting scan line.
1913///
1914/// Always 0 because all DIBs are normalized.
1915//
1916inline uint TDib::StartScan() const
1917{
1918 return 0;
1919}
1920
1921//
1922/// Returns the number of scans in this DIB.
1923///
1924/// Always same as height of the DIB.
1925//
1926inline uint TDib::NumScans() const
1927{
1928 return Height();
1929}
1930
1931//
1932/// Return number of colors times the size of each entry in the table,
1933/// whether it is an RGB color table or palette index table.
1934//
1936{
1937 return Mode == DIB_RGB_COLORS ?
1938 NumColors() * sizeof(RGBQUAD) : // RGB color table
1939 NumColors() * sizeof(uint16); // Palette index color table
1940}
1941
1942//
1943/// Size of dib is measured as the end of the bits minus the start of the block
1944//
1945inline uint32 TDib::SizeDib() const
1946{
1947 return static_cast<uint32>((reinterpret_cast<char*>(Bits) + SizeImage()) - reinterpret_cast<char*>(Info));
1948}
1949
1950//
1951/// Returns the Mode for this DIB. This value tells GDI how to treat the color
1952/// table - whether the DIB has palette color entries or RGB color entries.
1953//
1954inline uint16 TDib::Usage() const
1955{
1956 return Mode;
1957}
1958
1959//
1960/// Returns the byte offset from the start of the scan line to the xth pixel.
1961//
1962inline int TDib::XOffset(uint16 x) const
1963{
1964 return int(static_cast<uint32>(x) * BitsPixel() / 8);
1965}
1966
1967//
1968/// Returns the starting position of the scan line.
1969//
1970inline int TDib::YOffset(uint16 y) const
1971{
1972 return int(static_cast<uint32>(Pitch()) * y);
1973}
1974
1975//
1976/// Returns the byte of where the pixel is located.
1977//
1978inline void * TDib::PixelPtr(uint16 x, uint16 y)
1979{
1980 return reinterpret_cast<uint8 *>(Bits) + XOffset(x) + YOffset(y);
1981}
1982
1983//
1984/// Copies the DIB.
1985//
1987{
1988 if (IsResHandle)
1990}
1991
1992} // OWL namespace
1993
1994#endif // OWL_GDIOBJEC_H
#define PRECONDITION(condition)
Definition checks.h:227
TBitmap is the GDI bitmap class derived from TGdiObject.
Definition gdiobjec.h:510
BITMAP GetObject() const
Definition bitmap.cpp:266
uint32 GetBitmapBits(uint32 count, void *bits) const
Copies up to count bits of this bitmap to the buffer bits.
Definition gdiobjec.h:1372
uint32 SetBitmapBits(uint32 count, const void *bits)
Copies up to count bits from the bits buffer to this bitmap.
Definition gdiobjec.h:1380
HBITMAP THandle
TBitmap encapsulates an HBITMAP.
Definition gdiobjec.h:514
HBITMAP GetHandle() const
Returns the handle of the bitmap of type BITMAP.
Definition gdiobjec.h:1355
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...
Definition gdiobjec.h:1400
TSize GetBitmapDimension() const
Functional-style overload.
Definition bitmap.cpp:333
The GDI Brush class is derived from TGdiObject.
Definition gdiobjec.h:180
LOGBRUSH GetObject() const
Retrieves information about this brush object and places it in the given LOGBRUSH structure.
Definition brush.cpp:433
HBRUSH THandle
Definition gdiobjec.h:184
HBRUSH GetHandle() const
Returns the handle of the brush with type HBRUSH.
Definition gdiobjec.h:1110
The clipboard class encapsulates the methods for the clipboard object of Windows.
Definition clipboar.h:32
Class wrapper for management of color values.
Definition color.h:245
TCursor, derived from TGdiBase, represents the GDI cursor object class.
Definition gdiobjec.h:730
bool operator==(const TCursor &other) const
Returns true if this cursor equals other; otherwise returns false.
Definition gdiobjec.h:1640
HCURSOR GetHandle() const
Returns the handle of the cursor with type HCURSOR.
Definition gdiobjec.h:1623
HCURSOR THandle
TCursor encapsulates an HCURSOR.
Definition gdiobjec.h:734
auto GetIconInfo() const -> ICONINFO
Retrieves information about this cursor.
Definition cursor.cpp:157
TDC is the root class for GDI DC wrappers.
Definition dc.h:64
Encapsulates the system font used for a specific GUI element, e.g. icon, caption, menu,...
Definition gdiobjec.h:380
TSystemFontId
Defines the various GUI elements for which a default font can be created.
Definition gdiobjec.h:387
@ sfiCaption
Represents NONCLIENTMETRICS::lfCaptionFont.
Definition gdiobjec.h:390
@ sfiStatus
Represents NONCLIENTMETRICS::lfStatusFont.
Definition gdiobjec.h:393
@ sfiLegacyDefault
Represents the font returned by GetStockObject (DEFAULT_GUI_FONT).
Definition gdiobjec.h:388
@ sfiMenu
Represents NONCLIENTMETRICS::lfMenuFont.
Definition gdiobjec.h:392
@ sfiSmallCaption
Represents NONCLIENTMETRICS::lfSmCaptionFont.
Definition gdiobjec.h:391
@ sfiIcon
Represents ICONMETRICS::lfFont.
Definition gdiobjec.h:389
Internal DIB file Reda/Write functions talk to these interfaces.
Definition gdiobjec.h:923
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.
Definition gdiobjec.h:795
uint NumScans() const
Returns the number of scans in this DIB.
Definition gdiobjec.h:1926
int BitsPixel() const
Return the number of bits (2, 4, 8, 16, 24, or 32) used to store a pixel for the DIB.
Definition gdiobjec.h:1873
uint16 Usage() const
Returns the Mode for this DIB.
Definition gdiobjec.h:1954
uint32 SizeDib() const
Size of dib is measured as the end of the bits minus the start of the block.
Definition gdiobjec.h:1945
const uint16 * GetIndices() const
Returns the bmiColors indexes of this DIB.
Definition gdiobjec.h:1711
HANDLE THandle
TDib encapsulates an memory HANDLE w/ a DIB.
Definition gdiobjec.h:799
bool IsPM() const
Returns true if IsCore is true; that is, if the DIB is an old-style PM DIB using core headers.
Definition gdiobjec.h:1824
int32 SizeColors() const
Return number of colors times the size of each entry in the table, whether it is an RGB color table o...
Definition gdiobjec.h:1935
bool IsOK() const
Returns false if Info is 0, otherwise returns true.
Definition gdiobjec.h:1813
void ResToMemHandle()
Under Win32, resources are read-only.
Definition dib.cpp:143
void CopyOnWrite()
Copies the DIB.
Definition gdiobjec.h:1986
const BITMAPINFOHEADER * GetInfoHeader() const
Returns this DIB's bmiHeader field of the BITMAPINFO structure contains information about the color a...
Definition gdiobjec.h:1678
void * PixelPtr(uint16 x, uint16 y)
Returns the byte of where the pixel is located.
Definition gdiobjec.h:1978
int Pitch() const
Size of scan in bytes = Pixel Width * bits per pixel rounded up to a uint32 boundary.
Definition gdiobjec.h:1882
int XOffset(uint16 x) const
Returns the byte offset from the start of the scan line to the xth pixel.
Definition gdiobjec.h:1962
const BITMAPINFO * GetInfo() const
Returns this DIB's Info field.
Definition gdiobjec.h:1659
int Width() const
Returns the width of the DIB.
Definition gdiobjec.h:1832
static int ScanBytes(long w, int bpp)
Width+bpp to dword aligned bytes.
Definition gdiobjec.h:1865
int Height() const
Returns the height of the DIB.
Definition gdiobjec.h:1840
TSize Size() const
Returns TSize(W,H), the size of this DIB.
Definition gdiobjec.h:1856
bool operator==(const TDib &other) const
Compares two handles and returns true if this DIB's handle equals the other (other) DIB's handle.
Definition gdiobjec.h:1649
int YOffset(uint16 y) const
Returns the starting position of the scan line.
Definition gdiobjec.h:1970
uint StartScan() const
Returns the starting scan line.
Definition gdiobjec.h:1916
HANDLE Handle
GDI handle of this object.
Definition gdibase.h:81
long NumColors() const
Returns NumClrs, the number of colors in this DIB's palette.
Definition gdiobjec.h:1906
int FlippedY(int y) const
Returns the coordinate of y if the direction of the y-axis was reversed.
Definition gdiobjec.h:1848
uint32 SizeImage() const
Returns number of bytes used to store the image.
Definition gdiobjec.h:1898
uint32 Compression() const
Returns type of compression and encoding for bottom-up DIBs.
Definition gdiobjec.h:1890
const void * GetBits() const
Returns the Bits data member for this DIB.
Definition gdiobjec.h:1727
const TRgbQuad * GetColors() const
Returns the bmiColors value of this DIB.
Definition gdiobjec.h:1695
HANDLE GetHandle() const
Returns the handle of the DIB with type HANDLE.
Definition gdiobjec.h:1743
The TFile class encapsulates standard file characteristics and operations.
Definition file.h:120
TFont derived from TGdiObject provides constructors for creating font objects from explicit informati...
Definition gdiobjec.h:296
HFONT GetHandle() const
Returns the handle of the font with type HFONT.
Definition gdiobjec.h:1142
int GetHeight() const
Returns the height of the font.
Definition gdiobjec.h:1173
LOGFONT GetObject() const
Returns information about this font object.
Definition font.cpp:238
HFONT THandle
Definition gdiobjec.h:300
TEXTMETRIC GetTextMetrics() const
Retrieves information about this font when selected in a screen DC.
Definition font.cpp:182
int GetMaxWidth() const
Returns the maximum width of the characters in the font.
Definition gdiobjec.h:1205
int GetAveWidth() const
Returns the average width of the characters in the font.
Definition gdiobjec.h:1189
Root and abstract class for Windows object wrappers.
Definition gdibase.h:79
HANDLE Handle
GDI handle of this object.
Definition gdibase.h:81
GdiObject is the root, pseudo-abstract base class for ObjectWindows' GDI (Graphics Device Interface) ...
Definition gdiobjec.h:68
bool IsGDIObject() const
Returns true if this represents a real GDI object.
Definition gdiobjec.h:1071
HGDIOBJ GetGdiHandle() const
Returns the handle of the GDI object.
Definition gdiobjec.h:1020
TType
This enumeration is used to store the object type in the struct TObjInfo.
Definition gdiobjec.h:103
uint32 GetObjectType() const
Returns the type of the GDI object.
Definition gdiobjec.h:1063
int GetObject(int count, void *object) const
Retrieve the object's attributes into a buffer.
Definition gdiobjec.h:1051
bool operator==(const TGdiObject &other) const
Returns true if the handles are equal. This is a binary compare.
Definition gdiobjec.h:1036
HANDLE Handle
GDI handle of this object.
Definition gdibase.h:81
auto IsHandleOwner() const -> bool
Returns true if handle lifetime is managed.
Definition gdiobjec.h:98
HGDIOBJ THandle
TGdiObject encapsulates an HGDIOBJ.
Definition gdiobjec.h:72
Derived from TBrush, THatch8x8Brush defines a small, 8x8, monochrome, configurable hatch brush.
Definition gdiobjec.h:250
TIcon, derived from TGdiObject, represents the GDI object icon class.
Definition gdiobjec.h:670
auto GetIconInfo() const -> ICONINFO
Retrieves information about this icon.
Definition icon.cpp:148
bool operator==(const TIcon &other) const
Returns true if the handles of two icons are identical.
Definition gdiobjec.h:1591
HICON GetHandle() const
Returns the handle of the icon with type HICON.
Definition gdiobjec.h:1574
HICON THandle
TIcon encapsulates an HICON.
Definition gdiobjec.h:674
TMetaFilePict is a support class used with TMetaFileDC to simplify metafile operations,...
Definition metafile.h:80
TPalette is the GDI Palette class derived from TGdiObject.
Definition gdiobjec.h:413
void AnimatePalette(uint start, uint count, const PALETTEENTRY *entries)
Animate palette from entry 'start' for 'count' entries.
Definition gdiobjec.h:1263
HPALETTE THandle
TPalette encapsulates an HPALETTE.
Definition gdiobjec.h:417
uint SetPaletteEntry(uint16 index, const PALETTEENTRY &entry)
Sets the RGB color value at index in this palette from the entry argument.
Definition gdiobjec.h:1290
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.
Definition gdiobjec.h:1306
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...
Definition gdiobjec.h:1325
uint SetPaletteEntries(uint16 start, uint16 count, const PALETTEENTRY *entries)
Sets the RGB color values in this palette from the entries array of PALETTEENTRY structures.
Definition gdiobjec.h:1274
uint GetPaletteEntry(uint16 index, PALETTEENTRY &entry) const
Retrieves the entry in this logical palette at index and places it in the entries array.
Definition gdiobjec.h:1316
bool GetObject(uint16 &numEntries) const
Finds the number of entries in this logical palette and sets the value in the numEntries argument.
Definition gdiobjec.h:1336
HPALETTE GetHandle() const
Returns the handle of the palette.
Definition gdiobjec.h:1222
uint16 GetNumEntries() const
Returns the number of entries in this palette, or 0 if the call fails.
Definition gdiobjec.h:1344
bool UnrealizeObject()
Directs the GDI to completely remap the logical palette to the system palette on the next RealizePale...
Definition gdiobjec.h:1241
TPalette(const PALETTEENTRY(&entries)[N])
Creates a TPalette object with the entries from the given array.
Definition gdiobjec.h:434
bool ResizePalette(uint numEntries)
Changes the size of this logical palette to the number given by numEntries.
Definition gdiobjec.h:1250
TPen is derived from TGdiObject.
Definition gdiobjec.h:138
HPEN THandle
Definition gdiobjec.h:142
LOGPEN GetObject() const
Retrieves information about this pen object and places it in the given LOGPEN structure.
Definition pen.cpp:162
HPEN GetHandle() const
Returns the handle of the pen with type HPEN.
Definition gdiobjec.h:1079
TPoint is a support class, derived from tagPOINT.
Definition geometry.h:87
TRect is a mathematical class derived from tagRect.
Definition geometry.h:308
TRegion, derived from TGdiObject, represents GDI abstract shapes or regions.
Definition gdiobjec.h:581
bool Contains(const TPoint &point) const
Returns true if this region contains the given point.
Definition gdiobjec.h:1466
TRegion(const TPoint *points, const int(&polyCounts)[N], int fillMode)
Creates a filled TRegion object from the poly-polygons given by points and fillMode.
Definition gdiobjec.h:616
TRegion & operator|=(const TRegion &source)
Creates the union of this region and the given source region , and returns a reference to the result.
Definition gdiobjec.h:1555
bool Touches(const TRect &rect) const
Returns true if this region touches the given rectangle.
Definition gdiobjec.h:1474
auto Release() -> HRGN
Returns the encapsulated handle of the region and relinquishes ownership.
Definition gdiobjec.h:1424
TRegion & operator+=(const TSize &delta)
Adds the given delta to each point of this region to displace (translate) it by delta....
Definition gdiobjec.h:1515
TEllipse
Defines the class-specific constant Ellipse, used to distinguish the ellipse constructor from the rec...
Definition gdiobjec.h:596
TRegion & operator&=(const TRegion &source)
Creates the intersection of this region with the given source region and returns a reference to the r...
Definition gdiobjec.h:1545
TRegion & operator^=(const TRegion &source)
Creates the exclusive-or of this region and the given source region.
Definition gdiobjec.h:1565
TRegion & operator=(const TRegion &source)
Assigns the source region to this region.
Definition gdiobjec.h:1505
TRegion(const TPoint(&points)[N], int fillMode)
Creates a filled TRegion object from the polygon given by an array of points and fillMode.
Definition gdiobjec.h:607
TRect GetRgnBox() const
Returns the bounding rectangle of the region.
Definition gdiobjec.h:1494
void SetRectRgn(const TRect &rect)
Creates a rectangle of the size given by rect.
Definition gdiobjec.h:1442
bool operator==(const TRegion &other) const
Returns true if the regions are identical (equal in size and shape).
Definition gdiobjec.h:1450
HRGN GetHandle() const
Returns the handle of the region with type HREGION.
Definition gdiobjec.h:1417
bool operator!=(const TRegion &other) const
Returns true if this region is not equal to the other region.
Definition gdiobjec.h:1458
HRGN THandle
TRegion encapsulates an HRGN.
Definition gdiobjec.h:585
TRegion & operator-=(const TSize &delta)
Subtracts the given delta from each point of this region to displace (translate) it by -delta....
Definition gdiobjec.h:1525
Wrapper for Windows' RBGQUAD type.
Definition color.h:433
The TRiffFile class is used for reading and writing RIFF files.
Definition file.h:563
The tagSIZE struct is defined as.
Definition geometry.h:234
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.
Definition gdibase.h:70
TDefaultGuiFont TDefaultGUIFont
Deprecated alias.
Definition gdiobjec.h:404
Object Windows Library (OWLNext Core)
Definition animctrl.h:22
owl::opstream & operator<<(owl::opstream &os, const TColor &c)
Insert the color value into a persistent output stream.
Definition color.h:498
unsigned char uint8
Definition number.h:32
unsigned long uint32
Definition number.h:34
char tchar
Definition defs.h:77
unsigned short uint16
Definition number.h:33
std::string tstring
Definition defs.h:79
unsigned int uint
Definition number.h:25
#define protected_data
Definition defs.h:208
#define _OWLCLASS
Definition defs.h:338