i3
tree.h
Go to the documentation of this file.
1/*
2 * vim:ts=4:sw=4:expandtab
3 *
4 * i3 - an improved tiling window manager
5 * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
6 *
7 * tree.c: Everything that primarily modifies the layout tree data structure.
8 *
9 */
10#pragma once
11
12#include <config.h>
13
14extern Con *croot;
15/* TODO: i am not sure yet how much access to the focused container should
16 * be permitted to source files */
17extern Con *focused;
18TAILQ_HEAD(all_cons_head, Con);
19extern struct all_cons_head all_cons;
20
27void tree_init(xcb_get_geometry_reply_t *geometry);
28
33Con *tree_open_con(Con *con, i3Window *window);
34
40void tree_split(Con *con, orientation_t orientation);
41
46bool level_up(void);
47
52bool level_down(void);
53
59void tree_render(void);
60
65void tree_next(Con *con, direction_t direction);
66
71Con *get_tree_next_sibling(Con *con, position_t direction);
72
82bool tree_close_internal(Con *con, kill_window_t kill_window, bool dont_kill_parent);
83
88bool tree_restore(const char *path, xcb_get_geometry_reply_t *geometry);
89
103void tree_flatten(Con *child);
position_t
Definition data.h:63
orientation_t
Definition data.h:60
kill_window_t
parameter to specify whether tree_close_internal() and x_window_kill() should kill only this specific...
Definition data.h:73
direction_t
Definition data.h:56
#define TAILQ_HEAD(name, type)
Definition queue.h:318
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:66
void tree_flatten(Con *child)
tree_flatten() removes pairs of redundant split containers, e.g.: [workspace, horizontal] [v-split] [...
Definition tree.c:660
void tree_next(Con *con, direction_t direction)
Changes focus in the given direction.
Definition tree.c:596
bool level_up(void)
Moves focus one level up.
Definition tree.c:389
bool level_down(void)
Moves focus one level down.
Definition tree.c:412
Con * focused
Definition tree.c:13
Con * tree_open_con(Con *con, i3Window *window)
Opens an empty container in the current container.
Definition tree.c:149
bool tree_close_internal(Con *con, kill_window_t kill_window, bool dont_kill_parent)
Closes the given container including all children.
Definition tree.c:192
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:130
struct all_cons_head all_cons
Definition tree.c:15
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:455
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:330
Con * get_tree_next_sibling(Con *con, position_t direction)
Get the previous / next sibling.
Definition tree.c:638
Con * croot
Definition tree.c:12
A 'Window' is a type which contains an xcb_window_t and all the related information (hints like _NET_...
Definition data.h:424
A 'Con' represents everything from the X11 root window down to a single X11 window.
Definition data.h:643