![]() |
Louvre
v2.9.0-1
C++ library for Wayland compositors
|
Subsurface role for surfaces. More...
Public Member Functions | |
LSubsurfaceRole (const void *params) noexcept | |
Constructor of the LSubsurfaceRole class. More... | |
~LSubsurfaceRole ()=default | |
Destructor of the LSubsurfaceRole class. More... | |
bool | isSynced () const noexcept |
Current mode. More... | |
const LPoint & | localPos () const noexcept |
Offset in surface coordinates. More... | |
![]() | |
LBaseSurfaceRole (LFactoryObject::Type type, LResource *resource, LSurface *surface, UInt32 roleId) noexcept | |
Constructor of LBaseSurfaceRole class. More... | |
~LBaseSurfaceRole () | |
The LBaseSurfaceRole class destructor. More... | |
virtual LOutput * | exclusiveOutput () const |
The output to which the surface should be constrained. More... | |
UInt32 | roleId () const noexcept |
Role ID. More... | |
LSurface * | surface () const noexcept |
Returns the surface that has acquired the role provided in the constructor. More... | |
LResource * | resource () const |
Returns the Wayland resource for this role given in the constructor. More... | |
LClient * | client () const noexcept |
Client owner of the surface role. More... | |
![]() | |
Type | factoryObjectType () const noexcept |
Gets the base factory object type. More... | |
![]() | |
LObject (const LObject &) noexcept | |
Copy constructor. More... | |
LObject & | operator= (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... | |
Virtual Methods | |
virtual const LPoint & | rolePos () const override |
Position of the subsurface according to the role. More... | |
virtual void | localPosChanged () |
Change of offset. More... | |
virtual void | syncModeChanged () |
Change of mode. More... | |
virtual void | placedAbove (LSurface *sibling) |
Place above. More... | |
virtual void | placedBelow (LSurface *sibling) |
Place below. More... | |
Additional Inherited Members | |
![]() | |
enum | CommitOrigin |
Commit origin. More... | |
![]() | |
enum class | Type : Int32 |
Base factory object types. More... | |
![]() | |
virtual void | handleSurfaceBufferAttach (wl_resource *buffer, Int32 x, Int32 y) |
Notifies a new surface buffer attachment. More... | |
virtual void | handleSurfaceOffset (Int32 x, Int32 y) |
Notifies a surface buffer offset change. More... | |
![]() | |
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... | |
![]() | |
LPoint | m_rolePos |
Variable that stores the surface position given the role. More... | |
Subsurface role for surfaces.
LSubsurfaceRole surfaces are always children of other surfaces and are positioned relative to their parent surface. They are meant to be treated and composited as if they were part of their parent surface, for example, for displaying a video frame within a web browser window.
The Subsurface role is part of the Wayland protocol.
Clients can request to modify the order in which they are stacked relative to their parent surface or other sibling surfaces. See placedAbove() and placedBelow(). Louvre automatically updates the LCompositor::surfaces() list, keeping the order and also triggering the LSurface::orderChanged() event.
Subsurfaces can operate in two modes:
In this mode, changes to the subsurface, such as its position, are applied exclusively when its parent performs a commit. This mode is used by clients to synchronize the animation or movement of multiple subsurfaces. The library keeps track of changes and applies them when the parent performs a commit.
In this mode, subsurface changes are applied independently of the commits of its parent.
|
noexcept |
Constructor of the LSubsurfaceRole class.
params | Internal parameters provided in LCompositor::createObjectRequest(). |
|
default |
Destructor of the LSubsurfaceRole class.
Invoked after LCompositor::onAnticipatedObjectDestruction().
|
inlinenoexcept |
Current mode.
true
if in synchronous mode, false
otherwise.
|
inlinenoexcept |
Offset in surface coordinates.
The offset relative to the top-left corner of the parent surface in surface coordinates.
|
overridevirtual |
Position of the subsurface according to the role.
The default implementation of rolePos() positions the subsurface relative to its parent rolePos() by adding the offset given by localPos().
Implements LBaseSurfaceRole.
|
virtual |
Change of offset.
|
virtual |
|
virtual |
Place above.
|
virtual |
Place below.