|
guillaume 2026.6.1
A C++ UI framework designed for modern desktop and extended reality (XR) applications.
|
Configures View widgets and registers them in the scene's entity registry. More...
#include <headers/guillaume/entities/view.hpp>


Public Member Functions | |
| Builder (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry) | |
| Construct a builder holding the defaults of reset(). | |
| std::shared_ptr< View > | buildEntity (void) override |
| Build a view from the current configuration, without registering it or giving it a parent. | |
| void | reset (void) override |
| Restore the defaults: default pose, transparent background, corner radius 16 dp, horizontal axis, main axis alignment Start, cross axis alignment Center, spacing 8 dp, padding 16 dp, no fixed width or height, and no entity. | |
| Builder & | withPose (const utility::graphic::PoseF &pose) |
| Set where the view is. | |
| Builder & | withColor (const utility::graphic::Color32Bit &color) |
| Set the background color. | |
| Builder & | withBorderRadius (float borderRadius) |
| Set the corner radius of the background. | |
| Builder & | withAxis (Axis axis) |
| Choose between a row and a column. | |
| Builder & | withMainAxisAlignment (MainAxisAlignment alignment) |
| Set how the children are distributed along the axis. | |
| Builder & | withCrossAxisAlignment (CrossAxisAlignment alignment) |
| Set how each child is aligned across the axis. | |
| Builder & | withSpacing (float spacing) |
| Set the gap between two consecutive children. | |
| Builder & | withPadding (float padding) |
| Set the space between the edges of the view and its children. | |
| Builder & | withFixedWidth (float width) |
| Force the width of the view. | |
| Builder & | withFixedHeight (float height) |
| Force the height of the view. | |
| Builder & | withEntities (const std::vector< std::shared_ptr< ecs::Entity > > &entities) |
| Set the entities the view arranges, in layout order. | |
| std::shared_ptr< View > | makeDefaultView (std::shared_ptr< Entity > parent, const utility::graphic::PoseF &pose, const std::vector< std::shared_ptr< ecs::Entity > > &entities) |
| Build a transparent view, register it under parent and reset the builder. | |
| std::shared_ptr< View > | makeColorView (std::shared_ptr< Entity > parent, const utility::graphic::PoseF &pose, const utility::graphic::Color32Bit &color, const std::vector< std::shared_ptr< ecs::Entity > > &entities) |
| Build a view with a background color, register it under parent and reset the builder. | |
| Public Member Functions inherited from guillaume::entities::EntityBuilderBase< View > | |
| EntityBuilderBase (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry) | |
| Construct a builder bound to two registries. | |
| ~EntityBuilderBase (void) override=default | |
| Default destructor. | |
| std::shared_ptr< View > | 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 View widgets and registers them in the scene's entity registry.
| guillaume::entities::View::Builder::Builder | ( | ecs::ComponentRegistry & | componentRegistry, |
| ecs::EntityRegistry & | entityRegistry ) |
Construct a builder holding the defaults of reset().
| componentRegistry | The registry the components of the built views are stored in. |
| entityRegistry | The registry that owns the views built by the make... methods. |
Definition at line 35 of file view.cpp.

|
overridevirtual |
Build a view from the current configuration, without registering it or giving it a parent.
The entities of withEntities() are parented to the new view and arranged.
Implements guillaume::entities::EntityBuilderBase< View >.
Definition at line 42 of file view.cpp.

| std::shared_ptr< View > guillaume::entities::View::Builder::makeColorView | ( | std::shared_ptr< Entity > | parent, |
| const utility::graphic::PoseF & | pose, | ||
| const utility::graphic::Color32Bit & | color, | ||
| const std::vector< std::shared_ptr< ecs::Entity > > & | entities ) |
Build a view with a background color, register it under parent and reset the builder.
| parent | The entity the view is attached to, or nullptr for a root entity. |
| pose | The pose of the top-left corner of the view. |
| color | The background color (RGBA). |
| entities | The entities to arrange, in layout order. They are parented to the view; each must be owned by an entity registry. May be empty. |
Definition at line 148 of file view.cpp.

| std::shared_ptr< View > guillaume::entities::View::Builder::makeDefaultView | ( | std::shared_ptr< Entity > | parent, |
| const utility::graphic::PoseF & | pose, | ||
| const std::vector< std::shared_ptr< ecs::Entity > > & | entities ) |
Build a transparent view, register it under parent and reset the builder.
The background stays transparent unless withColor() was called. The other settings of the with... methods apply.
| parent | The entity the view is attached to, or nullptr for a root entity. |
| pose | The pose of the top-left corner of the view. |
| entities | The entities to arrange, in layout order. They are parented to the view; each must be owned by an entity registry. May be empty. |
Definition at line 141 of file view.cpp.

|
overridevirtual |
Restore the defaults: default pose, transparent background, corner radius 16 dp, horizontal axis, main axis alignment Start, cross axis alignment Center, spacing 8 dp, padding 16 dp, no fixed width or height, and no entity.
Implements guillaume::ecs::EntityBuilder.
Definition at line 52 of file view.cpp.

| View::Builder & guillaume::entities::View::Builder::withAxis | ( | Axis | axis | ) |
| View::Builder & guillaume::entities::View::Builder::withBorderRadius | ( | float | borderRadius | ) |
| View::Builder & guillaume::entities::View::Builder::withColor | ( | const utility::graphic::Color32Bit & | color | ) |
| View::Builder & guillaume::entities::View::Builder::withCrossAxisAlignment | ( | CrossAxisAlignment | alignment | ) |
| View::Builder & guillaume::entities::View::Builder::withEntities | ( | const std::vector< std::shared_ptr< ecs::Entity > > & | entities | ) |
Set the entities the view arranges, in layout order.
The builder keeps the pointers only until the view is built. The view does not own them either: each entity must be owned by an entity registry.
| entities | The entities to arrange. Null entries are skipped. Empty by default. |
| View::Builder & guillaume::entities::View::Builder::withFixedHeight | ( | float | height | ) |
| View::Builder & guillaume::entities::View::Builder::withFixedWidth | ( | float | width | ) |
| View::Builder & guillaume::entities::View::Builder::withMainAxisAlignment | ( | MainAxisAlignment | alignment | ) |
Set how the children are distributed along the axis.
| alignment | Start, Center, End or SpaceBetween. Start by default. It only shows when the view is larger than its content, that is with a fixed size on that axis. |
| View::Builder & guillaume::entities::View::Builder::withPadding | ( | float | padding | ) |
| View::Builder & guillaume::entities::View::Builder::withPose | ( | const utility::graphic::PoseF & | pose | ) |
| View::Builder & guillaume::entities::View::Builder::withSpacing | ( | float | spacing | ) |