Jonas Ådahl | e0de3c2 | 2014-03-12 22:08:42 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright © 2011, 2012 Intel Corporation |
| 3 | * |
Bryce Harrington | a0bbfea | 2015-06-11 15:35:43 -0700 | [diff] [blame] | 4 | * Permission is hereby granted, free of charge, to any person obtaining |
| 5 | * a copy of this software and associated documentation files (the |
| 6 | * "Software"), to deal in the Software without restriction, including |
| 7 | * without limitation the rights to use, copy, modify, merge, publish, |
| 8 | * distribute, sublicense, and/or sell copies of the Software, and to |
| 9 | * permit persons to whom the Software is furnished to do so, subject to |
| 10 | * the following conditions: |
Jonas Ådahl | e0de3c2 | 2014-03-12 22:08:42 +0100 | [diff] [blame] | 11 | * |
Bryce Harrington | a0bbfea | 2015-06-11 15:35:43 -0700 | [diff] [blame] | 12 | * The above copyright notice and this permission notice (including the |
| 13 | * next paragraph) shall be included in all copies or substantial |
| 14 | * portions of the Software. |
| 15 | * |
| 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS |
| 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN |
| 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 23 | * SOFTWARE. |
Jonas Ådahl | e0de3c2 | 2014-03-12 22:08:42 +0100 | [diff] [blame] | 24 | */ |
| 25 | |
| 26 | #ifndef _LIBINPUT_DEVICE_H_ |
| 27 | #define _LIBINPUT_DEVICE_H_ |
| 28 | |
| 29 | #include "config.h" |
| 30 | |
| 31 | #include <linux/input.h> |
| 32 | #include <wayland-util.h> |
| 33 | #include <libinput.h> |
Louis-Francis Ratté-Boulianne | 6ef59c9 | 2017-11-28 20:42:47 -0500 | [diff] [blame] | 34 | #include <stdbool.h> |
Jonas Ådahl | e0de3c2 | 2014-03-12 22:08:42 +0100 | [diff] [blame] | 35 | |
Pekka Paalanen | 3d5d947 | 2019-03-28 16:28:47 +0200 | [diff] [blame^] | 36 | #include <libweston/libweston.h> |
Jonas Ådahl | e0de3c2 | 2014-03-12 22:08:42 +0100 | [diff] [blame] | 37 | |
| 38 | enum evdev_device_seat_capability { |
| 39 | EVDEV_SEAT_POINTER = (1 << 0), |
| 40 | EVDEV_SEAT_KEYBOARD = (1 << 1), |
| 41 | EVDEV_SEAT_TOUCH = (1 << 2) |
| 42 | }; |
| 43 | |
| 44 | struct evdev_device { |
| 45 | struct weston_seat *seat; |
| 46 | enum evdev_device_seat_capability seat_caps; |
| 47 | struct libinput_device *device; |
Louis-Francis Ratté-Boulianne | 6ef59c9 | 2017-11-28 20:42:47 -0500 | [diff] [blame] | 48 | struct weston_touch_device *touch_device; |
Jonas Ådahl | e0de3c2 | 2014-03-12 22:08:42 +0100 | [diff] [blame] | 49 | struct wl_list link; |
| 50 | struct weston_output *output; |
| 51 | struct wl_listener output_destroy_listener; |
Jonas Ådahl | e0de3c2 | 2014-03-12 22:08:42 +0100 | [diff] [blame] | 52 | char *output_name; |
| 53 | int fd; |
Louis-Francis Ratté-Boulianne | 6ef59c9 | 2017-11-28 20:42:47 -0500 | [diff] [blame] | 54 | bool override_wl_calibration; |
Jonas Ådahl | e0de3c2 | 2014-03-12 22:08:42 +0100 | [diff] [blame] | 55 | }; |
| 56 | |
| 57 | void |
| 58 | evdev_led_update(struct evdev_device *device, enum weston_led leds); |
| 59 | |
| 60 | struct evdev_device * |
| 61 | evdev_device_create(struct libinput_device *libinput_device, |
| 62 | struct weston_seat *seat); |
| 63 | |
| 64 | int |
| 65 | evdev_device_process_event(struct libinput_event *event); |
| 66 | |
| 67 | void |
| 68 | evdev_device_set_output(struct evdev_device *device, |
| 69 | struct weston_output *output); |
| 70 | void |
| 71 | evdev_device_destroy(struct evdev_device *device); |
| 72 | |
| 73 | void |
| 74 | evdev_notify_keyboard_focus(struct weston_seat *seat, |
| 75 | struct wl_list *evdev_devices); |
Giulio Camuffo | 8aedf7b | 2016-06-02 21:48:12 +0300 | [diff] [blame] | 76 | void |
| 77 | evdev_device_set_calibration(struct evdev_device *device); |
Jonas Ådahl | e0de3c2 | 2014-03-12 22:08:42 +0100 | [diff] [blame] | 78 | |
| 79 | int |
| 80 | dispatch_libinput(struct libinput *libinput); |
| 81 | |
| 82 | #endif /* _LIBINPUT_DEVICE_H_ */ |