Go to the documentation of this file.00001
00028 #ifndef TOUCHADAPTOR_H
00029 #define TOUCHADAPTOR_H
00030
00031 #include "inputdevadaptor.h"
00032 #include "deviceadaptorringbuffer.h"
00033 #include <QObject>
00034 #include "touchdata.h"
00035
00041 class TouchAdaptor : public InputDevAdaptor
00042 {
00043 Q_OBJECT;
00044 public:
00049 static DeviceAdaptor* factoryMethod(const QString& id)
00050 {
00051 return new TouchAdaptor(id);
00052 }
00053
00054 protected:
00059 TouchAdaptor(const QString& id);
00060 ~TouchAdaptor();
00061
00062 private:
00063
00064 static const int HARD_MAX_TOUCH_POINTS;
00065
00069 struct TouchValues {
00070 int x;
00071 int y;
00072 int z;
00073 int volume;
00074 int toolWidth;
00075 TouchData::FingerState fingerState;
00076 };
00077
00081 struct RangeInfo {
00082 RangeInfo() : xMin(0), yMin(0), xRange(0), yRange(0) {};
00083
00084 int xMin;
00085 int yMin;
00086 int xRange;
00087 int yRange;
00088 };
00089
00094 bool checkInputDevice(QString path, QString matchString = "");
00095
00101 void interpretEvent(int src, struct input_event *ev);
00102
00107 void commitOutput(int src, struct input_event *ev);
00108
00109 void interpretSync(int src, struct input_event *ev);
00110
00111 DeviceAdaptorRingBuffer<TouchData>* outputBuffer_;
00112 TouchValues touchValues_[5];
00113 RangeInfo rangeInfo_;
00114 };
00115
00116 #endif