---
name: "wayland_server_viewporter_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_viewporter_t"
---

# wayland\_server\_viewporter\_t(3)

surface cropping and scaling

## NAME

wayland::server::viewporter\_t - surface cropping and scaling

## SYNOPSIS

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

Inherits wayland::server::resource\_t.

### Public Member Functions

std::function\< void()\> & **on\_destroy** ()\
 unbind from the cropping and scaling interface  std::function\< void(**viewport\_t**, **surface\_t**)\> & **on\_get\_viewport** ()\
 extend surface interface for crop and scale  void **post\_viewport\_exists** (std::string const &msg)\
 Post error: the surface already has a viewport object associated.  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** ()\

## Detailed Description

surface cropping and scaling

The global interface exposing surface cropping and scaling capabilities is used to instantiate an interface extension for a wl\_surface object. This extended interface will then allow cropping and scaling the surface contents, effectively disconnecting the direct relationship between the buffer and the surface size.

Definition at line **361** of file **wayland-server-protocol-extra.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.

### std::function\< void()\> & viewporter\_t::on\_destroy ()

unbind from the cropping and scaling interface Informs the server that the client will not be using this protocol object anymore. This does not affect any other objects, wp\_viewport objects included.

Definition at line **796** of file **wayland-server-protocol-extra.cpp**.

### std::function\< void(viewport\_t, surface\_t)\> & viewporter\_t::on\_get\_viewport ()

extend surface interface for crop and scale

**Parameters**

*id* the new viewport interface id \
 *surface* the surface

Instantiate an interface extension for the given wl\_surface to crop and scale its content. If the given wl\_surface already has a wp\_viewport object associated, the viewport\_exists protocol error is raised.

Definition at line **802** of file **wayland-server-protocol-extra.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.

### void viewporter\_t::post\_viewport\_exists (std::string const & msg)

Post error: the surface already has a viewport object associated.

Definition at line **808** of file **wayland-server-protocol-extra.cpp**.

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

## Author

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