public interface WlDataSourceEvents
The wl_data_source object is the source side of a wl_data_offer. It is created by the source client in a data transfer and provides a way to describe the offered data and a way to respond to requests to transfer the data.
| Modifier and Type | Field and Description |
|---|---|
static int |
VERSION |
| Modifier and Type | Method and Description |
|---|---|
void |
cancelled(WlDataSourceProxy emitter)
selection was cancelled
|
void |
send(WlDataSourceProxy emitter,
String mimeType,
int fd)
send the data
|
void |
target(WlDataSourceProxy emitter,
String mimeType)
a target accepts an offered mime type
|
static final int VERSION
void target(WlDataSourceProxy emitter, @Nullable String mimeType)
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.
emitter - The protocol object that emitted the event.mimeType - mime type accepted by the targetvoid send(WlDataSourceProxy emitter, @Nonnull String mimeType, int fd)
Request for data from the client. Send the data as the specified mime type over the passed file descriptor, then close it.
emitter - The protocol object that emitted the event.mimeType - mime type for the datafd - file descriptor for the datavoid cancelled(WlDataSourceProxy emitter)
This data source is no longer valid. There are several reasons why this could happen:
- The data source has been replaced by another data source. - The drag-and-drop operation was performed, but the drop destination did not accept any of the mime types offered through wl_data_source.target. - The drag-and-drop operation was performed, but the drop destination did not select any of the actions present in the mask offered through wl_data_source.action. - The drag-and-drop operation was performed but didn't happen over a surface. - The compositor cancelled the drag-and-drop operation (e.g. compositor dependent timeouts to avoid stale drag-and-drop transfers).
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.
emitter - The protocol object that emitted the event.Copyright © 2016. All rights reserved.