SDL
2.0
|
#include <wayland-client-protocol.h>
Data Fields | |
void(* | target )(void *data, struct wl_data_source *wl_data_source, const char *mime_type) |
void(* | send )(void *data, struct wl_data_source *wl_data_source, const char *mime_type, int32_t fd) |
void(* | cancelled )(void *data, struct wl_data_source *wl_data_source) |
void(* | dnd_drop_performed )(void *data, struct wl_data_source *wl_data_source) |
void(* | dnd_finished )(void *data, struct wl_data_source *wl_data_source) |
void(* | action )(void *data, struct wl_data_source *wl_data_source, uint32_t dnd_action) |
Definition at line 2090 of file wayland-client-protocol.h.
void(* wl_data_source_listener::action) (void *data, struct wl_data_source *wl_data_source, uint32_t dnd_action) |
notify the selected action
This event indicates the action selected by the compositor after matching the source/destination side actions. Only one action (or none) will be offered here.
This event can be emitted multiple times during the drag-and-drop operation, mainly in response to destination side changes through wl_data_offer.set_actions, and as the data device enters/leaves surfaces.
It is only possible to receive this event after wl_data_source.dnd_drop_performed if the drag-and-drop operation ended in an "ask" action, in which case the final wl_data_source.action event will happen immediately before wl_data_source.dnd_finished.
Compositors may also change the selected action on the fly, mainly in response to keyboard modifier changes during the drag-and-drop operation.
The most recent action received is always the valid one. The chosen action may change alongside negotiation (e.g. an "ask" action can turn into a "move" operation), so the effects of the final action must always be applied in wl_data_offer.dnd_finished.
Clients can trigger cursor surface changes from this point, so they reflect the current action.
dnd_action | action selected by the compositor |
Definition at line 2205 of file wayland-client-protocol.h.
selection was cancelled
This data source is no longer valid. There are several reasons why this could happen:
The client should clean up and destroy this data source.
For objects of version 2 or older, wl_data_source.cancelled will only be emitted if the data source was replaced by another data source.
Definition at line 2139 of file wayland-client-protocol.h.
void(* wl_data_source_listener::dnd_drop_performed) (void *data, struct wl_data_source *wl_data_source) |
the drag-and-drop operation physically finished
The user performed the drop action. This event does not indicate acceptance, wl_data_source.cancelled may still be emitted afterwards if the drop destination does not accept any mime type.
However, this event might however not be received if the compositor cancelled the drag-and-drop operation before this event could happen.
Note that the data_source may still be used in the future and should not be destroyed here.
Definition at line 2157 of file wayland-client-protocol.h.
the drag-and-drop operation concluded
The drop destination finished interoperating with this data source, so the client is now free to destroy this data source and free all associated data.
If the action used to perform the operation was "move", the source can now delete the transferred data.
Definition at line 2170 of file wayland-client-protocol.h.
void(* wl_data_source_listener::send) (void *data, struct wl_data_source *wl_data_source, const char *mime_type, int32_t fd) |
send the data
Request for data from the client. Send the data as the specified mime type over the passed file descriptor, then close it.
mime_type | mime type for the data |
fd | file descriptor for the data |
Definition at line 2112 of file wayland-client-protocol.h.
void(* wl_data_source_listener::target) (void *data, struct wl_data_source *wl_data_source, const char *mime_type) |
a target accepts an offered mime type
Sent when a target accepts pointer_focus or motion events. If a target does not accept any of the offered types, type is NULL.
Used for feedback during drag-and-drop.
mime_type | mime type accepted by the target |
Definition at line 2100 of file wayland-client-protocol.h.