]> git.lizzy.rs Git - bspwm.git/blob - types.h
Rotate the tree when unlinking, reload commands
[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     split_mode_t born_as; /* container node property used to when removing leaves */
76     node_t *first_child;
77     node_t *second_child;
78     node_t *parent;
79     client_t *client; /* NULL except for leaves */
80 };
81
82 typedef struct desktop_t desktop_t;
83 struct desktop_t {
84     char name[MAXLEN];
85     layout_t layout;
86     node_t *root;
87     node_t *focus;
88     node_t *last_focus;
89     desktop_t *prev;
90     desktop_t *next;
91 };
92
93 typedef struct {
94     char name[MAXLEN];
95 } rule_cause_t;
96
97 typedef struct {
98     bool floating;
99     char desk_name[MAXLEN];
100 } rule_effect_t;
101
102 typedef struct rule_t rule_t;
103 struct rule_t {
104     rule_cause_t cause;
105     rule_effect_t effect;
106     rule_t *next;
107 };
108
109 typedef struct {
110     node_t *node;
111     desktop_t *desktop;
112 } window_location_t;
113
114 node_t *make_node(void);
115 desktop_t *make_desktop(const char *);
116 client_t *make_client(xcb_window_t);
117 rule_t *make_rule(void);
118
119 #endif