diff options
author | Henrik Kinnunen <fluxgen@fluxbox.org> | 2010-03-18 18:41:35 (GMT) |
---|---|---|
committer | Henrik Kinnunen <fluxgen@fluxbox.org> | 2010-03-18 18:41:35 (GMT) |
commit | 6ed8369d57e8d3144805235fb7aeca63993742af (patch) | |
tree | 914bfd1a4fdc341d5c8aa1fc57e6297c7f8887f0 /src/Focusable.hh | |
parent | 02bb93590c69b619150735f026f7719df2e5c271 (diff) | |
download | fluxbox-6ed8369d57e8d3144805235fb7aeca63993742af.zip fluxbox-6ed8369d57e8d3144805235fb7aeca63993742af.tar.bz2 |
Changed Focusable::focusSig() to new signal system.
The focus signal emits the window that had the focus status changed.
Diffstat (limited to 'src/Focusable.hh')
-rw-r--r-- | src/Focusable.hh | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/Focusable.hh b/src/Focusable.hh index 453a114..6108ed9 100644 --- a/src/Focusable.hh +++ b/src/Focusable.hh | |||
@@ -25,6 +25,7 @@ | |||
25 | #include "FbTk/PixmapWithMask.hh" | 25 | #include "FbTk/PixmapWithMask.hh" |
26 | #include "FbTk/ITypeAheadable.hh" | 26 | #include "FbTk/ITypeAheadable.hh" |
27 | #include "FbTk/Subject.hh" | 27 | #include "FbTk/Subject.hh" |
28 | #include "FbTk/Signal.hh" | ||
28 | 29 | ||
29 | #include <string> | 30 | #include <string> |
30 | 31 | ||
@@ -41,8 +42,9 @@ public: | |||
41 | m_screen(scr), m_fbwin(fbwin), | 42 | m_screen(scr), m_fbwin(fbwin), |
42 | m_instance_name("fluxbox"), m_class_name("fluxbox"), | 43 | m_instance_name("fluxbox"), m_class_name("fluxbox"), |
43 | m_focused(false), m_attention_state(false), | 44 | m_focused(false), m_attention_state(false), |
44 | m_titlesig(*this), m_focussig(*this), m_diesig(*this), | 45 | m_titlesig(*this), m_diesig(*this), |
45 | m_attentionsig(*this) { } | 46 | m_attentionsig(*this), |
47 | m_focussig() { } | ||
46 | virtual ~Focusable() { } | 48 | virtual ~Focusable() { } |
47 | 49 | ||
48 | /** | 50 | /** |
@@ -118,14 +120,19 @@ public: | |||
118 | FbTk::Subject &titleSig() { return m_titlesig; } | 120 | FbTk::Subject &titleSig() { return m_titlesig; } |
119 | // Used for both title and icon changes. | 121 | // Used for both title and icon changes. |
120 | const FbTk::Subject &titleSig() const { return m_titlesig; } | 122 | const FbTk::Subject &titleSig() const { return m_titlesig; } |
121 | FbTk::Subject &focusSig() { return m_focussig; } | 123 | FbTk::Signal<void, Focusable&> &focusSig() { return m_focussig; } |
122 | const FbTk::Subject &focusSig() const { return m_focussig; } | 124 | const FbTk::Signal<void, Focusable&> &focusSig() const { return m_focussig; } |
123 | FbTk::Subject &dieSig() { return m_diesig; } | 125 | FbTk::Subject &dieSig() { return m_diesig; } |
124 | const FbTk::Subject &dieSig() const { return m_diesig; } | 126 | const FbTk::Subject &dieSig() const { return m_diesig; } |
125 | FbTk::Subject &attentionSig() { return m_attentionsig; } | 127 | FbTk::Subject &attentionSig() { return m_attentionsig; } |
126 | const FbTk::Subject &attentionSig() const { return m_attentionsig; } | 128 | const FbTk::Subject &attentionSig() const { return m_attentionsig; } |
127 | /** @} */ // end group signals | 129 | /** @} */ // end group signals |
128 | 130 | ||
131 | /// Notify any listeners that the focus changed for this window. | ||
132 | void notifyFocusChanged() { | ||
133 | m_focussig.emit(*this); | ||
134 | } | ||
135 | |||
129 | protected: | 136 | protected: |
130 | BScreen &m_screen; //< the screen in which it works | 137 | BScreen &m_screen; //< the screen in which it works |
131 | FluxboxWindow *m_fbwin; //< the working fluxbox window | 138 | FluxboxWindow *m_fbwin; //< the working fluxbox window |
@@ -136,7 +143,10 @@ protected: | |||
136 | FbTk::PixmapWithMask m_icon; //< icon pixmap with mask | 143 | FbTk::PixmapWithMask m_icon; //< icon pixmap with mask |
137 | 144 | ||
138 | // state and hint signals | 145 | // state and hint signals |
139 | FocusSubject m_titlesig, m_focussig, m_diesig, m_attentionsig; | 146 | FocusSubject m_titlesig, m_diesig, m_attentionsig; |
147 | |||
148 | private: | ||
149 | FbTk::Signal<void, Focusable&> m_focussig; | ||
140 | }; | 150 | }; |
141 | 151 | ||
142 | #endif // FOCUSABLE_HH | 152 | #endif // FOCUSABLE_HH |