mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-01-06 20:00:13 +01:00
tablet: add get_time_usec() for tablets, switch to usec
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
6bfc36f9cf
commit
1b952ee87d
5 changed files with 31 additions and 15 deletions
|
|
@ -107,7 +107,7 @@ static void
|
|||
tablet_process_absolute(struct tablet_dispatch *tablet,
|
||||
struct evdev_device *device,
|
||||
struct input_event *e,
|
||||
uint32_t time)
|
||||
uint64_t time)
|
||||
{
|
||||
enum libinput_tablet_axis axis;
|
||||
|
||||
|
|
@ -316,7 +316,7 @@ get_delta(enum libinput_tablet_axis axis, double current, double old)
|
|||
static void
|
||||
tablet_check_notify_axes(struct tablet_dispatch *tablet,
|
||||
struct evdev_device *device,
|
||||
uint32_t time,
|
||||
uint64_t time,
|
||||
struct libinput_tool *tool)
|
||||
{
|
||||
struct libinput_device *base = &device->base;
|
||||
|
|
@ -478,7 +478,7 @@ static void
|
|||
tablet_process_key(struct tablet_dispatch *tablet,
|
||||
struct evdev_device *device,
|
||||
struct input_event *e,
|
||||
uint32_t time)
|
||||
uint64_t time)
|
||||
{
|
||||
switch (e->code) {
|
||||
case BTN_TOOL_PEN:
|
||||
|
|
@ -521,7 +521,7 @@ static void
|
|||
tablet_process_relative(struct tablet_dispatch *tablet,
|
||||
struct evdev_device *device,
|
||||
struct input_event *e,
|
||||
uint32_t time)
|
||||
uint64_t time)
|
||||
{
|
||||
enum libinput_tablet_axis axis;
|
||||
|
||||
|
|
@ -551,7 +551,7 @@ static void
|
|||
tablet_process_misc(struct tablet_dispatch *tablet,
|
||||
struct evdev_device *device,
|
||||
struct input_event *e,
|
||||
uint32_t time)
|
||||
uint64_t time)
|
||||
{
|
||||
switch (e->code) {
|
||||
case MSC_SERIAL:
|
||||
|
|
@ -779,7 +779,7 @@ tablet_get_tool(struct tablet_dispatch *tablet,
|
|||
static void
|
||||
tablet_notify_button_mask(struct tablet_dispatch *tablet,
|
||||
struct evdev_device *device,
|
||||
uint32_t time,
|
||||
uint64_t time,
|
||||
struct libinput_tool *tool,
|
||||
const unsigned char *buttons,
|
||||
unsigned int buttons_len,
|
||||
|
|
@ -805,7 +805,7 @@ tablet_notify_button_mask(struct tablet_dispatch *tablet,
|
|||
static void
|
||||
tablet_notify_buttons(struct tablet_dispatch *tablet,
|
||||
struct evdev_device *device,
|
||||
uint32_t time,
|
||||
uint64_t time,
|
||||
struct libinput_tool *tool,
|
||||
enum libinput_button_state state)
|
||||
{
|
||||
|
|
@ -864,7 +864,7 @@ sanitize_tablet_axes(struct tablet_dispatch *tablet)
|
|||
static void
|
||||
tablet_flush(struct tablet_dispatch *tablet,
|
||||
struct evdev_device *device,
|
||||
uint32_t time)
|
||||
uint64_t time)
|
||||
{
|
||||
struct libinput_tool *tool =
|
||||
tablet_get_tool(tablet,
|
||||
|
|
|
|||
|
|
@ -432,7 +432,7 @@ touch_notify_frame(struct libinput_device *device,
|
|||
|
||||
void
|
||||
tablet_notify_axis(struct libinput_device *device,
|
||||
uint32_t time,
|
||||
uint64_t time,
|
||||
struct libinput_tool *tool,
|
||||
unsigned char *changed_axes,
|
||||
double *axes,
|
||||
|
|
@ -441,7 +441,7 @@ tablet_notify_axis(struct libinput_device *device,
|
|||
|
||||
void
|
||||
tablet_notify_proximity(struct libinput_device *device,
|
||||
uint32_t time,
|
||||
uint64_t time,
|
||||
struct libinput_tool *tool,
|
||||
enum libinput_tool_proximity_state state,
|
||||
unsigned char *changed_axes,
|
||||
|
|
@ -449,7 +449,7 @@ tablet_notify_proximity(struct libinput_device *device,
|
|||
|
||||
void
|
||||
tablet_notify_button(struct libinput_device *device,
|
||||
uint32_t time,
|
||||
uint64_t time,
|
||||
struct libinput_tool *tool,
|
||||
double *axes,
|
||||
int32_t button,
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ struct libinput_event_tablet {
|
|||
uint32_t button;
|
||||
enum libinput_button_state state;
|
||||
uint32_t seat_button_count;
|
||||
uint32_t time;
|
||||
uint64_t time;
|
||||
double axes[LIBINPUT_TABLET_AXIS_MAX + 1];
|
||||
double deltas[LIBINPUT_TABLET_AXIS_MAX + 1];
|
||||
double deltas_discrete[LIBINPUT_TABLET_AXIS_MAX + 1];
|
||||
|
|
@ -1021,6 +1021,12 @@ libinput_event_tablet_get_proximity_state(struct libinput_event_tablet *event)
|
|||
|
||||
LIBINPUT_EXPORT uint32_t
|
||||
libinput_event_tablet_get_time(struct libinput_event_tablet *event)
|
||||
{
|
||||
return us2ms(event->time);
|
||||
}
|
||||
|
||||
LIBINPUT_EXPORT uint64_t
|
||||
libinput_event_tablet_get_time_usec(struct libinput_event_tablet *event)
|
||||
{
|
||||
return event->time;
|
||||
}
|
||||
|
|
@ -1841,7 +1847,7 @@ touch_notify_frame(struct libinput_device *device,
|
|||
|
||||
void
|
||||
tablet_notify_axis(struct libinput_device *device,
|
||||
uint32_t time,
|
||||
uint64_t time,
|
||||
struct libinput_tool *tool,
|
||||
unsigned char *changed_axes,
|
||||
double *axes,
|
||||
|
|
@ -1876,7 +1882,7 @@ tablet_notify_axis(struct libinput_device *device,
|
|||
|
||||
void
|
||||
tablet_notify_proximity(struct libinput_device *device,
|
||||
uint32_t time,
|
||||
uint64_t time,
|
||||
struct libinput_tool *tool,
|
||||
enum libinput_tool_proximity_state proximity_state,
|
||||
unsigned char *changed_axes,
|
||||
|
|
@ -1910,7 +1916,7 @@ tablet_notify_proximity(struct libinput_device *device,
|
|||
|
||||
void
|
||||
tablet_notify_button(struct libinput_device *device,
|
||||
uint32_t time,
|
||||
uint64_t time,
|
||||
struct libinput_tool *tool,
|
||||
double *axes,
|
||||
int32_t button,
|
||||
|
|
|
|||
|
|
@ -1541,6 +1541,15 @@ libinput_event_tablet_get_seat_button_count(struct libinput_event_tablet *event)
|
|||
uint32_t
|
||||
libinput_event_tablet_get_time(struct libinput_event_tablet *event);
|
||||
|
||||
/**
|
||||
* @ingroup event_tablet
|
||||
*
|
||||
* @param event The libinput tablet event
|
||||
* @return The event time for this event in microseconds
|
||||
*/
|
||||
uint64_t
|
||||
libinput_event_tablet_get_time_usec(struct libinput_event_tablet *event);
|
||||
|
||||
/**
|
||||
* @ingroup event_tablet
|
||||
*
|
||||
|
|
|
|||
|
|
@ -191,6 +191,7 @@ LIBINPUT_TABLET_SUPPORT {
|
|||
libinput_event_tablet_get_tool;
|
||||
libinput_event_tablet_get_x_transformed;
|
||||
libinput_event_tablet_get_y_transformed;
|
||||
libinput_event_tablet_get_time_usec;
|
||||
libinput_tool_get_serial;
|
||||
libinput_tool_get_tool_id;
|
||||
libinput_tool_get_type;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue