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.
30 #include <xcb/randr.h>
31 #include <xcb/xcb_event.h>
34 #define MISSING_VALUE "N/A"
61 CLIENT_MODE_AUTOMATIC,
136 DESKTOP_STATUS_OCCUPIED
151 desktop_status_t status;
158 char class_name[3 * SMALEN / 2];
159 char instance_name[3 * SMALEN / 2];
160 unsigned int border_width;
164 bool locked; /* protects window from being closed */
169 xcb_rectangle_t floating_rectangle;
170 xcb_rectangle_t tiled_rectangle;
175 xcb_atom_t wm_state[MAX_STATE];
179 typedef struct node_t node_t;
181 split_type_t split_type;
183 split_mode_t split_mode;
184 direction_t split_dir;
186 xcb_rectangle_t rectangle;
187 bool vacant; /* vacant nodes only hold floating clients */
190 node_t *second_child;
192 client_t *client; /* NULL except for leaves */
195 typedef struct desktop_t desktop_t;
208 unsigned int border_width;
212 typedef struct monitor_t monitor_t;
215 xcb_randr_output_t id;
216 xcb_rectangle_t rectangle;
224 desktop_t *desk_head;
225 desktop_t *desk_tail;
237 typedef struct history_t history_t;
245 typedef struct stacking_list_t stacking_list_t;
246 struct stacking_list_t {
248 stacking_list_t *prev;
249 stacking_list_t *next;
252 typedef struct subscriber_list_t subscriber_list_t;
253 struct subscriber_list_t {
256 subscriber_list_t *prev;
257 subscriber_list_t *next;
260 typedef struct rule_t rule_t;
270 char class_name[3 * SMALEN / 2];
271 char instance_name[3 * SMALEN / 2];
272 char monitor_desc[MAXLEN];
273 char desktop_desc[MAXLEN];
274 char node_desc[MAXLEN];
275 char split_dir[SMALEN];
292 } rule_consequence_t;
294 typedef struct pending_rule_t pending_rule_t;
295 struct pending_rule_t {
298 rule_consequence_t *csq;
299 pending_rule_t *prev;
300 pending_rule_t *next;
304 xcb_point_t position;
305 pointer_action_t action;
306 xcb_rectangle_t rectangle;
307 node_t *vertical_fence;
308 node_t *horizontal_fence;
315 double vertical_ratio;
316 double horizontal_ratio;
323 unsigned int distance;