aboutsummaryrefslogtreecommitdiff
path: root/src/WorkspaceCmd.cc
diff options
context:
space:
mode:
authormarkt <markt>2007-11-22 04:07:57 (GMT)
committermarkt <markt>2007-11-22 04:07:57 (GMT)
commit675bc5d66aa08311e99cb00cf836d16a910a73df (patch)
tree9118f77bcc38631f944cdf4a07d2173011a29a9b /src/WorkspaceCmd.cc
parent08ebff4b319f51b4263cded0bb9c04103bcd9c3a (diff)
downloadfluxbox-675bc5d66aa08311e99cb00cf836d16a910a73df.zip
fluxbox-675bc5d66aa08311e99cb00cf836d16a910a73df.tar.bz2
added conditional statements to keys file
Diffstat (limited to 'src/WorkspaceCmd.cc')
-rw-r--r--src/WorkspaceCmd.cc49
1 files changed, 47 insertions, 2 deletions
diff --git a/src/WorkspaceCmd.cc b/src/WorkspaceCmd.cc
index 79ceb40..26f113d 100644
--- a/src/WorkspaceCmd.cc
+++ b/src/WorkspaceCmd.cc
@@ -30,6 +30,7 @@
30#include "fluxbox.hh" 30#include "fluxbox.hh"
31#include "WinClient.hh" 31#include "WinClient.hh"
32#include "FocusControl.hh" 32#include "FocusControl.hh"
33#include "WindowCmd.hh"
33 34
34#include "FbTk/KeyUtil.hh" 35#include "FbTk/KeyUtil.hh"
35 36
@@ -54,10 +55,54 @@ void WindowListCmd::execute() {
54 FocusControl::Focusables::iterator it = win_list.begin(), 55 FocusControl::Focusables::iterator it = win_list.begin(),
55 it_end = win_list.end(); 56 it_end = win_list.end();
56 for (; it != it_end; ++it) { 57 for (; it != it_end; ++it) {
57 if (m_pat.match(**it) && (*it)->fbwindow()) 58 if (m_pat.match(**it) && (*it)->fbwindow()) {
58 m_cmd->execute(*(*it)->fbwindow()); 59 WindowCmd<void>::setWindow((*it)->fbwindow());
60 m_cmd->execute();
61 }
62 }
63 }
64}
65
66bool SomeCmd::bool_execute() {
67 if (m_pat.error())
68 return m_cmd->bool_execute();
69
70 BScreen *screen = Fluxbox::instance()->keyScreen();
71 if (screen != 0) {
72 FocusControl::Focusables win_list(screen->focusControl().creationOrderList().clientList());
73
74 FocusControl::Focusables::iterator it = win_list.begin(),
75 it_end = win_list.end();
76 for (; it != it_end; ++it) {
77 WinClient *client = dynamic_cast<WinClient *>(*it);
78 if (!client) continue;
79 WindowCmd<void>::setClient(client);
80 if (m_cmd->bool_execute())
81 return true;
82 }
83 }
84 return false;
85}
86
87bool EveryCmd::bool_execute() {
88 if (m_pat.error())
89 return m_cmd->bool_execute();
90
91 BScreen *screen = Fluxbox::instance()->keyScreen();
92 if (screen != 0) {
93 FocusControl::Focusables win_list(screen->focusControl().creationOrderList().clientList());
94
95 FocusControl::Focusables::iterator it = win_list.begin(),
96 it_end = win_list.end();
97 for (; it != it_end; ++it) {
98 WinClient *client = dynamic_cast<WinClient *>(*it);
99 if (!client) continue;
100 WindowCmd<void>::setClient(client);
101 if (!m_cmd->bool_execute())
102 return false;
59 } 103 }
60 } 104 }
105 return true;
61} 106}
62 107
63void AttachCmd::execute() { 108void AttachCmd::execute() {