2 * uterm - Linux User-Space Terminal System Monitor
4 * Copyright (c) 2011-2013 David Herrmann <dh.herrmann@googlemail.com>
6 * Permission is hereby granted, free of charge, to any person obtaining
7 * a copy of this software and associated documentation files
8 * (the "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sublicense, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
21 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 * This watches the system for new seats, graphics devices or other devices that
29 * are used by terminals.
32 #ifndef UTERM_UTERM_MONITOR_H
33 #define UTERM_UTERM_MONITOR_H
41 struct uterm_monitor_seat;
42 struct uterm_monitor_dev;
44 enum uterm_monitor_event_type {
45 UTERM_MONITOR_NEW_SEAT,
46 UTERM_MONITOR_FREE_SEAT,
47 UTERM_MONITOR_NEW_DEV,
48 UTERM_MONITOR_FREE_DEV,
49 UTERM_MONITOR_HOTPLUG_DEV,
52 enum uterm_monitor_dev_type {
58 enum uterm_monitor_dev_flag {
59 UTERM_MONITOR_DRM_BACKED = 0x01,
60 UTERM_MONITOR_PRIMARY = 0x02,
61 UTERM_MONITOR_AUX = 0x04,
64 struct uterm_monitor_event {
67 struct uterm_monitor_seat *seat;
68 const char *seat_name;
71 struct uterm_monitor_dev *dev;
72 unsigned int dev_type;
73 unsigned int dev_flags;
78 typedef void (*uterm_monitor_cb) (struct uterm_monitor *mon,
79 struct uterm_monitor_event *event,
82 int uterm_monitor_new(struct uterm_monitor **out, struct ev_eloop *eloop,
83 uterm_monitor_cb cb, void *data);
84 void uterm_monitor_ref(struct uterm_monitor *mon);
85 void uterm_monitor_unref(struct uterm_monitor *mon);
86 void uterm_monitor_scan(struct uterm_monitor *mon);
88 void uterm_monitor_set_seat_data(struct uterm_monitor_seat *seat, void *data);
89 void uterm_monitor_set_dev_data(struct uterm_monitor_dev *dev, void *data);
91 #endif /* UTERM_UTERM_MONITOR_H */