2 * Copyright © 2013 Jonas Ådahl
4 * Permission to use, copy, modify, distribute, and sell this software and
5 * its documentation for any purpose is hereby granted without fee, provided
6 * that the above copyright notice appear in all copies and that both that
7 * copyright notice and this permission notice appear in supporting
8 * documentation, and that the name of the copyright holders not be used in
9 * advertising or publicity pertaining to distribution of the software
10 * without specific, written prior permission. The copyright holders make
11 * no representations about the suitability of this software for any
12 * purpose. It is provided "as is" without express or implied warranty.
14 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
15 * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
16 * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
17 * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
18 * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
19 * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
20 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
23 #ifndef LIBINPUT_PRIVATE_H
24 #define LIBINPUT_PRIVATE_H
28 struct libinput_device {
29 const struct libinput_device_interface *device_interface;
30 void *device_interface_data;
32 const struct libinput_keyboard_listener *keyboard_listener;
33 void *keyboard_listener_data;
35 const struct libinput_pointer_listener *pointer_listener;
36 void *pointer_listener_data;
38 const struct libinput_touch_listener *touch_listener;
39 void *touch_listener_data;
43 keyboard_notify_key(struct libinput_device *device,
46 enum libinput_keyboard_key_state state);
49 pointer_notify_motion(struct libinput_device *device,
55 pointer_notify_motion_absolute(struct libinput_device *device,
61 pointer_notify_button(struct libinput_device *device,
64 enum libinput_pointer_button_state state);
67 pointer_notify_axis(struct libinput_device *device,
69 enum libinput_pointer_axis axis,
73 touch_notify_touch(struct libinput_device *device,
78 enum libinput_touch_type touch_type);
80 static inline li_fixed_t li_fixed_from_int(int i)
85 static inline li_fixed_t
86 li_fixed_from_double(double d)
93 u.d = d + (3LL << (51 - 8));
98 #define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0])
100 #define LIBINPUT_EXPORT __attribute__ ((visibility("default")))
102 #endif /* LIBINPUT_PRIVATE_H */