2010-03-27 10:25:51 -04:00
|
|
|
/*
|
|
|
|
* vim:ts=4:sw=4:expandtab
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _TREE_H
|
|
|
|
#define _TREE_H
|
|
|
|
|
|
|
|
extern Con *croot;
|
|
|
|
/* TODO: i am not sure yet how much access to the focused container should
|
|
|
|
* be permitted to source files */
|
|
|
|
extern Con *focused;
|
|
|
|
TAILQ_HEAD(all_cons_head, Con);
|
|
|
|
extern struct all_cons_head all_cons;
|
|
|
|
|
2010-07-13 05:35:05 -04:00
|
|
|
/**
|
|
|
|
* Initializes the tree by creating the root node, adding all RandR outputs
|
|
|
|
* to the tree (that means randr_init() has to be called before) and
|
|
|
|
* assigning a workspace to each RandR output.
|
|
|
|
*
|
|
|
|
*/
|
2010-03-27 10:25:51 -04:00
|
|
|
void tree_init();
|
2010-07-13 05:35:05 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Opens an empty container in the current container
|
|
|
|
*
|
|
|
|
*/
|
2010-03-27 10:25:51 -04:00
|
|
|
Con *tree_open_con(Con *con);
|
2010-07-13 05:35:05 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Splits (horizontally or vertically) the given container by creating a new
|
|
|
|
* container which contains the old one and the future ones.
|
|
|
|
*
|
|
|
|
*/
|
2010-03-27 10:25:51 -04:00
|
|
|
void tree_split(Con *con, orientation_t orientation);
|
2010-07-13 05:35:05 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Moves focus one level up.
|
|
|
|
*
|
|
|
|
*/
|
2010-03-27 10:25:51 -04:00
|
|
|
void level_up();
|
2010-07-13 05:35:05 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Moves focus one level down.
|
|
|
|
*
|
|
|
|
*/
|
2010-03-27 10:25:51 -04:00
|
|
|
void level_down();
|
2010-07-13 05:35:05 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Renders the tree, that is rendering all outputs using render_con() and
|
|
|
|
* pushing the changes to X11 using x_push_changes().
|
|
|
|
*
|
|
|
|
*/
|
2010-03-27 10:25:51 -04:00
|
|
|
void tree_render();
|
2010-07-13 05:35:05 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Closes the current container using tree_close().
|
|
|
|
*
|
|
|
|
*/
|
2010-03-27 10:25:51 -04:00
|
|
|
void tree_close_con();
|
2010-07-13 05:35:05 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Changes focus in the given way (next/previous) and given orientation
|
|
|
|
* (horizontal/vertical).
|
|
|
|
*
|
|
|
|
*/
|
2010-03-27 10:25:51 -04:00
|
|
|
void tree_next(char way, orientation_t orientation);
|
2010-07-13 05:35:05 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Moves the current container in the given way (next/previous) and given
|
|
|
|
* orientation (horizontal/vertical).
|
|
|
|
*
|
|
|
|
*/
|
2010-03-27 10:25:51 -04:00
|
|
|
void tree_move(char way, orientation_t orientation);
|
2010-07-13 05:35:05 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Closes the given container including all children
|
|
|
|
*
|
|
|
|
*/
|
2010-05-14 18:16:59 -04:00
|
|
|
void tree_close(Con *con, bool kill_window);
|
2010-07-13 05:35:05 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Loads tree from ~/.i3/_restart.json (used for in-place restarts).
|
|
|
|
*
|
|
|
|
*/
|
2010-03-27 10:25:51 -04:00
|
|
|
bool tree_restore();
|
|
|
|
|
|
|
|
#endif
|