diff options
author | fluxgen <fluxgen> | 2003-08-13 15:12:39 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2003-08-13 15:12:39 (GMT) |
commit | 62adec2f25d8c5c4926d6294bd63ddc8e13cb853 (patch) | |
tree | e48cae24d98284a1fc404cb487654ad3c50df663 | |
parent | bdae051554da4655071b17e7fd200a13d541b56f (diff) | |
download | fluxbox_lack-62adec2f25d8c5c4926d6294bd63ddc8e13cb853.zip fluxbox_lack-62adec2f25d8c5c4926d6294bd63ddc8e13cb853.tar.bz2 |
cleaning
-rw-r--r-- | src/ToolbarTheme.cc | 34 | ||||
-rw-r--r-- | src/ToolbarTheme.hh | 43 |
2 files changed, 13 insertions, 64 deletions
diff --git a/src/ToolbarTheme.cc b/src/ToolbarTheme.cc index 0608726..6067264 100644 --- a/src/ToolbarTheme.cc +++ b/src/ToolbarTheme.cc | |||
@@ -19,7 +19,7 @@ | |||
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
20 | // DEALINGS IN THE SOFTWARE. | 20 | // DEALINGS IN THE SOFTWARE. |
21 | 21 | ||
22 | // $Id: ToolbarTheme.cc,v 1.7 2003/08/13 09:53:46 fluxgen Exp $ | 22 | // $Id: ToolbarTheme.cc,v 1.8 2003/08/13 15:12:39 fluxgen Exp $ |
23 | 23 | ||
24 | #include "ToolbarTheme.hh" | 24 | #include "ToolbarTheme.hh" |
25 | 25 | ||
@@ -45,36 +45,20 @@ void FbTk::ThemeItem<bool>::setFromString(char const *strval) { | |||
45 | 45 | ||
46 | ToolbarTheme::ToolbarTheme(int screen_num): | 46 | ToolbarTheme::ToolbarTheme(int screen_num): |
47 | FbTk::Theme(screen_num), | 47 | FbTk::Theme(screen_num), |
48 | m_button_color(*this, | ||
49 | "toolbar.button.picColor", "Toolbar.Button.PicColor"), | ||
50 | m_border_color(*this, | ||
51 | "toolbar.borderColor", "Toolbar.BorderColor"), | ||
52 | m_toolbar(*this, "toolbar", "Toolbar"), | 48 | m_toolbar(*this, "toolbar", "Toolbar"), |
53 | m_button(*this, "toolbar.button", "Toolbar.Button"), | 49 | m_border(*this, "toolbar", "Toolbar"), |
54 | m_pressed_button(*this, | ||
55 | "toolbar.button.pressed", "Toolbar.Button.Pressed"), | ||
56 | m_border_width(*this, "toolbar.borderWidth", "Toolbar.BorderWidth"), | ||
57 | m_bevel_width(*this, "toolbar.bevelWidth", "Toolbar.BevelWidth"), | 50 | m_bevel_width(*this, "toolbar.bevelWidth", "Toolbar.BevelWidth"), |
58 | m_button_border_width(*this, "toolbar.button.borderWidth", "Toolbar.Button.BorderWidth"), | ||
59 | m_shape(*this, "toolbar.shaped", "Toolbar.Shaped"), | 51 | m_shape(*this, "toolbar.shaped", "Toolbar.Shaped"), |
60 | m_alpha(*this, "toolbar.alpha", "Toolbar.Alpha"), | 52 | m_alpha(*this, "toolbar.alpha", "Toolbar.Alpha"), |
61 | m_display(FbTk::App::instance()->display()) { | 53 | m_display(FbTk::App::instance()->display()) { |
62 | 54 | ||
63 | Window rootwindow = RootWindow(m_display, screen_num); | 55 | *m_bevel_width = 0; |
64 | 56 | *m_alpha = 255; | |
65 | XGCValues gcv; | ||
66 | unsigned long gc_value_mask = GCForeground; | ||
67 | |||
68 | |||
69 | gcv.foreground = m_button_color->pixel(); | ||
70 | m_button_pic_gc = | ||
71 | XCreateGC(m_display, rootwindow, | ||
72 | gc_value_mask, &gcv); | ||
73 | 57 | ||
74 | } | 58 | } |
75 | 59 | ||
76 | ToolbarTheme::~ToolbarTheme() { | 60 | ToolbarTheme::~ToolbarTheme() { |
77 | XFreeGC(m_display, m_button_pic_gc); | 61 | |
78 | } | 62 | } |
79 | 63 | ||
80 | void ToolbarTheme::reconfigTheme() { | 64 | void ToolbarTheme::reconfigTheme() { |
@@ -82,12 +66,4 @@ void ToolbarTheme::reconfigTheme() { | |||
82 | *m_alpha = 255; | 66 | *m_alpha = 255; |
83 | else if (*m_alpha < 0) | 67 | else if (*m_alpha < 0) |
84 | *m_alpha = 0; | 68 | *m_alpha = 0; |
85 | |||
86 | XGCValues gcv; | ||
87 | unsigned long gc_value_mask = GCForeground; | ||
88 | |||
89 | gcv.foreground = m_button_color->pixel(); | ||
90 | XChangeGC(m_display, m_button_pic_gc, | ||
91 | gc_value_mask, &gcv); | ||
92 | |||
93 | } | 69 | } |
diff --git a/src/ToolbarTheme.hh b/src/ToolbarTheme.hh index 4076732..b29ab59 100644 --- a/src/ToolbarTheme.hh +++ b/src/ToolbarTheme.hh | |||
@@ -19,17 +19,16 @@ | |||
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
20 | // DEALINGS IN THE SOFTWARE. | 20 | // DEALINGS IN THE SOFTWARE. |
21 | 21 | ||
22 | // $Id: ToolbarTheme.hh,v 1.7 2003/08/13 09:53:35 fluxgen Exp $ | 22 | // $Id: ToolbarTheme.hh,v 1.8 2003/08/13 15:12:39 fluxgen Exp $ |
23 | 23 | ||
24 | #ifndef TOOLBARTHEME_HH | 24 | #ifndef TOOLBARTHEME_HH |
25 | #define TOOLBARTHEME_HH | 25 | #define TOOLBARTHEME_HH |
26 | 26 | ||
27 | #include "FbTk/Theme.hh" | 27 | #include "FbTk/Theme.hh" |
28 | #include "Font.hh" | ||
29 | #include "Texture.hh" | 28 | #include "Texture.hh" |
30 | #include "Color.hh" | 29 | #include "Color.hh" |
31 | #include "Text.hh" | 30 | |
32 | #include "Subject.hh" | 31 | #include "BorderTheme.hh" |
33 | 32 | ||
34 | /// toolbar theme class container | 33 | /// toolbar theme class container |
35 | class ToolbarTheme: public FbTk::Theme { | 34 | class ToolbarTheme: public FbTk::Theme { |
@@ -39,48 +38,22 @@ public: | |||
39 | 38 | ||
40 | void reconfigTheme(); | 39 | void reconfigTheme(); |
41 | 40 | ||
42 | /** | ||
43 | @name colors | ||
44 | */ | ||
45 | ///@{ | ||
46 | const FbTk::Color &buttonColor() const { return *m_button_color; } | ||
47 | const FbTk::Color &borderColor() const { return *m_border_color; } | ||
48 | ///@} | ||
49 | /** | ||
50 | @name textures | ||
51 | */ | ||
52 | ///@{ | ||
53 | const FbTk::Texture &toolbar() const { return *m_toolbar; } | ||
54 | const FbTk::Texture &button() const { return *m_button; } | ||
55 | const FbTk::Texture &pressedButton() const { return *m_pressed_button; } | ||
56 | ///@} | ||
57 | 41 | ||
58 | /** | 42 | inline const BorderTheme &border() const { return m_border; } |
59 | @name graphic context | 43 | inline const FbTk::Texture &toolbar() const { return *m_toolbar; } |
60 | */ | ||
61 | ///@{ | ||
62 | GC buttonPicGC() const { return m_button_pic_gc; } | ||
63 | ///@} | ||
64 | 44 | ||
65 | inline int borderWidth() const { return *m_border_width; } | ||
66 | inline int bevelWidth() const { return *m_bevel_width; } | 45 | inline int bevelWidth() const { return *m_bevel_width; } |
67 | inline int buttonBorderWidth() const { return *m_button_border_width; } | ||
68 | inline bool shape() const { return *m_shape; } | 46 | inline bool shape() const { return *m_shape; } |
69 | inline unsigned char alpha() const { return *m_alpha; } | 47 | inline unsigned char alpha() const { return *m_alpha; } |
70 | 48 | ||
71 | private: | 49 | private: |
72 | // text colors | 50 | FbTk::ThemeItem<FbTk::Texture> m_toolbar; |
73 | FbTk::ThemeItem<FbTk::Color> m_button_color, m_border_color; | 51 | BorderTheme m_border; |
74 | // textures | ||
75 | FbTk::ThemeItem<FbTk::Texture> m_toolbar, m_button, m_pressed_button; | ||
76 | 52 | ||
77 | FbTk::ThemeItem<int> m_border_width, m_bevel_width, m_button_border_width; | 53 | FbTk::ThemeItem<int> m_bevel_width; |
78 | FbTk::ThemeItem<bool> m_shape; | 54 | FbTk::ThemeItem<bool> m_shape; |
79 | FbTk::ThemeItem<int> m_alpha; | 55 | FbTk::ThemeItem<int> m_alpha; |
80 | 56 | ||
81 | // graphic context | ||
82 | GC m_button_pic_gc; | ||
83 | |||
84 | Display *m_display; | 57 | Display *m_display; |
85 | 58 | ||
86 | }; | 59 | }; |