diff options
Diffstat (limited to 'src/FocusableList.cc')
-rw-r--r-- | src/FocusableList.cc | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/FocusableList.cc b/src/FocusableList.cc index 258a43b..d15e10a 100644 --- a/src/FocusableList.cc +++ b/src/FocusableList.cc | |||
@@ -31,6 +31,12 @@ | |||
31 | 31 | ||
32 | #include <vector> | 32 | #include <vector> |
33 | 33 | ||
34 | #ifdef HAVE_CSTRING | ||
35 | #include <cstring> | ||
36 | #else | ||
37 | #include <string.h> | ||
38 | #endif | ||
39 | |||
34 | using std::string; | 40 | using std::string; |
35 | using std::vector; | 41 | using std::vector; |
36 | 42 | ||
@@ -280,10 +286,19 @@ void FocusableList::reset() { | |||
280 | 286 | ||
281 | bool FocusableList::contains(const Focusable &win) const { | 287 | bool FocusableList::contains(const Focusable &win) const { |
282 | Focusables::const_iterator it = m_list.begin(), it_end = m_list.end(); | 288 | Focusables::const_iterator it = m_list.begin(), it_end = m_list.end(); |
283 | it = find(it, it_end, &win); | 289 | it = std::find(it, it_end, &win); |
284 | return (it != it_end); | 290 | return (it != it_end); |
285 | } | 291 | } |
286 | 292 | ||
293 | Focusable *FocusableList::find(const ClientPattern &pat) const { | ||
294 | Focusables::const_iterator it = m_list.begin(), it_end = m_list.end(); | ||
295 | for (; it != it_end; ++it) { | ||
296 | if (pat.match(**it)) | ||
297 | return *it; | ||
298 | } | ||
299 | return 0; | ||
300 | } | ||
301 | |||
287 | void FocusableList::attachChild(FocusableList &child) const { | 302 | void FocusableList::attachChild(FocusableList &child) const { |
288 | m_addsig.attach(&child); | 303 | m_addsig.attach(&child); |
289 | m_removesig.attach(&child); | 304 | m_removesig.attach(&child); |