SDL  2.0
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 voidwl_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 4379 of file wayland-client-protocol.h.

◆ WL_POINTER_AXIS_SINCE_VERSION

#define WL_POINTER_AXIS_SINCE_VERSION   1

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

◆ WL_POINTER_AXIS_SOURCE_SINCE_VERSION

#define WL_POINTER_AXIS_SOURCE_SINCE_VERSION   5

Definition at line 4371 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 4077 of file wayland-client-protocol.h.

◆ WL_POINTER_AXIS_STOP_SINCE_VERSION

#define WL_POINTER_AXIS_STOP_SINCE_VERSION   5

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

◆ WL_POINTER_BUTTON_SINCE_VERSION

#define WL_POINTER_BUTTON_SINCE_VERSION   1

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

◆ WL_POINTER_ENTER_SINCE_VERSION

#define WL_POINTER_ENTER_SINCE_VERSION   1

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

◆ WL_POINTER_FRAME_SINCE_VERSION

#define WL_POINTER_FRAME_SINCE_VERSION   5

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

◆ WL_POINTER_LEAVE_SINCE_VERSION

#define WL_POINTER_LEAVE_SINCE_VERSION   1

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

◆ WL_POINTER_MOTION_SINCE_VERSION

#define WL_POINTER_MOTION_SINCE_VERSION   1

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

◆ WL_POINTER_RELEASE_SINCE_VERSION

#define WL_POINTER_RELEASE_SINCE_VERSION   3

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

◆ WL_POINTER_SET_CURSOR_SINCE_VERSION

#define WL_POINTER_SET_CURSOR_SINCE_VERSION   1

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

Enumeration Type Documentation

◆ 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 4020 of file wayland-client-protocol.h.

4020  {
4021  /**
4022  * vertical axis
4023  */
4025  /**
4026  * horizontal axis
4027  */
4029 };

◆ 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 4055 of file wayland-client-protocol.h.

4055  {
4056  /**
4057  * a physical wheel rotation
4058  */
4060  /**
4061  * finger on a touch surface
4062  */
4064  /**
4065  * continuous coordinate space
4066  */
4068  /**
4069  * a physical wheel tilt
4070  * @since 6
4071  */
4073 };

◆ 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 4000 of file wayland-client-protocol.h.

4000  {
4001  /**
4002  * the button is not pressed
4003  */
4005  /**
4006  * the button is pressed
4007  */
4009 };

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 
)
inlinestatic

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

4336 {
4337  return wl_proxy_add_listener((struct wl_proxy *) wl_pointer,
4338  (void (**)(void)) listener, data);
4339 }
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)
inlinestatic

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

4413 {
4414  wl_proxy_destroy((struct wl_proxy *) wl_pointer);
4415 }

◆ wl_pointer_get_user_data()

static void* wl_pointer_get_user_data ( struct wl_pointer *  wl_pointer)
inlinestatic

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

4400 {
4401  return wl_proxy_get_user_data((struct wl_proxy *) wl_pointer);
4402 }

◆ wl_pointer_release()

static void wl_pointer_release ( struct wl_pointer *  wl_pointer)
inlinestatic

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 4469 of file wayland-client-protocol.h.

References WL_POINTER_RELEASE.

4470 {
4471  wl_proxy_marshal((struct wl_proxy *) wl_pointer,
4473 
4474  wl_proxy_destroy((struct wl_proxy *) wl_pointer);
4475 }
#define WL_POINTER_RELEASE

◆ 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 
)
inlinestatic

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 4453 of file wayland-client-protocol.h.

References WL_POINTER_SET_CURSOR.

4454 {
4455  wl_proxy_marshal((struct wl_proxy *) wl_pointer,
4456  WL_POINTER_SET_CURSOR, serial, surface, hotspot_x, hotspot_y);
4457 }
EGLSurface surface
Definition: eglext.h:248
#define WL_POINTER_SET_CURSOR

◆ wl_pointer_set_user_data()

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

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

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