The wl_pointer interface

## Data Structures

struct | wl_pointer_listener

## Macros

#define | WL_POINTER_AXIS_SOURCE_WHEEL_TILT_SINCE_VERSION 6
#define | WL_POINTER_ENTER_SINCE_VERSION 1
#define | WL_POINTER_LEAVE_SINCE_VERSION 1
#define | WL_POINTER_MOTION_SINCE_VERSION 1
#define | WL_POINTER_BUTTON_SINCE_VERSION 1
#define | WL_POINTER_AXIS_SINCE_VERSION 1
#define | WL_POINTER_FRAME_SINCE_VERSION 5
#define | WL_POINTER_AXIS_SOURCE_SINCE_VERSION 5
#define | WL_POINTER_AXIS_STOP_SINCE_VERSION 5
#define | WL_POINTER_AXIS_DISCRETE_SINCE_VERSION 5
#define | WL_POINTER_SET_CURSOR_SINCE_VERSION 1
#define | WL_POINTER_RELEASE_SINCE_VERSION 3

## Enumerations

enum | wl_pointer_button_state { WL_POINTER_BUTTON_STATE_RELEASED = 0, WL_POINTER_BUTTON_STATE_PRESSED = 1 }
enum | wl_pointer_axis { WL_POINTER_AXIS_VERTICAL_SCROLL = 0, WL_POINTER_AXIS_HORIZONTAL_SCROLL = 1 }
enum | wl_pointer_axis_source { WL_POINTER_AXIS_SOURCE_WHEEL = 0, WL_POINTER_AXIS_SOURCE_FINGER = 1, WL_POINTER_AXIS_SOURCE_CONTINUOUS = 2, WL_POINTER_AXIS_SOURCE_WHEEL_TILT = 3 }

## Functions

static int | wl_pointer_add_listener (struct wl_pointer *wl_pointer, const struct wl_pointer_listener *listener, void *data)
static void | wl_pointer_set_user_data (struct wl_pointer *wl_pointer, void *user_data)
static void * | wl_pointer_get_user_data (struct wl_pointer *wl_pointer)
static void | wl_pointer_destroy (struct wl_pointer *wl_pointer)
static void | wl_pointer_set_cursor (struct wl_pointer *wl_pointer, uint32_t serial, struct wl_surface *surface, int32_t hotspot_x, int32_t hotspot_y)
static void | wl_pointer_release (struct wl_pointer *wl_pointer)

## Detailed Description

The wl_pointer interface represents one or more input devices, such as mice, which control the pointer location and pointer_focus of a seat.

The wl_pointer interface generates motion, enter and leave events for the surfaces that the pointer is located over, and button and axis events for button presses, button releases and scrolling.

## Macro Definition Documentation

## WL_POINTER_AXIS_DISCRETE_SINCE_VERSION

#define WL_POINTER_AXIS_DISCRETE_SINCE_VERSION 5

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

## WL_POINTER_AXIS_SINCE_VERSION

#define WL_POINTER_AXIS_SINCE_VERSION 1

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

## WL_POINTER_AXIS_SOURCE_SINCE_VERSION

#define WL_POINTER_AXIS_SOURCE_SINCE_VERSION 5

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

## WL_POINTER_AXIS_SOURCE_WHEEL_TILT_SINCE_VERSION

#define WL_POINTER_AXIS_SOURCE_WHEEL_TILT_SINCE_VERSION 6

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

## WL_POINTER_AXIS_STOP_SINCE_VERSION

#define WL_POINTER_AXIS_STOP_SINCE_VERSION 5

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

## WL_POINTER_BUTTON_SINCE_VERSION

#define WL_POINTER_BUTTON_SINCE_VERSION 1

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

## WL_POINTER_ENTER_SINCE_VERSION

#define WL_POINTER_ENTER_SINCE_VERSION 1

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

## WL_POINTER_FRAME_SINCE_VERSION

#define WL_POINTER_FRAME_SINCE_VERSION 5

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

