Louvre v2.18.1-1
C++ library for Wayland compositors
Loading...
Searching...
No Matches
Public Member Functions | List of all members
LDNDIconRole Class Reference

Drag & drop icon role for surfaces. More...

#include <LDNDIconRole.h>

+ Inheritance diagram for LDNDIconRole:

Public Member Functions

 LDNDIconRole (const void *params) noexcept
 Constructor of the LDNDIconRole class.
 
 ~LDNDIconRole ()
 Destructor of the LDNDIconRole class.
 
const LPoint & hotspot () const noexcept
 Hotspot of the icon in surface coordinates.
 
const LPoint & hotspotB () const noexcept
 Hotspot of the icon in buffer coordinates.
 
virtual void hotspotChanged () const
 Notify a hotspot change.
 
virtual const LPoint & rolePos () const override
 Position of the surface given the role.
 
- Public Member Functions inherited from LBaseSurfaceRole
 LBaseSurfaceRole (LFactoryObject::Type type, LResource *resource, LSurface *surface, UInt32 roleId) noexcept
 Constructor of LBaseSurfaceRole class.
 
 ~LBaseSurfaceRole ()
 The LBaseSurfaceRole class destructor.
 
virtual LOutput * exclusiveOutput () const
 The output to which the surface should be constrained.
 
UInt32 roleId () const noexcept
 Role ID.
 
LSurface * surface () const noexcept
 Returns the surface that has acquired the role provided in the constructor.
 
LResource * resource () const
 Returns the Wayland resource for this role given in the constructor.
 
LClient * client () const noexcept
 Client owner of the surface role.
 
- Public Member Functions inherited from LFactoryObject
Type factoryObjectType () const noexcept
 Gets the base factory object type.
 
- 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.
 

Additional Inherited Members

- Public Types inherited from LBaseSurfaceRole
enum  CommitOrigin
 Commit origin. More...
 
- Public Types inherited from LFactoryObject
enum class  Type : Int32
 Base factory object types. More...
 
- Protected Member Functions inherited from LBaseSurfaceRole
virtual bool acceptCommitRequest (CommitOrigin origin)
 Asks if the surface commit should be processed.
 
virtual void handleSurfaceBufferAttach (wl_resource *buffer, Int32 x, Int32 y)
 Notifies a new surface buffer attachment.
 
virtual void handleParentCommit ()
 Notifies a parent surface commit.
 
virtual void handleParentMappingChange ()
 Notifies when the mapping state of the parent surface changes.
 
virtual void handleParentChange ()
 Notifies when the parent surface changes.
 
- 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.
 
- Protected Attributes inherited from LBaseSurfaceRole
LPoint m_rolePos
 Variable that stores the surface position given the role.
 

Detailed Description

Drag & drop icon role for surfaces.

The LDNDIconRole role is used during drag & drop sessions. See LDND::icon().

Constructor & Destructor Documentation

◆ LDNDIconRole()

LDNDIconRole ( const void *  params)
noexcept

Constructor of the LDNDIconRole class.

Parameters
paramsInternal parameters provided in LCompositor::createObjectRequest().

◆ ~LDNDIconRole()

Destructor of the LDNDIconRole class.

Invoked after LCompositor::onAnticipatedObjectDestruction().

Warning
The surface() handle always remains valid during the destructor call. However, LSurface::role() returns nullptr because LSurface::roleChanged() is notified beforehand and requires the role to be valid.

Member Function Documentation

◆ hotspot()

const LPoint & hotspot ( ) const
inlinenoexcept

Hotspot of the icon in surface coordinates.

◆ hotspotB()

const LPoint & hotspotB ( ) const
inlinenoexcept

Hotspot of the icon in buffer coordinates.

◆ hotspotChanged()

virtual void hotspotChanged ( ) const
virtual

Notify a hotspot change.

Default implementation

{
/* No default implementation */
}
virtual void hotspotChanged() const
Notify a hotspot change.

◆ rolePos()

virtual const LPoint & rolePos ( ) const
overridevirtual

Position of the surface given the role.

The position of the icon given the role is calculated by subtracting the hotspot from LSurface::pos().

Default implementation

{
return m_rolePos;
}
LSurface * surface() const noexcept
Returns the surface that has acquired the role provided in the constructor.
Definition LBaseSurfaceRole.h:121
LPoint m_rolePos
Variable that stores the surface position given the role.
Definition LBaseSurfaceRole.h:148
const LPoint & hotspot() const noexcept
Hotspot of the icon in surface coordinates.
Definition LDNDIconRole.h:45
virtual const LPoint & rolePos() const override
Position of the surface given the role.
const LPoint & pos() const noexcept
Position given by the compositor.
Definition LSurface.cpp:336

Implements LBaseSurfaceRole.