Louvre  v2.12.0-1
C++ library for Wayland compositors
Public Types | Public Member Functions | List of all members
LFactoryObject Class Reference

Base class for Factory objects. More...

+ Inheritance diagram for LFactoryObject:

Public Types

enum class  Type : Int32
 Base factory object types. More...
 

Public Member Functions

Type factoryObjectType () const noexcept
 Gets the base factory object 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

Base class for Factory objects.

Factory

A Wayland compositor usually handles many different tasks such as processing client requests from various protocols, managing input events, rendering, and more.

In Louvre, each functionality is managed by a specific class, typically through virtual methods.
This approach allows Louvre to provide a default way to handle each functionality while also enabling developers to override it when desired, which is known as the factory pattern.

These classes are derived from this base class and their lifetime is managed entirely by LCompositor.
When LCompositor::createObjectRequest() is triggered, it expects you to return a new instance of a specific LFactoryObject subtype. If nullptr is returned, Louvre creates and uses an instance of the default class.

See also
Type to see all classes that can be overridden.

Before an instance of a class is destroyed by the compositor, the LCompositor::onAnticipatedObjectDestruction() event is triggered. This is called well in advance of the actual object's destructor, allowing you to still access many of its related resources.

Note
The compositor is responsible for destroying the object, do not attempt not delete it yourself.

Member Enumeration Documentation

◆ Type

enum Type : Int32
strong

Base factory object types.

Enum representing all Louvre classes that can be overridden. The names match the names of the actual classes.

See also
LCompositor::createObjectRequest()
Enumerator
LSurface 

Represents the LSurface class.

LToplevelRole 

Represents the LToplevelRole class.

LForeignToplevelController 

Represents the LForeignToplevelController class.

LPopupRole 

Represents the LPopupRole class.

LSubsurfaceRole 

Represents the LSubsurfaceRole class.

LCursorRole 

Represents the LCursorRole class.

LDNDIconRole 

Represents the LDNDIconRole class.

LSessionLockRole 

Represents the LSessionLockRole class.

LLayerRole 

Represents the LLayerRole class.

LClient 

Represents the LClient class.

LOutput 

Represents the LOutput class.

LSeat 

Represents the LSeat class.

LPointer 

Represents the LPointer class.

LKeyboard 

Represents the LKeyboard class.

LTouch 

Represents the LTouch class.

LClipboard 

Represents the LClipboard class.

LDND 

Represents the LDND class.

LSessionLockManager 

Represents the LSessionLockManager class.

LActivationTokenManager 

Represents the LActivationTokenManager class.

Member Function Documentation

◆ factoryObjectType()

Type factoryObjectType ( ) const
inlinenoexcept

Gets the base factory object type.

Returns the base factory object type associated with this instance.

Returns
The base factory object type.