libwtk-sdl2  0.0.1
mouse_tracker.hpp
1 #ifndef LIBWTK_SDL2_MOUSE_TRACKER_HPP
2 #define LIBWTK_SDL2_MOUSE_TRACKER_HPP
3 
4 #include <optional>
5 
6 #include "mouse_event.hpp"
7 
8 // Tracks mouse movement and state and produces events in a way that widgets
9 // don't have to hold a lot of internal state.
11 {
12  void mouse_down(point p);
13  mouse_up_event mouse_up(point p);
14 
15  mouse_move_event mouse_move(point p);
16 
17  // TODO add mouse movement path
18 
19  private:
20 
21  std::optional<point> _opt_down_pos;
22 };
23 
24 #endif
25 
Definition: mouse_event.hpp:19
Definition: mouse_tracker.hpp:10
Definition: geometry.hpp:6
Definition: mouse_event.hpp:26