refactor tree_move() into src/move.c, change config (!), change testcase

Due to lots of cases which were added and added to tree_move(), the function
was not really easy to understand. For this refactoring, I wrote tree_move()
from scratch, thinking about (hopefully) all cases. The testsuite still passes.

The move command also has different parameters now. Instead of the hard to
understand 'before v' stuff, we use 'move [left|right|up|down]'.
This commit is contained in:
Michael Stapelberg
2011-02-14 23:05:20 +01:00
parent 28dd226259
commit 26a416e016
14 changed files with 302 additions and 250 deletions

View File

@ -54,5 +54,6 @@
#include "xcursor.h"
#include "resize.h"
#include "sighandler.h"
#include "move.h"
#endif

View File

@ -42,6 +42,9 @@ Con *con_get_output(Con *con);
*/
Con *con_get_workspace(Con *con);
Con *con_parent_with_orientation(Con *con, orientation_t orientation);
/**
* Returns the first fullscreen node below this node.
*

15
include/move.h Normal file
View File

@ -0,0 +1,15 @@
/*
* vim:ts=4:sw=4:expandtab
*/
#ifndef _MOVE_H
#define _MOVE_H
/**
* Moves the current container in the given direction (TOK_LEFT, TOK_RIGHT,
* TOK_UP, TOK_DOWN from cmdparse.l)
*
*/
void tree_move(int direction);
#endif

View File

@ -65,13 +65,6 @@ void tree_close_con();
*/
void tree_next(char way, orientation_t orientation);
/**
* Moves the current container in the given way (next/previous) and given
* orientation (horizontal/vertical).
*
*/
void tree_move(char way, orientation_t orientation);
/**
* Closes the given container including all children
*

View File

@ -99,4 +99,6 @@ void workspace_map_clients(xcb_connection_t *conn, Workspace *ws);
*/
void workspace_update_urgent_flag(Con *ws);
void ws_force_orientation(Con *ws, orientation_t orientation);
#endif