-SUBDIRS = src doc test tools udev
+SUBDIRS = src doc test udev
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
%define udev_dir %{_prefix}/lib/udev
Name: libinput
-Version: 0.11.0
+Version: 1.8.0
Release: 0
License: MIT
Summary: Input devices for display servers and other applications
export LIBINPUT_EXECUTABLE_CFLAGS=" -fPIE "
export LIBINPUT_EXECUTABLE_LIBS=" -pie "
-%autogen --with-udev-dir=%{udev_dir}
+%autogen --with-udev-dir=%{udev_dir} --disable-documentation --disable-debug-gui --disable-tests --disable-libwacom
%build
%__make %{?_smp_mflags}
%{_libdir}/*.so.*
%{udev_dir}/%{name}*
%{udev_dir}/rules.d/*%{name}*
+%exclude /usr/lib/udev/hwdb.d/*
%files devel
%manifest %{name}.manifest
uint32_t width,
uint32_t height)
{
+ struct fallback_dispatch *dispatch = fallback_dispatch(device->dispatch);
double x_res = device->abs.absinfo_x->resolution;
double y_res = device->abs.absinfo_y->resolution;
- double x_scale = width / (device->abs.x + 1.0);
- double y_scale = height / (device->abs.y + 1.0);
+ double x_scale = width / (dispatch->abs.point.x + 1.0);
+ double y_scale = height / (dispatch->abs.point.y + 1.0);
if (x_res == y_res)
return diameter * x_scale;
struct mt_aux_data *aux_data;
struct list *current_axis_list;
- if (!dispatch->mt.aux_data_list) return false;
+ if (!dispatch->mt.aux_data_list) return;
if (dispatch->mt.slot < 0 || dispatch->mt.slot >= (int)dispatch->mt.slots_len)
- return false;
+ return;
current_axis_list = &dispatch->mt.aux_data_list[dispatch->mt.slot];
- if (list_empty(current_axis_list)) return false;
+ if (list_empty(current_axis_list)) return;
list_for_each(aux_data, current_axis_list, link) {
if (aux_data->code == e->code) {
int
evdev_scroll_get_wheel_click_angle(struct evdev_device *device)
{
- return device->scroll.wheel_click_angle;
+ return device->scroll.wheel_click_angle.x;
}
static struct evdev_dispatch *
if (udev_tags & EVDEV_UDEV_TAG_JOYSTICK) {
env = getenv("LIBINPUT_IGNORE_JOYSTICK");
if (env && atoi(env) == 1) {
- log_info(libinput,
- "input device '%s', %s have joystick, ignoring\n",
- device->devname, devnode);
- return -1;
+ evdev_log_info(device,
+ "input device '%s', have joystick, ignoring\n",
+ device->devname);
+ return NULL;
}
else {
if ((udev_tags & EVDEV_UDEV_TAG_JOYSTICK) == udev_tags) {
- log_info(libinput,
+ evdev_log_info(device,
"input device '%s', %s is a joystick, ignoring\n",
- device->devname, devnode);
- return -1;
+ device->devname);
+ return NULL;
}
}
}
/* A pair of tilt flags */
struct wheel_tilt_flags {
bool vertical, horizontal;
-}
+};
/* Ellipse parameters in device coordinates */
struct ellipse {
array[bit / 8] |= (1 << (bit % 8));
}
-static inline double
-deg2rad(double angle)
-{
- return angle * M_PI/180.0;
-}
-
static inline void
clear_bit(unsigned char *array, int bit)
{
static const char default_seat[] = "seat0";
static const char default_seat_name[] = "default";
-char **
-strv_from_string(const char *in, const char *separators);
-bool
-parse_calibration_property(const char *prop, float calibration_out[6]);
-
static struct udev_seat *
udev_seat_create(struct udev_input *input,
const char *device_seat,
return false;
}
-static inline bool
-safe_atod(const char *str, double *val)
-{
- char *endptr;
- double v;
- locale_t c_locale;
-
- /* Create a "C" locale to force strtod to use '.' as separator */
- c_locale = newlocale(LC_NUMERIC_MASK, "C", (locale_t)0);
- if (c_locale == (locale_t)0)
- return false;
-
- errno = 0;
- v = strtod_l(str, &endptr, c_locale);
- freelocale(c_locale);
- if (errno > 0)
- return false;
- if (str == endptr)
- return false;
- if (*str != '\0' && *endptr != '\0')
- return false;
- if (isnan(v) || isinf(v))
- return false;
-
- *val = v;
- return true;
-}
-
-static inline void
-strv_free(char **strv) {
- char **s = strv;
-
- if (!strv)
- return;
-
- while (*s != NULL) {
- free(*s);
- *s = (char*)0x1; /* detect use-after-free */
- s++;
- }
-
- free (strv);
-}
-
/**
* Return the next word in a string pointed to by state before the first
* separator character. Call repeatedly to tokenize a whole string.
return next;
}
-/**
- * Return a null-terminated string array with the tokens in the input
- * string, e.g. "one two\tthree" with a separator list of " \t" will return
- * an array [ "one", "two", "three", NULL ].
- *
- * Use strv_free() to free the array.
- *
- * @param in Input string
- * @param separators List of separator characters
- *
- * @return A null-terminated string array or NULL on errors
- */
-char **
-strv_from_string(const char *in, const char *separators)
-{
- const char *s, *word;
- char **strv = NULL;
- int nelems = 0, idx;
- size_t l;
-
- assert(in != NULL);
-
- s = in;
- while ((word = next_word(&s, &l, separators)) != NULL)
- nelems++;
-
- if (nelems == 0)
- return NULL;
-
- nelems++; /* NULL-terminated */
- strv = zalloc(nelems * sizeof *strv);
- if (!strv)
- return NULL;
-
- idx = 0;
-
- s = in;
- while ((word = next_word(&s, &l, separators)) != NULL) {
- char *copy = strndup(word, l);
- if (!copy) {
- strv_free(strv);
- return NULL;
- }
-
- strv[idx++] = copy;
- }
-
- return strv;
-}
-
-/**
- * Parses a set of 6 space-separated floats.
- *
- * @param prop The string value of the property
- * @param calibration Returns the six components
- * @return true on success, false otherwise
- */
-bool
-parse_calibration_property(const char *prop, float calibration_out[6])
-{
- int idx;
- char **strv;
- float calibration[6];
-
- if (!prop)
- return false;
-
- strv = strv_from_string(prop, " ");
- if (!strv)
- return false;
-
- for (idx = 0; idx < 6; idx++) {
- double v;
- if (strv[idx] == NULL || !safe_atod(strv[idx], &v)) {
- strv_free(strv);
- return false;
- }
-
- calibration[idx] = v;
- }
-
- strv_free(strv);
-
- memcpy(calibration_out, calibration, sizeof(calibration));
-
- return true;
-}
-
-
static int
device_added(struct udev_device *udev_device,
struct udev_input *input,