]> git.lizzy.rs Git - bspwm.git/blob - types.h
Status: read from fifo
[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 fullscreen;
64     bool locked;
65 } client_t;
66
67 typedef struct node_t node_t;
68 struct node_t {
69     split_type_t split_type;
70     double split_ratio;
71     xcb_rectangle_t rectangle;
72     bool vacant; /* vacant nodes only hold floating clients */
73     node_t *first_child;
74     node_t *second_child;
75     node_t *parent;
76     client_t *client; /* NULL except for leaves */
77 };
78
79 typedef struct desktop_t desktop_t;
80 struct desktop_t {
81     char *name;
82     layout_t layout;
83     node_t *root;
84     node_t *focus;
85     node_t *last_focus;
86     desktop_t *prev;
87     desktop_t *next;
88 };
89
90 typedef struct rule_t rule_t;
91 struct rule_t {
92     char *class_name;
93     char *instance_name;
94     char *win_title;
95     bool floating;
96     bool fullscreen;
97     bool locked;
98     rule_t *next;
99 };
100
101 typedef struct {
102     node_t *node;
103     desktop_t *desktop;
104 } window_location_t;
105
106 node_t *make_node(void);
107 desktop_t *make_desktop(void);
108 client_t *make_client(xcb_window_t);
109
110 #endif