aboutsummaryrefslogtreecommitdiffstats
path: root/include/sway/server.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/sway/server.h')
-rw-r--r--include/sway/server.h57
1 files changed, 57 insertions, 0 deletions
diff --git a/include/sway/server.h b/include/sway/server.h
new file mode 100644
index 00000000..296fbf22
--- /dev/null
+++ b/include/sway/server.h
@@ -0,0 +1,57 @@
1#ifndef _SWAY_SERVER_H
2#define _SWAY_SERVER_H
3#include <stdbool.h>
4#include <wayland-server.h>
5#include <wlr/backend.h>
6#include <wlr/backend/session.h>
7#include <wlr/types/wlr_compositor.h>
8#include <wlr/types/wlr_data_device.h>
9#include <wlr/types/wlr_layer_shell.h>
10#include <wlr/types/wlr_xdg_shell_v6.h>
11#include <wlr/render/wlr_renderer.h>
12// TODO WLR: make Xwayland optional
13#include <wlr/xwayland.h>
14
15struct sway_server {
16 struct wl_display *wl_display;
17 struct wl_event_loop *wl_event_loop;
18 const char *socket;
19
20 struct wlr_backend *backend;
21
22 struct wlr_compositor *compositor;
23 struct wlr_data_device_manager *data_device_manager;
24
25 struct sway_input_manager *input;
26
27 struct wl_listener new_output;
28
29 struct wlr_layer_shell *layer_shell;
30 struct wl_listener layer_shell_surface;
31
32 struct wlr_xdg_shell_v6 *xdg_shell_v6;
33 struct wl_listener xdg_shell_v6_surface;
34
35 struct wlr_xwayland *xwayland;
36 struct wlr_xcursor_manager *xcursor_manager;
37 struct wl_listener xwayland_surface;
38 struct wl_listener xwayland_ready;
39
40 struct wlr_wl_shell *wl_shell;
41 struct wl_listener wl_shell_surface;
42};
43
44struct sway_server server;
45
46bool server_init(struct sway_server *server);
47void server_fini(struct sway_server *server);
48void server_run(struct sway_server *server);
49
50void handle_new_output(struct wl_listener *listener, void *data);
51
52void handle_layer_shell_surface(struct wl_listener *listener, void *data);
53void handle_xdg_shell_v6_surface(struct wl_listener *listener, void *data);
54void handle_xwayland_surface(struct wl_listener *listener, void *data);
55void handle_wl_shell_surface(struct wl_listener *listener, void *data);
56
57#endif