From 96c49e2d0d103d9a4d6e5a12e33fc4f7ab83c24e Mon Sep 17 00:00:00 2001
From: fluxgen <fluxgen>
Date: Sat, 15 Feb 2003 01:54:54 +0000
Subject: added theme listener

---
 src/FbWinFrame.cc |  6 ++++--
 src/FbWinFrame.hh | 22 ++++++++++++++++++----
 2 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc
index 5c284ec..ca93957 100644
--- a/src/FbWinFrame.cc
+++ b/src/FbWinFrame.cc
@@ -19,7 +19,7 @@
 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 // DEALINGS IN THE SOFTWARE.
 
-// $Id: FbWinFrame.cc,v 1.5 2003/01/12 20:31:54 fluxgen Exp $
+// $Id: FbWinFrame.cc,v 1.6 2003/02/15 01:54:54 fluxgen Exp $
 
 #include "FbWinFrame.hh"
 #include "ImageControl.hh"
@@ -63,7 +63,9 @@ FbWinFrame::FbWinFrame(FbWinFrameTheme &theme, FbTk::ImageControl &imgctrl, int
     m_bevel(1),
     m_use_titlebar(true), 
     m_use_handle(true),
-    m_button_pm(0) {
+    m_button_pm(0),
+    m_themelistener(*this) {
+    theme.addListener(m_themelistener);
     init();
 }
 /*
diff --git a/src/FbWinFrame.hh b/src/FbWinFrame.hh
index 2f5b81b..841ad40 100644
--- a/src/FbWinFrame.hh
+++ b/src/FbWinFrame.hh
@@ -19,7 +19,7 @@
 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 // DEALINGS IN THE SOFTWARE.
 
-// $Id: FbWinFrame.hh,v 1.3 2003/01/09 22:00:34 fluxgen Exp $
+// $Id: FbWinFrame.hh,v 1.4 2003/02/15 01:54:18 fluxgen Exp $
 
 #ifndef FBWINFRAME_HH
 #define FBWINFRAME_HH
@@ -32,6 +32,7 @@
 #include "FbWinFrameTheme.hh"
 #include "RefCount.hh"
 #include "Command.hh"
+#include "Observer.hh"
 
 #include <vector>
 #include <string>
@@ -46,11 +47,13 @@ class FbWinFrame:public FbTk::EventHandler {
 public:
 
     /// create a top level window
-    FbWinFrame(FbWinFrameTheme &theme, FbTk::ImageControl &imgctrl, int screen_num, int x, int y,
+    FbWinFrame(FbWinFrameTheme &theme, FbTk::ImageControl &imgctrl, 
+               int screen_num, int x, int y,
                unsigned int width, unsigned int height);
 
     /// create a frame window inside another FbWindow, NOT IMPLEMENTED!
-    FbWinFrame(FbWinFrameTheme &theme, FbTk::ImageControl &imgctrl, const FbTk::FbWindow &parent,
+    FbWinFrame(FbWinFrameTheme &theme, FbTk::ImageControl &imgctrl, 
+               const FbTk::FbWindow &parent,
                int x, int y, 
                unsigned int width, unsigned int height);
 
@@ -236,7 +239,18 @@ private:
         FbTk::RefCount<FbTk::Command> click_pressed; ///< what to do when we press mouse button
         FbTk::RefCount<FbTk::Command> double_click; ///< what to do when we double click
     };
-    MouseButtonAction m_commands[5]; ///< hardcoded to five ...TODO, change this
+    MouseButtonAction m_commands[5]; ///< hardcoded to five ... //!! TODO, change this
+
+    class ThemeListener: public FbTk::Observer {
+    public:
+        ThemeListener(FbWinFrame &frame):m_frame(frame) { }
+        void update(FbTk::Subject *subj) {
+            m_frame.reconfigure();
+        }
+    private:
+        FbWinFrame &m_frame;
+    };
+    ThemeListener m_themelistener;
 };
 
 #endif // FBWINFRAME_HH
-- 
cgit v0.11.2