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