]> git.saurik.com Git - wxWidgets.git/blob - src/common/artstd.cpp
fe55f9d2f3ae9ccb42893d64bcb9cdafefbc3182
[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 #include "../../art/home.xpm"
88 #include "../../art/repview.xpm"
89 #include "../../art/listview.xpm"
90 #include "../../art/new_dir.xpm"
91 #include "../../art/folder.xpm"
92 #include "../../art/dir_up.xpm"
93 #include "../../art/exefile.xpm"
94 #include "../../art/deffile.xpm"
95
96 #undef static
97
98 // ----------------------------------------------------------------------------
99 // CreateBitmap routine
100 // ----------------------------------------------------------------------------
101
102 wxBitmap wxDefaultArtProvider::CreateBitmap(const wxArtID& id,
103 const wxArtClient& client,
104 const wxSize& size)
105 {
106 #if wxUSE_HTML
107 ART(wxART_HELP_SIDE_PANEL, htmsidep)
108 ART(wxART_HELP_SETTINGS, htmoptns)
109 ART(wxART_HELP_BOOK, htmbook)
110 ART(wxART_HELP_FOLDER, htmfoldr)
111 ART(wxART_HELP_PAGE, htmpage)
112 #endif // wxUSE_HTML
113 ART(wxART_ADD_BOOKMARK, addbookm)
114 ART(wxART_DEL_BOOKMARK, delbookm)
115 ART(wxART_GO_BACK, back)
116 ART(wxART_GO_FORWARD, forward)
117 ART(wxART_GO_UP, up)
118 ART(wxART_GO_DOWN, down)
119 ART(wxART_GO_TO_PARENT, toparent)
120 ART(wxART_GO_HOME, home)
121 ART(wxART_FILE_OPEN, fileopen)
122 ART(wxART_PRINT, print)
123 ART(wxART_HELP, helpicon)
124 ART(wxART_TIP, tipicon)
125 ART(wxART_REPORT_VIEW, repview)
126 ART(wxART_LIST_VIEW, listview)
127 ART(wxART_NEW_DIR, new_dir)
128 ART(wxART_FOLDER, folder)
129 ART(wxART_GO_DIR_UP, dir_up)
130 ART(wxART_EXECUTABLE_FILE, exefile)
131 ART(wxART_NORMAL_FILE, deffile)
132
133 return wxNullBitmap;
134 }