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