]> git.saurik.com Git - wxWidgets.git/blob - src/common/artstd.cpp
don't use deprecated wxImage methods inside wxWin
[wxWidgets.git] / src / common / artstd.cpp
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
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 // ---------------------------------------------------------------------------
13 // headers
14 // ---------------------------------------------------------------------------
15
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
23 #include "wx/artprov.h"
24 #include "wx/module.h"
25
26 // For the purposes of forcing this module to link
27 char g_ArtProviderModule = 0;
28
29 // ----------------------------------------------------------------------------
30 // wxDefaultArtProvider
31 // ----------------------------------------------------------------------------
32
33 class wxDefaultArtProvider : public wxArtProvider
34 {
35 protected:
36 virtual wxBitmap CreateBitmap(const wxArtID& id, const wxArtClient& client,
37 const wxSize& size);
38 };
39
40 #define ART(artId, xpmRc) \
41 if ( id == artId ) return wxBitmap(xpmRc##_xpm);
42
43
44 // ----------------------------------------------------------------------------
45 // wxDefaultArtProviderModule
46 // ----------------------------------------------------------------------------
47
48 class wxDefaultArtProviderModule: public wxModule
49 {
50 public:
51 bool OnInit()
52 {
53 wxArtProvider::PushProvider(new wxDefaultArtProvider);
54 return TRUE;
55 }
56 void OnExit() {}
57
58 DECLARE_DYNAMIC_CLASS(wxDefaultArtProviderModule)
59 };
60
61 IMPLEMENT_DYNAMIC_CLASS(wxDefaultArtProviderModule, wxModule)
62
63
64 // ----------------------------------------------------------------------------
65 // XPMs with the art
66 // ----------------------------------------------------------------------------
67
68 // XPM hack: make the arrays const
69 #define static static const
70
71 #if wxUSE_HTML
72 #include "../../art/htmsidep.xpm"
73 #include "../../art/htmoptns.xpm"
74 #include "../../art/htmbook.xpm"
75 #include "../../art/htmfoldr.xpm"
76 #include "../../art/htmpage.xpm"
77 #endif // wxUSE_HTML
78
79 #include "../../art/addbookm.xpm"
80 #include "../../art/delbookm.xpm"
81 #include "../../art/back.xpm"
82 #include "../../art/forward.xpm"
83 #include "../../art/up.xpm"
84 #include "../../art/down.xpm"
85 #include "../../art/toparent.xpm"
86 #include "../../art/fileopen.xpm"
87 #include "../../art/print.xpm"
88 #include "../../art/helpicon.xpm"
89 #include "../../art/tipicon.xpm"
90 #include "../../art/home.xpm"
91 #include "../../art/repview.xpm"
92 #include "../../art/listview.xpm"
93 #include "../../art/new_dir.xpm"
94 #include "../../art/folder.xpm"
95 #include "../../art/dir_up.xpm"
96 #include "../../art/exefile.xpm"
97 #include "../../art/deffile.xpm"
98 #include "../../art/tick.xpm"
99 #include "../../art/cross.xpm"
100
101 #undef static
102
103 // ----------------------------------------------------------------------------
104 // CreateBitmap routine
105 // ----------------------------------------------------------------------------
106
107 wxBitmap wxDefaultArtProvider::CreateBitmap(const wxArtID& id,
108 const wxArtClient& client,
109 const wxSize& size)
110 {
111 #if wxUSE_HTML
112 ART(wxART_HELP_SIDE_PANEL, htmsidep)
113 ART(wxART_HELP_SETTINGS, htmoptns)
114 ART(wxART_HELP_BOOK, htmbook)
115 ART(wxART_HELP_FOLDER, htmfoldr)
116 ART(wxART_HELP_PAGE, htmpage)
117 #endif // wxUSE_HTML
118 ART(wxART_ADD_BOOKMARK, addbookm)
119 ART(wxART_DEL_BOOKMARK, delbookm)
120 ART(wxART_GO_BACK, back)
121 ART(wxART_GO_FORWARD, forward)
122 ART(wxART_GO_UP, up)
123 ART(wxART_GO_DOWN, down)
124 ART(wxART_GO_TO_PARENT, toparent)
125 ART(wxART_GO_HOME, home)
126 ART(wxART_FILE_OPEN, fileopen)
127 ART(wxART_PRINT, print)
128 ART(wxART_HELP, helpicon)
129 ART(wxART_TIP, tipicon)
130 ART(wxART_REPORT_VIEW, repview)
131 ART(wxART_LIST_VIEW, listview)
132 ART(wxART_NEW_DIR, new_dir)
133 ART(wxART_FOLDER, folder)
134 ART(wxART_GO_DIR_UP, dir_up)
135 ART(wxART_EXECUTABLE_FILE, exefile)
136 ART(wxART_NORMAL_FILE, deffile)
137 ART(wxART_TICK_MARK, tick)
138 ART(wxART_CROSS_MARK, cross)
139
140 return wxNullBitmap;
141 }