---
name: "wayland_server_zwp_primary_selection_source_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_source_v1_t"
---

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

offer to replace the contents of the primary selection

## NAME

wayland::server::zwp\_primary\_selection\_source\_v1\_t - offer to replace the contents of the primary selection

## SYNOPSIS

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

Inherits wayland::server::resource\_t.

### Public Member Functions

std::function\< void(std::string)\> & **on\_offer** ()\
 add an offered mime type  std::function\< void()\> & **on\_destroy** ()\
 destroy the primary selection source  void **send** (std::string const &mime\_type, int fd, bool post=true)\
 send the primary selection contents  void **cancelled** (bool post=true)\
 request for primary selection contents was canceled  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 **send\_since\_version** = 1\
 Minimum protocol version required for the **send** function.  static constexpr std::uint32\_t **cancelled\_since\_version** = 1\
 Minimum protocol version required for the **cancelled** function.

## Detailed Description

offer to replace the contents of the primary selection

The source side of a wp\_primary\_selection\_offer, it provides a way to describe the offered data and respond to requests to transfer the requested contents of the primary selection clipboard.

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

## Member Function Documentation

### void zwp\_primary\_selection\_source\_v1\_t::cancelled (bool post = `true`)

request for primary selection contents was canceled This primary selection source is no longer valid. The client should clean up and destroy this primary selection source.

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

### 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.

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

destroy the primary selection source Destroy the primary selection source.

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

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

add an offered mime type

**Parameters**

*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.

Definition at line **5940** 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

### void zwp\_primary\_selection\_source\_v1\_t::send (std::string const & mime\_type, int fd, bool post = `true`)

send the primary selection contents

**Parameters**

*mime\_type* \
 *fd*

Request for the current primary selection contents from the client. Send the specified mime type over the passed file descriptor, then close it.

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

## Member Data Documentation

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

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

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

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

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

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

## Author

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