2019-11-21 05:16:53 +00:00
|
|
|
// Wayland stuff
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2019-11-23 06:58:07 +00:00
|
|
|
// Only define wlserver_t on the C side, as wlroots can't build as C++
|
|
|
|
#ifdef C_SIDE
|
|
|
|
|
2019-11-21 05:16:53 +00:00
|
|
|
#include <wayland-server-core.h>
|
|
|
|
#include <wlr/backend.h>
|
|
|
|
#include <wlr/backend/session.h>
|
|
|
|
#include <wlr/render/wlr_renderer.h>
|
|
|
|
#include <wlr/xwayland.h>
|
|
|
|
|
|
|
|
struct wlserver_t {
|
|
|
|
struct wl_display *wl_display;
|
|
|
|
struct wl_event_loop *wl_event_loop;
|
2019-12-31 06:50:49 +00:00
|
|
|
int wl_event_loop_fd;
|
2019-11-21 05:16:53 +00:00
|
|
|
|
|
|
|
struct {
|
|
|
|
struct wlr_backend *backend;
|
|
|
|
struct wlr_renderer *renderer;
|
|
|
|
struct wlr_compositor *compositor;
|
|
|
|
struct wlr_xwayland *xwayland;
|
|
|
|
struct wlr_session *session;
|
|
|
|
struct wlr_seat *seat;
|
|
|
|
struct wlr_output *output;
|
|
|
|
|
2020-01-02 07:23:39 +00:00
|
|
|
// // Only for nested (?)
|
|
|
|
// struct wlr_input_device *keyboard_dev;
|
|
|
|
// struct wlr_input_device *pointer_dev;
|
2019-11-21 05:16:53 +00:00
|
|
|
} wlr;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern struct wlserver_t wlserver;
|
2019-11-23 06:58:07 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef C_SIDE
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
extern const struct wlr_surface_role xwayland_surface_role;
|
|
|
|
|
2020-01-17 00:43:21 +00:00
|
|
|
void xwayland_surface_role_commit(struct wlr_surface *wlr_surface);
|
|
|
|
|
2020-01-02 07:23:39 +00:00
|
|
|
int wlserver_init( int argc, char **argv, bool bIsNested );
|
2019-11-23 06:58:07 +00:00
|
|
|
|
|
|
|
int wlserver_run(void);
|
|
|
|
|
2019-11-24 21:55:02 +00:00
|
|
|
void nudge_steamcompmgr(void);
|
2019-11-23 07:42:02 +00:00
|
|
|
|
2019-12-31 01:50:22 +00:00
|
|
|
void wlserver_lock(void);
|
|
|
|
void wlserver_unlock(void);
|
|
|
|
|
2020-01-02 07:23:39 +00:00
|
|
|
void wlserver_mousefocus( struct wlr_surface *wlrsurface );
|
|
|
|
void wlserver_mousemotion( int x, int y, uint32_t time );
|
|
|
|
void wlserver_mousebutton( int button, bool press, uint32_t time );
|
|
|
|
void wlserver_mousewheel( int x, int y, uint32_t time );
|
|
|
|
|
2019-11-23 06:58:07 +00:00
|
|
|
#ifndef C_SIDE
|
|
|
|
}
|
|
|
|
#endif
|