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#include "libinput.h" 35 36#include "util-bits.h" 37#include "util-macros.h" 38#include "util-list.h" 39#include "util-matrix.h" 40#include "util-strings.h" 41#include "util-ratelimit.h" 42#include "util-prop-parsers.h" 43#include "util-time.h" 44 45#define VENDOR_ID_APPLE 0x5ac 46#define VENDOR_ID_CHICONY 0x4f2 47#define VENDOR_ID_LOGITECH 0x46d 48#define VENDOR_ID_WACOM 0x56a 49#define VENDOR_ID_SYNAPTICS_SERIAL 0x002 50#define PRODUCT_ID_APPLE_KBD_TOUCHPAD 0x273 51#define PRODUCT_ID_APPLE_APPLETOUCH 0x21a 52#define PRODUCT_ID_SYNAPTICS_SERIAL 0x007 53#define PRODUCT_ID_WACOM_EKR 0x0331 54 55/* The HW DPI rate we normalize to before calculating pointer acceleration */ 56#define DEFAULT_MOUSE_DPI 1000 57#define DEFAULT_TRACKPOINT_SENSITIVITY 128 58 59#define trace(...) \ 60 do { \ 61 printf("%s() - \033[0;31m", __func__); \ 62 printf(__VA_ARGS__); \ 63 printf("\033[0m"); \ 64 } while (0) 65 66#define LIBINPUT_EXPORT __attribute__ ((visibility("default"))) 67#define LIBINPUT_UNUSED __attribute__ ((unused)) 68 69#endif /* LIBINPUT_UTIL_H */ 70