guillaume 2026.6.1
A C++ UI framework designed for modern desktop and extended reality (XR) applications.
Loading...
Searching...
No Matches
progress_indicator.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 <utility/graphic/color.hpp>
26
27#include "guillaume/ecs/system_filler.hpp"
28
29#include "guillaume/components/progress_indicator.hpp"
30
31namespace guillaume::systems
32{
72 public ecs::SystemFiller<components::ProgressIndicator>
73 {
74 public:
79
83 ~ProgressIndicator(void) override = default;
84
108 static void install(ecs::ComponentRegistry &componentRegistry,
109 const ecs::Entity::Identifier &entityIdentifier);
110
125 static void
126 installChildren(ecs::ComponentRegistry &componentRegistry,
127 const ecs::Entity::Identifier &entityIdentifier);
128
152 static void apply(ecs::ComponentRegistry &componentRegistry,
153 const ecs::Entity::Identifier &entityIdentifier);
154
166 static void setValue(ecs::ComponentRegistry &componentRegistry,
167 const ecs::Entity::Identifier &entityIdentifier,
168 float value);
169
180 static void setVisible(ecs::ComponentRegistry &componentRegistry,
181 const ecs::Entity::Identifier &entityIdentifier,
182 bool visible);
183
196 static void
197 startTransition(ecs::ComponentRegistry &componentRegistry,
198 const ecs::Entity::Identifier &entityIdentifier);
199
207 static utility::graphic::Color32Bit
208 indicatorColor(const ecs::ComponentRegistry &componentRegistry,
209 const ecs::Entity::Identifier &entityIdentifier);
210
219 void update(const ecs::Entity::Identifier &entityIdentifier) override;
220 };
221
222} // namespace guillaume::systems
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 void setVisible(ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier, bool visible)
Show or hide the indicator with a fade.
static void startTransition(ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier)
Start moving the drawn value and opacity towards their targets.
static void install(ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier)
Prepare the value, the transition and the accessibility role of a progress indicator.
static void setValue(ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier, float value)
Set the target value.
ProgressIndicator(void)
Create the system in the Layout phase.
static void installChildren(ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier)
Wire the looping animation of an indeterminate indicator and start it.
void update(const ecs::Entity::Identifier &entityIdentifier) override
Run apply() on one progress indicator; called by the frame loop.
static void apply(ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier)
Size one progress indicator and draw its track and fill from the displayed value, the cycle position ...
static utility::graphic::Color32Bit indicatorColor(const ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier)
Get the color of the fill at full opacity.
~ProgressIndicator(void) override=default
Default destructor.
Rules. Every class here runs each frame on the entities that have the components it declares.