• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright © 2008 Kristian Høgsberg
3  * Copyright © 2013-2015 Red Hat, Inc.
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a
6  * copy of this software and associated documentation files (the "Software"),
7  * to deal in the Software without restriction, including without limitation
8  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9  * and/or sell copies of the Software, and to permit persons to whom the
10  * Software is furnished to do so, subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice (including the next
13  * paragraph) shall be included in all copies or substantial portions of the
14  * Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
19  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  * DEALINGS IN THE SOFTWARE.
23  */
24 
25 #ifndef LIBINPUT_UTIL_H
26 #define LIBINPUT_UTIL_H
27 
28 #include "config.h"
29 
30 #ifdef NDEBUG
31 #warning "libinput relies on assert(). #defining NDEBUG is not recommended"
32 #endif
33 
34 
35 #include "libinput.h"
36 
37 #include "util-bits.h"
38 #include "util-macros.h"
39 #include "util-list.h"
40 #include "util-matrix.h"
41 #include "util-strings.h"
42 #include "util-ratelimit.h"
43 #include "util-prop-parsers.h"
44 #include "util-time.h"
45 
46 #define VENDOR_ID_APPLE 0x5ac
47 #define VENDOR_ID_CHICONY 0x4f2
48 #define VENDOR_ID_LOGITECH 0x46d
49 #define VENDOR_ID_WACOM 0x56a
50 #define VENDOR_ID_SYNAPTICS_SERIAL 0x002
51 #define PRODUCT_ID_APPLE_KBD_TOUCHPAD 0x273
52 #define PRODUCT_ID_APPLE_APPLETOUCH 0x21a
53 #define PRODUCT_ID_SYNAPTICS_SERIAL 0x007
54 #define PRODUCT_ID_WACOM_EKR 0x0331
55 
56 /* The HW DPI rate we normalize to before calculating pointer acceleration */
57 #define DEFAULT_MOUSE_DPI 1000
58 #define DEFAULT_TRACKPOINT_SENSITIVITY 128
59 
60 #define trace(...) \
61 	do { \
62 	printf("%s() - \033[0;31m", __func__); \
63 	printf(__VA_ARGS__); \
64 	printf("\033[0m"); \
65 	} while (0)
66 
67 #define LIBINPUT_EXPORT __attribute__ ((visibility("default")))
68 
69 #endif /* LIBINPUT_UTIL_H */
70