From a67ab4fd1065d434f4a14b72ee2d991a71af493c Mon Sep 17 00:00:00 2001 From: con Date: Fri, 15 Apr 2011 10:04:56 +0200 Subject: Compile fix for window surface features. (uikit) --- src/plugins/platforms/uikit/quikitwindowsurface.h | 1 + src/plugins/platforms/uikit/quikitwindowsurface.mm | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/uikit/quikitwindowsurface.h b/src/plugins/platforms/uikit/quikitwindowsurface.h index 58ccb1b..ca10a71 100644 --- a/src/plugins/platforms/uikit/quikitwindowsurface.h +++ b/src/plugins/platforms/uikit/quikitwindowsurface.h @@ -53,6 +53,7 @@ public: QPaintDevice *paintDevice(); void flush(QWidget *widget, const QRegion ®ion, const QPoint &offset); + WindowSurfaceFeatures features() const; private: QPaintDevice *mPaintDevice; diff --git a/src/plugins/platforms/uikit/quikitwindowsurface.mm b/src/plugins/platforms/uikit/quikitwindowsurface.mm index dd188fb..bb7dcd7 100644 --- a/src/plugins/platforms/uikit/quikitwindowsurface.mm +++ b/src/plugins/platforms/uikit/quikitwindowsurface.mm @@ -73,7 +73,6 @@ QT_BEGIN_NAMESPACE QUIKitWindowSurface::QUIKitWindowSurface(QWidget *window) : QWindowSurface(window), mPaintDevice(new EAGLPaintDevice(window->platformWindow())) { - setPartialUpdateSupport(false); } QPaintDevice *QUIKitWindowSurface::paintDevice() @@ -89,4 +88,9 @@ void QUIKitWindowSurface::flush(QWidget *widget, const QRegion ®ion, const QP widget->platformWindow()->glContext()->swapBuffers(); } +QWindowSurface::WindowSurfaceFeatures QUIKitWindowSurface::features() const +{ + return PartialUpdates; +} + QT_END_NAMESPACE -- cgit v0.12 From 42998c318800ed5ac578e54a13063d40b94ebf66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Fri, 15 Apr 2011 12:16:43 +0200 Subject: Lighthouse: Make directfb conform with ligthhouse gl context api --- src/plugins/platforms/directfb/qdirectfbglcontext.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/platforms/directfb/qdirectfbglcontext.cpp b/src/plugins/platforms/directfb/qdirectfbglcontext.cpp index ee46691..85effc9 100644 --- a/src/plugins/platforms/directfb/qdirectfbglcontext.cpp +++ b/src/plugins/platforms/directfb/qdirectfbglcontext.cpp @@ -70,11 +70,13 @@ QDirectFbGLContext::QDirectFbGLContext(IDirectFBGL *glContext) void QDirectFbGLContext::makeCurrent() { + QPlatformGLContext::makeCurrent(); m_dfbGlContext->Lock(m_dfbGlContext); } void QDirectFbGLContext::doneCurrent() { + QPlatformGLContext::doneCurrent(); m_dfbGlContext->Unlock(m_dfbGlContext); } -- cgit v0.12 From 6849e252cb8ebadc3211485fd059265635f3aba0 Mon Sep 17 00:00:00 2001 From: con Date: Fri, 15 Apr 2011 16:27:18 +0200 Subject: Adapt to different uikit resolutions. --- src/plugins/platforms/uikit/quikitscreen.mm | 20 +++++++++----------- src/plugins/platforms/uikit/quikitwindow.mm | 2 +- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/plugins/platforms/uikit/quikitscreen.mm b/src/plugins/platforms/uikit/quikitscreen.mm index 97382e3..21494c9 100644 --- a/src/plugins/platforms/uikit/quikitscreen.mm +++ b/src/plugins/platforms/uikit/quikitscreen.mm @@ -53,24 +53,22 @@ QUIKitScreen::QUIKitScreen(int screenIndex) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; UIScreen *screen = [[UIScreen screens] objectAtIndex:screenIndex]; - UIScreenMode *mode = [screen currentMode]; - CGSize size = [mode size]; - m_geometry = QRect(0, 0, size.width, size.height); - CGRect bounds = [screen bounds]; // in 'points', 1p == 1/160in - -// qreal xDpi = size.width * 160. / bounds.size.width; -// qreal yDpi = size.height * 160. / bounds.size.height; -// qDebug() << xDpi << yDpi; + CGRect bounds = [screen bounds]; + m_geometry = QRect(0, 0, bounds.size.width, bounds.size.height); m_format = QImage::Format_ARGB32; m_depth = 24; const qreal inch = 25.4; - const qreal dpi = 160.; + qreal dpi = 160.; + int dragDistance = 14; + if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) { + dpi = 132.; + dragDistance = 10; + } m_physicalSize = QSize(qRound(bounds.size.width * inch / dpi), qRound(bounds.size.height * inch / dpi)); - if (m_index == 0) - qApp->setStartDragDistance(12); + qApp->setStartDragDistance(dragDistance); [pool release]; } diff --git a/src/plugins/platforms/uikit/quikitwindow.mm b/src/plugins/platforms/uikit/quikitwindow.mm index cda5d4c..52d1846 100644 --- a/src/plugins/platforms/uikit/quikitwindow.mm +++ b/src/plugins/platforms/uikit/quikitwindow.mm @@ -127,7 +127,7 @@ private: CAEAGLLayer *eaglLayer = (CAEAGLLayer *)self.layer; eaglLayer.opaque = TRUE; eaglLayer.drawableProperties = [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithBool:NO], kEAGLDrawablePropertyRetainedBacking, + [NSNumber numberWithBool:YES], kEAGLDrawablePropertyRetainedBacking, kEAGLColorFormatRGBA8, kEAGLDrawablePropertyColorFormat, nil]; autocapitalizationType = UITextAutocapitalizationTypeNone; -- cgit v0.12 From dd14d7d1fb0327c702e548db794acca65628ac54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Fri, 15 Apr 2011 16:51:36 +0200 Subject: Lighthouse: Add dummy QSessionManager --- configure | 2 +- src/gui/kernel/kernel.pri | 3 +- src/gui/kernel/qsessionmanager_qpa.cpp | 172 +++++++++++++++++++++++++++++++++ 3 files changed, 175 insertions(+), 2 deletions(-) create mode 100644 src/gui/kernel/qsessionmanager_qpa.cpp diff --git a/configure b/configure index a54cfdf..95e4e28 100755 --- a/configure +++ b/configure @@ -2873,7 +2873,7 @@ if [ -z "$PLATFORM" ]; then esac fi -if [ "$PLATFORM_QWS" = "yes" -o "$PLATFORM_QPA" = "yes" ]; then +if [ "$PLATFORM_QWS" = "yes" ]; then CFG_SM=no PLATFORMS=`find "$relpath/mkspecs/qws" | sed "s,$relpath/mkspecs/qws/,,"` else diff --git a/src/gui/kernel/kernel.pri b/src/gui/kernel/kernel.pri index 32fa3d3..3aa28a4 100644 --- a/src/gui/kernel/kernel.pri +++ b/src/gui/kernel/kernel.pri @@ -248,7 +248,8 @@ qpa { kernel/qplatformglcontext_qpa.cpp \ kernel/qplatformcursor_qpa.cpp \ kernel/qplatformclipboard_qpa.cpp \ - kernel/qplatformnativeinterface_qpa.cpp + kernel/qplatformnativeinterface_qpa.cpp \ + kernel/qsessionmanager_qpa.cpp contains(QT_CONFIG, glib) { SOURCES += \ diff --git a/src/gui/kernel/qsessionmanager_qpa.cpp b/src/gui/kernel/qsessionmanager_qpa.cpp new file mode 100644 index 0000000..e28ac1e --- /dev/null +++ b/src/gui/kernel/qsessionmanager_qpa.cpp @@ -0,0 +1,172 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +#include +#ifndef QT_NO_SESSIONMANAGER + +QT_BEGIN_NAMESPACE + +class QSessionManagerPrivate : public QObjectPrivate +{ +public: + QSessionManagerPrivate(QSessionManager *m, const QString &id, + const QString &key); + + QStringList restartCommand; + QStringList discardCommand; + const QString sessionId; + const QString sessionKey; + QSessionManager::RestartHint restartHint; +}; + +QSessionManagerPrivate::QSessionManagerPrivate(QSessionManager*, + const QString &id, + const QString &key) + : QObjectPrivate(), sessionId(id), sessionKey(key) +{ +} + +QSessionManager::QSessionManager(QApplication *app, QString &id, QString &key) + : QObject(*new QSessionManagerPrivate(this, id, key), app) +{ + Q_D(QSessionManager); + d->restartHint = RestartIfRunning; +} + +QSessionManager::~QSessionManager() +{ +} + +QString QSessionManager::sessionId() const +{ + Q_D(const QSessionManager); + return d->sessionId; +} + +QString QSessionManager::sessionKey() const +{ + Q_D(const QSessionManager); + return d->sessionKey; +} + + +bool QSessionManager::allowsInteraction() +{ + return false; +} + +bool QSessionManager::allowsErrorInteraction() +{ + return false; +} + +void QSessionManager::release() +{ +} + +void QSessionManager::cancel() +{ +} + +void QSessionManager::setRestartHint(QSessionManager::RestartHint hint) +{ + Q_D(QSessionManager); + d->restartHint = hint; +} + +QSessionManager::RestartHint QSessionManager::restartHint() const +{ + Q_D(const QSessionManager); + return d->restartHint; +} + +void QSessionManager::setRestartCommand(const QStringList &command) +{ + Q_D(QSessionManager); + d->restartCommand = command; +} + +QStringList QSessionManager::restartCommand() const +{ + Q_D(const QSessionManager); + return d->restartCommand; +} + +void QSessionManager::setDiscardCommand(const QStringList &command) +{ + Q_D(QSessionManager); + d->discardCommand = command; +} + +QStringList QSessionManager::discardCommand() const +{ + Q_D(const QSessionManager); + return d->discardCommand; +} + +void QSessionManager::setManagerProperty(const QString &name, + const QString &value) +{ + Q_UNUSED(name); + Q_UNUSED(value); +} + +void QSessionManager::setManagerProperty(const QString &name, + const QStringList &value) +{ + Q_UNUSED(name); + Q_UNUSED(value); +} + +bool QSessionManager::isPhase2() const +{ + return false; +} + +void QSessionManager::requestPhase2() +{ +} + +QT_END_NAMESPACE + +#endif // QT_NO_SESSIONMANAGER -- cgit v0.12 From 5769a3bf3c14b08e83ee785a7877be0fd6a37376 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Fri, 15 Apr 2011 17:52:34 +0200 Subject: Add platformNativeInterface assessor to QApplication --- src/gui/kernel/qapplication.h | 6 ++++++ src/gui/kernel/qapplication_qpa.cpp | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/gui/kernel/qapplication.h b/src/gui/kernel/qapplication.h index aa62518..fb61d36 100644 --- a/src/gui/kernel/qapplication.h +++ b/src/gui/kernel/qapplication.h @@ -79,6 +79,8 @@ template class QList; class QLocale; #if defined(Q_WS_QWS) class QDecoration; +#elif defined(Q_WS_QPA) +class QPlatformNativeInterface; #endif #if defined(Q_OS_SYMBIAN) class QSymbianEvent; @@ -254,6 +256,10 @@ public: #endif #endif +#if defined(Q_WS_QPA) + static QPlatformNativeInterface *platformNativeInterface(); +#endif + #if defined(Q_WS_WIN) void winFocus(QWidget *, bool); diff --git a/src/gui/kernel/qapplication_qpa.cpp b/src/gui/kernel/qapplication_qpa.cpp index 1d4400a..b754cf7 100644 --- a/src/gui/kernel/qapplication_qpa.cpp +++ b/src/gui/kernel/qapplication_qpa.cpp @@ -444,6 +444,12 @@ void QApplication::alert(QWidget *, int) { } +QPlatformNativeInterface *QApplication::platformNativeInterface() +{ + QPlatformIntegration *pi = QApplicationPrivate::platformIntegration(); + return pi->nativeInterface(); +} + static void init_platform(const QString &name, const QString &platformPluginPath) { QApplicationPrivate::platform_integration = QPlatformIntegrationFactory::create(name, platformPluginPath); -- cgit v0.12 From c4ae6d8464b9839729744e2710869947c0ec7bd0 Mon Sep 17 00:00:00 2001 From: con Date: Mon, 18 Apr 2011 12:38:54 +0200 Subject: Fix build for Apple gcc Reviewed-by: Paul Olav Tvete --- src/gui/kernel/qsessionmanager_qpa.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/kernel/qsessionmanager_qpa.cpp b/src/gui/kernel/qsessionmanager_qpa.cpp index e28ac1e..ef532d7 100644 --- a/src/gui/kernel/qsessionmanager_qpa.cpp +++ b/src/gui/kernel/qsessionmanager_qpa.cpp @@ -67,7 +67,7 @@ QSessionManagerPrivate::QSessionManagerPrivate(QSessionManager*, } QSessionManager::QSessionManager(QApplication *app, QString &id, QString &key) - : QObject(*new QSessionManagerPrivate(this, id, key), app) + : QObject(*(new QSessionManagerPrivate(this, id, key)), app) { Q_D(QSessionManager); d->restartHint = RestartIfRunning; -- cgit v0.12