]> git.saurik.com Git - wxWidgets.git/blame_incremental - src/motif/icon.cpp
fix wxSystemSettings::GetColour() for wxGTK3
[wxWidgets.git] / src / motif / icon.cpp
... / ...
CommitLineData
1/////////////////////////////////////////////////////////////////////////////
2// Name: src/motif/icon.cpp
3// Purpose: wxIcon class
4// Author: Julian Smart
5// Modified by:
6// Created: 17/09/98
7// Copyright: (c) Julian Smart
8// Licence: wxWindows licence
9/////////////////////////////////////////////////////////////////////////////
10
11// For compilers that support precompilation, includes "wx.h".
12#include "wx/wxprec.h"
13
14#include "wx/icon.h"
15
16IMPLEMENT_DYNAMIC_CLASS(wxIcon, wxBitmap)
17
18// ============================================================================
19// Icons
20// ============================================================================
21
22wxIcon::wxIcon()
23{
24}
25
26// Create from XBM data
27wxIcon::wxIcon(const char bits[], int width, int height)
28{
29 (void) Create((void*) bits, wxBITMAP_TYPE_XBM_DATA, width, height, 1);
30}
31
32#ifdef wxNEEDS_CHARPP
33// Create from XPM data
34wxIcon::wxIcon(char **data)
35{
36 (void) Create((void*) data, wxBITMAP_TYPE_XPM_DATA, 0, 0, 0);
37}
38#endif
39
40wxIcon::wxIcon(const char* const* data)
41{
42 (void) Create((void*) data, wxBITMAP_TYPE_XPM_DATA, 0, 0, 0);
43}
44
45void wxIcon::CopyFromBitmap(const wxBitmap& bmp)
46{
47 wxIcon *icon = (wxIcon*)(&bmp);
48 *this = *icon;
49}
50
51wxIcon::~wxIcon()
52{
53}
54
55bool wxIcon::LoadFile(const wxString& filename, wxBitmapType type,
56 int desiredWidth, int desiredHeight)
57{
58 UnRef();
59
60 wxBitmapHandler *handler = FindHandler(type);
61
62 if ( handler )
63 return handler->LoadFile(this, filename, type,
64 desiredWidth, desiredHeight);
65 else
66 return false;
67}