]>
git.saurik.com Git - wxWidgets.git/blob - src/motif/icon.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxIcon class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "icon.h"
17 #include "wx/window.h"
20 #pragma message disable nosimpint
23 #include <X11/cursorfont.h>
25 #pragma message enable nosimpint
28 #include "wx/motif/private.h"
30 IMPLEMENT_DYNAMIC_CLASS(wxIcon
, wxBitmap
)
40 // Create from XBM data
41 wxIcon::wxIcon(const char bits
[], int width
, int height
)
43 (void) Create((void*) bits
, wxBITMAP_TYPE_XBM_DATA
, width
, height
, 1);
46 // Create from XPM data
47 wxIcon::wxIcon(char **data
)
49 (void) Create((void*) data
, wxBITMAP_TYPE_XPM_DATA
, 0, 0, 0);
52 wxIcon::wxIcon(const char **data
)
54 (void) Create((void*) data
, wxBITMAP_TYPE_XPM_DATA
, 0, 0, 0);
57 wxIcon::wxIcon(const wxString
& icon_file
, long flags
,
58 int desiredWidth
, int desiredHeight
)
61 LoadFile(icon_file
, flags
, desiredWidth
, desiredHeight
);
68 bool wxIcon::LoadFile(const wxString
& filename
, long type
,
69 int desiredWidth
, int desiredHeight
)
73 m_refData
= new wxBitmapRefData
;
75 wxBitmapHandler
*handler
= FindHandler(type
);
78 return handler
->LoadFile(this, filename
, type
, desiredWidth
, desiredHeight
);