diff options
Diffstat (limited to 'src/FocusableList.hh')
-rw-r--r-- | src/FocusableList.hh | 33 |
1 files changed, 10 insertions, 23 deletions
diff --git a/src/FocusableList.hh b/src/FocusableList.hh index 6e46db9..29d536f 100644 --- a/src/FocusableList.hh +++ b/src/FocusableList.hh | |||
@@ -82,30 +82,12 @@ public: | |||
82 | @name signals | 82 | @name signals |
83 | @{ | 83 | @{ |
84 | */ | 84 | */ |
85 | FbTk::Subject &orderSig() { return m_ordersig; } | 85 | FbTk::Signal<Focusable *> &orderSig() { return m_ordersig; } |
86 | const FbTk::Subject &orderSig() const { return m_ordersig; } | 86 | FbTk::Signal<Focusable *> &addSig() { return m_addsig; } |
87 | FbTk::Subject &addSig() { return m_addsig; } | 87 | FbTk::Signal<Focusable *> &removeSig() { return m_removesig; } |
88 | const FbTk::Subject &addSig() const { return m_addsig; } | 88 | FbTk::Signal<> &resetSig() { return m_resetsig; } |
89 | FbTk::Subject &removeSig() { return m_removesig; } | ||
90 | const FbTk::Subject &removeSig() const { return m_removesig; } | ||
91 | FbTk::Subject &resetSig() { return m_resetsig; } | ||
92 | const FbTk::Subject &resetSig() const { return m_resetsig; } | ||
93 | /** @} */ // end group signals | 89 | /** @} */ // end group signals |
94 | 90 | ||
95 | /** | ||
96 | * Signaling object to attatch observers to. | ||
97 | */ | ||
98 | class FocusableListSubject: public FbTk::Subject { | ||
99 | public: | ||
100 | explicit FocusableListSubject(): m_win(0) { } | ||
101 | void notify(Focusable *win) { m_win = win; FbTk::Subject::notify(); } | ||
102 | /// @return context for this signal | ||
103 | Focusable *win() { return m_win; } | ||
104 | |||
105 | private: | ||
106 | Focusable *m_win; | ||
107 | }; | ||
108 | |||
109 | private: | 91 | private: |
110 | void init(); | 92 | void init(); |
111 | void addMatching(); | 93 | void addMatching(); |
@@ -120,13 +102,18 @@ private: | |||
120 | /// Title has changed for a window | 102 | /// Title has changed for a window |
121 | /// @param win The window that title changed for. | 103 | /// @param win The window that title changed for. |
122 | void updateTitle(Focusable& win); | 104 | void updateTitle(Focusable& win); |
105 | void parentOrderChanged(Focusable* win); | ||
106 | void parentWindowAdded(Focusable* win); | ||
107 | void parentWindowRemoved(Focusable* win); | ||
108 | |||
123 | 109 | ||
124 | std::auto_ptr<ClientPattern> m_pat; | 110 | std::auto_ptr<ClientPattern> m_pat; |
125 | const FocusableList *m_parent; | 111 | const FocusableList *m_parent; |
126 | BScreen &m_screen; | 112 | BScreen &m_screen; |
127 | std::list<Focusable *> m_list; | 113 | std::list<Focusable *> m_list; |
128 | 114 | ||
129 | mutable FocusableListSubject m_ordersig, m_addsig, m_removesig, m_resetsig; | 115 | mutable FbTk::Signal<Focusable *> m_ordersig, m_addsig, m_removesig; |
116 | mutable FbTk::Signal<> m_resetsig; | ||
130 | typedef std::map<Focusable*, FbTk::RefCount<FbTk::SignalTracker> > SignalMap; | 117 | typedef std::map<Focusable*, FbTk::RefCount<FbTk::SignalTracker> > SignalMap; |
131 | SignalMap m_signal_map; | 118 | SignalMap m_signal_map; |
132 | }; | 119 | }; |