]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/gdiobj.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxGDIObject class: base class for other GDI classes
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
15 #include "wx/object.h"
18 #pragma interface "gdiobj.h"
21 // wxGDIRefData is the reference-counted data part of a GDI object.
22 // It contains another counter, m_usageCount, which counts the number
23 // of times this object has been used; e.g. in SetFont, the count
24 // is incremented. This is different from reference counting,
25 // where only the constructors, destructors and (un)clone operations
26 // affect the reference count.
27 // THIS IS NOW BEING REMOVED AS REDUNDANT AND ERROR-PRONE
29 class WXDLLEXPORT wxGDIRefData
: public wxObjectRefData
{
31 inline wxGDIRefData(void)
36 #define M_GDIDATA ((wxGDIRefData *)m_refData)
38 class WXDLLEXPORT wxGDIObject
: public wxObject
40 DECLARE_DYNAMIC_CLASS(wxGDIObject
)
42 inline wxGDIObject(void) { m_visible
= FALSE
; };
43 inline ~wxGDIObject(void) {};
45 // Creates the resource
46 virtual bool RealizeResource(void) { return FALSE
; };
49 virtual bool FreeResource(bool WXUNUSED(force
) = FALSE
) { return FALSE
; };
51 virtual bool IsFree(void) const { return FALSE
; };
53 inline bool IsNull(void) const { return (m_refData
== 0); }
56 virtual WXHANDLE
GetResourceHandle(void) { return 0; }
58 virtual bool GetVisible(void) { return m_visible
; }
59 virtual void SetVisible(bool v
) { m_visible
= v
; }
62 bool m_visible
; // Can a pointer to this object be safely taken?
63 // - only if created within FindOrCreate...