}
static void
-tp_button_set_timer(struct tp_dispatch *tp, uint32_t timeout)
+tp_button_set_timer(struct tp_dispatch *tp, uint64_t timeout)
{
struct itimerspec its;
its.it_interval.tv_sec = 0;
tp_button_handle_event(struct tp_dispatch *tp,
struct tp_touch *t,
enum button_event event,
- uint32_t time)
+ uint64_t time)
{
enum button_state current = t->button.state;
}
int
-tp_button_handle_state(struct tp_dispatch *tp, uint32_t time)
+tp_button_handle_state(struct tp_dispatch *tp, uint64_t time)
{
struct tp_touch *t;
}
static void
-tp_button_handle_timeout(struct tp_dispatch *tp, uint32_t now)
+tp_button_handle_timeout(struct tp_dispatch *tp, uint64_t now)
{
struct tp_touch *t;
int
tp_process_button(struct tp_dispatch *tp,
const struct input_event *e,
- uint32_t time)
+ uint64_t time)
{
uint32_t mask = 1 << (e->code - BTN_LEFT);
uint64_t expires;
int len;
struct timespec ts;
- uint32_t now;
+ uint64_t now;
len = read(tp->buttons.timer_fd, &expires, sizeof expires);
if (len != sizeof expires)
log_error("timerfd read error: %s\n", strerror(errno));
clock_gettime(CLOCK_MONOTONIC, &ts);
- now = ts.tv_sec * 1000 + ts.tv_nsec / 1000000;
+ now = ts.tv_sec * 1000ULL + ts.tv_nsec / 1000000;
tp_button_handle_timeout(tp, now);
}
}
static int
-tp_post_clickfinger_buttons(struct tp_dispatch *tp, uint32_t time)
+tp_post_clickfinger_buttons(struct tp_dispatch *tp, uint64_t time)
{
uint32_t current, old, button;
enum libinput_pointer_button_state state;
}
static int
-tp_post_physical_buttons(struct tp_dispatch *tp, uint32_t time)
+tp_post_physical_buttons(struct tp_dispatch *tp, uint64_t time)
{
uint32_t current, old, button;
}
static int
-tp_post_softbutton_buttons(struct tp_dispatch *tp, uint32_t time)
+tp_post_softbutton_buttons(struct tp_dispatch *tp, uint64_t time)
{
uint32_t current, old, button;
enum libinput_pointer_button_state state;
}
int
-tp_post_button_events(struct tp_dispatch *tp, uint32_t time)
+tp_post_button_events(struct tp_dispatch *tp, uint64_t time)
{
if (tp->buttons.is_clickpad) {
if (tp->buttons.use_clickfinger)
static void
tp_tap_notify(struct tp_dispatch *tp,
- uint32_t time,
+ uint64_t time,
int nfingers,
enum libinput_pointer_button_state state)
{
}
static void
-tp_tap_set_timer(struct tp_dispatch *tp, uint32_t time)
+tp_tap_set_timer(struct tp_dispatch *tp, uint64_t time)
{
- uint32_t timeout = time + DEFAULT_TAP_TIMEOUT_PERIOD;
+ uint64_t timeout = time + DEFAULT_TAP_TIMEOUT_PERIOD;
struct itimerspec its;
its.it_interval.tv_sec = 0;
}
static void
-tp_tap_idle_handle_event(struct tp_dispatch *tp, enum tap_event event, uint32_t time)
+tp_tap_idle_handle_event(struct tp_dispatch *tp, enum tap_event event, uint64_t time)
{
switch (event) {
}
static void
-tp_tap_touch_handle_event(struct tp_dispatch *tp, enum tap_event event, uint32_t time)
+tp_tap_touch_handle_event(struct tp_dispatch *tp, enum tap_event event, uint64_t time)
{
switch (event) {
}
static void
-tp_tap_hold_handle_event(struct tp_dispatch *tp, enum tap_event event, uint32_t time)
+tp_tap_hold_handle_event(struct tp_dispatch *tp, enum tap_event event, uint64_t time)
{
switch (event) {
}
static void
-tp_tap_tapped_handle_event(struct tp_dispatch *tp, enum tap_event event, uint32_t time)
+tp_tap_tapped_handle_event(struct tp_dispatch *tp, enum tap_event event, uint64_t time)
{
switch (event) {
}
static void
-tp_tap_touch2_handle_event(struct tp_dispatch *tp, enum tap_event event, uint32_t time)
+tp_tap_touch2_handle_event(struct tp_dispatch *tp, enum tap_event event, uint64_t time)
{
switch (event) {
}
static void
-tp_tap_touch2_hold_handle_event(struct tp_dispatch *tp, enum tap_event event, uint32_t time)
+tp_tap_touch2_hold_handle_event(struct tp_dispatch *tp, enum tap_event event, uint64_t time)
{
switch (event) {
}
static void
-tp_tap_touch3_handle_event(struct tp_dispatch *tp, enum tap_event event, uint32_t time)
+tp_tap_touch3_handle_event(struct tp_dispatch *tp, enum tap_event event, uint64_t time)
{
switch (event) {
}
static void
-tp_tap_touch3_hold_handle_event(struct tp_dispatch *tp, enum tap_event event, uint32_t time)
+tp_tap_touch3_hold_handle_event(struct tp_dispatch *tp, enum tap_event event, uint64_t time)
{
switch (event) {
}
static void
-tp_tap_dragging_or_doubletap_handle_event(struct tp_dispatch *tp, enum tap_event event, uint32_t time)
+tp_tap_dragging_or_doubletap_handle_event(struct tp_dispatch *tp, enum tap_event event, uint64_t time)
{
switch (event) {
case TAP_EVENT_TOUCH:
}
static void
-tp_tap_dragging_handle_event(struct tp_dispatch *tp, enum tap_event event, uint32_t time)
+tp_tap_dragging_handle_event(struct tp_dispatch *tp, enum tap_event event, uint64_t time)
{
switch (event) {
}
static void
-tp_tap_dragging_wait_handle_event(struct tp_dispatch *tp, enum tap_event event, uint32_t time)
+tp_tap_dragging_wait_handle_event(struct tp_dispatch *tp, enum tap_event event, uint64_t time)
{
switch (event) {
}
static void
-tp_tap_dragging2_handle_event(struct tp_dispatch *tp, enum tap_event event, uint32_t time)
+tp_tap_dragging2_handle_event(struct tp_dispatch *tp, enum tap_event event, uint64_t time)
{
switch (event) {
}
static void
-tp_tap_dead_handle_event(struct tp_dispatch *tp, enum tap_event event, uint32_t time)
+tp_tap_dead_handle_event(struct tp_dispatch *tp, enum tap_event event, uint64_t time)
{
switch (event) {
}
static void
-tp_tap_handle_event(struct tp_dispatch *tp, enum tap_event event, uint32_t time)
+tp_tap_handle_event(struct tp_dispatch *tp, enum tap_event event, uint64_t time)
{
enum tp_tap_state current;
if (!tp->tap.enabled)
}
int
-tp_tap_handle_state(struct tp_dispatch *tp, uint32_t time)
+tp_tap_handle_state(struct tp_dispatch *tp, uint64_t time)
{
struct tp_touch *t;
int filter_motion = 0;
uint64_t expires;
int len;
struct timespec ts;
- uint32_t now;
+ uint64_t now;
len = read(touchpad->tap.timer_fd, &expires, sizeof expires);
if (len != sizeof expires)
log_error("timerfd read error: %s\n", strerror(errno));
clock_gettime(CLOCK_MONOTONIC, &ts);
- now = ts.tv_sec * 1000 + ts.tv_nsec / 1000000;
+ now = ts.tv_sec * 1000ULL + ts.tv_nsec / 1000000;
tp_tap_handle_timeout(touchpad, now);
}
unsigned int
-tp_tap_handle_timeout(struct tp_dispatch *tp, uint32_t time)
+tp_tap_handle_timeout(struct tp_dispatch *tp, uint64_t time)
{
if (!tp->tap.enabled)
return 0;
tp_accel_profile(struct motion_filter *filter,
void *data,
double velocity,
- uint32_t time)
+ uint64_t time)
{
struct tp_dispatch *tp =
(struct tp_dispatch *) data;
static void
tp_filter_motion(struct tp_dispatch *tp,
- double *dx, double *dy, uint32_t time)
+ double *dx, double *dy, uint64_t time)
{
struct motion_params motion;
static void
tp_process_absolute(struct tp_dispatch *tp,
const struct input_event *e,
- uint32_t time)
+ uint64_t time)
{
struct tp_touch *t = tp_current_touch(tp);
static void
tp_process_absolute_st(struct tp_dispatch *tp,
const struct input_event *e,
- uint32_t time)
+ uint64_t time)
{
struct tp_touch *t = tp_current_touch(tp);
static void
tp_process_fake_touch(struct tp_dispatch *tp,
const struct input_event *e,
- uint32_t time)
+ uint64_t time)
{
struct tp_touch *t;
unsigned int fake_touches;
static void
tp_process_key(struct tp_dispatch *tp,
const struct input_event *e,
- uint32_t time)
+ uint64_t time)
{
switch (e->code) {
case BTN_LEFT:
}
static void
-tp_process_state(struct tp_dispatch *tp, uint32_t time)
+tp_process_state(struct tp_dispatch *tp, uint64_t time)
{
struct tp_touch *t;
struct tp_touch *first = tp_get_touch(tp, 0);
}
static void
-tp_post_process_state(struct tp_dispatch *tp, uint32_t time)
+tp_post_process_state(struct tp_dispatch *tp, uint64_t time)
{
struct tp_touch *t;
}
static void
-tp_post_twofinger_scroll(struct tp_dispatch *tp, uint32_t time)
+tp_post_twofinger_scroll(struct tp_dispatch *tp, uint64_t time)
{
struct tp_touch *t;
int nchanged = 0;
}
static int
-tp_post_scroll_events(struct tp_dispatch *tp, uint32_t time)
+tp_post_scroll_events(struct tp_dispatch *tp, uint64_t time)
{
struct tp_touch *t;
int nfingers_down = 0;
}
static void
-tp_post_events(struct tp_dispatch *tp, uint32_t time)
+tp_post_events(struct tp_dispatch *tp, uint64_t time)
{
struct tp_touch *t = tp_current_touch(tp);
double dx, dy;
tp_process(struct evdev_dispatch *dispatch,
struct evdev_device *device,
struct input_event *e,
- uint32_t time)
+ uint64_t time)
{
struct tp_dispatch *tp =
(struct tp_dispatch *)dispatch;
bool is_pointer; /* the pointer-controlling touch */
int32_t x;
int32_t y;
- uint32_t millis;
+ uint64_t millis;
struct {
struct tp_motion samples[TOUCHPAD_HISTORY_LENGTH];
enum button_state state;
/* We use button_event here so we can use == on events */
enum button_event curr;
- uint32_t timeout;
+ uint64_t timeout;
} button;
};
tp_set_pointer(struct tp_dispatch *tp, struct tp_touch *t);
int
-tp_tap_handle_state(struct tp_dispatch *tp, uint32_t time);
+tp_tap_handle_state(struct tp_dispatch *tp, uint64_t time);
unsigned int
-tp_tap_handle_timeout(struct tp_dispatch *tp, uint32_t time);
+tp_tap_handle_timeout(struct tp_dispatch *tp, uint64_t time);
int
tp_init_tap(struct tp_dispatch *tp);
int
tp_process_button(struct tp_dispatch *tp,
const struct input_event *e,
- uint32_t time);
+ uint64_t time);
int
-tp_post_button_events(struct tp_dispatch *tp, uint32_t time);
+tp_post_button_events(struct tp_dispatch *tp, uint64_t time);
int
-tp_button_handle_state(struct tp_dispatch *tp, uint32_t time);
+tp_button_handle_state(struct tp_dispatch *tp, uint64_t time);
int
tp_button_touch_active(struct tp_dispatch *tp, struct tp_touch *t);
touchpad_profile(struct motion_filter *filter,
void *data,
double velocity,
- uint32_t time)
+ uint64_t time)
{
struct touchpad_dispatch *touchpad =
(struct touchpad_dispatch *) data;
static void
filter_motion(struct touchpad_dispatch *touchpad,
- double *dx, double *dy, uint32_t time)
+ double *dx, double *dy, uint64_t time)
{
struct motion_params motion;
}
static void
-notify_button_pressed(struct touchpad_dispatch *touchpad, uint32_t time)
+notify_button_pressed(struct touchpad_dispatch *touchpad, uint64_t time)
{
pointer_notify_button(
&touchpad->device->base,
}
static void
-notify_button_released(struct touchpad_dispatch *touchpad, uint32_t time)
+notify_button_released(struct touchpad_dispatch *touchpad, uint64_t time)
{
pointer_notify_button(
&touchpad->device->base,
}
static void
-notify_tap(struct touchpad_dispatch *touchpad, uint32_t time)
+notify_tap(struct touchpad_dispatch *touchpad, uint64_t time)
{
notify_button_pressed(touchpad, time);
notify_button_released(touchpad, time);
}
static void
-process_fsm_events(struct touchpad_dispatch *touchpad, uint32_t time)
+process_fsm_events(struct touchpad_dispatch *touchpad, uint64_t time)
{
- uint32_t timeout = UINT32_MAX;
+ uint64_t timeout = UINT64_MAX;
enum fsm_event event;
unsigned int i;
}
}
- if (timeout != UINT32_MAX) {
+ if (timeout != UINT64_MAX) {
struct itimerspec its;
its.it_interval.tv_sec = 0;
uint64_t expires;
int len;
struct timespec ts;
- uint32_t now;
+ uint64_t now;
len = read(touchpad->fsm.timer.fd, &expires, sizeof expires);
if (len != sizeof expires)
if (touchpad->fsm.events_count == 0) {
clock_gettime(CLOCK_MONOTONIC, &ts);
- now = ts.tv_sec * 1000 + ts.tv_nsec / 1000000;
+ now = ts.tv_sec * 1000ULL + ts.tv_nsec / 1000000;
push_fsm_event(touchpad, FSM_EVENT_TIMEOUT);
process_fsm_events(touchpad, now);
}
static void
-touchpad_update_state(struct touchpad_dispatch *touchpad, uint32_t time)
+touchpad_update_state(struct touchpad_dispatch *touchpad, uint64_t time)
{
int motion_index;
int center_x, center_y;
process_key(struct touchpad_dispatch *touchpad,
struct evdev_device *device,
struct input_event *e,
- uint32_t time)
+ uint64_t time)
{
uint32_t code;
touchpad_process(struct evdev_dispatch *dispatch,
struct evdev_device *device,
struct input_event *e,
- uint32_t time)
+ uint64_t time)
{
struct touchpad_dispatch *touchpad =
(struct touchpad_dispatch *) dispatch;
}
static void
-evdev_flush_pending_event(struct evdev_device *device, uint32_t time)
+evdev_flush_pending_event(struct evdev_device *device, uint64_t time)
{
int32_t cx, cy;
li_fixed_t x, y;
static void
evdev_process_touch(struct evdev_device *device,
struct input_event *e,
- uint32_t time)
+ uint64_t time)
{
switch (e->code) {
case ABS_MT_SLOT:
static inline void
evdev_process_relative(struct evdev_device *device,
- struct input_event *e, uint32_t time)
+ struct input_event *e, uint64_t time)
{
struct libinput_device *base = &device->base;
static inline void
evdev_process_absolute(struct evdev_device *device,
struct input_event *e,
- uint32_t time)
+ uint64_t time)
{
if (device->is_mt) {
evdev_process_touch(device, e, time);
fallback_process(struct evdev_dispatch *dispatch,
struct evdev_device *device,
struct input_event *event,
- uint32_t time)
+ uint64_t time)
{
int need_frame = 0;
evdev_process_event(struct evdev_device *device, struct input_event *e)
{
struct evdev_dispatch *dispatch = device->dispatch;
- uint32_t time = e->time.tv_sec * 1000 + e->time.tv_usec / 1000;
+ uint64_t time = e->time.tv_sec * 1000ULL + e->time.tv_usec / 1000;
dispatch->interface->process(dispatch, device, e, time);
}
void (*process)(struct evdev_dispatch *dispatch,
struct evdev_device *device,
struct input_event *event,
- uint32_t time);
+ uint64_t time);
/* Destroy an event dispatch handler and free all its resources. */
void (*destroy)(struct evdev_dispatch *dispatch);
void
filter_dispatch(struct motion_filter *filter,
struct motion_params *motion,
- void *data, uint32_t time)
+ void *data, uint64_t time)
{
filter->interface->filter(filter, motion, data, time);
}
struct pointer_tracker {
double dx;
double dy;
- uint32_t time;
+ uint64_t time;
int dir;
};
static void
feed_trackers(struct pointer_accelerator *accel,
double dx, double dy,
- uint32_t time)
+ uint64_t time)
{
int i, current;
struct pointer_tracker *trackers = accel->trackers;
}
static double
-calculate_tracker_velocity(struct pointer_tracker *tracker, uint32_t time)
+calculate_tracker_velocity(struct pointer_tracker *tracker, uint64_t time)
{
int dx;
int dy;
}
static double
-calculate_velocity(struct pointer_accelerator *accel, uint32_t time)
+calculate_velocity(struct pointer_accelerator *accel, uint64_t time)
{
struct pointer_tracker *tracker;
double velocity;
static double
acceleration_profile(struct pointer_accelerator *accel,
- void *data, double velocity, uint32_t time)
+ void *data, double velocity, uint64_t time)
{
return accel->profile(&accel->base, data, velocity, time);
}
static double
calculate_acceleration(struct pointer_accelerator *accel,
- void *data, double velocity, uint32_t time)
+ void *data, double velocity, uint64_t time)
{
double factor;
static void
accelerator_filter(struct motion_filter *filter,
struct motion_params *motion,
- void *data, uint32_t time)
+ void *data, uint64_t time)
{
struct pointer_accelerator *accel =
(struct pointer_accelerator *) filter;
void
filter_dispatch(struct motion_filter *filter,
struct motion_params *motion,
- void *data, uint32_t time);
+ void *data, uint64_t time);
struct motion_filter_interface {
void (*filter)(struct motion_filter *filter,
struct motion_params *motion,
- void *data, uint32_t time);
+ void *data, uint64_t time);
void (*destroy)(struct motion_filter *filter);
};
typedef double (*accel_profile_func_t)(struct motion_filter *filter,
void *data,
double velocity,
- uint32_t time);
+ uint64_t time);
struct motion_filter *
create_pointer_accelator_filter(accel_profile_func_t filter);