27#include "guillaume/ecs/system_filler.hpp"
29#include "guillaume/components/chip.hpp"
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...
The base class to derive a system from: a System whose signature is the list of component types given...
~Chip(void) override=default
Default destructor.
void update(const ecs::Entity::Identifier &entityIdentifier) override
Frame entry point: call apply on one chip.
static void setDisabled(ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier, bool disabled)
Enable or disable the chip and show it at once.
Chip(void)
Create the system for the Layout phase, matching entities that have a components::Chip.
static void apply(ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier)
Draw one chip from its components and arrange its children.
static bool needsCheckIcon(const ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier)
Whether the widget class should build a selected check child for this chip.
static void press(ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier)
Press the chip as a click does.
static bool needsCloseIcon(const ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier)
Whether the widget class should build a trailing close icon child for this chip.
static std::string leadingGlyph(const ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier)
Get the name of the glyph the leading icon of the chip should show.
static void install(ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier)
Make an entity behave as a chip.
static bool isDisabled(const ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier)
Whether the chip ignores input and is drawn disabled.
static void close(ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier)
Press the close icon of the chip as a click does.
static void installCloseIcon(ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier)
Make the trailing icon of a chip a close button.
static bool isSelected(const ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier)
Whether the chip is selected.
static void setSelected(ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier, bool selected)
Select or deselect the chip from code and show it at once.
Rules. Every class here runs each frame on the entities that have the components it declares.