]> git.saurik.com Git - wxWidgets.git/blob - src/common/artstd.cpp
wxhtml.rc no longer needed
[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 #ifdef __GNUG__
17 #pragma implementation "artprov.h"
18 #endif
19
20 // For compilers that support precompilation, includes "wx.h".
21 #include "wx/wxprec.h"
22
23 #if defined(__BORLANDC__)
24 #pragma hdrstop
25 #endif
26
27 #include "wx/artprov.h"
28 #include "wx/module.h"
29
30 // ----------------------------------------------------------------------------
31 // wxDefaultArtProvider
32 // ----------------------------------------------------------------------------
33
34 class wxDefaultArtProvider : public wxArtProvider
35 {
36 protected:
37 virtual wxBitmap CreateBitmap(const wxArtID& id, const wxArtClient& client,
38 const wxSize& size);
39 };
40
41 #define ART(artId, xpmRc) \
42 if ( id == artId ) return wxBitmap(xpmRc##_xpm);
43
44
45 // ----------------------------------------------------------------------------
46 // wxDefaultArtProviderModule
47 // ----------------------------------------------------------------------------
48
49 class wxDefaultArtProviderModule: public wxModule
50 {
51 public:
52 bool OnInit()
53 {
54 wxArtProvider::PushProvider(new wxDefaultArtProvider);
55 return TRUE;
56 }
57 void OnExit() {}
58
59 DECLARE_DYNAMIC_CLASS(wxDefaultArtProviderModule)
60 };
61
62 IMPLEMENT_DYNAMIC_CLASS(wxDefaultArtProviderModule, wxModule)
63
64
65 // ----------------------------------------------------------------------------
66 // XPMs with the art
67 // ----------------------------------------------------------------------------
68
69 // XPM hack: make the arrays const
70 #define static static const
71
72 #if wxUSE_HTML
73 #include "../../art/htmsidep.xpm"
74 #include "../../art/htmoptns.xpm"
75 #include "../../art/htmbook.xpm"
76 #include "../../art/htmfoldr.xpm"
77 #include "../../art/htmpage.xpm"
78 #endif // wxUSE_HTML
79
80 #include "../../art/addbookm.xpm"
81 #include "../../art/delbookm.xpm"
82 #include "../../art/back.xpm"
83 #include "../../art/forward.xpm"
84 #include "../../art/up.xpm"
85 #include "../../art/down.xpm"
86 #include "../../art/toparent.xpm"
87 #include "../../art/fileopen.xpm"
88 #include "../../art/print.xpm"
89 #include "../../art/helpicon.xpm"
90 #include "../../art/tipicon.xpm"
91
92 #undef static
93
94 // ----------------------------------------------------------------------------
95 // CreateBitmap routine
96 // ----------------------------------------------------------------------------
97
98 wxBitmap wxDefaultArtProvider::CreateBitmap(const wxArtID& id,
99 const wxArtClient& client,
100 const wxSize& size)
101 {
102 #if wxUSE_HTML
103 ART(wxART_HELP_SIDE_PANEL, htmsidep)
104 ART(wxART_HELP_SETTINGS, htmoptns)
105 ART(wxART_HELP_BOOK, htmbook)
106 ART(wxART_HELP_FOLDER, htmfoldr)
107 ART(wxART_HELP_PAGE, htmpage)
108 #endif // wxUSE_HTML
109 ART(wxART_ADD_BOOKMARK, addbookm)
110 ART(wxART_DEL_BOOKMARK, delbookm)
111 ART(wxART_GO_BACK, back)
112 ART(wxART_GO_FORWARD, forward)
113 ART(wxART_GO_UP, up)
114 ART(wxART_GO_DOWN, down)
115 ART(wxART_GO_TO_PARENT, toparent)
116 ART(wxART_FILE_OPEN, fileopen)
117 ART(wxART_PRINT, print)
118 ART(wxART_HELP, helpicon)
119 ART(wxART_TIP, tipicon)
120
121 return wxNullBitmap;
122 }