summaryrefslogtreecommitdiffstats
path: root/tests/auto/qtconcurrentthreadengine
Commit message (Expand)AuthorAgeFilesLines
* Update license headers again.Jason McDonald2009-09-091-4/+4
* Update tech preview license header.Jason McDonald2009-08-311-13/+13
* Update license headers.Jason McDonald2009-08-111-1/+1
* Update license headers as requested by the marketing department.Jason McDonald2009-06-161-2/+2
* Long live Qt 4.5!Lars Knoll2009-03-233-0/+540
Qt.git/diff/src/plugins/platforms/directfb/qdirectfbblitter.cpp?h=v4.8.4&id=6f5ad5dcab8e6f702894c4fa5c016d9837375626'>src/plugins/platforms/directfb/qdirectfbblitter.cpp (renamed from src/plugins/platforms/directfb/qblitter_directfb.cpp)15
-rw-r--r--src/plugins/platforms/directfb/qdirectfbblitter.h (renamed from src/plugins/platforms/directfb/qblitter_directfb.h)0
-rw-r--r--src/plugins/platforms/directfb/qdirectfbconvenience.cpp2
-rw-r--r--src/plugins/platforms/directfb/qdirectfbcursor.cpp3
-rw-r--r--src/plugins/platforms/directfb/qdirectfbinput.cpp13
-rw-r--r--src/plugins/platforms/directfb/qdirectfbinput.h4
-rw-r--r--src/plugins/platforms/directfb/qdirectfbintegration.cpp (renamed from src/plugins/platforms/directfb/qplatformintegration_directfb.cpp)17
-rw-r--r--src/plugins/platforms/directfb/qdirectfbintegration.h (renamed from src/plugins/platforms/directfb/qplatformintegration_directfb.h)4
-rw-r--r--src/plugins/platforms/directfb/qdirectfbwindow.cpp (renamed from src/plugins/platforms/directfb/qwindowsurface_directfb.cpp)128
-rw-r--r--src/plugins/platforms/directfb/qdirectfbwindow.h73
-rw-r--r--src/plugins/platforms/directfb/qdirectfbwindowsurface.cpp141
-rw-r--r--src/plugins/platforms/directfb/qdirectfbwindowsurface.h (renamed from src/plugins/platforms/directfb/qwindowsurface_directfb.h)15
-rw-r--r--src/plugins/platforms/fb_base/fb_base.cpp112
-rw-r--r--src/plugins/platforms/fb_base/fb_base.h65
-rw-r--r--src/plugins/platforms/linuxfb/main.cpp2
-rw-r--r--src/plugins/platforms/linuxfb/qgraphicssystem_linuxfb.cpp45
-rw-r--r--src/plugins/platforms/linuxfb/qgraphicssystem_linuxfb.h11
-rw-r--r--src/plugins/platforms/minimal/minimal.pro2
-rw-r--r--src/plugins/platforms/minimal/qplatformintegration_minimal.cpp12
-rw-r--r--src/plugins/platforms/minimal/qplatformintegration_minimal.h4
-rw-r--r--src/plugins/platforms/minimal/qwindowsurface_minimal.cpp8
-rw-r--r--src/plugins/platforms/minimal/qwindowsurface_minimal.h4
-rw-r--r--src/plugins/platforms/qvfb/main.cpp16
-rw-r--r--src/plugins/platforms/qvfb/qvfb.pro11
-rw-r--r--src/plugins/platforms/qvfb/qvfbintegration.cpp (renamed from src/plugins/platforms/qvfb/qgraphicssystem_qvfb.cpp)95
-rw-r--r--src/plugins/platforms/qvfb/qvfbintegration.h (renamed from src/plugins/platforms/qvfb/qgraphicssystem_qvfb.h)28
-rw-r--r--src/plugins/platforms/qvfb/qwindowsurface_qvfb.cpp38
-rw-r--r--src/plugins/platforms/qvfb/qwindowsurface_qvfb.h26
-rw-r--r--src/plugins/platforms/testlite/qplatformintegration_testlite.cpp26
-rw-r--r--src/plugins/platforms/testlite/qplatformintegration_testlite.h3
-rw-r--r--src/plugins/platforms/testlite/qtestlitewindow.cpp (renamed from src/plugins/platforms/testlite/x11util.cpp)1596
-rw-r--r--src/plugins/platforms/testlite/qtestlitewindow.h (renamed from src/plugins/platforms/testlite/x11util.h)132
-rw-r--r--src/plugins/platforms/testlite/qwindowsurface_testlite.cpp636
-rw-r--r--src/plugins/platforms/testlite/qwindowsurface_testlite.h42
-rw-r--r--src/plugins/platforms/testlite/testlite.pro8
-rw-r--r--src/plugins/platforms/vnc/main.cpp12
-rw-r--r--src/plugins/platforms/vnc/qgraphicssystem_vnc.cpp42
-rw-r--r--src/plugins/platforms/vnc/qgraphicssystem_vnc.h21
-rw-r--r--src/plugins/platforms/vnc/qvnccursor.cpp2
-rw-r--r--src/plugins/platforms/vnc/qvnccursor.h4
-rw-r--r--src/plugins/platforms/vnc/qvncserver.cpp12
-rw-r--r--src/plugins/platforms/vnc/qvncserver.h22
-rw-r--r--src/plugins/plugins.pro2
46 files changed, 1822 insertions, 1656 deletions
diff --git a/src/plugins/graphicssystems/trace/qgraphicssystem_trace.cpp b/src/plugins/graphicssystems/trace/qgraphicssystem_trace.cpp
index 6bf9d6b..695050e 100644
--- a/src/plugins/graphicssystems/trace/qgraphicssystem_trace.cpp
+++ b/src/plugins/graphicssystems/trace/qgraphicssystem_trace.cpp
@@ -98,7 +98,11 @@ QPaintDevice *QTraceWindowSurface::paintDevice()
{
if (!buffer) {
buffer = new QPaintBuffer;
+#ifdef Q_WS_LITE
+ buffer->setBoundingRect(QRect(QPoint(), size()));
+#else
buffer->setBoundingRect(geometry());
+#endif
}
return buffer;
}
diff --git a/src/plugins/platforms/directfb/directfb.pro b/src/plugins/platforms/directfb/directfb.pro
index f8fccaa..f81ec31 100644
--- a/src/plugins/platforms/directfb/directfb.pro
+++ b/src/plugins/platforms/directfb/directfb.pro
@@ -13,17 +13,19 @@ INCLUDEPATH += $$DIRECTFB_INCLUDEPATH
LIBS += $$DIRECTFB_LIBS
SOURCES = main.cpp \
- qplatformintegration_directfb.cpp \
- qwindowsurface_directfb.cpp \
- qblitter_directfb.cpp \
+ qdirectfbintegration.cpp \
+ qdirectfbwindowsurface.cpp \
+ qdirectfbblitter.cpp \
qdirectfbconvenience.cpp \
qdirectfbinput.cpp \
- qdirectfbcursor.cpp
-HEADERS = qplatformintegration_directfb.h \
- qwindowsurface_directfb.h \
- qblitter_directfb.h \
+ qdirectfbcursor.cpp \
+ qdirectfbwindow.cpp
+HEADERS = qdirectfbintegration.h \
+ qdirectfbwindowsurface.h \
+ qdirectfbblitter.h \
qdirectfbconvenience.h \
qdirectfbinput.h \
- qdirectfbcursor.h
+ qdirectfbcursor.h \
+ qdirectfbwindow.h
target.path += $$[QT_INSTALL_PLUGINS]/platforms
INSTALLS += target
diff --git a/src/plugins/platforms/directfb/main.cpp b/src/plugins/platforms/directfb/main.cpp
index 1f0f081..9c7bcf6 100644
--- a/src/plugins/platforms/directfb/main.cpp
+++ b/src/plugins/platforms/directfb/main.cpp
@@ -40,7 +40,7 @@
****************************************************************************/
#include <QtGui/QPlatformIntegrationPlugin>
-#include "qplatformintegration_directfb.h"
+#include "qdirectfbintegration.h"
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/directfb/qblitter_directfb.cpp b/src/plugins/platforms/directfb/qdirectfbblitter.cpp
index 08dee0a..15bb18b 100644
--- a/src/plugins/platforms/directfb/qblitter_directfb.cpp
+++ b/src/plugins/platforms/directfb/qdirectfbblitter.cpp
@@ -1,4 +1,4 @@
-#include "qblitter_directfb.h"
+#include "qdirectfbblitter.h"
#include "qdirectfbconvenience.h"
#include <QtGui/private/qpixmap_blitter_p.h>
@@ -28,6 +28,7 @@ QDirectFbBlitter::QDirectFbBlitter(const QSize &rect, IDirectFBSurface *surface)
dfb->CreateSurface(dfb,&surfaceDesc, &m_surface);
m_surface->Clear(m_surface,0,0,0,0);
}
+
}
QDirectFbBlitter::~QDirectFbBlitter()
@@ -59,14 +60,18 @@ void QDirectFbBlitter::drawPixmap(const QRectF &rect, const QPixmap &pixmap, con
IDirectFBSurface *s = dfbBlitter->m_surface;
- quint32 blittingFlags = pixmap.hasAlpha()? DSBLIT_BLEND_ALPHACHANNEL : DSBLIT_NOFX;
+ DFBSurfaceBlittingFlags blittingFlags = DSBLIT_NOFX;
+ DFBSurfacePorterDuffRule porterDuff = DSPD_SRC;
+ if (pixmap.hasAlpha()) {
+ blittingFlags = DSBLIT_BLEND_ALPHACHANNEL;
+ porterDuff = DSPD_SRC_OVER;
+ }
- s->SetBlittingFlags(s, DFBSurfaceBlittingFlags(blittingFlags));
m_surface->SetBlittingFlags(m_surface, DFBSurfaceBlittingFlags(blittingFlags));
- m_surface->SetPorterDuff(m_surface,DSPD_SRC_OVER);
+ m_surface->SetPorterDuff(m_surface,porterDuff);
m_surface->SetDstBlendFunction(m_surface,DSBF_INVSRCALPHA);
- const DFBRectangle sRect = { srcRect.x(), srcRect.y(), rect.width(), rect.height() };
+ const DFBRectangle sRect = { srcRect.x(), srcRect.y(), srcRect.width(), srcRect.height() };
DFBResult result;
if (rect.width() == srcRect.width() && rect.height() == srcRect.height())
diff --git a/src/plugins/platforms/directfb/qblitter_directfb.h b/src/plugins/platforms/directfb/qdirectfbblitter.h
index 85a303a..85a303a 100644
--- a/src/plugins/platforms/directfb/qblitter_directfb.h
+++ b/src/plugins/platforms/directfb/qdirectfbblitter.h
diff --git a/src/plugins/platforms/directfb/qdirectfbconvenience.cpp b/src/plugins/platforms/directfb/qdirectfbconvenience.cpp
index 8594c09..adf9687 100644
--- a/src/plugins/platforms/directfb/qdirectfbconvenience.cpp
+++ b/src/plugins/platforms/directfb/qdirectfbconvenience.cpp
@@ -1,5 +1,5 @@
#include "qdirectfbconvenience.h"
-#include "qblitter_directfb.h"
+#include "qdirectfbblitter.h"
#include <private/qpixmap_blitter_p.h>
diff --git a/src/plugins/platforms/directfb/qdirectfbcursor.cpp b/src/plugins/platforms/directfb/qdirectfbcursor.cpp
index bb7088f..2edae45 100644
--- a/src/plugins/platforms/directfb/qdirectfbcursor.cpp
+++ b/src/plugins/platforms/directfb/qdirectfbcursor.cpp
@@ -1,9 +1,6 @@
#include "qdirectfbcursor.h"
-#include "qblitter_directfb.h"
-#include "qplatformintegration_directfb.h"
#include "qdirectfbconvenience.h"
-#include <private/qpixmap_blitter_p.h>
QDirectFBCursor::QDirectFBCursor(QPlatformScreen* screen) :
QGraphicsSystemCursor(screen), surface(0)
diff --git a/src/plugins/platforms/directfb/qdirectfbinput.cpp b/src/plugins/platforms/directfb/qdirectfbinput.cpp
index 74a38a4..90c3348 100644
--- a/src/plugins/platforms/directfb/qdirectfbinput.cpp
+++ b/src/plugins/platforms/directfb/qdirectfbinput.cpp
@@ -78,16 +78,13 @@ void QDirectFbInput::addWindow(DFBWindowID id, QWidget *tlw)
window->AttachEventBuffer(window,eventBuffer);
}
-void QDirectFbInput::removeWindow(QWidget *tlw)
+void QDirectFbInput::removeWindow(WId wId)
{
- DFBWindowID id = tlwMap.key(tlw,0);
- if (id) {
- IDirectFBWindow *window;
- dfbDisplayLayer->GetWindow(dfbDisplayLayer,id, &window);
+ IDirectFBWindow *window;
+ dfbDisplayLayer->GetWindow(dfbDisplayLayer,wId, &window);
- window->DetachEventBuffer(window,eventBuffer);
- tlwMap.remove(id);
- }
+ window->DetachEventBuffer(window,eventBuffer);
+ tlwMap.remove(wId);
}
void QDirectFbInput::handleEvents()
diff --git a/src/plugins/platforms/directfb/qdirectfbinput.h b/src/plugins/platforms/directfb/qdirectfbinput.h
index 31aa082..016e7f1 100644
--- a/src/plugins/platforms/directfb/qdirectfbinput.h
+++ b/src/plugins/platforms/directfb/qdirectfbinput.h
@@ -9,6 +9,8 @@
#include <QPoint>
#include <QEvent>
+#include <QtGui/qwindowdefs.h>
+
#include <directfb.h>
class InputSocketWaiter : public QThread
@@ -35,7 +37,7 @@ class QDirectFbInput : public QObject
public:
static QDirectFbInput *instance();
void addWindow(DFBWindowID id, QWidget *tlw);
- void removeWindow(QWidget *tlw);
+ void removeWindow(WId wId);
public slots:
void handleEvents();
diff --git a/src/plugins/platforms/directfb/qplatformintegration_directfb.cpp b/src/plugins/platforms/directfb/qdirectfbintegration.cpp
index c70bb64..60fce7e 100644
--- a/src/plugins/platforms/directfb/qplatformintegration_directfb.cpp
+++ b/src/plugins/platforms/directfb/qdirectfbintegration.cpp
@@ -39,11 +39,12 @@
**
****************************************************************************/
-#include "qplatformintegration_directfb.h"
-#include "qwindowsurface_directfb.h"
-#include "qblitter_directfb.h"
+#include "qdirectfbintegration.h"
+#include "qdirectfbwindowsurface.h"
+#include "qdirectfbblitter.h"
#include "qdirectfbconvenience.h"
#include "qdirectfbcursor.h"
+#include "qdirectfbwindow.h"
#include <private/qwindowsurface_raster_p.h>
#include <private/qpixmap_raster_p.h>
@@ -105,9 +106,15 @@ QPixmapData *QDirectFbIntegration::createPixmapData(QPixmapData::PixelType type)
return new QBlittablePixmapData(type);
}
-QWindowSurface *QDirectFbIntegration::createWindowSurface(QWidget *widget) const
+QPlatformWindow *QDirectFbIntegration::createPlatformWindow(QWidget *widget, WId winId) const
{
- return new QDirectFbWindowSurface (widget);
+ Q_UNUSED(winId);
+ return new QDirectFbWindow(widget);
+}
+
+QWindowSurface *QDirectFbIntegration::createWindowSurface(QWidget *widget, WId winId) const
+{
+ return new QDirectFbWindowSurface(widget,winId);
}
QBlittable *QDirectFbIntegration::createBlittable(const QSize &size) const
diff --git a/src/plugins/platforms/directfb/qplatformintegration_directfb.h b/src/plugins/platforms/directfb/qdirectfbintegration.h
index f74a81d..c0e770f 100644
--- a/src/plugins/platforms/directfb/qplatformintegration_directfb.h
+++ b/src/plugins/platforms/directfb/qdirectfbintegration.h
@@ -54,6 +54,7 @@ class QDirectFBCursor;
class QDirectFbScreen : public QPlatformScreen
{
+Q_OBJECT
public:
QDirectFbScreen(int display);
~QDirectFbScreen();
@@ -82,7 +83,8 @@ public:
QDirectFbIntegration();
QPixmapData *createPixmapData(QPixmapData::PixelType type) const;
- QWindowSurface *createWindowSurface(QWidget *widget) const;
+ QPlatformWindow *createPlatformWindow(QWidget *widget, WId winId = 0) const;
+ QWindowSurface *createWindowSurface(QWidget *widget, WId winId) const;
QBlittable *createBlittable(const QSize &size) const;
QList<QPlatformScreen *> screens() const { return mScreens; }
diff --git a/src/plugins/platforms/directfb/qwindowsurface_directfb.cpp b/src/plugins/platforms/directfb/qdirectfbwindow.cpp
index afe34b7..d88953e 100644
--- a/src/plugins/platforms/directfb/qwindowsurface_directfb.cpp
+++ b/src/plugins/platforms/directfb/qdirectfbwindow.cpp
@@ -38,23 +38,16 @@
** $QT_END_LICENSE$
**
****************************************************************************/
+#include "qdirectfbwindow.h"
+#include "qdirectfbinput.h"
-#include "qwindowsurface_directfb.h"
-#include "qplatformintegration_directfb.h"
-#include "qblitter_directfb.h"
-#include "qdirectfbconvenience.h"
-#include <private/qpixmap_blitter_p.h>
+#include <QWidget>
-#include <QtCore/qdebug.h>
+#include <directfb.h>
-QT_BEGIN_NAMESPACE
-
-QDirectFbWindowSurface::QDirectFbWindowSurface(QWidget *window)
- : QWindowSurface(window), m_pixmap(0), m_pmdata(0),
- m_dfbWindow(0), m_dfbSurface(0)
+QDirectFbWindow::QDirectFbWindow(QWidget *tlw)
+ : QPlatformWindow(tlw)
{
- window->setWindowSurface(this);
-
IDirectFBDisplayLayer *layer = QDirectFbConvenience::dfbDisplayLayer();
DFBDisplayLayerConfig layerConfig;
layer->GetConfiguration(layer,&layerConfig);
@@ -66,10 +59,10 @@ QDirectFbWindowSurface::QDirectFbWindowSurface(QWidget *window)
|DWDESC_OPTIONS
#endif
|DWDESC_CAPS);
- description.width = window->rect().width();
- description.height = window->rect().height();
- description.posx = window->rect().x();
- description.posy = window->rect().y();
+ description.width = tlw->rect().width();
+ description.height = tlw->rect().height();
+ description.posx = tlw->rect().x();
+ description.posy = tlw->rect().y();
if (layerConfig.surface_caps & DSCAPS_PREMULTIPLIED)
description.surface_caps = DSCAPS_PREMULTIPLIED;
@@ -86,102 +79,38 @@ QDirectFbWindowSurface::QDirectFbWindowSurface(QWidget *window)
DirectFBError("QDirectFbGraphicsSystemScreen: failed to create window",result);
}
+ m_dfbWindow->SetOpacity(m_dfbWindow,0xff);
+
DFBWindowID id;
m_dfbWindow->GetID(m_dfbWindow, &id);
- QDirectFbInput::instance()->addWindow(id,window);
-
- m_dfbWindow->GetSurface(m_dfbWindow,&m_dfbSurface);
-
- QDirectFbBlitter *blitter = new QDirectFbBlitter(window->rect().size(), m_dfbSurface);
- m_pmdata = new QBlittablePixmapData(QPixmapData::PixmapType);
- m_pmdata->setBlittable(blitter);
- m_pixmap = new QPixmap(m_pmdata);
+ QDirectFbInput::instance()->addWindow(id,tlw);
}
-QDirectFbWindowSurface::~QDirectFbWindowSurface()
+QDirectFbWindow::~QDirectFbWindow()
{
- QDirectFbInput::instance()->removeWindow(this->window());
+ QDirectFbInput::instance()->removeWindow(winId());
m_dfbWindow->Destroy(m_dfbWindow);
}
-QPaintDevice *QDirectFbWindowSurface::paintDevice()
-{
- return m_pixmap;
-}
-
-void QDirectFbWindowSurface::flush(QWidget *widget, const QRegion &region, const QPoint &offset)
+void QDirectFbWindow::setGeometry(const QRect &rect)
{
- m_pmdata->blittable()->unlock();
-
- const quint8 windowOpacity = quint8(widget->windowOpacity() * 0xff);
- m_dfbWindow->SetOpacity(m_dfbWindow,windowOpacity);
-
- QVector<QRect> rects = region.rects();
- for (int i = 0 ; i < rects.size(); i++) {
- const QRect rect = rects.at(i);
- DFBRegion dfbReg = { rect.x() + offset.x(),rect.y() + offset.y(),rect.right() + offset.x(),rect.bottom() + offset.y()};
- m_dfbSurface->Flip(m_dfbSurface, &dfbReg, DFBSurfaceFlipFlags(DSFLIP_BLIT|DSFLIP_ONSYNC));
- }
-}
-
-void QDirectFbWindowSurface::setGeometry(const QRect &rect)
-{
- m_pmdata->blittable()->unlock();
-
- QWindowSurface::setGeometry(rect);
+ QPlatformWindow::setGeometry(rect);
m_dfbWindow->SetBounds(m_dfbWindow, rect.x(),rect.y(),
rect.width(), rect.height());
- //Have to add 1 ref ass it will be removed by deleting the old blitter in setBlittable
- m_dfbSurface->AddRef(m_dfbSurface);
- QDirectFbBlitter *blitter = new QDirectFbBlitter(rect.size(),m_dfbSurface);
- m_pmdata->setBlittable(blitter);
}
-static inline void scrollSurface(IDirectFBSurface *surface, const QRect &r, int dx, int dy)
+void QDirectFbWindow::setOpacity(qreal level)
{
- const DFBRectangle rect = { r.x(), r.y(), r.width(), r.height() };
- surface->Blit(surface, surface, &rect, r.x() + dx, r.y() + dy);
- const DFBRegion region = { rect.x + dx, rect.y + dy, r.right() + dx, r.bottom() + dy };
- surface->Flip(surface, &region, DFBSurfaceFlipFlags(DSFLIP_BLIT));
-}
-
-bool QDirectFbWindowSurface::scroll(const QRegion &area, int dx, int dy)
-{
- m_pmdata->blittable()->unlock();
-
- if (!m_dfbSurface || area.isEmpty())
- return false;
- m_dfbSurface->SetBlittingFlags(m_dfbSurface, DSBLIT_NOFX);
- if (area.rectCount() == 1) {
- scrollSurface(m_dfbSurface, area.boundingRect(), dx, dy);
- } else {
- const QVector<QRect> rects = area.rects();
- const int n = rects.size();
- for (int i=0; i<n; ++i) {
- scrollSurface(m_dfbSurface, rects.at(i), dx, dy);
- }
- }
- return true;
-}
-
-void QDirectFbWindowSurface::beginPaint(const QRegion &region)
-{
- Q_UNUSED(region);
-}
-
-void QDirectFbWindowSurface::endPaint(const QRegion &region)
-{
- Q_UNUSED(region);
+ const quint8 windowOpacity = quint8(level * 0xff);
+ m_dfbWindow->SetOpacity(m_dfbWindow,windowOpacity);
}
-void QDirectFbWindowSurface::setVisible(bool visible)
+void QDirectFbWindow::setVisible(bool visible)
{
- m_pmdata->blittable()->unlock();
-
if (visible) {
- int x = this->geometry().x();
- int y = this->geometry().y();
+ int x = geometry().x();
+ int y = geometry().y();
m_dfbWindow->MoveTo(m_dfbWindow,x,y);
} else {
IDirectFBDisplayLayer *displayLayer;
@@ -193,7 +122,7 @@ void QDirectFbWindowSurface::setVisible(bool visible)
}
}
-Qt::WindowFlags QDirectFbWindowSurface::setWindowFlags(Qt::WindowFlags flags)
+Qt::WindowFlags QDirectFbWindow::setWindowFlags(Qt::WindowFlags flags)
{
switch (flags & Qt::WindowType_Mask) {
case Qt::ToolTip: {
@@ -210,22 +139,19 @@ Qt::WindowFlags QDirectFbWindowSurface::setWindowFlags(Qt::WindowFlags flags)
return flags;
}
-void QDirectFbWindowSurface::raise()
+void QDirectFbWindow::raise()
{
m_dfbWindow->RaiseToTop(m_dfbWindow);
}
-void QDirectFbWindowSurface::lower()
+void QDirectFbWindow::lower()
{
m_dfbWindow->LowerToBottom(m_dfbWindow);
}
-WId QDirectFbWindowSurface::winId() const
+WId QDirectFbWindow::winId() const
{
DFBWindowID id;
m_dfbWindow->GetID(m_dfbWindow, &id);
return WId(id);
}
-
-
-QT_END_NAMESPACE
diff --git a/src/plugins/platforms/directfb/qdirectfbwindow.h b/src/plugins/platforms/directfb/qdirectfbwindow.h
new file mode 100644
index 0000000..d5fd408
--- /dev/null
+++ b/src/plugins/platforms/directfb/qdirectfbwindow.h
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtOpenVG 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$
+**
+****************************************************************************/
+
+#ifndef QDIRECTFBWINDOW_H
+#define QDIRECTFBWINDOW_H
+
+#include <QPlatformWindow>
+
+#include "qdirectfbconvenience.h"
+
+QT_BEGIN_NAMESPACE
+
+class QDirectFbWindow : public QPlatformWindow
+{
+public:
+ QDirectFbWindow(QWidget *tlw);
+ ~QDirectFbWindow();
+
+ void setGeometry(const QRect &rect);
+ void setOpacity(qreal level);
+
+ void setVisible(bool visible);
+
+ Qt::WindowFlags setWindowFlags(Qt::WindowFlags flags);
+ void raise();
+ void lower();
+ WId winId() const;
+
+private:
+ IDirectFBWindow *m_dfbWindow;
+};
+
+QT_END_NAMESPACE
+
+#endif // QDIRECTFBWINDOW_H
diff --git a/src/plugins/platforms/directfb/qdirectfbwindowsurface.cpp b/src/plugins/platforms/directfb/qdirectfbwindowsurface.cpp
new file mode 100644
index 0000000..4ca9a72
--- /dev/null
+++ b/src/plugins/platforms/directfb/qdirectfbwindowsurface.cpp
@@ -0,0 +1,141 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtOpenVG 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 "qdirectfbwindowsurface.h"
+#include "qdirectfbintegration.h"
+#include "qdirectfbblitter.h"
+#include "qdirectfbconvenience.h"
+#include <private/qpixmap_blitter_p.h>
+
+#include <QtCore/qdebug.h>
+
+QT_BEGIN_NAMESPACE
+
+QDirectFbWindowSurface::QDirectFbWindowSurface(QWidget *window, WId wId)
+ : QWindowSurface(window), m_pixmap(0), m_pmdata(0), m_dfbSurface(0)
+{
+
+ IDirectFBDisplayLayer *layer = QDirectFbConvenience::dfbDisplayLayer();
+
+ DFBWindowID id(wId);
+ IDirectFBWindow *dfbWindow;
+
+ layer->GetWindow(layer,id,&dfbWindow);
+
+ dfbWindow->GetSurface(dfbWindow,&m_dfbSurface);
+//WRONGSIZE
+ QDirectFbBlitter *blitter = new QDirectFbBlitter(window->rect().size(), m_dfbSurface);
+ m_pmdata = new QBlittablePixmapData(QPixmapData::PixmapType);
+ m_pmdata->setBlittable(blitter);
+ m_pixmap = new QPixmap(m_pmdata);
+}
+
+QDirectFbWindowSurface::~QDirectFbWindowSurface()
+{
+
+}
+
+QPaintDevice *QDirectFbWindowSurface::paintDevice()
+{
+ return m_pixmap;
+}
+
+void QDirectFbWindowSurface::flush(QWidget *widget, const QRegion &region, const QPoint &offset)
+{
+ Q_UNUSED(widget);
+ m_pmdata->blittable()->unlock();
+
+ QVector<QRect> rects = region.rects();
+ for (int i = 0 ; i < rects.size(); i++) {
+ const QRect rect = rects.at(i);
+ DFBRegion dfbReg = { rect.x() + offset.x(),rect.y() + offset.y(),rect.right() + offset.x(),rect.bottom() + offset.y()};
+ m_dfbSurface->Flip(m_dfbSurface, &dfbReg, DFBSurfaceFlipFlags(DSFLIP_BLIT|DSFLIP_ONSYNC));
+ }
+}
+
+void QDirectFbWindowSurface::resize(const QSize &size)
+{
+ QWindowSurface::resize(size);
+
+ //Have to add 1 ref ass it will be removed by deleting the old blitter in setBlittable
+ m_dfbSurface->AddRef(m_dfbSurface);
+ QDirectFbBlitter *blitter = new QDirectFbBlitter(size,m_dfbSurface);
+ m_pmdata->setBlittable(blitter);
+}
+
+static inline void scrollSurface(IDirectFBSurface *surface, const QRect &r, int dx, int dy)
+{
+ const DFBRectangle rect = { r.x(), r.y(), r.width(), r.height() };
+ surface->Blit(surface, surface, &rect, r.x() + dx, r.y() + dy);
+ const DFBRegion region = { rect.x + dx, rect.y + dy, r.right() + dx, r.bottom() + dy };
+ surface->Flip(surface, &region, DFBSurfaceFlipFlags(DSFLIP_BLIT));
+}
+
+bool QDirectFbWindowSurface::scroll(const QRegion &area, int dx, int dy)
+{
+ m_pmdata->blittable()->unlock();
+
+ if (!m_dfbSurface || area.isEmpty())
+ return false;
+ m_dfbSurface->SetBlittingFlags(m_dfbSurface, DSBLIT_NOFX);
+ if (area.rectCount() == 1) {
+ scrollSurface(m_dfbSurface, area.boundingRect(), dx, dy);
+ } else {
+ const QVector<QRect> rects = area.rects();
+ const int n = rects.size();
+ for (int i=0; i<n; ++i) {
+ scrollSurface(m_dfbSurface, rects.at(i), dx, dy);
+ }
+ }
+ return true;
+}
+
+void QDirectFbWindowSurface::beginPaint(const QRegion &region)
+{
+ Q_UNUSED(region);
+}
+
+void QDirectFbWindowSurface::endPaint(const QRegion &region)
+{
+ Q_UNUSED(region);
+}
+
+QT_END_NAMESPACE
diff --git a/src/plugins/platforms/directfb/qwindowsurface_directfb.h b/src/plugins/platforms/directfb/qdirectfbwindowsurface.h
index 2f31513..d48f534 100644
--- a/src/plugins/platforms/directfb/qwindowsurface_directfb.h
+++ b/src/plugins/platforms/directfb/qdirectfbwindowsurface.h
@@ -49,37 +49,26 @@
QT_BEGIN_NAMESPACE
-class QDirectFbGraphicsSystemScreen;
-
class QDirectFbWindowSurface : public QWindowSurface
{
public:
- QDirectFbWindowSurface(QWidget *window);
+ QDirectFbWindowSurface(QWidget *window, WId wid);
~QDirectFbWindowSurface();
QPaintDevice *paintDevice();
void flush(QWidget *widget, const QRegion &region, const QPoint &offset);
- void setGeometry(const QRect &rect);
+ void resize (const QSize &size);
bool scroll(const QRegion &area, int dx, int dy);
void beginPaint(const QRegion &region);
void endPaint(const QRegion &region);
- void setVisible(bool visible);
- Qt::WindowFlags setWindowFlags(Qt::WindowFlags type);
-
- void raise();
- void lower();
-
- WId winId() const;
-
private:
void lockSurfaceToImage();
QPixmap *m_pixmap;
QBlittablePixmapData *m_pmdata;
- IDirectFBWindow *m_dfbWindow;
IDirectFBSurface *m_dfbSurface;
};
diff --git a/src/plugins/platforms/fb_base/fb_base.cpp b/src/plugins/platforms/fb_base/fb_base.cpp
index a2a6609..f2009c1 100644
--- a/src/plugins/platforms/fb_base/fb_base.cpp
+++ b/src/plugins/platforms/fb_base/fb_base.cpp
@@ -81,7 +81,7 @@ void QGraphicsSystemSoftwareCursor::changeCursor(QCursor * widgetCursor, QWidget
screen->setDirty(currentRect);
}
-QFbPlatformScreen::QFbPlatformScreen() : cursor(0), mGeometry(), mDepth(16), mFormat(QImage::Format_RGB16), mScreenImage(0), compositePainter(0), isUpToDate(false)
+QFbScreen::QFbScreen() : cursor(0), mGeometry(), mDepth(16), mFormat(QImage::Format_RGB16), mScreenImage(0), compositePainter(0), isUpToDate(false)
{
mScreenImage = new QImage(mGeometry.size(), mFormat);
redrawTimer.setSingleShot(true);
@@ -89,7 +89,7 @@ QFbPlatformScreen::QFbPlatformScreen() : cursor(0), mGeometry(), mDepth(16), mFo
QObject::connect(&redrawTimer, SIGNAL(timeout()), this, SLOT(doRedraw()));
}
-void QFbPlatformScreen::setGeometry(QRect rect)
+void QFbScreen::setGeometry(QRect rect)
{
delete mScreenImage;
mGeometry = rect;
@@ -99,17 +99,17 @@ void QFbPlatformScreen::setGeometry(QRect rect)
invalidateRectCache();
}
-void QFbPlatformScreen::setDepth(int depth)
+void QFbScreen::setDepth(int depth)
{
mDepth = depth;
}
-void QFbPlatformScreen::setPhysicalSize(QSize size)
+void QFbScreen::setPhysicalSize(QSize size)
{
mPhysicalSize = size;
}
-void QFbPlatformScreen::setFormat(QImage::Format format)
+void QFbScreen::setFormat(QImage::Format format)
{
mFormat = format;
delete mScreenImage;
@@ -118,21 +118,23 @@ void QFbPlatformScreen::setFormat(QImage::Format format)
compositePainter = 0;
}
-QFbPlatformScreen::~QFbPlatformScreen()
+QFbScreen::~QFbScreen()
{
delete compositePainter;
delete mScreenImage;
}
-void QFbPlatformScreen::setDirty(const QRect &rect)
+void QFbScreen::setDirty(const QRect &rect)
{
+
+// qDebug() << "QFbScreen::setDirty" << rect;
repaintRegion += rect;
if (!redrawTimer.isActive()) {
redrawTimer.start();
}
}
-void QFbPlatformScreen::generateRects()
+void QFbScreen::generateRects()
{
cachedRects.clear();
QRegion remainingScreen(mGeometry);
@@ -140,7 +142,10 @@ void QFbPlatformScreen::generateRects()
for (int i = 0; i < windowStack.length(); i++) {
if (remainingScreen.isEmpty())
break;
- if (!windowStack[i]->window()->testAttribute(Qt::WA_TranslucentBackground)) {
+ if (!windowStack[i]->visible())
+ continue;
+
+ if (!windowStack[i]->widget()->testAttribute(Qt::WA_TranslucentBackground)) {
remainingScreen -= windowStack[i]->geometry();
QRegion windowRegion(windowStack[i]->geometry());
windowRegion -= remainingScreen;
@@ -157,7 +162,7 @@ void QFbPlatformScreen::generateRects()
-QRegion QFbPlatformScreen::doRedraw()
+QRegion QFbScreen::doRedraw()
{
QRegion touchedRegion;
if (cursor)
@@ -197,12 +202,13 @@ QRegion QFbPlatformScreen::doRedraw()
for (int layerIndex = layer; layerIndex != -1; layerIndex--) {
if (!windowStack[layerIndex]->visible())
continue;
- if (windowStack[layerIndex]->window()->isMinimized())
+ if (windowStack[layerIndex]->widget()->isMinimized())
continue;
QRect windowRect = windowStack[layerIndex]->geometry();
QRect windowIntersect = rect.translated(-windowRect.left(),
-windowRect.top());
- compositePainter->drawImage(rect, windowStack[layerIndex]->image(),
+// qDebug() << " compositing" << layerIndex << windowStack[layerIndex]->surface->image().size();
+ compositePainter->drawImage(rect, windowStack[layerIndex]->surface->image(),
windowIntersect);
if (firstLayer) {
firstLayer = false;
@@ -224,24 +230,29 @@ QRegion QFbPlatformScreen::doRedraw()
touchedRegion += repaintRegion;
repaintRegion = QRegion();
+
+
+// qDebug() << "QFbScreen::doRedraw" << windowStack.size() << mScreenImage->size() << touchedRegion;
+
+
return touchedRegion;
}
-void QFbPlatformScreen::removeWindowSurface(QFbWindowSurface * surface)
+void QFbScreen::removeWindow(QFbWindow * surface)
{
windowStack.removeOne(surface);
invalidateRectCache();
setDirty(surface->geometry());
}
-void QFbWindowSurface::raise()
+void QFbWindow::raise()
{
mScreen->raise(this);
}
-void QFbPlatformScreen::raise(QWindowSurface * surface)
+void QFbScreen::raise(QPlatformWindow * surface)
{
- QFbWindowSurface *s = static_cast<QFbWindowSurface *>(surface);
+ QFbWindow *s = static_cast<QFbWindow *>(surface);
int index = windowStack.indexOf(s);
if (index <= 0)
return;
@@ -250,14 +261,14 @@ void QFbPlatformScreen::raise(QWindowSurface * surface)
setDirty(s->geometry());
}
-void QFbWindowSurface::lower()
+void QFbWindow::lower()
{
mScreen->lower(this);
}
-void QFbPlatformScreen::lower(QWindowSurface * surface)
+void QFbScreen::lower(QPlatformWindow * surface)
{
- QFbWindowSurface *s = static_cast<QFbWindowSurface *>(surface);
+ QFbWindow *s = static_cast<QFbWindow *>(surface);
int index = windowStack.indexOf(s);
if (index == -1 || index == (windowStack.size() - 1))
return;
@@ -266,32 +277,46 @@ void QFbPlatformScreen::lower(QWindowSurface * surface)
setDirty(s->geometry());
}
-QWidget * QFbPlatformScreen::topLevelAt(const QPoint & p) const
+QWidget * QFbScreen::topLevelAt(const QPoint & p) const
{
for(int i = 0; i < windowStack.size(); i++) {
if (windowStack[i]->geometry().contains(p, false) &&
windowStack[i]->visible() &&
- !windowStack[i]->window()->isMinimized()) {
- return windowStack[i]->window();
+ !windowStack[i]->widget()->isMinimized()) {
+ return windowStack[i]->widget();
}
}
return 0;
}
-QFbWindowSurface::QFbWindowSurface(QFbPlatformScreen *screen, QWidget *window)
- : QWindowSurface(window),
+QFbWindow::QFbWindow(QFbScreen *screen, QWidget *window)
+ :QPlatformWindow(window),
mScreen(screen),
visibleFlag(false)
{
static QAtomicInt winIdGenerator(1);
+ windowId = winIdGenerator.fetchAndAddRelaxed(1);
+}
+
+QFbWindow::~QFbWindow()
+{
+ mScreen->removeWindow(this);
+}
+
+
+QFbWindowSurface::QFbWindowSurface(QFbScreen *screen, QWidget *window)
+ : QWindowSurface(window),
+ mScreen(screen)
+{
mImage = QImage(window->size(), mScreen->format());
- windowId = winIdGenerator.fetchAndAddRelaxed(1);
+
+ platformWindow = static_cast<QFbWindow*>(window->platformWindow());
+ platformWindow->surface = this;
}
QFbWindowSurface::~QFbWindowSurface()
{
- mScreen->removeWindowSurface(this);
}
void QFbWindowSurface::flush(QWidget *widget, const QRegion &region, const QPoint &offset)
@@ -299,6 +324,16 @@ void QFbWindowSurface::flush(QWidget *widget, const QRegion &region, const QPoin
Q_UNUSED(widget);
Q_UNUSED(offset);
+
+// qDebug() << "QFbWindowSurface::flush" << region;
+
+
+ platformWindow->repaint(region);
+}
+
+
+void QFbWindow::repaint(const QRegion &region)
+{
QRect currentGeometry = geometry();
// If this is a move, redraw the previous location
if (oldGeometry != currentGeometry) {
@@ -314,19 +349,24 @@ void QFbWindowSurface::flush(QWidget *widget, const QRegion &region, const QPoin
mScreen->setDirty(dirtyRegion);
}
-void QFbWindowSurface::setGeometry(const QRect &rect)
+void QFbWindowSurface::resize(const QSize &size)
{
- // store previous geometry for screen update
+ // change the widget's QImage if this is a resize
+ if (mImage.size() != size)
+ mImage = QImage(size, mScreen->format());
+ QWindowSurface::resize(size);
+}
+
+void QFbWindow::setGeometry(const QRect &rect)
+{
+// store previous geometry for screen update
oldGeometry = geometry();
- // change the widget's QImage if this is a resize
- if (mImage.size() != rect.size())
- mImage = QImage(rect.size(), mScreen->format());
mScreen->invalidateRectCache();
- QWindowSystemInterface::handleGeometryChange(window(), rect);
+//### QWindowSystemInterface::handleGeometryChange(window(), rect);
- QWindowSurface::setGeometry(rect);
+ QPlatformWindow::setGeometry(rect);
}
bool QFbWindowSurface::scroll(const QRegion &area, int dx, int dy)
@@ -344,21 +384,21 @@ void QFbWindowSurface::endPaint(const QRegion &region)
Q_UNUSED(region);
}
-void QFbWindowSurface::setVisible(bool visible)
+void QFbWindow::setVisible(bool visible)
{
visibleFlag = visible;
mScreen->invalidateRectCache();
mScreen->setDirty(geometry());
}
-Qt::WindowFlags QFbWindowSurface::setWindowFlags(Qt::WindowFlags type)
+Qt::WindowFlags QFbWindow::setWindowFlags(Qt::WindowFlags type)
{
flags = type;
mScreen->invalidateRectCache();
return flags;
}
-Qt::WindowFlags QFbWindowSurface::windowFlags() const
+Qt::WindowFlags QFbWindow::windowFlags() const
{
return flags;
}
diff --git a/src/plugins/platforms/fb_base/fb_base.h b/src/plugins/platforms/fb_base/fb_base.h
index fef769c..2b32209 100644
--- a/src/plugins/platforms/fb_base/fb_base.h
+++ b/src/plugins/platforms/fb_base/fb_base.h
@@ -1,18 +1,19 @@
#ifndef QLIGHTHOUSEGRAPHICSSCREEN_H
#define QLIGHTHOUSEGRAPHICSSCREEN_H
-#include <QtGui/QPlatformIntegration>
#include <qrect.h>
#include <qimage.h>
#include <qtimer.h>
#include <qpainter.h>
-#include <QtGui/QGraphicsSystemCursor>
+#include <QGraphicsSystemCursor>
+#include <QPlatformScreen>
+#include <QPlatformWindow>
class QMouseEvent;
class QSize;
class QPainter;
-class QFbPlatformScreen;
+class QFbScreen;
class QGraphicsSystemSoftwareCursor : public QGraphicsSystemCursor
{
@@ -39,10 +40,12 @@ private:
QRect getCurrentRect();
};
+class QFbWindow;
+
class QFbWindowSurface : public QWindowSurface
{
public:
- QFbWindowSurface(QFbPlatformScreen *screen, QWidget *window);
+ QFbWindowSurface(QFbScreen *screen, QWidget *window);
~QFbWindowSurface();
virtual QPaintDevice *paintDevice() { return &mImage; }
@@ -51,35 +54,62 @@ public:
virtual void beginPaint(const QRegion &region);
virtual void endPaint(const QRegion &region);
- virtual void setVisible(bool visible);
- virtual bool visible() { return visibleFlag; }
+
const QImage image() { return mImage; }
- void setGeometry(const QRect &rect);
+ void resize(const QSize &size);
+
+protected:
+ friend class QFbWindow;
+ QFbWindow *platformWindow;
+
+ QFbScreen *mScreen;
+ QImage mImage;
+};
+
+
+class QFbWindow : public QPlatformWindow
+{
+public:
+
+ QFbWindow(QFbScreen *screen, QWidget *window);
+ ~QFbWindow();
+
+
+ virtual void setVisible(bool visible);
+ virtual bool visible() { return visibleFlag; }
virtual void raise();
virtual void lower();
+ void setGeometry(const QRect &rect);
+
virtual Qt::WindowFlags setWindowFlags(Qt::WindowFlags type);
virtual Qt::WindowFlags windowFlags() const;
WId winId() const { return windowId; }
+
+ virtual void repaint(const QRegion&);
+
protected:
- QFbPlatformScreen *mScreen;
+ friend class QFbWindowSurface;
+ friend class QFbScreen;
+ QFbWindowSurface *surface;
+ QFbScreen *mScreen;
QRect oldGeometry;
- QImage mImage;
bool visibleFlag;
Qt::WindowFlags flags;
+
WId windowId;
};
-class QFbPlatformScreen : public QPlatformScreen
+class QFbScreen : public QPlatformScreen
{
Q_OBJECT
public:
- QFbPlatformScreen();
- ~QFbPlatformScreen();
+ QFbScreen();
+ ~QFbScreen();
virtual QRect geometry() const { return mGeometry; }
virtual int depth() const { return mDepth; }
@@ -93,18 +123,18 @@ public:
virtual void setDirty(const QRect &rect);
- virtual void removeWindowSurface(QFbWindowSurface * surface);
- virtual void addWindowSurface(QFbWindowSurface * surface) {
+ virtual void removeWindow(QFbWindow * surface);
+ virtual void addWindow(QFbWindow * surface) {
windowStack.prepend(surface); invalidateRectCache(); }
- virtual void raise(QWindowSurface * surface);
- virtual void lower(QWindowSurface * surface);
+ virtual void raise(QPlatformWindow * surface);
+ virtual void lower(QPlatformWindow * surface);
virtual QWidget * topLevelAt(const QPoint & p) const;
QImage * image() const { return mScreenImage; }
QPaintDevice * paintDevice() const { return mScreenImage; }
protected:
- QList<QFbWindowSurface *> windowStack;
+ QList<QFbWindow *> windowStack;
QRegion repaintRegion;
QGraphicsSystemSoftwareCursor * cursor;
QTimer redrawTimer;
@@ -126,6 +156,7 @@ private:
void invalidateRectCache() { isUpToDate = false; }
friend class QFbWindowSurface;
+ friend class QFbWindow;
bool isUpToDate;
};
diff --git a/src/plugins/platforms/linuxfb/main.cpp b/src/plugins/platforms/linuxfb/main.cpp
index 4f7684b..1ee24b6 100644
--- a/src/plugins/platforms/linuxfb/main.cpp
+++ b/src/plugins/platforms/linuxfb/main.cpp
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include <QtGui/QPlatformIntegrationPlugin>
+#include <QPlatformIntegrationPlugin>
#include "qgraphicssystem_linuxfb.h"
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/linuxfb/qgraphicssystem_linuxfb.cpp b/src/plugins/platforms/linuxfb/qgraphicssystem_linuxfb.cpp
index 6310062..321e90f 100644
--- a/src/plugins/platforms/linuxfb/qgraphicssystem_linuxfb.cpp
+++ b/src/plugins/platforms/linuxfb/qgraphicssystem_linuxfb.cpp
@@ -69,11 +69,11 @@
QT_BEGIN_NAMESPACE
-class QLinuxFbPrivate
+class QLinuxFbIntegrationPrivate
{
public:
- QLinuxFbPrivate();
- ~QLinuxFbPrivate();
+ QLinuxFbIntegrationPrivate();
+ ~QLinuxFbIntegrationPrivate();
void openTty();
void closeTty();
@@ -94,7 +94,7 @@ public:
QString displaySpec;
};
-QLinuxFbPrivate::QLinuxFbPrivate()
+QLinuxFbIntegrationPrivate::QLinuxFbIntegrationPrivate()
: fd(-1), blank(true), doGraphicsMode(true),
#ifdef QT_QWS_DEPTH_GENERIC
doGenericColors(false),
@@ -103,12 +103,12 @@ QLinuxFbPrivate::QLinuxFbPrivate()
{
}
-QLinuxFbPrivate::~QLinuxFbPrivate()
+QLinuxFbIntegrationPrivate::~QLinuxFbIntegrationPrivate()
{
closeTty();
}
-void QLinuxFbPrivate::openTty()
+void QLinuxFbIntegrationPrivate::openTty()
{
const char *const devs[] = {"/dev/tty0", "/dev/tty", "/dev/console", 0};
@@ -139,7 +139,7 @@ void QLinuxFbPrivate::openTty()
QT_WRITE(ttyfd, termctl, sizeof(termctl));
}
-void QLinuxFbPrivate::closeTty()
+void QLinuxFbIntegrationPrivate::closeTty()
{
if (ttyfd == -1)
return;
@@ -157,18 +157,19 @@ void QLinuxFbPrivate::closeTty()
QLinuxFbIntegration::QLinuxFbIntegration()
{
- d_ptr = new QLinuxFbPrivate();
+ d_ptr = new QLinuxFbIntegrationPrivate();
// XXX
QString displaySpec = QString::fromLatin1(qgetenv("QWS_DISPLAY"));
if (!connect(displaySpec))
- qFatal("QLinuxFbGraphicsSystem: could not initialize screen");
+ qFatal("QLinuxFbIntegration: could not initialize screen");
initDevice();
// Create a QImage directly on the screen's framebuffer.
// This is the blit target for copying windows to the screen.
- mPrimaryScreen = new QLinuxFbScreen(data, w, h, lstep, screenFormat);
+ mPrimaryScreen = new QLinuxFbScreen(data, w, h, lstep,
+ screenFormat);
mPrimaryScreen->setPhysicalSize(QSize(physWidth, physHeight));
mScreens.append(mPrimaryScreen);
}
@@ -235,7 +236,7 @@ bool QLinuxFbIntegration::connect(const QString &displaySpec)
/* Get fixed screen information */
if (d_ptr->fd != -1 && ioctl(d_ptr->fd, FBIOGET_FSCREENINFO, &finfo)) {
- perror("QLinuxFbGraphicsSystem::connect");
+ perror("QLinuxFbIntegration::connect");
qWarning("Error reading fixed information");
return false;
}
@@ -247,7 +248,7 @@ bool QLinuxFbIntegration::connect(const QString &displaySpec)
/* Get variable screen information */
if (d_ptr->fd != -1 && ioctl(d_ptr->fd, FBIOGET_VSCREENINFO, &vinfo)) {
- perror("QLinuxFbGraphicsSystem::connect");
+ perror("QLinuxFbIntegration::connect");
qWarning("Error reading variable information");
return false;
}
@@ -293,7 +294,7 @@ bool QLinuxFbIntegration::connect(const QString &displaySpec)
}
if (w == 0 || h == 0) {
- qWarning("QLinuxFbGraphicsSystem::connect(): Unable to find screen geometry, "
+ qWarning("QLinuxFbIntegration::connect(): Unable to find screen geometry, "
"will use 320x240.");
dw = w = 320;
dh = h = 240;
@@ -345,7 +346,7 @@ bool QLinuxFbIntegration::connect(const QString &displaySpec)
MAP_SHARED, d_ptr->fd, 0);
if ((long)data == -1) {
- perror("QLinuxFbGraphicsSystem::connect");
+ perror("QLinuxFbIntegration::connect");
qWarning("Error: failed to map framebuffer device to memory.");
return false;
} else {
@@ -375,7 +376,7 @@ bool QLinuxFbIntegration::connect(const QString &displaySpec)
startcmap.transp=(unsigned short int *)
malloc(sizeof(unsigned short int)*screencols);
if (d_ptr->fd == -1 || ioctl(d_ptr->fd, FBIOGETCMAP, &startcmap)) {
- perror("QLinuxFbGraphicsSystem::connect");
+ perror("QLinuxFbIntegration::connect");
qWarning("Error reading palette from framebuffer, using default palette");
createPalette(startcmap, vinfo, finfo);
}
@@ -784,16 +785,20 @@ QPixmapData *QLinuxFbIntegration::createPixmapData(QPixmapData::PixelType type)
return new QRasterPixmapData(type);
}
-QWindowSurface *QLinuxFbIntegration::createWindowSurface(QWidget *widget) const
+QWindowSurface *QLinuxFbIntegration::createWindowSurface(QWidget *widget, WId) const
{
- if (widget->windowType() == Qt::Desktop)
- return 0; // Don't create an explicit window surface for the destkop.
QFbWindowSurface * surface =
new QFbWindowSurface(mPrimaryScreen, widget);
- mPrimaryScreen->addWindowSurface(surface);
return surface;
}
+QPlatformWindow *QLinuxFbIntegration::createPlatformWindow(QWidget *widget, WId /*winId*/) const
+{
+ QFbWindow *w = new QFbWindow(mPrimaryScreen, widget);
+ mPrimaryScreen->addWindow(w);
+ return w;
+}
+
QLinuxFbScreen::QLinuxFbScreen(uchar * d, int w,
int h, int lstep, QImage::Format screenFormat) : compositePainter(0)
{
@@ -840,7 +845,7 @@ void QLinuxFbScreen::setFormat(QImage::Format format)
QRegion QLinuxFbScreen::doRedraw()
{
QRegion touched;
- touched = QFbPlatformScreen::doRedraw();
+ touched = QFbScreen::doRedraw();
if (!compositePainter) {
compositePainter = new QPainter(mFbScreenImage);
diff --git a/src/plugins/platforms/linuxfb/qgraphicssystem_linuxfb.h b/src/plugins/platforms/linuxfb/qgraphicssystem_linuxfb.h
index bb4c920..dc61df5 100644
--- a/src/plugins/platforms/linuxfb/qgraphicssystem_linuxfb.h
+++ b/src/plugins/platforms/linuxfb/qgraphicssystem_linuxfb.h
@@ -42,12 +42,12 @@
#ifndef QGRAPHICSSYSTEM_LINUXFB_H
#define QGRAPHICSSYSTEM_LINUXFB_H
-#include <QtGui/QPlatformIntegration>
+#include <QPlatformIntegration>
#include "../fb_base/fb_base.h"
QT_BEGIN_NAMESPACE
-class QLinuxFbScreen : public QFbPlatformScreen
+class QLinuxFbScreen : public QFbScreen
{
public:
QLinuxFbScreen(uchar * d, int w, int h, int lstep, QImage::Format screenFormat);
@@ -65,7 +65,7 @@ private:
QPainter *compositePainter;
};
-class QLinuxFbPrivate;
+class QLinuxFbIntegrationPrivate;
struct fb_cmap;
struct fb_var_screeninfo;
struct fb_fix_screeninfo;
@@ -77,14 +77,15 @@ public:
~QLinuxFbIntegration();
QPixmapData *createPixmapData(QPixmapData::PixelType type) const;
- QWindowSurface *createWindowSurface(QWidget *widget) const;
+ QPlatformWindow *createPlatformWindow(QWidget *widget, WId WinId) const;
+ QWindowSurface *createWindowSurface(QWidget *widget, WId WinId) const;
QList<QPlatformScreen *> screens() const { return mScreens; }
private:
QLinuxFbScreen *mPrimaryScreen;
QList<QPlatformScreen *> mScreens;
- QLinuxFbPrivate *d_ptr;
+ QLinuxFbIntegrationPrivate *d_ptr;
enum PixelType { NormalPixel, BGRPixel };
diff --git a/src/plugins/platforms/minimal/minimal.pro b/src/plugins/platforms/minimal/minimal.pro
index 567b551..6c97f07 100644
--- a/src/plugins/platforms/minimal/minimal.pro
+++ b/src/plugins/platforms/minimal/minimal.pro
@@ -1,4 +1,4 @@
-TARGET = qminimalgraphicssystem
+TARGET = qminimal
include(../../qpluginbase.pri)
QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/platforms
diff --git a/src/plugins/platforms/minimal/qplatformintegration_minimal.cpp b/src/plugins/platforms/minimal/qplatformintegration_minimal.cpp
index 693e0c3..73e025c 100644
--- a/src/plugins/platforms/minimal/qplatformintegration_minimal.cpp
+++ b/src/plugins/platforms/minimal/qplatformintegration_minimal.cpp
@@ -2,6 +2,7 @@
#include "qwindowsurface_minimal.h"
#include <QtGui/private/qpixmap_raster_p.h>
+#include <QtGui/QPlatformWindow>
QMinimalIntegration::QMinimalIntegration()
{
@@ -10,7 +11,6 @@ QMinimalIntegration::QMinimalIntegration()
mPrimaryScreen->mGeometry = QRect(0, 0, 240, 320);
mPrimaryScreen->mDepth = 16;
mPrimaryScreen->mFormat = QImage::Format_RGB16;
- mPrimaryScreen->mPhysicalSize = QSize(40, 54);
mScreens.append(mPrimaryScreen);
}
@@ -19,7 +19,15 @@ QPixmapData *QMinimalIntegration::createPixmapData(QPixmapData::PixelType type)
{
return new QRasterPixmapData(type);
}
-QWindowSurface *QMinimalIntegration::createWindowSurface(QWidget *widget) const
+
+QPlatformWindow *QMinimalIntegration::createPlatformWindow(QWidget *widget, WId winId) const
+{
+ Q_UNUSED(winId);
+ return new QPlatformWindow(widget);
+}
+
+QWindowSurface *QMinimalIntegration::createWindowSurface(QWidget *widget, WId winId) const
{
+ Q_UNUSED(winId);
return new QMinimalWindowSurface(widget);
}
diff --git a/src/plugins/platforms/minimal/qplatformintegration_minimal.h b/src/plugins/platforms/minimal/qplatformintegration_minimal.h
index d4eb78b..a2f7449 100644
--- a/src/plugins/platforms/minimal/qplatformintegration_minimal.h
+++ b/src/plugins/platforms/minimal/qplatformintegration_minimal.h
@@ -57,7 +57,6 @@ public:
QRect geometry() const { return mGeometry; }
int depth() const { return mDepth; }
QImage::Format format() const { return mFormat; }
- QSize physicalSize() const { return mPhysicalSize; }
public:
QRect mGeometry;
@@ -72,7 +71,8 @@ public:
QMinimalIntegration();
QPixmapData *createPixmapData(QPixmapData::PixelType type) const;
- QWindowSurface *createWindowSurface(QWidget *widget) const;
+ QPlatformWindow *createPlatformWindow(QWidget *widget, WId winId) const;
+ QWindowSurface *createWindowSurface(QWidget *widget, WId winId) const;
QList<QPlatformScreen *> screens() const { return mScreens; }
diff --git a/src/plugins/platforms/minimal/qwindowsurface_minimal.cpp b/src/plugins/platforms/minimal/qwindowsurface_minimal.cpp
index 0b2bdd2..2f8b1f0 100644
--- a/src/plugins/platforms/minimal/qwindowsurface_minimal.cpp
+++ b/src/plugins/platforms/minimal/qwindowsurface_minimal.cpp
@@ -73,13 +73,13 @@ void QMinimalWindowSurface::flush(QWidget *widget, const QRegion &region, const
mImage.save(filename);
}
-void QMinimalWindowSurface::setGeometry(const QRect &rect)
+void QMinimalWindowSurface::resize(const QSize &size)
{
//qDebug() << "QMinimalWindowSurface::setGeometry:" << (long)this << rect;
- QWindowSurface::setGeometry(rect);
+ QWindowSurface::resize(size);
QImage::Format format = QApplicationPrivate::platformIntegration()->screens().first()->format();
- if (mImage.size() != rect.size())
- mImage = QImage(rect.size(), format);
+ if (mImage.size() != size)
+ mImage = QImage(size, format);
}
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/minimal/qwindowsurface_minimal.h b/src/plugins/platforms/minimal/qwindowsurface_minimal.h