27#include "guillaume/ecs/component.hpp"
59 using Handler = std::function<void(
void)>;
64 bool _focused {
false };
std::function< void(void)> Handler
Focus change callback.
Focus(void)=default
Construct an unfocused component without handler.
void setOnFocusLostHandler(const Handler &handler)
Store the callback run when the entity loses the focus.
bool isFocused(void) const
Check whether the entity owns the input focus.
~Focus(void)=default
Default destructor.
Handler getOnFocusLostHandler(void) const
Get the callback run when the entity loses the focus.
Handler getOnFocusGainedHandler(void) const
Get the callback run when the entity gains the focus.
void setFocused(bool focused)
Record whether the entity owns the input focus.
void setOnFocusGainedHandler(const Handler &handler)
Store the callback run when the entity gains the focus.
Base class of every component: a piece of state attached to an entity, plus a "changed" flag.
State. Every class here is plain data attached to an entity.