|
guillaume 2026.6.1
A C++ UI framework designed for modern desktop and extended reality (XR) applications.
|
Styles an app bar and lays out its navigation button, title and action buttons in a row. More...
#include <headers/guillaume/systems/app_bar.hpp>


Public Member Functions | |
| AppBar (void) | |
| Create the system in the Layout phase. | |
| ~AppBar (void) override=default | |
| Default destructor. | |
| void | update (const ecs::Entity::Identifier &entityIdentifier) override |
| Run apply() on one app bar; called by the frame loop. | |
| Public Member Functions inherited from guillaume::ecs::SystemFiller< components::AppBar > | |
| SystemFiller (Phase phase) | |
| Create the system and set its signature from ComponentTypes. | |
| virtual | ~SystemFiller (void)=default |
| Virtual destructor. | |
| Public Member Functions inherited from guillaume::ecs::System | |
| System (Phase phase) | |
| Create a system that runs in a given phase, with an empty signature. | |
| virtual | ~System (void)=default |
| Virtual destructor. | |
| Phase | getPhase (void) const noexcept |
| Get the phase of the frame in which the system runs. | |
| Entity::Signature | getSignature (void) const noexcept |
| Get the component types an entity must declare to be visited by this system. | |
| void | routine (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry, const ecs::EntityTreeTraveler &traveler) |
| Run the system once over a scene: prepare(), update() on each matching entity, cleanup(). | |
| void | bindComponentRegistry (ecs::ComponentRegistry &componentRegistry) |
| Bind a component registry so update() can be called directly, without routine(). | |
| void | unbindComponentRegistry (void) |
| Drop the binding made by bindComponentRegistry(). | |
| virtual void | prepare (void) |
| Called once per pass, before the first update(). | |
| virtual void | cleanup (void) |
| Called once per pass, after the last update(). | |
Static Public Member Functions | |
| static void | installTitle (ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier) |
| Expose the title child to assistive technology as a header. | |
| static void | apply (ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier) |
| Style one app bar and arrange its children. | |
| static float | height (components::AppBar::Variant variant) |
| Get the fixed height of a variant. | |
| static theme::TypeRole | titleRole (components::AppBar::Variant variant) |
| Get the typescale role the title of a variant is drawn with. | |
| static bool | needsNavigationButton (const ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier) |
| Whether the navigation button child still has to be created. | |
| static bool | needsTitle (const ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier) |
| Whether the title child still has to be created. | |
| static bool | needsActionButtons (const ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier) |
| Whether the action button children have to be created again. | |
Additional Inherited Members | |
| Protected Member Functions inherited from guillaume::ecs::System | |
| template<InheritFromComponent... ComponentTypes> | |
| void | setSignature (void) |
| Replace the signature by the one made of the given component types. | |
| ecs::EntityRegistry & | getEntityRegistry (void) |
| Get the entity registry of the scene being processed. | |
| const ecs::EntityRegistry & | getEntityRegistry (void) const |
| Get the entity registry of the scene being processed, read-only. | |
| ecs::ComponentRegistry & | getComponentRegistry (void) |
| Get the component registry of the scene being processed. | |
| const ecs::ComponentRegistry & | getComponentRegistry (void) const |
| Get the component registry of the scene being processed, read-only. | |
| template<InheritFromComponent ComponentType> | |
| bool | hasComponent (const ecs::Entity::Identifier &entityIdentifier) const |
| Tell whether an entity has a component, in the bound registry. | |
| template<InheritFromComponent ComponentType> | |
| ComponentType & | getComponent (const ecs::Entity::Identifier &entityIdentifier) |
| Get a component of an entity from the bound registry, to read or modify it. | |
| template<InheritFromComponent ComponentType> | |
| const ComponentType & | getComponent (const ecs::Entity::Identifier &entityIdentifier) const |
| Get a component of an entity from the bound registry, read-only. | |
| template<InheritFromComponent ComponentType> | |
| bool | requireComponent (const ecs::Entity::Identifier &entityIdentifier) |
| Tell whether an entity has a component, and log a warning naming the entity and the component when it does not. | |
Styles an app bar and lays out its navigation button, title and action buttons in a row.
Runs in the Layout phase on every entity that has a components::AppBar. It is registered after systems::Layout, so the children are already measured when it arranges them.
A system cannot create entities: entities::AppBar builds the children and records their identifiers in components::AppBar. The needs... functions tell it which children are still missing.
The bar needs components::Layout, Color and Elevation next to its components::AppBar: apply() throws ecs::EntityComponentNotFoundException when one is missing.
Definition at line 58 of file app_bar.hpp.
| guillaume::systems::AppBar::AppBar | ( | void | ) |
Create the system in the Layout phase.
Definition at line 108 of file app_bar.cpp.


|
static |
Style one app bar and arrange its children.
This is what update() runs each frame. Call it directly after changing components::AppBar to see the result before the next frame, which is what the setters of entities::AppBar do, or to drive an app bar in a test without a frame loop.
The children are laid out in the order navigation button, title, action buttons, skipping the ones that do not exist. A center-aligned bar centers a lone title and otherwise spreads its children across the bar.
| componentRegistry | The registry holding the components. |
| entityIdentifier | The app bar entity. |
| ecs::EntityComponentNotFoundException | When the entity lacks components::AppBar, Layout, Color or Elevation. |
Definition at line 196 of file app_bar.cpp.


|
static |
Get the fixed height of a variant.
| variant | The app bar variant. |
Definition at line 132 of file app_bar.cpp.

|
static |
Expose the title child to assistive technology as a header.
Adds a components::Accessibility to the title entity recorded in components::AppBar when it has none, sets its role to Header and its label to the title text, and makes it non-focusable. Call it once, right after the title child has been created and recorded. Does nothing when no title child is recorded.
| componentRegistry | The registry holding the components. |
| entityIdentifier | The app bar entity. |
Definition at line 113 of file app_bar.cpp.

|
static |
Whether the action button children have to be created again.
| componentRegistry | The registry holding the components. |
| entityIdentifier | The app bar entity. |
Definition at line 186 of file app_bar.cpp.

|
static |
Whether the navigation button child still has to be created.
| componentRegistry | The registry holding the components. |
| entityIdentifier | The app bar entity. |
Definition at line 165 of file app_bar.cpp.

|
static |
Whether the title child still has to be created.
| componentRegistry | The registry holding the components. |
| entityIdentifier | The app bar entity. |
Definition at line 176 of file app_bar.cpp.

|
static |
Get the typescale role the title of a variant is drawn with.
| variant | The app bar variant. |
Definition at line 150 of file app_bar.cpp.
|
overridevirtual |
Run apply() on one app bar; called by the frame loop.
Logs a warning and does nothing when the entity has no components::AppBar.
| entityIdentifier | The app bar entity. |
Implements guillaume::ecs::System.
Definition at line 257 of file app_bar.cpp.
