1 #ifndef TERMOX_TERMINAL_DYNAMIC_COLOR_ENGINE_HPP
2 #define TERMOX_TERMINAL_DYNAMIC_COLOR_ENGINE_HPP
6 #include <termox/common/lockable.hpp>
7 #include <termox/common/timer.hpp>
8 #include <termox/painter/color.hpp>
9 #include <termox/system/event_loop.hpp>
10 #include <termox/system/event_queue.hpp>
17 using Clock_t = Timer::Clock_t;
18 using Duration_t = Timer::Duration_t;
19 using Time_point = Timer::Time_point;
24 Time_point last_event_time;
27 static auto constexpr default_interval = Duration_t{100};
42 [[nodiscard]]
auto is_empty() const ->
bool;
51 std::vector<Registered_data> data_;
57 auto get_dynamic_color_event() -> Dynamic_color_event;
60 void loop_function(Event_queue& queue);
Color numbers [0 - 180] are valid.
Definition: color.hpp:16
Event loop that manages posting of Dynamic_color_events.
Definition: dynamic_color_engine.hpp:15
auto is_empty() const -> bool
Return true if there are no registered widgets.
Definition: dynamic_color_engine.cpp:38
void start()
Start another thread that waits on intervals and sents Events.
Definition: dynamic_color_engine.cpp:44
void stop()
Sends exit signal and waits for animation thread to exit.
Definition: dynamic_color_engine.cpp:49
void clear()
Remove all registered colors.
Definition: dynamic_color_engine.cpp:32
void register_color(Color color, Dynamic_color const &dynamic)
Add a dynamic color linked to color.
Definition: dynamic_color_engine.cpp:15
void unregister_color(Color color)
Removes the Dynamic_color linked to color.
Definition: dynamic_color_engine.cpp:22
Calls on loop_function(), and then processes the Event_queue.
Definition: event_loop.hpp:17
Definition: lockable.hpp:8
Timer class where begin() and wait() are used to block for a given interval.
Definition: timer.hpp:10
Definition: dynamic_color_engine.hpp:21
Defines an animated color.
Definition: color.hpp:105