2 * vim:ts=4:sw=4:expandtab
4 * i3 - an improved dynamic tiling window manager
5 * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
7 * tree.c: Everything that primarily modifies the layout tree data structure.
14 /* TODO: i am not sure yet how much access to the focused container should
15 * be permitted to source files */
17 TAILQ_HEAD(all_cons_head, Con);
18 extern struct all_cons_head all_cons;
21 * Initializes the tree by creating the root node, adding all RandR outputs
22 * to the tree (that means randr_init() has to be called before) and
23 * assigning a workspace to each RandR output.
26 void tree_init(xcb_get_geometry_reply_t *geometry);
29 * Opens an empty container in the current container
32 Con *tree_open_con(Con *con, i3Window *window);
35 * Splits (horizontally or vertically) the given container by creating a new
36 * container which contains the old one and the future ones.
39 void tree_split(Con *con, orientation_t orientation);
42 * Moves focus one level up.
48 * Moves focus one level down.
54 * Renders the tree, that is rendering all outputs using render_con() and
55 * pushing the changes to X11 using x_push_changes().
61 * Closes the current container using tree_close().
64 void tree_close_con(kill_window_t kill_window);
67 * Changes focus in the given way (next/previous) and given orientation
68 * (horizontal/vertical).
71 void tree_next(char way, orientation_t orientation);
74 * Closes the given container including all children.
75 * Returns true if the container was killed or false if just WM_DELETE was sent
76 * and the window is expected to kill itself.
78 * The dont_kill_parent flag is specified when the function calls itself
79 * recursively while deleting a containers children.
81 * The force_set_focus flag is specified in the case of killing a floating
82 * window: tree_close() will be invoked for the CT_FLOATINGCON (the parent
83 * container) and focus should be set there.
86 bool tree_close(Con *con, kill_window_t kill_window, bool dont_kill_parent, bool force_set_focus);
89 * Loads tree from ~/.i3/_restart.json (used for in-place restarts).
92 bool tree_restore(const char *path, xcb_get_geometry_reply_t *geometry);
95 * tree_flatten() removes pairs of redundant split containers, e.g.:
96 * [workspace, horizontal]
100 * In this example, the v-split and h-split container are redundant.
101 * Such a situation can be created by moving containers in a direction which is
102 * not the orientation of their parent container. i3 needs to create a new
103 * split container then and if you move containers this way multiple times,
104 * redundant chains of split-containers can be the result.
107 void tree_flatten(Con *child);