![]() |
Louvre v2.18.1-1
C++ library for Wayland compositors
|
Wrapper for native wl_resource structs. More...
#include <LResource.h>
Inheritance diagram for LResource:Public Member Functions | |
| wl_resource * | resource () const noexcept |
| Retrieve the wrapped wl_resource pointer. | |
| LClient * | client () const noexcept |
| Retrieve the client that owns this resource. | |
| Int32 | version () const noexcept |
| Retrieve the version of the global interface. | |
| UInt32 | id () const noexcept |
| Retrieve the ID of the resource. | |
| void | destroy () |
| Destroy the resource. | |
| template<typename... Args> | |
| void | postError (UInt32 code, std::format_string< Args... > message, Args &&... args) |
| A safe wrapper for wl_resource_post_error. | |
Public Member Functions inherited from LObject | |
| LObject (const LObject &) noexcept | |
| Copy constructor. | |
| LObject & | operator= (const LObject &) noexcept |
| Assignment operator (each object has its own individual LWeak reference count). | |
| void | setUserData (UIntPtr data) const noexcept |
| Store an unsigned integer value/pointer. | |
| UIntPtr | userData () const noexcept |
| Retrieves the stored unsigned integer value/pointer. | |
Protected Member Functions | |
| LResource (wl_client *client, const wl_interface *interface, Int32 version, UInt32 id, const void *implementation) noexcept | |
| Constructor for LResource using wl_client and other parameters. | |
| LResource (LClient *client, const wl_interface *interface, Int32 version, UInt32 id, const void *implementation) noexcept | |
| Constructor for LResource using LClient and other parameters. | |
| ~LResource () | |
| Destructor for LResource. | |
Protected Member Functions inherited from LObject | |
| LObject () noexcept=default | |
| Constructor of the LObject class. | |
| virtual | ~LObject () noexcept |
| Destructor of the LObject class. | |
| void | notifyDestruction () noexcept |
| Notifies the object destruction. | |
Wrapper for native wl_resource structs.
This class serves as a wrapper for the wl_resource struct from the original Wayland library.
Numerous objects expose their LResource objects, allowing you to utilize native Wayland methods if desired.
To explore all the globals/resources implemented by Louvre, refer to the Louvre/src/lib/protocols directory.
|
protectednoexcept |
Constructor for LResource using wl_client and other parameters.
This constructor creates an LResource and registers it with the provided parameters.
| client | The wl_client associated with the resource. |
| interface | Pointer to the wl_interface provided by the protocol. |
| version | Version of the global interface. |
| id | ID of the resource; passing 0 automatically generates an increasing ID. |
| implementation | Pointer to the interface implementation (struct with callback functions to handle client requests). |
|
protectednoexcept |
Constructor for LResource using LClient and other parameters.
This constructor creates an LResource and registers it with the provided parameters.
| client | The LClient associated with the resource. |
| interface | Pointer to the wl_interface provided by the protocol. |
| version | Version of the global interface. |
| id | ID of the resource; passing 0 automatically generates an increasing ID. |
| implementation | Pointer to the interface implementation (struct with callback functions to handle client requests). |
|
inlinenoexcept |
Retrieve the wrapped wl_resource pointer.
This method returns the original wl_resource pointer associated with this LResource.
|
inlinenoexcept |
|
noexcept |
Retrieve the version of the global interface.
This method returns the version of the global interface associated with this resource.
|
noexcept |
Retrieve the ID of the resource.
This method returns the ID of the resource, which is the same as calling wl_resource_get_id().
| void destroy | ( | ) |
Destroy the resource.
This method destroys the resource, equivalent to calling wl_resource_destroy().
|
inline |
A safe wrapper for wl_resource_post_error.
This method ensures that wl_resource_post_error is not called more than once for the same client.
| code | The error code to be sent to the client. |
| message | The format string for the error message. |
| args | Additional arguments to format the message. |