wlroots/include/wlr/backend/libinput.h
qiu b74e0cc75b backend/libinput: expose libinput context
Add `wlr_backend_get_libinput` getter, which returns a direct
handle to `struct libinput`.

Exposing the libinput context will allow compositors to load
libinput plugins after creating a `wlr_backend`.
Lua plugins are supported since libinput 1.30.0.
2026-05-21 15:23:30 +00:00

39 lines
1.2 KiB
C

/*
* This an unstable interface of wlroots. No guarantees are made regarding the
* future consistency of this API.
*/
#ifndef WLR_USE_UNSTABLE
#error "Add -DWLR_USE_UNSTABLE to enable unstable wlroots features"
#endif
#ifndef WLR_BACKEND_LIBINPUT_H
#define WLR_BACKEND_LIBINPUT_H
#include <libinput.h>
#include <wayland-server-core.h>
#include <wlr/backend.h>
#include <wlr/backend/session.h>
struct wlr_input_device;
struct wlr_tablet_tool;
struct wlr_backend *wlr_libinput_backend_create(struct wlr_session *session);
/**
* Gets the underlying struct libinput_device handle for the given input device.
*/
struct libinput_device *wlr_libinput_get_device_handle(
struct wlr_input_device *dev);
/**
* Gets the underlying struct libinput_tablet_tool handle for the given tablet tool.
*/
struct libinput_tablet_tool *wlr_libinput_get_tablet_tool_handle(
struct wlr_tablet_tool *wlr_tablet_tool);
/**
* Gets the underlying struct libinput for direct access to the libinput context.
*/
struct libinput *wlr_backend_get_libinput(struct wlr_backend *wlr_backend);
bool wlr_backend_is_libinput(const struct wlr_backend *backend);
bool wlr_input_device_is_libinput(struct wlr_input_device *device);
#endif