]> git.lizzy.rs Git - bspwm.git/blob - types.h
5afaeee3d2876e8f519dce169202f7b1b0e2b900
[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 DEFAULT_NAME "one"
9
10 typedef enum {
11     TYPE_HORIZONTAL,
12     TYPE_VERTICAL
13 } split_type_t;
14
15 typedef enum {
16     MODE_AUTOMATIC,
17     MODE_MANUAL
18 } split_mode_t;
19
20 typedef enum {
21     LAYOUT_TILED,
22     LAYOUT_MONOCLE
23 } layout_t;
24
25 typedef enum {
26     MOVE_PULL,
27     MOVE_PUSH
28 } fence_move_t;
29
30 typedef enum {
31     CHANGE_INCREASE,
32     CHANGE_DECREASE
33 } value_change_t;
34
35 typedef enum {
36     SKIP_NONE,
37     SKIP_FLOATING,
38     SKIP_TILED
39 } skip_client_t;
40
41 typedef enum {
42     DIR_NEXT,
43     DIR_PREV
44 } cycle_dir_t;
45
46 typedef enum {
47     ROTATE_CLOCK_WISE,
48     ROTATE_COUNTER_CW,
49     ROTATE_FULL_CYCLE
50 } rotate_t;
51
52 typedef enum {
53     DIR_LEFT,
54     DIR_UP,
55     DIR_RIGHT,
56     DIR_DOWN
57 } direction_t;
58
59 typedef struct {
60     xcb_window_t window;
61     bool floating;
62     bool fullscreen;
63     bool locked;
64 } client_t;
65
66 typedef struct node_t node_t;
67 struct node_t {
68     split_type_t split_type;
69     double split_ratio;
70     xcb_rectangle_t rectangle;
71     bool vacant; /* vacant nodes only hold floating clients */
72     node_t *first_child;
73     node_t *second_child;
74     node_t *parent;
75     /* the value of the following properties is NULL except for leaves: */
76     client_t *client; 
77     node_t *prev_leaf;
78     node_t *next_leaf;
79 };
80
81 typedef struct rule_t rule_t;
82 struct rule_t {
83     char *class_name;
84     char *desk_name;
85     bool floating;
86     bool fullscreen;
87     bool locked;
88     rule_t *next;
89 };
90
91 typedef struct desktop_t desktop_t;
92 struct desktop_t {
93     char *name;
94     layout_t layout;
95     node_t *root;
96     node_t *view; /* initially view = root, can be changed by zooming */
97     node_t *focus;
98     node_t *last_focus;
99     node_t *head; /* first element in the list of leaves */
100     node_t *tail;
101     desktop_t *prev;
102     desktop_t *next;
103 };
104
105 node_t *make_node(void);
106 desktop_t *make_desktop(void);
107 client_t *make_client(void);
108
109 #endif