![]() |
Louvre
v2.9.0-1
C++ library for Wayland compositors
|
Representation of a Wayland client. More...
Classes | |
struct | EventHistory |
Structure containing the last events sent to the client. More... | |
struct | KeyboardHistory |
Keyboard event history. More... | |
struct | PointerHistory |
Pointer event history. More... | |
struct | TouchHistory |
Touch event history. More... | |
Public Member Functions | |
LClient (const void *params) noexcept | |
Constructor of the LClient class. More... | |
~LClient () | |
Destructor of the LClient class. More... | |
void | credentials (pid_t *pid, uid_t *uid=nullptr, gid_t *gid=nullptr) const noexcept |
Retrieves Unix credentials of the client. More... | |
bool | ping (UInt32 serial) const noexcept |
Sends a ping event to the client. More... | |
virtual void | pong (UInt32 serial) |
Client response to a ping() event. More... | |
wl_client * | client () const noexcept |
Native wl_client struct of the client. More... | |
void | flush () noexcept |
Immediately flushes pending events. More... | |
void | destroyLater () noexcept |
Terminates the client connection with the compositor. More... | |
const EventHistory & | eventHistory () const noexcept |
Retrieves the client's event history. More... | |
const LEvent * | findEventBySerial (UInt32 serial) const noexcept |
Finds an event sent by the compositor matching the given serial number. More... | |
const LClientCursor & | lastCursorRequest () const noexcept |
Retrieves the last cursor requested by the client. More... | |
const std::vector< Protocols::Wayland::GOutput * > & | outputGlobals () const noexcept |
const std::vector< Protocols::Wayland::GCompositor * > & | compositorGlobals () const noexcept |
const std::vector< Protocols::Wayland::GSubcompositor * > & | subcompositorGlobals () const noexcept |
const std::vector< Protocols::Wayland::GSeat * > & | seatGlobals () const noexcept |
const std::vector< Protocols::Wayland::GDataDeviceManager * > & | dataDeviceManagerGlobals () const noexcept |
const std::vector< Protocols::XdgShell::GXdgWmBase * > & | xdgWmBaseGlobals () const noexcept |
const std::vector< Protocols::XdgDecoration::GXdgDecorationManager * > & | xdgDecorationManagerGlobals () const noexcept |
const std::vector< Protocols::PresentationTime::GPresentation * > & | presentationTimeGlobals () const noexcept |
const std::vector< Protocols::LinuxDMABuf::GLinuxDMABuf * > & | linuxDMABufGlobals () const noexcept |
const std::vector< Protocols::Viewporter::GViewporter * > & | viewporterGlobals () const noexcept |
const std::vector< Protocols::FractionalScale::GFractionalScaleManager * > & | fractionalScaleManagerGlobals () const noexcept |
const std::vector< Protocols::GammaControl::GGammaControlManager * > & | gammaControlManagerGlobals () const noexcept |
const std::vector< Protocols::TearingControl::GTearingControlManager * > & | tearingControlManagerGlobals () const noexcept |
const std::vector< Protocols::RelativePointer::GRelativePointerManager * > & | relativePointerManagerGlobals () const noexcept |
const std::vector< Protocols::PointerGestures::GPointerGestures * > & | pointerGesturesGlobals () const noexcept |
const std::vector< Protocols::SessionLock::GSessionLockManager * > & | sessionLockManagerGlobals () const noexcept |
const std::vector< Protocols::PointerConstraints::GPointerConstraints * > & | pointerConstraintsGlobals () const noexcept |
const std::vector< Protocols::XdgOutput::GXdgOutputManager * > & | xdgOutputManagerGlobals () const noexcept |
const std::vector< Protocols::ScreenCopy::GScreenCopyManager * > & | screenCopyManagerGlobals () const noexcept |
const std::vector< Protocols::ImageCaptureSource::GOutputImageCaptureSourceManager * > & | outputImageCaptureSourceManagerGlobals () const noexcept |
const std::vector< Protocols::ImageCaptureSource::GForeignToplevelImageCaptureSourceManager * > & | foreignToplevelImageCaptureSourceManagerGlobals () const noexcept |
const std::vector< Protocols::LayerShell::GLayerShell * > & | layerShellGlobals () const noexcept |
const std::vector< Protocols::ForeignToplevelManagement::GForeignToplevelManager * > & | foreignToplevelManagerGlobals () const noexcept |
const std::vector< Protocols::ForeignToplevelList::GForeignToplevelList * > & | foreignToplevelListGlobals () const noexcept |
const std::vector< Protocols::SinglePixelBuffer::GSinglePixelBufferManager * > & | singlePixelBufferManagerGlobals () const noexcept |
const std::vector< Protocols::ContentType::GContentTypeManager * > & | contentTypeManagerGlobals () const noexcept |
const std::vector< Protocols::IdleNotify::GIdleNotifier * > & | idleNotifierGlobals () const noexcept |
const std::vector< Protocols::IdleInhibit::GIdleInhibitManager * > & | idleInhibitManagerGlobals () const noexcept |
const std::vector< Protocols::XdgActivation::GXdgActivation * > & | xdgActivationGlobals () const noexcept |
![]() | |
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... | |
Additional Inherited Members | |
![]() | |
enum class | Type : Int32 |
Base factory object types. 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... | |
Representation of a Wayland client.
The LClient class represents a Wayland client connected to the compositor.
It allows managing the client connection, accessing its resources created through various Wayland protocols, handling ping/pong events, and more.
struct Louvre::LClient::EventHistory |
Structure containing the last events sent to the client.
This structure only contains event types that have a serial number in their respective Wayland protocol interface.
Class Members | ||
---|---|---|
PointerHistory | pointer | Pointer event history. |
KeyboardHistory | keyboard | Keyboard event history. |
TouchHistory | touch | Touch event history. |
struct Louvre::LClient::KeyboardHistory |
Keyboard event history.
Class Members | ||
---|---|---|
LKeyboardEnterEvent | enter | Sent when a surface acquires keyboard focus. |
LKeyboardKeyEvent | key[5] | Ring buffer of the last 5 keyboard key events. |
UInt8 | keyIndex | Current index of the keyboard key ring buffer. |
LKeyboardLeaveEvent | leave | Sent when a surface loses keyboard focus. |
LKeyboardModifiersEvent | modifiers | Sent when keyboard modifiers change. |
struct Louvre::LClient::PointerHistory |
Pointer event history.
Class Members | ||
---|---|---|
LPointerEnterEvent | enter | Sent when a surface acquires pointer focus. |
LPointerLeaveEvent | leave | Sent when a surface loses pointer focus. |
LPointerButtonEvent | button[5] | Ring buffer of the last 5 pointer button events. |
UInt8 | buttonIndex | Current index of the pointer button ring buffer. |
LPointerSwipeBeginEvent | swipeBegin | Sent when a pointer swipe begins. |
LPointerSwipeEndEvent | swipeEnd | Sent when a pointer swipe ends. |
LPointerPinchBeginEvent | pinchBegin | Sent when a pointer pinch begins. |
LPointerPinchEndEvent | pinchEnd | Sent when a pointer pinch ends. |
LPointerHoldBeginEvent | holdBegin | Sent when a pointer hold begins. |
LPointerHoldEndEvent | holdEnd | Sent when a pointer hold ends. |
struct Louvre::LClient::TouchHistory |
Touch event history.
A vector is used to store the last down and up events for specific touch points.
This is because the number of touch points is variable, but they are always re-used.
Class Members | ||
---|---|---|
vector< LTouchDownEvent > | down | Vector of the last touch down events. |
vector< LTouchUpEvent > | up | Vector of the last touch up events. |
|
noexcept |
Constructor of the LClient class.
params | Internal parameters provided in LCompositor::createObjectRequest(). |
~LClient | ( | ) |
Destructor of the LClient class.
Invoked after LCompositor::onAnticipatedObjectDestruction().
|
noexcept |
Retrieves Unix credentials of the client.
This method allows you to retrieve the process ID (PID), user ID (UID), and group ID (GID) of the client.
pid | A pointer to store the process ID (PID), or nullptr if not needed. |
uid | A pointer to store the user ID (UID), or nullptr if not needed. |
gid | A pointer to store the group ID (GID), or nullptr if not needed. |
|
noexcept |
Sends a ping event to the client.
This method sends a serial number to the client, which is expected to acknowledge it by invoking the pong()
virtual method.
It is primarily used to detect if a client is unresponsive.
false
, and you should not wait for a pong() response.serial | The serial number that the client must ACK when calling pong(). |
true
if the Ping event was sent successfully, false
if the client does not support this mechanism.
|
virtual |
|
noexcept |
Native wl_client
struct of the client.
This method returns a pointer to the native wl_client
struct associated with the client. The wl_client
struct is part of the original Wayland library.
|
noexcept |
Immediately flushes pending events.
Use this method to forcefully and immediately send any pending messages to the client.
|
noexcept |
Terminates the client connection with the compositor.
This method terminates the client's connection with the compositor, equivalent to invoking wl_client_destroy()
.
For safety reasons, it does not occur immediately but at the end of a main loop iteration.
|
noexcept |
Retrieves the client's event history.
This method returns a reference to a structure containing the most recent events that the compositor has sent to the client.
Initially, all events have a serial number of 0, indicating that the compositor has never sent that specific event type.
Finds an event sent by the compositor matching the given serial number.
This method searches for an event sent by the compositor with the specified serial number in the client's eventHistory().
If a matching event is found, a pointer to that event is returned, otherwise, nullptr
.
serial | The serial number to search for. |
nullptr
if not found.
|
noexcept |
Retrieves the last cursor requested by the client.
This method returns a reference to the last cursor that the client requested to set.
|
noexcept |
|
noexcept |
Resources created when the client binds to the wl_compositor singleton global of the Wayland protocol.
|
noexcept |
Resources created when the client binds to the wl_subcompositor global of the Wayland protocol.
|
noexcept |
Resources created when the client binds to the wl_seat global of the Wayland protocol.
|
noexcept |
Resource created when the client binds to the wl_data_device_manager singleton global of the Wayland protocol.
|
noexcept |
Resources created when the client binds to the xdg_wm_base global of the XdgShell protocol.
|
noexcept |
Resources created when the client binds to the zxdg_decoration_manager_v1 global of the XdgDecoration protocol.
The zxdg_decoration_manager_v1 interface allows the client and the compositor negotiate who should draw the decoration of toplevel surfaces.
|
noexcept |
Resources created when the client binds to the wp_presentation global of the PresentationTime protocol.
|
noexcept |
Resources created when the client binds to the zwp_linux_dmabuf_v1 global of the LinuxDMA-BUF protocol.
|
noexcept |
Resources created when the client binds to the wp_viewporter global of the Viewporter protocol.
|
noexcept |
Resources created when the client binds to the wp_fractional_scale_manager_v1 global of the FractionalScale protocol.
|
noexcept |
Resources created when the client binds to the zwlr_gamma_control_manager_v1 global of the wlroots Gamma Control protocol.
|
noexcept |
Resources created when the client binds to the wp_tearing_control_manager_v1 global of the Tearing Control protocol.
|
noexcept |
Resources created when the client binds to the zwp_relative_pointer_manager_v1 global of the Relative Pointer protocol.
|
noexcept |
Resources created when the client binds to the zwp_pointer_gestures_v1 global of the Pointer Gestures protocol.
|
noexcept |
Resources created when the client binds to the ext_session_lock_manager_v1 global of the Session Lock protocol.
|
noexcept |
Resources created when the client binds to the zwp_pointer_constraints_v1 global of the Pointer Constraints protocol.
|
noexcept |
Resources created when the client binds to the zxdg_output_manager_v1 global of the XDG Output protocol.
|
noexcept |
Resources created when the client binds to the zwlr_screencopy_manager_v1 global of the wlroots Screen Copy protocol.
|
noexcept |
Resources created when the client binds to the ext_output_image_capture_source_manager_v1 global of the Image Capture Source protocol.
|
noexcept |
Resources created when the client binds to the ext_foreign_toplevel_image_capture_source_manager_v1 global of the Image Capture Source protocol.
|
noexcept |
Resources created when the client binds to the zwlr_layer_shell_v1 global of the wlroots Layer Shell protocol.
|
noexcept |
Resources created when the client binds to the zwlr_foreign_toplevel_manager_v1 global of the wlroots Foreign Toplevel Management protocol.
|
noexcept |
Resources created when the client binds to the ext_foreign_toplevel_list_v1 global of the Foreign Toplevel List protocol.
|
noexcept |
Resources created when the client binds to the wp_single_pixel_buffer_manager_v1 global of the Single Pixel Buffer protocol.
|
noexcept |
Resources created when the client binds to the wp_content_type_manager_v1 global of the Content Type Hint protocol.
|
noexcept |
Resources created when the client binds to the ext_idle_notifier_v1 global of the Idle Notify protocol.
|
noexcept |
Resources created when the client binds to the zwp_idle_inhibit_manager_v1 global of the Idle Inhibit protocol.
|
noexcept |
Resources created when the client binds to the xdg_activation_v1 global of the XDG Activation protocol.