]> git.saurik.com Git - wxWidgets.git/blame - include/wx/x11/icon.h
safety check
[wxWidgets.git] / include / wx / x11 / icon.h
CommitLineData
83df96d6
JS
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#ifdef __GNUG__
16#pragma interface "icon.h"
17#endif
18
19#include "wx/bitmap.h"
20
21#define M_ICONDATA ((wxBitmapRefData *)m_refData)
22#define M_ICONHANDLERDATA ((wxBitmapRefData *)bitmap->GetRefData())
23
24// Icon
25class WXDLLEXPORT wxIcon: public wxBitmap
26{
27 DECLARE_DYNAMIC_CLASS(wxIcon)
28
29public:
30 wxIcon();
31
32 // Copy constructors
33 inline wxIcon(const wxIcon& icon) { Ref(icon); }
34
35 // Initialize with XBM data
36 wxIcon(const char bits[], int width, int height);
37
38 // Initialize with XPM data
39 wxIcon(const char **data);
40 wxIcon(char **data);
41
42 wxIcon(const wxString& name, long flags = wxBITMAP_TYPE_XPM,
43 int desiredWidth = -1, int desiredHeight = -1);
44 ~wxIcon();
45
46 bool LoadFile(const wxString& name, long flags = wxBITMAP_TYPE_XPM,
47 int desiredWidth = -1, int desiredHeight = -1);
48
49 inline wxIcon& operator = (const wxIcon& icon) { if (*this == icon) return (*this); Ref(icon); return *this; }
50 inline bool operator == (const wxIcon& icon) const { return m_refData == icon.m_refData; }
51 inline bool operator != (const wxIcon& icon) const { return m_refData != icon.m_refData; }
52
53 virtual bool Ok() const { return ((m_refData != NULL) && (M_ICONDATA->m_ok)); }
7266b672
JS
54
55 bool CopyFromBitmap(const wxBitmap& bitmap);
83df96d6
JS
56};
57
58#endif
59// _WX_ICON_H_