34#include <NDEVR/WidgetOptions.h>
35#include <NDEVR/WindowInstance.h>
36#include <NDEVR/Thread.h>
37#include <NDEVR/TimeSpan.h>
39#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
41#define points touchPoints
43#if NDEVR_SUPPORTS_THREADING
44#define RUN_MOUSE_MANAGER_THREADED 1
46#define RUN_MOUSE_MANAGER_THREADED 0
55#if NDEVR_SUPPORTS_THREADING
61 void setUseMouseClicks(
bool use_mouse_clicks);
62 void processMouseEvent();
63 void eraseOldestEvent();
64 MouseEvent oldestEvent()
const;
65 static NDEVRMouseManager& defaultInstance();
66 void clearEvents(
const WindowInstance* instance);
67#if RUN_MOUSE_MANAGER_THREADED
68 void stopThread()
override;
69 virtual void run()
override;
71 void addTouchEvent(Buffer<Vector<2, fltp04>> location, Vector<2, uint04> size,
bool touch_pressed, WindowInstance* instance =
nullptr);
72 void clearTouchEvent(WindowInstance* instance);
73 bool addMouseEvent(QEvent* event, Vector<2, uint04> size, WindowInstance* instance =
nullptr);
74 void addMouseEvent(MouseEvent& mouse_event);
75 const Buffer<MouseEvent>& mouseEvents()
const;
76 static ApplicationOption<bool> seperate_mouse_thread;
79 bool m_use_mouse_clicks;
80#if RUN_MOUSE_MANAGER_THREADED
81 mutable std::mutex m_critical_section;
83 Buffer<MouseEvent> m_last_mouse_events;
84 Vector<2, fltp04> m_last_mouse_press_point;
87 Vector<2, Vector<2, fltp04>> m_last_touch_press_point = Constant<Vector<2, Vector<2, fltp04>>>::Invalid;
89 fltp08 m_last_touch_scale_factor = Constant<fltp08>::Invalid;
90 uint08 m_last_mouse_press_time;
93#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)