]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/motif/icon.h
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"
21 #define M_ICONDATA ((wxBitmapRefData *)m_refData)
22 #define M_ICONHANDLERDATA ((wxBitmapRefData *)bitmap->GetRefData())
25 class WXDLLEXPORT wxIcon
: public wxBitmap
27 DECLARE_DYNAMIC_CLASS(wxIcon
)
33 inline wxIcon(const wxIcon
& icon
) { Ref(icon
); }
35 // Initialize with XBM data
36 wxIcon(const char bits
[], int width
, int height
);
38 // Initialize with XPM data
39 wxIcon(const char **data
);
42 wxIcon(const wxString
& name
, long flags
= wxBITMAP_TYPE_XPM
,
43 int desiredWidth
= -1, int desiredHeight
= -1);
46 bool LoadFile(const wxString
& name
, long flags
= wxBITMAP_TYPE_XPM
,
47 int desiredWidth
= -1, int desiredHeight
= -1);
49 // create from bitmap (which should have a mask unless it's monochrome):
50 // there shouldn't be any implicit bitmap -> icon conversion (i.e. no
51 // ctors, assignment operators...), but it's ok to have such function
52 void CopyFromBitmap(const wxBitmap
& bmp
);
54 inline wxIcon
& operator = (const wxIcon
& icon
) { if (*this == icon
) return (*this); Ref(icon
); return *this; }
55 inline bool operator == (const wxIcon
& icon
) const { return m_refData
== icon
.m_refData
; }
56 inline bool operator != (const wxIcon
& icon
) const { return m_refData
!= icon
.m_refData
; }
58 virtual bool Ok() const { return ((m_refData
!= NULL
) && (M_ICONDATA
->m_ok
)); }