## WL_POINTER_LEAVE_SINCE_VERSION

#define WL_POINTER_LEAVE_SINCE_VERSION 1

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

## WL_POINTER_MOTION_SINCE_VERSION

#define WL_POINTER_MOTION_SINCE_VERSION 1

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

## WL_POINTER_RELEASE_SINCE_VERSION

#define WL_POINTER_RELEASE_SINCE_VERSION 3

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

## WL_POINTER_SET_CURSOR_SINCE_VERSION

#define WL_POINTER_SET_CURSOR_SINCE_VERSION 1

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

## Enumeration Type Documentation

## wl_pointer_axis

enum wl_pointer_axis

axis types

Describes the axis types of scroll events.

Enumerator
WL_POINTER_AXIS_VERTICAL_SCROLL | vertical axis
WL_POINTER_AXIS_HORIZONTAL_SCROLL | horizontal axis

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

{
/**
* vertical axis
*/
WL_POINTER_AXIS_VERTICAL_SCROLL = 0,
/**
* horizontal axis
*/
WL_POINTER_AXIS_HORIZONTAL_SCROLL = 1,
};
WL_POINTER_AXIS_HORIZONTAL_SCROLL
Definition: wayland-client-protocol.h:4016
WL_POINTER_AXIS_VERTICAL_SCROLL
Definition: wayland-client-protocol.h:4012

## wl_pointer_axis_source

enum wl_pointer_axis_source

axis source types

Describes the source types for axis events. This indicates to the client how an axis event was physically generated; a client may adjust the user interface accordingly. For example, scroll events from a "finger" source may be in a smooth coordinate space with kinetic scrolling whereas a "wheel" source may be in discrete steps of a number of lines.

The "continuous" axis source is a device generating events in a continuous coordinate space, but using something other than a finger. One example for this source is button-based scrolling where the vertical motion of a device is converted to scroll events while a button is held down.

The "wheel tilt" axis source indicates that the actual device is a wheel but the scroll event is not caused by a rotation but a (usually sideways) tilt of the wheel.

Enumerator
WL_POINTER_AXIS_SOURCE_WHEEL | a physical wheel rotation
WL_POINTER_AXIS_SOURCE_FINGER | finger on a touch surface
WL_POINTER_AXIS_SOURCE_CONTINUOUS | continuous coordinate space

WL_POINTER_AXIS_SOURCE_WHEEL_TILT

a physical wheel tilt

Since
  6

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

{
/**
* a physical wheel rotation
*/
WL_POINTER_AXIS_SOURCE_WHEEL = 0,
/**
* finger on a touch surface
*/
WL_POINTER_AXIS_SOURCE_FINGER = 1,
/**
* continuous coordinate space
*/
WL_POINTER_AXIS_SOURCE_CONTINUOUS = 2,
/**
* a physical wheel tilt
* @since 6
*/
WL_POINTER_AXIS_SOURCE_WHEEL_TILT = 3,
};
WL_POINTER_AXIS_SOURCE_WHEEL
Definition: wayland-client-protocol.h:4047
WL_POINTER_AXIS_SOURCE_WHEEL_TILT
Definition: wayland-client-protocol.h:4060
WL_POINTER_AXIS_SOURCE_CONTINUOUS
Definition: wayland-client-protocol.h:4055
WL_POINTER_AXIS_SOURCE_FINGER
Definition: wayland-client-protocol.h:4051

## wl_pointer_button_state

enum wl_pointer_button_state

physical button state

Describes the physical state of a button that produced the button event.

Enumerator
WL_POINTER_BUTTON_STATE_RELEASED | the button is not pressed
WL_POINTER_BUTTON_STATE_PRESSED | the button is pressed

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

