Make the QNX QPA plugin work with non blackberry.

Change-Id: Id85d18d9f21711e8d53e8e4bfdf39d10e135f593
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
This commit is contained in:
Stephen Kelly 2012-04-18 12:07:10 +02:00 committed by Qt by Nokia
parent 5c2e560fe9
commit 47617f68cb
9 changed files with 118 additions and 73 deletions

View File

@ -0,0 +1,25 @@
#
# qmake configuration for qnx-qcc armv7 targets
#
MAKEFILE_GENERATOR = UNIX
TARGET_PLATFORM = unix
TEMPLATE = app
CONFIG += qt warn_on release link_prl
QT += core gui
include(g++-unix.conf)
include(unix.conf)
QMAKE_CC = qcc -Vgcc_ntoarmv7le
QNX_CPUDIR = armle-v7
include(qcc-base-qnx.conf)
QMAKE_AR = ntoarmv7-ar cqs
QMAKE_OBJCOPY = ntoarmv7-objcopy
QMAKE_RANLIB = ntoarmv7-ranlib
QMAKE_STRIP = ntoarmv7-strip
load(qt_config)

View File

@ -0,0 +1,25 @@
#
# qmake configuration for qnx-qcc x86 targets
#
MAKEFILE_GENERATOR = UNIX
TARGET_PLATFORM = unix
TEMPLATE = app
CONFIG += qt warn_on release link_prl
QT += core gui
include(g++-unix.conf)
include(unix.conf)
QMAKE_CC = qcc -Vgcc_ntox86
QNX_CPUDIR = x86
include(qcc-base-qnx.conf)
QMAKE_AR = ntox86-ar cqs
QMAKE_OBJCOPY = ntox86-objcopy
QMAKE_RANLIB = ntox86-ranlib
QMAKE_STRIP = ntox86-strip
load(qt_config)

View File

@ -1,5 +1,5 @@
#
# qmake configuration for blackberry x86 systems
# qmake configuration for blackberry armv7le systems
#
DEFINES += Q_OS_BLACKBERRY
@ -9,4 +9,4 @@ LIBS += -lbps
# Blackberry also has support for stack smashing protection in its libc
QMAKE_CFLAGS += -fstack-protector -fstack-protector-all
include(../qnx-armv7le-qcc/qmake.conf)
include(../../common/qcc-base-qnx-armv7le.conf)

View File

@ -9,4 +9,4 @@ LIBS += -lbps
# Blackberry also has support for stack smashing protection in its libc
QMAKE_CFLAGS += -fstack-protector -fstack-protector-all
include(../qnx-x86-qcc/qmake.conf)
include(../../common/qcc-base-qnx-x86.conf)

View File

@ -2,24 +2,6 @@
# qmake configuration for qnx-qcc armv7 targets
#
MAKEFILE_GENERATOR = UNIX
TARGET_PLATFORM = unix
TEMPLATE = app
CONFIG += qt warn_on release link_prl
QT += core gui
include(../../common/qcc-base-qnx-armv7le.conf)
include(../../common/g++-unix.conf)
include(../../common/unix.conf)
QMAKE_CC = qcc -Vgcc_ntoarmv7le
QNX_CPUDIR = armle-v7
include(../../common/qcc-base-qnx.conf)
QMAKE_AR = ntoarmv7-ar cqs
QMAKE_OBJCOPY = ntoarmv7-objcopy
QMAKE_RANLIB = ntoarmv7-ranlib
QMAKE_STRIP = ntoarmv7-strip
load(qt_config)
DEFINES += QT_NO_CLIPBOARD

View File

@ -2,24 +2,6 @@
# qmake configuration for qnx-qcc x86 targets
#
MAKEFILE_GENERATOR = UNIX
TARGET_PLATFORM = unix
TEMPLATE = app
CONFIG += qt warn_on release link_prl
QT += core gui
include(../../common/qcc-base-qnx-x86.conf)
include(../../common/g++-unix.conf)
include(../../common/unix.conf)
QMAKE_CC = qcc -Vgcc_ntox86
QNX_CPUDIR = x86
include(../../common/qcc-base-qnx.conf)
QMAKE_AR = ntox86-ar cqs
QMAKE_OBJCOPY = ntox86-objcopy
QMAKE_RANLIB = ntox86-ranlib
QMAKE_STRIP = ntox86-strip
load(qt_config)
DEFINES += QT_NO_CLIPBOARD

View File

