summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/qnx/qqnxnavigatoreventhandler.h
diff options
context:
space:
mode:
authorKevin Krammer <kevin.krammer.qnx@kdab.com>2012-03-20 11:27:52 +0100
committerQt by Nokia <qt-info@nokia.com>2012-03-21 20:47:54 +0100
commit9dc86ac0f2d019f93665c1ae0e3c2cd33fd88bce (patch)
treecb8b54487c43d9838ce025a36cf757d675edc4a0 /src/plugins/platforms/qnx/qqnxnavigatoreventhandler.h
parent3ed12e4b26bab091821ee3827eb44f61d22f47d7 (diff)
Use main thread event loop for navigator event processing
Removes the need for an extra thread by creating the event handler's socket notifier in the context of the main thread. Change-Id: If8c7bb986074083b5b9a7b9c96734a970ba32f92 Reviewed-by: Sean Harmer <sh@theharmers.co.uk> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Diffstat (limited to 'src/plugins/platforms/qnx/qqnxnavigatoreventhandler.h')
-rw-r--r--src/plugins/platforms/qnx/qqnxnavigatoreventhandler.h77
1 files changed, 77 insertions, 0 deletions
diff --git a/src/plugins/platforms/qnx/qqnxnavigatoreventhandler.h b/src/plugins/platforms/qnx/qqnxnavigatoreventhandler.h
new file mode 100644
index 0000000000..2e0bd1fa14
--- /dev/null
+++ b/src/plugins/platforms/qnx/qqnxnavigatoreventhandler.h
@@ -0,0 +1,77 @@
+/***************************************************************************
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQNXNAVIGATOREVENTHANDLER_H
+#define QQNXNAVIGATOREVENTHANDLER_H
+
+#include <QObject>
+
+QT_BEGIN_NAMESPACE
+
+class QQnxScreen;
+class QSocketNotifier;
+
+class QQnxNavigatorEventHandler : public QObject
+{
+ Q_OBJECT
+public:
+ QQnxNavigatorEventHandler(QQnxScreen &primaryScreen);
+ virtual ~QQnxNavigatorEventHandler();
+
+public Q_SLOTS:
+ void start();
+
+private Q_SLOTS:
+ void readData();
+
+private:
+ void parsePPS(const QByteArray &ppsData, QByteArray &msg, QByteArray &dat, QByteArray &id);
+ void replyPPS(const QByteArray &res, const QByteArray &id, const QByteArray &dat);
+ void handleMessage(const QByteArray &msg, const QByteArray &dat, const QByteArray &id);
+
+ QQnxScreen &m_primaryScreen;
+ int m_fd;
+ QSocketNotifier *m_readNotifier;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQNXNAVIGATOREVENTHANDLER_H