wl_touch_listener Struct Reference
The wl_touch interface

`#include <wayland-client-protocol.h>`

## Data Fields

void(* | down )(void *data, struct wl_touch *wl_touch, uint32_t serial, uint32_t time, struct wl_surface *surface, int32_t id, wl_fixed_t x, wl_fixed_t y)
void(* | up )(void *data, struct wl_touch *wl_touch, uint32_t serial, uint32_t time, int32_t id)
void(* | motion )(void *data, struct wl_touch *wl_touch, uint32_t time, int32_t id, wl_fixed_t x, wl_fixed_t y)
void(* | frame )(void *data, struct wl_touch *wl_touch)
void(* | cancel )(void *data, struct wl_touch *wl_touch)
void(* | shape )(void *data, struct wl_touch *wl_touch, int32_t id, wl_fixed_t major, wl_fixed_t minor)
void(* | orientation )(void *data, struct wl_touch *wl_touch, int32_t id, wl_fixed_t orientation)

## Detailed Description

Definition at line 4700 of file wayland-client-protocol.h.

## Field Documentation

## cancel

void(* wl_touch_listener::cancel) (void *data, struct wl_touch *wl_touch)

touch session cancelled

Sent if the compositor decides the touch stream is a global gesture. No further events are sent to the clients from that particular gesture. Touch cancellation applies to all touch points currently active on this client's surface. The client is responsible for finalizing the touch points, future touch points on this surface may reuse the touch point ID.

Definition at line 4777 of file wayland-client-protocol.h.

## down

void(* wl_touch_listener::down) (void *data, struct wl_touch *wl_touch, uint32_t serial, uint32_t time, struct wl_surface *surface, int32_t id, wl_fixed_t x, wl_fixed_t y)

touch down event and beginning of a touch sequence

A new touch point has appeared on the surface. This touch point is assigned a unique ID. Future events from this touch point reference this ID. The ID ceases to be valid after a touch up event and may be reused in the future.

Parameters

  serial | serial number of the touch down event
  time | timestamp with millisecond granularity
  surface | surface touched
  id | the unique ID of this touch point
  x | surface-local x coordinate
  y | surface-local y coordinate

Definition at line 4715 of file wayland-client-protocol.h.

## frame

void(* wl_touch_listener::frame) (void *data, struct wl_touch *wl_touch)

end of touch frame event

Indicates the end of a set of events that logically belong together. A client is expected to accumulate the data in all events within the frame before proceeding.

A wl_touch.frame terminates at least one event but otherwise no guarantee is provided about the set of events within a frame. A client must assume that any state not updated in a frame is unchanged from the previously known state.

Definition at line 4765 of file wayland-client-protocol.h.

## motion

void(* wl_touch_listener::motion) (void *data, struct wl_touch *wl_touch, uint32_t time, int32_t id, wl_fixed_t x, wl_fixed_t y)

update of touch point coordinates

A touch point has changed coordinates.

Parameters

  time | timestamp with millisecond granularity
  id | the unique ID of this touch point
  x | surface-local x coordinate
  y | surface-local y coordinate

Definition at line 4747 of file wayland-client-protocol.h.

## orientation

void(* wl_touch_listener::orientation) (void *data, struct wl_touch *wl_touch, int32_t id, wl_fixed_t orientation)

update orientation of touch point

Sent when a touchpoint has changed its orientation.

This event does not occur on its own. It is sent before a wl_touch.frame event and carries the new shape information for any previously reported, or new touch points of that frame.

Other events describing the touch point such as wl_touch.down, wl_touch.motion or wl_touch.shape may be sent within the same wl_touch.frame. A client should treat these events as a single logical touch point update. The order of wl_touch.shape, wl_touch.orientation and wl_touch.motion is not guaranteed. A wl_touch.down event is guaranteed to occur before the first wl_touch.orientation event for this touch ID but both events may occur within the same wl_touch.frame.

The orientation describes the clockwise angle of a touchpoint's major axis to the positive surface y-axis and is normalized to the -180 to +180 degree range. The granularity of orientation depends on the touch device, some devices only support binary rotation values between 0 and 90 degrees.

This event is only sent by the compositor if the touch device supports orientation reports.

Parameters

  id | the unique ID of this touch point
  orientation | angle between major axis and positive surface y-axis in degrees

Since
  6

Definition at line 4848 of file wayland-client-protocol.h.

## shape

void(* wl_touch_listener::shape) (void *data, struct wl_touch *wl_touch, int32_t id, wl_fixed_t major, wl_fixed_t minor)

update shape of touch point

Sent when a touchpoint has changed its shape.

This event does not occur on its own. It is sent before a wl_touch.frame event and carries the new shape information for any previously reported, or new touch points of that frame.

Other events describing the touch point such as wl_touch.down, wl_touch.motion or wl_touch.orientation may be sent within the same wl_touch.frame. A client should treat these events as a single logical touch point update. The order of wl_touch.shape, wl_touch.orientation and wl_touch.motion is not guaranteed. A wl_touch.down event is guaranteed to occur before the first wl_touch.shape event for this touch ID but both events may occur within the same wl_touch.frame.

A touchpoint shape is approximated by an ellipse through the major and minor axis length. The major axis length describes the longer diameter of the ellipse, while the minor axis length describes the shorter diameter. Major and minor are orthogonal and both are specified in surface-local coordinates. The center of the ellipse is always at the touchpoint location as reported by wl_touch.down or wl_touch.move.

This event is only sent by the compositor if the touch device supports shape reports. The client has to make reasonable assumptions about the shape if it did not receive this event.

Parameters

  id | the unique ID of this touch point
  major | length of the major axis in surface-local coordinates
  minor | length of the minor axis in surface-local coordinates

Since
  6

Definition at line 4813 of file wayland-client-protocol.h.

## up

void(* wl_touch_listener::up) (void *data, struct wl_touch *wl_touch, uint32_t serial, uint32_t time, int32_t id)

end of a touch event sequence

The touch point has disappeared. No further events will be sent for this touch point and the touch point's ID is released and may be reused in a future touch down event.

Parameters

  serial | serial number of the touch up event
  time | timestamp with millisecond granularity
  id | the unique ID of this touch point

Definition at line 4733 of file wayland-client-protocol.h.

The documentation for this struct was generated from the following file:

- gen/wayland-client-protocol.h