aboutsummaryrefslogtreecommitdiff
path: root/src/FbCommandFactory.cc
diff options
context:
space:
mode:
authormarkt <markt>2007-10-22 17:45:39 (GMT)
committermarkt <markt>2007-10-22 17:45:39 (GMT)
commitc6a2605d76927eed881e4ff9df58a9ec600bf4a2 (patch)
tree468c356ffdad6893d4f4b312f847122b66c997ed /src/FbCommandFactory.cc
parentf72633a0e0df146c4860b5b3940e9c3a2f7260b1 (diff)
downloadfluxbox-c6a2605d76927eed881e4ff9df58a9ec600bf4a2.zip
fluxbox-c6a2605d76927eed881e4ff9df58a9ec600bf4a2.tar.bz2
replaced ModKey with new key commands StartMoving and StartResizing
Diffstat (limited to 'src/FbCommandFactory.cc')
-rw-r--r--src/FbCommandFactory.cc45
1 files changed, 35 insertions, 10 deletions
diff --git a/src/FbCommandFactory.cc b/src/FbCommandFactory.cc
index bf008ad..be37403 100644
--- a/src/FbCommandFactory.cc
+++ b/src/FbCommandFactory.cc
@@ -158,7 +158,6 @@ FbCommandFactory::FbCommandFactory() {
158 "setalpha", 158 "setalpha",
159 "setenv", 159 "setenv",
160 "sethead", 160 "sethead",
161 "setmodkey",
162 "setstyle", 161 "setstyle",
163 "setworkspacename", 162 "setworkspacename",
164 "setworkspacenamedialog", 163 "setworkspacenamedialog",
@@ -167,6 +166,8 @@ FbCommandFactory::FbCommandFactory() {
167 "shade", 166 "shade",
168 "shadewindow", 167 "shadewindow",
169 "showdesktop", 168 "showdesktop",
169 "startmoving",
170 "startresizing",
170 "stick", 171 "stick",
171 "stickwindow", 172 "stickwindow",
172 "tab", 173 "tab",
@@ -235,15 +236,7 @@ FbTk::Command *FbCommandFactory::stringToCommand(const std::string &command,
235 string value = name.substr(pos + 1); 236 string value = name.substr(pos + 1);
236 name = name.substr(0, pos); 237 name = name.substr(0, pos);
237 return new ExportCmd(name, value); 238 return new ExportCmd(name, value);
238 } 239 } else if (command == "commanddialog") // run specified fluxbox command
239 else if (command == "setmodkey") {
240 string modkey(arguments);
241 FbTk::StringUtil::removeFirstWhitespace(modkey);
242 FbTk::StringUtil::removeTrailingWhitespace(modkey);
243
244 return new SetModKeyCmd(modkey);
245 }
246 else if (command == "commanddialog") // run specified fluxbox command
247 return new CommandDialogCmd(); 240 return new CommandDialogCmd();
248 else if (command == "bindkey" && trusted) 241 else if (command == "bindkey" && trusted)
249 return new BindKeyCmd(arguments); 242 return new BindKeyCmd(arguments);
@@ -307,6 +300,38 @@ FbTk::Command *FbCommandFactory::stringToCommand(const std::string &command,
307 pat = arguments.c_str() + pos; 300 pat = arguments.c_str() + pos;
308 301
309 return new WindowListCmd(FbTk::RefCount<WindowHelperCmd>(new SetAlphaCmd(focused, relative, unfocused, un_rel)), pat); 302 return new WindowListCmd(FbTk::RefCount<WindowHelperCmd>(new SetAlphaCmd(focused, relative, unfocused, un_rel)), pat);
303 } else if (command == "startmoving")
304 return new StartMovingCmd();
305 else if (command == "startresizing") {
306 FluxboxWindow::ResizeModel mode = FluxboxWindow::DEFAULTRESIZE;
307 vector<string> tokens;
308 FbTk::StringUtil::stringtok<vector<string> >(tokens, arguments);
309 if (!tokens.empty()) {
310 string arg = FbTk::StringUtil::toLower(tokens[0]);
311 if (arg == "nearestcorner")
312 mode = FluxboxWindow::QUADRANTRESIZE;
313 else if (arg == "nearestedge")
314 mode = FluxboxWindow::NEARESTEDGERESIZE;
315 else if (arg == "center")
316 mode = FluxboxWindow::CENTERRESIZE;
317 else if (arg == "topleft")
318 mode = FluxboxWindow::TOPLEFTRESIZE;
319 else if (arg == "top")
320 mode = FluxboxWindow::TOPRESIZE;
321 else if (arg == "topright")
322 mode = FluxboxWindow::TOPRIGHTRESIZE;
323 else if (arg == "left")
324 mode = FluxboxWindow::LEFTRESIZE;
325 else if (arg == "right")
326 mode = FluxboxWindow::RIGHTRESIZE;
327 else if (arg == "bottomleft")
328 mode = FluxboxWindow::BOTTOMLEFTRESIZE;
329 else if (arg == "bottom")
330 mode = FluxboxWindow::BOTTOMRESIZE;
331 else if (arg == "bottomright")
332 mode = FluxboxWindow::BOTTOMRIGHTRESIZE;
333 }
334 return new StartResizingCmd(mode);
310 } else if (command == "resize" || command == "resizeto" || 335 } else if (command == "resize" || command == "resizeto" ||
311 command == "resizehorizontal" || command == "resizevertical") { 336 command == "resizehorizontal" || command == "resizevertical") {
312 FbTk_istringstream is(arguments.c_str()); 337 FbTk_istringstream is(arguments.c_str());