wayland::server::output_t(3)
π NAME: wayland::server::output_t(3) π
okay bestie, this page is from the Wayland++ manual, and the main character is wayland::server::output_t β a compositor output region. π
β¨ SYNOPSIS β¨
#include <wayland-server-protocol.hpp>
π 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. lowkey the whole physical-vibe package. π¦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. periodt, that's the wrap-up. πbool can_done () constβ Check whether thedonefunction is available with the currently bound version of the protocol. πvoid scale (int32_t factor, bool post=true)β output scaling properties. slay, but make it bigger or smaller. πbool can_scale () constβ Check whether thescalefunction is available with the currently bound version of the protocol. πvoid name (std::string const &name, bool post=true)β name of this output. give the monitor its government name. πbool can_name () constβ Check whether thenamefunction 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. no cap, it's the friendly little bio. πΈbool can_description () constβ Check whether thedescriptionfunction is available with the currently bound version of the protocol. πbool proxy_has_object () constβ Check whether this wrapper actually wraps an object. vibe check for the wrapper itself. π«Άvoid post_no_memory () constβ the manual gives no extra one-liner here, just the signature. respect the mystery. πuint32_t get_id () constβ signature only in the source, no extra description. πclient_t get_client () constβ signature only in the source, no extra description. πunsigned int get_version () constβ signature only in the source, no extra description. πstd::string get_class ()β signature only in the source, no extra description. π
π¦ Static Public Attributes π¦
static constexpr std::uint32_t geometry_since_version = 1β Minimum protocol version required for thegeometryfunction. π§static constexpr std::uint32_t mode_since_version = 1β Minimum protocol version required for themodefunction. π§static constexpr std::uint32_t done_since_version = 2β Minimum protocol version required for thedonefunction. π§static constexpr std::uint32_t scale_since_version = 2β Minimum protocol version required for thescalefunction. π§static constexpr std::uint32_t name_since_version = 4β Minimum protocol version required for thenamefunction. π§static constexpr std::uint32_t description_since_version = 4β Minimum protocol version required for thedescriptionfunction. π§
π₯ Detailed Description π₯
okay so here's the lore, bestie: 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 3706 of file wayland-server-protocol.hpp. π
π MEMBER FUNCTION DOCUMENTATION π
okay bestie, this is the part where we go through literally every single method one by one. buckle up π
bool output_t::can_description () const
vibe check: is the description function even available on the protocol version you're currently bound to? that's it, that's the whole function. returns a bool, no cap.
Definition at line 2993 of file wayland-server-protocol.cpp.
bool output_t::can_done () const
same energy, different event β checks 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
you guessed it β is name available on your currently bound protocol version? yes/no, icon behavior. π
Definition at line 2983 of file wayland-server-protocol.cpp.
bool output_t::can_scale () const
and this one checks whether scale is available with the currently bound version of the protocol. the little quartet of can_ functions, we love a consistent queen π
Definition at line 2973 of file wayland-server-protocol.cpp.
void output_t::description (std::string const & description, bool post = true)
the human-readable description of this output π·οΈ
Parameters
- description β output description
so like β many compositors can produce human-readable descriptions of their outputs, and the client may want to know that description too, e.g. for output selection purposes.
the description is a UTF-8 string with no convention defined for its contents. and heads up: it 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. it's optional, tho β it may not be sent at all π
oh and 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. the whole point? it lets changes to the output properties be seen as atomic, even if they happen via multiple events. main character synchronization moment β¨
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)
the properties of the output β the whole glow-up package.
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. it's 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). zero is valid, bestie, don't panic π
the geometry event will be followed by a done event (starting from version 2).
Note:wl_outputonly 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 usingxandy, clients should usexdg_output.logical_position. instead of usingmakeandmodel, clients should usenameanddescription. iykyk π«Ά
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.
inherited behavior, still iconic π
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 the 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.
it's sent when binding to the output object, and there will always be one mode β the current mode. the event gets 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. periodt π
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. like, don't build your whole personality on them, fr.
the size of a mode is given in physical hardware units of the output device β which 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. that's the assignment, bestie π¦
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)
the 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 too so it can 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, but 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. so the name can be shared across processes to refer to a specific wl_output global. we love a consistent identifier β¨
the name is not guaranteed to be persistent across sessions, so it cannot be used to reliably identify an output in e.g. configuration files. hard truth, sorry π
examples of names include 'HDMI-A-1', 'WL-1', 'X11-1', etc. however, do not assume the name is a reflection of an underlying DRM connector, X11 connection, etc. it's giving "just a name," not a whole autobiography.
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. it's the polite goodbye, the "i'm leaving the group chat" of events π
Definition at line 2942 of file wayland-server-protocol.cpp.
void wayland::server::resource_t::post_no_memory () const [inherited]
post a "not enough memory" error to the client.
if the compositor doesn't have enough memory to fulfill a certain request of the client, this function can be called to notify the client of this circumstance. it's the "π ran out of RAM" announcement, inherited and ready to go.
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.
like checking if there's actually someone in the group chat or if it's just you and a dead group. inherited π₯
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 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. tiny text era: canceled π
the intention is that scaling-aware clients track the current output of a surface, and if it's 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. everybody wins, flawless victory β¨
the scale event will be followed by a done event.
Definition at line 2968 of file wayland-server-protocol.cpp.
π MEMBER DATA DOCUMENTATION π
these are the static constexpr besties that tell you the minimum protocol version for each function. lowkey the most useful little numbers in the whole file π
std::uint32_t wayland::server::output_t::description_since_version = 4 [static], [constexpr]
minimum protocol version required for the description function.
Definition at line 3944 of file wayland-server-protocol.hpp.
std::uint32_t wayland::server::output_t::done_since_version = 2 [static], [constexpr]
minimum protocol version required for the done function.
Definition at line 3834 of file wayland-server-protocol.hpp.
std::uint32_t wayland::server::output_t::geometry_since_version = 1 [static], [constexpr]
minimum protocol version required for the geometry function. version 1, the original icon π
Definition at line 3772 of file wayland-server-protocol.hpp.
std::uint32_t wayland::server::output_t::mode_since_version = 1 [static], [constexpr]
minimum protocol version required for the mode function.
Definition at line 3819 of file wayland-server-protocol.hpp.
std::uint32_t wayland::server::output_t::name_since_version = 4 [static], [constexpr]
minimum protocol version required for the name function.
Definition at line 3914 of file wayland-server-protocol.hpp.
std::uint32_t wayland::server::output_t::scale_since_version = 2 [static], [constexpr]
minimum protocol version required for the scale function.
Definition at line 3870 of file wayland-server-protocol.hpp.
π AUTHOR π
generated automatically by Doxygen for Wayland++ from the source code. not a human wrote this, it's a whole robot situation π€β¨
aaaand that's the whole page bestie, you ate that π π this totes came from Version 1.0.1, dated Fri Mar 27 2026 13:15:0 β go forth and bind your outputs responsibly, mwah π«Άππ¦
π¦ where this page comes from
- ubuntu stonking: waylandpp-dev 1.0.1-2 Β· BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms