]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/motif/icon.h
3ac1eb445001ac549ab804f55191525e724c6e65
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxIcon class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
16 #pragma interface "icon.h"
19 #include "wx/bitmap.h"
22 // Same as for wxBitmap
23 class WXDLLEXPORT wxIconRefData: public wxBitmapRefData
25 friend class WXDLLEXPORT wxBitmap;
26 friend class WXDLLEXPORT wxIcon;
33 #define M_ICONDATA ((wxBitmapRefData *)m_refData)
34 #define M_ICONHANDLERDATA ((wxBitmapRefData *)bitmap->GetRefData())
37 class WXDLLEXPORT wxIcon
: public wxBitmap
39 DECLARE_DYNAMIC_CLASS(wxIcon
)
45 inline wxIcon(const wxIcon
& icon
) { Ref(icon
); }
47 // Initialize with XBM data
48 wxIcon(const char bits
[], int width
, int height
);
50 // Initialize with XPM data
53 wxIcon(const wxString
& name
, long flags
= wxBITMAP_TYPE_XPM
,
54 int desiredWidth
= -1, int desiredHeight
= -1);
57 bool LoadFile(const wxString
& name
, long flags
= wxBITMAP_TYPE_XPM
,
58 int desiredWidth
= -1, int desiredHeight
= -1);
59 bool LoadFile(const wxString
& name
, long type
= wxBITMAP_TYPE_XBM
)
60 { return wxBitmap::LoadFile(name
, type
); }
62 inline wxIcon
& operator = (const wxIcon
& icon
) { if (*this == icon
) return (*this); Ref(icon
); return *this; }
63 inline bool operator == (const wxIcon
& icon
) { return m_refData
== icon
.m_refData
; }
64 inline bool operator != (const wxIcon
& icon
) { return m_refData
!= icon
.m_refData
; }
66 virtual bool Ok() const { return ((m_refData
!= NULL
) && (M_ICONDATA
->m_ok
)); }