Product SiteDocumentation Site

A.8. wl_data_offer - offer to transfer data

A wl_data_offer represents a piece of data offered for transfer by another client (the source client). It is used by the copy-and-paste and drag-and-drop mechanisms. The offer describes the different mime types that the data can be converted to and provides the mechanism for transferring the data directly from the source client.

A.8.1. Requests provided by wl_data_offer

A.8.1.1. wl_data_offer::accept - accept one of the offered mime-types

Indicate that the client can accept the given mime-type, or NULL for not accepted. Use for feedback during drag and drop.
wl_data_offer::accept arguments
serial
Type: uint
type
Type: string

A.8.1.2. wl_data_offer::receive - request that the data is transferred

To transfer the offered data, the client issues this request and indicates the mime-type it wants to receive. The transfer happens through the passed fd (typically a pipe(7) file descriptor). The source client writes the data in the mime-type representation requested and then closes the fd. The receiving client reads from the read end of the pipe until EOF and the closes its end, at which point the transfer is complete.
wl_data_offer::receive arguments
mime_type
Type: string
fd
Type: fd

A.8.1.3. wl_data_offer::destroy