|
guillaume 2026.6.1
A C++ UI framework designed for modern desktop and extended reality (XR) applications.
|
A thin horizontal line separating two pieces of content. More...
#include <headers/guillaume/entities/divider.hpp>


Classes | |
| class | Builder |
| Configures Divider widgets and registers them in the scene's entity registry. More... | |
Public Types | |
| using | Variant = components::Divider::Variant |
| Which ends of the line are shortened by the inset: FullWidth (none), Inset (leading end) or Middle (both). | |
| Public Types inherited from guillaume::ecs::Entity | |
| using | Identifier = std::size_t |
| The key under which an entity's components are stored. Systems and components refer to entities by this value. | |
| using | Signature = std::bitset<128> |
| A set of component types, one bit per type (bit position given by ComponentTypeId, MaxComponentTypes bits). | |
Public Member Functions | |
| ~Divider (void) override | |
| Destructor. | |
| Divider & | setVariant (Variant variant) |
| Choose which ends of the line are inset. Moves and resizes the line at once. | |
| Divider & | setLength (float length) |
| Set the total length. Resizes the line at once. | |
| Divider & | setThickness (float thickness) |
| Set the stroke thickness. Restyles at once. | |
| Divider & | setBold (bool bold) |
| Switch between the hairline and the bold stroke (Paper bold). Restyles at once. | |
| bool | isBold (void) const |
| Check whether the divider uses the bold stroke. | |
| Divider & | setInset (float inset) |
| Set how much an inset end is shortened. Moves and resizes the line at once. | |
| Divider & | setColor (const utility::graphic::Color32Bit &color) |
| Set the stroke color. Restyles at once. | |
| Variant | getVariant (void) const |
| Tell which ends of the line are inset. | |
| Public Member Functions inherited from guillaume::ecs::EntityFiller< components::Transform, components::Bound, components::Color, components::Line, components::Divider > | |
| EntityFiller (ComponentRegistry &componentRegistry) | |
| Create the entity, its listed components and its components::Hierarchy. | |
| virtual | ~EntityFiller (void)=default |
| Destroy the entity object; its components stay in the registry (see EntityRegistry::removeEntity). | |
| Public Member Functions inherited from guillaume::ecs::Entity | |
| Entity (void) | |
| Create an entity with a fresh identifier, an empty signature, no parent and no component. | |
| virtual | ~Entity (void)=default |
| Destroy the entity object. | |
| Entity::Identifier | getIdentifier (void) const noexcept |
| Get the identifier of the entity. | |
| Entity::Signature | getSignature (void) const noexcept |
| Get the set of component types the entity declares. | |
| void | setSignature (const Signature &signature) |
| Replace the signature of the entity. | |
| std::int32_t | getLayer (void) const noexcept |
| Get the depth of the entity in the tree. | |
| Entity & | setParent (std::shared_ptr< Entity > parent) |
| Attach the entity under another one, or detach it. | |
| std::vector< Identifier > | releaseComponents (void) |
| Drop the entity's place in the tree and all its components. | |
| std::shared_ptr< Entity > | getParent (void) const noexcept |
| Get the parent entity. | |
Static Public Member Functions | |
| template<typename... Arguments> | |
| static std::shared_ptr< Divider > | create (Arguments &&...arguments) |
| Build a divider without registering it in an entity registry. | |
| Static Public Member Functions inherited from guillaume::ecs::Entity | |
| template<InheritFromComponent... ComponentTypes> | |
| static Signature | getSignatureFromTypes (void) |
| Build the signature that has exactly the bits of the given component types. | |
Static Public Attributes | |
| static constexpr float | HairlineThickness |
| Default stroke thickness, in dp: a hairline (Paper StyleSheet.hairlineWidth on a 2x display). | |
| static constexpr float | BoldThickness |
| Stroke thickness of a bold divider, in dp (Paper bold). | |
| Static Public Attributes inherited from guillaume::ecs::Entity | |
| static constexpr Identifier | InvalidIdentifier |
| "No entity": never the identifier of a real entity | |
Additional Inherited Members | |
| Protected Member Functions inherited from guillaume::ecs::EntityFiller< components::Transform, components::Bound, components::Color, components::Line, components::Divider > | |
| ComponentRegistry & | getComponentRegistry (void) |
| Get the registry that stores this entity's components. | |
| Protected Member Functions inherited from guillaume::ecs::Entity | |
| void | attachHierarchy (ComponentRegistry &componentRegistry) |
| Give the entity a components::Hierarchy in a registry and add that component to its signature. | |
| template<InheritFromComponent... ComponentTypes> | |
| void | setSignature (void) |
| Replace the signature by the one made of the given component types. | |
A thin horizontal line separating two pieces of content.
Divider is a leaf widget: it has no children. Its state lives in components::Divider (variant, length, thickness, inset, color, origin pose); systems::Divider turns it into the entity's Transform, Bound, Line and Color each frame, in the Measure phase, and systems::LineRender draws the stroke. The class itself holds no field: its setters write the component and run systems::Divider at once.
The variant chooses which ends are shortened by the inset:
Divider::create(registry, pose, color, length, thickness, inset, variant) builds the same widget without registering it in an entity registry.
Watch out:
Definition at line 84 of file divider.hpp.
Which ends of the line are shortened by the inset: FullWidth (none), Inset (leading end) or Middle (both).
Definition at line 94 of file divider.hpp.
|
override |
Destructor.
Definition at line 127 of file divider.cpp.
|
inlinestatic |
Build a divider without registering it in an entity registry.
The arguments are forwarded to the private constructor: (registry, pose, color, length, thickness, inset, variant). A divider has no children to build.
| Arguments | The constructor argument types. |
| arguments | The constructor arguments, as listed above. |
Definition at line 228 of file divider.hpp.

