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"
131 option_bool_t pseudo_tiled;
132 option_bool_t floating;
133 option_bool_t fullscreen;
134 option_bool_t locked;
135 option_bool_t sticky;
136 option_bool_t private;
137 option_bool_t urgent;
138 option_bool_t same_class;
139 option_bool_t automatic;
141 option_bool_t focused;
142 stack_layer_t *layer;
146 option_bool_t occupied;
147 option_bool_t urgent;
153 char class_name[3 * SMALEN / 2];
154 char instance_name[3 * SMALEN / 2];
155 unsigned int border_width;
156 bool locked; /* protects window from being closed */
162 client_state_t state;
163 client_state_t last_state;
165 stack_layer_t last_layer;
166 xcb_rectangle_t floating_rectangle;
167 xcb_rectangle_t tiled_rectangle;
172 xcb_atom_t wm_state[MAX_STATE];
176 typedef struct node_t node_t;
178 split_type_t split_type;
180 split_mode_t split_mode;
181 direction_t split_dir;
183 xcb_rectangle_t rectangle;
184 bool vacant; /* vacant nodes only hold floating clients */
187 node_t *second_child;
189 client_t *client; /* NULL except for leaves */
192 typedef struct desktop_t desktop_t;
205 unsigned int border_width;
208 typedef struct monitor_t monitor_t;
211 xcb_randr_output_t id;
212 xcb_rectangle_t rectangle;
220 desktop_t *desk_head;
221 desktop_t *desk_tail;
233 typedef struct history_t history_t;
241 typedef struct stacking_list_t stacking_list_t;
242 struct stacking_list_t {
244 stacking_list_t *prev;
245 stacking_list_t *next;
248 typedef struct subscriber_list_t subscriber_list_t;
249 struct subscriber_list_t {
253 subscriber_list_t *prev;
254 subscriber_list_t *next;
257 typedef struct rule_t rule_t;
267 char class_name[3 * SMALEN / 2];
268 char instance_name[3 * SMALEN / 2];
269 char monitor_desc[MAXLEN];
270 char desktop_desc[MAXLEN];
271 char node_desc[MAXLEN];
272 char split_dir[SMALEN];
273 stack_layer_t *layer;
274 client_state_t *state;
288 } rule_consequence_t;
290 typedef struct pending_rule_t pending_rule_t;
291 struct pending_rule_t {
294 rule_consequence_t *csq;
295 pending_rule_t *prev;
296 pending_rule_t *next;
300 xcb_point_t position;
301 pointer_action_t action;
302 xcb_rectangle_t rectangle;
303 node_t *vertical_fence;
304 node_t *horizontal_fence;
311 double vertical_ratio;
312 double horizontal_ratio;
319 unsigned int distance;