2 * Copyright © 2013 Red Hat, Inc.
4 * Permission to use, copy, modify, distribute, and sell this software and its
5 * documentation for any purpose is hereby granted without fee, provided that
6 * the above copyright notice appear in all copies and that both that copyright
7 * notice and this permission notice appear in supporting documentation, and
8 * that the name of the copyright holders not be used in advertising or
9 * publicity pertaining to distribution of the software without specific,
10 * written prior permission. The copyright holders make no representations
11 * about the suitability of this software for any purpose. It is provided "as
12 * is" without express or implied warranty.
14 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
15 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
16 * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
17 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
18 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
19 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
23 #ifndef libevdev_INT_H
24 #define libevdev_INT_H
29 #define LONG_BITS (sizeof(long) * 8)
30 #define NLONGS(x) (((x) + LONG_BITS - 1) / LONG_BITS)
31 #define ARRAY_LENGTH(a) (sizeof(a) / (sizeof((a)[0])))
34 #define ABS_MT_MIN ABS_MT_SLOT
35 #define ABS_MT_MAX ABS_MT_TOOL_Y
36 #define ABS_MT_CNT (ABS_MT_MAX - ABS_MT_MIN + 1)
40 libevdev_log_func_t log;
44 unsigned long bits[NLONGS(EV_CNT)];
45 unsigned long props[NLONGS(INPUT_PROP_CNT)];
46 unsigned long key_bits[NLONGS(KEY_CNT)];
47 unsigned long rel_bits[NLONGS(REL_CNT)];
48 unsigned long abs_bits[NLONGS(ABS_CNT)];
49 unsigned long led_bits[NLONGS(LED_CNT)];
50 unsigned long key_values[NLONGS(KEY_CNT)];
51 struct input_absinfo abs_info[ABS_CNT];
52 unsigned int mt_slot_vals[MAX_SLOTS][ABS_MT_CNT];
53 int num_slots; /**< valid slots in mt_slot_vals */
58 struct input_event *queue;
59 size_t queue_size; /**< size of queue in elements */
60 size_t queue_next; /**< next event index */
61 size_t queue_nsync; /**< number of sync events */