Louvre  v2.13.0-1
C++ library for Wayland compositors
Public Member Functions | List of all members
LGlobal Class Referencefinal

A Wayland protocol global. More...

+ Inheritance diagram for LGlobal:

Public Member Functions

const wl_interface * interface () const noexcept
 Gets the interface of the global. More...
 
const wl_global * global () const noexcept
 Gets the native global handle. More...
 
template<class T >
bool isType () const noexcept
 Check the global type. More...
 
- Public Member Functions inherited from LObject
 LObject (const LObject &) noexcept
 Copy constructor. More...
 
LObjectoperator= (const LObject &) noexcept
 Assignment operator (each object has its own individual LWeak reference count). More...
 
void setUserData (UIntPtr data) const noexcept
 Store an unsigned integer value/pointer. More...
 
UIntPtr userData () const noexcept
 Retrieves the stored unsigned integer value/pointer. More...
 

Additional Inherited Members

- Protected Member Functions inherited from LObject
 LObject () noexcept=default
 Constructor of the LObject class. More...
 
virtual ~LObject () noexcept
 Destructor of the LObject class. More...
 
void notifyDestruction () noexcept
 Notifies the object destruction. More...
 

Detailed Description

A Wayland protocol global.

The LGlobal class encapsulates a wl_global, which is a special protocol interface notified to clients through the wl_registry interface.

Clients bound to a global can request the creation of resources with interfaces that provide functionality specific to the protocol they belong to.

Every protocol typically includes one or more globals. To view the globals implemented by Louvre, refer to LCompositor::createGlobalsRequest().

You can override LCompositor::createGlobalsRequest() to disable or add custom globals. To add a custom global, refer to LCompositor::createGlobal() and to remove it, use LCompositor::removeGlobal().

Note
Calling LCompositor::removeGlobal() isn't mandatory as globals are automatically destroyed during the compositor's uninitialization.

Member Function Documentation

◆ interface()

const wl_interface * interface ( ) const
noexcept

Gets the interface of the global.

◆ global()

const wl_global* global ( ) const
inlinenoexcept

Gets the native global handle.

◆ isType()

bool isType ( ) const
inlinenoexcept

Check the global type.

Returns
true if the global type is T, false otherwise.