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.h42
1 files changed, 11 insertions, 31 deletions
diff --git a/src/plugins/platforms/directfb/qdirectfbinput.h b/src/plugins/platforms/directfb/qdirectfbinput.h
index 016e7f1..0b2e7ed 100644
--- a/src/plugins/platforms/directfb/qdirectfbinput.h
+++ b/src/plugins/platforms/directfb/qdirectfbinput.h
@@ -1,9 +1,7 @@
#ifndef QDIRECTFBINPUT_H
#define QDIRECTFBINPUT_H
-#include <QThread>
-#include <QMutex>
-#include <QWaitCondition>
+#include <QSemaphore>
#include <QObject>
#include <QHash>
#include <QPoint>
@@ -13,53 +11,35 @@
#include <directfb.h>
-class InputSocketWaiter : public QThread
-{
- Q_OBJECT
-public:
- InputSocketWaiter(IDirectFBEventBuffer *eventBuffer, QObject *parent);
- virtual ~InputSocketWaiter();
- void continueWaitingForEvents();
-protected:
- void run();
-signals:
- void newEvent();
-private:
- IDirectFBEventBuffer *m_eventBuffer;
- bool m_shouldStop;
- QMutex m_cleanupMutex;
- QWaitCondition m_finishedProcessingEvents;
-};
-
class QDirectFbInput : public QObject
{
Q_OBJECT
public:
- static QDirectFbInput *instance();
+ QDirectFbInput(QObject *parent);
void addWindow(DFBWindowID id, QWidget *tlw);
void removeWindow(WId wId);
public slots:
+ void runInputEventLoop();
+ void stopInputEventLoop();
void handleEvents();
- void applicationEnd();
private:
- QDirectFbInput();
-
void handleMouseEvents(const DFBEvent &event);
void handleWheelEvent(const DFBEvent &event);
void handleKeyEvents(const DFBEvent &event);
void handleEnterLeaveEvents(const DFBEvent &event);
- IDirectFB *dfbInterface;
- IDirectFBDisplayLayer *dfbDisplayLayer;
- IDirectFBEventBuffer *eventBuffer;
+ inline QPoint globalPoint(const DFBEvent &event) const;
- QHash<DFBWindowID,QWidget *>tlwMap;
- inline QPoint globalPoint(const DFBEvent &event) const;
+ IDirectFB *m_dfbInterface;
+ IDirectFBDisplayLayer *m_dfbDisplayLayer;
+ IDirectFBEventBuffer *m_eventBuffer;
- InputSocketWaiter *m_inputHandler;
+ bool m_shouldStop;
+ QSemaphore m_waitStop;
+ QHash<DFBWindowID,QWidget *>m_tlwMap;
};
#endif // QDIRECTFBINPUT_H