wlr_data_control_unstable_v1
-
# zwlr_data_control_manager_v1
This interface is a manager that allows creating per-seat data device controls.Requests
-
struct zwlr_data_control_source_v1* zwlr_data_control_manager_v1_create_data_source(struct zwlr_data_control_manager_v1* zwlr_data_control_manager_v1)Create a new data source.
-
struct zwlr_data_control_device_v1* zwlr_data_control_manager_v1_get_data_device(struct zwlr_data_control_manager_v1* zwlr_data_control_manager_v1,struct wl_seat* seat)Create a data device that can be used to manage a seat's selection.
-
void zwlr_data_control_manager_v1_destroy(struct zwlr_data_control_manager_v1* zwlr_data_control_manager_v1)All objects created by the manager will still remain valid, until their appropriate destroy request has been called.
-
-
# zwlr_data_control_device_v1
This interface allows a client to manage a seat's selection. When the seat is destroyed, this object becomes inert.Requests
-
void zwlr_data_control_device_v1_set_selection(struct zwlr_data_control_device_v1* zwlr_data_control_device_v1,struct zwlr_data_control_source_v1* source)This request asks the compositor to set the selection to the data from the source on behalf of the client. The given source may not be used in any further set_selection or set_primary_selection requests. Attempting to use a previously used source is a protocol error. To unset the selection, set the source to NULL.
-
void zwlr_data_control_device_v1_destroy(struct zwlr_data_control_device_v1* zwlr_data_control_device_v1)Destroys the data device object.
-
void zwlr_data_control_device_v1_set_primary_selection(struct zwlr_data_control_device_v1* zwlr_data_control_device_v1,struct zwlr_data_control_source_v1* source)This request asks the compositor to set the primary selection to the data from the source on behalf of the client. The given source may not be used in any further set_selection or set_primary_selection requests. Attempting to use a previously used source is a protocol error. To unset the primary selection, set the source to NULL. The compositor will ignore this request if it does not support primary selection.
Events
-
struct zwlr_data_control_offer_v1* idThe data_offer event introduces a new wlr_data_control_offer object, which will subsequently be used in either the wlr_data_control_device.selection event (for the regular clipboard selections) or the wlr_data_control_device.primary_selection event (for the primary clipboard selections). Immediately following the wlr_data_control_device.data_offer event, the new data_offer object will send out wlr_data_control_offer.offer events to describe the MIME types it offers.
-
struct zwlr_data_control_offer_v1* idThe selection event is sent out to notify the client of a new wlr_data_control_offer for the selection for this device. The wlr_data_control_device.data_offer and the wlr_data_control_offer.offer events are sent out immediately before this event to introduce the data offer object. The selection event is sent to a client when a new selection is set. The wlr_data_control_offer is valid until a new wlr_data_control_offer or NULL is received. The client must destroy the previous selection wlr_data_control_offer, if any, upon receiving this event. The first selection event is sent upon binding the wlr_data_control_device object.
-
This data control object is no longer valid and should be destroyed by the client.
-
struct zwlr_data_control_offer_v1* idThe primary_selection event is sent out to notify the client of a new wlr_data_control_offer for the primary selection for this device. The wlr_data_control_device.data_offer and the wlr_data_control_offer.offer events are sent out immediately before this event to introduce the data offer object. The primary_selection event is sent to a client when a new primary selection is set. The wlr_data_control_offer is valid until a new wlr_data_control_offer or NULL is received. The client must destroy the previous primary selection wlr_data_control_offer, if any, upon receiving this event. If the compositor supports primary selection, the first primary_selection event is sent upon binding the wlr_data_control_device object.
Enums
-
ZWLR_DATA_CONTROL_DEVICE_V1_ERROR_USED_SOURCE /* source given to set_selection or set_primary_selection was already used before */
-
-
# zwlr_data_control_source_v1
The wlr_data_control_source object is the source side of a wlr_data_control_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.Requests
-
void zwlr_data_control_source_v1_offer(struct zwlr_data_control_source_v1* zwlr_data_control_source_v1,const char* mime_type /* MIME type offered by the data source */)This request adds a MIME type to the set of MIME types advertised to targets. Can be called several times to offer multiple types. Calling this after wlr_data_control_device.set_selection is a protocol error.
-
void zwlr_data_control_source_v1_destroy(struct zwlr_data_control_source_v1* zwlr_data_control_source_v1)Destroys the data source object.
Events
-
const char* mime_type /* MIME type for the data */int32_t fd /* file descriptor for the data */Request for data from the client. Send the data as the specified MIME type over the passed file descriptor, then close it.
-
This data source is no longer valid. The data source has been replaced by another data source. The client should clean up and destroy this data source.
Enums
-
ZWLR_DATA_CONTROL_SOURCE_V1_ERROR_INVALID_OFFER /* offer sent after wlr_data_control_device.set_selection */
-
-
# zwlr_data_control_offer_v1
A wlr_data_control_offer represents a piece of data offered for transfer by another client (the source client). 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.Requests
-
void zwlr_data_control_offer_v1_receive(struct zwlr_data_control_offer_v1* zwlr_data_control_offer_v1,const char* mime_type, /* MIME type desired by receiver */int32_t fd /* file descriptor for data transfer */)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 file descriptor (typically created with the pipe system call). The source client writes the data in the MIME type representation requested and then closes the file descriptor. The receiving client reads from the read end of the pipe until EOF and then closes its end, at which point the transfer is complete. This request may happen multiple times for different MIME types.
-
void zwlr_data_control_offer_v1_destroy(struct zwlr_data_control_offer_v1* zwlr_data_control_offer_v1)Destroys the data offer object.
Events
-
const char* mime_type /* offered MIME type */Sent immediately after creating the wlr_data_control_offer object. One event per offered MIME type.
-
Copyright Info
Copyright © 2018 Simon Ser
Copyright © 2019 Ivan Molodetskikh
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
without fee, provided that the above copyright notice appear in
all copies and that both that copyright notice and this permission
notice appear in supporting documentation, and that the name of
the copyright holders not be used in advertising or publicity
pertaining to distribution of the software without specific,
written prior permission. The copyright holders make no
representations about the suitability of this software for any
purpose. It is provided "as is" without express or implied
warranty.
THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.