diff options
Diffstat (limited to 'src/CurrentWindowCmd.hh')
-rw-r--r-- | src/CurrentWindowCmd.hh | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/src/CurrentWindowCmd.hh b/src/CurrentWindowCmd.hh index c1b9140..172f9c0 100644 --- a/src/CurrentWindowCmd.hh +++ b/src/CurrentWindowCmd.hh | |||
@@ -28,36 +28,33 @@ | |||
28 | #include "Command.hh" | 28 | #include "Command.hh" |
29 | 29 | ||
30 | class FluxboxWindow; | 30 | class FluxboxWindow; |
31 | class WinClient; | ||
32 | |||
33 | /// command that calls FluxboxWindow::<the function> on execute() | ||
34 | /// similar to FbTk::SimpleCommand<T> | ||
35 | class CurrentWindowCmd: public FbTk::Command { | ||
36 | public: | ||
37 | typedef void (FluxboxWindow::* Action)(); | ||
38 | explicit CurrentWindowCmd(Action action); | ||
39 | void execute(); | ||
40 | private: | ||
41 | Action m_action; | ||
42 | }; | ||
43 | 31 | ||
44 | /// helper class for window commands | 32 | /// helper class for window commands |
45 | /// 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 |
46 | class WindowHelperCmd: public FbTk::Command { | 34 | class WindowHelperCmd: public FbTk::Command { |
47 | public: | 35 | public: |
36 | explicit WindowHelperCmd(FluxboxWindow *win = 0): m_win(win) { } | ||
37 | |||
48 | void execute(); | 38 | void execute(); |
39 | void execute(FluxboxWindow &fbwin); | ||
49 | 40 | ||
50 | protected: | 41 | protected: |
51 | |||
52 | WinClient &winclient(); | ||
53 | FluxboxWindow &fbwindow(); | 42 | FluxboxWindow &fbwindow(); |
54 | virtual void real_execute() = 0; | 43 | virtual void real_execute() = 0; |
55 | 44 | ||
45 | private: | ||
46 | FluxboxWindow *m_win; | ||
56 | }; | 47 | }; |
57 | 48 | ||
58 | class KillWindowCmd: public WindowHelperCmd { | 49 | /// command that calls FluxboxWindow::<the function> on execute() |
59 | protected: | 50 | /// similar to FbTk::SimpleCommand<T> |
51 | class CurrentWindowCmd: public WindowHelperCmd { | ||
52 | public: | ||
53 | typedef void (FluxboxWindow::* Action)(); | ||
54 | explicit CurrentWindowCmd(Action action): m_action(action) { } | ||
60 | void real_execute(); | 55 | void real_execute(); |
56 | private: | ||
57 | Action m_action; | ||
61 | }; | 58 | }; |
62 | 59 | ||
63 | class SetHeadCmd : public WindowHelperCmd { | 60 | class SetHeadCmd : public WindowHelperCmd { |