|
guillaume 2026.6.1
A C++ UI framework designed for modern desktop and extended reality (XR) applications.
|
Configures and registers Surface widgets. More...
#include <headers/guillaume/entities/surface.hpp>


Public Member Functions | |
| Builder (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry) | |
| Construct a builder set to the defaults of reset(). | |
| std::shared_ptr< Surface > | buildEntity (void) override |
| Create a surface from the current configuration, without attaching nor registering it. | |
| void | reset (void) override |
| Restore the defaults: elevation level 1, a shadow (Mode::Elevated), square corners, children in a column aligned at the start and centered across, no spacing, no padding, no fixed size, default pose. | |
| Builder & | withPose (const utility::graphic::PoseF &pose) |
| Set where the surface is. | |
| Builder & | withElevation (theme::ElevationLevel elevation) |
| Set the elevation level, which tints the background and sizes the shadow. | |
| Builder & | withMode (Mode mode) |
| Choose whether the surface casts a shadow. | |
| Builder & | withShape (theme::ShapeRole role) |
| Set the corner radius from a shape role of the theme. | |
| Builder & | withConfig (const SurfaceConfig &config) |
| Replace the layout configuration: axis, alignment, spacing, padding, fixed size and corner radius. | |
| std::shared_ptr< Surface > | makeSurface (std::shared_ptr< ecs::Entity > parent, theme::ElevationLevel elevation, Mode mode=Mode::Elevated) |
| Build a surface with the given elevation and register it under a parent. | |
| Public Member Functions inherited from guillaume::entities::EntityBuilderBase< Surface > | |
| EntityBuilderBase (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry) | |
| Construct a builder bound to two registries. | |
| ~EntityBuilderBase (void) override=default | |
| Default destructor. | |
| std::shared_ptr< Surface > | registerEntity (std::shared_ptr< ecs::Entity > parent) |
| Build the widget, attach it to its parent, hand it to the entity registry, then reset the builder to its defaults. | |
| Public Member Functions inherited from guillaume::ecs::EntityBuilder | |
| EntityBuilder (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry) | |
| Create a builder working on a pair of registries, normally those of one scene. | |
| virtual | ~EntityBuilder (void)=default |
| Virtual destructor. | |
Additional Inherited Members | |
| Protected Member Functions inherited from guillaume::ecs::EntityBuilder | |
| ComponentRegistry & | getComponentRegistry (void) |
| Get the registry in which the builder creates components. | |
| EntityRegistry & | getEntityRegistry (void) |
| Get the registry in which the builder registers the entities it creates. | |
Configures and registers Surface widgets.
Definition at line 402 of file surface.hpp.
| guillaume::entities::Surface::Builder::Builder | ( | ecs::ComponentRegistry & | componentRegistry, |
| ecs::EntityRegistry & | entityRegistry ) |
Construct a builder set to the defaults of reset().
| componentRegistry | The registry that stores the components of the surfaces built. |
| entityRegistry | The registry that owns the surfaces built. |
Definition at line 118 of file surface.cpp.


|
overridevirtual |
Create a surface from the current configuration, without attaching nor registering it.
Implements guillaume::entities::EntityBuilderBase< Surface >.
Definition at line 125 of file surface.cpp.

| std::shared_ptr< Surface > guillaume::entities::Surface::Builder::makeSurface | ( | std::shared_ptr< ecs::Entity > | parent, |
| theme::ElevationLevel | elevation, | ||
| Mode | mode = Mode::Elevated ) |
Build a surface with the given elevation and register it under a parent.
The other settings are those given with the with...() methods. The builder is back to its defaults afterwards.
| parent | The entity the surface becomes a child of, or nullptr. |
| elevation | The elevation level, from Level0 to Level5. |
| mode | Elevated for a shadow, Flat for none. |
Definition at line 175 of file surface.cpp.

|
overridevirtual |
Restore the defaults: elevation level 1, a shadow (Mode::Elevated), square corners, children in a column aligned at the start and centered across, no spacing, no padding, no fixed size, default pose.
Implements guillaume::ecs::EntityBuilder.
Definition at line 131 of file surface.cpp.


| Surface::Builder & guillaume::entities::Surface::Builder::withConfig | ( | const SurfaceConfig & | config | ) |
Replace the layout configuration: axis, alignment, spacing, padding, fixed size and corner radius.
The pose already given to the builder is kept, so call withShape() after this method, not before. The color of the configuration has no lasting effect: the fill color comes from the elevation.
| config | The configuration to copy, except its pose. |
Definition at line 166 of file surface.cpp.
| Surface::Builder & guillaume::entities::Surface::Builder::withElevation | ( | theme::ElevationLevel | elevation | ) |
Set the elevation level, which tints the background and sizes the shadow.
| elevation | The level, from Level0 to Level5 (default: Level1). |
Definition at line 148 of file surface.cpp.

| Surface::Builder & guillaume::entities::Surface::Builder::withMode | ( | Mode | mode | ) |
Choose whether the surface casts a shadow.
| mode | Elevated for a shadow, Flat for none (default: Elevated). |
Definition at line 154 of file surface.cpp.
| Surface::Builder & guillaume::entities::Surface::Builder::withPose | ( | const utility::graphic::PoseF & | pose | ) |
Set where the surface is.
| pose | The position and orientation (default: the default pose). |
Definition at line 141 of file surface.cpp.
| Surface::Builder & guillaume::entities::Surface::Builder::withShape | ( | theme::ShapeRole | role | ) |
Set the corner radius from a shape role of the theme.
| role | The shape role, such as theme::ShapeRole::Medium (default: None, square corners). |
Definition at line 160 of file surface.cpp.
