2017-10-23 01:37:30 +11:00
|
|
|
#ifndef _SWAY_SERVER_H
|
|
|
|
#define _SWAY_SERVER_H
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <wayland-server.h>
|
|
|
|
#include <wlr/backend.h>
|
|
|
|
#include <wlr/backend/session.h>
|
2017-11-23 13:06:08 +11:00
|
|
|
#include <wlr/types/wlr_compositor.h>
|
2017-11-23 09:56:21 +11:00
|
|
|
#include <wlr/types/wlr_data_device.h>
|
2017-11-12 10:06:50 +11:00
|
|
|
#include <wlr/types/wlr_xdg_shell_v6.h>
|
2017-10-23 01:37:30 +11:00
|
|
|
#include <wlr/render.h>
|
|
|
|
// TODO WLR: make Xwayland optional
|
|
|
|
#include <wlr/xwayland.h>
|
|
|
|
|
|
|
|
struct sway_server {
|
|
|
|
struct wl_display *wl_display;
|
|
|
|
struct wl_event_loop *wl_event_loop;
|
2017-11-12 03:58:43 +11:00
|
|
|
const char *socket;
|
2017-10-23 01:37:30 +11:00
|
|
|
|
|
|
|
struct wlr_backend *backend;
|
|
|
|
struct wlr_renderer *renderer;
|
|
|
|
|
2017-11-23 13:06:08 +11:00
|
|
|
struct wlr_compositor *compositor;
|
2017-10-23 01:37:30 +11:00
|
|
|
struct wlr_data_device_manager *data_device_manager;
|
2017-10-23 02:38:30 +11:00
|
|
|
|
|
|
|
struct sway_input *input;
|
2017-11-12 03:58:43 +11:00
|
|
|
|
|
|
|
struct wl_listener output_add;
|
|
|
|
struct wl_listener output_remove;
|
|
|
|
struct wl_listener output_frame;
|
2017-11-12 10:06:50 +11:00
|
|
|
|
|
|
|
struct wlr_xdg_shell_v6 *xdg_shell_v6;
|
|
|
|
struct wl_listener xdg_shell_v6_surface;
|
2017-10-23 01:37:30 +11:00
|
|
|
};
|
|
|
|
|
2017-11-12 03:58:43 +11:00
|
|
|
struct sway_server server;
|
|
|
|
|
2017-10-23 01:37:30 +11:00
|
|
|
bool server_init(struct sway_server *server);
|
|
|
|
void server_fini(struct sway_server *server);
|
2017-11-12 03:58:43 +11:00
|
|
|
void server_run(struct sway_server *server);
|
2017-10-23 01:37:30 +11:00
|
|
|
|
2017-11-12 03:58:43 +11:00
|
|
|
void output_add_notify(struct wl_listener *listener, void *data);
|
2017-11-12 06:41:18 +11:00
|
|
|
void output_remove_notify(struct wl_listener *listener, void *data);
|
2017-10-23 01:37:30 +11:00
|
|
|
|
2017-11-12 10:06:50 +11:00
|
|
|
void handle_xdg_shell_v6_surface(struct wl_listener *listener, void *data);
|
|
|
|
|
2017-10-23 01:37:30 +11:00
|
|
|
#endif
|