sensorfw: adaptors/touchadaptor/touchadaptor.h Source File

sensorfw

touchadaptor.h
Go to the documentation of this file.
1
28 #ifndef TOUCHADAPTOR_H
29 #define TOUCHADAPTOR_H
30
31 #include "inputdevadaptor.h"
32 #include "deviceadaptorringbuffer.h"
33 #include <QObject>
34 #include "touchdata.h"
35
41 class TouchAdaptor : public InputDevAdaptor
42 {
43 Q_OBJECT;
44 public:
49 static DeviceAdaptor* factoryMethod(const QString& id)
50 {
51 return new TouchAdaptor(id);
52 }
53
54 protected:
59 TouchAdaptor(const QString& id);
60 ~TouchAdaptor();
61
62 private:
63
64 static const int HARD_MAX_TOUCH_POINTS;
65
69 struct TouchValues {
70 int x;
71 int y;
72 int z;
73 int volume;
74 int toolWidth;
75 TouchData::FingerState fingerState;
76 };
77
81 struct RangeInfo {
82 RangeInfo() : xMin(0), yMin(0), xRange(0), yRange(0) {};
83
84 int xMin;
85 int yMin;
86 int xRange;
87 int yRange;
88 };
89
94 bool checkInputDevice(QString path, QString matchString = "");
95
101 void interpretEvent(int src, struct input_event *ev);
102
107 void commitOutput(int src, struct input_event *ev);
108
109 void interpretSync(int src, struct input_event *ev);
110
111 DeviceAdaptorRingBuffer<TouchData>* outputBuffer_;
112 TouchValues touchValues_[5];
113 RangeInfo rangeInfo_;
114 };
115
116 #endif
TouchAdaptor
Adaptor for device touchscreen.
Definition: touchadaptor.h:42
TouchAdaptor::factoryMethod
static DeviceAdaptor * factoryMethod(const QString &id)
Factory method for gaining a new instance of TouchAdaptor class.
Definition: touchadaptor.h:49
TouchAdaptor::TouchAdaptor
TouchAdaptor(const QString &id)
Constructor.
TouchAdaptor::~TouchAdaptor
~TouchAdaptor()
TouchData::FingerState
FingerState
Enumeration to handle synaptic multitouch driver accuracy.
Definition: touchdata.h:41
touchdata.h
Datatype for touch events.