1 /* Copyright (c) 2012, Bastien Dejean
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met:
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.
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.
29 #include <xcb/randr.h>
30 #include <xcb/xcb_event.h>
33 #define MISSING_VALUE "N/A"
34 #define MAX_WM_STATES 4
130 option_bool_t automatic;
131 option_bool_t focused;
135 option_bool_t pseudo_tiled;
136 option_bool_t floating;
137 option_bool_t fullscreen;
138 option_bool_t locked;
139 option_bool_t sticky;
140 option_bool_t private;
141 option_bool_t urgent;
142 option_bool_t same_class;
144 option_bool_t normal;
149 option_bool_t occupied;
150 option_bool_t focused;
151 option_bool_t urgent;
156 option_bool_t occupied;
157 option_bool_t focused;
161 char class_name[3 * SMALEN / 2];
162 char instance_name[3 * SMALEN / 2];
163 unsigned int border_width;
165 client_state_t state;
166 client_state_t last_state;
168 stack_layer_t last_layer;
169 xcb_rectangle_t floating_rectangle;
170 xcb_rectangle_t tiled_rectangle;
177 xcb_atom_t wm_state[MAX_WM_STATES];
181 typedef struct presel_t presel_t;
184 direction_t split_dir;
185 xcb_window_t feedback;
188 typedef struct node_t node_t;
191 split_type_t split_type;
195 xcb_rectangle_t rectangle;
201 node_t *second_child;
206 typedef struct desktop_t desktop_t;
219 unsigned int border_width;
222 typedef struct monitor_t monitor_t;
225 xcb_randr_output_t id;
232 unsigned int sticky_count;
233 xcb_rectangle_t rectangle;
235 desktop_t *desk_head;
236 desktop_t *desk_tail;
247 typedef struct history_t history_t;
255 typedef struct stacking_list_t stacking_list_t;
256 struct stacking_list_t {
258 stacking_list_t *prev;
259 stacking_list_t *next;
262 typedef struct subscriber_list_t subscriber_list_t;
263 struct subscriber_list_t {
267 subscriber_list_t *prev;
268 subscriber_list_t *next;
271 typedef struct rule_t rule_t;
273 char class_name[MAXLEN];
274 char instance_name[MAXLEN];
282 char class_name[3 * SMALEN / 2];
283 char instance_name[3 * SMALEN / 2];
284 char monitor_desc[MAXLEN];
285 char desktop_desc[MAXLEN];
286 char node_desc[MAXLEN];
287 char split_dir[SMALEN];
289 stack_layer_t *layer;
290 client_state_t *state;
303 } rule_consequence_t;
305 typedef struct pending_rule_t pending_rule_t;
306 struct pending_rule_t {
309 rule_consequence_t *csq;
310 pending_rule_t *prev;
311 pending_rule_t *next;
315 xcb_point_t position;
316 pointer_action_t action;
317 xcb_rectangle_t rectangle;
318 node_t *vertical_fence;
319 node_t *horizontal_fence;
326 double vertical_ratio;
327 double horizontal_ratio;
334 unsigned int distance;