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 */
166 xcb_rectangle_t floating_rectangle;
167 xcb_rectangle_t tiled_rectangle;
168 xcb_atom_t wm_state[MAX_STATE];
172 typedef struct node_t node_t;
174 split_type_t split_type;
176 split_mode_t split_mode;
177 direction_t split_dir;
179 xcb_rectangle_t rectangle;
180 bool vacant; /* vacant nodes only hold floating clients */
183 node_t *second_child;
185 client_t *client; /* NULL except for leaves */
188 typedef struct desktop_t desktop_t;
201 unsigned int border_width;
205 typedef struct monitor_t monitor_t;
208 xcb_randr_output_t id;
209 xcb_rectangle_t rectangle;
213 desktop_t *desk_head;
214 desktop_t *desk_tail;
226 typedef struct history_t history_t;
234 typedef struct stacking_list_t stacking_list_t;
235 struct stacking_list_t {
237 stacking_list_t *prev;
238 stacking_list_t *next;
241 typedef struct subscriber_list_t subscriber_list_t;
242 struct subscriber_list_t {
245 subscriber_list_t *prev;
246 subscriber_list_t *next;
249 typedef struct rule_t rule_t;
259 char class_name[SMALEN];
260 char instance_name[SMALEN];
261 char desktop_desc[MAXLEN];
262 char monitor_desc[MAXLEN];
274 } rule_consequence_t;
276 typedef struct pending_rule_t pending_rule_t;
277 struct pending_rule_t {
280 rule_consequence_t *csq;
281 pending_rule_t *prev;
282 pending_rule_t *next;
286 xcb_point_t position;
287 pointer_action_t action;
288 xcb_rectangle_t rectangle;
289 node_t *vertical_fence;
290 node_t *horizontal_fence;
297 double vertical_ratio;
298 double horizontal_ratio;
305 unsigned int distance;