aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/MenuTheme.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbTk/MenuTheme.hh')
-rw-r--r--src/FbTk/MenuTheme.hh113
1 files changed, 113 insertions, 0 deletions
diff --git a/src/FbTk/MenuTheme.hh b/src/FbTk/MenuTheme.hh
new file mode 100644
index 0000000..4e21ba1
--- /dev/null
+++ b/src/FbTk/MenuTheme.hh
@@ -0,0 +1,113 @@
1// MenuTheme.hh for FbTk
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: MenuTheme.hh,v 1.5 2003/02/22 21:24:19 fluxgen Exp $
23
24#ifndef FBTK_MENUTHEME_HH
25#define FBTK_MENUTHEME_HH
26
27#include "Theme.hh"
28#include "Color.hh"
29#include "Font.hh"
30#include "Texture.hh"
31#include "Text.hh"
32#include "Subject.hh"
33
34namespace FbTk {
35
36class MenuTheme:public FbTk::Theme {
37public:
38 enum BulletType { EMPTY, SQUARE, TRIANGLE, DIAMOND};
39 MenuTheme(int screen_num);
40 virtual ~MenuTheme();
41
42 void reconfigTheme();
43
44 /**
45 @name text colors
46 */
47 ///@{
48 const FbTk::Color &titleTextColor() const { return *t_text; }
49 const FbTk::Color &frameTextColor() const { return *f_text; }
50 const FbTk::Color &highlightTextColor() const { return *h_text; }
51 const FbTk::Color &disableTextColor() const { return *d_text; }
52 ///@}
53 /**
54 @name textures
55 */
56 ///@{
57 const FbTk::Texture &titleTexture() const { return *title; }
58 const FbTk::Texture &frameTexture() const { return *frame; }
59 const FbTk::Texture &hiliteTexture() const { return *hilite; }
60 ///@}
61 /**
62 @name fonts
63 */
64 ///@{
65 const FbTk::Font &titleFont() const { return *titlefont; }
66 FbTk::Font &titleFont() { return *titlefont; }
67 const FbTk::Font &frameFont() const { return *framefont; }
68 FbTk::Font &frameFont() { return *framefont; }
69 ///@}
70
71 FbTk::Justify frameFontJustify() const { return *framefont_justify; }
72 FbTk::Justify titleFontJustify() const { return *titlefont_justify; }
73
74 /**
75 @name graphic contexts
76 */
77 ///@{
78 GC titleTextGC() const { return t_text_gc; }
79 GC frameTextGC() const { return f_text_gc; }
80 GC hiliteTextGC() const { return h_text_gc; }
81 GC disableTextGC() const { return d_text_gc; }
82 GC hiliteGC() const { return hilite_gc; }
83 ///@}
84 BulletType bullet() const { return *m_bullet; }
85 FbTk::Justify bulletPos() const { return *bullet_pos; }
86
87 unsigned int borderWidth() const { return *m_border_width; }
88 unsigned int bevelWidth() const { return *m_bevel_width; }
89 const FbTk::Color &borderColor() const { return *m_border_color; }
90 /// attach observer
91 void addListener(FbTk::Observer &obs) { m_theme_change_sig.attach(&obs); }
92 /// detach observer
93 void removeListener(FbTk::Observer &obs) { m_theme_change_sig.detach(&obs); }
94private:
95 FbTk::ThemeItem<FbTk::Color> t_text, f_text, h_text, d_text;
96 FbTk::ThemeItem<FbTk::Texture> title, frame, hilite;
97 FbTk::ThemeItem<FbTk::Font> titlefont, framefont;
98 FbTk::ThemeItem<FbTk::Justify> framefont_justify, titlefont_justify;
99 FbTk::ThemeItem<FbTk::Justify> bullet_pos;
100 FbTk::ThemeItem<BulletType> m_bullet;
101 FbTk::ThemeItem<unsigned int> m_border_width;
102 FbTk::ThemeItem<unsigned int> m_bevel_width;
103 FbTk::ThemeItem<FbTk::Color> m_border_color;
104
105
106 Display *m_display;
107 GC t_text_gc, f_text_gc, h_text_gc, d_text_gc, hilite_gc;
108 FbTk::Subject m_theme_change_sig;
109};
110
111}; // end namespace FbTk
112
113#endif // FBTK_MENUTHEME_HH