]> git.lizzy.rs Git - bspwm.git/blob - types.h
Fix hang related to SIGCHLD
[bspwm.git] / types.h
1 #ifndef _TYPES_H
2 #define _TYPES_H
3
4 #include <xcb/xcb.h>
5 #include <xcb/xcb_event.h>
6 #include "helpers.h"
7
8 #define SPLIT_RATIO  0.5
9 #define DESK_NAME    "One"
10
11 typedef enum {
12     TYPE_HORIZONTAL,
13     TYPE_VERTICAL
14 } split_type_t;
15
16 typedef enum {
17     MODE_AUTOMATIC,
18     MODE_MANUAL
19 } split_mode_t;
20
21 typedef enum {
22     LAYOUT_TILED,
23     LAYOUT_MONOCLE
24 } layout_t;
25
26 typedef enum {
27     MOVE_PULL,
28     MOVE_PUSH
29 } fence_move_t;
30
31 typedef enum {
32     CHANGE_INCREASE,
33     CHANGE_DECREASE
34 } value_change_t;
35
36 typedef enum {
37     SKIP_NONE,
38     SKIP_FLOATING,
39     SKIP_TILED
40 } skip_client_t;
41
42 typedef enum {
43     DIR_NEXT,
44     DIR_PREV
45 } cycle_dir_t;
46
47 typedef enum {
48     ROTATE_CLOCKWISE,
49     ROTATE_COUNTER_CLOCKWISE,
50     ROTATE_FULL_CYCLE
51 } rotate_t;
52
53 typedef enum {
54     DIR_LEFT,
55     DIR_RIGHT,
56     DIR_UP,
57     DIR_DOWN
58 } direction_t;
59
60 typedef struct {
61     xcb_window_t window;
62     bool floating;
63     bool transient; /* transient window are always floating */
64     bool fullscreen;
65     bool locked; /* protects window from being closed */
66     xcb_rectangle_t rectangle;
67 } client_t;
68
69 typedef struct node_t node_t;
70 struct node_t {
71     split_type_t split_type;
72     double split_ratio;
73     xcb_rectangle_t rectangle;
74     bool vacant; /* vacant nodes only hold floating clients */
75     node_t *first_child;
76     node_t *second_child;
77     node_t *parent;
78     client_t *client; /* NULL except for leaves */
79 };
80
81 typedef struct desktop_t desktop_t;
82 struct desktop_t {
83     char name[MAXLEN];
84     layout_t layout;
85     node_t *root;
86     node_t *focus;
87     node_t *last_focus;
88     desktop_t *prev;
89     desktop_t *next;
90 };
91
92 typedef struct {
93     char name[MAXLEN];
94 } rule_cause_t;
95
96 typedef struct {
97     bool floating;
98     char desk_name[MAXLEN];
99 } rule_effect_t;
100
101 typedef struct rule_t rule_t;
102 struct rule_t {
103     rule_cause_t cause;
104     rule_effect_t effect;
105     rule_t *next;
106 };
107
108 typedef struct {
109     node_t *node;
110     desktop_t *desktop;
111 } window_location_t;
112
113 node_t *make_node(void);
114 desktop_t *make_desktop(const char *);
115 client_t *make_client(xcb_window_t);
116 rule_t *make_rule(void);
117
118 #endif