wl backend: add wlr_input_device_is_wl

This commit is contained in:
Dominique Martinet 2017-12-19 20:20:32 +01:00
parent d9eaca6c9f
commit 169bc9fa10
3 changed files with 10 additions and 1 deletions

View File

@ -203,6 +203,10 @@ static struct wlr_input_device_impl input_device_impl = {
.destroy = input_device_destroy .destroy = input_device_destroy
}; };
bool wlr_input_device_is_wl(struct wlr_input_device *dev) {
return dev->impl == &input_device_impl;
}
static struct wlr_input_device *allocate_device(struct wlr_wl_backend *backend, static struct wlr_input_device *allocate_device(struct wlr_wl_backend *backend,
enum wlr_input_device_type type) { enum wlr_input_device_type type) {
struct wlr_wl_input_device *wlr_wl_dev; struct wlr_wl_input_device *wlr_wl_dev;

View File

@ -8,7 +8,6 @@
#include <wlr/render/egl.h> #include <wlr/render/egl.h>
#include <wlr/backend/wayland.h> #include <wlr/backend/wayland.h>
#include <wlr/types/wlr_box.h> #include <wlr/types/wlr_box.h>
#include <wlr/types/wlr_input_device.h>
#include <wayland-util.h> #include <wayland-util.h>
struct wlr_wl_backend { struct wlr_wl_backend {

View File

@ -4,6 +4,7 @@
#include <wayland-client.h> #include <wayland-client.h>
#include <wayland-server.h> #include <wayland-server.h>
#include <wlr/backend.h> #include <wlr/backend.h>
#include <wlr/types/wlr_input_device.h>
#include <wlr/types/wlr_output.h> #include <wlr/types/wlr_output.h>
#include <stdbool.h> #include <stdbool.h>
@ -26,6 +27,11 @@ struct wlr_output *wlr_wl_output_create(struct wlr_backend *backend);
*/ */
bool wlr_backend_is_wl(struct wlr_backend *backend); bool wlr_backend_is_wl(struct wlr_backend *backend);
/**
* True if the given input device is a wlr_wl_input_device.
*/
bool wlr_input_device_is_wl(struct wlr_input_device *device);
/** /**
* True if the given output is a wlr_wl_backend_output. * True if the given output is a wlr_wl_backend_output.
*/ */