1#ifndef MAUS_X11_H
2#define MAUS_X11_H
3
4#include <stdint.h>
5
6#include <X11/Xlib.h>
7#include <X11/extensions/XShm.h>
8
9typedef enum {
10 MAUS_ATOM_WM_DELETE_WINDOW,
11 MAUS_ATOM_LAST
12} MausX11Atoms;
13
14typedef struct {
15 Display* display;
16 Window root;
17 Window win;
18 Atom atoms[MAUS_ATOM_LAST];
19 GC gc;
20
21 int8_t cur_rel; /* relative cursor */
22 int8_t ignore_warp;
23 int32_t mouse_x;
24 int32_t mouse_y;
25 int8_t mouse_pos_set;
26
27 XShmSegmentInfo shm;
28 int8_t shmat;
29 XImage* image; /* TODO: XImage path */
30} MausBackend;
31
32#endif /* MAUS_X11_H */
33