aboutsummaryrefslogtreecommitdiff
path: root/src/FbCommandFactory.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-09-10 14:07:48 (GMT)
committerfluxgen <fluxgen>2003-09-10 14:07:48 (GMT)
commitb78edef5b6e39822142dd91331a53ab38b147f05 (patch)
treea2842f409b3032f0aa041e14a0558718af023270 /src/FbCommandFactory.cc
parent90eb966c41af507c2995804213ec33ba833529cc (diff)
downloadfluxbox_pavel-b78edef5b6e39822142dd91331a53ab38b147f05.zip
fluxbox_pavel-b78edef5b6e39822142dd91331a53ab38b147f05.tar.bz2
added move command, thanks Mathias Gumz
Diffstat (limited to 'src/FbCommandFactory.cc')
-rw-r--r--src/FbCommandFactory.cc27
1 files changed, 17 insertions, 10 deletions
diff --git a/src/FbCommandFactory.cc b/src/FbCommandFactory.cc
index f9e22ce..d7bea89 100644
--- a/src/FbCommandFactory.cc
+++ b/src/FbCommandFactory.cc
@@ -20,7 +20,7 @@
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21// DEALINGS IN THE SOFTWARE. 21// DEALINGS IN THE SOFTWARE.
22 22
23// $Id: FbCommandFactory.cc,v 1.15 2003/09/06 15:43:27 fluxgen Exp $ 23// $Id: FbCommandFactory.cc,v 1.16 2003/09/10 14:06:37 fluxgen Exp $
24 24
25#include "FbCommandFactory.hh" 25#include "FbCommandFactory.hh"
26 26
@@ -40,7 +40,7 @@ FbCommandFactory FbCommandFactory::s_autoreg;
40 40
41FbCommandFactory::FbCommandFactory() { 41FbCommandFactory::FbCommandFactory() {
42 // setup commands that we can handle 42 // setup commands that we can handle
43 const char commands[][33] = { 43 const char commands[][52] = {
44 "arrangewindows", 44 "arrangewindows",
45 "close", 45 "close",
46 "detachclient", 46 "detachclient",
@@ -57,6 +57,7 @@ FbCommandFactory::FbCommandFactory() {
57 "maximizewindow", 57 "maximizewindow",
58 "minimize", 58 "minimize",
59 "minimizewindow", 59 "minimizewindow",
60 "move",
60 "movedown", 61 "movedown",
61 "moveleft", 62 "moveleft",
62 "moveright", 63 "moveright",
@@ -133,23 +134,29 @@ FbTk::Command *FbCommandFactory::stringToCommand(const std::string &command,
133 else if (command == "maximizehorizontal") 134 else if (command == "maximizehorizontal")
134 return new CurrentWindowCmd(&FluxboxWindow::maximizeHorizontal); 135 return new CurrentWindowCmd(&FluxboxWindow::maximizeHorizontal);
135 else if (command == "resize") { 136 else if (command == "resize") {
136 std::istringstream is(arguments); 137 std::istringstream is(arguments);
137 int dx = 0, dy = 0; 138 int dx = 0, dy = 0;
138 is >> dx >> dy; 139 is >> dx >> dy;
139 return new ResizeCmd(dx, dy); 140 return new ResizeCmd(dx, dy);
140 } 141 }
141 else if (command == "resizehorizontal") 142 else if (command == "resizehorizontal")
142 return new ResizeCmd(atoi(arguments.c_str()),0); 143 return new ResizeCmd(atoi(arguments.c_str()),0);
143 else if (command == "resizevertical") 144 else if (command == "resizevertical")
144 return new ResizeCmd(0,atoi(arguments.c_str())); 145 return new ResizeCmd(0,atoi(arguments.c_str()));
146 else if (command == "move") {
147 std::istringstream is(arguments);
148 int dx = 0, dy = 0;
149 is >> dx >> dy;
150 return new MoveCmd(dx, dy);
151 }
145 else if (command == "moveright") 152 else if (command == "moveright")
146 return new MoveRightCmd(atoi(arguments.c_str())); 153 return new MoveCmd(atoi(arguments.c_str()),0);
147 else if (command == "moveleft") 154 else if (command == "moveleft")
148 return new MoveLeftCmd(atoi(arguments.c_str())); 155 return new MoveCmd(-atoi(arguments.c_str()),0);
149 else if (command == "moveup") 156 else if (command == "moveup")
150 return new MoveUpCmd(atoi(arguments.c_str())); 157 return new MoveCmd(0,-atoi(arguments.c_str()));
151 else if (command == "movedown") 158 else if (command == "movedown")
152 return new MoveDownCmd(atoi(arguments.c_str())); 159 return new MoveCmd(0,atoi(arguments.c_str()));
153 else if (command == "raise") 160 else if (command == "raise")
154 return new CurrentWindowCmd(&FluxboxWindow::raise); 161 return new CurrentWindowCmd(&FluxboxWindow::raise);
155 else if (command == "lower") 162 else if (command == "lower")