]>
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 wxString
& icon_file
, long flags
,
53 int desiredWidth
, int desiredHeight
)
56 LoadFile(icon_file
, flags
, desiredWidth
, desiredHeight
);
63 bool wxIcon::LoadFile(const wxString
& filename
, long type
,
64 int desiredWidth
, int desiredHeight
)
68 m_refData
= new wxBitmapRefData
;
70 wxBitmapHandler
*handler
= FindHandler(type
);
73 return handler
->LoadFile(this, filename
, type
, desiredWidth
, desiredHeight
);