-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMultitouchMouse.h
executable file
·77 lines (48 loc) · 1.26 KB
/
MultitouchMouse.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#include "sigc++/sigc++.h"
#include "ControlSuper.h"
#include "GLRect.h"
#include "PointF.h"
#include "OpenGLUtils.h"
#include "TapDetect.h"
#ifndef _MultitouchMouse_H_
#define _MultitouchMouse_H_
#define MULTITOUCHMOUSE_MOVE 0
#define MULTITOUCHMOUSE_TAP 1
#define MULTITOUCHMOUSE_DOWN 2
#define MULTITOUCHMOUSE_UP 3
#define MULTITOUCHMOUSE_2_DOWN 4
#define MULTITOUCHMOUSE_2_UP 5
#define MULTITOUCHMOUSE_ZOOM 6
namespace touchcontrols
{
class MultitouchMouse : public ControlSuper
{
bool pressed;
bool hideGraphics;
int id;
int id2;
std::string image;
GLuint glTex;
GLRect glRect;
GLLines *glLines;
PointF last, last2;
PointF anchor;
TapDetect tapDetect;
public:
sigc::signal<void, int, float, float, float, float> signal_action;
sigc::signal<void, int> signal_double_tap;
MultitouchMouse(std::string tag, RectF pos, std::string image_filename);
void setHideGraphics(bool v);
void resetOutput();
bool processPointer(int action, int pid, float x, float y);
bool drawGL(bool);
bool initGL();
void updateSize();
void saveXML(TiXmlDocument &doc);
void loadXML(TiXmlDocument &doc);
private:
void reset();
float distancePoints(PointF p1, PointF p2);
};
}
#endif