summaryrefslogtreecommitdiff
path: root/src/CurrentWindowCmd.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/CurrentWindowCmd.cc')
-rw-r--r--src/CurrentWindowCmd.cc40
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
39using FbTk::Command; 50using FbTk::Command;
40 51
41namespace { 52namespace {
@@ -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);
95REGISTER_COMMAND_PARSER(maximizevertical, createCurrentWindowCmd, void); 102REGISTER_COMMAND_PARSER(maximizevertical, createCurrentWindowCmd, void);
96REGISTER_COMMAND_PARSER(maximizehorizontal, createCurrentWindowCmd, void); 103REGISTER_COMMAND_PARSER(maximizehorizontal, createCurrentWindowCmd, void);
97REGISTER_COMMAND_PARSER(raise, createCurrentWindowCmd, void); 104REGISTER_COMMAND_PARSER(raise, createCurrentWindowCmd, void);
98REGISTER_COMMAND_PARSER(raiselayer, createCurrentWindowCmd, void);
99REGISTER_COMMAND_PARSER(lower, createCurrentWindowCmd, void); 105REGISTER_COMMAND_PARSER(lower, createCurrentWindowCmd, void);
100REGISTER_COMMAND_PARSER(lowerlayer, createCurrentWindowCmd, void);
101REGISTER_COMMAND_PARSER(close, createCurrentWindowCmd, void); 106REGISTER_COMMAND_PARSER(close, createCurrentWindowCmd, void);
102REGISTER_COMMAND_PARSER(killwindow, createCurrentWindowCmd, void); 107REGISTER_COMMAND_PARSER(killwindow, createCurrentWindowCmd, void);
103REGISTER_COMMAND_PARSER(kill, createCurrentWindowCmd, void); 108REGISTER_COMMAND_PARSER(kill, createCurrentWindowCmd, void);
@@ -115,7 +120,7 @@ REGISTER_COMMAND_PARSER(movetabright, createCurrentWindowCmd, void);
115REGISTER_COMMAND_PARSER(detachclient, createCurrentWindowCmd, void); 120REGISTER_COMMAND_PARSER(detachclient, createCurrentWindowCmd, void);
116REGISTER_COMMAND_PARSER(windowmenu, createCurrentWindowCmd, void); 121REGISTER_COMMAND_PARSER(windowmenu, createCurrentWindowCmd, void);
117 122
118}; // end anonymous namespace 123} // end anonymous namespace
119 124
120void WindowHelperCmd::execute() { 125void 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,
207REGISTER_COMMAND_PARSER(activate, parseFocusCmd, void); 212REGISTER_COMMAND_PARSER(activate, parseFocusCmd, void);
208REGISTER_COMMAND_PARSER(focus, parseFocusCmd, void); 213REGISTER_COMMAND_PARSER(focus, parseFocusCmd, void);
209 214
210}; // end anonymous namespace 215} // end anonymous namespace
211 216
212void SetHeadCmd::real_execute() { 217void 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
474FbTk::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
486REGISTER_COMMAND_PARSER(raiselayer, ChangeLayerCmd::parse, void);
487REGISTER_COMMAND_PARSER(lowerlayer, ChangeLayerCmd::parse, void);
488
489void ChangeLayerCmd::real_execute() {
490 fbwindow().changeLayer(m_diff);
491}
492
469namespace { 493namespace {
470class SetTitleDialog: public TextDialog, public FbTk::Observer { 494class SetTitleDialog: public TextDialog, public FbTk::Observer {
471public: 495public: