]> git.lizzy.rs Git - bspwm.git/blob - tree.h
Consolidate focus_follows_pointer
[bspwm.git] / tree.h
1 /* Copyright (c) 2012, Bastien Dejean
2  * All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are met:
6  *
7  * 1. Redistributions of source code must retain the above copyright notice, this
8  *    list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright notice,
10  *    this list of conditions and the following disclaimer in the documentation
11  *    and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
14  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
17  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
18  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
19  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
20  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
22  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23  */
24
25 #ifndef BSPWM_TREE_H
26 #define BSPWM_TREE_H
27
28 void arrange(monitor_t *m, desktop_t *d);
29 void apply_layout(monitor_t *m, desktop_t *d, node_t *n, xcb_rectangle_t rect, xcb_rectangle_t root_rect);
30 presel_t *make_presel(void);
31 void set_ratio(node_t *n, double rat);
32 void presel_dir(monitor_t *m, desktop_t *d, node_t *n, direction_t dir);
33 void presel_ratio(monitor_t *m, desktop_t *d, node_t *n, double ratio);
34 void cancel_presel(monitor_t *m, desktop_t *d, node_t *n);
35 node_t *find_public(desktop_t *d);
36 node_t *insert_node(monitor_t *m, desktop_t *d, node_t *n, node_t *f);
37 void insert_receptacle(monitor_t *m, desktop_t *d, node_t *n);
38 bool activate_node(monitor_t *m, desktop_t *d, node_t *n);
39 void transfer_sticky_nodes(monitor_t *m, desktop_t *ds, desktop_t *dd, node_t *n);
40 bool focus_node(monitor_t *m, desktop_t *d, node_t *n);
41 void update_focused(void);
42 void hide_node(node_t *n);
43 void show_node(node_t *n);
44 node_t *make_node(uint32_t id);
45 client_t *make_client(void);
46 void initialize_client(node_t *n);
47 bool is_focusable(node_t *n);
48 bool is_leaf(node_t *n);
49 bool is_first_child(node_t *n);
50 bool is_second_child(node_t *n);
51 unsigned int clients_count_in(node_t *n);
52 node_t *brother_tree(node_t *n);
53 node_t *first_extrema(node_t *n);
54 node_t *second_extrema(node_t *n);
55 node_t *first_focusable_leaf(node_t *n);
56 node_t *next_leaf(node_t *n, node_t *r);
57 node_t *prev_leaf(node_t *n, node_t *r);
58 node_t *next_tiled_leaf(node_t *n, node_t *r);
59 node_t *prev_tiled_leaf(node_t *n, node_t *r);
60 bool is_adjacent(node_t *a, node_t *b, direction_t dir);
61 node_t *find_fence(node_t *n, direction_t dir);
62 node_t *nearest_neighbor(monitor_t *m, desktop_t *d, node_t *n, direction_t dir, node_select_t sel);
63 bool is_child(node_t *a, node_t *b);
64 bool is_descendant(node_t *a, node_t *b);
65 bool find_by_id(uint32_t id, coordinates_t *loc);
66 node_t *find_by_id_in(node_t *r, uint32_t id);
67 node_t *nearest_from_tree(monitor_t *m, desktop_t *d, node_t *n, direction_t dir, node_select_t sel);
68 node_t *nearest_from_history(monitor_t *m, desktop_t *d, node_t *n, direction_t dir, node_select_t sel);
69 node_t *nearest_from_distance(monitor_t *m, desktop_t *d, node_t *n, direction_t dir, node_select_t sel);
70 void get_opposite(direction_t src, direction_t *dst);
71 unsigned int node_area(desktop_t *d, node_t *n);
72 int tiled_count(node_t *n);
73 node_t *find_biggest(monitor_t *m, desktop_t *d, node_t *n, node_select_t sel);
74 void rotate_tree(node_t *n, int deg);
75 void rotate_brother(node_t *n);
76 void unrotate_tree(node_t *n, int rot);
77 void unrotate_brother(node_t *n);
78 void flip_tree(node_t *n, flip_t flp);
79 void equalize_tree(node_t *n);
80 int balance_tree(node_t *n);
81 void unlink_node(monitor_t *m, desktop_t *d, node_t *n);
82 void close_node(node_t *n);
83 void kill_node(monitor_t *m, desktop_t *d, node_t *n);
84 void remove_node(monitor_t *m, desktop_t *d, node_t *n);
85 void destroy_tree(monitor_t *m, desktop_t *d, node_t *n);
86 bool swap_nodes(monitor_t *m1, desktop_t *d1, node_t *n1, monitor_t *m2, desktop_t *d2, node_t *n2);
87 bool transfer_node(monitor_t *ms, desktop_t *ds, node_t *ns, monitor_t *md, desktop_t *dd, node_t *nd);
88 node_t *closest_node(monitor_t *m, desktop_t *d, node_t *n, cycle_dir_t dir, node_select_t sel);
89 void circulate_leaves(monitor_t *m, desktop_t *d, node_t *n, circulate_dir_t dir);
90 void set_vacant(monitor_t *m, desktop_t *d, node_t *n, bool value);
91 void set_vacant_local(monitor_t *m, desktop_t *d, node_t *n, bool value);
92 void propagate_vacant_downward(monitor_t *m, desktop_t *d, node_t *n, bool value);
93 void propagate_vacant_upward(monitor_t *m, desktop_t *d, node_t *n);
94 bool set_layer(monitor_t *m, desktop_t *d, node_t *n, stack_layer_t l);
95 bool set_state(monitor_t *m, desktop_t *d, node_t *n, client_state_t s);
96 void set_floating(monitor_t *m, desktop_t *d, node_t *n, bool value);
97 void set_fullscreen(monitor_t *m, desktop_t *d, node_t *n, bool value);
98 void neutralize_occluding_windows(monitor_t *m, desktop_t *d, node_t *n);
99 void propagate_flags_upward(monitor_t *m, desktop_t *d, node_t *n);
100 void set_hidden(monitor_t *m, desktop_t *d, node_t *n, bool value);
101 void set_hidden_local(monitor_t *m, desktop_t *d, node_t *n, bool value);
102 void propagate_hidden_downward(monitor_t *m, desktop_t *d, node_t *n, bool value);
103 void propagate_hidden_upward(monitor_t *m, desktop_t *d, node_t *n);
104 void set_sticky(monitor_t *m, desktop_t *d, node_t *n, bool value);
105 void set_private(monitor_t *m, desktop_t *d, node_t *n, bool value);
106 void set_locked(monitor_t *m, desktop_t *d, node_t *n, bool value);
107 void set_urgent(monitor_t *m, desktop_t *d, node_t *n, bool value);
108 bool contains(xcb_rectangle_t a, xcb_rectangle_t b);
109 xcb_rectangle_t get_rectangle(desktop_t *d, node_t *n);
110 void get_side_handle(desktop_t *d, node_t *n, direction_t dir, xcb_point_t *pt);
111 void listen_enter_notify(node_t *n, bool enable);
112
113 unsigned int sticky_count(node_t *n);
114 unsigned int private_count(node_t *n);
115 unsigned int locked_count(node_t *n);
116
117 #endif