added left and right workspace cmd
fluxgen fluxgen
3 files changed,
39 insertions(+),
5 deletions(-)
M
src/FbCommandFactory.cc
→
src/FbCommandFactory.cc
@@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbCommandFactory.cc,v 1.6 2003/07/01 01:49:09 rathnor Exp $ +// $Id: FbCommandFactory.cc,v 1.7 2003/07/01 09:47:39 fluxgen Exp $ #include "FbCommandFactory.hh"@@ -37,7 +37,7 @@
FbCommandFactory::FbCommandFactory() { // setup commands that we can handle - const char commands[][25] = { + const char commands[][30] = { "setstyle", "saverc", "reconfigure",@@ -69,6 +69,8 @@ "nexttab",
"prevtab", "detachclient", "nextworkspace", + "rightworkspace", + "leftworkspace", "prevworkspace", "workspace", "nextwindow",@@ -107,7 +109,7 @@ return new FbTk::SimpleCommand<Fluxbox>(*Fluxbox::instance(), &Fluxbox::shutdown);
// // Current focused window commands // - else if (command == "minimizewindow" || command == "mimimize" || command == "iconify") + else if (command == "minimizewindow" || command == "minimize" || command == "iconify") return new CurrentWindowCmd(&FluxboxWindow::iconify); else if (command == "maximizewindow" || command == "maximize") return new CurrentWindowCmd(&FluxboxWindow::maximize);@@ -152,6 +154,10 @@ else if (command == "nextworkspace" && arguments.size() == 0)
return new NextWorkspaceCmd(); else if (command == "prevworkspace" && arguments.size() == 0) return new PrevWorkspaceCmd(); + else if (command == "rightworkspace") + return new RightWorkspaceCmd(atoi(arguments.c_str())); + else if (command == "leftworkspace") + return new LeftWorkspaceCmd(atoi(arguments.c_str())); else if (command == "workspace") { int num = 1; // workspaces appear 1-indexed to the user if (!arguments.empty())
M
src/WorkspaceCmd.cc
→
src/WorkspaceCmd.cc
@@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: WorkspaceCmd.cc,v 1.1 2003/06/30 14:38:42 fluxgen Exp $ +// $Id: WorkspaceCmd.cc,v 1.2 2003/07/01 09:47:41 fluxgen Exp $ #include "WorkspaceCmd.hh" #include "Workspace.hh"@@ -83,6 +83,18 @@ void PrevWorkspaceCmd::execute() {
BScreen *screen = Fluxbox::instance()->keyScreen(); if (screen != 0) screen->prevWorkspace(); +} + +void LeftWorkspaceCmd::execute() { + BScreen *screen = Fluxbox::instance()->keyScreen(); + if (screen != 0) + screen->leftWorkspace(m_param); +} + +void RightWorkspaceCmd::execute() { + BScreen *screen = Fluxbox::instance()->keyScreen(); + if (screen != 0) + screen->rightWorkspace(m_param); } JumpToWorkspaceCmd::JumpToWorkspaceCmd(int workspace_num):m_workspace_num(workspace_num) { }
M
src/WorkspaceCmd.hh
→
src/WorkspaceCmd.hh
@@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: WorkspaceCmd.hh,v 1.1 2003/06/30 14:38:42 fluxgen Exp $ +// $Id: WorkspaceCmd.hh,v 1.2 2003/07/01 09:47:41 fluxgen Exp $ #ifndef WORKSPACECMD_HH #define WORKSPACECMD_HH@@ -50,6 +50,22 @@
class PrevWorkspaceCmd: public FbTk::Command { public: void execute(); +}; + +class LeftWorkspaceCmd: public FbTk::Command { +public: + explicit LeftWorkspaceCmd(int num=1):m_param(num == 0 ? 1 : num) { } + void execute(); +private: + const int m_param; +}; + +class RightWorkspaceCmd: public FbTk::Command { +public: + explicit RightWorkspaceCmd(int num=1):m_param(num == 0 ? 1 : num) { } + void execute(); +private: + const int m_param; }; class JumpToWorkspaceCmd: public FbTk::Command {