downstream: Multiseat support for drm/wayland backends
[profile/ivi/weston-ivi-shell.git] / src / libinput-seat.h
1 /*
2  * Copyright © 2013 Intel Corporation
3  * Copyright © 2013 Jonas Ådahl
4  *
5  * Permission to use, copy, modify, distribute, and sell this software and
6  * its documentation for any purpose is hereby granted without fee, provided
7  * that the above copyright notice appear in all copies and that both that
8  * copyright notice and this permission notice appear in supporting
9  * documentation, and that the name of the copyright holders not be used in
10  * advertising or publicity pertaining to distribution of the software
11  * without specific, written prior permission.  The copyright holders make
12  * no representations about the suitability of this software for any
13  * purpose.  It is provided "as is" without express or implied warranty.
14  *
15  * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
16  * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
17  * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
18  * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
19  * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
20  * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
21  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22  */
23
24 #ifndef _LIBINPUT_SEAT_H_
25 #define _LIBINPUT_SEAT_H_
26
27 #include "config.h"
28
29 #include <libudev.h>
30
31 #include "compositor.h"
32
33 struct udev_input {
34         struct libinput *libinput;
35         struct wl_event_source *libinput_source;
36         struct weston_compositor *compositor;
37         int suspended;
38 };
39
40 struct udev_seat {
41         struct weston_seat base;
42         struct udev_input input;
43         struct wl_list devices_list;
44         struct wl_listener output_create_listener;
45 };
46
47 int
48 udev_input_enable(struct udev_input *input);
49 void
50 udev_input_disable(struct udev_input *input);
51 int
52 udev_input_init(struct udev_input *input,
53                 struct weston_compositor *c,
54                 struct udev *udev,
55                 const char *seat_id);
56 void
57 udev_input_destroy(struct udev_input *input);
58
59 struct udev_seat *
60 udev_seat_get_named(struct weston_compositor *c,
61                     const char *seat_name);
62
63 int udev_seat_link_output(struct udev_seat *seat,
64                           struct weston_output *output);
65
66 #endif