1 // ToolbarTheme.hh  a theme class for Toolbar
2 // Copyright (c) 2002 - 2006 Henrik Kinnunen (fluxgen at fluxbox dot org)
3 //
4 // Permission is hereby granted, free of charge, to any person obtaining a
5 // copy of this software and associated documentation files (the "Software"),
6 // to deal in the Software without restriction, including without limitation
7 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 // and/or sell copies of the Software, and to permit persons to whom the
9 // Software is furnished to do so, subject to the following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included in
12 // all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 // DEALINGS IN THE SOFTWARE.
21 
22 #ifndef TOOLBARTHEME_HH
23 #define TOOLBARTHEME_HH
24 
25 #include "FbTk/Theme.hh"
26 #include "FbTk/Texture.hh"
27 #include "FbTk/BorderTheme.hh"
28 
29 /// toolbar theme class container
30 class ToolbarTheme: public FbTk::Theme, public FbTk::ThemeProxy<ToolbarTheme> {
31 public:
32     explicit ToolbarTheme(int screen_num);
33     virtual ~ToolbarTheme();
34 
35     void reconfigTheme();
36 
border() const37     const FbTk::BorderTheme &border() const { return m_border; }
toolbar() const38     const FbTk::Texture &toolbar() const { return *m_toolbar; }
39 
40     bool fallback(FbTk::ThemeItem_base &item);
41 
bevelWidth() const42     int bevelWidth() const { return *m_bevel_width; }
shape() const43     bool shape() const { return *m_shape; }
height() const44     int height() const { return *m_height; }
buttonSize() const45     int buttonSize() const { return *m_button_size; }
46 
reconfigSig()47     virtual FbTk::Signal<> &reconfigSig() { return FbTk::Theme::reconfigSig(); }
48 
operator *()49     virtual ToolbarTheme &operator *() { return *this; }
operator *() const50     virtual const ToolbarTheme &operator *() const { return *this; }
51 
52 private:
53     FbTk::ThemeItem<FbTk::Texture> m_toolbar;
54     FbTk::BorderTheme m_border;
55 
56     FbTk::ThemeItem<int> m_bevel_width;
57     FbTk::ThemeItem<bool> m_shape;
58     FbTk::ThemeItem<int> m_height, m_button_size;
59 };
60 
61 #endif // TOOLBARTHEME_HH
62