diff options
-rwxr-xr-x | configure | 2 | ||||
-rw-r--r-- | src/gui/kernel/kernel.pri | 3 | ||||
-rw-r--r-- | src/gui/kernel/qapplication.h | 6 | ||||
-rw-r--r-- | src/gui/kernel/qapplication_qpa.cpp | 6 | ||||
-rw-r--r-- | src/gui/kernel/qsessionmanager_qpa.cpp | 172 | ||||
-rw-r--r-- | src/plugins/platforms/directfb/qdirectfbglcontext.cpp | 2 | ||||
-rw-r--r-- | src/plugins/platforms/uikit/quikitscreen.mm | 20 | ||||
-rw-r--r-- | src/plugins/platforms/uikit/quikitwindow.mm | 2 | ||||
-rw-r--r-- | src/plugins/platforms/uikit/quikitwindowsurface.h | 1 | ||||
-rw-r--r-- | src/plugins/platforms/uikit/quikitwindowsurface.mm | 6 |
10 files changed, 205 insertions, 15 deletions
@@ -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/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 <typename T> 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); diff --git a/src/gui/kernel/qsessionmanager_qpa.cpp b/src/gui/kernel/qsessionmanager_qpa.cpp new file mode 100644 index 0000000..ef532d7 --- /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 <qsessionmanager.h> + +#include <private/qobject_p.h> +#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 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); } 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; 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 |