blob: 65c9b64bac1d6a5b44e64410f14c723ba9c8ec50 [file] [log] [blame]
Jonas Ådahle0de3c22014-03-12 22:08:42 +01001/*
2 * Copyright © 2013 Intel Corporation
3 * Copyright © 2013 Jonas Ådahl
4 *
Bryce Harringtona0bbfea2015-06-11 15:35:43 -07005 * Permission is hereby granted, free of charge, to any person obtaining
6 * a copy of this software and associated documentation files (the
7 * "Software"), to deal in the Software without restriction, including
8 * without limitation the rights to use, copy, modify, merge, publish,
9 * distribute, sublicense, and/or sell copies of the Software, and to
10 * permit persons to whom the Software is furnished to do so, subject to
11 * the following conditions:
Jonas Ådahle0de3c22014-03-12 22:08:42 +010012 *
Bryce Harringtona0bbfea2015-06-11 15:35:43 -070013 * The above copyright notice and this permission notice (including the
14 * next paragraph) shall be included in all copies or substantial
15 * portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
21 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
22 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
23 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 * SOFTWARE.
Jonas Ådahle0de3c22014-03-12 22:08:42 +010025 */
26
27#ifndef _LIBINPUT_SEAT_H_
28#define _LIBINPUT_SEAT_H_
29
30#include "config.h"
31
32#include <libudev.h>
33
34#include "compositor.h"
35
Giulio Camuffo8aedf7b2016-06-02 21:48:12 +030036struct libinput_device;
37
Jonas Ådahle0de3c22014-03-12 22:08:42 +010038struct udev_seat {
39 struct weston_seat base;
40 struct wl_list devices_list;
41 struct wl_listener output_create_listener;
42};
43
Giulio Camuffo8aedf7b2016-06-02 21:48:12 +030044typedef void (*udev_configure_device_t)(struct weston_compositor *compositor,
45 struct libinput_device *device);
46
Jonas Ådahle0de3c22014-03-12 22:08:42 +010047struct udev_input {
48 struct libinput *libinput;
49 struct wl_event_source *libinput_source;
50 struct weston_compositor *compositor;
51 int suspended;
Giulio Camuffo8aedf7b2016-06-02 21:48:12 +030052 udev_configure_device_t configure_device;
Jonas Ådahle0de3c22014-03-12 22:08:42 +010053};
54
55int
56udev_input_enable(struct udev_input *input);
57void
58udev_input_disable(struct udev_input *input);
59int
60udev_input_init(struct udev_input *input,
61 struct weston_compositor *c,
62 struct udev *udev,
Giulio Camuffo8aedf7b2016-06-02 21:48:12 +030063 const char *seat_id,
64 udev_configure_device_t configure_device);
Jonas Ådahle0de3c22014-03-12 22:08:42 +010065void
66udev_input_destroy(struct udev_input *input);
67
68struct udev_seat *
69udev_seat_get_named(struct udev_input *u,
70 const char *seat_name);
71
72#endif