aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-02-15 01:59:00 (GMT)
committerfluxgen <fluxgen>2003-02-15 01:59:00 (GMT)
commitf25cf733d6fc1496f02514695948c09797755dae (patch)
tree33844f1a73c288d6d21dd4656920b3a2268f6e1b /src
parent2031f46de3475f52a54165740bf8c2b891b3bebe (diff)
downloadfluxbox_paul-f25cf733d6fc1496f02514695948c09797755dae.zip
fluxbox_paul-f25cf733d6fc1496f02514695948c09797755dae.tar.bz2
added theme listener subject
Diffstat (limited to 'src')
-rw-r--r--src/FbWinFrameTheme.cc5
-rw-r--r--src/FbWinFrameTheme.hh8
-rw-r--r--src/ToolbarTheme.cc5
-rw-r--r--src/ToolbarTheme.hh13
4 files changed, 24 insertions, 7 deletions
diff --git a/src/FbWinFrameTheme.cc b/src/FbWinFrameTheme.cc
index 8fc562f..ece7dcc 100644
--- a/src/FbWinFrameTheme.cc
+++ b/src/FbWinFrameTheme.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: FbWinFrameTheme.cc,v 1.1 2003/01/05 22:14:10 fluxgen Exp $ 22// $Id: FbWinFrameTheme.cc,v 1.2 2003/02/15 01:55:45 fluxgen Exp $
23 23
24#include "FbWinFrameTheme.hh" 24#include "FbWinFrameTheme.hh"
25#include "App.hh" 25#include "App.hh"
@@ -81,5 +81,8 @@ void FbWinFrameTheme::reconfigTheme() {
81 81
82 gcv.foreground = m_label_unfocus_color->pixel(); 82 gcv.foreground = m_label_unfocus_color->pixel();
83 XChangeGC(disp, m_label_text_unfocus_gc, gc_value_mask, &gcv); 83 XChangeGC(disp, m_label_text_unfocus_gc, gc_value_mask, &gcv);
84
85 // notify listeners
86 m_theme_change.notify();
84} 87}
85 88
diff --git a/src/FbWinFrameTheme.hh b/src/FbWinFrameTheme.hh
index 4c702c4..d98b629 100644
--- a/src/FbWinFrameTheme.hh
+++ b/src/FbWinFrameTheme.hh
@@ -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: FbWinFrameTheme.hh,v 1.1 2003/01/05 22:14:10 fluxgen Exp $ 22// $Id: FbWinFrameTheme.hh,v 1.2 2003/02/15 01:55:27 fluxgen Exp $
23 23
24#ifndef FBWINFRAMETHEME_HH 24#ifndef FBWINFRAMETHEME_HH
25#define FBWINFRAMETHEME_HH 25#define FBWINFRAMETHEME_HH
@@ -29,6 +29,7 @@
29#include "Text.hh" 29#include "Text.hh"
30#include "Color.hh" 30#include "Color.hh"
31#include "FbTk/Theme.hh" 31#include "FbTk/Theme.hh"
32#include "Subject.hh"
32 33
33class FbWinFrameTheme: public FbTk::Theme { 34class FbWinFrameTheme: public FbTk::Theme {
34public: 35public:
@@ -76,6 +77,9 @@ public:
76 GC labelTextUnfocusGC() const { return m_label_text_unfocus_gc; } 77 GC labelTextUnfocusGC() const { return m_label_text_unfocus_gc; }
77 78
78 void reconfigTheme(); 79 void reconfigTheme();
80
81 void addListener(FbTk::Observer &obs) { m_theme_change.attach(&obs); }
82 void removeListener(FbTk::Observer &obs) { m_theme_change.detach(&obs); }
79private: 83private:
80 FbTk::ThemeItem<FbTk::Texture> m_label_focus, m_label_unfocus; 84 FbTk::ThemeItem<FbTk::Texture> m_label_focus, m_label_unfocus;
81 FbTk::ThemeItem<FbTk::Texture> m_title_focus, m_title_unfocus; 85 FbTk::ThemeItem<FbTk::Texture> m_title_focus, m_title_unfocus;
@@ -91,6 +95,8 @@ private:
91 FbTk::ThemeItem<FbTk::Justify> m_textjustify; 95 FbTk::ThemeItem<FbTk::Justify> m_textjustify;
92 96
93 GC m_label_text_focus_gc, m_label_text_unfocus_gc; 97 GC m_label_text_focus_gc, m_label_text_unfocus_gc;
98
99 FbTk::Subject m_theme_change;
94}; 100};
95 101
96#endif // FBWINFRAMETHEME_HH 102#endif // FBWINFRAMETHEME_HH
diff --git a/src/ToolbarTheme.cc b/src/ToolbarTheme.cc
index 138104f..374a596 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.1 2002/12/02 19:56:38 fluxgen Exp $ 22// $Id: ToolbarTheme.cc,v 1.2 2003/02/15 01:59:00 fluxgen Exp $
23 23
24#include "ToolbarTheme.hh" 24#include "ToolbarTheme.hh"
25 25
@@ -106,4 +106,7 @@ void ToolbarTheme::reconfigTheme() {
106 gcv.foreground = m_button_color->pixel(); 106 gcv.foreground = m_button_color->pixel();
107 XChangeGC(m_display, m_button_pic_gc, 107 XChangeGC(m_display, m_button_pic_gc,
108 gc_value_mask, &gcv); 108 gc_value_mask, &gcv);
109
110 // notify listeners
111 m_theme_change_sig.notify();
109} 112}
diff --git a/src/ToolbarTheme.hh b/src/ToolbarTheme.hh
index f40ed19..cbe9c90 100644
--- a/src/ToolbarTheme.hh
+++ b/src/ToolbarTheme.hh
@@ -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.hh,v 1.1 2002/12/02 19:56:08 fluxgen Exp $ 22// $Id: ToolbarTheme.hh,v 1.2 2003/02/15 01:58:52 fluxgen Exp $
23 23
24#ifndef TOOLBARTHEME_HH 24#ifndef TOOLBARTHEME_HH
25#define TOOLBARTHEME_HH 25#define TOOLBARTHEME_HH
@@ -29,9 +29,9 @@
29#include "Texture.hh" 29#include "Texture.hh"
30#include "Color.hh" 30#include "Color.hh"
31#include "Text.hh" 31#include "Text.hh"
32/** 32#include "Subject.hh"
33 Toolbar theme class container 33
34*/ 34/// toolbar theme class container
35class ToolbarTheme: public FbTk::Theme { 35class ToolbarTheme: public FbTk::Theme {
36public: 36public:
37 explicit ToolbarTheme(int screen_num); 37 explicit ToolbarTheme(int screen_num);
@@ -71,6 +71,9 @@ public:
71 GC buttonPicGC() const { return m_button_pic_gc; } 71 GC buttonPicGC() const { return m_button_pic_gc; }
72 ///@} 72 ///@}
73 FbTk::Justify justify() const { return *m_justify; } 73 FbTk::Justify justify() const { return *m_justify; }
74
75 void addListener(FbTk::Observer &obs) { m_theme_change_sig.attach(&obs); }
76 void removeListener(FbTk::Observer &obs) { m_theme_change_sig.detach(&obs); }
74private: 77private:
75 // text colors 78 // text colors
76 FbTk::ThemeItem<FbTk::Color> m_label_textcolor, m_window_textcolor, m_clock_textcolor; 79 FbTk::ThemeItem<FbTk::Color> m_label_textcolor, m_window_textcolor, m_clock_textcolor;
@@ -82,6 +85,8 @@ private:
82 // graphic context 85 // graphic context
83 GC m_label_text_gc, m_window_text_gc, m_clock_text_gc, m_button_pic_gc; 86 GC m_label_text_gc, m_window_text_gc, m_clock_text_gc, m_button_pic_gc;
84 Display *m_display; 87 Display *m_display;
88
89 FbTk::Subject m_theme_change_sig;
85}; 90};
86 91
87#endif // TOOLBARTHEME_HH 92#endif // TOOLBARTHEME_HH