Jonas Ådahl | e0de3c2 | 2014-03-12 22:08:42 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright © 2013 Intel Corporation |
| 3 | * Copyright © 2013 Jonas Ådahl |
| 4 | * |
Bryce Harrington | a0bbfea | 2015-06-11 15:35:43 -0700 | [diff] [blame] | 5 | * 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 Ådahl | e0de3c2 | 2014-03-12 22:08:42 +0100 | [diff] [blame] | 12 | * |
Bryce Harrington | a0bbfea | 2015-06-11 15:35:43 -0700 | [diff] [blame] | 13 | * 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 Ådahl | e0de3c2 | 2014-03-12 22:08:42 +0100 | [diff] [blame] | 25 | */ |
| 26 | |
| 27 | #ifndef _LIBINPUT_SEAT_H_ |
| 28 | #define _LIBINPUT_SEAT_H_ |
| 29 | |
| 30 | #include "config.h" |
| 31 | |
| 32 | #include <libudev.h> |
| 33 | |
Pekka Paalanen | 3d5d947 | 2019-03-28 16:28:47 +0200 | [diff] [blame] | 34 | #include <libweston/libweston.h> |
Jonas Ådahl | e0de3c2 | 2014-03-12 22:08:42 +0100 | [diff] [blame] | 35 | |
Giulio Camuffo | 8aedf7b | 2016-06-02 21:48:12 +0300 | [diff] [blame] | 36 | struct libinput_device; |
| 37 | |
Jonas Ådahl | e0de3c2 | 2014-03-12 22:08:42 +0100 | [diff] [blame] | 38 | struct udev_seat { |
| 39 | struct weston_seat base; |
| 40 | struct wl_list devices_list; |
| 41 | struct wl_listener output_create_listener; |
Pekka Paalanen | 8dc6db8 | 2018-03-20 13:29:40 +0200 | [diff] [blame] | 42 | struct wl_listener output_heads_listener; |
Jonas Ådahl | e0de3c2 | 2014-03-12 22:08:42 +0100 | [diff] [blame] | 43 | }; |
| 44 | |
Giulio Camuffo | 8aedf7b | 2016-06-02 21:48:12 +0300 | [diff] [blame] | 45 | typedef void (*udev_configure_device_t)(struct weston_compositor *compositor, |
| 46 | struct libinput_device *device); |
| 47 | |
Jonas Ådahl | e0de3c2 | 2014-03-12 22:08:42 +0100 | [diff] [blame] | 48 | struct udev_input { |
| 49 | struct libinput *libinput; |
| 50 | struct wl_event_source *libinput_source; |
| 51 | struct weston_compositor *compositor; |
| 52 | int suspended; |
Giulio Camuffo | 8aedf7b | 2016-06-02 21:48:12 +0300 | [diff] [blame] | 53 | udev_configure_device_t configure_device; |
Jonas Ådahl | e0de3c2 | 2014-03-12 22:08:42 +0100 | [diff] [blame] | 54 | }; |
| 55 | |
| 56 | int |
| 57 | udev_input_enable(struct udev_input *input); |
| 58 | void |
| 59 | udev_input_disable(struct udev_input *input); |
| 60 | int |
| 61 | udev_input_init(struct udev_input *input, |
| 62 | struct weston_compositor *c, |
| 63 | struct udev *udev, |
Giulio Camuffo | 8aedf7b | 2016-06-02 21:48:12 +0300 | [diff] [blame] | 64 | const char *seat_id, |
| 65 | udev_configure_device_t configure_device); |
Jonas Ådahl | e0de3c2 | 2014-03-12 22:08:42 +0100 | [diff] [blame] | 66 | void |
| 67 | udev_input_destroy(struct udev_input *input); |
| 68 | |
| 69 | struct udev_seat * |
| 70 | udev_seat_get_named(struct udev_input *u, |
| 71 | const char *seat_name); |
| 72 | |
| 73 | #endif |