| Divider::Variant guillaume::entities::Divider::getVariant | ( | void | ) | const |
Tell which ends of the line are inset.
Definition at line 193 of file divider.cpp.
| bool guillaume::entities::Divider::isBold | ( | void | ) | const |
Check whether the divider uses the bold stroke.
Definition at line 174 of file divider.cpp.
| Divider & guillaume::entities::Divider::setBold | ( | bool | bold | ) |
Switch between the hairline and the bold stroke (Paper bold). Restyles at once.
| bold | True for BoldThickness (1 dp), false for HairlineThickness (0.5 dp). |
Definition at line 169 of file divider.cpp.

| Divider & guillaume::entities::Divider::setColor | ( | const utility::graphic::Color32Bit & | color | ) |
Set the stroke color. Restyles at once.
| color | The new color (RGBA). |
Definition at line 186 of file divider.cpp.


| Divider & guillaume::entities::Divider::setInset | ( | float | inset | ) |
Set how much an inset end is shortened. Moves and resizes the line at once.
| inset | The new inset, in dp. It has no effect with the FullWidth variant. |
Definition at line 179 of file divider.cpp.


| Divider & guillaume::entities::Divider::setLength | ( | float | length | ) |
Set the total length. Resizes the line at once.
| length | The new length, insets included, in dp. The drawn line is this length minus the insets of the variant, and never negative. |
Definition at line 155 of file divider.cpp.


| Divider & guillaume::entities::Divider::setThickness | ( | float | thickness | ) |
Set the stroke thickness. Restyles at once.
| thickness | The new thickness, in dp. |
Definition at line 162 of file divider.cpp.


| Divider & guillaume::entities::Divider::setVariant | ( | Variant | variant | ) |
Choose which ends of the line are inset. Moves and resizes the line at once.
| variant | The new variant. |
Definition at line 148 of file divider.cpp.


|
staticconstexpr |
Stroke thickness of a bold divider, in dp (Paper bold).
Definition at line 106 of file divider.hpp.
|
staticconstexpr |
Default stroke thickness, in dp: a hairline (Paper StyleSheet.hairlineWidth on a 2x display).
Definition at line 100 of file divider.hpp.