2018-12-31 00:12:33 +01:00
|
|
|
#ifndef CG_SERVER_H
|
|
|
|
|
#define CG_SERVER_H
|
|
|
|
|
|
2018-12-31 17:24:21 +01:00
|
|
|
#include "config.h"
|
|
|
|
|
|
2019-12-20 17:16:53 +01:00
|
|
|
#include <wayland-server-core.h>
|
2019-01-08 23:24:51 +01:00
|
|
|
#include <wlr/types/wlr_idle_inhibit_v1.h>
|
2023-11-21 19:20:13 +01:00
|
|
|
#include <wlr/types/wlr_idle_notify_v1.h>
|
2018-12-31 00:12:33 +01:00
|
|
|
#include <wlr/types/wlr_output_layout.h>
|
2023-11-09 17:14:37 +01:00
|
|
|
#include <wlr/types/wlr_relative_pointer_v1.h>
|
2019-02-17 22:17:11 +01:00
|
|
|
#include <wlr/types/wlr_xdg_decoration_v1.h>
|
2019-01-03 21:55:25 +01:00
|
|
|
#if CAGE_HAS_XWAYLAND
|
2018-12-31 17:24:21 +01:00
|
|
|
#include <wlr/xwayland.h>
|
|
|
|
|
#endif
|
2018-12-31 00:12:33 +01:00
|
|
|
|
2020-05-31 15:45:47 +02:00
|
|
|
enum cg_multi_output_mode {
|
|
|
|
|
CAGE_MULTI_OUTPUT_MODE_EXTEND,
|
|
|
|
|
CAGE_MULTI_OUTPUT_MODE_LAST,
|
|
|
|
|
};
|
|
|
|
|
|
2018-12-31 00:12:33 +01:00
|
|
|
struct cg_server {
|
|
|
|
|
struct wl_display *wl_display;
|
|
|
|
|
struct wl_list views;
|
2020-07-15 16:50:38 +02:00
|
|
|
struct wlr_backend *backend;
|
2021-08-11 11:31:14 +02:00
|
|
|
struct wlr_renderer *renderer;
|
|
|
|
|
struct wlr_allocator *allocator;
|
2023-09-30 13:36:49 +02:00
|
|
|
struct wlr_session *session;
|
2024-08-28 15:05:03 +02:00
|
|
|
struct wl_listener display_destroy;
|
2018-12-31 00:12:33 +01:00
|
|
|
|
|
|
|
|
struct cg_seat *seat;
|
2023-11-21 19:20:13 +01:00
|
|
|
struct wlr_idle_notifier_v1 *idle;
|
2019-01-08 23:24:51 +01:00
|
|
|
struct wlr_idle_inhibit_manager_v1 *idle_inhibit_v1;
|
|
|
|
|
struct wl_listener new_idle_inhibitor_v1;
|
|
|
|
|
struct wl_list inhibitors;
|
2018-12-31 00:12:33 +01:00
|
|
|
|
2020-05-31 15:45:47 +02:00
|
|
|
enum cg_multi_output_mode output_mode;
|
2018-12-31 00:12:33 +01:00
|
|
|
struct wlr_output_layout *output_layout;
|
2023-11-25 12:48:30 +01:00
|
|
|
struct wlr_scene_output_layout *scene_output_layout;
|
|
|
|
|
|
2021-08-09 20:06:57 +02:00
|
|
|
struct wlr_scene *scene;
|
2020-05-31 16:04:01 +02:00
|
|
|
/* Includes disabled outputs; depending on the output_mode
|
|
|
|
|
* some outputs may be disabled. */
|
|
|
|
|
struct wl_list outputs; // cg_output::link
|
2018-12-31 00:12:33 +01:00
|
|
|
struct wl_listener new_output;
|
2023-07-21 15:37:38 +02:00
|
|
|
struct wl_listener output_layout_change;
|
2018-12-31 17:24:21 +01:00
|
|
|
|
2019-02-17 22:17:11 +01:00
|
|
|
struct wl_listener xdg_toplevel_decoration;
|
2024-02-16 16:48:25 +01:00
|
|
|
struct wl_listener new_xdg_toplevel;
|
|
|
|
|
struct wl_listener new_xdg_popup;
|
2023-01-07 14:28:40 +00:00
|
|
|
|
|
|
|
|
struct wl_listener new_virtual_keyboard;
|
|
|
|
|
struct wl_listener new_virtual_pointer;
|
2018-12-31 17:24:21 +01:00
|
|
|
#if CAGE_HAS_XWAYLAND
|
|
|
|
|
struct wl_listener new_xwayland_surface;
|
|
|
|
|
#endif
|
2023-07-21 15:37:38 +02:00
|
|
|
struct wlr_output_manager_v1 *output_manager_v1;
|
|
|
|
|
struct wl_listener output_manager_apply;
|
|
|
|
|
struct wl_listener output_manager_test;
|
2019-01-25 15:36:04 +01:00
|
|
|
|
2023-11-09 17:14:37 +01:00
|
|
|
struct wlr_relative_pointer_manager_v1 *relative_pointer_manager;
|
|
|
|
|
|
2019-02-17 22:17:11 +01:00
|
|
|
bool xdg_decoration;
|
2020-07-15 16:50:38 +02:00
|
|
|
bool allow_vt_switch;
|
2023-08-18 15:25:21 +02:00
|
|
|
bool return_app_code;
|
2024-08-28 15:05:03 +02:00
|
|
|
bool terminated;
|
2018-12-31 00:12:33 +01:00
|
|
|
};
|
|
|
|
|
|
2024-08-28 15:05:03 +02:00
|
|
|
void server_terminate(struct cg_server *server);
|
|
|
|
|
|
2018-12-31 00:12:33 +01:00
|
|
|
#endif
|