1#ifndef TYPES_H
2#define TYPES_H
3
4#include <stdbool.h>
5#include <stdint.h>
6#include <signal.h>
7
8#include <wayland-server.h>
9#include <swc.h>
10
11#include "howl.h"
12
13struct config {
14 uint32_t mod;
15 uint32_t if_color;
16 uint32_t iu_color;
17 uint32_t of_color;
18 uint32_t ou_color;
19 int32_t ib_width;
20 int32_t ob_width;
21 char *tf;
22};
23
24struct client {
25 struct wl_list link;
26 struct swc_window *win;
27 struct screen *scr;
28
29 bool visible;
30 bool fullscreen;
31
32 int32_t x, y;
33 uint32_t width, height;
34 uint8_t ws;
35 uint32_t id;
36};
37
38struct decor {
39 struct {
40 struct swc_decor_part top_left, top, top_right;
41 struct swc_decor_part left, right;
42 struct swc_decor_part bottom_left, bottom, bottom_right;
43 } active;
44 struct {
45 struct swc_decor_part top_left, top, top_right;
46 struct swc_decor_part left, right;
47 struct swc_decor_part bottom_left, bottom, bottom_right;
48 } inactive;
49
50 bool enabled;
51 enum swc_decor_edge edge;
52 enum swc_decor_align align;
53 uint32_t foreground, background;
54 uint32_t padding;
55 int32_t offset_x, offset_y;
56 uint32_t edge_left, edge_right, edge_top, edge_bottom;
57 char *fontname;
58};
59
60struct grab {
61 bool active, resize;
62 struct client *client;
63};
64
65struct status {
66 bool ok;
67 char msg[MAXSIZE];
68};
69typedef struct status status;
70
71struct screen {
72 struct wl_list link;
73 struct swc_screen *scr;
74 int32_t x, y;
75 uint32_t width, height;
76};
77
78struct wm {
79 struct wl_display *dpy;
80 struct wl_event_loop *loop;
81
82 struct wl_list clients;
83 struct wl_list screens;
84
85 struct screen *scr;
86 struct client *cur;
87 struct grab grab;
88 uint8_t ws;
89 uint32_t last_id;
90
91 volatile sig_atomic_t running;
92};
93
94#endif /* TYPES_H */