1#ifndef TYPES_H
2#define TYPES_H
3
4#include <stdbool.h>
5#include <stdint.h>
6
7#include <swc.h>
8#include <wayland-server.h>
9
10enum {
11 BTN_LEFT = 0x110,
12 BTN_RIGHT = 0x111,
13 BTN_MIDDLE = 0x112,
14};
15
16enum {
17 MOD1 = SWC_MOD_ALT,
18 MOD4 = SWC_MOD_LOGO,
19 SHFT = SWC_MOD_SHIFT,
20 CTRL = SWC_MOD_CTRL,
21};
22
23union arg {
24 int i;
25 uint32_t ui;
26 float f;
27 const void* v;
28};
29
30struct bind {
31 uint32_t type;
32 uint32_t mods;
33 uint32_t ksym;
34 union arg arg;
35 void (*fn)(void* data, uint32_t time, uint32_t value, uint32_t state);
36};
37
38struct client {
39 struct wl_list link;
40 struct swc_window* win;
41 struct screen* scr;
42 bool fullscreen;
43 int32_t x;
44 int32_t y;
45 uint32_t w;
46 uint32_t h;
47 uint32_t ws;
48};
49
50struct config {
51 bool decor_enabled;
52 struct swc_decor decor;
53 uint32_t motion_throttle_hz;
54 uint32_t border_col_active;
55 uint32_t border_col_normal;
56 uint32_t border_width;
57};
58
59struct screen {
60 struct wl_list link;
61 struct swc_screen* scr;
62};
63
64struct wm {
65 struct wl_display* dpy;
66 struct wl_event_loop* ev_loop;
67
68 struct wl_list screens;
69 struct wl_list clients;
70
71 struct screen* sel_screen;
72 struct client* sel_client;
73 uint8_t ws;
74};
75
76#endif /* TYPES_H */