aboutsummaryrefslogtreecommitdiff
path: root/src/ToolbarTheme.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/ToolbarTheme.hh')
-rw-r--r--src/ToolbarTheme.hh103
1 files changed, 103 insertions, 0 deletions
diff --git a/src/ToolbarTheme.hh b/src/ToolbarTheme.hh
new file mode 100644
index 0000000..eaa7811
--- /dev/null
+++ b/src/ToolbarTheme.hh
@@ -0,0 +1,103 @@
1// ToolbarTheme.hh a theme class for Toolbar
2// Copyright (c) 2002 Henrik Kinnunen (fluxgen at users.sourceforge.net)
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// $Id: ToolbarTheme.hh,v 1.5 2003/07/10 13:48:35 fluxgen Exp $
23
24#ifndef TOOLBARTHEME_HH
25#define TOOLBARTHEME_HH
26
27#include "FbTk/Theme.hh"
28#include "Font.hh"
29#include "Texture.hh"
30#include "Color.hh"
31#include "Text.hh"
32#include "Subject.hh"
33
34/// toolbar theme class container
35class ToolbarTheme: public FbTk::Theme {
36public:
37 explicit ToolbarTheme(int screen_num);
38 virtual ~ToolbarTheme();
39
40 void reconfigTheme();
41
42 /**
43 @name colors
44 */
45 ///@{
46 const FbTk::Color &labelTextColor() const { return *m_label_textcolor; }
47 const FbTk::Color &windowTextColor() const { return *m_window_textcolor; }
48 const FbTk::Color &clockTextColor() const { return *m_clock_textcolor; }
49 const FbTk::Color &buttonColor() const { return *m_button_color; }
50 const FbTk::Color &borderColor() const { return *m_border_color; }
51 ///@}
52 /**
53 @name textures
54 */
55 ///@{
56 const FbTk::Texture &toolbar() const { return *m_toolbar; }
57 const FbTk::Texture &label() const { return *m_label; }
58 const FbTk::Texture &window() const { return *m_window; }
59 const FbTk::Texture &button() const { return *m_button; }
60 const FbTk::Texture &pressedButton() const { return *m_pressed_button; }
61 const FbTk::Texture &clock() const { return *m_clock; }
62 ///@}
63 const FbTk::Font &font() const { return *m_font; }
64 FbTk::Font &font() { return *m_font; }
65 /**
66 @name graphic context
67 */
68 ///@{
69 GC labelTextGC() const { return m_label_text_gc; }
70 GC windowTextGC() const { return m_window_text_gc; }
71 GC clockTextGC() const { return m_clock_text_gc; }
72 GC buttonPicGC() const { return m_button_pic_gc; }
73 ///@}
74 FbTk::Justify justify() const { return *m_justify; }
75
76 inline int borderWidth() const { return *m_border_width; }
77 inline int bevelWidth() const { return *m_bevel_width; }
78 inline int buttonBorderWidth() const { return *m_button_border_width; }
79 inline bool shape() const { return *m_shape; }
80
81 void addListener(FbTk::Observer &obs) { m_theme_change_sig.attach(&obs); }
82 void removeListener(FbTk::Observer &obs) { m_theme_change_sig.detach(&obs); }
83
84private:
85 // text colors
86 FbTk::ThemeItem<FbTk::Color> m_label_textcolor, m_window_textcolor, m_clock_textcolor;
87 FbTk::ThemeItem<FbTk::Color> m_button_color, m_border_color;
88 // textures
89 FbTk::ThemeItem<FbTk::Texture> m_toolbar, m_label, m_window, m_button, m_pressed_button, m_clock;
90 FbTk::ThemeItem<FbTk::Font> m_font;
91 FbTk::ThemeItem<FbTk::Justify> m_justify;
92
93 FbTk::ThemeItem<int> m_border_width, m_bevel_width, m_button_border_width;
94 FbTk::ThemeItem<bool> m_shape;
95
96 // graphic context
97 GC m_label_text_gc, m_window_text_gc, m_clock_text_gc, m_button_pic_gc;
98 Display *m_display;
99
100 FbTk::Subject m_theme_change_sig;
101};
102
103#endif // TOOLBARTHEME_HH