1 /* Copyright (c) 2012-2014, 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.
24 * The views and conclusions contained in the software and documentation are those
25 * of the authors and should not be interpreted as representing official policies,
26 * either expressed or implied, of the FreeBSD Project.
34 #include <xcb/randr.h>
35 #include <xcb/xcb_event.h>
38 #define MISSING_VALUE "N/A"
65 CLIENT_MODE_AUTOMATIC,
139 DESKTOP_STATUS_OCCUPIED
149 desktop_status_t status;
156 char class_name[3 * SMALEN / 2];
157 char instance_name[3 * SMALEN / 2];
158 unsigned int border_width;
162 bool locked; /* protects window from being closed */
167 xcb_rectangle_t floating_rectangle;
168 xcb_rectangle_t tiled_rectangle;
173 xcb_atom_t wm_state[MAX_STATE];
177 typedef struct node_t node_t;
179 split_type_t split_type;
181 split_mode_t split_mode;
182 direction_t split_dir;
184 xcb_rectangle_t rectangle;
185 bool vacant; /* vacant nodes only hold floating clients */
188 node_t *second_child;
190 client_t *client; /* NULL except for leaves */
193 typedef struct desktop_t desktop_t;
206 unsigned int border_width;
210 typedef struct monitor_t monitor_t;
213 xcb_randr_output_t id;
214 xcb_rectangle_t rectangle;
222 desktop_t *desk_head;
223 desktop_t *desk_tail;
235 typedef struct history_t history_t;
243 typedef struct stacking_list_t stacking_list_t;
244 struct stacking_list_t {
246 stacking_list_t *prev;
247 stacking_list_t *next;
250 typedef struct subscriber_list_t subscriber_list_t;
251 struct subscriber_list_t {
254 subscriber_list_t *prev;
255 subscriber_list_t *next;
258 typedef struct rule_t rule_t;
268 char class_name[3 * SMALEN / 2];
269 char instance_name[3 * SMALEN / 2];
270 char monitor_desc[MAXLEN];
271 char desktop_desc[MAXLEN];
272 char node_desc[MAXLEN];
273 char split_dir[SMALEN];
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;