aboutsummaryrefslogtreecommitdiff
path: root/src/FbCommandFactory.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbCommandFactory.cc')
-rw-r--r--src/FbCommandFactory.cc25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/FbCommandFactory.cc b/src/FbCommandFactory.cc
index ece8c9e..b82332a 100644
--- a/src/FbCommandFactory.cc
+++ b/src/FbCommandFactory.cc
@@ -123,6 +123,7 @@ FbCommandFactory::FbCommandFactory() {
123 "sendtoworkspace", 123 "sendtoworkspace",
124 "sendtonextworkspace", 124 "sendtonextworkspace",
125 "sendtoprevworkspace", 125 "sendtoprevworkspace",
126 "setalpha",
126 "setenv", 127 "setenv",
127 "sethead", 128 "sethead",
128 "setmodkey", 129 "setmodkey",
@@ -247,7 +248,29 @@ FbTk::Command *FbCommandFactory::stringToCommand(const std::string &command,
247 return new CurrentWindowCmd(&FluxboxWindow::maximizeVertical); 248 return new CurrentWindowCmd(&FluxboxWindow::maximizeVertical);
248 else if (command == "maximizehorizontal") 249 else if (command == "maximizehorizontal")
249 return new CurrentWindowCmd(&FluxboxWindow::maximizeHorizontal); 250 return new CurrentWindowCmd(&FluxboxWindow::maximizeHorizontal);
250 else if (command == "resize") { 251 else if (command == "setalpha") {
252 typedef vector<string> StringTokens;
253 StringTokens tokens;
254 FbTk::StringUtil::stringtok<StringTokens>(tokens, arguments);
255
256 int focused, unfocused;
257 bool relative, un_rel;
258
259 if (tokens.empty()) { // set default alpha
260 focused = unfocused = 256;
261 relative = un_rel = false;
262 } else {
263 relative = un_rel = (tokens[0][0] == '+' || tokens[0][0] == '-');
264 focused = unfocused = atoi(tokens[0].c_str());
265 }
266
267 if (tokens.size() > 1) { // set different unfocused alpha
268 un_rel = (tokens[1][0] == '+' || tokens[1][0] == '-');
269 unfocused = atoi(tokens[1].c_str());
270 }
271
272 return new SetAlphaCmd(focused, relative, unfocused, un_rel);
273 } else if (command == "resize") {
251 FbTk_istringstream is(arguments.c_str()); 274 FbTk_istringstream is(arguments.c_str());
252 int dx = 0, dy = 0; 275 int dx = 0, dy = 0;
253 is >> dx >> dy; 276 is >> dx >> dy;