diff options
Diffstat (limited to 'src/CurrentWindowCmd.cc')
-rw-r--r-- | src/CurrentWindowCmd.cc | 40 |
1 files changed, 32 insertions, 8 deletions
diff --git a/src/CurrentWindowCmd.cc b/src/CurrentWindowCmd.cc index dfb5c19..b73de01 100644 --- a/src/CurrentWindowCmd.cc +++ b/src/CurrentWindowCmd.cc | |||
@@ -36,6 +36,17 @@ | |||
36 | #include "FbTk/stringstream.hh" | 36 | #include "FbTk/stringstream.hh" |
37 | #include "FbTk/StringUtil.hh" | 37 | #include "FbTk/StringUtil.hh" |
38 | 38 | ||
39 | #ifdef HAVE_CONFIG_H | ||
40 | #include "config.h" | ||
41 | #endif // HAVE_CONFIG_H | ||
42 | |||
43 | #ifdef HAVE_CSTDLIB | ||
44 | #include <cstdlib> | ||
45 | #else | ||
46 | #include <stdlib.h> | ||
47 | #endif | ||
48 | |||
49 | |||
39 | using FbTk::Command; | 50 | using FbTk::Command; |
40 | 51 | ||
41 | namespace { | 52 | namespace { |
@@ -52,12 +63,8 @@ FbTk::Command<void> *createCurrentWindowCmd(const std::string &command, | |||
52 | return new CurrentWindowCmd(&FluxboxWindow::maximizeHorizontal); | 63 | return new CurrentWindowCmd(&FluxboxWindow::maximizeHorizontal); |
53 | else if (command == "raise") | 64 | else if (command == "raise") |
54 | return new CurrentWindowCmd(&FluxboxWindow::raise); | 65 | return new CurrentWindowCmd(&FluxboxWindow::raise); |
55 | else if (command == "raiselayer") | ||
56 | return new CurrentWindowCmd(&FluxboxWindow::raiseLayer); | ||
57 | else if (command == "lower") | 66 | else if (command == "lower") |
58 | return new CurrentWindowCmd(&FluxboxWindow::lower); | 67 | return new CurrentWindowCmd(&FluxboxWindow::lower); |
59 | else if (command == "lowerlayer") | ||
60 | return new CurrentWindowCmd(&FluxboxWindow::lowerLayer); | ||
61 | else if (command == "close") | 68 | else if (command == "close") |
62 | return new CurrentWindowCmd(&FluxboxWindow::close); | 69 | return new CurrentWindowCmd(&FluxboxWindow::close); |
63 | else if (command == "killwindow" || command == "kill") | 70 | else if (command == "killwindow" || command == "kill") |
@@ -95,9 +102,7 @@ REGISTER_COMMAND_PARSER(maximize, createCurrentWindowCmd, void); | |||
95 | REGISTER_COMMAND_PARSER(maximizevertical, createCurrentWindowCmd, void); | 102 | REGISTER_COMMAND_PARSER(maximizevertical, createCurrentWindowCmd, void); |
96 | REGISTER_COMMAND_PARSER(maximizehorizontal, createCurrentWindowCmd, void); | 103 | REGISTER_COMMAND_PARSER(maximizehorizontal, createCurrentWindowCmd, void); |
97 | REGISTER_COMMAND_PARSER(raise, createCurrentWindowCmd, void); | 104 | REGISTER_COMMAND_PARSER(raise, createCurrentWindowCmd, void); |
98 | REGISTER_COMMAND_PARSER(raiselayer, createCurrentWindowCmd, void); | ||
99 | REGISTER_COMMAND_PARSER(lower, createCurrentWindowCmd, void); | 105 | REGISTER_COMMAND_PARSER(lower, createCurrentWindowCmd, void); |
100 | REGISTER_COMMAND_PARSER(lowerlayer, createCurrentWindowCmd, void); | ||
101 | REGISTER_COMMAND_PARSER(close, createCurrentWindowCmd, void); | 106 | REGISTER_COMMAND_PARSER(close, createCurrentWindowCmd, void); |
102 | REGISTER_COMMAND_PARSER(killwindow, createCurrentWindowCmd, void); | 107 | REGISTER_COMMAND_PARSER(killwindow, createCurrentWindowCmd, void); |
103 | REGISTER_COMMAND_PARSER(kill, createCurrentWindowCmd, void); | 108 | REGISTER_COMMAND_PARSER(kill, createCurrentWindowCmd, void); |
@@ -115,7 +120,7 @@ REGISTER_COMMAND_PARSER(movetabright, createCurrentWindowCmd, void); | |||
115 | REGISTER_COMMAND_PARSER(detachclient, createCurrentWindowCmd, void); | 120 | REGISTER_COMMAND_PARSER(detachclient, createCurrentWindowCmd, void); |
116 | REGISTER_COMMAND_PARSER(windowmenu, createCurrentWindowCmd, void); | 121 | REGISTER_COMMAND_PARSER(windowmenu, createCurrentWindowCmd, void); |
117 | 122 | ||
118 | }; // end anonymous namespace | 123 | } // end anonymous namespace |
119 | 124 | ||
120 | void WindowHelperCmd::execute() { | 125 | void WindowHelperCmd::execute() { |
121 | if (WindowCmd<void>::window() || FocusControl::focusedFbWindow()) | 126 | if (WindowCmd<void>::window() || FocusControl::focusedFbWindow()) |
@@ -207,7 +212,7 @@ FbTk::Command<void> *parseFocusCmd(const string &command, const string &args, | |||
207 | REGISTER_COMMAND_PARSER(activate, parseFocusCmd, void); | 212 | REGISTER_COMMAND_PARSER(activate, parseFocusCmd, void); |
208 | REGISTER_COMMAND_PARSER(focus, parseFocusCmd, void); | 213 | REGISTER_COMMAND_PARSER(focus, parseFocusCmd, void); |
209 | 214 | ||
210 | }; // end anonymous namespace | 215 | } // end anonymous namespace |
211 | 216 | ||
212 | void SetHeadCmd::real_execute() { | 217 | void SetHeadCmd::real_execute() { |
213 | int num = m_head; | 218 | int num = m_head; |
@@ -466,6 +471,25 @@ void SetLayerCmd::real_execute() { | |||
466 | fbwindow().moveToLayer(m_layer); | 471 | fbwindow().moveToLayer(m_layer); |
467 | } | 472 | } |
468 | 473 | ||
474 | FbTk::Command<void> *ChangeLayerCmd::parse(const string &command, | ||
475 | const string &args, bool trusted) { | ||
476 | int num = 2; | ||
477 | FbTk_istringstream iss(args.c_str()); | ||
478 | iss >> num; | ||
479 | if (command == "raiselayer") | ||
480 | return new ChangeLayerCmd(-num); | ||
481 | else if (command == "lowerlayer") | ||
482 | return new ChangeLayerCmd(num); | ||
483 | return 0; | ||
484 | } | ||
485 | |||
486 | REGISTER_COMMAND_PARSER(raiselayer, ChangeLayerCmd::parse, void); | ||
487 | REGISTER_COMMAND_PARSER(lowerlayer, ChangeLayerCmd::parse, void); | ||
488 | |||
489 | void ChangeLayerCmd::real_execute() { | ||
490 | fbwindow().changeLayer(m_diff); | ||
491 | } | ||
492 | |||
469 | namespace { | 493 | namespace { |
470 | class SetTitleDialog: public TextDialog, public FbTk::Observer { | 494 | class SetTitleDialog: public TextDialog, public FbTk::Observer { |
471 | public: | 495 | public: |