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

◆ WL_POINTER_AXIS_SINCE_VERSION

#define WL_POINTER_AXIS_SINCE_VERSION   1

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

◆ WL_POINTER_AXIS_SOURCE_SINCE_VERSION

#define WL_POINTER_AXIS_SOURCE_SINCE_VERSION   5

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

◆ WL_POINTER_AXIS_STOP_SINCE_VERSION

#define WL_POINTER_AXIS_STOP_SINCE_VERSION   5

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

◆ WL_POINTER_BUTTON_SINCE_VERSION

#define WL_POINTER_BUTTON_SINCE_VERSION   1

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

◆ WL_POINTER_ENTER_SINCE_VERSION

#define WL_POINTER_ENTER_SINCE_VERSION   1

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

◆ WL_POINTER_FRAME_SINCE_VERSION

#define WL_POINTER_FRAME_SINCE_VERSION   5

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

◆ WL_POINTER_LEAVE_SINCE_VERSION

#define WL_POINTER_LEAVE_SINCE_VERSION   1

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

◆ WL_POINTER_MOTION_SINCE_VERSION

#define WL_POINTER_MOTION_SINCE_VERSION   1

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

◆ WL_POINTER_RELEASE_SINCE_VERSION

#define WL_POINTER_RELEASE_SINCE_VERSION   3

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

◆ WL_POINTER_SET_CURSOR_SINCE_VERSION

#define WL_POINTER_SET_CURSOR_SINCE_VERSION   1

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

4060 {
4061 /**
4062 * vertical axis
4063 */
4065 /**
4066 * horizontal axis
4067 */
4069};
@ WL_POINTER_AXIS_VERTICAL_SCROLL
@ WL_POINTER_AXIS_HORIZONTAL_SCROLL

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

4095 {
4096 /**
4097 * a physical wheel rotation
4098 */
4100 /**
4101 * finger on a touch surface
4102 */
4104 /**
4105 * continuous coordinate space
4106 */
4108 /**
4109 * a physical wheel tilt
4110 * @since 6
4111 */
4113};
@ WL_POINTER_AXIS_SOURCE_WHEEL_TILT
@ WL_POINTER_AXIS_SOURCE_CONTINUOUS
@ WL_POINTER_AXIS_SOURCE_WHEEL
@ WL_POINTER_AXIS_SOURCE_FINGER

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

4040 {
4041 /**
4042 * the button is not pressed
4043 */
4045 /**
4046 * the button is pressed
4047 */
4049};
@ WL_POINTER_BUTTON_STATE_RELEASED
@ WL_POINTER_BUTTON_STATE_PRESSED

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

4376{
4377 return wl_proxy_add_listener((struct wl_proxy *) wl_pointer,
4378 (void (**)(void)) listener, data);
4379}
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 4452 of file wayland-client-protocol.h.

4453{
4454 wl_proxy_destroy((struct wl_proxy *) wl_pointer);
4455}

◆ wl_pointer_get_user_data()

static void * wl_pointer_get_user_data ( struct wl_pointer *  wl_pointer)
inlinestatic

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

4440{
4441 return wl_proxy_get_user_data((struct wl_proxy *) wl_pointer);
4442}

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

4510{
4511 wl_proxy_marshal_flags((struct wl_proxy *) wl_pointer,
4512 WL_POINTER_RELEASE, NULL, wl_proxy_get_version((struct wl_proxy *) wl_pointer), WL_MARSHAL_FLAG_DESTROY);
4513}
#define NULL
Definition: begin_code.h:167
#define WL_POINTER_RELEASE

References NULL, and 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 4493 of file wayland-client-protocol.h.

4494{
4495 wl_proxy_marshal_flags((struct wl_proxy *) wl_pointer,
4496 WL_POINTER_SET_CURSOR, NULL, wl_proxy_get_version((struct wl_proxy *) wl_pointer), 0, serial, surface, hotspot_x, hotspot_y);
4497}
EGLSurface surface
Definition: eglext.h:248
#define WL_POINTER_SET_CURSOR

References NULL, and 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 4432 of file wayland-client-protocol.h.

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