Kanzi 3.9.10
kanzi::wayland::WaylandInterface< T, NativeHandle, Listener > Class Template Reference

Represents a generic Wayland interface handle with managed lifetime. More...

#include <kanzi/core.ui/platform/windowing_ng/wayland/wayland_interface.hpp>

Public Types

using ListenerType
 Generic alias to query for appropriate listener type.
 

Public Member Functions

template<typename L = Listener>
bool addListener (enable_if_t<!is_same< L, void >::value, const L & > listener, void *data) const noexcept
 Adds a listener to Wayland object.
 
KZ_NO_DISCARD unsigned int askVersion () const noexcept
 Requests compositor which interface version we use.
 
KZ_NO_DISCARD NativeHandle * getNativeHandle () const noexcept
 Gets the underlying native handle.
 

Static Public Member Functions

static KZ_NO_DISCARD unsigned int askVersion (NativeHandle *handle) noexcept
 Requests compositor which interface version we use.
 

Detailed Description

template<typename T, typename NativeHandle, typename Listener = void>
class kanzi::wayland::WaylandInterface< T, NativeHandle, Listener >

Represents a generic Wayland interface handle with managed lifetime.

Uses CRTP pattern. The user is encouraged to derive from it and pass itself as a template parameter.

Template Parameters
TCRTP derived class.
NativeHandleNative Wayland handle type.
ListenerNative Wayland listener type associated with interface.
Since
Kanzi 3.9.8

Member Typedef Documentation

◆ ListenerType

template<typename T , typename NativeHandle , typename Listener = void>
using kanzi::wayland::WaylandInterface< T, NativeHandle, Listener >::ListenerType

Generic alias to query for appropriate listener type.

Member Function Documentation

◆ askVersion() [1/2]

template<typename T , typename NativeHandle , typename Listener = void>
static KZ_NO_DISCARD unsigned int kanzi::wayland::WaylandInterface< T, NativeHandle, Listener >::askVersion ( NativeHandle * handle)
inlinestaticnoexcept

Requests compositor which interface version we use.

Returns
Current interface version.

◆ askVersion() [2/2]

template<typename T , typename NativeHandle , typename Listener = void>
KZ_NO_DISCARD unsigned int kanzi::wayland::WaylandInterface< T, NativeHandle, Listener >::askVersion ( ) const
inlinenoexcept

Requests compositor which interface version we use.

Returns
Current interface version.

◆ getNativeHandle()

template<typename T , typename NativeHandle , typename Listener = void>
KZ_NO_DISCARD NativeHandle * kanzi::wayland::WaylandInterface< T, NativeHandle, Listener >::getNativeHandle ( ) const
inlinenoexcept

Gets the underlying native handle.

Returns
Native Wayland handle.

◆ addListener()

template<typename T , typename NativeHandle , typename Listener = void>
template<typename L = Listener>
bool kanzi::wayland::WaylandInterface< T, NativeHandle, Listener >::addListener ( enable_if_t<!is_same< L, void >::value, const L & > listener,
void * data ) const
inlinenoexcept

Adds a listener to Wayland object.

Template Parameters
LListener type.
Parameters
listenerListener to attach.
dataData pointer to receive when the listener is called.
Returns
On success, true, otherwise false.

The documentation for this class was generated from the following file: