---
name: "wayland_server_output_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_output_t"
---

# wayland\_server\_output\_t(3)

compositor output region

## NAME

wayland::server::output\_t - compositor output region

## SYNOPSIS

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

Inherits wayland::server::resource\_t.

### Public Member Functions

std::function\< void()\> & **on\_release** ()\
 release the output object  void **geometry** (int32\_t x, int32\_t y, int32\_t physical\_width, int32\_t physical\_height, output\_subpixel const &subpixel, std::string const &make, std::string const &model, **output\_transform** const &transform, bool post=true)\
 properties of the output  void **mode** (**output\_mode** const &flags, int32\_t width, int32\_t height, int32\_t refresh, bool post=true)\
 advertise available modes for the output  void **done** (bool post=true)\
 sent all information about output  bool **can\_done** () const\
 Check whether the **done** function is available with the currently bound version of the protocol.  void **scale** (int32\_t factor, bool post=true)\
 output scaling properties  bool **can\_scale** () const\
 Check whether the **scale** function is available with the currently bound version of the protocol.  void **name** (std::string const &name, bool post=true)\
 name of this output  bool **can\_name** () const\
 Check whether the **name** function is available with the currently bound version of the protocol.  void **description** (std::string const &description, bool post=true)\
 human-readable description of this output  bool **can\_description** () const\
 Check whether the **description** function is available with the currently bound version of the protocol.  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 **geometry\_since\_version** = 1\
 Minimum protocol version required for the **geometry** function.  static constexpr std::uint32\_t **mode\_since\_version** = 1\
 Minimum protocol version required for the **mode** function.  static constexpr std::uint32\_t **done\_since\_version** = 2\
 Minimum protocol version required for the **done** function.  static constexpr std::uint32\_t **scale\_since\_version** = 2\
 Minimum protocol version required for the **scale** function.  static constexpr std::uint32\_t **name\_since\_version** = 4\
 Minimum protocol version required for the **name** function.  static constexpr std::uint32\_t **description\_since\_version** = 4\
 Minimum protocol version required for the **description** function.

## Detailed Description

compositor output region

An output describes part of the compositor geometry. The compositor works in the 'compositor coordinate system' and an output corresponds to a rectangular area in that space that is actually visible. This typically corresponds to a monitor that displays part of the compositor space. This object is published as global during start up, or when a monitor is hotplugged.

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

## Member Function Documentation

### bool output\_t::can\_description () const

Check whether the **description** function is available with the currently bound version of the protocol.

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

### bool output\_t::can\_done () const

Check whether the **done** function is available with the currently bound version of the protocol.

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

### bool output\_t::can\_name () const

Check whether the **name** function is available with the currently bound version of the protocol.

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

### bool output\_t::can\_scale () const

Check whether the **scale** function is available with the currently bound version of the protocol.

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

### void output\_t::description (std::string const & description, bool post = `true`)

human-readable description of this output

**Parameters**

*description* output description

Many compositors can produce human-readable descriptions of their outputs. The client may wish to know this description as well, e.g. for output selection purposes.

The description is a UTF-8 string with no convention defined for its contents. The description is not guaranteed to be unique among all wl\_output globals. Examples might include 'Foocorp 11" Display' or 'Virtual X11 output via :1'.

The description event is sent after binding the output object and whenever the description changes. The description is optional, and may not be sent at all.

The description event will be followed by a done event.

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

### void output\_t::done (bool post = `true`)

sent all information about output This event is sent after all other properties have been sent after binding to the output object and after any other property changes done after that. This allows changes to the output properties to be seen as atomic, even if they happen via multiple events.

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

### void output\_t::geometry (int32\_t x, int32\_t y, int32\_t physical\_width, int32\_t physical\_height, output\_subpixel const & subpixel, std::string const & make, std::string const & model, output\_transform const & transform, bool post = `true`)

properties of the output

**Parameters**

*x* x position within the global compositor space \
 *y* y position within the global compositor space \
 *physical\_width* width in millimeters of the output \
 *physical\_height* height in millimeters of the output \
 *subpixel* subpixel orientation of the output \
 *make* textual description of the manufacturer \
 *model* textual description of the model \
 *transform* transform that maps framebuffer to output

The geometry event describes geometric properties of the output. The event is sent when binding to the output object and whenever any of the properties change.

The physical size can be set to zero if it doesn't make sense for this output (e.g. for projectors or virtual outputs).

The geometry event will be followed by a done event (starting from version 2).

