---
name: "wayland_server_zwp_primary_selection_offer_v1_t"
section: "3"
platform: "linux"
package: "waylandpp-dev"
version: "1.0.0-6+b2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/wayland_server_zwp_primary_selection_offer_v1_t"
---

# wayland\_server\_zwp\_primary\_selection\_offer\_v1\_t(3)

offer to transfer primary selection contents

## NAME

wayland::server::zwp\_primary\_selection\_offer\_v1\_t - offer to transfer primary selection contents

## SYNOPSIS

`#include <wayland-server-protocol-unstable.hpp>`

Inherits wayland::server::resource\_t.

### Public Member Functions

std::function\< void(std::string, int)\> & **on\_receive** ()\
 request that the data is transferred  std::function\< void()\> & **on\_destroy** ()\
 destroy the primary selection offer  void **offer** (std::string const &mime\_type, bool post=true)\
 advertise offered mime type  bool **proxy\_has\_object** () const\
 Check whether this wrapper actually wraps an object.  void **post\_no\_memory** () const\
 uint32\_t **get\_id** () const\
 client\_t **get\_client** () const\
 unsigned int **get\_version** () const\
 std::string **get\_class** ()\

### Static Public Attributes

static constexpr std::uint32\_t **offer\_since\_version** = 1\
 Minimum protocol version required for the **offer** function.

## Detailed Description

offer to transfer primary selection contents

A wp\_primary\_selection\_offer represents an offer to transfer the contents of the primary selection clipboard to the client. Similar to wl\_data\_offer, the offer also describes the mime types that the data can be converted to and provides the mechanisms for transferring the data directly to the client.

Definition at line **3678** of file **wayland-server-protocol-unstable.hpp**.

## Member Function Documentation

### std::string wayland::server::resource\_t::get\_class ()` [inherited]`

Retrieve the interface name (class) of a resource object.

**Returns**

Interface name of the resource object.

### client\_t wayland::server::resource\_t::get\_client () const` [inherited]`

Get the associated client

**Returns**

the client that owns the resource.

### uint32\_t wayland::server::resource\_t::get\_id () const` [inherited]`

Get the internal ID of the resource

**Returns**

the internal ID of the resource

### unsigned int wayland::server::resource\_t::get\_version () const` [inherited]`

Get interface version

**Returns**

Interface version this resource has been constructed with.

### void zwp\_primary\_selection\_offer\_v1\_t::offer (std::string const & mime\_type, bool post = `true`)

advertise offered mime type

**Parameters**

*mime\_type*

Sent immediately after creating announcing the wp\_primary\_selection\_offer through wp\_primary\_selection\_device.data\_offer. One event is sent per offered mime type.

Definition at line **5901** of file **wayland-server-protocol-unstable.cpp**.

### std::function\< void()\> & zwp\_primary\_selection\_offer\_v1\_t::on\_destroy ()

destroy the primary selection offer Destroy the primary selection offer.

Definition at line **5895** of file **wayland-server-protocol-unstable.cpp**.

### std::function\< void(std::string, int)\> & zwp\_primary\_selection\_offer\_v1\_t::on\_receive ()

request that the data is transferred

**Parameters**

*mime\_type* \
 *fd*

To transfer the contents of the primary selection clipboard, the client issues this request and indicates the mime type that 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 closes its end, at which point the transfer is complete.

Definition at line **5889** of file **wayland-server-protocol-unstable.cpp**.

### void wayland::server::resource\_t::post\_no\_memory () const` [inherited]`

Post 'not enough memory' error to the client

If the compositor has not enough memory to fulfill a certail request of the client, this function can be called to notify the client of this circumstance.

### bool wayland::server::resource\_t::proxy\_has\_object () const` [inherited]`

Check whether this wrapper actually wraps an object.

**Returns**

true if there is an underlying object, false if this wrapper is empty

## Member Data Documentation

### constexpr std::uint32\_t wayland::server::zwp\_primary\_selection\_offer\_v1\_t::offer\_since\_version = 1` [static]`, ` [constexpr]`

Minimum protocol version required for the **offer** function.

Definition at line **3742** of file **wayland-server-protocol-unstable.hpp**.

## Author

Generated automatically by Doxygen for Wayland++ from the source code.