{
/**
* the button is not pressed
*/
WL_POINTER_BUTTON_STATE_RELEASED = 0,
/**
* the button is pressed
*/
WL_POINTER_BUTTON_STATE_PRESSED = 1,
};
WL_POINTER_BUTTON_STATE_RELEASED
Definition: wayland-client-protocol.h:3992
WL_POINTER_BUTTON_STATE_PRESSED
Definition: wayland-client-protocol.h:3996

## Function Documentation

## wl_pointer_add_listener()

static int wl_pointer_add_listener | ( | struct wl_pointer * | wl_pointer,
|  | const struct wl_pointer_listener * | listener,
|  | void * | data
| ) |  |

inline static

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

{
return wl_proxy_add_listener((struct wl_proxy *) wl_pointer,
(void (**)(void)) listener, data);
}
data
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: SDL_opengl.h:1974

## wl_pointer_destroy()

static void wl_pointer_destroy | ( | struct wl_pointer * | wl_pointer | ) |

inline static

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

{
wl_proxy_destroy((struct wl_proxy *) wl_pointer);
}

## wl_pointer_get_user_data()

static void* wl_pointer_get_user_data | ( | struct wl_pointer * | wl_pointer | ) |

inline static

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

{
return wl_proxy_get_user_data((struct wl_proxy *) wl_pointer);
}

## wl_pointer_release()

static void wl_pointer_release | ( | struct wl_pointer * | wl_pointer | ) |

inline static

Using this request a client can tell the server that it is not going to use the pointer object anymore.

This request destroys the pointer proxy object, so clients must not call wl_pointer_destroy() after using this request.

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

References WL_POINTER_RELEASE.

{
wl_proxy_marshal((struct wl_proxy *) wl_pointer,
WL_POINTER_RELEASE);
wl_proxy_destroy((struct wl_proxy *) wl_pointer);
}
WL_POINTER_RELEASE
#define WL_POINTER_RELEASE
Definition: wayland-client-protocol.h:4330

## wl_pointer_set_cursor()

static void wl_pointer_set_cursor | ( | struct wl_pointer * | wl_pointer,
|  | uint32_t | serial,
|  | struct wl_surface * | surface,
|  | int32_t | hotspot_x,
|  | int32_t | hotspot_y
| ) |  |

inline static

Set the pointer surface, i.e., the surface that contains the pointer image (cursor). This request gives the surface the role of a cursor. If the surface already has another role, it raises a protocol error.

The cursor actually changes only if the pointer focus for this device is one of the requesting client's surfaces or the surface parameter is the current pointer surface. If there was a previous surface set with this request it is replaced. If surface is NULL, the pointer image is hidden.

The parameters hotspot_x and hotspot_y define the position of the pointer surface relative to the pointer location. Its top-left corner is always at (x, y) - (hotspot_x, hotspot_y), where (x, y) are the coordinates of the pointer location, in surface-local coordinates.

On surface.attach requests to the pointer surface, hotspot_x and hotspot_y are decremented by the x and y parameters passed to the request. Attach must be confirmed by wl_surface.commit as usual.

The hotspot can also be updated by passing the currently set pointer surface to this request with new values for hotspot_x and hotspot_y.

The current and pending input regions of the wl_surface are cleared, and wl_surface.set_input_region is ignored until the wl_surface is no longer used as the cursor. When the use as a cursor ends, the current and pending input regions become undefined, and the wl_surface is unmapped.

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

References WL_POINTER_SET_CURSOR.

{
wl_proxy_marshal((struct wl_proxy *) wl_pointer,
WL_POINTER_SET_CURSOR, serial, surface, hotspot_x, hotspot_y);
}
surface
EGLSurface surface
Definition: eglext.h:248
WL_POINTER_SET_CURSOR
#define WL_POINTER_SET_CURSOR
Definition: wayland-client-protocol.h:4329

## wl_pointer_set_user_data()

static void wl_pointer_set_user_data | ( | struct wl_pointer * | wl_pointer,
|  | void * | user_data
| ) |  |

inline static

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

{
wl_proxy_set_user_data((struct wl_proxy *) wl_pointer, user_data);
}