]> git.lizzy.rs Git - bspwm.git/blob - types.h
Indicate mouse bindings
[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 DEFAULT_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     CYCLE_NEXT,
44     CYCLE_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 enum {
61     TOP_LEFT,
62     TOP_RIGHT,
63     BOTTOM_LEFT,
64     BOTTOM_RIGHT
65 } corner_t;
66
67 typedef struct {
68     xcb_window_t window;
69     bool floating;
70     bool transient;  /* transient window are always floating */
71     bool fullscreen;
72     bool locked;     /* protects window from being closed */
73     bool urgent;
74     xcb_rectangle_t floating_rectangle;
75     xcb_rectangle_t tiled_rectangle;
76 } client_t;
77
78 typedef struct node_t node_t;
79 struct node_t {
80     split_type_t split_type;
81     double split_ratio;
82     xcb_rectangle_t rectangle;
83     bool vacant;          /* vacant nodes only hold floating clients */
84     split_mode_t born_as;
85     node_t *first_child;
86     node_t *second_child;
87     node_t *parent;
88     client_t *client;     /* NULL except for leaves */
89 };
90
91 typedef struct desktop_t desktop_t;
92 struct desktop_t {
93     char name[MAXLEN];
94     layout_t layout;
95     node_t *root;
96     node_t *focus;
97     node_t *last_focus;
98     desktop_t *prev;
99     desktop_t *next;
100 };
101
102 typedef struct {
103     char name[MAXLEN];
104 } rule_cause_t;
105
106 typedef struct {
107     bool floating;
108     char desk_name[MAXLEN];
109 } rule_effect_t;
110
111 typedef struct rule_t rule_t;
112 struct rule_t {
113     rule_cause_t cause;
114     rule_effect_t effect;
115     rule_t *next;
116 };
117
118 typedef struct {
119     node_t *node;
120     desktop_t *desktop;
121 } window_location_t;
122
123 typedef struct {
124     xcb_point_t position;
125     xcb_button_t button;
126     xcb_rectangle_t rectangle;
127     desktop_t *desktop;
128     node_t *node;
129     corner_t corner;
130 } pointer_state_t;
131
132 node_t *make_node(void);
133 desktop_t *make_desktop(const char *);
134 client_t *make_client(xcb_window_t);
135 rule_t *make_rule(void);
136 pointer_state_t *make_pointer_state(void);
137
138 #endif