Note: wl\_output only advertises partial information about the output position and identification. Some compositors, for instance those not implementing a desktop-style output layout or those exposing virtual outputs, might fake this information. Instead of using x and y, clients should use xdg\_output.logical\_position. Instead of using make and model, clients should use name and description.

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

### void output\_t::mode (output\_mode const & flags, int32\_t width, int32\_t height, int32\_t refresh, bool post = `true`)

advertise available modes for the output

**Parameters**

*flags* bitfield of mode flags \
 *width* width of the mode in hardware units \
 *height* height of the mode in hardware units \
 *refresh* vertical refresh rate in mHz

The mode event describes an available mode for the output.

The event is sent when binding to the output object and there will always be one mode, the current mode. The event is sent again if an output changes mode, for the mode that is now current. In other words, the current mode is always the last mode that was received with the current flag set.

Non-current modes are deprecated. A compositor can decide to only advertise the current mode and never send other modes. Clients should not rely on non-current modes.

The size of a mode is given in physical hardware units of the output device. This is not necessarily the same as the output size in the global compositor space. For instance, the output may be scaled, as described in wl\_output.scale, or transformed, as described in wl\_output.transform. Clients willing to retrieve the output size in the global compositor space should use xdg\_output.logical\_size instead.

The vertical refresh rate can be set to zero if it doesn't make sense for this output (e.g. for virtual outputs).

The mode event will be followed by a done event (starting from version 2).

Clients should not use the refresh rate to schedule frames. Instead, they should use the wl\_surface.frame event or the presentation-time protocol.

Note: this information is not always meaningful for all outputs. Some compositors, such as those exposing virtual outputs, might fake the refresh rate or the size.

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

### void output\_t::name (std::string const & name, bool post = `true`)

name of this output

**Parameters**

*name* output name

Many compositors will assign user-friendly names to their outputs, show them to the user, allow the user to refer to an output, etc. The client may wish to know this name as well to offer the user similar behaviors.

The name is a UTF-8 string with no convention defined for its contents. Each name is unique among all wl\_output globals. The name is only guaranteed to be unique for the compositor instance.

The same output name is used for all clients for a given wl\_output global. Thus, the name can be shared across processes to refer to a specific wl\_output global.

The name is not guaranteed to be persistent across sessions, thus cannot be used to reliably identify an output in e.g. configuration files.

Examples of names include 'HDMI-A-1', 'WL-1', 'X11-1', etc. However, do not assume that the name is a reflection of an underlying DRM connector, X11 connection, etc.

The name event is sent after binding the output object. This event is only sent once per output object, and the name does not change over the lifetime of the wl\_output global.

Compositors may re-use the same output name if the wl\_output global is destroyed and re-created later. Compositors should avoid re-using the same name if possible.

The name event will be followed by a done event.

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

### std::function\< void()\> & output\_t::on\_release ()

release the output object Using this request a client can tell the server that it is not going to use the output object anymore.

Definition at line **2942** of file **wayland-server-protocol.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 output\_t::scale (int32\_t factor, bool post = `true`)

output scaling properties

**Parameters**

*factor* scaling factor of output

This event contains scaling geometry information that is not in the geometry event. It may be sent after binding the output object or if the output scale changes later. If it is not sent, the client should assume a scale of 1.

A scale larger than 1 means that the compositor will automatically scale surface buffers by this amount when rendering. This is used for very high resolution displays where applications rendering at the native resolution would be too small to be legible.

It is intended that scaling aware clients track the current output of a surface, and if it is on a scaled output it should use wl\_surface.set\_buffer\_scale with the scale of the output. That way the compositor can avoid scaling the surface, and the client can supply a higher detail image.

The scale event will be followed by a done event.

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

## Member Data Documentation

### constexpr std::uint32\_t wayland::server::output\_t::description\_since\_version = 4` [static]`, ` [constexpr]`

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

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

### constexpr std::uint32\_t wayland::server::output\_t::done\_since\_version = 2` [static]`, ` [constexpr]`

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

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

### constexpr std::uint32\_t wayland::server::output\_t::geometry\_since\_version = 1` [static]`, ` [constexpr]`

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

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

### constexpr std::uint32\_t wayland::server::output\_t::mode\_since\_version = 1` [static]`, ` [constexpr]`

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

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

### constexpr std::uint32\_t wayland::server::output\_t::name\_since\_version = 4` [static]`, ` [constexpr]`

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

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

### constexpr std::uint32\_t wayland::server::output\_t::scale\_since\_version = 2` [static]`, ` [constexpr]`

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

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

## Author

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