TermOx
widget_slots.hpp
1 #ifndef TERMOX_WIDGET_WIDGET_SLOTS_HPP
2 #define TERMOX_WIDGET_WIDGET_SLOTS_HPP
3 #include <signals_light/signal.hpp>
4 
5 #include <termox/painter/color.hpp>
6 #include <termox/system/key.hpp>
7 #include <termox/system/mouse.hpp>
8 #include <termox/widget/point.hpp>
9 
10 namespace ox {
11 class Widget;
12 } // namespace ox
13 
14 namespace ox::slot {
15 
16 [[nodiscard]] auto enable(Widget& w) -> sl::Slot<void()>;
17 
18 [[nodiscard]] auto disable(Widget& w) -> sl::Slot<void()>;
19 
20 [[nodiscard]] auto update(Widget& w) -> sl::Slot<void()>;
21 
22 [[nodiscard]] auto click(Widget& w) -> sl::Slot<void(Point, Mouse::Button)>;
23 
24 [[nodiscard]] auto click(Widget& w, Point p) -> sl::Slot<void(Mouse::Button)>;
25 
26 [[nodiscard]] auto click(Widget& w, Mouse::Button b) -> sl::Slot<void(Point)>;
27 
28 [[nodiscard]] auto click(Widget& w, Point p, Mouse::Button b)
29  -> sl::Slot<void()>;
30 
31 [[nodiscard]] auto keypress(Widget& w) -> sl::Slot<void(Key)>;
32 
33 [[nodiscard]] auto keypress(Widget& w, Key k) -> sl::Slot<void()>;
34 
35 [[nodiscard]] auto set_background(Widget& w) -> sl::Slot<void(Color)>;
36 
37 [[nodiscard]] auto set_background(Widget& w, Color c) -> sl::Slot<void()>;
38 
39 [[nodiscard]] auto set_foreground(Widget& w) -> sl::Slot<void(Color)>;
40 
41 [[nodiscard]] auto set_foreground(Widget& w, Color c) -> sl::Slot<void()>;
42 
43 [[nodiscard]] auto toggle_cursor(Widget& w) -> sl::Slot<void()>;
44 
45 } // namespace ox::slot
46 #endif // TERMOX_WIDGET_WIDGET_SLOTS_HPP