all repos — fluxbox @ 39abccae4af9d290de33c7f7877f4f4af92c6db8

custom fork of the fluxbox windowmanager

resize command
fluxgen fluxgen
commit

39abccae4af9d290de33c7f7877f4f4af92c6db8

parent

d75ac0afcc21375081000cbcb3bee763c90c8d08

3 files changed, 27 insertions(+), 23 deletions(-)

jump to
M src/CurrentWindowCmd.ccsrc/CurrentWindowCmd.cc

@@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: CurrentWindowCmd.cc,v 1.4 2003/08/19 23:37:31 fluxgen Exp $ +// $Id: CurrentWindowCmd.cc,v 1.5 2003/09/06 15:43:27 fluxgen Exp $ #include "CurrentWindowCmd.hh"

@@ -85,13 +85,11 @@ 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()); -} +ResizeCmd::ResizeCmd(const int step_size_x, const int step_size_y) : + m_step_size_x(step_size_x), m_step_size_y(step_size_y) { } -ResizeVerticalCmd::ResizeVerticalCmd(int step_size):MoveHelper(step_size) { } -void ResizeVerticalCmd::real_execute() { - fbwindow().resize(fbwindow().width(), fbwindow().height() + stepSize() * fbwindow().winClient().height_inc); +void ResizeCmd::real_execute() { + fbwindow().resize( + fbwindow().width() + m_step_size_x * fbwindow().winClient().width_inc, + fbwindow().height() + m_step_size_y * fbwindow().winClient().height_inc ); } -
M src/CurrentWindowCmd.hhsrc/CurrentWindowCmd.hh

@@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: CurrentWindowCmd.hh,v 1.3 2003/08/19 23:37:31 fluxgen Exp $ +// $Id: CurrentWindowCmd.hh,v 1.4 2003/09/06 15:43:27 fluxgen Exp $ #ifndef CURRENTWINDOWCMD_HH #define CURRENTWINDOWCMD_HH

@@ -110,19 +110,16 @@ protected:

void real_execute(); }; -// resize vertical -class ResizeVerticalCmd: public MoveHelper { +// resize horizontal +class ResizeCmd: public WindowHelperCmd{ public: - explicit ResizeVerticalCmd(int step_size); + explicit ResizeCmd(int step_size_x, int step_size_y); protected: void real_execute(); -}; + +private: -// resize horizontal -class ResizeHorizontalCmd: public MoveHelper{ -public: - explicit ResizeHorizontalCmd(int step_size); -protected: - void real_execute(); + const int m_step_size_x; + const int m_step_size_y; }; #endif // CURRENTWINDOWCMD_HH
M src/FbCommandFactory.ccsrc/FbCommandFactory.cc

@@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbCommandFactory.cc,v 1.14 2003/08/30 11:59:29 fluxgen Exp $ +// $Id: FbCommandFactory.cc,v 1.15 2003/09/06 15:43:27 fluxgen Exp $ #include "FbCommandFactory.hh"

@@ -31,6 +31,8 @@ #include "WorkspaceCmd.hh"

#include "fluxbox.hh" #include "SimpleCommand.hh" #include "Screen.hh" + +#include <sstream> // autoregister this module to command parser FbCommandFactory FbCommandFactory::s_autoreg;

@@ -72,6 +74,7 @@ "prevworkspace",

"quit", "raise", "reconfigure", + "resize", "resizehorizontal", "resizevertical", "restart",

@@ -129,10 +132,16 @@ else if (command == "maximizevertical")

return new CurrentWindowCmd(&FluxboxWindow::maximizeVertical); else if (command == "maximizehorizontal") return new CurrentWindowCmd(&FluxboxWindow::maximizeHorizontal); + else if (command == "resize") { + std::istringstream is(arguments); + int dx = 0, dy = 0; + is >> dx >> dy; + return new ResizeCmd(dx, dy); + } else if (command == "resizehorizontal") - return new ResizeHorizontalCmd(atoi(arguments.c_str())); + return new ResizeCmd(atoi(arguments.c_str()),0); else if (command == "resizevertical") - return new ResizeVerticalCmd(atoi(arguments.c_str())); + return new ResizeCmd(0,atoi(arguments.c_str())); else if (command == "moveright") return new MoveRightCmd(atoi(arguments.c_str())); else if (command == "moveleft")