Debian Codegraph @

clutter/evdev/clutter-input-device-evdev.h

raw
1 /*
2 * Clutter.
3 *
4 * An OpenGL based 'interactive canvas' library.
5 *
6 * Copyright (C) 2010 Intel Corp.
7 * Copyright (C) 2014 Jonas Ådahl
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2 of the License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
21 *
22 * Author: Damien Lespiau <[email protected]>
23 * Author: Jonas Ådahl <[email protected]>
24 */
25
26 #ifndef __CLUTTER_INPUT_DEVICE_EVDEV_H__
27 #define __CLUTTER_INPUT_DEVICE_EVDEV_H__
28
29 #include <glib-object.h>
30 #include <libinput.h>
31
32 #include <clutter/clutter-input-device.h>
33
34 G_BEGIN_DECLS
35
36 #define CLUTTER_TYPE_INPUT_DEVICE_EVDEV _clutter_input_device_evdev_get_type()
37
38 #define CLUTTER_INPUT_DEVICE_EVDEV(obj) \
39 (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
40 CLUTTER_TYPE_INPUT_DEVICE_EVDEV, ClutterInputDeviceEvdev))
41
42 #define CLUTTER_INPUT_DEVICE_EVDEV_CLASS(klass) \
43 (G_TYPE_CHECK_CLASS_CAST ((klass), \
44 CLUTTER_TYPE_INPUT_DEVICE_EVDEV, ClutterInputDeviceEvdevClass))
45
46 #define CLUTTER_IS_INPUT_DEVICE_EVDEV(obj) \
47 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
48 CLUTTER_TYPE_INPUT_DEVICE_EVDEV))
49
50 #define CLUTTER_IS_INPUT_DEVICE_EVDEV_CLASS(klass) \
51 (G_TYPE_CHECK_CLASS_TYPE ((klass), \
52 CLUTTER_TYPE_INPUT_DEVICE_EVDEV))
53
54 #define CLUTTER_INPUT_DEVICE_EVDEV_GET_CLASS(obj) \
55 (G_TYPE_INSTANCE_GET_CLASS ((obj), \
56 CLUTTER_TYPE_INPUT_DEVICE_EVDEV, ClutterInputDeviceEvdevClass))
57
58 typedef struct _ClutterInputDeviceEvdev ClutterInputDeviceEvdev;
59 typedef struct _ClutterSeatEvdev ClutterSeatEvdev;
60 typedef struct _ClutterEventEvdev ClutterEventEvdev;
61
62 struct _ClutterInputDeviceEvdev
63 {
64 ClutterInputDevice parent;
65
66 struct libinput_device *libinput_device;
67 ClutterSeatEvdev *seat;
68 };
69
70 GType _clutter_input_device_evdev_get_type (void) G_GNUC_CONST;
71
72 ClutterInputDevice * _clutter_input_device_evdev_new (ClutterDeviceManager *manager,
73 ClutterSeatEvdev *seat,
74 struct libinput_device *libinput_device);
75
76 ClutterInputDevice * _clutter_input_device_evdev_new_virtual (ClutterDeviceManager *manager,
77 ClutterSeatEvdev *seat,
78 ClutterInputDeviceType type);
79
80 ClutterSeatEvdev * _clutter_input_device_evdev_get_seat (ClutterInputDeviceEvdev *device);
81
82 void _clutter_input_device_evdev_update_leds (ClutterInputDeviceEvdev *device,
83 enum libinput_led leds);
84
85 ClutterInputDeviceType _clutter_input_device_evdev_determine_type (struct libinput_device *libinput_device);
86
87
88 ClutterEventEvdev * _clutter_event_evdev_copy (ClutterEventEvdev *event_evdev);
89 void _clutter_event_evdev_free (ClutterEventEvdev *event_evdev);
90
91 void _clutter_evdev_event_set_event_code (ClutterEvent *event,
92 guint32 evcode);
93
94 void _clutter_evdev_event_set_time_usec (ClutterEvent *event,
95 guint64 time_usec);
96
97 void _clutter_evdev_event_set_relative_motion (ClutterEvent *event,
98 double dx,
99 double dy,
100 double dx_unaccel,
101 double dy_unaccel);
102
103 G_END_DECLS
104
105 #endif /* __CLUTTER_INPUT_DEVICE_EVDEV_H__ */