1 /* * Copyright (c) 2012-2013 Bastien Dejean
4 * Redistribution and use in source and binary forms, with or without modification,
5 * are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright notice, this
8 * list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright notice,
10 * this list of conditions and the following disclaimer in the documentation and/or
11 * other materials provided with the distribution.
13 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 ON
20 * 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"
139 DESKTOP_STATUS_OCCUPIED
149 desktop_status_t status;
156 char class_name[SMALEN];
157 unsigned int border_width;
159 bool transient; /* transient window are always floating */
161 bool locked; /* protects window from being closed */
167 xcb_rectangle_t floating_rectangle;
168 xcb_rectangle_t tiled_rectangle;
169 xcb_atom_t wm_state[MAX_STATE];
173 typedef struct node_t node_t;
175 split_type_t split_type;
177 split_mode_t split_mode;
178 direction_t split_dir;
180 xcb_rectangle_t rectangle;
181 bool vacant; /* vacant nodes only hold floating clients */
184 node_t *second_child;
186 client_t *client; /* NULL except for leaves */
189 typedef struct desktop_t desktop_t;
198 unsigned int border_width;
202 typedef struct monitor_t monitor_t;
205 xcb_randr_output_t id;
206 xcb_rectangle_t rectangle;
214 desktop_t *desk_head;
215 desktop_t *desk_tail;
227 typedef struct history_t history_t;
235 typedef struct stacking_list_t stacking_list_t;
236 struct stacking_list_t {
238 stacking_list_t *prev;
239 stacking_list_t *next;
242 typedef struct subscriber_list_t subscriber_list_t;
243 struct subscriber_list_t {
246 subscriber_list_t *prev;
247 subscriber_list_t *next;
250 typedef struct rule_t rule_t;
260 char class_name[SMALEN];
261 char instance_name[SMALEN];
262 char desktop_desc[MAXLEN];
263 char monitor_desc[MAXLEN];
276 } rule_consequence_t;
278 typedef struct pending_rule_t pending_rule_t;
279 struct pending_rule_t {
282 rule_consequence_t *csq;
283 pending_rule_t *prev;
284 pending_rule_t *next;
288 xcb_point_t position;
289 pointer_action_t action;
290 xcb_rectangle_t rectangle;
291 node_t *vertical_fence;
292 node_t *horizontal_fence;
299 double vertical_ratio;
300 double horizontal_ratio;
307 unsigned int distance;