]>
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 #include <X11/cursorfont.h>
22 #include "wx/motif/private.h"
24 #if !USE_SHARED_LIBRARIES
25 IMPLEMENT_DYNAMIC_CLASS(wxIcon
, wxBitmap
)
36 // Create from XBM data
37 wxIcon::wxIcon(const char bits
[], int width
, int height
)
39 (void) Create((void*) bits
, wxBITMAP_TYPE_XBM_DATA
, width
, height
, 1);
42 // Create from XPM data
43 wxIcon::wxIcon(char **data
)
45 (void) Create((void*) data
, wxBITMAP_TYPE_XPM_DATA
, 0, 0, 0);
48 wxIcon::wxIcon(const wxString
& icon_file
, long flags
,
49 int desiredWidth
, int desiredHeight
)
52 LoadFile(icon_file
, flags
, desiredWidth
, desiredHeight
);
59 bool wxIcon::LoadFile(const wxString
& filename
, long type
,
60 int desiredWidth
, int desiredHeight
)
64 m_refData
= new wxBitmapRefData
;
66 wxBitmapHandler
*handler
= FindHandler(type
);
69 return handler
->LoadFile(this, filename
, type
, desiredWidth
, desiredHeight
);