diff options
author | Jørgen Lind <jorgen.lind@nokia.com> | 2010-04-21 11:25:54 (GMT) |
---|---|---|
committer | Jørgen Lind <jorgen.lind@nokia.com> | 2010-04-21 11:25:54 (GMT) |
commit | 6f5ad5dcab8e6f702894c4fa5c016d9837375626 (patch) | |
tree | 8951be47d1da0f836c461d0f844083f65880ebbb /src/plugins/platforms/linuxfb | |
parent | 662eab575f3678364fbd3f317624fdd840e03c3c (diff) | |
parent | 66e4d48129d6baa405ed9a4a22b12913227a8c45 (diff) | |
download | Qt-6f5ad5dcab8e6f702894c4fa5c016d9837375626.zip Qt-6f5ad5dcab8e6f702894c4fa5c016d9837375626.tar.gz Qt-6f5ad5dcab8e6f702894c4fa5c016d9837375626.tar.bz2 |
Merge branch 'platform_window' into lighthouse
Conflicts:
src/gui/kernel/qplatformscreen_lite.h
src/plugins/platforms/fb_base/fb_base.cpp
src/plugins/platforms/fb_base/fb_base.h
src/plugins/platforms/linuxfb/main.cpp
src/plugins/platforms/linuxfb/qgraphicssystem_linuxfb.cpp
src/plugins/platforms/linuxfb/qgraphicssystem_linuxfb.h
src/plugins/platforms/testlite/qplatformintegration_testlite.cpp
src/plugins/platforms/vnc/main.cpp
src/plugins/platforms/vnc/qgraphicssystem_vnc.cpp
src/plugins/platforms/vnc/qgraphicssystem_vnc.h
src/plugins/platforms/vnc/qvnccursor.cpp
src/plugins/platforms/vnc/qvnccursor.h
src/plugins/platforms/vnc/qvncserver.cpp
src/plugins/platforms/vnc/qvncserver.h
Diffstat (limited to 'src/plugins/platforms/linuxfb')
-rw-r--r-- | src/plugins/platforms/linuxfb/main.cpp | 2 | ||||
-rw-r--r-- | src/plugins/platforms/linuxfb/qgraphicssystem_linuxfb.cpp | 45 | ||||
-rw-r--r-- | src/plugins/platforms/linuxfb/qgraphicssystem_linuxfb.h | 11 |
3 files changed, 32 insertions, 26 deletions
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 }; |