Heaven v0.1.0-1
C++ global-menu library for Wayland sessions
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Data Fields
HNCompositor Class Reference

Core class representing a Wayland compositor integration. More...

#include "HNCompositor.h"

Inheritance diagram for HNCompositor:
Inheritance graph
[legend]
Collaboration diagram for HNCompositor:
Collaboration graph
[legend]

Public Member Functions

void setActiveClient (const std::string &dbusId) noexcept
 Sets the currently active client.
 

Static Public Member Functions

static std::shared_ptr< HNCompositorGetOrMake () noexcept
 Retrieves the singleton compositor instance, creating it if necessary.
 
static std::shared_ptr< HNCompositorGet () noexcept
 Retrieves the existing compositor instance.
 

Data Fields

CZSignal< const char *, const char * > onClientRegistered
 Emitted when a Wayland client is registered.
 

Detailed Description

Core class representing a Wayland compositor integration.

This class acts as the bridge between a Wayland compositor and the bar application. It is responsible for:

Member Function Documentation

◆ Get()

static std::shared_ptr< HNCompositor > Get ( )
staticnoexcept

Retrieves the existing compositor instance.

Returns
Shared pointer to the compositor instance, or nullptr if not yet created.

◆ GetOrMake()

static std::shared_ptr< HNCompositor > GetOrMake ( )
staticnoexcept

Retrieves the singleton compositor instance, creating it if necessary.

Returns
Shared pointer to the compositor instance, or nullptr on failure.

◆ setActiveClient()

void setActiveClient ( const std::string &  dbusId)
noexcept

Sets the currently active client.

This notifies the bar application which client should be considered active.

Parameters
dbusIdThe DBus identifier of the active client. Passing an empty string ("") clears the active client.

Field Documentation

◆ onClientRegistered

CZSignal<const char* , const char* > onClientRegistered

Emitted when a Wayland client is registered.

This signal provides the association between:

  • A compositor-specific private handle (sent to the Wayland client via a the private handle protocol), and
  • The corresponding DBus identifier used by the bar application.

The compositor should store this mapping and later use the DBus identifier when calling setActiveClient().

Parameters
privateHandleOpaque identifier used internally by the compositor to reference the Wayland client.
dbusIdDBus identifier associated with the client.

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