Product SiteDocumentation Site

A.9. wl_data_source - offer to transfer data

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.

A.9.1. Requests provided by wl_data_source

A.9.1.1. wl_data_source::offer - add an offered mime type

This request adds a mime type to the set of mime types advertised to targets. Can be called several times to offer multiple types.
wl_data_source::offer arguments
mime_type
Type: string

A.9.1.2. wl_data_source::destroy - destroy the data source

Destroy the data source.

A.9.2. Events provided by wl_data_source

A.9.2.1. wl_data_source::target - 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.
wl_data_source::target arguments
mime_type
Type: string

A.9.2.2. wl_data_source::send - 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.
wl_data_source::send arguments
mime_type
Type: string
fd
Type: fd

A.9.2.3. wl_data_source::cancelled - selection was cancelled

This data source has been replaced by another data source. The client should clean up and destroy this data source.