From 5749014fa76f6019d0507776bcadec12bae54635 Mon Sep 17 00:00:00 2001 From: fluxgen Date: Tue, 19 Aug 2003 23:37:31 +0000 Subject: added resizehorizontal and resizevertical, patch from Mathias Gumz --- src/CurrentWindowCmd.cc | 12 +++++++++++- src/CurrentWindowCmd.hh | 17 ++++++++++++++++- src/FbCommandFactory.cc | 10 ++++++++-- 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 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: CurrentWindowCmd.cc,v 1.3 2003/07/28 15:06:33 rathnor Exp $ +// $Id: CurrentWindowCmd.cc,v 1.4 2003/08/19 23:37:31 fluxgen Exp $ #include "CurrentWindowCmd.hh" @@ -85,3 +85,13 @@ void MoveUpCmd::real_execute() { fbwindow().move(fbwindow().x(), fbwindow().y() - stepSize()); } +ResizeHorizontalCmd::ResizeHorizontalCmd(int step_size):MoveHelper(step_size) { } +void ResizeHorizontalCmd::real_execute() { + fbwindow().resize(fbwindow().width() + stepSize() * fbwindow().winClient().width_inc, fbwindow().height()); +} + +ResizeVerticalCmd::ResizeVerticalCmd(int step_size):MoveHelper(step_size) { } +void ResizeVerticalCmd::real_execute() { + fbwindow().resize(fbwindow().width(), fbwindow().height() + stepSize() * fbwindow().winClient().height_inc); +} + 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 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: CurrentWindowCmd.hh,v 1.2 2003/07/28 15:06:33 rathnor Exp $ +// $Id: CurrentWindowCmd.hh,v 1.3 2003/08/19 23:37:31 fluxgen Exp $ #ifndef CURRENTWINDOWCMD_HH #define CURRENTWINDOWCMD_HH @@ -110,4 +110,19 @@ protected: void real_execute(); }; +// resize vertical +class ResizeVerticalCmd: public MoveHelper { +public: + explicit ResizeVerticalCmd(int step_size); +protected: + void real_execute(); +}; + +// resize horizontal +class ResizeHorizontalCmd: public MoveHelper{ +public: + explicit ResizeHorizontalCmd(int step_size); +protected: + void real_execute(); +}; #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 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbCommandFactory.cc,v 1.11 2003/07/28 12:05:27 fluxgen Exp $ +// $Id: FbCommandFactory.cc,v 1.12 2003/08/19 23:37:31 fluxgen Exp $ #include "FbCommandFactory.hh" @@ -38,7 +38,7 @@ FbCommandFactory FbCommandFactory::s_autoreg; FbCommandFactory::FbCommandFactory() { // setup commands that we can handle - const char commands[][30] = { + const char commands[][32] = { "setstyle", "saverc", "reconfigure", @@ -54,6 +54,8 @@ FbCommandFactory::FbCommandFactory() { "maximize", "maximizevertical", "maximizehorizontal", + "resizevertical", + "resizehorizontal", "moveright", "moveleft", "moveup", @@ -125,6 +127,10 @@ FbTk::Command *FbCommandFactory::stringToCommand(const std::string &command, return new CurrentWindowCmd(&FluxboxWindow::maximizeVertical); else if (command == "maximizehorizontal") return new CurrentWindowCmd(&FluxboxWindow::maximizeHorizontal); + else if (command == "resizehorizontal") + return new ResizeHorizontalCmd(atoi(arguments.c_str())); + else if (command == "resizevertical") + return new ResizeVerticalCmd(atoi(arguments.c_str())); else if (command == "moveright") return new MoveRightCmd(atoi(arguments.c_str())); else if (command == "moveleft") -- cgit v0.11.2