@ -31,59 +31,66 @@ SOURCES = main.cpp \
qqnxglcontext.cpp \
qqnxglbackingstore.cpp \
qqnxintegration.cpp \
qqnxnavigatoreventhandler.cpp \
qqnxnavigatoreventnotifier.cpp \
qqnxscreen.cpp \
qqnxwindow.cpp \
qqnxrasterbackingstore.cpp \
qqnxvirtualkeyboard.cpp \
qqnxclipboard.cpp \
qqnxrootwindow.cpp \
qqnxscreeneventhandler.cpp \
qqnxabstractvirtualkeyboard.cpp \
qqnxnativeinterface.cpp
CONFIG(blackberry) {
SOURCES += qqnxnavigatoreventhandler.cpp \
qqnxnavigatoreventnotifier.cpp \
qqnxvirtualkeyboard.cpp \
qqnxclipboard.cpp \
qqnxabstractvirtualkeyboard.cpp
}
HEADERS = main.h \
qqnxbuffer.h \
qqnxeventthread.h \
qqnxkeytranslator.h \
qqnxintegration.h \
qqnxnavigatoreventhandler.h \
qqnxnavigatoreventnotifier.h \
qqnxglcontext.h \
qqnxglbackingstore.h \
qqnxscreen.h \
qqnxwindow.h \
qqnxrasterbackingstore.h \
qqnxvirtualkeyboard.h \
qqnxclipboard.h \
qqnxrootwindow.h \
qqnxscreeneventhandler.h \
qqnxabstractvirtualkeyboard.h \
qqnxnativeinterface.h
CONFIG(blackberry) {
HEADERS += qqnxnavigatoreventhandler.h \
qqnxnavigatoreventnotifier.h \
qqnxvirtualkeyboard.h \
qqnxclipboard.h \
qqnxabstractvirtualkeyboard.h
}
CONFIG(blackberry) {
SOURCES += qqnxservices.cpp
HEADERS += qqnxservices.h
}
CONFIG(qqnx_imf) {
DEFINES += QQNX_IMF
HEADERS += qqnxinputcontext_imf.h
SOURCES += qqnxinputcontext_imf.cpp
} else {
HEADERS += qqnxinputcontext_noimf.h
SOURCES += qqnxinputcontext_noimf.cpp
CONFIG(qqnx_imf) {
DEFINES += QQNX_IMF
HEADERS += qqnxinputcontext_imf.h
SOURCES += qqnxinputcontext_imf.cpp
} else {
HEADERS += qqnxinputcontext_noimf.h
SOURCES += qqnxinputcontext_noimf.cpp
}
}
OTHER_FILES += qnx.json
QMAKE_CXXFLAGS += -I./private
LIBS += -lpps -lscreen -lEGL -lclipboard
LIBS += -lscreen -lEGL
CONFIG(blackberry) {
LIBS += -lbps
LIBS += -lbps -lpps -lclipboard
}
include (../../../platformsupport/eglconvenience/eglconvenience.pri)

View File

