]>
Commit | Line | Data |
---|---|---|
83df96d6 | 1 | ///////////////////////////////////////////////////////////////////////////// |
71451a6d VS |
2 | // Name: wx/generic/icon.h |
3 | // Purpose: wxIcon implementation for ports where it's same as wxBitmap | |
83df96d6 JS |
4 | // Author: Julian Smart |
5 | // Modified by: | |
6 | // Created: 17/09/98 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) Julian Smart | |
71451a6d | 9 | // Licence: wxWindows licence |
83df96d6 JS |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
71451a6d VS |
12 | #ifndef _WX_GENERIC_ICON_H_ |
13 | #define _WX_GENERIC_ICON_H_ | |
83df96d6 | 14 | |
83df96d6 JS |
15 | #include "wx/bitmap.h" |
16 | ||
a11672a4 RR |
17 | //----------------------------------------------------------------------------- |
18 | // wxIcon | |
19 | //----------------------------------------------------------------------------- | |
83df96d6 | 20 | |
71451a6d VS |
21 | #ifndef wxICON_DEFAULT_BITMAP_TYPE |
22 | #define wxICON_DEFAULT_BITMAP_TYPE wxBITMAP_TYPE_XPM | |
23 | #endif | |
24 | ||
968eb2ef | 25 | class WXDLLIMPEXP_CORE wxIcon: public wxBitmap |
83df96d6 | 26 | { |
83df96d6 JS |
27 | public: |
28 | wxIcon(); | |
71451a6d | 29 | |
a11672a4 | 30 | wxIcon( const char **bits, int width=-1, int height=-1 ); |
71451a6d | 31 | wxIcon( char **bits, int width=-1, int height=-1 ); |
a11672a4 RR |
32 | |
33 | // For compatibility with wxMSW where desired size is sometimes required to | |
34 | // distinguish between multiple icons in a resource. | |
71451a6d VS |
35 | wxIcon( const wxString& filename, |
36 | wxBitmapType type = wxICON_DEFAULT_BITMAP_TYPE, | |
a11672a4 RR |
37 | int WXUNUSED(desiredWidth)=-1, int WXUNUSED(desiredHeight)=-1 ) : |
38 | wxBitmap(filename, type) | |
39 | { | |
40 | } | |
a11672a4 | 41 | |
aaf7ab43 | 42 | wxIcon(const wxIconLocation& loc) |
6f12c2c9 | 43 | : wxBitmap(loc.GetFileName(), wxBITMAP_TYPE_ANY) |
aaf7ab43 VZ |
44 | { |
45 | } | |
46 | ||
71451a6d VS |
47 | bool operator==(const wxIcon& icon) const |
48 | { return m_refData == icon.m_refData; } | |
49 | bool operator!=(const wxIcon& icon) const | |
50 | { return !(*this == icon); } | |
a11672a4 RR |
51 | |
52 | // create from bitmap (which should have a mask unless it's monochrome): | |
53 | // there shouldn't be any implicit bitmap -> icon conversion (i.e. no | |
54 | // ctors, assignment operators...), but it's ok to have such function | |
55 | void CopyFromBitmap(const wxBitmap& bmp); | |
71451a6d | 56 | |
a11672a4 RR |
57 | private: |
58 | DECLARE_DYNAMIC_CLASS(wxIcon) | |
83df96d6 JS |
59 | }; |
60 | ||
71451a6d | 61 | #endif // _WX_GENERIC_ICON_H_ |