summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/plugins/platforms/qnx/qnx.pro9
-rw-r--r--src/plugins/platforms/qnx/qqnxbpseventfilter.cpp107
-rw-r--r--src/plugins/platforms/qnx/qqnxbpseventfilter.h69
-rw-r--r--src/plugins/platforms/qnx/qqnxeventdispatcher_blackberry.cpp80
-rw-r--r--src/plugins/platforms/qnx/qqnxeventdispatcher_blackberry.h66
-rw-r--r--src/plugins/platforms/qnx/qqnxintegration.cpp21
-rw-r--r--src/plugins/platforms/qnx/qqnxintegration.h4
7 files changed, 354 insertions, 2 deletions
diff --git a/src/plugins/platforms/qnx/qnx.pro b/src/plugins/platforms/qnx/qnx.pro
index 9c7819a503..48738a5dee 100644
--- a/src/plugins/platforms/qnx/qnx.pro
+++ b/src/plugins/platforms/qnx/qnx.pro
@@ -20,6 +20,7 @@ CONFIG(blackberry) {
# Uncomment these to enable debugging output for various aspects of the plugin
#DEFINES += QQNXBUFFER_DEBUG
+#DEFINES += QQNXBPSEVENTFILTER_DEBUG
#DEFINES += QQNXCLIPBOARD_DEBUG
#DEFINES += QQNXEVENTTHREAD_DEBUG
#DEFINES += QQNXGLBACKINGSTORE_DEBUG
@@ -81,9 +82,13 @@ contains(QT_CONFIG, opengles2) {
}
CONFIG(blackberry) {
- SOURCES += qqnxnavigatorbps.cpp
+ SOURCES += qqnxnavigatorbps.cpp \
+ qqnxeventdispatcher_blackberry.cpp \
+ qqnxbpseventfilter.cpp
- HEADERS += qqnxnavigatorbps.h
+ HEADERS += qqnxnavigatorbps.h \
+ qqnxeventdispatcher_blackberry.h \
+ qqnxbpseventfilter.h
LIBS += -lbps
}
diff --git a/src/plugins/platforms/qnx/qqnxbpseventfilter.cpp b/src/plugins/platforms/qnx/qqnxbpseventfilter.cpp
new file mode 100644
index 0000000000..d1db0665bf
--- /dev/null
+++ b/src/plugins/platforms/qnx/qqnxbpseventfilter.cpp
@@ -0,0 +1,107 @@
+/***************************************************************************
+**
+** Copyright (C) 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$
+**
+****************************************************************************/
+
+#include "qqnxbpseventfilter.h"
+
+#include <QAbstractEventDispatcher>
+#include <QDebug>
+
+#include <bps/event.h>
+
+QT_BEGIN_NAMESPACE
+
+static QQnxBpsEventFilter *s_instance = 0;
+
+QQnxBpsEventFilter::QQnxBpsEventFilter(QObject *parent)
+ : QObject(parent)
+{
+ Q_ASSERT(s_instance == 0);
+
+ s_instance = this;
+}
+
+QQnxBpsEventFilter::~QQnxBpsEventFilter()
+{
+ Q_ASSERT(s_instance == this);
+
+ s_instance = 0;
+}
+
+void QQnxBpsEventFilter::installOnEventDispatcher(QAbstractEventDispatcher *dispatcher)
+{
+#if defined(QQNXBPSEVENTFILTER_DEBUG)
+ qDebug() << Q_FUNC_INFO << "dispatcher=" << dispatcher;
+#endif
+
+ QAbstractEventDispatcher::EventFilter previousEventFilter = dispatcher->setEventFilter(dispatcherEventFilter);
+
+ // the QPA plugin creates the event dispatcher so we are the first event
+ // filter assert on that just in case somebody adds another event filter
+ // in the QQnxIntegration constructor instead of adding a new section in here
+ Q_ASSERT(previousEventFilter == 0);
+ Q_UNUSED(previousEventFilter);
+}
+
+bool QQnxBpsEventFilter::dispatcherEventFilter(void *message)
+{
+#if defined(QQNXBPSEVENTFILTER_DEBUG)
+ qDebug() << Q_FUNC_INFO;
+#endif
+
+ if (s_instance == 0)
+ return false;
+
+ bps_event_t *event = static_cast<bps_event_t *>(message);
+ return s_instance->bpsEventFilter(event);
+}
+
+bool QQnxBpsEventFilter::bpsEventFilter(bps_event_t *event)
+{
+#if defined(QQNXBPSEVENTFILTER_DEBUG)
+ qDebug() << Q_FUNC_INFO << "event=" << event << "domain=" << bps_event_get_domain(event);
+#else
+ Q_UNUSED(event);
+#endif
+
+ return false;
+}
+
+QT_END_NAMESPACE
diff --git a/src/plugins/platforms/qnx/qqnxbpseventfilter.h b/src/plugins/platforms/qnx/qqnxbpseventfilter.h
new file mode 100644
index 0000000000..f03ea8e837
--- /dev/null
+++ b/src/plugins/platforms/qnx/qqnxbpseventfilter.h
@@ -0,0 +1,69 @@
+/***************************************************************************
+**
+** Copyright (C) 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 QQNXBPSEVENTFILTER_H
+#define QQNXBPSEVENTFILTER_H
+
+#include <QObject>
+
+struct bps_event_t;
+
+QT_BEGIN_NAMESPACE
+
+class QAbstractEventDispatcher;
+
+class QQnxBpsEventFilter : public QObject
+{
+ Q_OBJECT
+public:
+ explicit QQnxBpsEventFilter(QObject *parent = 0);
+ ~QQnxBpsEventFilter();
+
+ void installOnEventDispatcher(QAbstractEventDispatcher *dispatcher);
+
+private:
+ static bool dispatcherEventFilter(void *message);
+ bool bpsEventFilter(bps_event_t *event);
+};
+
+QT_END_NAMESPACE
+
+#endif // QQNXBPSEVENTFILTER_H
diff --git a/src/plugins/platforms/qnx/qqnxeventdispatcher_blackberry.cpp b/src/plugins/platforms/qnx/qqnxeventdispatcher_blackberry.cpp
new file mode 100644
index 0000000000..c7d9eb5ed9
--- /dev/null
+++ b/src/plugins/platforms/qnx/qqnxeventdispatcher_blackberry.cpp
@@ -0,0 +1,80 @@
+/***************************************************************************
+**
+** Copyright (C) 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$
+**
+****************************************************************************/
+
+#include "qqnxeventdispatcher_blackberry.h"
+
+#include <QWindowSystemInterface>
+#include <private/qguiapplication_p.h>
+
+QT_BEGIN_NAMESPACE
+
+
+QQnxEventDispatcherBlackberry::QQnxEventDispatcherBlackberry(QObject *parent)
+ : QEventDispatcherBlackberry(parent)
+{
+}
+
+QQnxEventDispatcherBlackberry::~QQnxEventDispatcherBlackberry()
+{
+}
+
+bool QQnxEventDispatcherBlackberry::processEvents(QEventLoop::ProcessEventsFlags flags)
+{
+ bool didSendEvents = QWindowSystemInterface::sendWindowSystemEvents(this, flags);
+
+ if (QEventDispatcherBlackberry::processEvents(flags))
+ return true;
+
+ return didSendEvents;
+}
+
+bool QQnxEventDispatcherBlackberry::hasPendingEvents()
+{
+ return QEventDispatcherBlackberry::hasPendingEvents() || QWindowSystemInterface::windowSystemEventsQueued();
+}
+
+void QQnxEventDispatcherBlackberry::flush()
+{
+ if (qApp)
+ qApp->sendPostedEvents();
+}
+
+QT_END_NAMESPACE
diff --git a/src/plugins/platforms/qnx/qqnxeventdispatcher_blackberry.h b/src/plugins/platforms/qnx/qqnxeventdispatcher_blackberry.h
new file mode 100644
index 0000000000..be34b5f7d0
--- /dev/null
+++ b/src/plugins/platforms/qnx/qqnxeventdispatcher_blackberry.h
@@ -0,0 +1,66 @@
+/***************************************************************************
+**
+** Copyright (C) 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 QQNXEVENTDISPATCHER_BLACKBERRY_H
+#define QQNXEVENTDISPATCHER_BLACKBERRY_H
+
+#include <qglobal.h>
+#include <private/qeventdispatcher_blackberry_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QQnxEventDispatcherBlackberry : public QEventDispatcherBlackberry
+{
+ Q_OBJECT
+
+public:
+ explicit QQnxEventDispatcherBlackberry(QObject *parent = 0);
+ ~QQnxEventDispatcherBlackberry();
+
+ bool processEvents(QEventLoop::ProcessEventsFlags flags);
+ bool hasPendingEvents();
+
+ void flush();
+};
+
+QT_END_NAMESPACE
+
+#endif // QQNXEVENTDISPATCHER_BLACKBERRY_H
diff --git a/src/plugins/platforms/qnx/qqnxintegration.cpp b/src/plugins/platforms/qnx/qqnxintegration.cpp
index e75b3ef7a9..b3c39498d4 100644
--- a/src/plugins/platforms/qnx/qqnxintegration.cpp
+++ b/src/plugins/platforms/qnx/qqnxintegration.cpp
@@ -52,6 +52,7 @@
#include "qqnxservices.h"
#if defined(Q_OS_BLACKBERRY)
+#include "qqnxbpseventfilter.h"
#include "qqnxnavigatorbps.h"
#elif defined(QQNX_PPS)
#include "qqnxnavigatorpps.h"
@@ -70,7 +71,12 @@
#endif
#include "private/qgenericunixfontdatabase_p.h"
+
+#if defined(Q_OS_BLACKBERRY)
+#include "qqnxeventdispatcher_blackberry.h"
+#else
#include "private/qgenericunixeventdispatcher_p.h"
+#endif
#include <QtGui/QPlatformWindow>
#include <QtGui/QWindowSystemInterface>
@@ -106,7 +112,12 @@ QQnxIntegration::QQnxIntegration()
#if !defined(QT_NO_OPENGL)
, m_paintUsingOpenGL(false)
#endif
+#if defined(Q_OS_BLACKBERRY)
+ , m_eventDispatcher(new QQnxEventDispatcherBlackberry())
+ , m_bpsEventFilter(0)
+#else
, m_eventDispatcher(createUnixEventDispatcher())
+#endif
, m_nativeInterface(new QQnxNativeInterface())
, m_screenEventHandler(new QQnxScreenEventHandler())
#if !defined(QT_NO_CLIPBOARD)
@@ -169,6 +180,12 @@ QQnxIntegration::QQnxIntegration()
// Create services handling class
if (m_navigator)
m_services = new QQnxServices(m_navigator);
+
+#if defined(Q_OS_BLACKBERRY)
+ m_bpsEventFilter = new QQnxBpsEventFilter;
+ m_bpsEventFilter->installOnEventDispatcher(m_eventDispatcher);
+#endif
+
}
QQnxIntegration::~QQnxIntegration()
@@ -220,6 +237,10 @@ QQnxIntegration::~QQnxIntegration()
// Destroy navigator interface
delete m_navigator;
+#if defined(Q_OS_BLACKBERRY)
+ delete m_bpsEventFilter;
+#endif
+
#if defined(QQNXINTEGRATION_DEBUG)
qDebug() << "QQnx: platform plugin shutdown end";
#endif
diff --git a/src/plugins/platforms/qnx/qqnxintegration.h b/src/plugins/platforms/qnx/qqnxintegration.h
index c578938db2..538892e9fb 100644
--- a/src/plugins/platforms/qnx/qqnxintegration.h
+++ b/src/plugins/platforms/qnx/qqnxintegration.h
@@ -50,6 +50,7 @@
QT_BEGIN_NAMESPACE
+class QQnxBpsEventFilter;
class QQnxEventThread;
class QQnxNativeInterface;
class QQnxWindow;
@@ -135,6 +136,9 @@ private:
bool m_paintUsingOpenGL;
#endif
QAbstractEventDispatcher *m_eventDispatcher;
+#if defined(Q_OS_BLACKBERRY)
+ QQnxBpsEventFilter *m_bpsEventFilter;
+#endif
QQnxNativeInterface *m_nativeInterface;
QList<QQnxScreen*> m_screens;
QQnxScreenEventHandler *m_screenEventHandler;