]> git.lizzy.rs Git - bspwm.git/blob - types.h
Rules, XDG config & autostart
[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_CLOCK_WISE,
49     ROTATE_COUNTER_CW,
50     ROTATE_FULL_CYCLE
51 } rotate_t;
52
53 typedef enum {
54     DIR_LEFT,
55     DIR_UP,
56     DIR_RIGHT,
57     DIR_DOWN
58 } direction_t;
59
60 typedef struct {
61     xcb_window_t window;
62     bool floating;
63     bool transient;
64     bool fullscreen;
65     bool locked;
66 } client_t;
67
68 typedef struct node_t node_t;
69 struct node_t {
70     split_type_t split_type;
71     double split_ratio;
72     xcb_rectangle_t rectangle;
73     bool vacant; /* vacant nodes only hold floating clients */
74     node_t *first_child;
75     node_t *second_child;
76     node_t *parent;
77     client_t *client; /* NULL except for leaves */
78 };
79
80 typedef struct desktop_t desktop_t;
81 struct desktop_t {
82     char name[MAXLEN];
83     layout_t layout;
84     node_t *root;
85     node_t *focus;
86     node_t *last_focus;
87     desktop_t *prev;
88     desktop_t *next;
89 };
90
91 typedef struct {
92     char *class_name;
93     char *instance_name;
94 } rule_cause_t;
95
96 typedef struct {
97     bool floating;
98     bool fullscreen;
99     bool locked;
100     bool centered;
101 } rule_effect_t;
102
103 typedef struct rule_t rule_t;
104 struct rule_t {
105     rule_cause_t cause;
106     rule_effect_t effect;
107     rule_t *next;
108 };
109
110 typedef struct {
111     node_t *node;
112     desktop_t *desktop;
113 } window_location_t;
114
115 node_t *make_node(void);
116 desktop_t *make_desktop(void);
117 client_t *make_client(xcb_window_t);
118 rule_t *make_rule(void);
119
120 #endif