From 6667c365ce0a5620f3904885222d0f040e71dadd Mon Sep 17 00:00:00 2001 From: markt Date: Fri, 1 Jun 2007 02:00:00 +0000 Subject: added AddWorkspace and RemoveLastWorkspace key commands --- ChangeLog | 3 +++ src/FbCommandFactory.cc | 6 ++++++ src/WorkspaceCmd.cc | 12 ++++++++++++ src/WorkspaceCmd.hh | 10 ++++++++++ 4 files changed, 31 insertions(+) diff --git a/ChangeLog b/ChangeLog index 7a0d7f6..379b08a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ (Format: Year/Month/Day) Changes for 1.1: +*07/06/01: + * Added key commands AddWorkspace and RemoveLastWorkspace (Mark) + FbCommandFactory.cc WorkspaceCmd.cc/hh *07/05/23: * Added key command :Attach which groups all windows matching the given pattern (Mark) diff --git a/src/FbCommandFactory.cc b/src/FbCommandFactory.cc index 1e5b506..2e19700 100644 --- a/src/FbCommandFactory.cc +++ b/src/FbCommandFactory.cc @@ -84,6 +84,7 @@ void parseNextWindowArgs(const string &in, int &opts, string &pat) { FbCommandFactory::FbCommandFactory() { // setup commands that we can handle const char* commands[] = { + "addworkspace", "arrangewindows", "attach", "bindkey", @@ -142,6 +143,7 @@ FbCommandFactory::FbCommandFactory() { "reconfig", "reconfigure", "reloadstyle", + "removelastworkspace", "resizeto", "resize", "resizehorizontal", @@ -260,6 +262,10 @@ FbTk::Command *FbCommandFactory::stringToCommand(const std::string &command, return new SetResourceValueCmd(name, value); } else if (command == "setresourcevaluedialog") return new SetResourceValueDialogCmd(); + else if (command == "addworkspace") + return new AddWorkspaceCmd(); + else if (command == "removelastworkspace") + return new RemoveLastWorkspaceCmd(); // // Current focused window commands // diff --git a/src/WorkspaceCmd.cc b/src/WorkspaceCmd.cc index a9b7aca..79c002e 100644 --- a/src/WorkspaceCmd.cc +++ b/src/WorkspaceCmd.cc @@ -137,6 +137,18 @@ void DirFocusCmd::execute() { screen->focusControl().dirFocus(*win, m_dir); } +void AddWorkspaceCmd::execute() { + BScreen *screen = Fluxbox::instance()->mouseScreen(); + if (screen != 0) + screen->addWorkspace(); +} + +void RemoveLastWorkspaceCmd::execute() { + BScreen *screen = Fluxbox::instance()->mouseScreen(); + if (screen != 0) + screen->removeLastWorkspace(); +} + void NextWorkspaceCmd::execute() { BScreen *screen = Fluxbox::instance()->mouseScreen(); if (screen != 0) diff --git a/src/WorkspaceCmd.hh b/src/WorkspaceCmd.hh index e1727f5..8053dc9 100644 --- a/src/WorkspaceCmd.hh +++ b/src/WorkspaceCmd.hh @@ -103,6 +103,16 @@ private: const FocusControl::FocusDir m_dir; }; +class AddWorkspaceCmd: public FbTk::Command { +public: + void execute(); +}; + +class RemoveLastWorkspaceCmd: public FbTk::Command { +public: + void execute(); +}; + class NextWorkspaceCmd: public FbTk::Command { public: explicit NextWorkspaceCmd(int option):m_option(option) { } -- cgit v0.11.2