aboutsummaryrefslogtreecommitdiff
path: root/src/CurrentWindowCmd.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/CurrentWindowCmd.hh')
-rw-r--r--src/CurrentWindowCmd.hh26
1 files changed, 22 insertions, 4 deletions
diff --git a/src/CurrentWindowCmd.hh b/src/CurrentWindowCmd.hh
index 53dc7b8..e7370de 100644
--- a/src/CurrentWindowCmd.hh
+++ b/src/CurrentWindowCmd.hh
@@ -27,22 +27,30 @@
27 27
28#include "Command.hh" 28#include "Command.hh"
29#include "Window.hh" 29#include "Window.hh"
30#include "ClientPattern.hh"
30 31
31/// helper class for window commands 32/// helper class for window commands
32/// calls real_execute if there's a focused window or a window in button press/release window 33/// calls real_execute if there's a focused window or a window in button press/release window
33class WindowHelperCmd: public FbTk::Command { 34class WindowHelperCmd: public FbTk::Command {
34public: 35public:
35 explicit WindowHelperCmd(FluxboxWindow *win = 0): m_win(win) { } 36 explicit WindowHelperCmd() { }
36 37
37 void execute(); 38 void execute();
38 void execute(FluxboxWindow &fbwin);
39 39
40protected: 40protected:
41 FluxboxWindow &fbwindow(); 41 FluxboxWindow &fbwindow();
42 virtual void real_execute() = 0; 42 virtual void real_execute() = 0;
43};
43 44
44private: 45class WindowHelperBoolCmd: public FbTk::BoolCommand {
45 FluxboxWindow *m_win; 46public:
47 explicit WindowHelperBoolCmd() { }
48
49 bool bool_execute();
50
51protected:
52 FluxboxWindow &fbwindow();
53 virtual bool real_execute() = 0;
46}; 54};
47 55
48/// command that calls FluxboxWindow::<the function> on execute() 56/// command that calls FluxboxWindow::<the function> on execute()
@@ -221,4 +229,14 @@ private:
221 int m_focus, m_unfocus; 229 int m_focus, m_unfocus;
222 int m_relative, m_un_relative; 230 int m_relative, m_un_relative;
223}; 231};
232
233class MatchCmd: public WindowHelperBoolCmd {
234public:
235 MatchCmd(const std::string &pat): m_pat(pat.c_str()) { };
236protected:
237 bool real_execute();
238private:
239 ClientPattern m_pat;
240};
241
224#endif // CURRENTWINDOWCMD_HH 242#endif // CURRENTWINDOWCMD_HH