From f20bcea618d52659c60ce96e885d20f60b2367d5 Mon Sep 17 00:00:00 2001 From: fluxgen Date: Sat, 30 Aug 2003 11:59:29 +0000 Subject: added workspacemenu action, thanks Mathias Gumz --- src/FbCommandFactory.cc | 77 +++++++++++++++++++++++++------------------------ src/FbCommands.cc | 13 ++++++++- src/FbCommands.hh | 7 ++++- 3 files changed, 58 insertions(+), 39 deletions(-) diff --git a/src/FbCommandFactory.cc b/src/FbCommandFactory.cc index 237b16c..bdbe305 100644 --- a/src/FbCommandFactory.cc +++ b/src/FbCommandFactory.cc @@ -20,7 +20,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbCommandFactory.cc,v 1.13 2003/08/26 23:53:01 fluxgen Exp $ +// $Id: FbCommandFactory.cc,v 1.14 2003/08/30 11:59:29 fluxgen Exp $ #include "FbCommandFactory.hh" @@ -38,56 +38,57 @@ FbCommandFactory FbCommandFactory::s_autoreg; FbCommandFactory::FbCommandFactory() { // setup commands that we can handle - const char commands[][32] = { - "setstyle", - "saverc", - "reconfigure", - "execcommand", + const char commands[][33] = { + "arrangewindows", + "close", + "detachclient", "exec", + "execcommand", "execute", - "quit", - "restart", - "minimizewindow", - "minimize", "iconfiy", - "maximizewindow", + "killwindow", + "leftworkspace", + "lower", "maximize", - "maximizevertical", "maximizehorizontal", - "resizevertical", - "resizehorizontal", - "moveright", + "maximizevertical", + "maximizewindow", + "minimize", + "minimizewindow", + "movedown", "moveleft", + "moveright", + "movetableft", + "movetabright", "moveup", - "movedown", + "nextgroup", + "nexttab", + "nextwindow", + "nextworkspace", + "prevgroup", + "prevtab", + "prevwindow", + "prevworkspace", + "quit", "raise", - "lower", - "close", + "reconfigure", + "resizehorizontal", + "resizevertical", + "restart", + "rightworkspace", + "rootmenu", + "saverc", + "sendtoworkspace", + "setstyle", + "setworkspacename", "shade", "shadewindow", + "showdesktop", "stick", "stickwindow", "toggledecor", - "sendtoworkspace", - "killwindow", - "nexttab", - "prevtab", - "movetableft", - "movetabright", - "detachclient", - "nextworkspace", - "rightworkspace", - "leftworkspace", - "prevworkspace", "workspace", - "nextwindow", - "prevwindow", - "nextgroup", - "prevgroup", - "showdesktop", - "arrangewindows", - "rootmenu", - "setworkspacename", + "workspacemenu", "" }; @@ -196,6 +197,8 @@ FbTk::Command *FbCommandFactory::stringToCommand(const std::string &command, return new ShowDesktopCmd(); else if (command == "rootmenu") return new ShowRootMenuCmd(); + else if (command == "workspacemenu") + return new ShowWorkspaceMenuCmd(); else if (command == "setworkspacename") return new SetWorkspaceNameCmd(); return 0; diff --git a/src/FbCommands.cc b/src/FbCommands.cc index 61e22e7..61b9e3e 100644 --- a/src/FbCommands.cc +++ b/src/FbCommands.cc @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbCommands.cc,v 1.14 2003/08/26 23:52:09 fluxgen Exp $ +// $Id: FbCommands.cc,v 1.15 2003/08/30 11:59:29 fluxgen Exp $ #include "FbCommands.hh" #include "fluxbox.hh" @@ -114,6 +114,17 @@ void ShowRootMenuCmd::execute() { } } +void ShowWorkspaceMenuCmd::execute() { + BScreen *screen = Fluxbox::instance()->mouseScreen(); + if (screen == 0) + return; + + if (screen->getWorkspacemenu()) { + screen->getWorkspacemenu()->show(); + screen->getWorkspacemenu()->grabInputFocus(); + } +} + void SetWorkspaceNameCmd::execute() { BScreen *screen = Fluxbox::instance()->mouseScreen(); diff --git a/src/FbCommands.hh b/src/FbCommands.hh index 53482f3..83fe0f9 100644 --- a/src/FbCommands.hh +++ b/src/FbCommands.hh @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbCommands.hh,v 1.9 2003/08/26 23:51:16 fluxgen Exp $ +// $Id: FbCommands.hh,v 1.10 2003/08/30 11:59:29 fluxgen Exp $ // \file contains basic commands to restart, reconfigure, execute command and exit fluxbox @@ -83,6 +83,11 @@ public: void execute(); }; +class ShowWorkspaceMenuCmd: public FbTk::Command { +public: + void execute(); +}; + class SetWorkspaceNameCmd: public FbTk::Command { public: void execute(); -- cgit v0.11.2