]>
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
, wxBitmapType type
,
58 int desiredWidth
, int desiredHeight
)
61 LoadFile(icon_file
, type
, desiredWidth
, desiredHeight
);
64 void wxIcon::CopyFromBitmap(const wxBitmap
& bmp
)
66 wxIcon
*icon
= (wxIcon
*)(&bmp
);
74 bool wxIcon::LoadFile(const wxString
& filename
, wxBitmapType type
,
75 int desiredWidth
, int desiredHeight
)
79 m_refData
= new wxBitmapRefData
;
81 wxBitmapHandler
*handler
= FindHandler(type
);
84 return handler
->LoadFile(this, filename
, type
,
85 desiredWidth
, desiredHeight
);