int32_t seat_slot;
li_fixed_t x;
li_fixed_t y;
- enum libinput_touch_type touch_type;
};
static void
case LIBINPUT_EVENT_POINTER_BUTTON:
case LIBINPUT_EVENT_POINTER_AXIS:
return (struct libinput_event_pointer *) event;
- case LIBINPUT_EVENT_TOUCH_TOUCH:
+ case LIBINPUT_EVENT_TOUCH_DOWN:
+ case LIBINPUT_EVENT_TOUCH_UP:
+ case LIBINPUT_EVENT_TOUCH_MOTION:
+ case LIBINPUT_EVENT_TOUCH_CANCEL:
case LIBINPUT_EVENT_TOUCH_FRAME:
break;
}
case LIBINPUT_EVENT_POINTER_MOTION_ABSOLUTE:
case LIBINPUT_EVENT_POINTER_BUTTON:
case LIBINPUT_EVENT_POINTER_AXIS:
- case LIBINPUT_EVENT_TOUCH_TOUCH:
+ case LIBINPUT_EVENT_TOUCH_DOWN:
+ case LIBINPUT_EVENT_TOUCH_UP:
+ case LIBINPUT_EVENT_TOUCH_MOTION:
+ case LIBINPUT_EVENT_TOUCH_CANCEL:
case LIBINPUT_EVENT_TOUCH_FRAME:
break;
}
case LIBINPUT_EVENT_POINTER_BUTTON:
case LIBINPUT_EVENT_POINTER_AXIS:
break;
- case LIBINPUT_EVENT_TOUCH_TOUCH:
+ case LIBINPUT_EVENT_TOUCH_DOWN:
+ case LIBINPUT_EVENT_TOUCH_UP:
+ case LIBINPUT_EVENT_TOUCH_MOTION:
+ case LIBINPUT_EVENT_TOUCH_CANCEL:
case LIBINPUT_EVENT_TOUCH_FRAME:
return (struct libinput_event_touch *) event;
}
case LIBINPUT_EVENT_POINTER_MOTION_ABSOLUTE:
case LIBINPUT_EVENT_POINTER_BUTTON:
case LIBINPUT_EVENT_POINTER_AXIS:
- case LIBINPUT_EVENT_TOUCH_TOUCH:
+ case LIBINPUT_EVENT_TOUCH_DOWN:
+ case LIBINPUT_EVENT_TOUCH_UP:
+ case LIBINPUT_EVENT_TOUCH_MOTION:
+ case LIBINPUT_EVENT_TOUCH_CANCEL:
case LIBINPUT_EVENT_TOUCH_FRAME:
break;
}
return event->y;
}
-LIBINPUT_EXPORT enum libinput_touch_type
-libinput_event_touch_get_touch_type(struct libinput_event_touch *event)
-{
- return event->touch_type;
-}
-
struct libinput_source *
libinput_add_fd(struct libinput *libinput,
int fd,
}
void
-touch_notify_touch(struct libinput_device *device,
- uint32_t time,
- int32_t slot,
- int32_t seat_slot,
- li_fixed_t x,
- li_fixed_t y,
- enum libinput_touch_type touch_type)
+touch_notify_touch_down(struct libinput_device *device,
+ uint32_t time,
+ int32_t slot,
+ int32_t seat_slot,
+ li_fixed_t x,
+ li_fixed_t y)
+{
+ struct libinput_event_touch *touch_event;
+
+ touch_event = zalloc(sizeof *touch_event);
+ if (!touch_event)
+ return;
+
+ *touch_event = (struct libinput_event_touch) {
+ .time = time,
+ .slot = slot,
+ .seat_slot = seat_slot,
+ .x = x,
+ .y = y,
+ };
+
+ post_device_event(device,
+ LIBINPUT_EVENT_TOUCH_DOWN,
+ &touch_event->base);
+}
+
+void
+touch_notify_touch_motion(struct libinput_device *device,
+ uint32_t time,
+ int32_t slot,
+ int32_t seat_slot,
+ li_fixed_t x,
+ li_fixed_t y)
{
struct libinput_event_touch *touch_event;
.seat_slot = seat_slot,
.x = x,
.y = y,
- .touch_type = touch_type,
};
post_device_event(device,
- LIBINPUT_EVENT_TOUCH_TOUCH,
+ LIBINPUT_EVENT_TOUCH_MOTION,
+ &touch_event->base);
+}
+
+void
+touch_notify_touch_up(struct libinput_device *device,
+ uint32_t time,
+ int32_t slot,
+ int32_t seat_slot)
+{
+ struct libinput_event_touch *touch_event;
+
+ touch_event = zalloc(sizeof *touch_event);
+ if (!touch_event)
+ return;
+
+ *touch_event = (struct libinput_event_touch) {
+ .time = time,
+ .slot = slot,
+ .seat_slot = seat_slot,
+ };
+
+ post_device_event(device,
+ LIBINPUT_EVENT_TOUCH_UP,
&touch_event->base);
}