]>
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 #if !USE_SHARED_LIBRARIES
31 IMPLEMENT_DYNAMIC_CLASS(wxIcon
, wxBitmap
)
42 // Create from XBM data
43 wxIcon::wxIcon(const char bits
[], int width
, int height
)
45 (void) Create((void*) bits
, wxBITMAP_TYPE_XBM_DATA
, width
, height
, 1);
48 // Create from XPM data
49 wxIcon::wxIcon(char **data
)
51 (void) Create((void*) data
, wxBITMAP_TYPE_XPM_DATA
, 0, 0, 0);
54 wxIcon::wxIcon(const wxString
& icon_file
, long flags
,
55 int desiredWidth
, int desiredHeight
)
58 LoadFile(icon_file
, flags
, desiredWidth
, desiredHeight
);
65 bool wxIcon::LoadFile(const wxString
& filename
, long type
,
66 int desiredWidth
, int desiredHeight
)
70 m_refData
= new wxBitmapRefData
;
72 wxBitmapHandler
*handler
= FindHandler(type
);
75 return handler
->LoadFile(this, filename
, type
, desiredWidth
, desiredHeight
);