summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-08-19 23:37:31 (GMT)
committerfluxgen <fluxgen>2003-08-19 23:37:31 (GMT)
commit5749014fa76f6019d0507776bcadec12bae54635 (patch)
tree5c846471ba97eec7822cd08dfc11ab7c840dddc9
parent6d1ac53b5f99c098b149e472143d46df68378347 (diff)
downloadfluxbox_lack-5749014fa76f6019d0507776bcadec12bae54635.zip
fluxbox_lack-5749014fa76f6019d0507776bcadec12bae54635.tar.bz2
added resizehorizontal and resizevertical, patch from Mathias Gumz
-rw-r--r--src/CurrentWindowCmd.cc12
-rw-r--r--src/CurrentWindowCmd.hh17
-rw-r--r--src/FbCommandFactory.cc10
3 files changed, 35 insertions, 4 deletions
diff --git a/src/CurrentWindowCmd.cc b/src/CurrentWindowCmd.cc
index b8913bb..6906926 100644
--- a/src/CurrentWindowCmd.cc
+++ b/src/CurrentWindowCmd.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: CurrentWindowCmd.cc,v 1.3 2003/07/28 15:06:33 rathnor Exp $ 23// $Id: CurrentWindowCmd.cc,v 1.4 2003/08/19 23:37:31 fluxgen Exp $
24 24
25#include "CurrentWindowCmd.hh" 25#include "CurrentWindowCmd.hh"
26 26
@@ -85,3 +85,13 @@ void MoveUpCmd::real_execute() {
85 fbwindow().move(fbwindow().x(), fbwindow().y() - stepSize()); 85 fbwindow().move(fbwindow().x(), fbwindow().y() - stepSize());
86} 86}
87 87
88ResizeHorizontalCmd::ResizeHorizontalCmd(int step_size):MoveHelper(step_size) { }
89void ResizeHorizontalCmd::real_execute() {
90 fbwindow().resize(fbwindow().width() + stepSize() * fbwindow().winClient().width_inc, fbwindow().height());
91}
92
93ResizeVerticalCmd::ResizeVerticalCmd(int step_size):MoveHelper(step_size) { }
94void ResizeVerticalCmd::real_execute() {
95 fbwindow().resize(fbwindow().width(), fbwindow().height() + stepSize() * fbwindow().winClient().height_inc);
96}
97
diff --git a/src/CurrentWindowCmd.hh b/src/CurrentWindowCmd.hh
index 3e56625..7927add 100644
--- a/src/CurrentWindowCmd.hh
+++ b/src/CurrentWindowCmd.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: CurrentWindowCmd.hh,v 1.2 2003/07/28 15:06:33 rathnor Exp $ 23// $Id: CurrentWindowCmd.hh,v 1.3 2003/08/19 23:37:31 fluxgen Exp $
24 24
25#ifndef CURRENTWINDOWCMD_HH 25#ifndef CURRENTWINDOWCMD_HH
26#define CURRENTWINDOWCMD_HH 26#define CURRENTWINDOWCMD_HH
@@ -110,4 +110,19 @@ protected:
110 void real_execute(); 110 void real_execute();
111}; 111};
112 112
113// resize vertical
114class ResizeVerticalCmd: public MoveHelper {
115public:
116 explicit ResizeVerticalCmd(int step_size);
117protected:
118 void real_execute();
119};
120
121// resize horizontal
122class ResizeHorizontalCmd: public MoveHelper{
123public:
124 explicit ResizeHorizontalCmd(int step_size);
125protected:
126 void real_execute();
127};
113#endif // CURRENTWINDOWCMD_HH 128#endif // CURRENTWINDOWCMD_HH
diff --git a/src/FbCommandFactory.cc b/src/FbCommandFactory.cc
index 237442a..168aa22 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.11 2003/07/28 12:05:27 fluxgen Exp $ 23// $Id: FbCommandFactory.cc,v 1.12 2003/08/19 23:37:31 fluxgen Exp $
24 24
25#include "FbCommandFactory.hh" 25#include "FbCommandFactory.hh"
26 26
@@ -38,7 +38,7 @@ FbCommandFactory FbCommandFactory::s_autoreg;
38 38
39FbCommandFactory::FbCommandFactory() { 39FbCommandFactory::FbCommandFactory() {
40 // setup commands that we can handle 40 // setup commands that we can handle
41 const char commands[][30] = { 41 const char commands[][32] = {
42 "setstyle", 42 "setstyle",
43 "saverc", 43 "saverc",
44 "reconfigure", 44 "reconfigure",
@@ -54,6 +54,8 @@ FbCommandFactory::FbCommandFactory() {
54 "maximize", 54 "maximize",
55 "maximizevertical", 55 "maximizevertical",
56 "maximizehorizontal", 56 "maximizehorizontal",
57 "resizevertical",
58 "resizehorizontal",
57 "moveright", 59 "moveright",
58 "moveleft", 60 "moveleft",
59 "moveup", 61 "moveup",
@@ -125,6 +127,10 @@ FbTk::Command *FbCommandFactory::stringToCommand(const std::string &command,
125 return new CurrentWindowCmd(&FluxboxWindow::maximizeVertical); 127 return new CurrentWindowCmd(&FluxboxWindow::maximizeVertical);
126 else if (command == "maximizehorizontal") 128 else if (command == "maximizehorizontal")
127 return new CurrentWindowCmd(&FluxboxWindow::maximizeHorizontal); 129 return new CurrentWindowCmd(&FluxboxWindow::maximizeHorizontal);
130 else if (command == "resizehorizontal")
131 return new ResizeHorizontalCmd(atoi(arguments.c_str()));
132 else if (command == "resizevertical")
133 return new ResizeVerticalCmd(atoi(arguments.c_str()));
128 else if (command == "moveright") 134 else if (command == "moveright")
129 return new MoveRightCmd(atoi(arguments.c_str())); 135 return new MoveRightCmd(atoi(arguments.c_str()));
130 else if (command == "moveleft") 136 else if (command == "moveleft")