all repos — fluxbox @ 9c35bbdd40ada59658feb9b98535f77a473bbaa5

custom fork of the fluxbox windowmanager

added resizeto and moveto commands
fluxgen fluxgen
commit

9c35bbdd40ada59658feb9b98535f77a473bbaa5

parent

4d161094576b29ca1a41e807fabb80d672fc1852

3 files changed, 61 insertions(+), 4 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.6 2003/09/10 14:07:48 fluxgen Exp $ +// $Id: CurrentWindowCmd.cc,v 1.7 2003/10/25 22:11:22 fluxgen Exp $ #include "CurrentWindowCmd.hh"

@@ -80,3 +80,21 @@ fbwindow().resize(

fbwindow().width() + m_step_size_x * fbwindow().winClient().width_inc, fbwindow().height() + m_step_size_y * fbwindow().winClient().height_inc ); } + +MoveToCmd::MoveToCmd(const int step_size_x, const int step_size_y) : + m_step_size_x(step_size_x), m_step_size_y(step_size_y) { } + +void MoveToCmd::real_execute() { + fbwindow().move( + m_step_size_x, + m_step_size_y ); +} + +ResizeToCmd::ResizeToCmd(const int step_size_x, const int step_size_y) : + m_step_size_x(step_size_x), m_step_size_y(step_size_y) { } + +void ResizeToCmd::real_execute() { + fbwindow().resize( + m_step_size_x * fbwindow().winClient().width_inc, + 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.5 2003/09/10 14:07:48 fluxgen Exp $ +// $Id: CurrentWindowCmd.hh,v 1.6 2003/10/25 22:11:22 fluxgen Exp $ #ifndef CURRENTWINDOWCMD_HH #define CURRENTWINDOWCMD_HH

@@ -69,6 +69,7 @@ private:

const int m_workspace_num; }; +// move cmd, relative position class MoveCmd: public WindowHelperCmd { public: explicit MoveCmd(const int step_size_x, const int step_size_y);

@@ -80,10 +81,34 @@ const int m_step_size_x;

const int m_step_size_y; }; -// resize cmd +// resize cmd, relative size class ResizeCmd: public WindowHelperCmd{ public: explicit ResizeCmd(int step_size_x, int step_size_y); +protected: + void real_execute(); + +private: + + const int m_step_size_x; + const int m_step_size_y; +}; + +class MoveToCmd: public WindowHelperCmd { +public: + explicit MoveToCmd(const int step_size_x, const int step_size_y); +protected: + void real_execute(); + +private: + const int m_step_size_x; + const int m_step_size_y; +}; + +// resize cmd +class ResizeToCmd: public WindowHelperCmd{ +public: + explicit ResizeToCmd(int step_size_x, int step_size_y); protected: void real_execute();
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.18 2003/09/29 14:22:07 fluxgen Exp $ +// $Id: FbCommandFactory.cc,v 1.19 2003/10/25 22:11:22 fluxgen Exp $ #include "FbCommandFactory.hh"

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

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

@@ -80,6 +81,7 @@ "prevworkspace",

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

@@ -144,10 +146,22 @@ int dx = 0, dy = 0;

is >> dx >> dy; return new ResizeCmd(dx, dy); } + else if (command == "resizeto") { + std::istringstream is(arguments); + int dx = 0, dy = 0; + is >> dx >> dy; + return new ResizeToCmd(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 == "moveto") { + std::istringstream is(arguments); + int dx = 0, dy = 0; + is >> dx >> dy; + return new MoveToCmd(dx,dy); + } else if (command == "move") { std::istringstream is(arguments); int dx = 0, dy = 0;