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 DEFINES += Q_OS_BLACKBERRY
@ -9,4 +9,4 @@ LIBS += -lbps
# Blackberry also has support for stack smashing protection in its libc # Blackberry also has support for stack smashing protection in its libc
QMAKE_CFLAGS += -fstack-protector -fstack-protector-all 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 # Blackberry also has support for stack smashing protection in its libc
QMAKE_CFLAGS += -fstack-protector -fstack-protector-all 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 # qmake configuration for qnx-qcc armv7 targets
# #
MAKEFILE_GENERATOR = UNIX include(../../common/qcc-base-qnx-armv7le.conf)
TARGET_PLATFORM = unix
TEMPLATE = app
CONFIG += qt warn_on release link_prl
QT += core gui
include(../../common/g++-unix.conf) DEFINES += QT_NO_CLIPBOARD
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)

View File

@ -2,24 +2,6 @@
# qmake configuration for qnx-qcc x86 targets # qmake configuration for qnx-qcc x86 targets
# #
MAKEFILE_GENERATOR = UNIX include(../../common/qcc-base-qnx-x86.conf)
TARGET_PLATFORM = unix
TEMPLATE = app
CONFIG += qt warn_on release link_prl
QT += core gui
include(../../common/g++-unix.conf) DEFINES += QT_NO_CLIPBOARD
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)

View File

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

View File

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

View File

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