2017-06-19 17:46:50 +02:00
|
|
|
#ifndef WLR_BACKEND_WAYLAND_H
|
|
|
|
#define WLR_BACKEND_WAYLAND_H
|
2018-02-12 21:29:23 +01:00
|
|
|
#include <stdbool.h>
|
2017-04-25 21:06:58 +02:00
|
|
|
#include <wayland-client.h>
|
2019-07-27 10:53:54 +02:00
|
|
|
#include <wayland-server-core.h>
|
2017-06-19 17:46:50 +02:00
|
|
|
#include <wlr/backend.h>
|
2017-12-19 19:55:18 +01:00
|
|
|
#include <wlr/types/wlr_output.h>
|
2017-04-25 21:06:58 +02:00
|
|
|
|
2022-03-03 15:43:38 +01:00
|
|
|
struct wlr_input_device;
|
|
|
|
|
2017-06-21 00:22:21 +02:00
|
|
|
/**
|
2022-05-24 18:46:59 +02:00
|
|
|
* Creates a new Wayland backend. This backend will be created with no outputs;
|
|
|
|
* you must use wlr_wl_output_create() to add them.
|
2018-01-13 21:41:04 +01:00
|
|
|
*
|
|
|
|
* The `remote` argument is the name of the host compositor wayland socket. Set
|
|
|
|
* to NULL for the default behaviour (WAYLAND_DISPLAY env variable or wayland-0
|
2022-05-24 18:46:59 +02:00
|
|
|
* default).
|
2017-06-21 00:22:21 +02:00
|
|
|
*/
|
2019-01-11 03:53:32 +01:00
|
|
|
struct wlr_backend *wlr_wl_backend_create(struct wl_display *display,
|
2020-12-19 11:34:28 +01:00
|
|
|
const char *remote);
|
2017-12-19 19:55:18 +01:00
|
|
|
|
2019-11-12 17:56:57 +01:00
|
|
|
/**
|
2022-05-24 18:46:59 +02:00
|
|
|
* Returns the remote struct wl_display used by the Wayland backend.
|
2019-11-12 17:56:57 +01:00
|
|
|
*/
|
|
|
|
struct wl_display *wlr_wl_backend_get_remote_display(struct wlr_backend *backend);
|
|
|
|
|
2017-06-21 00:22:21 +02:00
|
|
|
/**
|
|
|
|
* Adds a new output to this backend. You may remove outputs by destroying them.
|
|
|
|
* Note that if called before initializing the backend, this will return NULL
|
|
|
|
* and your outputs will be created during initialization (and given to you via
|
2022-05-24 18:46:59 +02:00
|
|
|
* the new_output signal).
|
2017-06-21 00:22:21 +02:00
|
|
|
*/
|
|
|
|
struct wlr_output *wlr_wl_output_create(struct wlr_backend *backend);
|
2017-12-19 19:55:18 +01:00
|
|
|
|
2017-06-21 00:22:21 +02:00
|
|
|
/**
|
2022-05-24 18:46:59 +02:00
|
|
|
* Check whether the provided backend is a Wayland backend.
|
2017-06-21 00:22:21 +02:00
|
|
|
*/
|
|
|
|
bool wlr_backend_is_wl(struct wlr_backend *backend);
|
2017-04-25 21:06:58 +02:00
|
|
|
|
2017-12-19 20:20:32 +01:00
|
|
|
/**
|
2022-05-24 18:46:59 +02:00
|
|
|
* Check whether the provided input device is a Wayland input device.
|
2017-12-19 20:20:32 +01:00
|
|
|
*/
|
|
|
|
bool wlr_input_device_is_wl(struct wlr_input_device *device);
|
|
|
|
|
2017-12-19 19:55:18 +01:00
|
|
|
/**
|
2022-05-24 18:46:59 +02:00
|
|
|
* Check whether the provided output device is a Wayland output device.
|
2017-12-19 19:55:18 +01:00
|
|
|
*/
|
|
|
|
bool wlr_output_is_wl(struct wlr_output *output);
|
|
|
|
|
2019-01-11 03:53:32 +01:00
|
|
|
/**
|
2022-05-24 18:46:59 +02:00
|
|
|
* Sets the title of a struct wlr_output which is a Wayland toplevel.
|
2019-01-11 03:53:32 +01:00
|
|
|
*/
|
|
|
|
void wlr_wl_output_set_title(struct wlr_output *output, const char *title);
|
|
|
|
|
2019-11-12 17:56:57 +01:00
|
|
|
/**
|
2022-05-24 18:46:59 +02:00
|
|
|
* Returns the remote struct wl_surface used by the Wayland output.
|
2019-11-12 17:56:57 +01:00
|
|
|
*/
|
|
|
|
struct wl_surface *wlr_wl_output_get_surface(struct wlr_output *output);
|
|
|
|
|
|
|
|
/**
|
2022-05-24 18:46:59 +02:00
|
|
|
* Returns the remote struct wl_seat for a Wayland input device.
|
2019-11-12 17:56:57 +01:00
|
|
|
*/
|
|
|
|
struct wl_seat *wlr_wl_input_device_get_seat(struct wlr_input_device *dev);
|
|
|
|
|
2017-04-25 21:06:58 +02:00
|
|
|
#endif
|