guillaume 2026.6.1
A C++ UI framework designed for modern desktop and extended reality (XR) applications.
Loading...
Searching...
No Matches
app_bar.hpp
1/*
2 Copyright (c) 2026 ETIB Corporation
3
4 Permission is hereby granted, free of charge, to any person obtaining a copy of
5 this software and associated documentation files (the "Software"), to deal in
6 the Software without restriction, including without limitation the rights to
7 use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
8 of the Software, and to permit persons to whom the Software is furnished to do
9 so, subject to the following conditions:
10
11 The above copyright notice and this permission notice shall be included in all
12 copies or substantial portions of the Software.
13
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 SOFTWARE.
21 */
22
23#pragma once
24
25#include "guillaume/ecs/system_filler.hpp"
26
27#include "guillaume/components/app_bar.hpp"
28#include "guillaume/theme/typescale.hpp"
29
30namespace guillaume::systems
31{
58 class AppBar: public ecs::SystemFiller<components::AppBar>
59 {
60 public:
64 AppBar(void);
65
69 ~AppBar(void) override = default;
70
82 static void
83 installTitle(ecs::ComponentRegistry &componentRegistry,
84 const ecs::Entity::Identifier &entityIdentifier);
85
103 static void apply(ecs::ComponentRegistry &componentRegistry,
104 const ecs::Entity::Identifier &entityIdentifier);
105
112 static float height(components::AppBar::Variant variant);
113
122
131 static bool needsNavigationButton(
132 const ecs::ComponentRegistry &componentRegistry,
133 const ecs::Entity::Identifier &entityIdentifier);
134
142 static bool needsTitle(const ecs::ComponentRegistry &componentRegistry,
143 const ecs::Entity::Identifier &entityIdentifier);
144
154 static bool
155 needsActionButtons(const ecs::ComponentRegistry &componentRegistry,
156 const ecs::Entity::Identifier &entityIdentifier);
157
165 void update(const ecs::Entity::Identifier &entityIdentifier) override;
166 };
167
168} // namespace guillaume::systems
Variant
Shape of the bar. It sets the height and the title size.
Definition app_bar.hpp:64
Stores every component of a scene, per component type and per entity identifier, and knows which ones...
std::size_t Identifier
The key under which an entity's components are stored. Systems and components refer to entities by th...
Definition entity.hpp:86
The base class to derive a system from: a System whose signature is the list of component types given...
static bool needsNavigationButton(const ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier)
Whether the navigation button child still has to be created.
Definition app_bar.cpp:165
static theme::TypeRole titleRole(components::AppBar::Variant variant)
Get the typescale role the title of a variant is drawn with.
Definition app_bar.cpp:150
static bool needsActionButtons(const ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier)
Whether the action button children have to be created again.
Definition app_bar.cpp:186
static void installTitle(ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier)
Expose the title child to assistive technology as a header.
Definition app_bar.cpp:113
static bool needsTitle(const ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier)
Whether the title child still has to be created.
Definition app_bar.cpp:176
static float height(components::AppBar::Variant variant)
Get the fixed height of a variant.
Definition app_bar.cpp:132
static void apply(ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier)
Style one app bar and arrange its children.
Definition app_bar.cpp:196
AppBar(void)
Create the system in the Layout phase.
Definition app_bar.cpp:108
~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.
Definition app_bar.cpp:257
Rules. Every class here runs each frame on the entities that have the components it declares.
TypeRole
The named text styles of Material Design 3: what a piece of text is, not how big it is.
Definition typescale.hpp:47