added workspacemenu action, thanks Mathias Gumz

This commit is contained in:
fluxgen 2003-08-30 11:59:29 +00:00
parent 685a3e36b3
commit f20bcea618
3 changed files with 65 additions and 46 deletions

View file

@ -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",
"exec",
"execute",
"quit",
"restart",
"minimizewindow",
"minimize",
"iconfiy",
"maximizewindow",
"maximize",
"maximizevertical",
"maximizehorizontal",
"resizevertical",
"resizehorizontal",
"moveright",
"moveleft",
"moveup",
"movedown",
"raise",
"lower",
const char commands[][33] = {
"arrangewindows",
"close",
"detachclient",
"exec",
"execcommand",
"execute",
"iconfiy",
"killwindow",
"leftworkspace",
"lower",
"maximize",
"maximizehorizontal",
"maximizevertical",
"maximizewindow",
"minimize",
"minimizewindow",
"movedown",
"moveleft",
"moveright",
"movetableft",
"movetabright",
"moveup",
"nextgroup",
"nexttab",
"nextwindow",
"nextworkspace",
"prevgroup",
"prevtab",
"prevwindow",
"prevworkspace",
"quit",
"raise",
"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;

View file

@ -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();

View file

@ -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();