.TH "wayland::shell_surface_t" 3 "Wed May 3 2023" "Version 1.0.0" "Wayland++" \" -*- nroff -*- .ad l .nh .SH NAME wayland::shell_surface_t \- desktop-style metadata interface .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits \fBwayland::proxy_t\fP\&. .SS "Public Types" .in +1c .ti -1c .RI "enum class \fBwrapper_type\fP { \fBstandard\fP, \fBdisplay\fP, \fBforeign\fP, \fBproxy_wrapper\fP }" .br .in -1c .SS "Public Member Functions" .in +1c .ti -1c .RI "void \fBpong\fP (uint32_t serial)" .br .RI "respond to a ping event " .ti -1c .RI "void \fBmove\fP (\fBseat_t\fP const &seat, uint32_t serial)" .br .RI "start an interactive move " .ti -1c .RI "void \fBresize\fP (\fBseat_t\fP const &seat, uint32_t serial, \fBshell_surface_resize\fP const &edges)" .br .RI "start an interactive resize " .ti -1c .RI "void \fBset_toplevel\fP ()" .br .RI "make the surface a toplevel surface " .ti -1c .RI "void \fBset_transient\fP (\fBsurface_t\fP const &parent, int32_t x, int32_t y, \fBshell_surface_transient\fP const &flags)" .br .RI "make the surface a transient surface " .ti -1c .RI "void \fBset_fullscreen\fP (shell_surface_fullscreen_method const &method, uint32_t framerate, \fBoutput_t\fP const &output)" .br .RI "make the surface a fullscreen surface " .ti -1c .RI "void \fBset_popup\fP (\fBseat_t\fP const &seat, uint32_t serial, \fBsurface_t\fP const &parent, int32_t x, int32_t y, \fBshell_surface_transient\fP const &flags)" .br .RI "make the surface a popup surface " .ti -1c .RI "void \fBset_maximized\fP (\fBoutput_t\fP const &output)" .br .RI "make the surface a maximized surface " .ti -1c .RI "void \fBset_title\fP (std::string const &title)" .br .RI "set surface title " .ti -1c .RI "void \fBset_class\fP (std::string const &class_)" .br .RI "set surface class " .ti -1c .RI "std::function< void(uint32_t)> & \fBon_ping\fP ()" .br .RI "ping client " .ti -1c .RI "std::function< void(\fBshell_surface_resize\fP, int32_t, int32_t)> & \fBon_configure\fP ()" .br .RI "suggest resize " .ti -1c .RI "std::function< void()> & \fBon_popup_done\fP ()" .br .RI "popup interaction is done " .ti -1c .RI "uint32_t \fBget_id\fP () const" .br .RI "Get the id of a proxy object\&. " .ti -1c .RI "std::string \fBget_class\fP () const" .br .RI "Get the interface name (class) of a proxy object\&. " .ti -1c .RI "uint32_t \fBget_version\fP () const" .br .RI "Get the protocol object version of a proxy object\&. " .ti -1c .RI "\fBwrapper_type\fP \fBget_wrapper_type\fP () const" .br .RI "Get the type of a proxy object\&. " .ti -1c .RI "void \fBset_queue\fP (\fBevent_queue_t\fP queue)" .br .RI "Assign a proxy to an event queue\&. " .ti -1c .RI "wl_proxy * \fBc_ptr\fP () const" .br .RI "Get a pointer to the underlying C struct\&. " .ti -1c .RI "bool \fBproxy_has_object\fP () const" .br .RI "Check whether this wrapper actually wraps an object\&. " .ti -1c .RI "\fBoperator bool\fP () const" .br .RI "Check whether this wrapper actually wraps an object\&. " .ti -1c .RI "bool \fBoperator==\fP (const \fBproxy_t\fP &right) const" .br .RI "Check whether two wrappers refer to the same object\&. " .ti -1c .RI "bool \fBoperator!=\fP (const \fBproxy_t\fP &right) const" .br .RI "Check whether two wrappers refer to different objects\&. " .ti -1c .RI "void \fBproxy_release\fP ()" .br .RI "Release the wrapped object (if any), making this an empty wrapper\&. " .in -1c .SS "Static Public Attributes" .in +1c .ti -1c .RI "static constexpr std::uint32_t \fBpong_since_version\fP = 1" .br .RI "Minimum protocol version required for the \fBpong\fP function\&. " .ti -1c .RI "static constexpr std::uint32_t \fBmove_since_version\fP = 1" .br .RI "Minimum protocol version required for the \fBmove\fP function\&. " .ti -1c .RI "static constexpr std::uint32_t \fBresize_since_version\fP = 1" .br .RI "Minimum protocol version required for the \fBresize\fP function\&. " .ti -1c .RI "static constexpr std::uint32_t \fBset_toplevel_since_version\fP = 1" .br .RI "Minimum protocol version required for the \fBset_toplevel\fP function\&. " .ti -1c .RI "static constexpr std::uint32_t \fBset_transient_since_version\fP = 1" .br .RI "Minimum protocol version required for the \fBset_transient\fP function\&. " .ti -1c .RI "static constexpr std::uint32_t \fBset_fullscreen_since_version\fP = 1" .br .RI "Minimum protocol version required for the \fBset_fullscreen\fP function\&. " .ti -1c .RI "static constexpr std::uint32_t \fBset_popup_since_version\fP = 1" .br .RI "Minimum protocol version required for the \fBset_popup\fP function\&. " .ti -1c .RI "static constexpr std::uint32_t \fBset_maximized_since_version\fP = 1" .br .RI "Minimum protocol version required for the \fBset_maximized\fP function\&. " .ti -1c .RI "static constexpr std::uint32_t \fBset_title_since_version\fP = 1" .br .RI "Minimum protocol version required for the \fBset_title\fP function\&. " .ti -1c .RI "static constexpr std::uint32_t \fBset_class_since_version\fP = 1" .br .RI "Minimum protocol version required for the \fBset_class\fP function\&. " .in -1c .SH "Detailed Description" .PP desktop-style metadata interface An interface that may be implemented by a wl_surface, for implementations that provide a desktop-style user interface\&. .PP It provides requests to treat surfaces like toplevel, fullscreen or popup windows, move, resize or maximize them, associate metadata like title and class, etc\&. .PP On the server side the object is automatically destroyed when the related wl_surface is destroyed\&. On the client side, wl_shell_surface_destroy() must be called before destroying the wl_surface object\&. .PP \fBExamples\fP .in +1c \fBegl\&.cpp\fP, and \fBshm\&.cpp\fP\&. .PP Definition at line \fB1591\fP of file \fBwayland\-client\-protocol\&.hpp\fP\&. .SH "Member Enumeration Documentation" .PP .SS "enum class \fBwayland::proxy_t::wrapper_type\fP\fC [strong]\fP, \fC [inherited]\fP" Underlying wl_proxy type and properties of a \fBproxy_t\fP that affect construction, destruction, and event handling .PP \fBEnumerator\fP .in +1c .TP \fB\fIstandard \fP\fP C pointer is a standard type compatible with wl_proxy*\&. Events are dispatched and it is destructed when the \fBproxy_t\fP is destructed\&. User data is set\&. .TP \fB\fIdisplay \fP\fP C pointer is a wl_display*\&. No events are dispatched, wl_display_disconnect is called when the \fBproxy_t\fP is destructed\&. User data is set\&. .TP \fB\fIforeign \fP\fP C pointer is a standard type compatible with wl_proxy*, but another library owns it and it should not be touched in a way that could affect the operation of the other library\&. No events are dispatched, wl_proxy_destroy is not called when the \fBproxy_t\fP is destructed, user data is not touched\&. Consequently, there is no reference counting for the \fBproxy_t\fP\&. Lifetime of such wrappers should preferably be short to minimize the chance that the owning library decides to destroy the wl_proxy\&. .TP \fB\fIproxy_wrapper \fP\fP C pointer is a wl_proxy* that was constructed with wl_proxy_create_wrapper\&. No events are dispatched, wl_proxy_wrapper_destroy is called when the \fBproxy_t\fP is destroyed\&. Reference counting is active\&. A reference to the \fBproxy_t\fP creating this proxy wrapper is held to extend its lifetime until after the proxy wrapper is destroyed\&. .PP Definition at line \fB115\fP of file \fBwayland\-client\&.hpp\fP\&. .SH "Member Function Documentation" .PP .SS "wl_proxy * wayland::proxy_t::c_ptr () const\fC [inherited]\fP" .PP Get a pointer to the underlying C struct\&. .PP \fBReturns\fP .RS 4 The underlying wl_proxy wrapped by this \fBproxy_t\fP if it exists, otherwise an exception is thrown .RE .PP .SS "std::string wayland::proxy_t::get_class () const\fC [inherited]\fP" .PP Get the interface name (class) of a proxy object\&. .PP \fBReturns\fP .RS 4 The interface name of the object associated with the proxy .RE .PP .SS "uint32_t wayland::proxy_t::get_id () const\fC [inherited]\fP" .PP Get the id of a proxy object\&. .PP \fBReturns\fP .RS 4 The id the object associated with the proxy .RE .PP .SS "uint32_t wayland::proxy_t::get_version () const\fC [inherited]\fP" .PP Get the protocol object version of a proxy object\&. Gets the protocol object version of a proxy object, or 0 if the proxy was created with unversioned API\&. .PP A returned value of 0 means that no version information is available, so the caller must make safe assumptions about the object's real version\&. .PP \fBdisplay_t\fP will always return version 0\&. .PP \fBReturns\fP .RS 4 The protocol object version of the proxy or 0 .RE .PP .SS "\fBwrapper_type\fP wayland::proxy_t::get_wrapper_type () const\fC [inline]\fP, \fC [inherited]\fP" .PP Get the type of a proxy object\&. .PP Definition at line \fB301\fP of file \fBwayland\-client\&.hpp\fP\&. .SS "void shell_surface_t::move (\fBseat_t\fP const & seat, uint32_t serial)" .PP start an interactive move .PP \fBParameters\fP .RS 4 \fIseat\fP seat whose pointer is used .br \fIserial\fP serial number of the implicit grab on the pointer .RE .PP Start a pointer-driven move of the surface\&. .PP This request must be used in response to a button press event\&. The server may ignore move requests depending on the state of the surface (e\&.g\&. fullscreen or maximized)\&. .PP \fBExamples\fP .in +1c \fBegl\&.cpp\fP, and \fBshm\&.cpp\fP\&. .PP Definition at line \fB2542\fP of file \fBwayland\-client\-protocol\&.cpp\fP\&. .SS "std::function< void(\fBshell_surface_resize\fP, int32_t, int32_t)> & shell_surface_t::on_configure ()" .PP suggest resize .PP \fBParameters\fP .RS 4 \fIedges\fP how the surface was resized .br \fIwidth\fP new width of the surface .br \fIheight\fP new height of the surface .RE .PP The configure event asks the client to resize its surface\&. .PP The size is a hint, in the sense that the client is free to ignore it if it doesn't resize, pick a smaller size (to satisfy aspect ratio or resize in steps of NxM pixels)\&. .PP The edges parameter provides a hint about how the surface was resized\&. The client may use this information to decide how to adjust its content to the new size (e\&.g\&. a scrolling area might adjust its content position to leave the viewable content unmoved)\&. .PP The client is free to dismiss all but the last configure event it received\&. .PP The width and height arguments specify the size of the window in surface-local coordinates\&. .PP Definition at line \fB2601\fP of file \fBwayland\-client\-protocol\&.cpp\fP\&. .SS "std::function< void(uint32_t)> & shell_surface_t::on_ping ()" .PP ping client .PP \fBParameters\fP .RS 4 \fIserial\fP serial number of the ping .RE .PP Ping a client to check if it is receiving events and sending requests\&. A client is expected to reply with a pong request\&. .PP \fBExamples\fP .in +1c \fBegl\&.cpp\fP, and \fBshm\&.cpp\fP\&. .PP Definition at line \fB2596\fP of file \fBwayland\-client\-protocol\&.cpp\fP\&. .SS "std::function< void()> & shell_surface_t::on_popup_done ()" .PP popup interaction is done The popup_done event is sent out when a popup grab is broken, that is, when the user clicks a surface that doesn't belong to the client owning the popup surface\&. .PP Definition at line \fB2606\fP of file \fBwayland\-client\-protocol\&.cpp\fP\&. .SS "wayland::proxy_t::operator bool () const\fC [inherited]\fP" .PP Check whether this wrapper actually wraps an object\&. .PP \fBReturns\fP .RS 4 true if there is an underlying object, false if this wrapper is empty .RE .PP .SS "bool wayland::proxy_t::operator!= (const \fBproxy_t\fP & right) const\fC [inherited]\fP" .PP Check whether two wrappers refer to different objects\&. .SS "bool wayland::proxy_t::operator== (const \fBproxy_t\fP & right) const\fC [inherited]\fP" .PP Check whether two wrappers refer to the same object\&. .SS "void shell_surface_t::pong (uint32_t serial)" .PP respond to a ping event .PP \fBParameters\fP .RS 4 \fIserial\fP serial number of the ping event .RE .PP A client must respond to a ping event with a pong request or the client may be deemed unresponsive\&. .PP \fBExamples\fP .in +1c \fBegl\&.cpp\fP, and \fBshm\&.cpp\fP\&. .PP Definition at line \fB2536\fP of file \fBwayland\-client\-protocol\&.cpp\fP\&. .SS "bool wayland::proxy_t::proxy_has_object () const\fC [inherited]\fP" .PP Check whether this wrapper actually wraps an object\&. .PP \fBReturns\fP .RS 4 true if there is an underlying object, false if this wrapper is empty .RE .PP .SS "void wayland::proxy_t::proxy_release ()\fC [inherited]\fP" .PP Release the wrapped object (if any), making this an empty wrapper\&. Note that \fBdisplay_t\fP instances cannot be released this way\&. Attempts to do so are ignored\&. .PP \fBExamples\fP .in +1c \fBforeign_display\&.cpp\fP\&. .SS "void shell_surface_t::resize (\fBseat_t\fP const & seat, uint32_t serial, \fBshell_surface_resize\fP const & edges)" .PP start an interactive resize .PP \fBParameters\fP .RS 4 \fIseat\fP seat whose pointer is used .br \fIserial\fP serial number of the implicit grab on the pointer .br \fIedges\fP which edge or corner is being dragged .RE .PP Start a pointer-driven resizing of the surface\&. .PP This request must be used in response to a button press event\&. The server may ignore resize requests depending on the state of the surface (e\&.g\&. fullscreen or maximized)\&. .PP Definition at line \fB2548\fP of file \fBwayland\-client\-protocol\&.cpp\fP\&. .SS "void shell_surface_t::set_class (std::string const & class_)" .PP set surface class .PP \fBParameters\fP .RS 4 \fIclass_\fP surface class .RE .PP Set a class for the surface\&. .PP The surface class identifies the general class of applications to which the surface belongs\&. A common convention is to use the file name (or the full path if it is a non-standard location) of the application's \&.desktop file as the class\&. .PP Definition at line \fB2590\fP of file \fBwayland\-client\-protocol\&.cpp\fP\&. .SS "void shell_surface_t::set_fullscreen (shell_surface_fullscreen_method const & method, uint32_t framerate, \fBoutput_t\fP const & output)" .PP make the surface a fullscreen surface .PP \fBParameters\fP .RS 4 \fImethod\fP method for resolving size conflict .br \fIframerate\fP framerate in mHz .br \fIoutput\fP output on which the surface is to be fullscreen .RE .PP Map the surface as a fullscreen surface\&. .PP If an output parameter is given then the surface will be made fullscreen on that output\&. If the client does not specify the output then the compositor will apply its policy - usually choosing the output on which the surface has the biggest surface area\&. .PP The client may specify a method to resolve a size conflict between the output size and the surface size - this is provided through the method parameter\&. .PP The framerate parameter is used only when the method is set to 'driver', to indicate the preferred framerate\&. A value of 0 indicates that the client does not care about framerate\&. The framerate is specified in mHz, that is framerate of 60000 is 60Hz\&. .PP A method of 'scale' or 'driver' implies a scaling operation of the surface, either via a direct scaling operation or a change of the output mode\&. This will override any kind of output scaling, so that mapping a surface with a buffer size equal to the mode can fill the screen independent of buffer_scale\&. .PP A method of 'fill' means we don't scale up the buffer, however any output scale is applied\&. This means that you may run into an edge case where the application maps a buffer with the same size of the output mode but buffer_scale 1 (thus making a surface larger than the output)\&. In this case it is allowed to downscale the results to fit the screen\&. .PP The compositor must reply to this request with a configure event with the dimensions for the output on which the surface will be made fullscreen\&. .PP Definition at line \fB2566\fP of file \fBwayland\-client\-protocol\&.cpp\fP\&. .SS "void shell_surface_t::set_maximized (\fBoutput_t\fP const & output)" .PP make the surface a maximized surface .PP \fBParameters\fP .RS 4 \fIoutput\fP output on which the surface is to be maximized .RE .PP Map the surface as a maximized surface\&. .PP If an output parameter is given then the surface will be maximized on that output\&. If the client does not specify the output then the compositor will apply its policy - usually choosing the output on which the surface has the biggest surface area\&. .PP The compositor will reply with a configure event telling the expected new surface size\&. The operation is completed on the next buffer attach to this surface\&. .PP A maximized surface typically fills the entire output it is bound to, except for desktop elements such as panels\&. This is the main difference between a maximized shell surface and a fullscreen shell surface\&. .PP The details depend on the compositor implementation\&. .PP Definition at line \fB2578\fP of file \fBwayland\-client\-protocol\&.cpp\fP\&. .SS "void shell_surface_t::set_popup (\fBseat_t\fP const & seat, uint32_t serial, \fBsurface_t\fP const & parent, int32_t x, int32_t y, \fBshell_surface_transient\fP const & flags)" .PP make the surface a popup surface .PP \fBParameters\fP .RS 4 \fIseat\fP seat whose pointer is used .br \fIserial\fP serial number of the implicit grab on the pointer .br \fIparent\fP parent surface .br \fIx\fP surface-local x coordinate .br \fIy\fP surface-local y coordinate .br \fIflags\fP transient surface behavior .RE .PP Map the surface as a popup\&. .PP A popup surface is a transient surface with an added pointer grab\&. .PP An existing implicit grab will be changed to owner-events mode, and the popup grab will continue after the implicit grab ends (i\&.e\&. releasing the mouse button does not cause the popup to be unmapped)\&. .PP The popup grab continues until the window is destroyed or a mouse button is pressed in any other client's window\&. A click in any of the client's surfaces is reported as normal, however, clicks in other clients' surfaces will be discarded and trigger the callback\&. .PP The x and y arguments specify the location of the upper left corner of the surface relative to the upper left corner of the parent surface, in surface-local coordinates\&. .PP Definition at line \fB2572\fP of file \fBwayland\-client\-protocol\&.cpp\fP\&. .SS "void wayland::proxy_t::set_queue (\fBevent_queue_t\fP queue)\fC [inherited]\fP" .PP Assign a proxy to an event queue\&. .PP \fBParameters\fP .RS 4 \fIqueue\fP The event queue that will handle this proxy .RE .PP Assign proxy to event queue\&. Events coming from proxy will be queued in queue instead of the display's main queue\&. .PP See also: \fBdisplay_t::dispatch_queue()\fP\&. .PP \fBExamples\fP .in +1c \fBproxy_wrapper\&.cpp\fP\&. .SS "void shell_surface_t::set_title (std::string const & title)" .PP set surface title .PP \fBParameters\fP .RS 4 \fItitle\fP surface title .RE .PP Set a short title for the surface\&. .PP This string may be used to identify the surface in a task bar, window list, or other user interface elements provided by the compositor\&. .PP The string must be encoded in UTF-8\&. .PP \fBExamples\fP .in +1c \fBegl\&.cpp\fP, and \fBshm\&.cpp\fP\&. .PP Definition at line \fB2584\fP of file \fBwayland\-client\-protocol\&.cpp\fP\&. .SS "void shell_surface_t::set_toplevel ()" .PP make the surface a toplevel surface Map the surface as a toplevel surface\&. .PP A toplevel surface is not fullscreen, maximized or transient\&. .PP \fBExamples\fP .in +1c \fBegl\&.cpp\fP, and \fBshm\&.cpp\fP\&. .PP Definition at line \fB2554\fP of file \fBwayland\-client\-protocol\&.cpp\fP\&. .SS "void shell_surface_t::set_transient (\fBsurface_t\fP const & parent, int32_t x, int32_t y, \fBshell_surface_transient\fP const & flags)" .PP make the surface a transient surface .PP \fBParameters\fP .RS 4 \fIparent\fP parent surface .br \fIx\fP surface-local x coordinate .br \fIy\fP surface-local y coordinate .br \fIflags\fP transient surface behavior .RE .PP Map the surface relative to an existing surface\&. .PP The x and y arguments specify the location of the upper left corner of the surface relative to the upper left corner of the parent surface, in surface-local coordinates\&. .PP The flags argument controls details of the transient behaviour\&. .PP Definition at line \fB2560\fP of file \fBwayland\-client\-protocol\&.cpp\fP\&. .SH "Member Data Documentation" .PP .SS "constexpr std::uint32_t wayland::shell_surface_t::move_since_version = 1\fC [static]\fP, \fC [constexpr]\fP" .PP Minimum protocol version required for the \fBmove\fP function\&. .PP Definition at line \fB1644\fP of file \fBwayland\-client\-protocol\&.hpp\fP\&. .SS "constexpr std::uint32_t wayland::shell_surface_t::pong_since_version = 1\fC [static]\fP, \fC [constexpr]\fP" .PP Minimum protocol version required for the \fBpong\fP function\&. .PP Definition at line \fB1627\fP of file \fBwayland\-client\-protocol\&.hpp\fP\&. .SS "constexpr std::uint32_t wayland::shell_surface_t::resize_since_version = 1\fC [static]\fP, \fC [constexpr]\fP" .PP Minimum protocol version required for the \fBresize\fP function\&. .PP Definition at line \fB1662\fP of file \fBwayland\-client\-protocol\&.hpp\fP\&. .SS "constexpr std::uint32_t wayland::shell_surface_t::set_class_since_version = 1\fC [static]\fP, \fC [constexpr]\fP" .PP Minimum protocol version required for the \fBset_class\fP function\&. .PP Definition at line \fB1841\fP of file \fBwayland\-client\-protocol\&.hpp\fP\&. .SS "constexpr std::uint32_t wayland::shell_surface_t::set_fullscreen_since_version = 1\fC [static]\fP, \fC [constexpr]\fP" .PP Minimum protocol version required for the \fBset_fullscreen\fP function\&. .PP Definition at line \fB1742\fP of file \fBwayland\-client\-protocol\&.hpp\fP\&. .SS "constexpr std::uint32_t wayland::shell_surface_t::set_maximized_since_version = 1\fC [static]\fP, \fC [constexpr]\fP" .PP Minimum protocol version required for the \fBset_maximized\fP function\&. .PP Definition at line \fB1806\fP of file \fBwayland\-client\-protocol\&.hpp\fP\&. .SS "constexpr std::uint32_t wayland::shell_surface_t::set_popup_since_version = 1\fC [static]\fP, \fC [constexpr]\fP" .PP Minimum protocol version required for the \fBset_popup\fP function\&. .PP Definition at line \fB1777\fP of file \fBwayland\-client\-protocol\&.hpp\fP\&. .SS "constexpr std::uint32_t wayland::shell_surface_t::set_title_since_version = 1\fC [static]\fP, \fC [constexpr]\fP" .PP Minimum protocol version required for the \fBset_title\fP function\&. .PP Definition at line \fB1824\fP of file \fBwayland\-client\-protocol\&.hpp\fP\&. .SS "constexpr std::uint32_t wayland::shell_surface_t::set_toplevel_since_version = 1\fC [static]\fP, \fC [constexpr]\fP" .PP Minimum protocol version required for the \fBset_toplevel\fP function\&. .PP Definition at line \fB1675\fP of file \fBwayland\-client\-protocol\&.hpp\fP\&. .SS "constexpr std::uint32_t wayland::shell_surface_t::set_transient_since_version = 1\fC [static]\fP, \fC [constexpr]\fP" .PP Minimum protocol version required for the \fBset_transient\fP function\&. .PP Definition at line \fB1696\fP of file \fBwayland\-client\-protocol\&.hpp\fP\&. .SH "Author" .PP Generated automatically by Doxygen for Wayland++ from the source code\&.