aboutsummaryrefslogtreecommitdiff
path: root/src/SystemTray.hh
diff options
context:
space:
mode:
authorHenrik Kinnunen <fluxgen@fluxbox.org>2008-04-27 19:22:18 (GMT)
committerHenrik Kinnunen <fluxgen@fluxbox.org>2008-04-27 19:22:18 (GMT)
commit80b10f7772b91f1f4a61eace4e5235a79060e1f0 (patch)
tree27057e59c41188e7c2f724614233265fed03c9b3 /src/SystemTray.hh
parent40e17b4d0ef1b9503f21509e697dd4dcb24d2bbf (diff)
downloadfluxbox_pavel-80b10f7772b91f1f4a61eace4e5235a79060e1f0.zip
fluxbox_pavel-80b10f7772b91f1f4a61eace4e5235a79060e1f0.tar.bz2
Added SimpleObserver class.
This class works in the same way as the SimpleCommand class. Use it with the makeObserver function. It calls the receiver's member function when the subject sends a signal.
Diffstat (limited to 'src/SystemTray.hh')
-rw-r--r--src/SystemTray.hh11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/SystemTray.hh b/src/SystemTray.hh
index 3215e31..132069a 100644
--- a/src/SystemTray.hh
+++ b/src/SystemTray.hh
@@ -25,12 +25,12 @@
25 25
26#include "FbTk/FbWindow.hh" 26#include "FbTk/FbWindow.hh"
27#include "FbTk/EventHandler.hh" 27#include "FbTk/EventHandler.hh"
28#include "FbTk/Observer.hh"
29 28
30#include "ToolTheme.hh" 29#include "ToolTheme.hh"
31#include "ToolbarItem.hh" 30#include "ToolbarItem.hh"
32 31
33#include <list> 32#include <list>
33#include <memory>
34 34
35class BScreen; 35class BScreen;
36class ButtonTheme; 36class ButtonTheme;
@@ -39,9 +39,10 @@ class AtomHandler;
39 39
40namespace FbTk { 40namespace FbTk {
41template <class T> class ThemeProxy; 41template <class T> class ThemeProxy;
42class Observer;
42} 43}
43 44
44class SystemTray: public ToolbarItem, public FbTk::EventHandler, public FbTk::Observer { 45class SystemTray: public ToolbarItem, public FbTk::EventHandler {
45public: 46public:
46 47
47 explicit SystemTray(const FbTk::FbWindow &parent, 48 explicit SystemTray(const FbTk::FbWindow &parent,
@@ -75,7 +76,7 @@ public:
75 m_window.setBorderWidth(m_theme->border().width()); 76 m_window.setBorderWidth(m_theme->border().width());
76 m_window.setBorderColor(m_theme->border().color()); 77 m_window.setBorderColor(m_theme->border().color());
77 m_window.setAlpha(alpha); 78 m_window.setAlpha(alpha);
78 update(0); 79 update();
79 } 80 }
80 void updateSizing() { m_window.setBorderWidth(m_theme->border().width()); } 81 void updateSizing() { m_window.setBorderWidth(m_theme->border().width()); }
81 82
@@ -85,7 +86,7 @@ public:
85 86
86private: 87private:
87 88
88 void update(FbTk::Subject *subj); 89 void update();
89 90
90 typedef std::list<TrayWindow *> ClientList; 91 typedef std::list<TrayWindow *> ClientList;
91 ClientList::iterator findClient(Window win); 92 ClientList::iterator findClient(Window win);
@@ -108,7 +109,7 @@ private:
108 // gaim/pidgin seems to barf if the selection is not an independent window. 109 // gaim/pidgin seems to barf if the selection is not an independent window.
109 // I suspect it's an interacton with parent relationship and gdk window caching. 110 // I suspect it's an interacton with parent relationship and gdk window caching.
110 FbTk::FbWindow m_selection_owner; 111 FbTk::FbWindow m_selection_owner;
111 112 std::auto_ptr<FbTk::Observer> m_observer;
112}; 113};
113 114
114#endif // SYSTEMTRAY_HH 115#endif // SYSTEMTRAY_HH