From 69d63da5420965216f2cd6a756301c70f6c32284 Mon Sep 17 00:00:00 2001 From: markt Date: Sun, 1 Jul 2007 21:01:31 +0000 Subject: added key commands :AddWorkspace and :RemoveLastWorkspace --- ChangeLog | 2 ++ src/FbCommandFactory.cc | 6 ++++++ src/WorkspaceCmd.cc | 12 ++++++++++++ src/WorkspaceCmd.hh | 10 ++++++++++ 4 files changed, 30 insertions(+) diff --git a/ChangeLog b/ChangeLog index fa6044b..420260c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ (Format: Year/Month/Day) Changes for 1.0.0: *07/07/01: + * Added keycommands :AddWorkspace and :RemoveLastWorkspace (Mark) + WorkspaceCmd.cc/hh FbCommandFactory.cc * More fixes for _NET_WM_STATE_MODAL and _NET_WM_STATE_DEMANDS_ATTENTION, plus a minor fix for pixmap styles (Mark) Ewmh.cc Window.cc AttentionNoticeHandler.cc/hh WinClient.cc diff --git a/src/FbCommandFactory.cc b/src/FbCommandFactory.cc index f1f7276..1382c89 100644 --- a/src/FbCommandFactory.cc +++ b/src/FbCommandFactory.cc @@ -60,6 +60,7 @@ static int getint(const char *str, int defaultvalue) { FbCommandFactory::FbCommandFactory() { // setup commands that we can handle const char* commands[] = { + "addworkspace", "arrangewindows", "bindkey", "close", @@ -115,6 +116,7 @@ FbCommandFactory::FbCommandFactory() { "reconfig", "reconfigure", "reloadstyle", + "removelastworkspace", "resizeto", "resize", "resizehorizontal", @@ -232,6 +234,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 0cbf5b9..b040fdd 100644 --- a/src/WorkspaceCmd.cc +++ b/src/WorkspaceCmd.cc @@ -63,6 +63,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 7d8d9e6..31a6ea4 100644 --- a/src/WorkspaceCmd.hh +++ b/src/WorkspaceCmd.hh @@ -53,6 +53,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