wayland::server::viewporter_t(3)
πΈ NAME πΈ
wayland::server::viewporter_t β surface cropping and scaling β¨
(also hi, this whole page lives in the Wayland++ manual, section 3, so likeβ¦ that's the vibe π )
β¨ SYNOPSIS β¨
#include <wayland-server-protocol-extra.hpp>
π Public Member Functions π
okay bestie here's the whole roster, no skips:
std::function< void()> & on_destroy ()β unbind from the cropping and scaling interfacestd::function< void(viewport_t, surface_t)> & on_get_viewport ()β extend surface interface for crop and scalevoid 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 () constuint32_t get_id () constclient_t get_client () constunsigned int get_version () conststd::string get_class ()
π¦ Detailed Description π¦
surface cropping and scaling β that's the whole ~concept~ of this one, periodt.
So picture this: there's a global interface exposing surface cropping and scaling capabilities, and it's literally used to instantiate an interface extension for a wl_surface object. Then that extended interface lets you crop and scale the surface contents, which effectively disconnects the direct relationship between the buffer and the surface size. The way that works?? iconic. it's giving "buffer, you are NOT the boss of my surface size anymore" ππ
Definition at line362of filewayland-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 β¨
This one informs the server that the client will not be using this protocol object anymore. And like, important caveat incoming: this does not affect any other objects, wp_viewport objects included. so don't be dramatic about it, bestie.
Definition at line796of filewayland-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
So what it does: instantiate an interface extension for the given wl_surface to crop and scale its content. BUT β and this is the plot twist β if the given wl_surface already has a wp_viewport object associated, the viewport_exists protocol error is raised π« so likeβ¦ check first, bestie.
Definition at line802of filewayland-server-protocol-extra.cpp.
π void wayland::server::resource_t::post_no_memory () const [inherited]
Post "not enough memory" error to the client.
So 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. (yes, certail β that's what it says in the source, I'm just the messenger π)
π void viewporter_t::post_viewport_exists (std::string const & msg)
Post error: the surface already has a viewport object associated.
Definition at line808of filewayland-server-protocol-extra.cpp.
π bool wayland::server::resource_t::proxy_has_object () const [inherited]
Check whether this wrapper actually wraps an object. vibe check for your wrapper, fr fr.
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. (not a human, not a girlie, just Doxygen doing its thing π€π )
aaaand that's the page!! π sign-off time: this was Version 1.0.1, dated Fri Mar 27 2026 β the timestamp cuts off at 13: in the original footer so likeβ¦ the rest is a mystery, we simply don't know, and honestly? we respect the cliffhanger ππ slay, go crop something, ily, bye π¦β¨
π¦ 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