1 #ifndef TERMOX_WIDGET_CURSOR_DATA_HPP
2 #define TERMOX_WIDGET_CURSOR_DATA_HPP
3 #include <signals_light/signal.hpp>
5 #include <termox/widget/point.hpp>
17 [[nodiscard]]
auto position() const -> Point;
35 Point position_ = {0, 0};
36 bool enabled_ =
false;
Holds and provides access to all data relevant to a Widget's cursor.
Definition: cursor.hpp:10
auto position() const -> Point
Get the local position of the cursor.
Definition: cursor.cpp:7
void disable(bool disable=true)
Disable the cursor(do not show on screen).
Definition: cursor.cpp:13
void set_position(Point p)
Set the local position of the cursor.
Definition: cursor.cpp:17
auto is_enabled() const -> bool
Query if the cursor is enabled.
Definition: cursor.cpp:9
void toggle()
Enable the cursor if disabled, or disable it if enabled.
Definition: cursor.cpp:15
sl::Signal< void(Point)> moved
Signal called when the cursor is moved, passing along the new position.
Definition: cursor.hpp:13
void enable(bool enable=true)
Enable the cursor(show on screen).
Definition: cursor.cpp:11