Lines Matching refs:xwl_touch
934 static struct xwl_touch *
937 struct xwl_touch *xwl_touch, *next_xwl_touch; in xwl_seat_lookup_touch() local
939 xorg_list_for_each_entry_safe(xwl_touch, next_xwl_touch, in xwl_seat_lookup_touch()
941 if (xwl_touch->id == id) in xwl_seat_lookup_touch()
942 return xwl_touch; in xwl_seat_lookup_touch()
949 xwl_touch_send_event(struct xwl_touch *xwl_touch, in xwl_touch_send_event() argument
955 dx = xwl_touch->window->window->drawable.x; in xwl_touch_send_event()
956 dy = xwl_touch->window->window->drawable.y; in xwl_touch_send_event()
958 x = (dx + xwl_touch->x) * 0xFFFF / xwl_seat->xwl_screen->width; in xwl_touch_send_event()
959 y = (dy + xwl_touch->y) * 0xFFFF / xwl_seat->xwl_screen->height; in xwl_touch_send_event()
964 QueueTouchEvents(xwl_seat->touch, type, xwl_touch->id, 0, &mask); in xwl_touch_send_event()
974 struct xwl_touch *xwl_touch; in touch_handle_down() local
979 xwl_touch = calloc(1, sizeof *xwl_touch); in touch_handle_down()
980 if (xwl_touch == NULL) { in touch_handle_down()
985 xwl_touch->window = wl_surface_get_user_data(surface); in touch_handle_down()
986 xwl_touch->id = id; in touch_handle_down()
987 xwl_touch->x = wl_fixed_to_int(sx_w); in touch_handle_down()
988 xwl_touch->y = wl_fixed_to_int(sy_w); in touch_handle_down()
989 xorg_list_add(&xwl_touch->link_touch, &xwl_seat->touches); in touch_handle_down()
991 xwl_touch_send_event(xwl_touch, xwl_seat, XI_TouchBegin); in touch_handle_down()
998 struct xwl_touch *xwl_touch; in touch_handle_up() local
1001 xwl_touch = xwl_seat_lookup_touch(xwl_seat, id); in touch_handle_up()
1003 if (!xwl_touch) in touch_handle_up()
1006 xwl_touch_send_event(xwl_touch, xwl_seat, XI_TouchEnd); in touch_handle_up()
1007 xorg_list_del(&xwl_touch->link_touch); in touch_handle_up()
1008 free(xwl_touch); in touch_handle_up()
1017 struct xwl_touch *xwl_touch; in touch_handle_motion() local
1019 xwl_touch = xwl_seat_lookup_touch(xwl_seat, id); in touch_handle_motion()
1021 if (!xwl_touch) in touch_handle_motion()
1024 xwl_touch->x = wl_fixed_to_int(sx_w); in touch_handle_motion()
1025 xwl_touch->y = wl_fixed_to_int(sy_w); in touch_handle_motion()
1026 xwl_touch_send_event(xwl_touch, xwl_seat, XI_TouchUpdate); in touch_handle_motion()
1038 struct xwl_touch *xwl_touch, *next_xwl_touch; in touch_handle_cancel() local
1040 xorg_list_for_each_entry_safe(xwl_touch, next_xwl_touch, in touch_handle_cancel()
1046 xwl_touch_send_event(xwl_touch, xwl_seat, XI_TouchEnd); in touch_handle_cancel()
1047 xorg_list_del(&xwl_touch->link_touch); in touch_handle_cancel()
1048 free(xwl_touch); in touch_handle_cancel()
1402 struct xwl_touch *xwl_touch, *next_xwl_touch; in xwl_seat_destroy() local
1406 xorg_list_for_each_entry_safe(xwl_touch, next_xwl_touch, in xwl_seat_destroy()
1408 xorg_list_del(&xwl_touch->link_touch); in xwl_seat_destroy()
1409 free(xwl_touch); in xwl_seat_destroy()
2601 struct xwl_touch *xwl_touch, *next_xwl_touch; in xwl_seat_clear_touch() local
2603 xorg_list_for_each_entry_safe(xwl_touch, next_xwl_touch, in xwl_seat_clear_touch()
2605 if (xwl_touch->window->window == window) { in xwl_seat_clear_touch()
2606 xorg_list_del(&xwl_touch->link_touch); in xwl_seat_clear_touch()
2607 free(xwl_touch); in xwl_seat_clear_touch()