]> git.saurik.com Git - wxWidgets.git/blame - src/common/artstd.cpp
wxUSE_XXX related fixes
[wxWidgets.git] / src / common / artstd.cpp
CommitLineData
2aca4a98
VS
1/////////////////////////////////////////////////////////////////////////////
2// Name: artstd.cpp
3// Purpose: stock wxArtProvider instance with default wxWin art
4// Author: Vaclav Slavik
5// Modified by:
6// Created: 18/03/2002
7// RCS-ID: $Id$
8// Copyright: (c) Vaclav Slavik
65571936 9// Licence: wxWindows licence
2aca4a98
VS
10/////////////////////////////////////////////////////////////////////////////
11
12// ---------------------------------------------------------------------------
13// headers
14// ---------------------------------------------------------------------------
15
2aca4a98
VS
16// For compilers that support precompilation, includes "wx.h".
17#include "wx/wxprec.h"
18
19#if defined(__BORLANDC__)
20 #pragma hdrstop
21#endif
22
66941e14
VS
23#ifndef WX_PRECOMP
24 #if WXWIN_COMPATIBILITY_2_2
25 #include "wx/app.h"
26 #endif
27#endif
28
2aca4a98 29#include "wx/artprov.h"
2aca4a98
VS
30
31// ----------------------------------------------------------------------------
32// wxDefaultArtProvider
33// ----------------------------------------------------------------------------
34
35class wxDefaultArtProvider : public wxArtProvider
36{
37protected:
57b0987b
VS
38 virtual wxBitmap CreateBitmap(const wxArtID& id, const wxArtClient& client,
39 const wxSize& size);
2aca4a98
VS
40};
41
66941e14
VS
42// ----------------------------------------------------------------------------
43// helper macros
44// ----------------------------------------------------------------------------
45
46// Standard macro for getting a resource from XPM file:
57b0987b
VS
47#define ART(artId, xpmRc) \
48 if ( id == artId ) return wxBitmap(xpmRc##_xpm);
66941e14 49
66941e14
VS
50// There are two ways of getting the standard icon: either via XPMs or via
51// wxIcon ctor. This depends on the platform:
52#if defined(__WXUNIVERSAL__)
53 #define CREATE_STD_ICON(iconId, xpmRc) return wxNullBitmap;
54#elif defined(__WXGTK__) || defined(__WXMOTIF__)
55 #define CREATE_STD_ICON(iconId, xpmRc) return wxBitmap(xpmRc##_xpm);
56#else
57 #define CREATE_STD_ICON(iconId, xpmRc) \
58 { \
59 wxIcon icon(_T(iconId)); \
60 wxBitmap bmp; \
61 bmp.CopyFromIcon(icon); \
62 return bmp; \
63 }
64#endif
65
66// Macro used in CreateBitmap to get wxICON_FOO icons:
67#define ART_MSGBOX(artId, iconId, xpmRc) \
68 if ( id == artId ) \
69 { \
66941e14
VS
70 CREATE_STD_ICON(#iconId, xpmRc) \
71 }
2aca4a98
VS
72
73// ----------------------------------------------------------------------------
2b5f62a0 74// wxArtProvider::InitStdProvider
2aca4a98
VS
75// ----------------------------------------------------------------------------
76
2b5f62a0 77/*static*/ void wxArtProvider::InitStdProvider()
2aca4a98 78{
2b5f62a0
VZ
79 wxArtProvider::PushProvider(new wxDefaultArtProvider);
80}
2aca4a98 81
ff44780b
VS
82#if !defined(__WXGTK20__) || defined(__WXUNIVERSAL__)
83/*static*/ void wxArtProvider::InitNativeProvider()
84{
85}
86#endif
87
2aca4a98
VS
88
89// ----------------------------------------------------------------------------
90// XPMs with the art
91// ----------------------------------------------------------------------------
92
93// XPM hack: make the arrays const
94#define static static const
95
66941e14
VS
96#if defined(__WXGTK__)
97 #include "../../art/gtk/info.xpm"
98 #include "../../art/gtk/error.xpm"
99 #include "../../art/gtk/warning.xpm"
100 #include "../../art/gtk/question.xpm"
101#elif defined(__WXMOTIF__)
102 #include "../../art/motif/info.xpm"
103 #include "../../art/motif/error.xpm"
104 #include "../../art/motif/warning.xpm"
105 #include "../../art/motif/question.xpm"
106#endif
107
2aca4a98 108#if wxUSE_HTML
57b0987b
VS
109 #include "../../art/htmsidep.xpm"
110 #include "../../art/htmoptns.xpm"
111 #include "../../art/htmbook.xpm"
112 #include "../../art/htmfoldr.xpm"
113 #include "../../art/htmpage.xpm"
2aca4a98
VS
114#endif // wxUSE_HTML
115
0de41e82 116#include "../../art/missimg.xpm"
57b0987b
VS
117#include "../../art/addbookm.xpm"
118#include "../../art/delbookm.xpm"
119#include "../../art/back.xpm"
120#include "../../art/forward.xpm"
121#include "../../art/up.xpm"
122#include "../../art/down.xpm"
123#include "../../art/toparent.xpm"
124#include "../../art/fileopen.xpm"
125#include "../../art/print.xpm"
126#include "../../art/helpicon.xpm"
127#include "../../art/tipicon.xpm"
60d2cc25
VS
128#include "../../art/home.xpm"
129#include "../../art/repview.xpm"
130#include "../../art/listview.xpm"
131#include "../../art/new_dir.xpm"
ddf6088b
RR
132#include "../../art/harddisk.xpm"
133#include "../../art/cdrom.xpm"
134#include "../../art/floppy.xpm"
135#include "../../art/removable.xpm"
60d2cc25 136#include "../../art/folder.xpm"
ddf6088b 137#include "../../art/folder_open.xpm"
60d2cc25
VS
138#include "../../art/dir_up.xpm"
139#include "../../art/exefile.xpm"
140#include "../../art/deffile.xpm"
00958db5
VS
141#include "../../art/tick.xpm"
142#include "../../art/cross.xpm"
2aca4a98
VS
143
144#undef static
145
146// ----------------------------------------------------------------------------
147// CreateBitmap routine
148// ----------------------------------------------------------------------------
149
57b0987b 150wxBitmap wxDefaultArtProvider::CreateBitmap(const wxArtID& id,
fc7a2a60 151 const wxArtClient& WXUNUSED(client),
d84afea9 152 const wxSize& WXUNUSED(size))
2aca4a98 153{
66941e14
VS
154 // wxMessageBox icons:
155 ART_MSGBOX(wxART_ERROR, wxICON_ERROR, error)
156 ART_MSGBOX(wxART_INFORMATION, wxICON_INFORMATION, info)
157 ART_MSGBOX(wxART_WARNING, wxICON_WARNING, warning)
158 ART_MSGBOX(wxART_QUESTION, wxICON_QUESTION, question)
159
160 // standard icons:
2aca4a98 161#if wxUSE_HTML
57b0987b
VS
162 ART(wxART_HELP_SIDE_PANEL, htmsidep)
163 ART(wxART_HELP_SETTINGS, htmoptns)
164 ART(wxART_HELP_BOOK, htmbook)
165 ART(wxART_HELP_FOLDER, htmfoldr)
166 ART(wxART_HELP_PAGE, htmpage)
2aca4a98 167#endif // wxUSE_HTML
ff44780b 168 ART(wxART_MISSING_IMAGE, missimg)
57b0987b
VS
169 ART(wxART_ADD_BOOKMARK, addbookm)
170 ART(wxART_DEL_BOOKMARK, delbookm)
171 ART(wxART_GO_BACK, back)
172 ART(wxART_GO_FORWARD, forward)
173 ART(wxART_GO_UP, up)
174 ART(wxART_GO_DOWN, down)
175 ART(wxART_GO_TO_PARENT, toparent)
60d2cc25 176 ART(wxART_GO_HOME, home)
57b0987b
VS
177 ART(wxART_FILE_OPEN, fileopen)
178 ART(wxART_PRINT, print)
179 ART(wxART_HELP, helpicon)
180 ART(wxART_TIP, tipicon)
60d2cc25
VS
181 ART(wxART_REPORT_VIEW, repview)
182 ART(wxART_LIST_VIEW, listview)
183 ART(wxART_NEW_DIR, new_dir)
ddf6088b
RR
184 ART(wxART_HARDDISK, harddisk)
185 ART(wxART_FLOPPY, floppy)
186 ART(wxART_CDROM, cdrom)
187 ART(wxART_REMOVABLE, removable)
60d2cc25 188 ART(wxART_FOLDER, folder)
ddf6088b 189 ART(wxART_FOLDER_OPEN, folder_open)
60d2cc25
VS
190 ART(wxART_GO_DIR_UP, dir_up)
191 ART(wxART_EXECUTABLE_FILE, exefile)
192 ART(wxART_NORMAL_FILE, deffile)
00958db5
VS
193 ART(wxART_TICK_MARK, tick)
194 ART(wxART_CROSS_MARK, cross)
2aca4a98
VS
195
196 return wxNullBitmap;
197}