diff options
author | Jørgen Lind <jorgen.lind@nokia.com> | 2011-04-14 10:23:42 (GMT) |
---|---|---|
committer | Jørgen Lind <jorgen.lind@nokia.com> | 2011-04-14 10:23:42 (GMT) |
commit | b56444d86aa449e2da15d9b9fd08001f09ac9b25 (patch) | |
tree | 171f6c0be5cc1c2935f15757630c8583bf0b2dd9 /src/plugins | |
parent | 5f68933c9adbf2dc1d6150d5771c8443395d6780 (diff) | |
parent | 662174b78b7e08c759d0086e215e81e9e0eaf0c5 (diff) | |
download | Qt-b56444d86aa449e2da15d9b9fd08001f09ac9b25.zip Qt-b56444d86aa449e2da15d9b9fd08001f09ac9b25.tar.gz Qt-b56444d86aa449e2da15d9b9fd08001f09ac9b25.tar.bz2 |
Merge remote-tracking branch 'origin/master' into lighthouse-master
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/audio/audio.pro | 3 | ||||
-rw-r--r-- | src/plugins/bearer/connman/qofonoservice_linux.cpp | 5 | ||||
-rw-r--r-- | src/plugins/bearer/connman/qofonoservice_linux_p.h | 6 | ||||
-rw-r--r-- | src/plugins/bearer/icd/dbusdispatcher.cpp | 9 | ||||
-rw-r--r-- | src/plugins/bearer/icd/qnetworksession_impl.cpp | 14 | ||||
-rw-r--r-- | src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp | 5 | ||||
-rw-r--r-- | src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwswsegl.c | 5 | ||||
-rw-r--r-- | src/plugins/graphicssystems/meego/qmeegographicssystem.cpp | 58 | ||||
-rw-r--r-- | src/plugins/graphicssystems/meego/qmeegographicssystem.h | 6 | ||||
-rw-r--r-- | src/plugins/graphicssystems/meego/qmeegolivepixmapdata.cpp | 12 | ||||
-rw-r--r-- | src/plugins/plugins.pro | 1 | ||||
-rw-r--r-- | src/plugins/s60/3_2/3_2.pro | 1 | ||||
-rw-r--r-- | src/plugins/s60/5_0/5_0.pro | 1 | ||||
-rw-r--r-- | src/plugins/s60/src/qlocale_3_2.cpp | 2 |
14 files changed, 101 insertions, 27 deletions
diff --git a/src/plugins/audio/audio.pro b/src/plugins/audio/audio.pro deleted file mode 100644 index b7a775b..0000000 --- a/src/plugins/audio/audio.pro +++ /dev/null @@ -1,3 +0,0 @@ -TEMPLATE = subdirs -SUBDIRS = - diff --git a/src/plugins/bearer/connman/qofonoservice_linux.cpp b/src/plugins/bearer/connman/qofonoservice_linux.cpp index 2a22280..e3fb2c6 100644 --- a/src/plugins/bearer/connman/qofonoservice_linux.cpp +++ b/src/plugins/bearer/connman/qofonoservice_linux.cpp @@ -53,6 +53,8 @@ #include "qofonoservice_linux_p.h" +#ifndef QT_NO_BEARERMANAGEMENT +#ifndef QT_NO_DBUS QT_BEGIN_NAMESPACE static QDBusConnection dbusConnection = QDBusConnection::systemBus(); @@ -938,3 +940,6 @@ void QOfonoSmsInterface::sendMessage(const QString &to, const QString &message) } QT_END_NAMESPACE + +#endif // QT_NO_DBUS +#endif // QT_NO_BEARERMANAGEMENT diff --git a/src/plugins/bearer/connman/qofonoservice_linux_p.h b/src/plugins/bearer/connman/qofonoservice_linux_p.h index 4db08f5..af54ba0 100644 --- a/src/plugins/bearer/connman/qofonoservice_linux_p.h +++ b/src/plugins/bearer/connman/qofonoservice_linux_p.h @@ -65,6 +65,9 @@ #include <QtDBus/QDBusContext> #include <QMap> +#ifndef QT_NO_BEARERMANAGEMENT +#ifndef QT_NO_DBUS + #define OFONO_SERVICE "org.ofono" #define OFONO_MANAGER_INTERFACE "org.ofono.Manager" #define OFONO_MANAGER_PATH "/" @@ -331,4 +334,7 @@ Q_SIGNALS: QT_END_NAMESPACE +#endif // QT_NO_DBUS +#endif // QT_NO_BEARERMANAGEMENT + #endif //QOFONOSERVICE_H diff --git a/src/plugins/bearer/icd/dbusdispatcher.cpp b/src/plugins/bearer/icd/dbusdispatcher.cpp index 13cd8a9..a317cb4 100644 --- a/src/plugins/bearer/icd/dbusdispatcher.cpp +++ b/src/plugins/bearer/icd/dbusdispatcher.cpp @@ -194,18 +194,21 @@ static bool appendVariantToDBusMessage(const QVariant& argument, &int32_data); break; - case QVariant::String: - str_data = argument.toString().toLatin1().data(); + case QVariant::String: { + QByteArray data = argument.toString().toLatin1(); + str_data = data.data(); dbus_message_iter_append_basic(dbus_iter, DBUS_TYPE_STRING, &str_data); break; + } case QVariant::StringList: str_list = argument.toStringList(); dbus_message_iter_open_container(dbus_iter, DBUS_TYPE_ARRAY, "s", &array_iter); for (idx = 0; idx < str_list.size(); idx++) { - str_data = str_list.at(idx).toLatin1().data(); + QByteArray data = str_list.at(idx).toLatin1(); + str_data = data.data(); dbus_message_iter_append_basic(&array_iter, DBUS_TYPE_STRING, &str_data); diff --git a/src/plugins/bearer/icd/qnetworksession_impl.cpp b/src/plugins/bearer/icd/qnetworksession_impl.cpp index af5d85e..94a6c81 100644 --- a/src/plugins/bearer/icd/qnetworksession_impl.cpp +++ b/src/plugins/bearer/icd/qnetworksession_impl.cpp @@ -621,21 +621,21 @@ static QString get_network_interface() if (ret == 0) { /* No results */ #ifdef BEARER_MANAGEMENT_DEBUG - qDebug() << "Cannot get addrinfo from icd, are you connected or is icd running?"; + qDebug() << "Cannot get addrinfo from icd, are you connected or is icd running?"; #endif - return iface; + return iface; } if (addr_results.first().ip_info.isEmpty()) - return QString(); + return QString(); - const char *address = addr_results.first().ip_info.first().address.toAscii().constData(); + QByteArray data = addr_results.first().ip_info.first().address.toAscii(); struct in_addr addr; - if (inet_aton(address, &addr) == 0) { + if (inet_aton(data.constData(), &addr) == 0) { #ifdef BEARER_MANAGEMENT_DEBUG - qDebug() << "address" << address << "invalid"; + qDebug() << "address" << data.constData() << "invalid"; #endif - return iface; + return iface; } struct ifaddrs *ifaddr, *ifa; diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp index dc74c4e..6d6fb02 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp @@ -1025,11 +1025,10 @@ void QDirectFBPaintEnginePrivate::setCompositionMode(QPainter::CompositionMode m case QPainter::CompositionMode_DestinationOut: surface->SetPorterDuff(surface, DSPD_DST_OUT); break; -#if (Q_DIRECTFB_VERSION >= 0x010209) case QPainter::CompositionMode_Destination: - surface->SetPorterDuff(surface, DSPD_DST); + surface->SetSrcBlendFunction(surface, DSBF_ZERO); + surface->SetDstBlendFunction(surface, DSBF_ONE); break; -#endif #if (Q_DIRECTFB_VERSION >= 0x010000) case QPainter::CompositionMode_SourceAtop: surface->SetPorterDuff(surface, DSPD_SRC_ATOP); diff --git a/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwswsegl.c b/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwswsegl.c index 8a1fddf..f861838 100644 --- a/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwswsegl.c +++ b/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwswsegl.c @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include <GLES/egltypes.h> +#include <GLES/eglplatform.h> #include <wsegl.h> #include <pvr2d.h> #include <string.h> @@ -202,7 +202,8 @@ static WSEGLError wseglDeleteDrawable(WSEGLDrawableHandle _drawable) PvrQwsDrawable *drawable = (PvrQwsDrawable *)_drawable; if (!drawable || drawable->type == PvrQwsScreen) return WSEGL_SUCCESS; - pvrQwsFreeBuffers(drawable); + if (pvrQwsDisplay.numFlipBuffers == 0) + pvrQwsFreeBuffers(drawable); if (pvrQwsReleaseWindow(drawable)) pvrQwsDestroyDrawable(drawable); return WSEGL_SUCCESS; diff --git a/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp b/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp index 18a0944..fdb72de 100644 --- a/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp +++ b/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp @@ -59,12 +59,16 @@ #include "qmeegographicssystem.h" #include "qmeegoextensions.h" +#include <QTimer> + bool QMeeGoGraphicsSystem::surfaceWasCreated = false; QHash <Qt::HANDLE, QPixmap*> QMeeGoGraphicsSystem::liveTexturePixmaps; QList<QMeeGoSwitchCallback> QMeeGoGraphicsSystem::switchCallbacks; +QMeeGoGraphicsSystem::SwitchPolicy QMeeGoGraphicsSystem::switchPolicy = QMeeGoGraphicsSystem::AutomaticSwitch; + QMeeGoGraphicsSystem::QMeeGoGraphicsSystem() { qDebug("Using the meego graphics system"); @@ -85,8 +89,12 @@ public: void addWidget(QWidget *widget); bool eventFilter(QObject *, QEvent *); + void handleMapNotify(); + private slots: void removeWidget(QObject *object); + void switchToRaster(); + void switchToMeeGo(); private: int visibleWidgets() const; @@ -95,22 +103,46 @@ private: QList<QWidget *> m_widgets; }; +typedef bool(*QX11FilterFunction)(XEvent *event); +Q_GUI_EXPORT void qt_installX11EventFilter(QX11FilterFunction func); + +static bool x11EventFilter(XEvent *event); + QMeeGoGraphicsSystemSwitchHandler::QMeeGoGraphicsSystemSwitchHandler() { + qt_installX11EventFilter(x11EventFilter); } void QMeeGoGraphicsSystemSwitchHandler::addWidget(QWidget *widget) { - if (!m_widgets.contains(widget)) { + if (widget != qt_gl_share_widget() && !m_widgets.contains(widget)) { widget->installEventFilter(this); connect(widget, SIGNAL(destroyed(QObject *)), this, SLOT(removeWidget(QObject *))); m_widgets << widget; } } +void QMeeGoGraphicsSystemSwitchHandler::handleMapNotify() +{ + if (m_widgets.isEmpty() && QMeeGoGraphicsSystem::switchPolicy == QMeeGoGraphicsSystem::AutomaticSwitch) + QTimer::singleShot(0, this, SLOT(switchToMeeGo())); +} + void QMeeGoGraphicsSystemSwitchHandler::removeWidget(QObject *object) { m_widgets.removeOne(static_cast<QWidget *>(object)); + if (m_widgets.isEmpty() && QMeeGoGraphicsSystem::switchPolicy == QMeeGoGraphicsSystem::AutomaticSwitch) + QTimer::singleShot(0, this, SLOT(switchToRaster())); +} + +void QMeeGoGraphicsSystemSwitchHandler::switchToRaster() +{ + QMeeGoGraphicsSystem::switchToRaster(); +} + +void QMeeGoGraphicsSystemSwitchHandler::switchToMeeGo() +{ + QMeeGoGraphicsSystem::switchToMeeGo(); } int QMeeGoGraphicsSystemSwitchHandler::visibleWidgets() const @@ -123,7 +155,9 @@ int QMeeGoGraphicsSystemSwitchHandler::visibleWidgets() const bool QMeeGoGraphicsSystemSwitchHandler::eventFilter(QObject *object, QEvent *event) { - if (event->type() == QEvent::WindowStateChange) { + if (event->type() == QEvent::WindowStateChange + && QMeeGoGraphicsSystem::switchPolicy == QMeeGoGraphicsSystem::AutomaticSwitch) + { QWindowStateChangeEvent *change = static_cast<QWindowStateChangeEvent *>(event); QWidget *widget = static_cast<QWidget *>(object); @@ -136,7 +170,7 @@ bool QMeeGoGraphicsSystemSwitchHandler::eventFilter(QObject *object, QEvent *eve if (visibleWidgets() == 0) QMeeGoGraphicsSystem::switchToRaster(); } else { - if (visibleWidgets() == 1) + if (visibleWidgets() > 0) QMeeGoGraphicsSystem::switchToMeeGo(); } } @@ -148,6 +182,13 @@ bool QMeeGoGraphicsSystemSwitchHandler::eventFilter(QObject *object, QEvent *eve Q_GLOBAL_STATIC(QMeeGoGraphicsSystemSwitchHandler, switch_handler) +bool x11EventFilter(XEvent *event) +{ + if (event->type == MapNotify) + switch_handler()->handleMapNotify(); + return false; +} + QWindowSurface* QMeeGoGraphicsSystem::createWindowSurface(QWidget *widget) const { QGLWidget *shareWidget = qt_gl_share_widget(); @@ -176,7 +217,7 @@ QPixmapData *QMeeGoGraphicsSystem::createPixmapData(QPixmapData *origin) // and if the pixmap pointer matches our mapping... // create a shared image instead with the given handle. - if (origin->classId() == QPixmapData::RasterClass) { + if (!origin->isNull() && origin->classId() == QPixmapData::RasterClass) { QRasterPixmapData *rasterClass = static_cast <QRasterPixmapData *> (origin); void *rawResource = static_cast <void *> (rasterClass->buffer()->data_ptr()->data); @@ -343,7 +384,7 @@ QString QMeeGoGraphicsSystem::runningGraphicsSystemName() void QMeeGoGraphicsSystem::switchToMeeGo() { - if (meeGoRunning()) + if (switchPolicy == NoSwitch || meeGoRunning()) return; if (QApplicationPrivate::instance()->graphics_system_name != QLatin1String("runtime")) @@ -360,7 +401,7 @@ void QMeeGoGraphicsSystem::switchToMeeGo() void QMeeGoGraphicsSystem::switchToRaster() { - if (runningGraphicsSystemName() == QLatin1String("raster")) + if (switchPolicy == NoSwitch || runningGraphicsSystemName() == QLatin1String("raster")) return; if (QApplicationPrivate::instance()->graphics_system_name != QLatin1String("runtime")) @@ -485,4 +526,9 @@ void qt_meego_register_switch_callback(QMeeGoSwitchCallback callback) QMeeGoGraphicsSystem::registerSwitchCallback(callback); } +void qt_meego_set_switch_policy(int policy) +{ + QMeeGoGraphicsSystem::switchPolicy = QMeeGoGraphicsSystem::SwitchPolicy(policy); +} + #include "qmeegographicssystem.moc" diff --git a/src/plugins/graphicssystems/meego/qmeegographicssystem.h b/src/plugins/graphicssystems/meego/qmeegographicssystem.h index ecc85b2..3528425 100644 --- a/src/plugins/graphicssystems/meego/qmeegographicssystem.h +++ b/src/plugins/graphicssystems/meego/qmeegographicssystem.h @@ -52,6 +52,8 @@ extern "C" typedef void (*QMeeGoSwitchCallback)(int type, const char *name); class QMeeGoGraphicsSystem : public QGraphicsSystem { public: + enum SwitchPolicy { AutomaticSwitch, ManualSwitch, NoSwitch }; + QMeeGoGraphicsSystem(); ~QMeeGoGraphicsSystem(); @@ -84,6 +86,8 @@ public: static void registerSwitchCallback(QMeeGoSwitchCallback callback); + static SwitchPolicy switchPolicy; + private: static bool meeGoRunning(); static EGLSurface getSurfaceForLiveTexturePixmap(QPixmap *pixmap); @@ -93,7 +97,6 @@ private: static bool surfaceWasCreated; static QHash<Qt::HANDLE, QPixmap*> liveTexturePixmaps; static QList<QMeeGoSwitchCallback> switchCallbacks; - }; /* C api */ @@ -118,6 +121,7 @@ extern "C" { Q_DECL_EXPORT void qt_meego_switch_to_raster(void); Q_DECL_EXPORT void qt_meego_switch_to_meego(void); Q_DECL_EXPORT void qt_meego_register_switch_callback(QMeeGoSwitchCallback callback); + Q_DECL_EXPORT void qt_meego_set_switch_policy(int policy); } #endif diff --git a/src/plugins/graphicssystems/meego/qmeegolivepixmapdata.cpp b/src/plugins/graphicssystems/meego/qmeegolivepixmapdata.cpp index 0970b89..b6ba7ec 100644 --- a/src/plugins/graphicssystems/meego/qmeegolivepixmapdata.cpp +++ b/src/plugins/graphicssystems/meego/qmeegolivepixmapdata.cpp @@ -194,6 +194,8 @@ QImage* QMeeGoLivePixmapData::lock(EGLSyncKHR fenceSync) void *data = 0; int pitch = 0; + int surfaceWidth = 0; + int surfaceHeight = 0; EGLSurface surface = 0; QImage::Format format; lockedImage = QImage(); @@ -206,9 +208,11 @@ QImage* QMeeGoLivePixmapData::lock(EGLSyncKHR fenceSync) eglQuerySurface(QEgl::display(), surface, EGL_BITMAP_POINTER_KHR, (EGLint*) &data); eglQuerySurface(QEgl::display(), surface, EGL_BITMAP_PITCH_KHR, (EGLint*) &pitch); + eglQuerySurface(QEgl::display(), surface, EGL_WIDTH, (EGLint*) &surfaceWidth); + eglQuerySurface(QEgl::display(), surface, EGL_HEIGHT, (EGLint*) &surfaceHeight); // Ok, here we know we just support those two formats. Real solution would be: - // uqery also the format. + // query also the format. if (backingX11Pixmap->depth() > 16) format = QImage::Format_ARGB32_Premultiplied; else @@ -219,6 +223,12 @@ QImage* QMeeGoLivePixmapData::lock(EGLSyncKHR fenceSync) return &lockedImage; } + if (width() != surfaceWidth || height() != surfaceHeight) { + qWarning("Live texture dimensions don't match!"); + QMeeGoExtensions::eglUnlockSurfaceKHR(QEgl::display(), surface); + return &lockedImage; + } + lockedImage = QImage((uchar *) data, width(), height(), pitch, format); return &lockedImage; } diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro index 3e7da0e..7479d2f 100644 --- a/src/plugins/plugins.pro +++ b/src/plugins/plugins.pro @@ -13,6 +13,5 @@ embedded:SUBDIRS *= gfxdrivers decorations mousedrivers kbddrivers !symbian:!contains(QT_CONFIG, no-gui):SUBDIRS += accessible symbian:SUBDIRS += s60 contains(QT_CONFIG, phonon): SUBDIRS *= phonon -contains(QT_CONFIG, multimedia): SUBDIRS *= audio qpa:SUBDIRS += platforms contains(QT_CONFIG, declarative): SUBDIRS *= qmltooling diff --git a/src/plugins/s60/3_2/3_2.pro b/src/plugins/s60/3_2/3_2.pro index 0524866..b104c05 100644 --- a/src/plugins/s60/3_2/3_2.pro +++ b/src/plugins/s60/3_2/3_2.pro @@ -16,6 +16,7 @@ contains(S60_VERSION, 3.1) { LIBS += -lDirectoryLocalizer } LIBS += -lefsrv + LIBS += -lnumberconversion INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE } diff --git a/src/plugins/s60/5_0/5_0.pro b/src/plugins/s60/5_0/5_0.pro index 00aea1b..b037215 100644 --- a/src/plugins/s60/5_0/5_0.pro +++ b/src/plugins/s60/5_0/5_0.pro @@ -16,6 +16,7 @@ contains(S60_VERSION, 3.1) { LIBS += -lDirectoryLocalizer } LIBS += -lefsrv + LIBS += -lnumberconversion INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE } diff --git a/src/plugins/s60/src/qlocale_3_2.cpp b/src/plugins/s60/src/qlocale_3_2.cpp index 8c0edd2..ecbf46c 100644 --- a/src/plugins/s60/src/qlocale_3_2.cpp +++ b/src/plugins/s60/src/qlocale_3_2.cpp @@ -42,6 +42,7 @@ #include <exception> #include <e32std.h> #include <e32base.h> +#include <numberconversion.h> EXPORT_C TPtrC defaultGetLongDateFormatSpec(TExtendedLocale& locale) { @@ -61,4 +62,5 @@ EXPORT_C TPtrC defaultGetTimeFormatSpec(TExtendedLocale& locale) EXPORT_C void defaultFormatL(TTime& time, TDes& des, const TDesC& format, const TLocale& locale) { time.FormatL(des, format, locale); + NumberConversion::ConvertDigits(des, locale.DigitType()); } |