1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxIcon class
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
16 #pragma interface "icon.h"
19 #include "wx/bitmap.h"
22 class WXDLLEXPORT wxIcon
: public wxBitmap
24 DECLARE_DYNAMIC_CLASS(wxIcon
)
30 inline wxIcon(const wxIcon
& icon
) { Ref(icon
); }
32 wxIcon( const char **data
);
33 wxIcon( char **data
);
34 wxIcon(const char bits
[], int width
, int height
);
35 wxIcon(const wxString
& name
, long flags
= wxBITMAP_TYPE_ICON_RESOURCE
,
36 int desiredWidth
= -1, int desiredHeight
= -1);
39 bool LoadFile(const wxString
& name
, long flags
/* = wxBITMAP_TYPE_ICON_RESOURCE */ ,
40 int desiredWidth
/* = -1 */ , int desiredHeight
= -1);
41 bool LoadFile(const wxString
& name
,long flags
= wxBITMAP_TYPE_ICON_RESOURCE
)
42 { return LoadFile( name
, flags
, -1 , -1 ) ; }
44 inline wxIcon
& operator = (const wxIcon
& icon
) { if (*this == icon
) return (*this); Ref(icon
); return *this; }
45 inline bool operator == (const wxIcon
& icon
) { return m_refData
== icon
.m_refData
; }
46 inline bool operator != (const wxIcon
& icon
) { return m_refData
!= icon
.m_refData
; }
50 class WXDLLEXPORT wxICONFileHandler: public wxBitmapHandler
52 DECLARE_DYNAMIC_CLASS(wxICONFileHandler)
54 inline wxICONFileHandler()
56 m_name = "ICO icon file";
58 m_type = wxBITMAP_TYPE_ICO;
61 virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags,
62 int desiredWidth = -1, int desiredHeight = -1);
66 class WXDLLEXPORT wxICONResourceHandler
: public wxBitmapHandler
68 DECLARE_DYNAMIC_CLASS(wxICONResourceHandler
)
70 inline wxICONResourceHandler()
72 m_name
= "ICON resource";
74 m_type
= wxBITMAP_TYPE_ICON_RESOURCE
;
77 virtual bool LoadFile(wxBitmap
*bitmap
, const wxString
& name
, long flags
,
78 int desiredWidth
= -1, int desiredHeight
= -1);