@ -44,15 +44,17 @@
#include "qqnxglbackingstore.h"
#include "qqnxglcontext.h"
#include "qqnxnativeinterface.h"
#include "qqnxnavigatoreventhandler.h"
#include "qqnxnavigatoreventnotifier.h"
#include "qqnxrasterbackingstore.h"
#include "qqnxscreen.h"
#include "qqnxscreeneventhandler.h"
#include "qqnxwindow.h"
#include "qqnxglcontext.h"
#ifdef Q_OS_BLACKBERRY
#include "qqnxnavigatoreventhandler.h"
#include "qqnxnavigatoreventnotifier.h"
#include "qqnxvirtualkeyboard.h"
#include "qqnxclipboard.h"
#include "qqnxglcontext.h"
#include "qqnxservices.h"
#if defined(QQnx_IMF)
@ -60,6 +62,7 @@
#else
#include "qqnxinputcontext_noimf.h"
#endif
#endif // Q_OS_BLACKBERRY
#include "private/qgenericunixfontdatabase_p.h"
#include "private/qgenericunixeventdispatcher_p.h"
@ -81,15 +84,17 @@ QMutex QQnxIntegration::ms_windowMapperMutex;
QQnxIntegration::QQnxIntegration()
: QPlatformIntegration()
, m_eventThread(0)
#ifdef Q_OS_BLACKBERRY
, m_navigatorEventHandler(new QQnxNavigatorEventHandler())
, m_navigatorEventNotifier(0)
, m_virtualKeyboard(0)
, m_inputContext(0)
, m_services(0)
#endif
, m_fontDatabase(new QGenericUnixFontDatabase())
, m_paintUsingOpenGL(false)
, m_eventDispatcher(createUnixEventDispatcher())
, m_nativeInterface(new QQnxNativeInterface())
, m_services(0)
, m_screenEventHandler(new QQnxScreenEventHandler())
#ifndef QT_NO_CLIPBOARD
, m_clipboard(0)
@ -105,12 +110,14 @@ QQnxIntegration::QQnxIntegration()
qFatal("QQnx: failed to connect to composition manager, errno=%d", errno);
}
#ifdef Q_OS_BLACKBERRY
// Create/start navigator event notifier
m_navigatorEventNotifier = new QQnxNavigatorEventNotifier(m_navigatorEventHandler);
// delay invocation of start() to the time the event loop is up and running
// needed to have the QThread internals of the main thread properly initialized
QMetaObject::invokeMethod(m_navigatorEventNotifier, "start", Qt::QueuedConnection);
#endif
// Create displays for all possible screens (which may not be attached)
createDisplays();
@ -122,6 +129,7 @@ QQnxIntegration::QQnxIntegration()
m_eventThread = new QQnxEventThread(m_screenContext, m_screenEventHandler);
m_eventThread->start();
#ifdef Q_OS_BLACKBERRY
// Create/start the keyboard class.
m_virtualKeyboard = new QQnxVirtualKeyboard();
@ -137,7 +145,6 @@ QQnxIntegration::QQnxIntegration()
m_inputContext = new QQnxInputContext(*m_virtualKeyboard);
// Create services handling class
#ifdef Q_OS_BLACKBERRY
m_services = new QQnxServices;
#endif
}
@ -151,6 +158,7 @@ QQnxIntegration::~QQnxIntegration()
delete m_nativeInterface;
#ifdef Q_OS_BLACKBERRY
// Destroy input context
delete m_inputContext;
@ -165,6 +173,7 @@ QQnxIntegration::~QQnxIntegration()
// Stop/destroy navigator event notifier
delete m_navigatorEventNotifier;
delete m_navigatorEventHandler;
#endif
// Stop/destroy event thread
delete m_eventThread;
@ -231,6 +240,7 @@ QPlatformOpenGLContext *QQnxIntegration::createPlatformOpenGLContext(QOpenGLCont
return new QQnxGLContext(context);
}
#ifdef Q_OS_BLACKBERRY
QPlatformInputContext *QQnxIntegration::inputContext() const
{
#if defined(QQNXINTEGRATION_DEBUG)
@ -238,6 +248,7 @@ QPlatformInputContext *QQnxIntegration::inputContext() const
#endif
return m_inputContext;
}
#endif
void QQnxIntegration::moveToScreen(QWindow *window, int screen)
{
@ -292,10 +303,12 @@ QVariant QQnxIntegration::styleHint(QPlatformIntegration::StyleHint hint) const
return QPlatformIntegration::styleHint(hint);
}
#ifdef Q_OS_BLACKBERRY
QPlatformServices * QQnxIntegration::services() const
{
return m_services;
}
#endif
QWindow *QQnxIntegration::window(screen_window_t qnxWindow)
{
@ -361,7 +374,9 @@ void QQnxIntegration::createDisplays()
QObject::connect(m_screenEventHandler, SIGNAL(windowClosed(void *)),
screen, SLOT(windowClosed(void *)));
#ifdef Q_OS_BLACKBERRY
QObject::connect(m_navigatorEventHandler, SIGNAL(rotationChanged(int)), screen, SLOT(setRotation(int)));
#endif
}
}

View File

@ -51,15 +51,18 @@
QT_BEGIN_NAMESPACE
class QQnxEventThread;
class QQnxInputContext;
class QQnxNativeInterface;
class QQnxWindow;
class QQnxScreen;
class QQnxScreenEventHandler;
#ifdef Q_OS_BLACKBERRY
class QQnxInputContext;
class QQnxNavigatorEventHandler;
class QQnxNavigatorEventNotifier;
class QQnxAbstractVirtualKeyboard;
class QQnxWindow;
class QQnxServices;
class QQnxScreen;
class QQnxScreenEventHandler;
#endif
#ifndef QT_NO_CLIPBOARD
class QQnxClipboard;
@ -80,7 +83,9 @@ public:
QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const;
QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const;
#ifdef Q_OS_BLACKBERRY
QPlatformInputContext *inputContext() const;
#endif
void moveToScreen(QWindow *window, int screen);
@ -98,7 +103,9 @@ public:
bool paintUsingOpenGL() const { return m_paintUsingOpenGL; }
#ifdef Q_OS_BLACKBERRY
QPlatformServices *services() const;
#endif
static QWindow *window(screen_window_t qnxWindow);
@ -112,15 +119,17 @@ private:
screen_context_t m_screenContext;
QQnxEventThread *m_eventThread;
#ifdef Q_OS_BLACKBERRY
QQnxNavigatorEventHandler *m_navigatorEventHandler;
QQnxNavigatorEventNotifier *m_navigatorEventNotifier;
QQnxAbstractVirtualKeyboard *m_virtualKeyboard;
QQnxInputContext *m_inputContext;
QQnxServices *m_services;
#endif
QPlatformFontDatabase *m_fontDatabase;
bool m_paintUsingOpenGL;
QAbstractEventDispatcher *m_eventDispatcher;
QQnxNativeInterface *m_nativeInterface;
QQnxServices *m_services;
QList<QQnxScreen*> m_screens;
QQnxScreenEventHandler *m_screenEventHandler;
#ifndef QT_NO_CLIPBOARD