aboutsummaryrefslogtreecommitdiff
path: root/src/FbWinFrameTheme.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbWinFrameTheme.hh')
-rw-r--r--src/FbWinFrameTheme.hh136
1 files changed, 136 insertions, 0 deletions
diff --git a/src/FbWinFrameTheme.hh b/src/FbWinFrameTheme.hh
new file mode 100644
index 0000000..712f4be
--- /dev/null
+++ b/src/FbWinFrameTheme.hh
@@ -0,0 +1,136 @@
1// FbWinFrameTheme.hh for Fluxbox Window Manager
2// Copyright (c) 2003 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: FbWinFrameTheme.hh,v 1.12 2003/09/29 12:53:58 rathnor Exp $
23
24#ifndef FBWINFRAMETHEME_HH
25#define FBWINFRAMETHEME_HH
26
27#include "FbTk/Font.hh"
28#include "FbTk/Texture.hh"
29#include "FbTk/Text.hh"
30#include "FbTk/Color.hh"
31#include "FbTk/Theme.hh"
32#include "FbTk/Subject.hh"
33#include "FbTk/GContext.hh"
34
35#include "BorderTheme.hh"
36#include "Shape.hh"
37
38class FbWinFrameTheme: public FbTk::Theme {
39public:
40 explicit FbWinFrameTheme(int screen_num);
41 ~FbWinFrameTheme();
42 /**
43 @name textures
44 */
45 //@{
46 const FbTk::Texture &labelFocusTexture() const { return *m_label_focus; }
47 const FbTk::Texture &labelUnfocusTexture() const { return *m_label_unfocus; }
48
49 const FbTk::Texture &titleFocusTexture() const { return *m_title_focus; }
50 const FbTk::Texture &titleUnfocusTexture() const { return *m_title_unfocus; }
51
52 const FbTk::Texture &handleFocusTexture() const { return *m_handle_focus; }
53 const FbTk::Texture &handleUnfocusTexture() const { return *m_handle_unfocus; }
54
55 const FbTk::Texture &buttonFocusTexture() const { return *m_button_focus; }
56 const FbTk::Texture &buttonUnfocusTexture() const { return *m_button_unfocus; }
57 const FbTk::Texture &buttonPressedTexture() const { return *m_button_pressed; }
58
59 const FbTk::Texture &gripFocusTexture() const { return *m_grip_focus; }
60 const FbTk::Texture &gripUnfocusTexture() const { return *m_grip_unfocus; }
61 //@}
62
63 /**
64 @name colors
65 */
66 //@{
67 const FbTk::Color &labelFocusColor() const { return *m_label_focus_color; }
68 const FbTk::Color &labelUnfocusColor() const { return *m_label_unfocus_color; }
69 const FbTk::Color &frameFocuscolor() const { return *m_frame_focus_color; }
70 const FbTk::Color &frameUnfocuscolor() const { return *m_frame_unfocus_color; }
71 const FbTk::Color &buttonFocuscolor() const { return *m_button_focus_color; }
72 const FbTk::Color &buttonUnfocuscolor() const { return *m_button_unfocus_color; }
73 //@}
74 const FbTk::Font &font() const { return *m_font; }
75 FbTk::Font &font() { return *m_font; }
76
77 FbTk::Justify justify() const { return *m_textjustify; }
78
79 GC labelTextFocusGC() const { return m_label_text_focus_gc.gc(); }
80 GC labelTextUnfocusGC() const { return m_label_text_unfocus_gc.gc(); }
81 GC buttonPicFocusGC() const { return m_button_pic_focus_gc.gc(); }
82 GC buttonPicUnfocusGC() const { return m_button_pic_unfocus_gc.gc(); }
83
84 bool fallback(FbTk::ThemeItem_base &item);
85 void reconfigTheme();
86
87 void addListener(FbTk::Observer &obs) { m_theme_change.attach(&obs); }
88 void removeListener(FbTk::Observer &obs) { m_theme_change.detach(&obs); }
89
90 inline Cursor moveCursor() const { return m_cursor_move; }
91 inline Cursor lowerLeftAngleCursor() const { return m_cursor_lower_left_angle; }
92 inline Cursor lowerRightAngleCursor() const { return m_cursor_lower_right_angle; }
93 inline Cursor upperLeftAngleCursor() const { return m_cursor_upper_left_angle; }
94 inline Cursor upperRightAngleCursor() const { return m_cursor_upper_right_angle; }
95
96 inline Shape::ShapePlace shapePlace() const { return *m_shape_place; }
97 inline const BorderTheme &border() const { return m_border; }
98 unsigned char alpha() const { return *m_alpha; }
99
100 unsigned int titleHeight() const { return *m_title_height; }
101 unsigned int bevelWidth() const { return *m_bevel_width; }
102 unsigned int handleWidth() const { return *m_handle_width; }
103
104private:
105 FbTk::ThemeItem<FbTk::Texture> m_label_focus, m_label_unfocus;
106 FbTk::ThemeItem<FbTk::Texture> m_title_focus, m_title_unfocus;
107 FbTk::ThemeItem<FbTk::Texture> m_handle_focus, m_handle_unfocus;
108 FbTk::ThemeItem<FbTk::Texture> m_button_focus, m_button_unfocus, m_button_pressed;
109 FbTk::ThemeItem<FbTk::Texture> m_grip_focus, m_grip_unfocus;
110
111 FbTk::ThemeItem<FbTk::Color> m_label_focus_color, m_label_unfocus_color;
112 FbTk::ThemeItem<FbTk::Color> m_frame_focus_color, m_frame_unfocus_color;
113 FbTk::ThemeItem<FbTk::Color> m_button_focus_color, m_button_unfocus_color;
114
115 FbTk::ThemeItem<FbTk::Font> m_font;
116 FbTk::ThemeItem<FbTk::Justify> m_textjustify;
117 FbTk::ThemeItem<Shape::ShapePlace> m_shape_place;
118
119 FbTk::ThemeItem<int> m_alpha, m_title_height, m_bevel_width, m_handle_width;
120 BorderTheme m_border;
121
122 FbTk::GContext m_label_text_focus_gc, m_label_text_unfocus_gc;
123 FbTk::GContext m_button_pic_focus_gc, m_button_pic_unfocus_gc;
124
125 FbTk::Subject m_theme_change;
126
127 Cursor m_cursor_move;
128 Cursor m_cursor_lower_left_angle;
129 Cursor m_cursor_lower_right_angle;
130 Cursor m_cursor_upper_left_angle;
131 Cursor m_cursor_upper_right_angle;
132};
133
134#endif // FBWINFRAMETHEME_HH
135
136