!x->resolution || !y->resolution)
return -1;
- *width = evdev_convert_to_mm(x, x->maximum);
- *height = evdev_convert_to_mm(y, y->maximum);
+ *width = absinfo_convert_to_mm(x, x->maximum);
+ *height = absinfo_convert_to_mm(y, y->maximum);
return 0;
}
#include "timer.h"
#include "filter.h"
#include "quirks.h"
+#include "util-input-event.h"
/* The fake resolution value for abs devices without resolution */
#define EVDEV_FAKE_RESOLUTION 1
enum libinput_config_middle_emulation_state
evdev_middlebutton_get_default(struct libinput_device *device);
-static inline double
-evdev_convert_to_mm(const struct input_absinfo *absinfo, double v)
-{
- double value = v - absinfo->minimum;
- return value/absinfo->resolution;
-}
-
static inline struct phys_coords
evdev_convert_xy_to_mm(const struct evdev_device *device, int x, int y)
{
struct phys_coords mm;
- mm.x = evdev_convert_to_mm(device->abs.absinfo_x, x);
- mm.y = evdev_convert_to_mm(device->abs.absinfo_y, y);
+ mm.x = absinfo_convert_to_mm(device->abs.absinfo_x, x);
+ mm.y = absinfo_convert_to_mm(device->abs.absinfo_y, y);
return mm;
}
0,
LIBINPUT_EVENT_POINTER_MOTION_ABSOLUTE);
- return evdev_convert_to_mm(device->abs.absinfo_x, event->absolute.x);
+ return absinfo_convert_to_mm(device->abs.absinfo_x, event->absolute.x);
}
LIBINPUT_EXPORT double
0,
LIBINPUT_EVENT_POINTER_MOTION_ABSOLUTE);
- return evdev_convert_to_mm(device->abs.absinfo_y, event->absolute.y);
+ return absinfo_convert_to_mm(device->abs.absinfo_y, event->absolute.y);
}
LIBINPUT_EXPORT double
LIBINPUT_EVENT_TOUCH_DOWN,
LIBINPUT_EVENT_TOUCH_MOTION);
- return evdev_convert_to_mm(device->abs.absinfo_x, event->point.x);
+ return absinfo_convert_to_mm(device->abs.absinfo_x, event->point.x);
}
LIBINPUT_EXPORT double
LIBINPUT_EVENT_TOUCH_DOWN,
LIBINPUT_EVENT_TOUCH_MOTION);
- return evdev_convert_to_mm(device->abs.absinfo_y, event->point.y);
+ return absinfo_convert_to_mm(device->abs.absinfo_y, event->point.y);
}
LIBINPUT_EXPORT uint32_t
LIBINPUT_EVENT_TABLET_TOOL_BUTTON,
LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY);
- return evdev_convert_to_mm(device->abs.absinfo_x,
- event->axes.point.x);
+ return absinfo_convert_to_mm(device->abs.absinfo_x,
+ event->axes.point.x);
}
LIBINPUT_EXPORT double
LIBINPUT_EVENT_TABLET_TOOL_BUTTON,
LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY);
- return evdev_convert_to_mm(device->abs.absinfo_y,
- event->axes.point.y);
+ return absinfo_convert_to_mm(device->abs.absinfo_y,
+ event->axes.point.y);
}
LIBINPUT_EXPORT double