all repos — fluxbox @ b78edef5b6e39822142dd91331a53ab38b147f05

custom fork of the fluxbox windowmanager

added move command, thanks Mathias Gumz
fluxgen fluxgen
commit

b78edef5b6e39822142dd91331a53ab38b147f05

parent

90eb966c41af507c2995804213ec33ba833529cc

3 files changed, 31 insertions(+), 67 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.5 2003/09/06 15:43:27 fluxgen Exp $ +// $Id: CurrentWindowCmd.cc,v 1.6 2003/09/10 14:07:48 fluxgen Exp $ #include "CurrentWindowCmd.hh"

@@ -63,26 +63,13 @@ // will exist from execute above

return *Fluxbox::instance()->getFocusedWindow()->fbwindow(); } -MoveLeftCmd::MoveLeftCmd(int step_size):MoveHelper(step_size) { } -void MoveLeftCmd::real_execute() { - fbwindow().move(fbwindow().x() - stepSize(), - fbwindow().y()); -} +MoveCmd::MoveCmd(const int step_size_x, const int step_size_y) : + m_step_size_x(step_size_x), m_step_size_y(step_size_y) { } -MoveRightCmd::MoveRightCmd(int step_size):MoveHelper(step_size) { } -void MoveRightCmd::real_execute() { - fbwindow().move(fbwindow().x() + stepSize(), - fbwindow().y()); -} - -MoveDownCmd::MoveDownCmd(int step_size):MoveHelper(step_size) { } -void MoveDownCmd::real_execute() { - fbwindow().move(fbwindow().x(), fbwindow().y() + stepSize()); -} - -MoveUpCmd::MoveUpCmd(int step_size):MoveHelper(step_size) { } -void MoveUpCmd::real_execute() { - fbwindow().move(fbwindow().x(), fbwindow().y() - stepSize()); +void MoveCmd::real_execute() { + fbwindow().move( + fbwindow().x() + m_step_size_x, + fbwindow().y() + m_step_size_y ); } ResizeCmd::ResizeCmd(const int step_size_x, const int step_size_y) :
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.4 2003/09/06 15:43:27 fluxgen Exp $ +// $Id: CurrentWindowCmd.hh,v 1.5 2003/09/10 14:07:48 fluxgen Exp $ #ifndef CURRENTWINDOWCMD_HH #define CURRENTWINDOWCMD_HH

@@ -69,48 +69,18 @@ private:

const int m_workspace_num; }; -class MoveHelper: public WindowHelperCmd { -public: - explicit MoveHelper(int step_size):m_step_size(step_size) { } -protected: - int stepSize() const { return m_step_size; } - -private: - const int m_step_size; -}; -/// move window to left -class MoveLeftCmd: public MoveHelper { -public: - explicit MoveLeftCmd(int step_size); -protected: - void real_execute(); -}; - -/// move window to right -class MoveRightCmd: public MoveHelper { -public: - explicit MoveRightCmd(int step_size); -protected: - void real_execute(); -}; - -/// move window up -class MoveUpCmd: public MoveHelper { +class MoveCmd: public WindowHelperCmd { public: - explicit MoveUpCmd(int step_size); + explicit MoveCmd(const int step_size_x, const int step_size_y); protected: void real_execute(); -}; -/// move window down -class MoveDownCmd: public MoveHelper { -public: - explicit MoveDownCmd(int step_size); -protected: - void real_execute(); +private: + const int m_step_size_x; + const int m_step_size_y; }; -// resize horizontal +// resize cmd class ResizeCmd: public WindowHelperCmd{ public: explicit ResizeCmd(int step_size_x, int step_size_y);
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.15 2003/09/06 15:43:27 fluxgen Exp $ +// $Id: FbCommandFactory.cc,v 1.16 2003/09/10 14:06:37 fluxgen Exp $ #include "FbCommandFactory.hh"

@@ -40,7 +40,7 @@

FbCommandFactory::FbCommandFactory() { // setup commands that we can handle - const char commands[][33] = { + const char commands[][52] = { "arrangewindows", "close", "detachclient",

@@ -57,6 +57,7 @@ "maximizevertical",

"maximizewindow", "minimize", "minimizewindow", + "move", "movedown", "moveleft", "moveright",

@@ -133,23 +134,29 @@ 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); + std::istringstream is(arguments); + int dx = 0, dy = 0; + is >> dx >> dy; + return new ResizeCmd(dx, dy); } else if (command == "resizehorizontal") return new ResizeCmd(atoi(arguments.c_str()),0); else if (command == "resizevertical") return new ResizeCmd(0,atoi(arguments.c_str())); + else if (command == "move") { + std::istringstream is(arguments); + int dx = 0, dy = 0; + is >> dx >> dy; + return new MoveCmd(dx, dy); + } else if (command == "moveright") - return new MoveRightCmd(atoi(arguments.c_str())); + return new MoveCmd(atoi(arguments.c_str()),0); else if (command == "moveleft") - return new MoveLeftCmd(atoi(arguments.c_str())); + return new MoveCmd(-atoi(arguments.c_str()),0); else if (command == "moveup") - return new MoveUpCmd(atoi(arguments.c_str())); + return new MoveCmd(0,-atoi(arguments.c_str())); else if (command == "movedown") - return new MoveDownCmd(atoi(arguments.c_str())); + return new MoveCmd(0,atoi(arguments.c_str())); else if (command == "raise") return new CurrentWindowCmd(&FluxboxWindow::raise); else if (command == "lower")