diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2009-09-01 08:25:54 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2009-09-01 08:25:54 (GMT) |
commit | 1051e9d0dc5cbad27b89756839f3619cae2d44fe (patch) | |
tree | cd25969458735e14c0b5de365760c3fd7747659d /src/plugins | |
parent | 0d411622521a89c04a416e2aaf3da44b6015b183 (diff) | |
parent | 8f1596ae9b64870c54958611552c71b0b390038f (diff) | |
download | Qt-1051e9d0dc5cbad27b89756839f3619cae2d44fe.zip Qt-1051e9d0dc5cbad27b89756839f3619cae2d44fe.tar.gz Qt-1051e9d0dc5cbad27b89756839f3619cae2d44fe.tar.bz2 |
Merge branch '4.6' of git:qt/qt into 4.6
Diffstat (limited to 'src/plugins')
15 files changed, 162 insertions, 82 deletions
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbkeyboard.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbkeyboard.cpp index fe77fd1..f207ebc 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbkeyboard.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbkeyboard.cpp @@ -41,7 +41,7 @@ #include "qdirectfbkeyboard.h" -#ifndef QT_NO_DIRECTFB +#ifndef QT_NO_QWS_DIRECTFB #include "qdirectfbscreen.h" #include <qobject.h> @@ -53,6 +53,8 @@ #include <fcntl.h> #include <errno.h> +QT_BEGIN_NAMESPACE + class KeyMap : public QHash<DFBInputDeviceKeySymbol, Qt::Key> { public: @@ -429,6 +431,6 @@ KeyMap::KeyMap() insert(DIKS_TILDE , Qt::Key_AsciiTilde); } +QT_END_NAMESPACE #include "qdirectfbkeyboard.moc" - -#endif // QT_NO_DIRECTFB +#endif // QT_NO_QWS_DIRECTFB diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbkeyboard.h b/src/plugins/gfxdrivers/directfb/qdirectfbkeyboard.h index 756892f..96d73ac 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbkeyboard.h +++ b/src/plugins/gfxdrivers/directfb/qdirectfbkeyboard.h @@ -42,13 +42,16 @@ #ifndef QDIRECTFBKEYBOARD_H #define QDIRECTFBKEYBOARD_H +#include <qglobal.h> #include <QtGui/qkbd_qws.h> +#ifndef QT_NO_QWS_DIRECTFB + QT_BEGIN_HEADER -QT_MODULE(Gui) +QT_BEGIN_NAMESPACE -#ifndef QT_NO_DIRECTFB +QT_MODULE(Gui) class QDirectFBKeyboardHandlerPrivate; @@ -62,7 +65,9 @@ private: QDirectFBKeyboardHandlerPrivate *d; }; -#endif // QT_NO_DIRECTFB +QT_END_NAMESPACE + +#endif // QT_NO_QWS_DIRECTFB QT_END_HEADER diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbmouse.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbmouse.cpp index 1f2b363..2fb1520 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbmouse.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbmouse.cpp @@ -41,6 +41,8 @@ #include "qdirectfbmouse.h" +#ifndef QT_NO_QWS_DIRECTFB + #include "qdirectfbscreen.h" #include <qsocketnotifier.h> @@ -49,6 +51,8 @@ #include <fcntl.h> #include <errno.h> +QT_BEGIN_NAMESPACE + class QDirectFBMouseHandlerPrivate : public QObject { Q_OBJECT @@ -269,5 +273,8 @@ void QDirectFBMouseHandler::resume() d->setEnabled(true); } +QT_END_NAMESPACE #include "qdirectfbmouse.moc" +#endif // QT_NO_QWS_DIRECTFB + diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbmouse.h b/src/plugins/gfxdrivers/directfb/qdirectfbmouse.h index 14026ee..5ef229c 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbmouse.h +++ b/src/plugins/gfxdrivers/directfb/qdirectfbmouse.h @@ -42,13 +42,16 @@ #ifndef QDIRECTFBMOUSE_H #define QDIRECTFBMOUSE_H +#include <qglobal.h> #include <QtGui/qmouse_qws.h> +#ifndef QT_NO_QWS_DIRECTFB + QT_BEGIN_HEADER -QT_MODULE(Gui) +QT_BEGIN_NAMESPACE -#ifndef QT_NO_DIRECTFB +QT_MODULE(Gui) class QDirectFBMouseHandlerPrivate; @@ -65,8 +68,8 @@ protected: QDirectFBMouseHandlerPrivate *d; }; -#endif // QT_NO_DIRECTFB +QT_END_NAMESPACE QT_END_HEADER - +#endif // QT_NO_QWS_DIRECTFB #endif // QDIRECTFBMOUSE_H diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp index dec4bdd..106de0d 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp @@ -39,12 +39,14 @@ ** ****************************************************************************/ -#ifndef QT_NO_DIRECTFB - #include "qdirectfbscreen.h" #include "qdirectfbpaintdevice.h" #include "qdirectfbpaintengine.h" +#ifndef QT_NO_QWS_DIRECTFB + +QT_BEGIN_NAMESPACE + QDirectFBPaintDevice::QDirectFBPaintDevice(QDirectFBScreen *scr) : QCustomRasterPaintDevice(0), dfbSurface(0), lockedImage(0), screen(scr), bpl(-1), lockFlgs(DFBSurfaceLockFlags(0)), mem(0), engine(0), @@ -169,5 +171,6 @@ QPaintEngine *QDirectFBPaintDevice::paintEngine() const return engine; } -#endif +QT_END_NAMESPACE +#endif // QT_NO_QWS_DIRECTFB diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h b/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h index ca958c8..f5de44b 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h @@ -43,11 +43,14 @@ #define QDIRECTFBPAINTDEVICE_H #include <private/qpaintengine_raster_p.h> -#include <directfb.h> #include "qdirectfbscreen.h" +#ifndef QT_NO_QWS_DIRECTFB + QT_BEGIN_HEADER +QT_BEGIN_NAMESPACE + QT_MODULE(Gui) // Inherited by both window surface and pixmap @@ -57,7 +60,7 @@ class QDirectFBPaintDevice : public QCustomRasterPaintDevice public: ~QDirectFBPaintDevice(); - IDirectFBSurface *directFBSurface() const; + virtual IDirectFBSurface *directFBSurface() const; void lockDirectFB(DFBSurfaceLockFlags lock); void unlockDirectFB(); @@ -94,6 +97,9 @@ private: Q_DISABLE_COPY(QDirectFBPaintDevice); }; +QT_END_NAMESPACE + QT_END_HEADER +#endif // QT_NO_QWS_DIRECTFB #endif //QDIRECTFBPAINTDEVICE_H diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp index 337e75a..9a9553e 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp @@ -41,7 +41,7 @@ #include "qdirectfbpaintengine.h" -#ifndef QT_NO_DIRECTFB +#ifndef QT_NO_QWS_DIRECTFB #include "qdirectfbwindowsurface.h" #include "qdirectfbscreen.h" @@ -55,6 +55,8 @@ #include <private/qpixmap_raster_p.h> #include <private/qimagepixmapcleanuphooks_p.h> +QT_BEGIN_NAMESPACE + class SurfaceCache; class QDirectFBPaintEnginePrivate : public QRasterPaintEnginePrivate { @@ -145,7 +147,9 @@ private: #ifdef QT_DIRECTFB_IMAGECACHE +QT_BEGIN_INCLUDE_NAMESPACE #include <private/qimage_p.h> +QT_END_INCLUDE_NAMESPACE struct CachedImage { IDirectFBSurface *surface; @@ -1246,4 +1250,7 @@ static void rasterFallbackWarn(const char *msg, const char *func, const device * } #endif // QT_DIRECTFB_WARN_ON_RASTERFALLBACKS -#endif // QT_NO_DIRECTFB + +QT_END_NAMESPACE + +#endif // QT_NO_QWS_DIRECTFB diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.h b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.h index 51468ad..b4f0b5d 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.h +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.h @@ -45,8 +45,12 @@ #include <QtGui/qpaintengine.h> #include <private/qpaintengine_raster_p.h> +#ifndef QT_NO_QWS_DIRECTFB + QT_BEGIN_HEADER +QT_BEGIN_NAMESPACE + QT_MODULE(Gui) class QDirectFBPaintEnginePrivate; @@ -107,6 +111,10 @@ public: static void initImageCache(int size); }; +QT_END_NAMESPACE + QT_END_HEADER +#endif // QT_NO_QWS_DIRECTFB + #endif // QPAINTENGINE_DIRECTFB_P_H diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp index 2e3d32d..0717020 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp @@ -41,6 +41,8 @@ #include "qdirectfbpixmap.h" +#ifndef QT_NO_QWS_DIRECTFB + #include "qdirectfbscreen.h" #include "qdirectfbpaintengine.h" @@ -48,6 +50,9 @@ #include <QtCore/qfile.h> #include <directfb.h> + +QT_BEGIN_NAMESPACE + static int global_ser_no = 0; QDirectFBPixmapData::QDirectFBPixmapData(QDirectFBScreen *screen, PixelType pixelType) @@ -574,3 +579,9 @@ void QDirectFBPixmapData::invalidate() imageFormat = QImage::Format_Invalid; } +QT_END_NAMESPACE + +#endif // QT_NO_QWS_DIRECTFB + + + diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.h b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.h index 8bf1e73..7b4ae47 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.h +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.h @@ -42,6 +42,10 @@ #ifndef QDIRECTFBPIXMAP_H #define QDIRECTFBPIXMAP_H +#include <qglobal.h> + +#ifndef QT_NO_QWS_DIRECTFB + #include <QtGui/private/qpixmapdata_p.h> #include <QtGui/private/qpaintengine_raster_p.h> #include "qdirectfbpaintdevice.h" @@ -49,6 +53,8 @@ QT_BEGIN_HEADER +QT_BEGIN_NAMESPACE + QT_MODULE(Gui) class QDirectFBPaintEngine; @@ -91,6 +97,10 @@ private: bool alpha; }; +QT_END_NAMESPACE + QT_END_HEADER +#endif // QT_NO_QWS_DIRECTFB + #endif // QDIRECTFBPIXMAP_H diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp index 8be0355..59fa191 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp @@ -54,6 +54,10 @@ #include <QtCore/qvector.h> #include <QtCore/qrect.h> +#ifndef QT_NO_QWS_DIRECTFB + +QT_BEGIN_NAMESPACE + class QDirectFBScreenPrivate : public QObject, public QWSGraphicsSystem { Q_OBJECT @@ -94,8 +98,6 @@ public: QDirectFBScreen *q; }; -#include "qdirectfbscreen.moc" - QDirectFBScreenPrivate::QDirectFBScreenPrivate(QDirectFBScreen *qptr) : QWSGraphicsSystem(qptr), dfb(0), flipFlags(DSFLIP_NONE), directFBFlags(QDirectFBScreen::NoFlags), alphaPixmapFormat(QImage::Format_Invalid), @@ -494,14 +496,6 @@ void QDirectFBScreen::setSurfaceColorTable(IDirectFBSurface *surface, #endif // QT_NO_DIRECTFB_PALETTE -#ifndef QT_NO_QWS_CURSOR -#if defined QT_DIRECTFB_WM && defined QT_DIRECTFB_WINDOW_AS_CURSOR -#define QT_DIRECTFB_CURSOR -#elif defined QT_DIRECTFB_LAYER -#define QT_DIRECTFB_CURSOR -#endif -#endif - #if defined QT_DIRECTFB_CURSOR class Q_GUI_EXPORT QDirectFBScreenCursor : public QScreenCursor { @@ -1015,7 +1009,7 @@ static void printDirectFBInfo(IDirectFB *fb, IDirectFBSurface *primarySurface) static inline bool setIntOption(const QStringList &arguments, const QString &variable, int *value) { Q_ASSERT(value); - QRegExp rx(QString("%1=?(\\d+)").arg(variable)); + QRegExp rx(QString::fromLatin1("%1=?(\\d+)").arg(variable)); rx.setCaseSensitivity(Qt::CaseInsensitive); if (arguments.indexOf(rx) != -1) { *value = rx.cap(1).toInt(); @@ -1024,36 +1018,6 @@ static inline bool setIntOption(const QStringList &arguments, const QString &var return false; } -static inline int depth(QImage::Format format) -{ - switch (format) { - case QImage::Format_Mono: - case QImage::Format_MonoLSB: - return 1; - case QImage::Format_Indexed8: - return 8; - case QImage::Format_RGB32: - case QImage::Format_ARGB32: - case QImage::Format_ARGB32_Premultiplied: - return 32; - case QImage::Format_ARGB8565_Premultiplied: - case QImage::Format_RGB666: - case QImage::Format_ARGB6666_Premultiplied: - case QImage::Format_ARGB8555_Premultiplied: - case QImage::Format_RGB888: - return 24; - case QImage::Format_RGB555: - case QImage::Format_RGB444: - case QImage::Format_RGB16: - case QImage::Format_ARGB4444_Premultiplied: - return 16; - case QImage::Format_Invalid: - case QImage::NImageFormats: - break; - } - return -1; -} - bool QDirectFBScreen::connect(const QString &displaySpec) { DFBResult result = DFB_OK; @@ -1199,7 +1163,7 @@ bool QDirectFBScreen::connect(const QString &displaySpec) break; } setPixelFormat(pixelFormat); - QScreen::d = ::depth(pixelFormat); + QScreen::d = QDirectFBScreen::depth(pixelFormat); data = 0; lstep = 0; size = 0; @@ -1227,6 +1191,8 @@ bool QDirectFBScreen::connect(const QString &displaySpec) "Unable to get screen size!", result); return false; } + ::setIntOption(displayArgs, QLatin1String("width"), &w); + ::setIntOption(displayArgs, QLatin1String("height"), &h); dw = w; dh = h; @@ -1252,7 +1218,7 @@ bool QDirectFBScreen::connect(const QString &displaySpec) surface->Release(surface); #endif - QRegExp backgroundColorRegExp("bgcolor=?(.+)"); + QRegExp backgroundColorRegExp(QLatin1String("bgcolor=?(.+)")); backgroundColorRegExp.setCaseSensitivity(Qt::CaseInsensitive); if (displayArgs.indexOf(backgroundColorRegExp) != -1) { d_ptr->backgroundColor.setNamedColor(backgroundColorRegExp.cap(1)); @@ -1305,12 +1271,10 @@ bool QDirectFBScreen::initDevice() } #endif -#ifndef QT_NO_QWS_CURSOR -#if defined QT_NO_DIRECTFB_WM || defined QT_NO_DIRECTFB_LAYER - QScreenCursor::initSoftwareCursor(); -#else +#ifdef QT_DIRECTFB_CURSOR qt_screencursor = new QDirectFBScreenCursor; -#endif +#elif !defined QT_NO_QWS_CURSOR + QScreenCursor::initSoftwareCursor(); #endif return true; } @@ -1370,17 +1334,18 @@ QWSWindowSurface *QDirectFBScreen::createSurface(const QString &key) const // window surfaces. Normal, directFB surfaces are handled by DirectFB. void QDirectFBScreen::exposeRegion(QRegion r, int changing) { -#ifdef QT_NO_DIRECTFB_WM +#if defined QT_NO_DIRECTFB_WM const QList<QWSWindow*> windows = QWSServer::instance()->clientWindows(); - if (changing < 0 || changing >= windows.size()) + if (changing < 0 || changing >= windows.size()) { return; - + } QWSWindow *win = windows.at(changing); QWSWindowSurface *s = win->windowSurface(); r &= region(); - if (r.isEmpty()) + if (r.isEmpty()) { return; + } const QRect brect = r.boundingRect(); @@ -1398,15 +1363,18 @@ void QDirectFBScreen::exposeRegion(QRegion r, int changing) ? static_cast<QDirectFBWindowSurface*>(s) : 0; if (dfbWindowSurface) { IDirectFBSurface *surface = dfbWindowSurface->directFBSurface(); + Q_ASSERT(surface); const int n = insideWindow.numRects(); if (n == 1 || d_ptr->directFBFlags & BoundingRectFlip) { const QRect source = (insideWindow.boundingRect().intersected(windowGeometry)).translated(-windowGeometry.topLeft()); const DFBRectangle rect = { source.x(), source.y(), source.width(), source.height() }; + d_ptr->primarySurface->Blit(d_ptr->primarySurface, surface, &rect, windowGeometry.x() + source.x(), windowGeometry.y() + source.y()); + } else { const QVector<QRect> rects = insideWindow.rects(); QVarLengthArray<DFBRectangle, 16> dfbRectangles(n); @@ -1429,6 +1397,7 @@ void QDirectFBScreen::exposeRegion(QRegion r, int changing) } } +#ifdef QT_NO_DIRECTFB_CURSOR if (QScreenCursor *cursor = QScreenCursor::instance()) { const QRect cursorRectangle = cursor->boundingRect(); if (cursor->isVisible() && !cursor->isAccelerated() && cursorRectangle.intersects(brect)) { @@ -1442,6 +1411,7 @@ void QDirectFBScreen::exposeRegion(QRegion r, int changing) #endif } } +#endif flipSurface(d_ptr->primarySurface, d_ptr->flipFlags, r, QPoint()); #else Q_UNUSED(r); @@ -1459,8 +1429,8 @@ void QDirectFBScreen::solidFill(const QColor &color, const QRegion ®ion) return; d_ptr->primarySurface->SetColor(d_ptr->primarySurface, - color.red(), color.green(), color.blue(), - color.alpha()); + color.red(), color.green(), color.blue(), + color.alpha()); const int n = region.numRects(); if (n > 1) { const QRect r = region.boundingRect(); @@ -1590,3 +1560,8 @@ IDirectFBSurface *QDirectFBScreen::subSurfaceForWidget(const QWidget *widget, co return subSurface; } +QT_END_NAMESPACE + +#include "qdirectfbscreen.moc" +#endif // QT_NO_QWS_DIRECTFB + diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h index df0eea4..e74adb1 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h +++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h @@ -42,12 +42,16 @@ #ifndef QDIRECTFBSCREEN_H #define QDIRECTFBSCREEN_H +#include <qglobal.h> +#ifndef QT_NO_QWS_DIRECTFB #include <QtGui/qscreen_qws.h> #include <directfb.h> #include <directfb_version.h> QT_BEGIN_HEADER +QT_BEGIN_NAMESPACE + QT_MODULE(Gui) #if !defined QT_NO_DIRECTFB_LAYER && !defined QT_DIRECTFB_LAYER @@ -83,6 +87,16 @@ QT_MODULE(Gui) #if !defined QT_NO_DIRECTFB_OPAQUE_DETECTION && !defined QT_DIRECTFB_OPAQUE_DETECTION #define QT_DIRECTFB_OPAQUE_DETECTION #endif +#ifndef QT_NO_QWS_CURSOR +#if defined QT_DIRECTFB_WM && defined QT_DIRECTFB_WINDOW_AS_CURSOR +#define QT_DIRECTFB_CURSOR +#elif defined QT_DIRECTFB_LAYER +#define QT_DIRECTFB_CURSOR +#endif +#endif +#ifndef QT_DIRECTFB_CURSOR +#define QT_NO_DIRECTFB_CURSOR +#endif #if defined QT_NO_DIRECTFB_LAYER && defined QT_DIRECTFB_WM #error QT_NO_DIRECTFB_LAYER requires QT_NO_DIRECTFB_WM #endif @@ -269,6 +283,10 @@ inline bool QDirectFBScreen::hasAlphaChannel(IDirectFBSurface *surface) return QDirectFBScreen::hasAlphaChannel(format); } +QT_END_NAMESPACE + QT_END_HEADER +#endif // QT_NO_QWS_DIRECTFB #endif // QDIRECTFBSCREEN_H + diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreenplugin.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbscreenplugin.cpp index 4caee414..05fe70f 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbscreenplugin.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreenplugin.cpp @@ -43,6 +43,7 @@ #include <QtGui/qscreendriverplugin_qws.h> #include <QtCore/qstringlist.h> +#ifndef QT_NO_QWS_DIRECTFB class DirectFBScreenDriverPlugin : public QScreenDriverPlugin { @@ -73,3 +74,5 @@ QScreen* DirectFBScreenDriverPlugin::create(const QString& driver, } Q_EXPORT_PLUGIN2(qdirectfbscreen, DirectFBScreenDriverPlugin) + +#endif diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp index a05ad21..73a6dd7 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp @@ -48,11 +48,15 @@ #include <qpaintdevice.h> #include <qvarlengtharray.h> +#ifndef QT_NO_QWS_DIRECTFB + +QT_BEGIN_NAMESPACE + QDirectFBWindowSurface::QDirectFBWindowSurface(DFBSurfaceFlipFlags flip, QDirectFBScreen *scr) : QDirectFBPaintDevice(scr) + , sibling(0) #ifndef QT_NO_DIRECTFB_WM , dfbWindow(0) - , sibling(0) #endif , flipFlags(flip) , boundingRectFlip(scr->directFBFlags() & QDirectFBScreen::BoundingRectFlip) @@ -69,9 +73,9 @@ QDirectFBWindowSurface::QDirectFBWindowSurface(DFBSurfaceFlipFlags flip, QDirect QDirectFBWindowSurface::QDirectFBWindowSurface(DFBSurfaceFlipFlags flip, QDirectFBScreen *scr, QWidget *widget) : QWSWindowSurface(widget), QDirectFBPaintDevice(scr) + , sibling(0) #ifndef QT_NO_DIRECTFB_WM , dfbWindow(0) - , sibling(0) #endif , flipFlags(flip) , boundingRectFlip(scr->directFBFlags() & QDirectFBScreen::BoundingRectFlip) @@ -243,23 +247,16 @@ void QDirectFBWindowSurface::setGeometry(const QRect &rect) QByteArray QDirectFBWindowSurface::permanentState() const { -#ifdef QT_DIRECTFB_WM QByteArray state(sizeof(this), 0); *reinterpret_cast<const QDirectFBWindowSurface**>(state.data()) = this; return state; -#endif - return QByteArray(); } void QDirectFBWindowSurface::setPermanentState(const QByteArray &state) { -#ifdef QT_DIRECTFB_WM if (state.size() == sizeof(this)) { sibling = *reinterpret_cast<QDirectFBWindowSurface *const*>(state.constData()); } -#else - Q_UNUSED(state); -#endif } static inline void scrollSurface(IDirectFBSurface *surface, const QRect &r, int dx, int dy) @@ -381,6 +378,7 @@ void QDirectFBWindowSurface::flush(QWidget *, const QRegion ®ion, } } +#ifdef QT_NO_DIRECTFB_CURSOR if (QScreenCursor *cursor = QScreenCursor::instance()) { const QRect cursorRectangle = cursor->boundingRect(); if (cursor->isVisible() && !cursor->isAccelerated() @@ -396,6 +394,7 @@ void QDirectFBWindowSurface::flush(QWidget *, const QRegion ®ion, #endif } } +#endif if (mode == Offscreen) { screen->flipSurface(primarySurface, flipFlags, region, offset + windowGeometry.topLeft()); } else @@ -424,6 +423,14 @@ void QDirectFBWindowSurface::endPaint(const QRegion &) unlockDirectFB(); } +IDirectFBSurface *QDirectFBWindowSurface::directFBSurface() const +{ + if (!dfbSurface && sibling && sibling->dfbSurface) + return sibling->dfbSurface; + return dfbSurface; +} + + IDirectFBSurface *QDirectFBWindowSurface::surfaceForWidget(const QWidget *widget, QRect *rect) const { Q_ASSERT(widget); @@ -449,3 +456,9 @@ void QDirectFBWindowSurface::updateFormat() { imageFormat = dfbSurface ? QDirectFBScreen::getImageFormat(dfbSurface) : QImage::Format_Invalid; } + +QT_END_NAMESPACE + +#endif // QT_NO_QWS_DIRECTFB + + diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h index a2861e5..ca76613 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h +++ b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h @@ -46,9 +46,10 @@ #include "qdirectfbpaintdevice.h" #include "qdirectfbscreen.h" +#ifndef QT_NO_QWS_DIRECTFB + #include <private/qpaintengine_raster_p.h> #include <private/qwindowsurface_qws_p.h> -#include <directfb.h> #ifdef QT_DIRECTFB_TIMING #include <qdatetime.h> @@ -56,6 +57,8 @@ QT_BEGIN_HEADER +QT_BEGIN_NAMESPACE + QT_MODULE(Gui) class QDirectFBWindowSurface : public QWSWindowSurface, public QDirectFBPaintDevice @@ -89,12 +92,14 @@ public: void endPaint(const QRegion &); IDirectFBSurface *surfaceForWidget(const QWidget *widget, QRect *rect) const; + IDirectFBSurface *directFBSurface() const; private: void updateFormat(); + QDirectFBWindowSurface *sibling; + #ifdef QT_DIRECTFB_WM void createWindow(); IDirectFBWindow *dfbWindow; - QDirectFBWindowSurface *sibling; #else enum Mode { Primary, @@ -110,6 +115,10 @@ private: #endif }; +QT_END_NAMESPACE + QT_END_HEADER +#endif // QT_NO_QWS_DIRECTFB + #endif // QDIRECFBWINDOWSURFACE_H |