]> git.lizzy.rs Git - bspwm.git/blob - types.h
Only one layer
[bspwm.git] / types.h
1 #ifndef _TYPES_H
2 #define _TYPES_H
3
4 #include <stdlib.h>
5 #include <xcb/xcb.h>
6 #include <xcb/xcb_event.h>
7 #include "utils.h"
8
9 typedef enum {
10     LAYOUT_TILED,
11     LAYOUT_MAX
12 } layout_t;
13
14 typedef enum {
15     TYPE_HORIZONTAL,
16     TYPE_VERTICAL
17 } split_type_t;
18
19 typedef enum {
20     MODE_AUTOMATIC,
21     MODE_MANUAL
22 } split_mode_t;
23
24 typedef enum {
25     ROTATE_CLOCK_WISE,
26     ROTATE_COUNTER_CW,
27     ROTATE_FULL_CYCLE
28 } rotate_t;
29
30 typedef enum {
31     DIR_LEFT,
32     DIR_UP,
33     DIR_RIGHT,
34     DIR_DOWN
35 } direction_t;
36
37 typedef struct {
38     xcb_window_t window;
39     bool floating;
40     bool fullscreen;
41     bool urgent;
42     bool locked;
43 } Client;
44
45 typedef struct Node Node;
46 struct Node {
47     split_type_t split_type;
48     double split_ratio;
49     xcb_rectangle_t rectangle;
50     Node *first_child;
51     Node *second_child;
52     Node *parent;
53     Client *client; /* equals NULL except for leaves */
54 };
55
56 typedef struct NodeFocusHistory NodeFocusHistory;
57 struct NodeFocusHistory {
58     Node *node;
59     NodeFocusHistory *prev;
60 };
61
62 typedef struct {
63     Node *root;
64     Node *focus;
65     NodeFocusHistory *focus_history;
66 } Layer;
67
68 typedef struct Desktop Desktop;
69 struct Desktop {
70     char *name;
71     layout_t layout;
72     Layer layer;
73     Desktop *previous;
74     Desktop *next;
75 };
76
77 Node *make_node(void);
78 Desktop *make_desktop(void);
79
80 #endif