-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathglobalgestureforwarder.h
46 lines (39 loc) · 1.18 KB
/
globalgestureforwarder.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
#ifndef GLOBALGESTUREFORWARDER_H
#define GLOBALGESTUREFORWARDER_H
#include <QThread>
#include <QDataStream>
#include <QLocalSocket>
#include <QSizeF>
class QTimer;
class GlobalGestureForwarder : public QObject
{
Q_OBJECT
public:
explicit GlobalGestureForwarder(QObject *parent = nullptr);
static GlobalGestureForwarder* self() {
return _self;
}
void pinchGestureBegin(int fingerCount, quint32 time);
void pinchGestureUpdate(qreal scale, qreal angleDelta, const QSizeF &delta, quint32 time);
void pinchGestureEnd(quint32 time);
void pinchGestureCancelled(quint32 time);
void swipeGestureBegin(int fingerCount, quint32 time);
void swipeGestureUpdate(const QSizeF &delta, quint32 time);
void swipeGestureEnd(quint32 time);
void swipeGestureCancelled(quint32 time);
void init(int pid);
private:
void connectToServer();
void sendData();
private:
QByteArray block;
QDataStream *outStream;
QLocalSocket *socket;
QTimer *connectTimer;
static GlobalGestureForwarder* _self;
bool bConnected = false;
friend class ConnectThread;
int curServerPid = 0;
QSizeF lastSwipDelta;
};
#endif // GLOBALGESTUREFORWARDER_H