1 /////////////////////////////////////////////////////////////////////////////
2 // Name:        wx/motif/icon.h
3 // Purpose:     wxIcon class
4 // Author:      Julian Smart
5 // Modified by:
6 // Created:     17/09/98
7 // Copyright:   (c) Julian Smart
8 // Licence:     wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10 
11 #ifndef _WX_ICON_H_
12 #define _WX_ICON_H_
13 
14 #include "wx/bitmap.h"
15 
16 // Icon
17 class WXDLLIMPEXP_CORE wxIcon : public wxBitmap
18 {
19 public:
20     wxIcon();
21 
22     // Initialize with XBM data
23     wxIcon(const char bits[], int width, int height);
24 
25     // Initialize with XPM data
26     wxIcon(const char* const* data);
27 
28     wxIcon(const wxString& name, wxBitmapType type = wxICON_DEFAULT_TYPE,
29            int desiredWidth = -1, int desiredHeight = -1)
30     {
31         LoadFile(name, type, desiredWidth, desiredHeight);
32     }
33 
wxIcon(const wxIconLocation & loc)34     wxIcon(const wxIconLocation& loc)
35     {
36         LoadFile(loc.GetFileName(), wxBITMAP_TYPE_ANY);
37     }
38 
39     virtual ~wxIcon();
40 
41     bool LoadFile(const wxString& name, wxBitmapType type,
42                   int desiredWidth, int desiredHeight);
43 
44     // unhide the base class version
45     virtual bool LoadFile(const wxString& name,
46                           wxBitmapType flags = wxICON_DEFAULT_TYPE)
47         { return LoadFile(name, flags); }
48 
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);
53 
54 
55     wxDECLARE_DYNAMIC_CLASS(wxIcon);
56 };
57 
58 #endif // _WX_ICON_H_
59