summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/directfb/qdirectfbinput.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/directfb/qdirectfbinput.h')
-rw-r--r--src/plugins/platforms/directfb/qdirectfbinput.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/plugins/platforms/directfb/qdirectfbinput.h b/src/plugins/platforms/directfb/qdirectfbinput.h
new file mode 100644
index 0000000000..0b2e7ede10
--- /dev/null
+++ b/src/plugins/platforms/directfb/qdirectfbinput.h
@@ -0,0 +1,45 @@
+#ifndef QDIRECTFBINPUT_H
+#define QDIRECTFBINPUT_H
+
+#include <QSemaphore>
+#include <QObject>
+#include <QHash>
+#include <QPoint>
+#include <QEvent>
+
+#include <QtGui/qwindowdefs.h>
+
+#include <directfb.h>
+
+class QDirectFbInput : public QObject
+{
+ Q_OBJECT
+public:
+ QDirectFbInput(QObject *parent);
+ void addWindow(DFBWindowID id, QWidget *tlw);
+ void removeWindow(WId wId);
+
+public slots:
+ void runInputEventLoop();
+ void stopInputEventLoop();
+ void handleEvents();
+
+private:
+ void handleMouseEvents(const DFBEvent &event);
+ void handleWheelEvent(const DFBEvent &event);
+ void handleKeyEvents(const DFBEvent &event);
+ void handleEnterLeaveEvents(const DFBEvent &event);
+ inline QPoint globalPoint(const DFBEvent &event) const;
+
+
+ IDirectFB *m_dfbInterface;
+ IDirectFBDisplayLayer *m_dfbDisplayLayer;
+ IDirectFBEventBuffer *m_eventBuffer;
+
+ bool m_shouldStop;
+ QSemaphore m_waitStop;
+
+ QHash<DFBWindowID,QWidget *>m_tlwMap;
+};
+
+#endif // QDIRECTFBINPUT_H