-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtouchsystem.h
57 lines (42 loc) · 1.28 KB
/
touchsystem.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef TOUCHSYSTEM_H
#define TOUCHSYSTEM_H
#include "libda_global.h"
#include "swipinggesture.h"
#include <QWidget>
#include <QGesture>
LDA_BEGIN_NAMESPACE
class TouchInterfacing;
class LIBDA_SHARED_EXPORT TouchSystem : public QObject
{
Q_OBJECT
public:
explicit TouchSystem();
inline static TouchSystem *instance() {
static TouchSystem *inst = new TouchSystem;
return inst;
}
bool eventFilter(QObject *object, QEvent *event) override;
void listenTo(QWidget *object, Dtk::Addons::TouchInterfacing *face);
/**
* @brief Destroys the instance if the interface is no longer existent
*/
void check();
/**
* @brief Prints events data when enabled with UID of the object
* @param enable
*/
void enableDebug(bool enable);
void destroyInterface(Dtk::Addons::TouchInterfacing *face);
protected:
bool processMouseMove(QMouseEvent *e);
bool processMousePress(QMouseEvent *e);
bool processMouseRelease(QMouseEvent *e);
bool processGestures(QGestureEvent *event);
private:
QList<Dtk::Addons::TouchInterfacing *> m_interfaces;
QMap<QWidget *, Dtk::Addons::TouchInterfacing *> m_sources;
Dtk::Addons::TouchInterfacing *interface;
bool debug = false;
};
LDA_END_NAMESPACE
#endif // TOUCHSYSTEM_H