diff options
author | fluxgen <fluxgen> | 2003-07-01 09:47:41 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2003-07-01 09:47:41 (GMT) |
commit | 1e097242f948c424585fc087900c8657695ca1fa (patch) | |
tree | eda672bfe17b2431d467586e71bc7b58751d0cbf /src | |
parent | 6ad9158c4f1e1adf1fbb80b205523aa1bc5fe4b7 (diff) | |
download | fluxbox_paul-1e097242f948c424585fc087900c8657695ca1fa.zip fluxbox_paul-1e097242f948c424585fc087900c8657695ca1fa.tar.bz2 |
added left and right workspace cmd
Diffstat (limited to 'src')
-rw-r--r-- | src/FbCommandFactory.cc | 12 | ||||
-rw-r--r-- | src/WorkspaceCmd.cc | 14 | ||||
-rw-r--r-- | src/WorkspaceCmd.hh | 18 |
3 files changed, 39 insertions, 5 deletions
diff --git a/src/FbCommandFactory.cc b/src/FbCommandFactory.cc index 097c3cd..c4bacae 100644 --- a/src/FbCommandFactory.cc +++ b/src/FbCommandFactory.cc | |||
@@ -20,7 +20,7 @@ | |||
20 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 20 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
21 | // DEALINGS IN THE SOFTWARE. | 21 | // DEALINGS IN THE SOFTWARE. |
22 | 22 | ||
23 | // $Id: FbCommandFactory.cc,v 1.6 2003/07/01 01:49:09 rathnor Exp $ | 23 | // $Id: FbCommandFactory.cc,v 1.7 2003/07/01 09:47:39 fluxgen Exp $ |
24 | 24 | ||
25 | #include "FbCommandFactory.hh" | 25 | #include "FbCommandFactory.hh" |
26 | 26 | ||
@@ -37,7 +37,7 @@ FbCommandFactory FbCommandFactory::s_autoreg; | |||
37 | 37 | ||
38 | FbCommandFactory::FbCommandFactory() { | 38 | FbCommandFactory::FbCommandFactory() { |
39 | // setup commands that we can handle | 39 | // setup commands that we can handle |
40 | const char commands[][25] = { | 40 | const char commands[][30] = { |
41 | "setstyle", | 41 | "setstyle", |
42 | "saverc", | 42 | "saverc", |
43 | "reconfigure", | 43 | "reconfigure", |
@@ -69,6 +69,8 @@ FbCommandFactory::FbCommandFactory() { | |||
69 | "prevtab", | 69 | "prevtab", |
70 | "detachclient", | 70 | "detachclient", |
71 | "nextworkspace", | 71 | "nextworkspace", |
72 | "rightworkspace", | ||
73 | "leftworkspace", | ||
72 | "prevworkspace", | 74 | "prevworkspace", |
73 | "workspace", | 75 | "workspace", |
74 | "nextwindow", | 76 | "nextwindow", |
@@ -107,7 +109,7 @@ FbTk::Command *FbCommandFactory::stringToCommand(const std::string &command, | |||
107 | // | 109 | // |
108 | // Current focused window commands | 110 | // Current focused window commands |
109 | // | 111 | // |
110 | else if (command == "minimizewindow" || command == "mimimize" || command == "iconify") | 112 | else if (command == "minimizewindow" || command == "minimize" || command == "iconify") |
111 | return new CurrentWindowCmd(&FluxboxWindow::iconify); | 113 | return new CurrentWindowCmd(&FluxboxWindow::iconify); |
112 | else if (command == "maximizewindow" || command == "maximize") | 114 | else if (command == "maximizewindow" || command == "maximize") |
113 | return new CurrentWindowCmd(&FluxboxWindow::maximize); | 115 | return new CurrentWindowCmd(&FluxboxWindow::maximize); |
@@ -152,6 +154,10 @@ FbTk::Command *FbCommandFactory::stringToCommand(const std::string &command, | |||
152 | return new NextWorkspaceCmd(); | 154 | return new NextWorkspaceCmd(); |
153 | else if (command == "prevworkspace" && arguments.size() == 0) | 155 | else if (command == "prevworkspace" && arguments.size() == 0) |
154 | return new PrevWorkspaceCmd(); | 156 | return new PrevWorkspaceCmd(); |
157 | else if (command == "rightworkspace") | ||
158 | return new RightWorkspaceCmd(atoi(arguments.c_str())); | ||
159 | else if (command == "leftworkspace") | ||
160 | return new LeftWorkspaceCmd(atoi(arguments.c_str())); | ||
155 | else if (command == "workspace") { | 161 | else if (command == "workspace") { |
156 | int num = 1; // workspaces appear 1-indexed to the user | 162 | int num = 1; // workspaces appear 1-indexed to the user |
157 | if (!arguments.empty()) | 163 | if (!arguments.empty()) |
diff --git a/src/WorkspaceCmd.cc b/src/WorkspaceCmd.cc index f8f39da..45bf7a2 100644 --- a/src/WorkspaceCmd.cc +++ b/src/WorkspaceCmd.cc | |||
@@ -20,7 +20,7 @@ | |||
20 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 20 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
21 | // DEALINGS IN THE SOFTWARE. | 21 | // DEALINGS IN THE SOFTWARE. |
22 | 22 | ||
23 | // $Id: WorkspaceCmd.cc,v 1.1 2003/06/30 14:38:42 fluxgen Exp $ | 23 | // $Id: WorkspaceCmd.cc,v 1.2 2003/07/01 09:47:41 fluxgen Exp $ |
24 | 24 | ||
25 | #include "WorkspaceCmd.hh" | 25 | #include "WorkspaceCmd.hh" |
26 | #include "Workspace.hh" | 26 | #include "Workspace.hh" |
@@ -85,6 +85,18 @@ void PrevWorkspaceCmd::execute() { | |||
85 | screen->prevWorkspace(); | 85 | screen->prevWorkspace(); |
86 | } | 86 | } |
87 | 87 | ||
88 | void LeftWorkspaceCmd::execute() { | ||
89 | BScreen *screen = Fluxbox::instance()->keyScreen(); | ||
90 | if (screen != 0) | ||
91 | screen->leftWorkspace(m_param); | ||
92 | } | ||
93 | |||
94 | void RightWorkspaceCmd::execute() { | ||
95 | BScreen *screen = Fluxbox::instance()->keyScreen(); | ||
96 | if (screen != 0) | ||
97 | screen->rightWorkspace(m_param); | ||
98 | } | ||
99 | |||
88 | JumpToWorkspaceCmd::JumpToWorkspaceCmd(int workspace_num):m_workspace_num(workspace_num) { } | 100 | JumpToWorkspaceCmd::JumpToWorkspaceCmd(int workspace_num):m_workspace_num(workspace_num) { } |
89 | 101 | ||
90 | void JumpToWorkspaceCmd::execute() { | 102 | void JumpToWorkspaceCmd::execute() { |
diff --git a/src/WorkspaceCmd.hh b/src/WorkspaceCmd.hh index cc5702b..8a23bff 100644 --- a/src/WorkspaceCmd.hh +++ b/src/WorkspaceCmd.hh | |||
@@ -20,7 +20,7 @@ | |||
20 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 20 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
21 | // DEALINGS IN THE SOFTWARE. | 21 | // DEALINGS IN THE SOFTWARE. |
22 | 22 | ||
23 | // $Id: WorkspaceCmd.hh,v 1.1 2003/06/30 14:38:42 fluxgen Exp $ | 23 | // $Id: WorkspaceCmd.hh,v 1.2 2003/07/01 09:47:41 fluxgen Exp $ |
24 | 24 | ||
25 | #ifndef WORKSPACECMD_HH | 25 | #ifndef WORKSPACECMD_HH |
26 | #define WORKSPACECMD_HH | 26 | #define WORKSPACECMD_HH |
@@ -52,6 +52,22 @@ public: | |||
52 | void execute(); | 52 | void execute(); |
53 | }; | 53 | }; |
54 | 54 | ||
55 | class LeftWorkspaceCmd: public FbTk::Command { | ||
56 | public: | ||
57 | explicit LeftWorkspaceCmd(int num=1):m_param(num == 0 ? 1 : num) { } | ||
58 | void execute(); | ||
59 | private: | ||
60 | const int m_param; | ||
61 | }; | ||
62 | |||
63 | class RightWorkspaceCmd: public FbTk::Command { | ||
64 | public: | ||
65 | explicit RightWorkspaceCmd(int num=1):m_param(num == 0 ? 1 : num) { } | ||
66 | void execute(); | ||
67 | private: | ||
68 | const int m_param; | ||
69 | }; | ||
70 | |||
55 | class JumpToWorkspaceCmd: public FbTk::Command { | 71 | class JumpToWorkspaceCmd: public FbTk::Command { |
56 | public: | 72 | public: |
57 | explicit JumpToWorkspaceCmd(int workspace_num); | 73 | explicit JumpToWorkspaceCmd(int workspace_num); |