SDL  2.0
wl_data_device_listener Struct Reference

#include <wayland-client-protocol.h>

Data Fields

void(* data_offer )(void *data, struct wl_data_device *wl_data_device, struct wl_data_offer *id)
 
void(* enter )(void *data, struct wl_data_device *wl_data_device, uint32_t serial, struct wl_surface *surface, wl_fixed_t x, wl_fixed_t y, struct wl_data_offer *id)
 
void(* leave )(void *data, struct wl_data_device *wl_data_device)
 
void(* motion )(void *data, struct wl_data_device *wl_data_device, uint32_t time, wl_fixed_t x, wl_fixed_t y)
 
void(* drop )(void *data, struct wl_data_device *wl_data_device)
 
void(* selection )(void *data, struct wl_data_device *wl_data_device, struct wl_data_offer *id)
 

Detailed Description

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

Field Documentation

◆ data_offer

void(* wl_data_device_listener::data_offer) (void *data, struct wl_data_device *wl_data_device, struct wl_data_offer *id)

introduce a new wl_data_offer

The data_offer event introduces a new wl_data_offer object, which will subsequently be used in either the data_device.enter event (for drag-and-drop) or the data_device.selection event (for selections). Immediately following the data_device_data_offer event, the new data_offer object will send out data_offer.offer events to describe the mime types it offers.

Parameters
idthe new data_offer object

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

◆ drop

void(* wl_data_device_listener::drop) (void *data, struct wl_data_device *wl_data_device)

end drag-and-drop session successfully

The event is sent when a drag-and-drop operation is ended because the implicit grab is removed.

The drag-and-drop destination is expected to honor the last action received through wl_data_offer.action, if the resulting action is "copy" or "move", the destination can still perform wl_data_offer.receive requests, and is expected to end all transfers with a wl_data_offer.finish request.

If the resulting action is "ask", the action will not be considered final. The drag-and-drop destination is expected to perform one last wl_data_offer.set_actions request, or wl_data_offer.destroy in order to cancel the operation.

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

◆ enter

void(* wl_data_device_listener::enter) (void *data, struct wl_data_device *wl_data_device, uint32_t serial, struct wl_surface *surface, wl_fixed_t x, wl_fixed_t y, struct wl_data_offer *id)

initiate drag-and-drop session

This event is sent when an active drag-and-drop pointer enters a surface owned by the client. The position of the pointer at enter time is provided by the x and y arguments, in surface-local coordinates.

Parameters
serialserial number of the enter event
surfaceclient surface entered
xsurface-local x coordinate
ysurface-local y coordinate
idsource data_offer object

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

◆ leave

void(* wl_data_device_listener::leave) (void *data, struct wl_data_device *wl_data_device)

end drag-and-drop session

This event is sent when the drag-and-drop pointer leaves the surface and the session ends. The client must destroy the wl_data_offer introduced at enter time at this point.

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

◆ motion

void(* wl_data_device_listener::motion) (void *data, struct wl_data_device *wl_data_device, uint32_t time, wl_fixed_t x, wl_fixed_t y)

drag-and-drop session motion

This event is sent when the drag-and-drop pointer moves within the currently focused surface. The new position of the pointer is provided by the x and y arguments, in surface-local coordinates.

Parameters
timetimestamp with millisecond granularity
xsurface-local x coordinate
ysurface-local y coordinate

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

◆ selection

void(* wl_data_device_listener::selection) (void *data, struct wl_data_device *wl_data_device, struct wl_data_offer *id)

advertise new selection

The selection event is sent out to notify the client of a new wl_data_offer for the selection for this device. The data_device.data_offer and the data_offer.offer events are sent out immediately before this event to introduce the data offer object. The selection event is sent to a client immediately before receiving keyboard focus and when a new selection is set while the client has keyboard focus. The data_offer is valid until a new data_offer or NULL is received or until the client loses keyboard focus. The client must destroy the previous selection data_offer, if any, upon receiving this event.

Parameters
idselection data_offer object

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


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