i3
tree.h
Go to the documentation of this file.
1 /*
2  * vim:ts=4:sw=4:expandtab
3  *
4  * i3 - an improved dynamic tiling window manager
5  * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
6  *
7  * tree.c: Everything that primarily modifies the layout tree data structure.
8  *
9  */
10 #ifndef I3_TREE_H
11 #define I3_TREE_H
12 
13 extern Con *croot;
14 /* TODO: i am not sure yet how much access to the focused container should
15  * be permitted to source files */
16 extern Con *focused;
17 TAILQ_HEAD(all_cons_head, Con);
18 extern struct all_cons_head all_cons;
19 
26 void tree_init(xcb_get_geometry_reply_t *geometry);
27 
32 Con *tree_open_con(Con *con, i3Window *window);
33 
39 void tree_split(Con *con, orientation_t orientation);
40 
45 bool level_up(void);
46 
51 bool level_down(void);
52 
58 void tree_render(void);
59 
64 void tree_close_con(kill_window_t kill_window);
65 
71 void tree_next(char way, orientation_t orientation);
72 
86 bool tree_close(Con *con, kill_window_t kill_window, bool dont_kill_parent, bool force_set_focus);
87 
92 bool tree_restore(const char *path, xcb_get_geometry_reply_t *geometry);
93 
107 void tree_flatten(Con *child);
108 
109 #endif
A 'Con' represents everything from the X11 root window down to a single X11 window.
Definition: data.h:457
struct all_cons_head all_cons
Definition: tree.c:17
kill_window_t
parameter to specify whether tree_close() and x_window_kill() should kill only this specific window o...
Definition: data.h:61
struct Con * croot
Definition: tree.c:14
void tree_next(char way, orientation_t orientation)
Changes focus in the given way (next/previous) and given orientation (horizontal/vertical).
Definition: tree.c:667
bool tree_restore(const char *path, xcb_get_geometry_reply_t *geometry)
Loads tree from ~/.i3/_restart.json (used for in-place restarts).
Definition: tree.c:68
Con * tree_open_con(Con *con, i3Window *window)
Opens an empty container in the current container.
Definition: tree.c:136
A 'Window' is a type which contains an xcb_window_t and all the related information (hints like _NET_...
Definition: data.h:313
#define TAILQ_HEAD(name, type)
Definition: queue.h:306
void tree_flatten(Con *con)
tree_flatten() removes pairs of redundant split containers, e.g.
Definition: tree.c:684
bool tree_close(Con *con, kill_window_t kill_window, bool dont_kill_parent, bool force_set_focus)
Closes the given container including all children.
Definition: tree.c:192
bool level_up(void)
Moves focus one level up.
Definition: tree.c:436
orientation_t
Definition: data.h:56
Con * focused
Definition: tree.c:15
void tree_init(xcb_get_geometry_reply_t *geometry)
Initializes the tree by creating the root node, adding all RandR outputs to the tree (that means rand...
Definition: tree.c:116
void tree_render(void)
Renders the tree, that is rendering all outputs using render_con() and pushing the changes to X11 usi...
Definition: tree.c:501
bool level_down(void)
Moves focus one level down.
Definition: tree.c:459
void tree_close_con(kill_window_t kill_window)
Closes the current container using tree_close().
Definition: tree.c:360
void tree_split(Con *con, orientation_t orientation)
Splits (horizontally or vertically) the given container by creating a new container which contains th...
Definition: tree.c:380