aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarkt <markt>2007-07-01 21:01:31 (GMT)
committermarkt <markt>2007-07-01 21:01:31 (GMT)
commit69d63da5420965216f2cd6a756301c70f6c32284 (patch)
tree919c3f48fb5ed1318d5376283ba5fc16f612003e
parent7783a8c84e57c4a58d270b9722800a031f50ed62 (diff)
downloadfluxbox_pavel-69d63da5420965216f2cd6a756301c70f6c32284.zip
fluxbox_pavel-69d63da5420965216f2cd6a756301c70f6c32284.tar.bz2
added key commands :AddWorkspace and :RemoveLastWorkspace
-rw-r--r--ChangeLog2
-rw-r--r--src/FbCommandFactory.cc6
-rw-r--r--src/WorkspaceCmd.cc12
-rw-r--r--src/WorkspaceCmd.hh10
4 files changed, 30 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index fa6044b..420260c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,8 @@
1 (Format: Year/Month/Day) 1 (Format: Year/Month/Day)
2Changes for 1.0.0: 2Changes for 1.0.0:
3*07/07/01: 3*07/07/01:
4 * Added keycommands :AddWorkspace and :RemoveLastWorkspace (Mark)
5 WorkspaceCmd.cc/hh FbCommandFactory.cc
4 * More fixes for _NET_WM_STATE_MODAL and _NET_WM_STATE_DEMANDS_ATTENTION, 6 * More fixes for _NET_WM_STATE_MODAL and _NET_WM_STATE_DEMANDS_ATTENTION,
5 plus a minor fix for pixmap styles (Mark) 7 plus a minor fix for pixmap styles (Mark)
6 Ewmh.cc Window.cc AttentionNoticeHandler.cc/hh WinClient.cc 8 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) {
60FbCommandFactory::FbCommandFactory() { 60FbCommandFactory::FbCommandFactory() {
61 // setup commands that we can handle 61 // setup commands that we can handle
62 const char* commands[] = { 62 const char* commands[] = {
63 "addworkspace",
63 "arrangewindows", 64 "arrangewindows",
64 "bindkey", 65 "bindkey",
65 "close", 66 "close",
@@ -115,6 +116,7 @@ FbCommandFactory::FbCommandFactory() {
115 "reconfig", 116 "reconfig",
116 "reconfigure", 117 "reconfigure",
117 "reloadstyle", 118 "reloadstyle",
119 "removelastworkspace",
118 "resizeto", 120 "resizeto",
119 "resize", 121 "resize",
120 "resizehorizontal", 122 "resizehorizontal",
@@ -232,6 +234,10 @@ FbTk::Command *FbCommandFactory::stringToCommand(const std::string &command,
232 return new SetResourceValueCmd(name, value); 234 return new SetResourceValueCmd(name, value);
233 } else if (command == "setresourcevaluedialog") 235 } else if (command == "setresourcevaluedialog")
234 return new SetResourceValueDialogCmd(); 236 return new SetResourceValueDialogCmd();
237 else if (command == "addworkspace")
238 return new AddWorkspaceCmd();
239 else if (command == "removelastworkspace")
240 return new RemoveLastWorkspaceCmd();
235 // 241 //
236 // Current focused window commands 242 // Current focused window commands
237 // 243 //
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() {
63 screen->focusControl().dirFocus(*win, m_dir); 63 screen->focusControl().dirFocus(*win, m_dir);
64} 64}
65 65
66void AddWorkspaceCmd::execute() {
67 BScreen *screen = Fluxbox::instance()->mouseScreen();
68 if (screen != 0)
69 screen->addWorkspace();
70}
71
72void RemoveLastWorkspaceCmd::execute() {
73 BScreen *screen = Fluxbox::instance()->mouseScreen();
74 if (screen != 0)
75 screen->removeLastWorkspace();
76}
77
66void NextWorkspaceCmd::execute() { 78void NextWorkspaceCmd::execute() {
67 BScreen *screen = Fluxbox::instance()->mouseScreen(); 79 BScreen *screen = Fluxbox::instance()->mouseScreen();
68 if (screen != 0) 80 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:
53 const FocusControl::FocusDir m_dir; 53 const FocusControl::FocusDir m_dir;
54}; 54};
55 55
56class AddWorkspaceCmd: public FbTk::Command {
57public:
58 void execute();
59};
60
61class RemoveLastWorkspaceCmd: public FbTk::Command {
62public:
63 void execute();
64};
65
56class NextWorkspaceCmd: public FbTk::Command { 66class NextWorkspaceCmd: public FbTk::Command {
57public: 67public:
58 explicit NextWorkspaceCmd(int option):m_option(option) { } 68 explicit NextWorkspaceCmd(int option):m_option(option) { }