![]() |
Heaven v0.1.0-1
C++ global-menu library for Wayland sessions
|
Base class for all menu objects created by a client. More...
#include "HNObject.h"


Public Types | |
| enum | Type { Topbar , Menu , Action , Toggle , Divider } |
| Enumeration of the possible object roles. More... | |
Public Member Functions | |
| UInt32 | id () const noexcept |
| Returns the unique identifier of this object within the client. | |
| Type | type () const noexcept |
| Returns the immutable role/type of this object. | |
| std::shared_ptr< HNClient > | client () const noexcept |
| Returns the client that owns this object. | |
| ~HNObject () noexcept | |
| Destructor. Notifies the bar that the object was destroyed. | |
Data Fields | |
| CZSignal< HNObject * > | onClicked |
| Emitted when the bar notifies that this object was clicked. | |
Protected Member Functions | |
| HNObject (std::shared_ptr< HNClient > client, UInt32 id, Type type) noexcept | |
| Constructs an object owned by the given client. | |
Base class for all menu objects created by a client.
A client builds its menu tree out of HNObject subclasses (HNTopbar, HNMenu, HNAction, HNToggle, HNDivider). Objects are reference-counted through std::shared_ptr; destroying the last reference removes the object and, once connected, notifies the bar.
The role/type of an object is fixed at construction time.
| enum Type |
Constructs an object owned by the given client.
| client | Owning client. |
| id | Unique object identifier within the client. |
| type | Immutable object role. |
|
inlinenoexcept |
Returns the client that owns this object.
|
inlinenoexcept |
Returns the unique identifier of this object within the client.
|
inlinenoexcept |
Returns the immutable role/type of this object.
| CZSignal<HNObject*> onClicked |
Emitted when the bar notifies that this object was clicked.
| object | Pointer to the clicked object (this). |