summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/accessible/compat/q3complexwidgets.cpp2
-rw-r--r--src/plugins/audio/audio.pro3
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbkeyboard.cpp31
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbmouse.cpp18
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp37
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h27
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp1013
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.h57
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp20
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpixmap.h5
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp382
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbscreen.h34
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp307
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h17
-rw-r--r--src/plugins/graphicssystems/openvg/openvg.pro8
-rw-r--r--src/plugins/graphicssystems/shivavg/shivavg.pro4
-rw-r--r--src/plugins/imageformats/ico/qicohandler.cpp12
-rw-r--r--src/plugins/imageformats/mng/qmnghandler.h2
-rw-r--r--src/plugins/kbddrivers/kbddrivers.pro3
-rw-r--r--src/plugins/kbddrivers/sl5000/main.cpp77
-rw-r--r--src/plugins/kbddrivers/sl5000/sl5000.pro16
-rw-r--r--src/plugins/kbddrivers/vr41xx/main.cpp77
-rw-r--r--src/plugins/kbddrivers/vr41xx/vr41xx.pro14
-rw-r--r--src/plugins/kbddrivers/yopy/main.cpp77
-rw-r--r--src/plugins/kbddrivers/yopy/yopy.pro14
-rw-r--r--src/plugins/mousedrivers/bus/bus.pro14
-rw-r--r--src/plugins/mousedrivers/bus/main.cpp76
-rw-r--r--src/plugins/mousedrivers/linuxis/linuxis.pro10
-rw-r--r--src/plugins/mousedrivers/linuxis/linuxismousedriverplugin.cpp83
-rw-r--r--src/plugins/mousedrivers/linuxis/linuxismousedriverplugin.h58
-rw-r--r--src/plugins/mousedrivers/linuxis/linuxismousehandler.cpp180
-rw-r--r--src/plugins/mousedrivers/linuxis/linuxismousehandler.h72
-rw-r--r--src/plugins/mousedrivers/mousedrivers.pro5
-rw-r--r--src/plugins/mousedrivers/vr41xx/main.cpp76
-rw-r--r--src/plugins/mousedrivers/vr41xx/vr41xx.pro14
-rw-r--r--src/plugins/mousedrivers/yopy/main.cpp76
-rw-r--r--src/plugins/mousedrivers/yopy/yopy.pro14
-rw-r--r--src/plugins/plugins.pro1
-rw-r--r--src/plugins/s60/src/qdesktopservices_3_1.cpp6
-rw-r--r--src/plugins/s60/src/qdesktopservices_3_2.cpp6
-rw-r--r--src/plugins/s60/src/qlocale_3_1.cpp6
-rw-r--r--src/plugins/s60/src/qlocale_3_2.cpp6
42 files changed, 1041 insertions, 1919 deletions
diff --git a/src/plugins/accessible/compat/q3complexwidgets.cpp b/src/plugins/accessible/compat/q3complexwidgets.cpp
index 696bc99..b911d5e 100644
--- a/src/plugins/accessible/compat/q3complexwidgets.cpp
+++ b/src/plugins/accessible/compat/q3complexwidgets.cpp
@@ -274,7 +274,7 @@ QString Q3AccessibleTitleBar::text(Text t, int child) const
return Q3TitleBar::tr("Contains commands to manipulate the window");
case 3:
if (window && window->isMinimized())
- return Q3TitleBar::tr("Puts a minimized back to normal");
+ return Q3TitleBar::tr("Puts a minimized window back to normal");
return Q3TitleBar::tr("Moves the window out of the way");
case 4:
if (window && window->isMaximized())
diff --git a/src/plugins/audio/audio.pro b/src/plugins/audio/audio.pro
new file mode 100644
index 0000000..e93b369
--- /dev/null
+++ b/src/plugins/audio/audio.pro
@@ -0,0 +1,3 @@
+TEMPLATE = subdirs
+
+#SUBDIRS += ossaudio
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbkeyboard.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbkeyboard.cpp
index ed59db8..13c4053 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbkeyboard.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbkeyboard.cpp
@@ -77,13 +77,15 @@ private:
QSocketNotifier *keyboardNotifier;
DFBEvent event;
int bytesRead;
-
-private slots:
+ int lastUnicode, lastKeycode;
+ Qt::KeyboardModifiers lastModifiers;
+private Q_SLOTS:
void readKeyboardData();
};
QDirectFBKeyboardHandlerPrivate::QDirectFBKeyboardHandlerPrivate(QDirectFBKeyboardHandler *h)
- : handler(h), eventBuffer(0)
+ : handler(h), eventBuffer(0), keyboardNotifier(0), bytesRead(0),
+ lastUnicode(0), lastKeycode(0), lastModifiers(0)
{
Q_ASSERT(qt_screen);
@@ -114,8 +116,6 @@ QDirectFBKeyboardHandlerPrivate::QDirectFBKeyboardHandlerPrivate(QDirectFBKeyboa
::fcntl(fd, F_SETFL, flags | O_NONBLOCK);
memset(&event, 0, sizeof(event));
- bytesRead = 0;
-
keyboardNotifier = new QSocketNotifier(fd, QSocketNotifier::Read, this);
connect(keyboardNotifier, SIGNAL(activated(int)),
@@ -213,8 +213,27 @@ void QDirectFBKeyboardHandlerPrivate::readKeyboardData()
unicode = symbol;
if (unicode != -1 || keycode != 0) {
+ bool autoRepeat = false;
+ if (press) {
+ if (unicode == lastUnicode && keycode == lastKeycode && modifiers == lastModifiers) {
+ autoRepeat = true;
+ } else {
+ lastUnicode = unicode;
+ lastKeycode = keycode;
+ lastModifiers = modifiers;
+ }
+ } else {
+ lastUnicode = lastKeycode = -1;
+ lastModifiers = 0;
+ }
+ if (autoRepeat) {
+ handler->processKeyEvent(unicode, keycode,
+ modifiers, false, autoRepeat);
+
+ }
+
handler->processKeyEvent(unicode, keycode,
- modifiers, press, false);
+ modifiers, press, autoRepeat);
}
}
}
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbmouse.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbmouse.cpp
index 15fb6f4..4365a5d 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbmouse.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbmouse.cpp
@@ -71,7 +71,7 @@ private:
DFBEvent event;
uint bytesRead;
-private slots:
+private Q_SLOTS:
void readMouseData();
};
@@ -101,7 +101,7 @@ QDirectFBMouseHandlerPrivate::QDirectFBMouseHandlerPrivate(QDirectFBMouseHandler
#endif
DFBInputDeviceCapabilities caps;
- caps = DFBInputDeviceCapabilities(DICAPS_BUTTONS | DICAPS_AXES);
+ caps = DICAPS_BUTTONS | DICAPS_AXES;
result = fb->CreateInputEventBuffer(fb, caps, DFB_TRUE, &eventBuffer);
if (result != DFB_OK) {
DirectFBError("QDirectFBMouseHandler: "
@@ -203,7 +203,6 @@ void QDirectFBMouseHandlerPrivate::readMouseData()
int wheel = 0;
if (input.type == DIET_AXISMOTION) {
-#ifdef QT_NO_DIRECTFB_LAYER
if (input.flags & DIEF_AXISABS) {
switch (input.axis) {
case DIAI_X: x = input.axisabs; break;
@@ -223,19 +222,6 @@ void QDirectFBMouseHandlerPrivate::readMouseData()
"unknown axis (releative) %d", input.axis);
}
}
-#else
- if (input.axis == DIAI_X || input.axis == DIAI_Y) {
- DFBResult result = layer->GetCursorPosition(layer, &x, &y);
- if (result != DFB_OK) {
- DirectFBError("QDirectFBMouseHandler::readMouseData",
- result);
- }
- } else if (input.axis == DIAI_Z) {
- Q_ASSERT(input.flags & DIEF_AXISREL);
- wheel = input.axisrel;
- wheel *= -120;
- }
-#endif
}
Qt::MouseButtons buttons = Qt::NoButton;
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp
index 905fec3..2075799 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp
@@ -43,10 +43,17 @@
#include "qdirectfbscreen.h"
#include "qdirectfbpaintdevice.h"
+#include "qdirectfbpaintengine.h"
+
+QDirectFBPaintDevice::QDirectFBPaintDevice(QDirectFBScreen *scr)
+ : QCustomRasterPaintDevice(0), dfbSurface(0), lockedImage(0), screen(scr),
+ lock(DFBSurfaceLockFlags(0)), mem(0), engine(0)
+{}
QDirectFBPaintDevice::~QDirectFBPaintDevice()
{
delete lockedImage;
+ delete engine;
}
@@ -56,20 +63,17 @@ IDirectFBSurface *QDirectFBPaintDevice::directFBSurface() const
}
-void QDirectFBPaintDevice::lockDirectFB(uint flags)
+void QDirectFBPaintDevice::lockDirectFB(DFBSurfaceLockFlags flags)
{
if (!(lock & flags)) {
if (lock)
unlockDirectFB();
- if ((mem = QDirectFBScreen::lockSurface(dfbSurface, flags, &bpl))) {
- const QSize s = size();
- lockedImage = new QImage(mem, s.width(), s.height(), bpl,
- QDirectFBScreen::getImageFormat(dfbSurface));
- lock = flags;
- Q_ASSERT(mem);
- } else {
- lock = 0;
- }
+ mem = QDirectFBScreen::lockSurface(dfbSurface, flags, &bpl);
+ Q_ASSERT(mem);
+ const QSize s = size();
+ lockedImage = new QImage(mem, s.width(), s.height(), bpl,
+ QDirectFBScreen::getImageFormat(dfbSurface));
+ lock = flags;
}
}
@@ -83,17 +87,12 @@ void QDirectFBPaintDevice::unlockDirectFB()
delete lockedImage;
lockedImage = 0;
mem = 0;
- lock = 0;
+ lock = DFBSurfaceLockFlags(0);
}
void *QDirectFBPaintDevice::memory() const
{
- if (lock != (DSLF_READ|DSLF_WRITE)) {
- QDirectFBPaintDevice *that = const_cast<QDirectFBPaintDevice*>(this);
- that->lockDirectFB(DSLF_READ|DSLF_WRITE);
- Q_ASSERT(that->lockedImage);
- }
return mem;
}
@@ -172,4 +171,10 @@ int QDirectFBPaintDevice::metric(QPaintDevice::PaintDeviceMetric metric) const
}
}
+QPaintEngine *QDirectFBPaintDevice::paintEngine() const
+{
+ return engine;
+}
+
#endif
+
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h b/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h
index 32c49bb..c4aeb70 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h
@@ -51,6 +51,7 @@ QT_BEGIN_HEADER
QT_MODULE(Gui)
// Inherited by both window surface and pixmap
+class QDirectFBPaintEngine;
class QDirectFBPaintDevice : public QCustomRasterPaintDevice
{
public:
@@ -58,27 +59,20 @@ public:
IDirectFBSurface *directFBSurface() const;
- void lockDirectFB(uint flags);
+ void lockDirectFB(DFBSurfaceLockFlags lock);
void unlockDirectFB();
// Reimplemented from QCustomRasterPaintDevice:
- void* memory() const;
+ void *memory() const;
QImage::Format format() const;
int bytesPerLine() const;
QSize size() const;
int metric(QPaintDevice::PaintDeviceMetric metric) const;
- uint lockFlags() const { return lock; }
-protected:
- // Shouldn't create QDirectFBPaintDevice by itself but only sub-class it:
- QDirectFBPaintDevice(QDirectFBScreen *scr = QDirectFBScreen::instance())
- : QCustomRasterPaintDevice(0),
- dfbSurface(0),
- lockedImage(0),
- screen(scr),
- lock(0),
- mem(0)
- {}
+ DFBSurfaceLockFlags lockFlags() const { return lock; }
+ QPaintEngine *paintEngine() const;
+protected:
+ QDirectFBPaintDevice(QDirectFBScreen *scr);
inline int dotsPerMeterX() const
{
return (screen->deviceWidth() * 1000) / screen->physicalWidth();
@@ -87,15 +81,16 @@ protected:
{
return (screen->deviceHeight() * 1000) / screen->physicalHeight();
}
-
+protected:
IDirectFBSurface *dfbSurface;
QImage *lockedImage;
QDirectFBScreen *screen;
int bpl;
- uint lock;
+ DFBSurfaceLockFlags lock;
uchar *mem;
+ QDirectFBPaintEngine *engine;
private:
- Q_DISABLE_COPY(QDirectFBPaintDevice)
+ Q_DISABLE_COPY(QDirectFBPaintDevice);
};
QT_END_HEADER
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
index ade8554..58c8a58 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
@@ -53,199 +53,52 @@
#include <qmath.h>
#include <private/qpixmapdata_p.h>
#include <private/qpixmap_raster_p.h>
+#include <private/qimagepixmapcleanuphooks_p.h>
-#if defined QT_DIRECTFB_WARN_ON_RASTERFALLBACKS || defined QT_DIRECTFB_DISABLE_RASTERFALLBACKS
-#define VOID_ARG() static_cast<bool>(false)
-enum PaintOperation {
- DRAW_RECTS = 0x0001,
- DRAW_LINES = 0x0002,
- DRAW_IMAGE = 0x0004,
- DRAW_PIXMAP = 0x0008,
- DRAW_TILED_PIXMAP = 0x0010,
- STROKE_PATH = 0x0020,
- DRAW_PATH = 0x0040,
- DRAW_POINTS = 0x0080,
- DRAW_ELLIPSE = 0x0100,
- DRAW_POLYGON = 0x0200,
- DRAW_TEXT = 0x0400,
- FILL_PATH = 0x0800,
- FILL_RECT = 0x1000,
- DRAW_COLORSPANS = 0x2000,
- ALL = 0xffff
-};
-#endif
-
-#ifdef QT_DIRECTFB_WARN_ON_RASTERFALLBACKS
-template <typename T> inline const T *ptr(const T &t) { return &t; }
-template <> inline const bool* ptr<bool>(const bool &) { return 0; }
-template <typename device, typename T1, typename T2, typename T3>
-static void rasterFallbackWarn(const char *msg, const char *func, const device *dev,
- int scale, bool matrixRotShear, bool simplePen,
- bool dfbHandledClip, bool unsupportedCompositionMode,
- const char *nameOne, const T1 &one,
- const char *nameTwo, const T2 &two,
- const char *nameThree, const T3 &three)
-{
- QString out;
- QDebug dbg(&out);
- dbg << msg << (QByteArray(func) + "()") << "painting on";
- if (dev->devType() == QInternal::Widget) {
- dbg << static_cast<const QWidget*>(dev);
- } else {
- dbg << dev << "of type" << dev->devType();
- }
-
- dbg << "scale" << scale
- << "matrixRotShear" << matrixRotShear
- << "simplePen" << simplePen
- << "dfbHandledClip" << dfbHandledClip
- << "unsupportedCompositionMode" << unsupportedCompositionMode;
-
- const T1 *t1 = ptr(one);
- const T2 *t2 = ptr(two);
- const T3 *t3 = ptr(three);
-
- if (t1) {
- dbg << nameOne << *t1;
- if (t2) {
- dbg << nameTwo << *t2;
- if (t3) {
- dbg << nameThree << *t3;
- }
- }
- }
- qWarning("%s", qPrintable(out));
-}
-#endif
-
-#if defined QT_DIRECTFB_WARN_ON_RASTERFALLBACKS && defined QT_DIRECTFB_DISABLE_RASTERFALLBACKS
-#define RASTERFALLBACK(op, one, two, three) \
- if (op & (QT_DIRECTFB_WARN_ON_RASTERFALLBACKS)) \
- rasterFallbackWarn("Disabled raster engine operation", \
- __FUNCTION__, state()->painter->device(), \
- d_func()->scale, d_func()->matrixRotShear, \
- d_func()->simplePen, d_func()->dfbCanHandleClip(), \
- d_func()->unsupportedCompositionMode, \
- #one, one, #two, two, #three, three); \
- if (op & (QT_DIRECTFB_DISABLE_RASTERFALLBACKS)) \
- return;
-#elif defined QT_DIRECTFB_DISABLE_RASTERFALLBACKS
-#define RASTERFALLBACK(op, one, two, three) \
- if (op & (QT_DIRECTFB_DISABLE_RASTERFALLBACKS)) \
- return;
-#elif defined QT_DIRECTFB_WARN_ON_RASTERFALLBACKS
-#define RASTERFALLBACK(op, one, two, three) \
- if (op & (QT_DIRECTFB_WARN_ON_RASTERFALLBACKS)) \
- rasterFallbackWarn("Falling back to raster engine for", \
- __FUNCTION__, state()->painter->device(), \
- d_func()->scale, d_func()->matrixRotShear, \
- d_func()->simplePen, d_func()->dfbCanHandleClip(), \
- d_func()->unsupportedCompositionMode, \
- #one, one, #two, two, #three, three);
-#else
-#define RASTERFALLBACK(op, one, two, three)
-#endif
-
-static inline uint ALPHA_MUL(uint x, uint a)
-{
- uint t = x * a;
- t = ((t + (t >> 8) + 0x80) >> 8) & 0xff;
- return t;
-}
-
-class SurfaceCache
-{
-public:
- SurfaceCache() : surface(0), buffer(0), bufsize(0) {}
- ~SurfaceCache() { clear(); }
-
-
- IDirectFBSurface *getSurface(const uint *buf, int size)
- {
- if (buffer == buf && bufsize == size)
- return surface;
-
- clear();
-
- const DFBSurfaceDescription description = QDirectFBScreen::getSurfaceDescription(buf, size);
- surface = QDirectFBScreen::instance()->createDFBSurface(description, QDirectFBScreen::TrackSurface);
- if (!surface)
- qWarning("QDirectFBPaintEngine: SurfaceCache: Unable to create surface");
-
- buffer = const_cast<uint*>(buf);
- bufsize = size;
-
- return surface;
- }
-
- void clear()
- {
- if (surface && QDirectFBScreen::instance())
- QDirectFBScreen::instance()->releaseDFBSurface(surface);
- surface = 0;
- buffer = 0;
- bufsize = 0;
- }
-private:
- IDirectFBSurface *surface;
- uint *buffer;
- int bufsize;
-};
-
-
-#ifdef QT_DIRECTFB_IMAGECACHE
-#include <private/qimage_p.h>
-struct CachedImage
-{
- IDirectFBSurface *surface;
- ~CachedImage()
- {
- if (surface && QDirectFBScreen::instance()) {
- QDirectFBScreen::instance()->releaseDFBSurface(surface);
- }
- }
-};
-static QCache<qint64, CachedImage> imageCache(4*1024*1024); // 4 MB
-#endif
-
+class SurfaceCache;
class QDirectFBPaintEnginePrivate : public QRasterPaintEnginePrivate
{
public:
- enum Scale { NoScale, Scaled, NegativeScale };
+ enum TransformationTypeFlags {
+ Matrix_NegativeScale = 0x100,
+ Matrix_RectsUnsupported = (QTransform::TxRotate|QTransform::TxShear|QTransform::TxProject),
+ Matrix_BlitsUnsupported = (Matrix_NegativeScale|Matrix_RectsUnsupported)
+ };
+
+ enum CompositionModeStatus {
+ PorterDuff_None = 0x0,
+ PorterDuff_SupportedBlits = 0x1,
+ PorterDuff_SupportedPrimitives = 0x2
+ };
+
+ enum ClipType {
+ ClipUnset,
+ NoClip,
+ RectClip,
+ RegionClip,
+ ComplexClip
+ };
QDirectFBPaintEnginePrivate(QDirectFBPaintEngine *p);
~QDirectFBPaintEnginePrivate();
- void setTransform(const QTransform &m);
- void setPen(const QPen &pen);
+ inline void setTransform(const QTransform &transforma);
+ inline void setPen(const QPen &pen);
inline void setCompositionMode(QPainter::CompositionMode mode);
- inline void setOpacity(quint8 value);
- void setRenderHints(QPainter::RenderHints hints);
+ inline void setRenderHints(QPainter::RenderHints hints);
inline void setDFBColor(const QColor &color);
inline void lock();
inline void unlock();
- inline bool dfbCanHandleClip(const QRect &rect) const;
- inline bool dfbCanHandleClip(const QRectF &rect) const;
- inline bool dfbCanHandleClip() const;
inline bool isSimpleBrush(const QBrush &brush) const;
- void drawLines(const QLine *lines, int count);
- void drawLines(const QLineF *lines, int count);
-
- void fillRegion(const QRegion &r);
- void fillRects(const QRect *rects, int count);
- void drawRects(const QRect *rects, int count);
- void fillRects(const QRectF *rects, int count);
- void drawRects(const QRectF *rects, int count);
-
- void drawTiledPixmap(const QRectF &dest, const QPixmap &pixmap);
+ void drawTiledPixmap(const QRectF &dest, const QPixmap &pixmap, const QPointF &pos);
void blit(const QRectF &dest, IDirectFBSurface *surface, const QRectF &src);
inline void updateClip();
- void systemStateChanged();
+ virtual void systemStateChanged();
static IDirectFBSurface *getSurface(const QImage &img, bool *release);
@@ -257,36 +110,142 @@ public:
private:
IDirectFBSurface *surface;
- QPen pen;
-
bool antialiased;
-
bool simplePen;
- bool matrixRotShear;
- Scale scale;
+ uint transformationType; // this is QTransform::type() + Matrix_NegativeScale if qMin(transform.m11(), transform.m22()) < 0
SurfaceCache *surfaceCache;
- QTransform transform;
- int lastLockedHeight;
-
IDirectFB *fb;
- int fbWidth;
- int fbHeight;
-
quint8 opacity;
bool dirtyClip;
- bool dfbHandledClip;
- bool ignoreSystemClip;
+ ClipType clipType;
QDirectFBPaintDevice *dfbDevice;
- void *lockedMemory;
- bool unsupportedCompositionMode;
+ uint compositionModeStatus;
QDirectFBPaintEngine *q;
+ QRect currentClip;
friend class QDirectFBPaintEngine;
};
+class SurfaceCache
+{
+public:
+ SurfaceCache() : surface(0), buffer(0), bufsize(0) {}
+ ~SurfaceCache() { clear(); }
+ IDirectFBSurface *getSurface(const uint *buf, int size);
+ void clear();
+private:
+ IDirectFBSurface *surface;
+ uint *buffer;
+ int bufsize;
+};
+
+
+#ifdef QT_DIRECTFB_IMAGECACHE
+#include <private/qimage_p.h>
+struct CachedImage
+{
+ IDirectFBSurface *surface;
+ ~CachedImage()
+ {
+ if (surface && QDirectFBScreen::instance()) {
+ QDirectFBScreen::instance()->releaseDFBSurface(surface);
+ }
+ }
+};
+static QCache<qint64, CachedImage> imageCache(4*1024*1024); // 4 MB
+#endif
+
+#if defined QT_DIRECTFB_WARN_ON_RASTERFALLBACKS || defined QT_DIRECTFB_DISABLE_RASTERFALLBACKS
+#define VOID_ARG() static_cast<bool>(false)
+enum PaintOperation {
+ DRAW_RECTS = 0x0001, DRAW_LINES = 0x0002, DRAW_IMAGE = 0x0004,
+ DRAW_PIXMAP = 0x0008, DRAW_TILED_PIXMAP = 0x0010, STROKE_PATH = 0x0020,
+ DRAW_PATH = 0x0040, DRAW_POINTS = 0x0080, DRAW_ELLIPSE = 0x0100,
+ DRAW_POLYGON = 0x0200, DRAW_TEXT = 0x0400, FILL_PATH = 0x0800,
+ FILL_RECT = 0x1000, DRAW_COLORSPANS = 0x2000, ALL = 0xffff
+};
+#endif
+
+#ifdef QT_DIRECTFB_WARN_ON_RASTERFALLBACKS
+template <typename device, typename T1, typename T2, typename T3>
+static void rasterFallbackWarn(const char *msg, const char *func, const device *dev,
+ uint transformationType, bool simplePen,
+ uint clipType, uint compositionModeStatus,
+ const char *nameOne, const T1 &one,
+ const char *nameTwo, const T2 &two,
+ const char *nameThree, const T3 &three);
+#endif
+
+#if defined QT_DIRECTFB_WARN_ON_RASTERFALLBACKS && defined QT_DIRECTFB_DISABLE_RASTERFALLBACKS
+#define RASTERFALLBACK(op, one, two, three) \
+ if (op & (QT_DIRECTFB_WARN_ON_RASTERFALLBACKS)) \
+ rasterFallbackWarn("Disabled raster engine operation", \
+ __FUNCTION__, state()->painter->device(), \
+ d_func()->transformationType, \
+ d_func()->simplePen, \
+ d_func()->clipType, \
+ d_func()->compositionModeStatus, \
+ #one, one, #two, two, #three, three); \
+ if (op & (QT_DIRECTFB_DISABLE_RASTERFALLBACKS)) \
+ return;
+#elif defined QT_DIRECTFB_DISABLE_RASTERFALLBACKS
+#define RASTERFALLBACK(op, one, two, three) \
+ if (op & (QT_DIRECTFB_DISABLE_RASTERFALLBACKS)) \
+ return;
+#elif defined QT_DIRECTFB_WARN_ON_RASTERFALLBACKS
+#define RASTERFALLBACK(op, one, two, three) \
+ if (op & (QT_DIRECTFB_WARN_ON_RASTERFALLBACKS)) \
+ rasterFallbackWarn("Falling back to raster engine for", \
+ __FUNCTION__, state()->painter->device(), \
+ d_func()->transformationType, \
+ d_func()->simplePen, \
+ d_func()->clipType, \
+ d_func()->compositionModeStatus, \
+ #one, one, #two, two, #three, three);
+#else
+#define RASTERFALLBACK(op, one, two, three)
+#endif
+
+template <class T>
+static inline void drawLines(const T *lines, int n, const QTransform &transform, IDirectFBSurface *surface);
+template <class T>
+static inline void fillRects(const T *rects, int n, const QTransform &transform, IDirectFBSurface *surface);
+template <class T>
+static inline void drawRects(const T *rects, int n, const QTransform &transform, IDirectFBSurface *surface);
+
+#define CLIPPED_PAINT(operation) { \
+ DFBRegion clipRegion; \
+ switch (d->clipType) { \
+ case QDirectFBPaintEnginePrivate::NoClip: \
+ case QDirectFBPaintEnginePrivate::RectClip: \
+ operation; \
+ break; \
+ case QDirectFBPaintEnginePrivate::RegionClip: { \
+ Q_ASSERT(d->clip()); \
+ const QVector<QRect> cr = d->clip()->clipRegion.rects(); \
+ const int size = cr.size(); \
+ for (int i=0; i<size; ++i) { \
+ d->currentClip = cr.at(i); \
+ clipRegion.x1 = d->currentClip.x(); \
+ clipRegion.y1 = d->currentClip.y(); \
+ clipRegion.x2 = d->currentClip.right(); \
+ clipRegion.y2 = d->currentClip.bottom(); \
+ d->surface->SetClip(d->surface, &clipRegion); \
+ operation; \
+ } \
+ d->dirtyClip = true; \
+ break; } \
+ case QDirectFBPaintEnginePrivate::ComplexClip: \
+ case QDirectFBPaintEnginePrivate::ClipUnset: \
+ qFatal("CLIPPED_PAINT internal error %d", d->clipType); \
+ break; \
+ } \
+ }
+
+
QDirectFBPaintEngine::QDirectFBPaintEngine(QPaintDevice *device)
: QRasterPaintEngine(*(new QDirectFBPaintEnginePrivate(this)), device)
{
@@ -299,7 +258,6 @@ QDirectFBPaintEngine::~QDirectFBPaintEngine()
bool QDirectFBPaintEngine::begin(QPaintDevice *device)
{
Q_D(QDirectFBPaintEngine);
- d->lastLockedHeight = -1;
if (device->devType() == QInternal::CustomRaster) {
d->dfbDevice = static_cast<QDirectFBPaintDevice*>(device);
} else if (device->devType() == QInternal::Pixmap) {
@@ -316,23 +274,10 @@ bool QDirectFBPaintEngine::begin(QPaintDevice *device)
qFatal("QDirectFBPaintEngine used on an invalid device: 0x%x",
device->devType());
}
- d->lockedMemory = 0;
- d->surface->GetSize(d->surface, &d->fbWidth, &d->fbHeight);
-
- d->setTransform(QTransform());
- d->antialiased = false;
- d->setOpacity(255);
- d->setCompositionMode(state()->compositionMode());
- d->dirtyClip = true;
- d->setPen(state()->pen);
-
- const bool status = QRasterPaintEngine::begin(device);
-
- // XXX: QRasterPaintEngine::begin() resets the capabilities
- gccaps |= PorterDuff;
-
- return status;
+ d->prepare(d->dfbDevice);
+ d->setCompositionMode(state()->composition_mode);
+ return QRasterPaintEngine::begin(device);
}
bool QDirectFBPaintEngine::end()
@@ -343,6 +288,7 @@ bool QDirectFBPaintEngine::end()
#if (Q_DIRECTFB_VERSION >= 0x010000)
d->surface->ReleaseSource(d->surface);
#endif
+ d->currentClip = QRect();
d->surface->SetClip(d->surface, NULL);
d->surface = 0;
return QRasterPaintEngine::end();
@@ -366,7 +312,7 @@ void QDirectFBPaintEngine::penChanged()
void QDirectFBPaintEngine::opacityChanged()
{
Q_D(QDirectFBPaintEngine);
- d->setOpacity(quint8(state()->opacity * 255));
+ d->opacity = quint8(state()->opacity * 255);
QRasterPaintEngine::opacityChanged();
}
@@ -387,32 +333,26 @@ void QDirectFBPaintEngine::renderHintsChanged()
void QDirectFBPaintEngine::transformChanged()
{
Q_D(QDirectFBPaintEngine);
- const QDirectFBPaintEnginePrivate::Scale old = d->scale;
- d->setTransform(state()->transform());
- if (d->scale != old) {
- d->setPen(state()->pen);
- }
+ d->setTransform(state()->matrix);
QRasterPaintEngine::transformChanged();
}
-void QDirectFBPaintEngine::setState(QPainterState *s)
+void QDirectFBPaintEngine::setState(QPainterState *state)
{
Q_D(QDirectFBPaintEngine);
- QRasterPaintEngine::setState(s);
+ QRasterPaintEngine::setState(state);
d->dirtyClip = true;
- d->setPen(state()->pen);
- d->setOpacity(quint8(state()->opacity * 255));
- d->setCompositionMode(state()->compositionMode());
- d->setTransform(state()->transform());
+ d->setPen(state->pen);
+ d->opacity = quint8(state->opacity * 255);
+ d->setCompositionMode(state->compositionMode());
+ d->setTransform(state->transform());
+ d->setRenderHints(state->renderHints);
}
void QDirectFBPaintEngine::clip(const QVectorPath &path, Qt::ClipOperation op)
{
Q_D(QDirectFBPaintEngine);
d->dirtyClip = true;
- const QPoint bottom = d->transform.map(QPoint(0, int(path.controlPointRect().bottom())));
- if (bottom.y() > d->lastLockedHeight)
- d->lock();
QRasterPaintEngine::clip(path, op);
}
@@ -420,62 +360,66 @@ void QDirectFBPaintEngine::clip(const QRect &rect, Qt::ClipOperation op)
{
Q_D(QDirectFBPaintEngine);
d->dirtyClip = true;
- if (d->clip() && !d->clip()->hasRectClip && d->clip()->enabled) {
- const QPoint bottom = d->transform.map(QPoint(0, rect.bottom()));
- if (bottom.y() > d->lastLockedHeight)
- d->lock();
- }
-
QRasterPaintEngine::clip(rect, op);
}
void QDirectFBPaintEngine::drawRects(const QRect *rects, int rectCount)
{
Q_D(QDirectFBPaintEngine);
- d->updateClip();
+ const QPen &pen = state()->pen;
const QBrush &brush = state()->brush;
- if (d->unsupportedCompositionMode || !d->dfbCanHandleClip() || d->matrixRotShear
- || !d->simplePen || !d->isSimpleBrush(brush)) {
+ if (brush == Qt::NoBrush && pen == Qt::NoPen)
+ return;
+
+ d->updateClip();
+ if (!(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_SupportedPrimitives)
+ || (d->transformationType & QDirectFBPaintEnginePrivate::Matrix_RectsUnsupported)
+ || !d->simplePen
+ || d->clipType == QDirectFBPaintEnginePrivate::ComplexClip
+ || !d->isSimpleBrush(brush)) {
RASTERFALLBACK(DRAW_RECTS, rectCount, VOID_ARG(), VOID_ARG());
d->lock();
QRasterPaintEngine::drawRects(rects, rectCount);
return;
}
-
d->unlock();
-
if (brush != Qt::NoBrush) {
d->setDFBColor(brush.color());
- d->fillRects(rects, rectCount);
+ CLIPPED_PAINT(::fillRects<QRect>(rects, rectCount, state()->matrix, d->surface));
}
- if (d->pen != Qt::NoPen) {
- d->setDFBColor(d->pen.color());
- d->drawRects(rects, rectCount);
+ if (pen != Qt::NoPen) {
+ d->setDFBColor(pen.color());
+ CLIPPED_PAINT(::drawRects<QRect>(rects, rectCount, state()->matrix, d->surface));
}
}
void QDirectFBPaintEngine::drawRects(const QRectF *rects, int rectCount)
{
Q_D(QDirectFBPaintEngine);
- d->updateClip();
+ const QPen &pen = state()->pen;
const QBrush &brush = state()->brush;
- if (d->unsupportedCompositionMode || !d->dfbCanHandleClip() || d->matrixRotShear
- || !d->simplePen || !d->isSimpleBrush(brush)) {
+ if (brush == Qt::NoBrush && pen == Qt::NoPen)
+ return;
+
+ d->updateClip();
+ if (!(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_SupportedPrimitives)
+ || (d->transformationType & QDirectFBPaintEnginePrivate::Matrix_RectsUnsupported)
+ || !d->simplePen
+ || d->clipType == QDirectFBPaintEnginePrivate::ComplexClip
+ || !d->isSimpleBrush(brush)) {
RASTERFALLBACK(DRAW_RECTS, rectCount, VOID_ARG(), VOID_ARG());
d->lock();
QRasterPaintEngine::drawRects(rects, rectCount);
return;
}
-
d->unlock();
-
if (brush != Qt::NoBrush) {
d->setDFBColor(brush.color());
- d->fillRects(rects, rectCount);
+ CLIPPED_PAINT(::fillRects<QRectF>(rects, rectCount, state()->matrix, d->surface));
}
- if (d->pen != Qt::NoPen) {
- d->setDFBColor(d->pen.color());
- d->drawRects(rects, rectCount);
+ if (pen != Qt::NoPen) {
+ d->setDFBColor(pen.color());
+ CLIPPED_PAINT(::drawRects<QRectF>(rects, rectCount, state()->matrix, d->surface));
}
}
@@ -483,17 +427,21 @@ void QDirectFBPaintEngine::drawLines(const QLine *lines, int lineCount)
{
Q_D(QDirectFBPaintEngine);
d->updateClip();
- if (d->unsupportedCompositionMode || !d->simplePen || !d->dfbCanHandleClip()) {
+
+ if (!(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_SupportedPrimitives)
+ || !d->simplePen
+ || d->clipType == QDirectFBPaintEnginePrivate::ComplexClip) {
RASTERFALLBACK(DRAW_LINES, lineCount, VOID_ARG(), VOID_ARG());
d->lock();
QRasterPaintEngine::drawLines(lines, lineCount);
return;
}
- if (d->pen != Qt::NoPen) {
+ const QPen &pen = state()->pen;
+ if (pen != Qt::NoPen) {
d->unlock();
- d->setDFBColor(d->pen.color());
- d->drawLines(lines, lineCount);
+ d->setDFBColor(pen.color());
+ CLIPPED_PAINT(::drawLines<QLine>(lines, lineCount, state()->matrix, d->surface));
}
}
@@ -501,17 +449,21 @@ void QDirectFBPaintEngine::drawLines(const QLineF *lines, int lineCount)
{
Q_D(QDirectFBPaintEngine);
d->updateClip();
- if (d->unsupportedCompositionMode || !d->simplePen || !d->dfbCanHandleClip()) {
+
+ if (!(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_SupportedPrimitives)
+ || !d->simplePen
+ || d->clipType == QDirectFBPaintEnginePrivate::ComplexClip) {
RASTERFALLBACK(DRAW_LINES, lineCount, VOID_ARG(), VOID_ARG());
d->lock();
QRasterPaintEngine::drawLines(lines, lineCount);
return;
}
- if (d->pen != Qt::NoPen) {
+ const QPen &pen = state()->pen;
+ if (pen != Qt::NoPen) {
d->unlock();
- d->setDFBColor(d->pen.color());
- d->drawLines(lines, lineCount);
+ d->setDFBColor(pen.color());
+ CLIPPED_PAINT(::drawLines<QLineF>(lines, lineCount, state()->matrix, d->surface));
}
}
@@ -541,10 +493,9 @@ void QDirectFBPaintEngine::drawImage(const QRectF &r, const QImage &image,
d->updateClip();
#if !defined QT_NO_DIRECTFB_PREALLOCATED || defined QT_DIRECTFB_IMAGECACHE
- if (d->unsupportedCompositionMode
- || d->matrixRotShear
- || d->scale == QDirectFBPaintEnginePrivate::NegativeScale
- || !d->dfbCanHandleClip(r)
+ if (!(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_SupportedBlits)
+ || (d->transformationType & QDirectFBPaintEnginePrivate::Matrix_BlitsUnsupported)
+ || d->clipType == QDirectFBPaintEnginePrivate::ComplexClip
#ifndef QT_DIRECTFB_IMAGECACHE
|| QDirectFBScreen::getSurfacePixelFormat(image.format()) == DSPF_UNKNOWN
#elif defined QT_NO_DIRECTFB_PREALLOCATED
@@ -563,10 +514,10 @@ void QDirectFBPaintEngine::drawImage(const QRectF &r, const QImage &image,
bool release;
IDirectFBSurface *imgSurface = d->getSurface(image, &release);
d->prepareForBlit(QDirectFBScreen::hasAlpha(imgSurface));
- d->blit(r, imgSurface, sr);
+ CLIPPED_PAINT(d->blit(r, imgSurface, sr));
if (release) {
#if (Q_DIRECTFB_VERSION >= 0x010000)
- imgSurface->ReleaseSource(imgSurface);
+ d->surface->ReleaseSource(d->surface);
#endif
imgSurface->Release(imgSurface);
}
@@ -582,14 +533,15 @@ void QDirectFBPaintEngine::drawPixmap(const QRectF &r, const QPixmap &pixmap,
const QRectF &sr)
{
Q_D(QDirectFBPaintEngine);
- d->updateClip();
+ d->updateClip();
if (pixmap.pixmapData()->classId() != QPixmapData::DirectFBClass) {
RASTERFALLBACK(DRAW_PIXMAP, r, pixmap.size(), sr);
d->lock();
QRasterPaintEngine::drawPixmap(r, pixmap, sr);
- } else if (d->unsupportedCompositionMode || !d->dfbCanHandleClip(r) || d->matrixRotShear
- || d->scale == QDirectFBPaintEnginePrivate::NegativeScale) {
+ } else if (!(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_SupportedBlits)
+ || (d->transformationType & QDirectFBPaintEnginePrivate::Matrix_BlitsUnsupported)
+ || d->clipType == QDirectFBPaintEnginePrivate::ComplexClip) {
RASTERFALLBACK(DRAW_PIXMAP, r, pixmap.size(), sr);
const QImage *img = static_cast<QDirectFBPixmapData*>(pixmap.pixmapData())->buffer(DSLF_READ);
d->lock();
@@ -602,7 +554,8 @@ void QDirectFBPaintEngine::drawPixmap(const QRectF &r, const QPixmap &pixmap,
QDirectFBPixmapData *dfbData = static_cast<QDirectFBPixmapData*>(data);
dfbData->unlockDirectFB();
IDirectFBSurface *s = dfbData->directFBSurface();
- d->blit(r, s, sr);
+
+ CLIPPED_PAINT(d->blit(r, s, sr));
}
}
@@ -613,30 +566,27 @@ void QDirectFBPaintEngine::drawPixmap(const QPointF &p, const QPixmap &pm)
void QDirectFBPaintEngine::drawTiledPixmap(const QRectF &r,
const QPixmap &pixmap,
- const QPointF &sp)
+ const QPointF &offset)
{
Q_D(QDirectFBPaintEngine);
d->updateClip();
if (pixmap.pixmapData()->classId() != QPixmapData::DirectFBClass) {
- RASTERFALLBACK(DRAW_TILED_PIXMAP, r, pixmap.size(), sp);
+ RASTERFALLBACK(DRAW_TILED_PIXMAP, r, pixmap.size(), offset);
d->lock();
- QRasterPaintEngine::drawTiledPixmap(r, pixmap, sp);
- } else if (d->unsupportedCompositionMode || !d->dfbCanHandleClip(r) || d->matrixRotShear || !sp.isNull()
- || d->scale == QDirectFBPaintEnginePrivate::NegativeScale) {
- RASTERFALLBACK(DRAW_TILED_PIXMAP, r, pixmap.size(), sp);
+ QRasterPaintEngine::drawTiledPixmap(r, pixmap, offset);
+ } else if (!(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_SupportedBlits)
+ || (d->transformationType & QDirectFBPaintEnginePrivate::Matrix_BlitsUnsupported)
+ || d->clipType == QDirectFBPaintEnginePrivate::ComplexClip) {
+ RASTERFALLBACK(DRAW_TILED_PIXMAP, r, pixmap.size(), offset);
const QImage *img = static_cast<QDirectFBPixmapData*>(pixmap.pixmapData())->buffer(DSLF_READ);
d->lock();
QRasterPixmapData *data = new QRasterPixmapData(QPixmapData::PixmapType);
data->fromImage(*img, Qt::AutoColor);
const QPixmap pix(data);
- QRasterPaintEngine::drawTiledPixmap(r, pix, sp);
+ QRasterPaintEngine::drawTiledPixmap(r, pix, offset);
} else {
d->unlock();
- QPixmapData *data = pixmap.pixmapData();
- Q_ASSERT(data->classId() == QPixmapData::DirectFBClass);
- QDirectFBPixmapData *dfbData = static_cast<QDirectFBPixmapData*>(data);
- dfbData->unlockDirectFB();
- d->drawTiledPixmap(r, pixmap);
+ d->drawTiledPixmap(r, pixmap, offset);
}
}
@@ -710,6 +660,8 @@ void QDirectFBPaintEngine::drawTextItem(const QPointF &p,
void QDirectFBPaintEngine::fill(const QVectorPath &path, const QBrush &brush)
{
+ if (brush.style() == Qt::NoBrush)
+ return;
RASTERFALLBACK(FILL_PATH, path, brush, VOID_ARG());
Q_D(QDirectFBPaintEngine);
d->lock();
@@ -720,27 +672,38 @@ void QDirectFBPaintEngine::fill(const QVectorPath &path, const QBrush &brush)
void QDirectFBPaintEngine::fillRect(const QRectF &rect, const QBrush &brush)
{
Q_D(QDirectFBPaintEngine);
+ if (brush.style() == Qt::NoBrush)
+ return;
d->updateClip();
- if (!d->unsupportedCompositionMode && d->dfbCanHandleClip(rect) && !d->matrixRotShear) {
+ if (d->clipType != QDirectFBPaintEnginePrivate::ComplexClip) {
switch (brush.style()) {
case Qt::SolidPattern: {
+ if (!(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_SupportedPrimitives)
+ || (d->transformationType & QDirectFBPaintEnginePrivate::Matrix_RectsUnsupported)) {
+ break;
+ }
const QColor color = brush.color();
if (!color.isValid())
return;
d->unlock();
d->setDFBColor(color);
- const QRect r = d->transform.mapRect(rect).toRect();
- d->surface->FillRectangle(d->surface, r.x(), r.y(),
- r.width(), r.height());
+ const QRect r = state()->matrix.mapRect(rect).toRect();
+ CLIPPED_PAINT(d->surface->FillRectangle(d->surface, r.x(), r.y(), r.width(), r.height()));
return; }
- case Qt::TexturePattern:
- if (state()->brushOrigin == QPointF() && brush.transform().isIdentity()) {
- //could handle certain types of brush.transform() E.g. scale
- d->unlock();
- d->drawTiledPixmap(rect, brush.texture());
- return;
+
+ case Qt::TexturePattern: {
+ if (!(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_SupportedBlits)
+ || (d->transformationType & QDirectFBPaintEnginePrivate::Matrix_BlitsUnsupported)) {
+ break;
}
- break;
+
+ const QPixmap texture = brush.texture();
+ if (texture.pixmapData()->classId() != QPixmapData::DirectFBClass)
+ break;
+
+ d->unlock();
+ CLIPPED_PAINT(d->drawTiledPixmap(rect, texture, rect.topLeft() - state()->brushOrigin));
+ return; }
default:
break;
}
@@ -756,51 +719,21 @@ void QDirectFBPaintEngine::fillRect(const QRectF &rect, const QColor &color)
return;
Q_D(QDirectFBPaintEngine);
d->updateClip();
- if (d->unsupportedCompositionMode || !d->dfbCanHandleClip() || d->matrixRotShear) {
+ if (!(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_SupportedPrimitives)
+ || (d->transformationType & QDirectFBPaintEnginePrivate::Matrix_RectsUnsupported)
+ || d->clipType == QDirectFBPaintEnginePrivate::ComplexClip) {
RASTERFALLBACK(FILL_RECT, rect, color, VOID_ARG());
d->lock();
QRasterPaintEngine::fillRect(rect, color);
} else {
d->unlock();
d->setDFBColor(color);
- const QRect r = d->transform.mapRect(rect).toRect();
+ const QRect r = state()->matrix.mapRect(rect).toRect();
d->surface->FillRectangle(d->surface, r.x(), r.y(),
r.width(), r.height());
}
}
-void QDirectFBPaintEngine::drawColorSpans(const QSpan *spans, int count,
- uint color)
-{
- Q_D(QDirectFBPaintEngine);
- color = INV_PREMUL(color);
-
- QVarLengthArray<DFBRegion> lines(count);
- int j = 0;
- for (int i = 0; i < count; ++i) {
- if (spans[i].coverage == 255) {
- lines[j].x1 = spans[i].x;
- lines[j].y1 = spans[i].y;
- lines[j].x2 = spans[i].x + spans[i].len - 1;
- lines[j].y2 = spans[i].y;
- ++j;
- } else {
- DFBSpan span = { spans[i].x, spans[i].len };
- uint c = BYTE_MUL(color, spans[i].coverage);
- // ### how does this play with setDFBColor
- d->surface->SetColor(d->surface,
- qRed(c), qGreen(c), qBlue(c), qAlpha(c));
- d->surface->FillSpans(d->surface, spans[i].y, &span, 1);
- }
- }
- if (j > 0) {
- d->surface->SetColor(d->surface,
- qRed(color), qGreen(color), qBlue(color),
- qAlpha(color));
- d->surface->DrawLines(d->surface, lines.data(), j);
- }
-}
-
void QDirectFBPaintEngine::drawBufferSpan(const uint *buffer, int bufsize,
int x, int y, int length,
uint const_alpha)
@@ -822,9 +755,7 @@ void QDirectFBPaintEngine::initImageCache(int size)
{
Q_ASSERT(size >= 0);
imageCache.setMaxCost(size);
- typedef void (*_qt_image_cleanup_hook_64)(qint64);
- extern Q_GUI_EXPORT _qt_image_cleanup_hook_64 qt_image_cleanup_hook_64;
- qt_image_cleanup_hook_64 = ::cachedImageCleanupHook;
+ QImagePixmapCleanupHooks::instance()->addImageHook(cachedImageCleanupHook);
}
#endif // QT_DIRECTFB_IMAGECACHE
@@ -834,13 +765,11 @@ void QDirectFBPaintEngine::initImageCache(int size)
QDirectFBPaintEnginePrivate::QDirectFBPaintEnginePrivate(QDirectFBPaintEngine *p)
: surface(0), antialiased(false), simplePen(false),
- matrixRotShear(false), scale(NoScale), lastLockedHeight(-1),
- fbWidth(-1), fbHeight(-1), opacity(255), dirtyClip(true),
- dfbHandledClip(false), dfbDevice(0), lockedMemory(0),
- unsupportedCompositionMode(false), q(p)
+ transformationType(0), opacity(255), dirtyClip(true),
+ clipType(ClipUnset), dfbDevice(0),
+ compositionModeStatus(0), q(p)
{
fb = QDirectFBScreen::instance()->dfb();
- ignoreSystemClip = QDirectFBScreen::instance()->directFBFlags() & QDirectFBScreen::IgnoreSystemClip;
surfaceCache = new SurfaceCache;
}
@@ -849,23 +778,6 @@ QDirectFBPaintEnginePrivate::~QDirectFBPaintEnginePrivate()
delete surfaceCache;
}
-bool QDirectFBPaintEnginePrivate::dfbCanHandleClip(const QRect &) const
-{
- // TODO: Check to see if DirectFB can handle the clip for the given rect
- return dfbHandledClip;
-}
-
-bool QDirectFBPaintEnginePrivate::dfbCanHandleClip(const QRectF &) const
-{
- // TODO: Check to see if DirectFB can handle the clip for the given rect
- return dfbHandledClip;
-}
-
-bool QDirectFBPaintEnginePrivate::dfbCanHandleClip() const
-{
- return dfbHandledClip;
-}
-
bool QDirectFBPaintEnginePrivate::isSimpleBrush(const QBrush &brush) const
{
return (brush.style() == Qt::NoBrush) || (brush.style() == Qt::SolidPattern && !antialiased);
@@ -877,12 +789,9 @@ void QDirectFBPaintEnginePrivate::lock()
// lock so we need to call the base implementation of prepare so
// it updates its rasterBuffer to point to the new buffer address.
Q_ASSERT(dfbDevice);
- if (dfbDevice->lockFlags() != (DSLF_WRITE|DSLF_READ)
- || dfbDevice->height() != lastLockedHeight
- || dfbDevice->memory() != lockedMemory) {
+ if (dfbDevice->lockFlags() != (DSLF_WRITE|DSLF_READ)) {
+ dfbDevice->lockDirectFB(DSLF_READ|DSLF_WRITE);
prepare(dfbDevice);
- lastLockedHeight = dfbDevice->height();
- lockedMemory = dfbDevice->memory();
}
}
@@ -890,32 +799,26 @@ void QDirectFBPaintEnginePrivate::unlock()
{
Q_ASSERT(dfbDevice);
dfbDevice->unlockDirectFB();
- lockedMemory = 0;
}
-void QDirectFBPaintEnginePrivate::setTransform(const QTransform &m)
+void QDirectFBPaintEnginePrivate::setTransform(const QTransform &transform)
{
- transform = m;
- matrixRotShear = (transform.m12() != 0 || transform.m21() != 0);
+ transformationType = transform.type();
if (qMin(transform.m11(), transform.m22()) < 0) {
- scale = NegativeScale;
- } else if (transform.m11() != 1 || transform.m22() != 1) {
- scale = Scaled;
- } else {
- scale = NoScale;
+ transformationType |= QDirectFBPaintEnginePrivate::Matrix_NegativeScale;
}
+ setPen(q->state()->pen);
}
-void QDirectFBPaintEnginePrivate::setPen(const QPen &p)
+void QDirectFBPaintEnginePrivate::setPen(const QPen &pen)
{
- pen = p;
if (pen.style() == Qt::NoPen) {
simplePen = true;
} else if (pen.style() == Qt::SolidLine
&& !antialiased
&& pen.brush().style() == Qt::SolidPattern
&& pen.widthF() <= 1.0
- && (scale == NoScale || pen.isCosmetic())) {
+ && (transformationType < QTransform::TxScale || pen.isCosmetic())) {
simplePen = true;
} else {
simplePen = false;
@@ -924,13 +827,53 @@ void QDirectFBPaintEnginePrivate::setPen(const QPen &p)
void QDirectFBPaintEnginePrivate::setCompositionMode(QPainter::CompositionMode mode)
{
- unsupportedCompositionMode = (mode != QPainter::CompositionMode_SourceOver);
-}
-
-
-void QDirectFBPaintEnginePrivate::setOpacity(quint8 op)
-{
- opacity = op;
+ if (!surface)
+ return;
+ compositionModeStatus = PorterDuff_SupportedBlits;
+ switch (mode) {
+ case QPainter::CompositionMode_Clear:
+ surface->SetPorterDuff(surface, DSPD_CLEAR);
+ break;
+ case QPainter::CompositionMode_Source:
+ surface->SetPorterDuff(surface, DSPD_SRC);
+ break;
+ case QPainter::CompositionMode_SourceOver:
+ compositionModeStatus |= PorterDuff_SupportedPrimitives;
+ surface->SetPorterDuff(surface, DSPD_SRC_OVER);
+ break;
+ case QPainter::CompositionMode_DestinationOver:
+ surface->SetPorterDuff(surface, DSPD_DST_OVER);
+ break;
+ case QPainter::CompositionMode_SourceIn:
+ surface->SetPorterDuff(surface, DSPD_SRC_IN);
+ break;
+ case QPainter::CompositionMode_DestinationIn:
+ surface->SetPorterDuff(surface, DSPD_DST_IN);
+ break;
+ case QPainter::CompositionMode_SourceOut:
+ surface->SetPorterDuff(surface, DSPD_SRC_OUT);
+ break;
+ case QPainter::CompositionMode_DestinationOut:
+ surface->SetPorterDuff(surface, DSPD_DST_OUT);
+ break;
+#if (Q_DIRECTFB_VERSION >= 0x010000)
+ case QPainter::CompositionMode_SourceAtop:
+ surface->SetPorterDuff(surface, DSPD_SRC_ATOP);
+ break;
+ case QPainter::CompositionMode_DestinationAtop:
+ surface->SetPorterDuff(surface, DSPD_DST_ATOP);
+ break;
+ case QPainter::CompositionMode_Plus:
+ surface->SetPorterDuff(surface, DSPD_ADD);
+ break;
+#endif
+ case QPainter::CompositionMode_Xor:
+ surface->SetPorterDuff(surface, DSPD_XOR);
+ break;
+ default:
+ compositionModeStatus = 0;
+ break;
+ }
}
void QDirectFBPaintEnginePrivate::setRenderHints(QPainter::RenderHints hints)
@@ -952,6 +895,13 @@ void QDirectFBPaintEnginePrivate::prepareForBlit(bool alpha)
surface->SetBlittingFlags(surface, DFBSurfaceBlittingFlags(blittingFlags));
}
+static inline uint ALPHA_MUL(uint x, uint a)
+{
+ uint t = x * a;
+ t = ((t + (t >> 8) + 0x80) >> 8) & 0xff;
+ return t;
+}
+
void QDirectFBPaintEnginePrivate::setDFBColor(const QColor &color)
{
Q_ASSERT(surface);
@@ -962,67 +912,6 @@ void QDirectFBPaintEnginePrivate::setDFBColor(const QColor &color)
surface->SetDrawingFlags(surface, alpha == 255 ? DSDRAW_NOFX : DSDRAW_BLEND);
}
-void QDirectFBPaintEnginePrivate::drawLines(const QLine *lines, int n)
-{
- for (int i = 0; i < n; ++i) {
- const QLine l = transform.map(lines[i]);
- surface->DrawLine(surface, l.x1(), l.y1(), l.x2(), l.y2());
- }
-}
-
-void QDirectFBPaintEnginePrivate::drawLines(const QLineF *lines, int n)
-{
- for (int i = 0; i < n; ++i) {
- const QLine l = transform.map(lines[i]).toLine();
- surface->DrawLine(surface, l.x1(), l.y1(), l.x2(), l.y2());
- }
-}
-
-void QDirectFBPaintEnginePrivate::fillRegion(const QRegion &region)
-{
- Q_ASSERT(isSimpleBrush(q->state()->brush));
- setDFBColor(q->state()->brush.color());
- const QVector<QRect> rects = region.rects();
- const int n = rects.size();
- fillRects(rects.constData(), n);
-}
-
-void QDirectFBPaintEnginePrivate::fillRects(const QRect *rects, int n)
-{
- for (int i = 0; i < n; ++i) {
- const QRect r = transform.mapRect(rects[i]);
- surface->FillRectangle(surface, r.x(), r.y(),
- r.width(), r.height());
- }
-}
-
-void QDirectFBPaintEnginePrivate::fillRects(const QRectF *rects, int n)
-{
- for (int i = 0; i < n; ++i) {
- const QRect r = transform.mapRect(rects[i]).toRect();
- surface->FillRectangle(surface, r.x(), r.y(),
- r.width(), r.height());
- }
-}
-
-void QDirectFBPaintEnginePrivate::drawRects(const QRect *rects, int n)
-{
- for (int i = 0; i < n; ++i) {
- const QRect r = transform.mapRect(rects[i]);
- surface->DrawRectangle(surface, r.x(), r.y(),
- r.width() + 1, r.height() + 1);
- }
-}
-
-void QDirectFBPaintEnginePrivate::drawRects(const QRectF *rects, int n)
-{
- for (int i = 0; i < n; ++i) {
- const QRect r = transform.mapRect(rects[i]).toRect();
- surface->DrawRectangle(surface, r.x(), r.y(),
- r.width() + 1, r.height() + 1);
- }
-}
-
IDirectFBSurface *QDirectFBPaintEnginePrivate::getSurface(const QImage &img, bool *release)
{
#ifndef QT_DIRECTFB_IMAGECACHE
@@ -1061,7 +950,7 @@ IDirectFBSurface *QDirectFBPaintEnginePrivate::getSurface(const QImage &img, boo
void QDirectFBPaintEnginePrivate::blit(const QRectF &dest, IDirectFBSurface *s, const QRectF &src)
{
const QRect sr = src.toRect();
- const QRect dr = transform.mapRect(dest).toRect();
+ const QRect dr = q->state()->matrix.mapRect(dest).toRect();
if (dr.isEmpty())
return;
const DFBRectangle sRect = { sr.x(), sr.y(), sr.width(), sr.height() };
@@ -1077,55 +966,107 @@ void QDirectFBPaintEnginePrivate::blit(const QRectF &dest, IDirectFBSurface *s,
DirectFBError("QDirectFBPaintEngine::drawPixmap()", result);
}
-void QDirectFBPaintEnginePrivate::drawTiledPixmap(const QRectF &dest,
- const QPixmap &pixmap)
+static inline qreal fixCoord(qreal rect_pos, qreal pixmapSize, qreal offset)
+{
+ qreal pos = rect_pos - offset;
+ while (pos > rect_pos)
+ pos -= pixmapSize;
+ while (pos + pixmapSize < rect_pos)
+ pos += pixmapSize;
+ return pos;
+}
+
+void QDirectFBPaintEnginePrivate::drawTiledPixmap(const QRectF &dest, const QPixmap &pixmap, const QPointF &off)
{
+ Q_ASSERT(!dirtyClip);
+ Q_ASSERT(!(transformationType & Matrix_BlitsUnsupported));
+ const QTransform &transform = q->state()->matrix;
+ const QRect destinationRect = transform.mapRect(dest).toRect().normalized();
+ QRect newClip = destinationRect;
+ if (!currentClip.isEmpty())
+ newClip &= currentClip;
+
+ if (newClip.isNull())
+ return;
+
+ const DFBRegion clip = {
+ newClip.x(),
+ newClip.y(),
+ newClip.right(),
+ newClip.bottom()
+ };
+ surface->SetClip(surface, &clip);
+
+ QPointF offset = off;
+ Q_ASSERT(transform.type() <= QTransform::TxScale);
prepareForBlit(pixmap.hasAlphaChannel());
QPixmapData *data = pixmap.pixmapData();
Q_ASSERT(data->classId() == QPixmapData::DirectFBClass);
QDirectFBPixmapData *dfbData = static_cast<QDirectFBPixmapData*>(data);
- IDirectFBSurface *s = dfbData->directFBSurface();
- const QRect dr = transform.mapRect(dest).toRect();
- DFBResult result = DFB_OK;
-
- if (scale == NoScale && dr == QRect(0, 0, fbWidth, fbHeight)) {
- result = surface->TileBlit(surface, s, 0, 0, 0);
- } else if (scale == NoScale) {
- const int dx = pixmap.width();
- const int dy = pixmap.height();
- const DFBRectangle rect = { 0, 0, dx, dy };
- QVarLengthArray<DFBRectangle> rects;
- QVarLengthArray<DFBPoint> points;
-
- for (int y = dr.y(); y <= dr.bottom(); y += dy) {
- for (int x = dr.x(); x <= dr.right(); x += dx) {
- rects.append(rect);
- const DFBPoint point = { x, y };
- points.append(point);
+ dfbData->unlockDirectFB();
+ const QSize pixmapSize = dfbData->size();
+ IDirectFBSurface *sourceSurface = dfbData->directFBSurface();
+ if (transform.isScaling()) {
+ Q_ASSERT(qMin(transform.m11(), transform.m22()) >= 0);
+ offset.rx() *= transform.m11();
+ offset.ry() *= transform.m22();
+
+ const QSizeF mappedSize(pixmapSize.width() * transform.m11(), pixmapSize.height() * transform.m22());
+ qreal y = ::fixCoord(destinationRect.y(), mappedSize.height(), offset.y());
+ const qreal startX = ::fixCoord(destinationRect.x(), mappedSize.width(), offset.x());
+ while (y <= destinationRect.bottom()) {
+ qreal x = startX;
+ while (x <= destinationRect.right()) {
+ const DFBRectangle destination = { qRound(x), qRound(y), mappedSize.width(), mappedSize.height() };
+ surface->StretchBlit(surface, sourceSurface, 0, &destination);
+ x += mappedSize.width();
}
+ y += mappedSize.height();
}
- result = surface->BatchBlit(surface, s, rects.constData(),
- points.constData(), points.size());
} else {
- const QRect sr = transform.mapRect(QRect(0, 0, pixmap.width(), pixmap.height()));
- const int dx = sr.width();
- const int dy = sr.height();
- const DFBRectangle sRect = { 0, 0, dx, dy };
-
- for (int y = dr.y(); y <= dr.bottom(); y += dy) {
- for (int x = dr.x(); x <= dr.right(); x += dx) {
- const DFBRectangle dRect = { x, y, dx, dy };
- result = surface->StretchBlit(surface, s, &sRect, &dRect);
- if (result != DFB_OK) {
- y = dr.bottom() + 1;
- break;
- }
+ qreal y = ::fixCoord(destinationRect.y(), pixmapSize.height(), offset.y());
+ const qreal startX = ::fixCoord(destinationRect.x(), pixmapSize.width(), offset.x());
+ int horizontal = qMax(1, destinationRect.width() / pixmapSize.width()) + 1;
+ if (startX != destinationRect.x())
+ ++horizontal;
+ int vertical = qMax(1, destinationRect.height() / pixmapSize.height()) + 1;
+ if (y != destinationRect.y())
+ ++vertical;
+
+ const int maxCount = (vertical * horizontal);
+ QVarLengthArray<DFBRectangle, 16> sourceRects(maxCount);
+ QVarLengthArray<DFBPoint, 16> points(maxCount);
+
+ int i = 0;
+ while (y <= destinationRect.bottom()) {
+ Q_ASSERT(i < maxCount);
+ qreal x = startX;
+ while (x <= destinationRect.right()) {
+ points[i].x = qRound(x);
+ points[i].y = qRound(y);
+ sourceRects[i].x = 0;
+ sourceRects[i].y = 0;
+ sourceRects[i].w = int(pixmapSize.width());
+ sourceRects[i].h = int(pixmapSize.height());
+ x += pixmapSize.width();
+ ++i;
}
+ y += pixmapSize.height();
}
+ surface->BatchBlit(surface, sourceSurface, sourceRects.constData(), points.constData(), i);
}
- if (result != DFB_OK)
- DirectFBError("QDirectFBPaintEngine::drawTiledPixmap()", result);
+ if (currentClip.isEmpty()) {
+ surface->SetClip(surface, 0);
+ } else {
+ const DFBRegion clip = {
+ currentClip.x(),
+ currentClip.y(),
+ currentClip.right(),
+ currentClip.bottom()
+ };
+ surface->SetClip(surface, &clip);
+ }
}
void QDirectFBPaintEnginePrivate::updateClip()
@@ -1133,23 +1074,26 @@ void QDirectFBPaintEnginePrivate::updateClip()
if (!dirtyClip)
return;
+ currentClip = QRect();
const QClipData *clipData = clip();
if (!clipData || !clipData->enabled) {
surface->SetClip(surface, NULL);
- dfbHandledClip = true;
+ clipType = NoClip;
} else if (clipData->hasRectClip) {
const DFBRegion r = {
clipData->clipRect.x(),
clipData->clipRect.y(),
- clipData->clipRect.x() + clipData->clipRect.width(),
- clipData->clipRect.y() + clipData->clipRect.height()
+ clipData->clipRect.right(),
+ clipData->clipRect.bottom()
};
surface->SetClip(surface, &r);
- dfbHandledClip = true;
- } else if (clipData->hasRegionClip && ignoreSystemClip && clipData->clipRegion == systemClip) {
- dfbHandledClip = true;
+ currentClip = clipData->clipRect.normalized();
+ // ### is this guaranteed to always be normalized?
+ clipType = RectClip;
+ } else if (clipData->hasRegionClip) {
+ clipType = RegionClip;
} else {
- dfbHandledClip = false;
+ clipType = ComplexClip;
}
dirtyClip = false;
@@ -1161,4 +1105,125 @@ void QDirectFBPaintEnginePrivate::systemStateChanged()
QRasterPaintEnginePrivate::systemStateChanged();
}
+IDirectFBSurface *SurfaceCache::getSurface(const uint *buf, int size)
+{
+ if (buffer == buf && bufsize == size)
+ return surface;
+
+ clear();
+
+ const DFBSurfaceDescription description = QDirectFBScreen::getSurfaceDescription(buf, size);
+ surface = QDirectFBScreen::instance()->createDFBSurface(description, QDirectFBScreen::TrackSurface);
+ if (!surface)
+ qWarning("QDirectFBPaintEngine: SurfaceCache: Unable to create surface");
+
+ buffer = const_cast<uint*>(buf);
+ bufsize = size;
+
+ return surface;
+}
+
+void SurfaceCache::clear()
+{
+ if (surface && QDirectFBScreen::instance())
+ QDirectFBScreen::instance()->releaseDFBSurface(surface);
+ surface = 0;
+ buffer = 0;
+ bufsize = 0;
+}
+
+
+static inline QRect mapRect(const QTransform &transform, const QRect &rect) { return transform.mapRect(rect); }
+static inline QRect mapRect(const QTransform &transform, const QRectF &rect) { return transform.mapRect(rect).toRect(); }
+static inline QLine map(const QTransform &transform, const QLine &line) { return transform.map(line); }
+static inline QLine map(const QTransform &transform, const QLineF &line) { return transform.map(line).toLine(); }
+template <class T>
+static inline void drawLines(const T *lines, int n, const QTransform &transform, IDirectFBSurface *surface)
+{
+ if (n == 1) {
+ const QLine l = ::map(transform, lines[0]);
+ surface->DrawLine(surface, l.x1(), l.y1(), l.x2(), l.y2());
+ } else {
+ QVarLengthArray<DFBRegion, 32> lineArray(n);
+ for (int i=0; i<n; ++i) {
+ const QLine l = ::map(transform, lines[i]);
+ lineArray[i].x1 = l.x1();
+ lineArray[i].y1 = l.y1();
+ lineArray[i].x2 = l.x2();
+ lineArray[i].y2 = l.y2();
+ }
+ surface->DrawLines(surface, lineArray.constData(), n);
+ }
+}
+
+template <class T>
+static inline void fillRects(const T *rects, int n, const QTransform &transform, IDirectFBSurface *surface)
+{
+ if (n == 1) {
+ const QRect r = ::mapRect(transform, rects[0]);
+ surface->FillRectangle(surface, r.x(), r.y(), r.width(), r.height());
+ } else {
+ QVarLengthArray<DFBRectangle, 32> rectArray(n);
+ for (int i=0; i<n; ++i) {
+ const QRect r = ::mapRect(transform, rects[i]);
+ rectArray[i].x = r.x();
+ rectArray[i].y = r.y();
+ rectArray[i].w = r.width();
+ rectArray[i].h = r.height();
+ }
+ surface->FillRectangles(surface, rectArray.constData(), n);
+ }
+}
+
+template <class T>
+static inline void drawRects(const T *rects, int n, const QTransform &transform, IDirectFBSurface *surface)
+{
+ for (int i=0; i<n; ++i) {
+ const QRect r = ::mapRect(transform, rects[i]);
+ surface->DrawRectangle(surface, r.x(), r.y(), r.width(), r.height());
+ }
+}
+
+#ifdef QT_DIRECTFB_WARN_ON_RASTERFALLBACKS
+template <typename T> inline const T *ptr(const T &t) { return &t; }
+template <> inline const bool* ptr<bool>(const bool &) { return 0; }
+template <typename device, typename T1, typename T2, typename T3>
+static void rasterFallbackWarn(const char *msg, const char *func, const device *dev,
+ uint transformationType, bool simplePen,
+ uint clipType, uint compositionModeStatus,
+ const char *nameOne, const T1 &one,
+ const char *nameTwo, const T2 &two,
+ const char *nameThree, const T3 &three)
+{
+ QString out;
+ QDebug dbg(&out);
+ dbg << msg << (QByteArray(func) + "()") << "painting on";
+ if (dev->devType() == QInternal::Widget) {
+ dbg << static_cast<const QWidget*>(dev);
+ } else {
+ dbg << dev << "of type" << dev->devType();
+ }
+
+ dbg << QString("transformationType 0x%1").arg(transformationType, 3, 16, QLatin1Char('0'))
+ << "simplePen" << simplePen
+ << "clipType" << clipType
+ << "compositionModeStatus" << compositionModeStatus;
+
+ const T1 *t1 = ptr(one);
+ const T2 *t2 = ptr(two);
+ const T3 *t3 = ptr(three);
+
+ if (t1) {
+ dbg << nameOne << *t1;
+ if (t2) {
+ dbg << nameTwo << *t2;
+ if (t3) {
+ dbg << nameThree << *t3;
+ }
+ }
+ }
+ qWarning("%s", qPrintable(out));
+}
+
+#endif // QT_DIRECTFB_WARN_ON_RASTERFALLBACKS
#endif // QT_NO_DIRECTFB
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.h b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.h
index 6df0c0a..6148b14 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.h
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.h
@@ -53,46 +53,43 @@ class QDirectFBPaintEnginePrivate;
class QDirectFBPaintEngine : public QRasterPaintEngine
{
- Q_DECLARE_SCOPED_PRIVATE(QDirectFBPaintEngine)
+ Q_DECLARE_PRIVATE(QDirectFBPaintEngine)
public:
QDirectFBPaintEngine(QPaintDevice *device);
- ~QDirectFBPaintEngine();
+ virtual ~QDirectFBPaintEngine();
- bool begin(QPaintDevice *device);
- bool end();
+ virtual bool begin(QPaintDevice *device);
+ virtual bool end();
- void drawRects(const QRect *rects, int rectCount);
- void drawRects(const QRectF *rects, int rectCount);
+ virtual void drawRects(const QRect *rects, int rectCount);
+ virtual void drawRects(const QRectF *rects, int rectCount);
- void fillRect(const QRectF &r, const QBrush &brush);
- void fillRect(const QRectF &r, const QColor &color);
+ virtual void fillRect(const QRectF &r, const QBrush &brush);
+ virtual void fillRect(const QRectF &r, const QColor &color);
- void drawLines(const QLine *line, int lineCount);
- void drawLines(const QLineF *line, int lineCount);
+ virtual void drawLines(const QLine *line, int lineCount);
+ virtual void drawLines(const QLineF *line, int lineCount);
- void drawImage(const QPointF &p, const QImage &img);
- void drawImage(const QRectF &r, const QImage &pm, const QRectF &sr,
- Qt::ImageConversionFlags falgs = Qt::AutoColor);
+ virtual void drawImage(const QPointF &p, const QImage &img);
+ virtual void drawImage(const QRectF &r, const QImage &pm, const QRectF &sr,
+ Qt::ImageConversionFlags falgs = Qt::AutoColor);
- void drawPixmap(const QPointF &p, const QPixmap &pm);
- void drawPixmap(const QRectF &r, const QPixmap &pixmap, const QRectF &sr);
- void drawTiledPixmap(const QRectF &r, const QPixmap &pm, const QPointF &sr);
+ virtual void drawPixmap(const QPointF &p, const QPixmap &pm);
+ virtual void drawPixmap(const QRectF &r, const QPixmap &pixmap, const QRectF &sr);
+ virtual void drawTiledPixmap(const QRectF &r, const QPixmap &pm, const QPointF &sr);
- void drawColorSpans(const QSpan *spans, int count, uint color);
- void drawBufferSpan(const uint *buffer, int bufsize,
- int x, int y, int length, uint const_alpha);
+ virtual void drawBufferSpan(const uint *buffer, int bufsize,
+ int x, int y, int length, uint const_alpha);
-
- // The following methods simply lock the surface & call the base implementation
- void stroke(const QVectorPath &path, const QPen &pen);
- void drawPath(const QPainterPath &path);
- void drawPoints(const QPointF *points, int pointCount);
- void drawPoints(const QPoint *points, int pointCount);
- void drawEllipse(const QRectF &rect);
- void drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode);
- void drawPolygon(const QPoint *points, int pointCount, PolygonDrawMode mode);
- void drawTextItem(const QPointF &p, const QTextItem &textItem);
- void fill(const QVectorPath &path, const QBrush &brush);
+ virtual void stroke(const QVectorPath &path, const QPen &pen);
+ virtual void drawPath(const QPainterPath &path);
+ virtual void drawPoints(const QPointF *points, int pointCount);
+ virtual void drawPoints(const QPoint *points, int pointCount);
+ virtual void drawEllipse(const QRectF &rect);
+ virtual void drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode);
+ virtual void drawPolygon(const QPoint *points, int pointCount, PolygonDrawMode mode);
+ virtual void drawTextItem(const QPointF &p, const QTextItem &textItem);
+ virtual void fill(const QVectorPath &path, const QBrush &brush);
virtual void clipEnabledChanged();
virtual void penChanged();
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
index c9d5d7c..bedd9e5 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
@@ -49,9 +49,9 @@
static int global_ser_no = 0;
-QDirectFBPixmapData::QDirectFBPixmapData(PixelType pixelType)
- : QPixmapData(pixelType, DirectFBClass),
- engine(0), format(QImage::Format_Invalid), alpha(false)
+QDirectFBPixmapData::QDirectFBPixmapData(QDirectFBScreen *screen, PixelType pixelType)
+ : QPixmapData(pixelType, DirectFBClass), QDirectFBPaintDevice(screen),
+ format(QImage::Format_Invalid), alpha(false)
{
setSerialNumber(0);
}
@@ -61,7 +61,6 @@ QDirectFBPixmapData::~QDirectFBPixmapData()
unlockDirectFB();
if (dfbSurface && QDirectFBScreen::instance())
screen->releaseDFBSurface(dfbSurface);
- delete engine;
}
void QDirectFBPixmapData::resize(int width, int height)
@@ -304,7 +303,7 @@ QPixmap QDirectFBPixmapData::transformed(const QTransform &transform,
Q_ASSERT(image);
const QImage transformed = image->transformed(transform, mode);
that->unlockDirectFB();
- QDirectFBPixmapData *data = new QDirectFBPixmapData(QPixmapData::PixmapType);
+ QDirectFBPixmapData *data = new QDirectFBPixmapData(screen, QPixmapData::PixmapType);
data->fromImage(transformed, Qt::AutoColor);
return QPixmap(data);
}
@@ -314,7 +313,7 @@ QPixmap QDirectFBPixmapData::transformed(const QTransform &transform,
if (size.isEmpty())
return QPixmap();
- QDirectFBPixmapData *data = new QDirectFBPixmapData(QPixmapData::PixmapType);
+ QDirectFBPixmapData *data = new QDirectFBPixmapData(screen, QPixmapData::PixmapType);
DFBSurfaceBlittingFlags flags = DSBLIT_NOFX;
data->alpha = alpha;
if (alpha) {
@@ -345,6 +344,10 @@ QImage QDirectFBPixmapData::toImage() const
if (!dfbSurface)
return QImage();
+#if 0
+ // In later versions of DirectFB one can set a flag to tell
+ // DirectFB not to move the surface to videomemory. When that
+ // happens we can use this (hopefully faster) codepath
#ifndef QT_NO_DIRECTFB_PREALLOCATED
QImage ret(w, h, QDirectFBScreen::getImageFormat(dfbSurface));
if (IDirectFBSurface *imgSurface = screen->createDFBSurface(ret, QDirectFBScreen::DontTrackSurface)) {
@@ -362,12 +365,15 @@ QImage QDirectFBPixmapData::toImage() const
return ret;
}
#endif
+#endif
QDirectFBPixmapData *that = const_cast<QDirectFBPixmapData*>(this);
const QImage *img = that->buffer();
return img->copy();
}
+/* This is QPixmapData::paintEngine(), not QPaintDevice::paintEngine() */
+
QPaintEngine *QDirectFBPixmapData::paintEngine() const
{
if (!engine) {
@@ -385,7 +391,7 @@ QImage *QDirectFBPixmapData::buffer()
return lockedImage;
}
-QImage * QDirectFBPixmapData::buffer(uint lockFlags)
+QImage * QDirectFBPixmapData::buffer(DFBSurfaceLockFlags lockFlags)
{
lockDirectFB(lockFlags);
return lockedImage;
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.h b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.h
index e81aef4..df3c679 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.h
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.h
@@ -56,7 +56,7 @@ class QDirectFBPaintEngine;
class QDirectFBPixmapData : public QPixmapData, public QDirectFBPaintDevice
{
public:
- QDirectFBPixmapData(PixelType pixelType);
+ QDirectFBPixmapData(QDirectFBScreen *screen, PixelType pixelType);
~QDirectFBPixmapData();
// Re-implemented from QPixmapData:
@@ -71,7 +71,7 @@ public:
virtual QImage *buffer();
virtual int metric(QPaintDevice::PaintDeviceMetric m) const {return QDirectFBPaintDevice::metric(m);}
- QImage *buffer(uint lockFlags);
+ QImage *buffer(DFBSurfaceLockFlags lockFlags);
// Pure virtual in QPixmapData, so re-implement here and delegate to QDirectFBPaintDevice
inline QImage::Format pixelFormat() const { return format; }
@@ -79,7 +79,6 @@ public:
inline bool hasAlphaChannel() const { return alpha; }
private:
void invalidate();
- QDirectFBPaintEngine *engine;
QImage::Format format;
bool alpha;
};
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
index 76064ad..4f8fa2f 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
@@ -57,7 +57,7 @@
class QDirectFBScreenPrivate : public QObject, public QWSGraphicsSystem
{
public:
- QDirectFBScreenPrivate(QDirectFBScreen*);
+ QDirectFBScreenPrivate(QDirectFBScreen *qptr);
~QDirectFBScreenPrivate();
void setFlipFlags(const QStringList &args);
@@ -70,7 +70,6 @@ public:
IDirectFBDisplayLayer *dfbLayer;
#endif
IDirectFBScreen *dfbScreen;
- QRegion prevExpose;
QSet<IDirectFBSurface*> allocatedSurfaces;
@@ -82,10 +81,12 @@ public:
#endif
QDirectFBScreen::DirectFBFlags directFBFlags;
QImage::Format alphaPixmapFormat;
+ QColor backgroundColor;
+ QDirectFBScreen *q;
};
-QDirectFBScreenPrivate::QDirectFBScreenPrivate(QDirectFBScreen *screen)
- : QWSGraphicsSystem(screen), dfb(0), dfbSurface(0), flipFlags(DSFLIP_NONE)
+QDirectFBScreenPrivate::QDirectFBScreenPrivate(QDirectFBScreen *qptr)
+ : QWSGraphicsSystem(qptr), dfb(0), dfbSurface(0), flipFlags(DSFLIP_NONE)
#ifndef QT_NO_DIRECTFB_LAYER
, dfbLayer(0)
#endif
@@ -98,6 +99,7 @@ QDirectFBScreenPrivate::QDirectFBScreenPrivate(QDirectFBScreen *screen)
#endif
, directFBFlags(QDirectFBScreen::NoFlags)
, alphaPixmapFormat(QImage::Format_Invalid)
+ , q(qptr)
{
#ifndef QT_NO_QWS_SIGNALHANDLER
QWSSignalHandler::instance()->addObject(this);
@@ -141,6 +143,7 @@ IDirectFBSurface *QDirectFBScreen::createDFBSurface(const QImage &img, SurfaceCr
{
if (img.isNull()) // assert?
return 0;
+
if (QDirectFBScreen::getSurfacePixelFormat(img.format()) == DSPF_UNKNOWN) {
QImage image = img.convertToFormat(img.hasAlphaChannel()
? d_ptr->alphaPixmapFormat
@@ -208,7 +211,7 @@ IDirectFBSurface *QDirectFBScreen::createDFBSurface(const QSize &size,
{
DFBSurfaceDescription desc;
memset(&desc, 0, sizeof(DFBSurfaceDescription));
- desc.flags = DFBSurfaceDescriptionFlags(DSDESC_WIDTH|DSDESC_HEIGHT);
+ desc.flags |= DSDESC_WIDTH|DSDESC_HEIGHT;
if (!QDirectFBScreen::initSurfaceDescriptionPixelFormat(&desc, format))
return 0;
desc.width = size.width();
@@ -226,13 +229,15 @@ IDirectFBSurface *QDirectFBScreen::createDFBSurface(DFBSurfaceDescription desc,
return 0;
}
- if (d_ptr->directFBFlags & VideoOnly && !(desc.flags & DSDESC_PREALLOCATED)) {
+ if (d_ptr->directFBFlags & VideoOnly
+ && !(desc.flags & DSDESC_PREALLOCATED)
+ && (!(desc.flags & DSDESC_CAPS) || !(desc.caps & DSCAPS_SYSTEMONLY))) {
// Add the video only capability. This means the surface will be created in video ram
if (!(desc.flags & DSDESC_CAPS)) {
desc.caps = DSCAPS_VIDEOONLY;
- desc.flags = DFBSurfaceDescriptionFlags(desc.flags | DSDESC_CAPS);
+ desc.flags |= DSDESC_CAPS;
} else {
- desc.caps = DFBSurfaceCapabilities(desc.caps | DSCAPS_VIDEOONLY);
+ desc.caps |= DSCAPS_VIDEOONLY;
}
result = d_ptr->dfb->CreateSurface(d_ptr->dfb, &desc, &newSurface);
if (result != DFB_OK
@@ -247,11 +252,11 @@ IDirectFBSurface *QDirectFBScreen::createDFBSurface(DFBSurfaceDescription desc,
desc.preallocated[0].data, desc.preallocated[0].pitch,
DirectFBErrorString(result));
}
- desc.caps = DFBSurfaceCapabilities(desc.caps & ~DSCAPS_VIDEOONLY);
+ desc.caps &= ~DSCAPS_VIDEOONLY;
}
if (d_ptr->directFBFlags & SystemOnly)
- desc.caps = DFBSurfaceCapabilities(desc.caps | DSCAPS_SYSTEMONLY);
+ desc.caps |= DSCAPS_SYSTEMONLY;
if (!newSurface)
result = d_ptr->dfb->CreateSurface(d_ptr->dfb, &desc, &newSurface);
@@ -319,10 +324,10 @@ IDirectFBSurface *QDirectFBScreen::copyToDFBSurface(const QImage &img,
DFBResult result = dfbSurface->Blit(dfbSurface, imgSurface, 0, 0, 0);
if (result != DFB_OK)
DirectFBError("QDirectFBScreen::copyToDFBSurface()", result);
+ imgSurface->Release(imgSurface);
#if (Q_DIRECTFB_VERSION >= 0x010000)
dfbSurface->ReleaseSource(dfbSurface);
#endif
- imgSurface->Release(imgSurface);
#else // QT_NO_DIRECTFB_PREALLOCATED
Q_ASSERT(image.format() == pixmapFormat);
int bpl;
@@ -459,20 +464,16 @@ DFBSurfaceDescription QDirectFBScreen::getSurfaceDescription(const QImage &image
const DFBSurfacePixelFormat format = getSurfacePixelFormat(image.format());
if (format == DSPF_UNKNOWN || image.isNull()) {
- description.flags = DFBSurfaceDescriptionFlags(0);
+ description.flags = DSDESC_NONE;
return description;
}
- description.flags = DFBSurfaceDescriptionFlags(DSDESC_WIDTH
- | DSDESC_HEIGHT
-#ifndef QT_NO_DIRECTFB_PREALLOCATED
- | DSDESC_PREALLOCATED
-#endif
- | DSDESC_PIXELFORMAT);
+ description.flags = DSDESC_WIDTH|DSDESC_HEIGHT|DSDESC_PIXELFORMAT;
QDirectFBScreen::initSurfaceDescriptionPixelFormat(&description, image.format());
description.width = image.width();
description.height = image.height();
#ifndef QT_NO_DIRECTFB_PREALLOCATED
+ description.flags |= DSDESC_PREALLOCATED;
description.preallocated[0].data = (void*)(image.bits());
description.preallocated[0].pitch = image.bytesPerLine();
description.preallocated[1].data = 0;
@@ -491,11 +492,7 @@ DFBSurfaceDescription QDirectFBScreen::getSurfaceDescription(const uint *buffer,
DFBSurfaceDescription description;
memset(&description, 0, sizeof(DFBSurfaceDescription));
- description.flags = DFBSurfaceDescriptionFlags(DSDESC_CAPS
- | DSDESC_WIDTH
- | DSDESC_HEIGHT
- | DSDESC_PIXELFORMAT
- | DSDESC_PREALLOCATED);
+ description.flags = DSDESC_CAPS|DSDESC_WIDTH|DSDESC_HEIGHT|DSDESC_PIXELFORMAT|DSDESC_PREALLOCATED;
description.caps = DSCAPS_PREMULTIPLIED;
description.width = length;
description.height = 1;
@@ -504,8 +501,7 @@ DFBSurfaceDescription QDirectFBScreen::getSurfaceDescription(const uint *buffer,
description.preallocated[0].pitch = length * sizeof(uint);
description.preallocated[1].data = 0;
description.preallocated[1].pitch = 0;
-
- return description;
+return description;
}
#ifndef QT_NO_DIRECTFB_PALETTE
@@ -727,19 +723,19 @@ void QDirectFBScreenPrivate::setFlipFlags(const QStringList &args)
flipFlags = DSFLIP_NONE;
foreach(const QString &flip, flips) {
if (flip == QLatin1String("wait"))
- flipFlags = DFBSurfaceFlipFlags(flipFlags | DSFLIP_WAIT);
+ flipFlags |= DSFLIP_WAIT;
else if (flip == QLatin1String("blit"))
- flipFlags = DFBSurfaceFlipFlags(flipFlags | DSFLIP_BLIT);
+ flipFlags |= DSFLIP_BLIT;
else if (flip == QLatin1String("onsync"))
- flipFlags = DFBSurfaceFlipFlags(flipFlags | DSFLIP_ONSYNC);
+ flipFlags |= DSFLIP_ONSYNC;
else if (flip == QLatin1String("pipeline"))
- flipFlags = DFBSurfaceFlipFlags(flipFlags | DSFLIP_PIPELINE);
+ flipFlags |= DSFLIP_PIPELINE;
else
qWarning("QDirectFBScreen: Unknown flip argument: %s",
qPrintable(flip));
}
} else {
- flipFlags = DFBSurfaceFlipFlags(DSFLIP_BLIT);
+ flipFlags = DSFLIP_BLIT;
}
}
@@ -748,10 +744,16 @@ QPixmapData *QDirectFBScreenPrivate::createPixmapData(QPixmapData::PixelType typ
if (type == QPixmapData::BitmapType)
return QWSGraphicsSystem::createPixmapData(type);
- return new QDirectFBPixmapData(type);
+ return new QDirectFBPixmapData(q, type);
}
-#ifndef QT_NO_DEBUG
+#if (Q_DIRECTFB_VERSION >= 0x000923)
+#ifdef QT_NO_DEBUG
+struct FlagDescription;
+static const FlagDescription *accelerationDescriptions = 0;
+static const FlagDescription *blitDescriptions = 0;
+static const FlagDescription *drawDescriptions = 0;
+#else
struct FlagDescription {
const char *name;
uint flag;
@@ -803,9 +805,6 @@ static const FlagDescription drawDescriptions[] = {
};
#endif
-
-
-#if (Q_DIRECTFB_VERSION >= 0x000923)
static const QByteArray flagDescriptions(uint mask, const FlagDescription *flags)
{
#ifdef QT_NO_DEBUG
@@ -917,9 +916,6 @@ bool QDirectFBScreen::connect(const QString &displaySpec)
QDirectFBPaintEngine::initImageCache(imageCacheSize);
#endif
- if (displayArgs.contains(QLatin1String("ignoresystemclip"), Qt::CaseInsensitive))
- d_ptr->directFBFlags |= IgnoreSystemClip;
-
#ifndef QT_NO_DIRECTFB_WM
if (displayArgs.contains(QLatin1String("fullscreen")))
#endif
@@ -928,13 +924,13 @@ bool QDirectFBScreen::connect(const QString &displaySpec)
DFBSurfaceDescription description;
memset(&description, 0, sizeof(DFBSurfaceDescription));
- description.flags = DFBSurfaceDescriptionFlags(DSDESC_CAPS);
+ description.flags = DSDESC_CAPS;
if (::setIntOption(displayArgs, QLatin1String("width"), &description.width))
- description.flags = DFBSurfaceDescriptionFlags(description.flags | DSDESC_WIDTH);
+ description.flags |= DSDESC_WIDTH;
if (::setIntOption(displayArgs, QLatin1String("height"), &description.height))
- description.flags = DFBSurfaceDescriptionFlags(description.flags | DSDESC_HEIGHT);
+ description.flags |= DSDESC_HEIGHT;
- uint caps = DSCAPS_PRIMARY|DSCAPS_DOUBLE;
+ description.caps = DSCAPS_PRIMARY|DSCAPS_DOUBLE;
struct {
const char *name;
const DFBSurfaceCapabilities cap;
@@ -948,14 +944,13 @@ bool QDirectFBScreen::connect(const QString &displaySpec)
};
for (int i=0; capabilities[i].name; ++i) {
if (displayArgs.contains(QString::fromLatin1(capabilities[i].name), Qt::CaseInsensitive))
- caps |= capabilities[i].cap;
+ description.caps |= capabilities[i].cap;
}
if (displayArgs.contains(QLatin1String("forcepremultiplied"), Qt::CaseInsensitive)) {
- caps |= DSCAPS_PREMULTIPLIED;
+ description.caps |= DSCAPS_PREMULTIPLIED;
}
- description.caps = DFBSurfaceCapabilities(caps);
// We don't track the primary surface as it's released in disconnect
d_ptr->dfbSurface = createDFBSurface(description, DontTrackSurface);
if (!d_ptr->dfbSurface) {
@@ -1050,6 +1045,14 @@ bool QDirectFBScreen::connect(const QString &displaySpec)
printDirectFBInfo(d_ptr->dfb, d_ptr->dfbSurface);
#endif
+ QRegExp backgroundColorRegExp("bgcolor=?(.+)");
+ backgroundColorRegExp.setCaseSensitivity(Qt::CaseInsensitive);
+ if (displayArgs.indexOf(backgroundColorRegExp) != -1) {
+ d_ptr->backgroundColor.setNamedColor(backgroundColorRegExp.cap(1));
+ }
+ if (!d_ptr->backgroundColor.isValid())
+ d_ptr->backgroundColor = Qt::green;
+
return true;
}
@@ -1090,7 +1093,7 @@ bool QDirectFBScreen::initDevice()
#endif
#ifndef QT_NO_QWS_CURSOR
-#ifdef QT_NO_DIRECTFB_LAYER
+#if defined QT_NO_DIRECTFB_WM || defined QT_NO_DIRECTFB_LAYER
QScreenCursor::initSoftwareCursor();
#else
qt_screencursor = new QDirectFBScreenCursor;
@@ -1148,203 +1151,134 @@ QWSWindowSurface *QDirectFBScreen::createSurface(const QString &key) const
return QScreen::createSurface(key);
}
-void QDirectFBScreen::compose(const QRegion &region)
-{
- const QList<QWSWindow*> windows = QWSServer::instance()->clientWindows();
-
- QRegion blitRegion = region;
- QRegion blendRegion;
-
- d_ptr->dfbSurface->SetBlittingFlags(d_ptr->dfbSurface, DSBLIT_NOFX);
-
- // blit opaque region
- for (int i = 0; i < windows.size(); ++i) {
- QWSWindow *win = windows.at(i);
- QWSWindowSurface *surface = win->windowSurface();
- if (!surface)
- continue;
-
- const QRegion r = win->allocatedRegion() & blitRegion;
- if (r.isEmpty())
- continue;
-
- blitRegion -= r;
-
- if (surface->isRegionReserved()) {
- // nothing
- } else if (win->isOpaque()) {
- const QPoint offset = win->requestedRegion().boundingRect().topLeft();
-
- if (surface->key() == QLatin1String("directfb")) {
- QDirectFBWindowSurface *s = static_cast<QDirectFBWindowSurface*>(surface);
- blit(s->directFBSurface(), offset, r);
- } else {
- blit(surface->image(), offset, r);
- }
- } else {
- blendRegion += r;
- }
- if (blitRegion.isEmpty())
- break;
- }
-
- { // fill background
- const QRegion fill = blitRegion + blendRegion;
- if (!fill.isEmpty()) {
- const QColor color = QWSServer::instance()->backgroundBrush().color();
- solidFill(color, fill);
- blitRegion = QRegion();
- }
- }
-
- if (blendRegion.isEmpty())
- return;
-
- // blend non-opaque region
- for (int i = windows.size() - 1; i >= 0; --i) {
- QWSWindow *win = windows.at(i);
- QWSWindowSurface *surface = win->windowSurface();
- if (!surface)
- continue;
-
- const QRegion r = win->allocatedRegion() & blendRegion;
- if (r.isEmpty())
- continue;
-
- DFBSurfaceBlittingFlags flags = DSBLIT_NOFX;
- if (!win->isOpaque()) {
- flags = DFBSurfaceBlittingFlags(flags | DSBLIT_BLEND_ALPHACHANNEL);
- const uint opacity = win->opacity();
- if (opacity < 255) {
- flags = DFBSurfaceBlittingFlags(flags | DSBLIT_BLEND_COLORALPHA);
- d_ptr->dfbSurface->SetColor(d_ptr->dfbSurface, 0xff, 0xff, 0xff, opacity);
- }
- }
- d_ptr->dfbSurface->SetBlittingFlags(d_ptr->dfbSurface, flags);
-
- const QPoint offset = win->requestedRegion().boundingRect().topLeft();
-
- if (surface->key() == QLatin1String("directfb")) {
- QDirectFBWindowSurface *s = static_cast<QDirectFBWindowSurface*>(surface);
- blit(s->directFBSurface(), offset, r);
- } else {
- blit(surface->image(), offset, r);
- }
- }
-#if (Q_DIRECTFB_VERSION >= 0x010000)
- d_ptr->dfbSurface->ReleaseSource(d_ptr->dfbSurface);
-#endif
-}
-
// Normally, when using DirectFB to compose the windows (I.e. when
// QT_NO_DIRECTFB_WM isn't set), exposeRegion will simply return. If
// QT_NO_DIRECTFB_WM is set, exposeRegion will compose only non-directFB
// window surfaces. Normal, directFB surfaces are handled by DirectFB.
+static inline bool needExposeRegion()
+{
+#ifdef QT_NO_DIRECTFB_WM
+ return true;
+#endif
+#ifdef QT_NO_DIRECTFB_LAYER
+#ifndef QT_NO_QWS_CURSOR
+ return true;
+#endif
+#endif
+ return false;
+}
+
void QDirectFBScreen::exposeRegion(QRegion r, int changing)
{
+ if (!needExposeRegion()) {
+ return;
+ }
+
const QList<QWSWindow*> windows = QWSServer::instance()->clientWindows();
if (changing < 0 || changing >= windows.size())
return;
-#ifndef QT_NO_DIRECTFB_WM
+
QWSWindow *win = windows.at(changing);
QWSWindowSurface *s = win->windowSurface();
- if (s && s->key() == QLatin1String("directfb"))
- return;
-#endif
-
r &= region();
if (r.isEmpty())
return;
- if (d_ptr->flipFlags & DSFLIP_BLIT) {
- const QRect brect = r.boundingRect();
- DFBRegion dfbRegion = { brect.left(), brect.top(),
- brect.right(), brect.bottom() };
- compose(r);
- d_ptr->dfbSurface->Flip(d_ptr->dfbSurface, &dfbRegion,
- d_ptr->flipFlags);
+ const QRect brect = r.boundingRect();
+
+ if (!s) {
+ solidFill(d_ptr->backgroundColor, r);
} else {
- compose(r + d_ptr->prevExpose);
- d_ptr->dfbSurface->Flip(d_ptr->dfbSurface, 0, d_ptr->flipFlags);
+ const QRect windowGeometry = s->geometry();
+ const QRegion outsideWindow = r.subtracted(windowGeometry);
+ if (!outsideWindow.isEmpty()) {
+ solidFill(d_ptr->backgroundColor, outsideWindow);
+ }
+ const QRegion insideWindow = r.intersected(windowGeometry);
+ if (!insideWindow.isEmpty()) {
+ QDirectFBWindowSurface *dfbWindowSurface = (s->key() == QLatin1String("directfb"))
+ ? static_cast<QDirectFBWindowSurface*>(s) : 0;
+ if (dfbWindowSurface) {
+ IDirectFBSurface *surface = dfbWindowSurface->directFBSurface();
+ 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->dfbSurface->Blit(d_ptr->dfbSurface, surface, &rect,
+ windowGeometry.x() + source.x(),
+ windowGeometry.y() + source.y());
+ } else {
+ const QVector<QRect> rects = insideWindow.rects();
+ QVarLengthArray<DFBRectangle, 16> dfbRectangles(n);
+ QVarLengthArray<DFBPoint, 16> dfbPoints(n);
+
+ for (int i=0; i<n; ++i) {
+ const QRect source = (rects.at(i).intersected(windowGeometry)).translated(-windowGeometry.topLeft());
+ DFBRectangle &rect = dfbRectangles[i];
+ rect.x = source.x();
+ rect.y = source.y();
+ rect.w = source.width();
+ rect.h = source.height();
+ dfbPoints[i].x = (windowGeometry.x() + source.x());
+ dfbPoints[i].y = (windowGeometry.y() + source.y());
+ }
+ d_ptr->dfbSurface->BatchBlit(d_ptr->dfbSurface, surface, dfbRectangles.constData(),
+ dfbPoints.constData(), n);
+ }
+ }
+ }
}
- d_ptr->prevExpose = r;
-}
-
-void QDirectFBScreen::blit(const QImage &img, const QPoint &topLeft,
- const QRegion &reg)
-{
- IDirectFBSurface *src = createDFBSurface(img, QDirectFBScreen::DontTrackSurface);
- if (!src) {
- qWarning("QDirectFBScreen::blit(): Error creating surface");
- return;
- }
- blit(src, topLeft, reg);
+ if (QScreenCursor *cursor = QScreenCursor::instance()) {
+ const QRect cursorRectangle = cursor->boundingRect();
+ if (cursor->isVisible() && !cursor->isAccelerated() && cursorRectangle.intersects(brect)) {
+ const QImage image = cursor->image();
+ IDirectFBSurface *surface = createDFBSurface(image, QDirectFBScreen::DontTrackSurface);
+ d_ptr->dfbSurface->SetBlittingFlags(d_ptr->dfbSurface, DSBLIT_BLEND_ALPHACHANNEL);
+ d_ptr->dfbSurface->Blit(d_ptr->dfbSurface, surface, 0, cursorRectangle.x(), cursorRectangle.y());
+ surface->Release(surface);
#if (Q_DIRECTFB_VERSION >= 0x010000)
- d_ptr->dfbSurface->ReleaseSource(d_ptr->dfbSurface);
+ d_ptr->dfbSurface->ReleaseSource(d_ptr->dfbSurface);
#endif
- src->Release(src);
-}
-
-void QDirectFBScreen::blit(IDirectFBSurface *src, const QPoint &topLeft,
- const QRegion &region)
-{
- const QVector<QRect> rs = region.translated(-offset()).rects();
- const int size = rs.size();
- const QPoint tl = topLeft - offset();
-
- QVarLengthArray<DFBRectangle> rects(size);
- QVarLengthArray<DFBPoint> points(size);
-
- int n = 0;
- for (int i = 0; i < size; ++i) {
- const QRect r = rs.at(i);
- if (!r.isValid())
- continue;
- rects[n].x = r.x() - tl.x();
- rects[n].y = r.y() - tl.y();
- rects[n].w = r.width();
- rects[n].h = r.height();
- points[n].x = r.x();
- points[n].y = r.y();
- ++n;
+ }
}
-
- d_ptr->dfbSurface->BatchBlit(d_ptr->dfbSurface, src, rects.data(),
- points.data(), n);
+ flipSurface(d_ptr->dfbSurface, d_ptr->flipFlags, r, QPoint());
}
-// This function is only ever called by QScreen::drawBackground which
-// is only ever called by QScreen::compose which is never called with
-// DirectFB so it's really a noop.
void QDirectFBScreen::solidFill(const QColor &color, const QRegion &region)
{
if (region.isEmpty())
return;
- if (QDirectFBScreen::getImageFormat(d_ptr->dfbSurface) == QImage::Format_RGB32) {
- data = QDirectFBScreen::lockSurface(d_ptr->dfbSurface, DSLF_WRITE, &lstep);
- if (!data)
- return;
-
- QScreen::solidFill(color, region);
- d_ptr->dfbSurface->Unlock(d_ptr->dfbSurface);
- data = 0;
- lstep = 0;
+ d_ptr->dfbSurface->SetColor(d_ptr->dfbSurface,
+ color.red(), color.green(), color.blue(),
+ color.alpha());
+ const int n = region.numRects();
+ if (n > 1) {
+ const QRect r = region.boundingRect();
+ d_ptr->dfbSurface->FillRectangle(d_ptr->dfbSurface, r.x(), r.y(), r.width(), r.height());
} else {
- d_ptr->dfbSurface->SetColor(d_ptr->dfbSurface,
- color.red(), color.green(), color.blue(),
- color.alpha());
const QVector<QRect> rects = region.rects();
- for (int i=0; i<rects.size(); ++i) {
+ QVarLengthArray<DFBRectangle, 32> rectArray(n);
+ for (int i=0; i<n; ++i) {
const QRect &r = rects.at(i);
- d_ptr->dfbSurface->FillRectangle(d_ptr->dfbSurface,
- r.x(), r.y(), r.width(), r.height());
+ rectArray[i].x = r.x();
+ rectArray[i].y = r.y();
+ rectArray[i].w = r.width();
+ rectArray[i].h = r.height();
}
+ d_ptr->dfbSurface->FillRectangles(d_ptr->dfbSurface, rectArray.constData(), n);
}
}
+void QDirectFBScreen::erase(const QRegion &region)
+{
+ solidFill(d_ptr->backgroundColor, region);
+}
+
QImage::Format QDirectFBScreen::alphaPixmapFormat() const
{
return d_ptr->alphaPixmapFormat;
@@ -1356,14 +1290,14 @@ bool QDirectFBScreen::initSurfaceDescriptionPixelFormat(DFBSurfaceDescription *d
const DFBSurfacePixelFormat pixelformat = QDirectFBScreen::getSurfacePixelFormat(format);
if (pixelformat == DSPF_UNKNOWN)
return false;
- description->flags = DFBSurfaceDescriptionFlags(description->flags | DSDESC_PIXELFORMAT);
+ description->flags |= DSDESC_PIXELFORMAT;
description->pixelformat = pixelformat;
if (QDirectFBScreen::isPremultiplied(format)) {
if (!(description->flags & DSDESC_CAPS)) {
description->caps = DSCAPS_PREMULTIPLIED;
- description->flags = DFBSurfaceDescriptionFlags(description->flags | DSDESC_CAPS);
+ description->flags |= DSDESC_CAPS;
} else {
- description->caps = DFBSurfaceCapabilities(description->caps | DSCAPS_PREMULTIPLIED);
+ description->caps |= DSCAPS_PREMULTIPLIED;
}
}
return true;
@@ -1380,3 +1314,31 @@ uchar *QDirectFBScreen::lockSurface(IDirectFBSurface *surface, uint flags, int *
return reinterpret_cast<uchar*>(mem);
}
+
+void QDirectFBScreen::flipSurface(IDirectFBSurface *surface, DFBSurfaceFlipFlags flipFlags,
+ const QRegion &region, const QPoint &offset)
+{
+ if (!(flipFlags & DSFLIP_BLIT)) {
+ surface->Flip(surface, 0, flipFlags);
+ } else {
+ if (!(d_ptr->directFBFlags & BoundingRectFlip) && region.numRects() > 1) {
+ const QVector<QRect> rects = region.rects();
+ const DFBSurfaceFlipFlags nonWaitFlags = flipFlags & ~DSFLIP_WAIT;
+ for (int i=0; i<rects.size(); ++i) {
+ const QRect &r = rects.at(i);
+ const DFBRegion dfbReg = { r.x() + offset.x(), r.y() + offset.y(),
+ r.right() + offset.x(),
+ r.bottom() + offset.y() };
+ surface->Flip(surface, &dfbReg, i + 1 < rects.size() ? nonWaitFlags : flipFlags);
+ }
+ } else {
+ const QRect r = region.boundingRect();
+ const DFBRegion dfbReg = { r.x() + offset.x(), r.y() + offset.y(),
+ r.right() + offset.x(),
+ r.bottom() + offset.y() };
+ surface->Flip(surface, &dfbReg, flipFlags);
+ }
+ }
+}
+
+
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h
index 4239156..8884a06 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h
@@ -44,6 +44,7 @@
#include <QtGui/qscreen_qws.h>
#include <directfb.h>
+#include <directfb_version.h>
QT_BEGIN_HEADER
@@ -51,8 +52,23 @@ QT_MODULE(Gui)
#define Q_DIRECTFB_VERSION ((DIRECTFB_MAJOR_VERSION << 16) | (DIRECTFB_MINOR_VERION << 8) | DIRECTFB_MICRO_VERSION)
-class QDirectFBScreenPrivate;
+#define DIRECTFB_DECLARE_OPERATORS_FOR_FLAGS(F) \
+ static inline F operator~(F f) { return F(~int(f)); } \
+ static inline F operator&(F left, F right) { return F(int(left) & int(right)); } \
+ static inline F operator|(F left, F right) { return F(int(left) | int(right)); } \
+ static inline F &operator|=(F &left, F right) { left = (left | right); return left; } \
+ static inline F &operator&=(F &left, F right) { left = (left & right); return left; }
+
+DIRECTFB_DECLARE_OPERATORS_FOR_FLAGS(DFBInputDeviceCapabilities);
+DIRECTFB_DECLARE_OPERATORS_FOR_FLAGS(DFBWindowDescriptionFlags);
+DIRECTFB_DECLARE_OPERATORS_FOR_FLAGS(DFBSurfaceDescriptionFlags);
+DIRECTFB_DECLARE_OPERATORS_FOR_FLAGS(DFBSurfaceCapabilities);
+DIRECTFB_DECLARE_OPERATORS_FOR_FLAGS(DFBSurfaceLockFlags);
+DIRECTFB_DECLARE_OPERATORS_FOR_FLAGS(DFBSurfaceBlittingFlags);
+DIRECTFB_DECLARE_OPERATORS_FOR_FLAGS(DFBSurfaceDrawingFlags);
+DIRECTFB_DECLARE_OPERATORS_FOR_FLAGS(DFBSurfaceFlipFlags);
+class QDirectFBScreenPrivate;
class Q_GUI_EXPORT QDirectFBScreen : public QScreen
{
public:
@@ -63,8 +79,7 @@ public:
NoFlags = 0x00,
VideoOnly = 0x01,
SystemOnly = 0x02,
- IgnoreSystemClip = 0x04,
- BoundingRectFlip = 0x08
+ BoundingRectFlip = 0x04
};
Q_DECLARE_FLAGS(DirectFBFlags, DirectFBFlag);
@@ -77,7 +92,6 @@ public:
void shutdownDevice();
void exposeRegion(QRegion r, int changing);
- void blit(const QImage &img, const QPoint &topLeft, const QRegion &region);
void scroll(const QRegion &region, const QPoint &offset);
void solidFill(const QColor &color, const QRegion &region);
@@ -114,9 +128,12 @@ public:
QImage::Format format,
SurfaceCreationOptions options);
IDirectFBSurface *copyToDFBSurface(const QImage &image,
- QImage::Format format,
- SurfaceCreationOptions options);
+ QImage::Format format,
+ SurfaceCreationOptions options);
+ void flipSurface(IDirectFBSurface *surface, DFBSurfaceFlipFlags flipFlags,
+ const QRegion &region, const QPoint &offset);
void releaseDFBSurface(IDirectFBSurface *surface);
+ void erase(const QRegion &region);
using QScreen::depth;
static int depth(DFBSurfacePixelFormat format);
@@ -138,14 +155,9 @@ public:
#endif
static uchar *lockSurface(IDirectFBSurface *surface, uint flags, int *bpl = 0);
-
private:
IDirectFBSurface *createDFBSurface(DFBSurfaceDescription desc,
SurfaceCreationOptions options);
- void compose(const QRegion &r);
- void blit(IDirectFBSurface *src, const QPoint &topLeft,
- const QRegion &region);
-
QDirectFBScreenPrivate *d_ptr;
friend class SurfaceCache;
};
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
index 86ee62c..34168bc 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
@@ -44,10 +44,10 @@
#include "qdirectfbpaintengine.h"
#include <qwidget.h>
+#include <qwindowsystem_qws.h>
#include <qpaintdevice.h>
#include <qvarlengtharray.h>
-
//#define QT_DIRECTFB_DEBUG_SURFACES 1
QDirectFBWindowSurface::QDirectFBWindowSurface(DFBSurfaceFlipFlags flip, QDirectFBScreen *scr)
@@ -55,10 +55,15 @@ QDirectFBWindowSurface::QDirectFBWindowSurface(DFBSurfaceFlipFlags flip, QDirect
#ifndef QT_NO_DIRECTFB_WM
, dfbWindow(0)
#endif
- , engine(0)
+ , engineHeight(-1)
, flipFlags(flip)
, boundingRectFlip(scr->directFBFlags() & QDirectFBScreen::BoundingRectFlip)
{
+#ifdef QT_NO_DIRECTFB_WM
+ mode = Offscreen;
+#else
+ mode = Window;
+#endif
setSurfaceFlags(Opaque | Buffered);
#ifdef QT_DIRECTFB_TIMING
frames = 0;
@@ -71,15 +76,21 @@ QDirectFBWindowSurface::QDirectFBWindowSurface(DFBSurfaceFlipFlags flip, QDirect
#ifndef QT_NO_DIRECTFB_WM
, dfbWindow(0)
#endif
- , engine(0)
+ , engineHeight(-1)
, flipFlags(flip)
, boundingRectFlip(scr->directFBFlags() & QDirectFBScreen::BoundingRectFlip)
{
- onscreen = widget->testAttribute(Qt::WA_PaintOnScreen);
- if (onscreen)
+ if (widget && widget->testAttribute(Qt::WA_PaintOnScreen)) {
setSurfaceFlags(Opaque | RegionReserved);
- else
+ mode = Primary;
+ } else {
+#ifdef QT_NO_DIRECTFB_WM
+ mode = Offscreen;
+#else
+ mode = Window;
+#endif
setSurfaceFlags(Opaque | Buffered);
+ }
#ifdef QT_DIRECTFB_TIMING
frames = 0;
timer.start();
@@ -99,25 +110,23 @@ bool QDirectFBWindowSurface::isValid() const
void QDirectFBWindowSurface::createWindow()
{
#ifdef QT_NO_DIRECTFB_LAYER
-#warning QT_NO_DIRECTFB_LAYER requires QT_NO_DIRECTFB_WM
+#error QT_NO_DIRECTFB_LAYER requires QT_NO_DIRECTFB_WM
#else
IDirectFBDisplayLayer *layer = screen->dfbDisplayLayer();
if (!layer)
qFatal("QDirectFBWindowSurface: Unable to get primary display layer!");
DFBWindowDescription description;
- description.caps = DFBWindowCapabilities(DWCAPS_NODECORATION);
- description.flags = DFBWindowDescriptionFlags(DWDESC_CAPS
- |DWDESC_SURFACE_CAPS
- |DWDESC_PIXELFORMAT);
+ description.caps = DWCAPS_NODECORATION;
+ description.flags = DWDESC_CAPS|DWDESC_SURFACE_CAPS|DWDESC_PIXELFORMAT;
description.surface_caps = DSCAPS_NONE;
if (screen->directFBFlags() & QDirectFBScreen::VideoOnly)
- description.surface_caps = DFBSurfaceCapabilities(description.surface_caps|DSCAPS_VIDEOONLY);
+ description.surface_caps |= DSCAPS_VIDEOONLY;
const QImage::Format format = screen->pixelFormat();
description.pixelformat = QDirectFBScreen::getSurfacePixelFormat(format);
if (QDirectFBScreen::isPremultiplied(format))
- description.surface_caps = DFBSurfaceCapabilities(DSCAPS_PREMULTIPLIED|description.caps);
+ description.surface_caps = DSCAPS_PREMULTIPLIED;
DFBResult result = layer->CreateWindow(layer, &description, &dfbWindow);
if (result != DFB_OK)
@@ -131,8 +140,40 @@ void QDirectFBWindowSurface::createWindow()
}
#endif // QT_NO_DIRECTFB_WM
-void QDirectFBWindowSurface::setGeometry(const QRect &rect, const QRegion &mask)
+#ifndef QT_NO_DIRECTFB_WM
+static DFBResult setGeometry(IDirectFBWindow *dfbWindow, const QRect &old, const QRect &rect)
+{
+ DFBResult result = DFB_OK;
+ const bool isMove = old.isEmpty() || rect.topLeft() != old.topLeft();
+ const bool isResize = rect.size() != old.size();
+
+#if (Q_DIRECTFB_VERSION >= 0x010000)
+ if (isResize && isMove) {
+ result = dfbWindow->SetBounds(dfbWindow, rect.x(), rect.y(),
+ rect.width(), rect.height());
+ } else if (isResize) {
+ result = dfbWindow->Resize(dfbWindow,
+ rect.width(), rect.height());
+ } else if (isMove) {
+ result = dfbWindow->MoveTo(dfbWindow, rect.x(), rect.y());
+ }
+#else
+ if (isResize) {
+ result = dfbWindow->Resize(dfbWindow,
+ rect.width(), rect.height());
+ }
+ if (isMove) {
+ result = dfbWindow->MoveTo(dfbWindow, rect.x(), rect.y());
+ }
+#endif
+ return result;
+}
+#endif
+
+void QDirectFBWindowSurface::setGeometry(const QRect &rect)
{
+ IDirectFBSurface *primarySurface = screen->dfbSurface();
+ Q_ASSERT(primarySurface);
if (rect.isNull()) {
#ifndef QT_NO_DIRECTFB_WM
if (dfbWindow) {
@@ -140,22 +181,21 @@ void QDirectFBWindowSurface::setGeometry(const QRect &rect, const QRegion &mask)
dfbWindow = 0;
}
#endif
- if (dfbSurface && dfbSurface != screen->dfbSurface()) {
- dfbSurface->Release(dfbSurface);
+ if (dfbSurface) {
+ if (dfbSurface != primarySurface) {
+ dfbSurface->Release(dfbSurface);
+ }
dfbSurface = 0;
}
} else if (rect != geometry()) {
+ const QRect oldRect = geometry();
DFBResult result = DFB_OK;
-
// If we're in a resize, the surface shouldn't be locked
Q_ASSERT((lockedImage == 0) || (rect.size() == geometry().size()));
-
- if (onscreen) {
- IDirectFBSurface *primarySurface = screen->dfbSurface();
- Q_ASSERT(primarySurface);
+ switch (mode) {
+ case Primary:
if (dfbSurface && dfbSurface != primarySurface)
dfbSurface->Release(dfbSurface);
-
if (rect == screen->region().boundingRect()) {
dfbSurface = primarySurface;
} else {
@@ -163,58 +203,34 @@ void QDirectFBWindowSurface::setGeometry(const QRect &rect, const QRegion &mask)
rect.width(), rect.height() };
result = primarySurface->GetSubSurface(primarySurface, &r, &dfbSurface);
}
- } else {
- const bool isResize = rect.size() != geometry().size();
-#ifdef QT_NO_DIRECTFB_WM
- if (isResize) {
+ break;
+ case Window:
+#ifndef QT_NO_DIRECTFB_WM
+ if (!dfbWindow)
+ createWindow();
+ ::setGeometry(dfbWindow, oldRect, rect);
+#endif
+ break;
+ case Offscreen: {
+ if (!dfbSurface || oldRect.size() != rect.size()) {
if (dfbSurface)
dfbSurface->Release(dfbSurface);
-
- IDirectFB *dfb = screen->dfb();
- if (!dfb) {
- qFatal("QDirectFBWindowSurface::setGeometry(): "
- "Unable to get DirectFB handle!");
- }
-
dfbSurface = screen->createDFBSurface(rect.size(), screen->pixelFormat(), QDirectFBScreen::DontTrackSurface);
- } else {
- Q_ASSERT(dfbSurface);
- }
-#else
- const QRect oldRect = geometry();
- const bool isMove = oldRect.isEmpty() ||
- rect.topLeft() != oldRect.topLeft();
-
- if (!dfbWindow)
- createWindow();
-
-#if (Q_DIRECTFB_VERSION >= 0x010000)
- if (isResize && isMove) {
- result = dfbWindow->SetBounds(dfbWindow, rect.x(), rect.y(),
- rect.width(), rect.height());
- } else if (isResize) {
- result = dfbWindow->Resize(dfbWindow,
- rect.width(), rect.height());
- } else if (isMove) {
- result = dfbWindow->MoveTo(dfbWindow, rect.x(), rect.y());
}
-#else
- if (isResize) {
- result = dfbWindow->Resize(dfbWindow,
- rect.width(), rect.height());
- }
- if (isMove) {
- result = dfbWindow->MoveTo(dfbWindow, rect.x(), rect.y());
- }
-#endif
-#endif
+ const QRegion region = QRegion(oldRect.isEmpty() ? screen->region() : QRegion(oldRect)).subtracted(rect);
+ screen->erase(region);
+ screen->flipSurface(primarySurface, flipFlags, region, QPoint());
+ break; }
}
if (result != DFB_OK)
DirectFBErrorFatal("QDirectFBWindowSurface::setGeometry()", result);
}
-
- QWSWindowSurface::setGeometry(rect, mask);
+ if (engine) {
+ delete engine;
+ engine = 0;
+ }
+ QWSWindowSurface::setGeometry(rect);
}
QByteArray QDirectFBWindowSurface::permanentState() const
@@ -256,7 +272,6 @@ static inline void scrollSurface(IDirectFBSurface *surface, const QRect &r, int
surface->Blit(surface, surface, &rect, r.x() + dx, r.y() + dy);
}
-
bool QDirectFBWindowSurface::scroll(const QRegion &region, int dx, int dy)
{
if (!dfbSurface || !(flipFlags & DSFLIP_BLIT) || region.isEmpty())
@@ -274,42 +289,10 @@ bool QDirectFBWindowSurface::scroll(const QRegion &region, int dx, int dy)
return true;
}
-bool QDirectFBWindowSurface::move(const QPoint &offset)
-{
- QWSWindowSurface::move(offset);
-
-#ifdef QT_NO_DIRECTFB_WM
- return true; // buffered
-#else
- if (!dfbWindow)
- return false;
-
- DFBResult status = dfbWindow->Move(dfbWindow, offset.x(), offset.y());
- return (status == DFB_OK);
-#endif
-}
-
-QRegion QDirectFBWindowSurface::move(const QPoint &offset, const QRegion &newClip)
-{
-#ifdef QT_NO_DIRECTFB_WM
- return QWSWindowSurface::move(offset, newClip);
-#else
- Q_UNUSED(offset);
- Q_UNUSED(newClip);
-
- // DirectFB handles the entire move, so there's no need to blit.
- return QRegion();
-#endif
-}
-
-QPaintEngine* QDirectFBWindowSurface::paintEngine() const
+bool QDirectFBWindowSurface::move(const QPoint &moveBy)
{
- if (!engine) {
- QDirectFBWindowSurface *that = const_cast<QDirectFBWindowSurface*>(this);
- that->engine = new QDirectFBPaintEngine(that);
- return that->engine;
- }
- return engine;
+ setGeometry(geometry().translated(moveBy));
+ return true;
}
// hw: XXX: copied from QWidgetPrivate::isOpaque()
@@ -335,57 +318,93 @@ inline bool isWidgetOpaque(const QWidget *w)
return false;
}
-void QDirectFBWindowSurface::flush(QWidget *widget, const QRegion &region,
+
+void QDirectFBWindowSurface::flush(QWidget *, const QRegion &region,
const QPoint &offset)
{
- Q_UNUSED(widget);
-#ifdef QT_NO_DIRECTFB_WM
- Q_UNUSED(region);
- Q_UNUSED(offset);
-#endif
-
- QWidget *win = window();
-
// hw: make sure opacity information is updated before compositing
- const bool opaque = isWidgetOpaque(win);
- if (opaque != isOpaque()) {
- SurfaceFlags flags = Buffered;
- if (opaque)
- flags |= Opaque;
- setSurfaceFlags(flags);
- }
+ if (QWidget *win = window()) {
+
+ const bool opaque = isWidgetOpaque(win);
+ if (opaque != isOpaque()) {
+ SurfaceFlags flags = surfaceFlags();
+ if (opaque) {
+ flags |= Opaque;
+ } else {
+ flags &= ~Opaque;
+ }
+ setSurfaceFlags(flags);
+ }
#ifndef QT_NO_DIRECTFB_WM
- const quint8 winOpacity = quint8(win->windowOpacity() * 255);
- quint8 opacity;
+ const quint8 winOpacity = quint8(win->windowOpacity() * 255);
+ quint8 opacity;
- if (dfbWindow) {
- dfbWindow->GetOpacity(dfbWindow, &opacity);
- if (winOpacity != opacity)
- dfbWindow->SetOpacity(dfbWindow, winOpacity);
- }
+ if (dfbWindow) {
+ dfbWindow->GetOpacity(dfbWindow, &opacity);
+ if (winOpacity != opacity)
+ dfbWindow->SetOpacity(dfbWindow, winOpacity);
+ }
#endif
- if (!(flipFlags & DSFLIP_BLIT)) {
- dfbSurface->Flip(dfbSurface, 0, flipFlags);
- } else {
- if (!boundingRectFlip && region.numRects() > 1) {
+ }
+
+ const QRect windowGeometry = QDirectFBWindowSurface::geometry();
+ IDirectFBSurface *primarySurface = screen->dfbSurface();
+ if (mode == Offscreen) {
+ primarySurface->SetBlittingFlags(primarySurface, DSBLIT_NOFX);
+ const QRect windowRect(0, 0, windowGeometry.width(), windowGeometry.height());
+ const int n = region.numRects();
+ if (n == 1 || boundingRectFlip ) {
+ const QRect regionBoundingRect = region.boundingRect().translated(offset);
+ const QRect source = windowRect & regionBoundingRect;
+ const DFBRectangle rect = {
+ source.x(), source.y(), source.width(), source.height()
+ };
+ primarySurface->Blit(primarySurface, dfbSurface, &rect,
+ windowGeometry.x() + source.x(),
+ windowGeometry.y() + source.y());
+ } else {
const QVector<QRect> rects = region.rects();
- const DFBSurfaceFlipFlags nonWaitFlags = DFBSurfaceFlipFlags(flipFlags & ~DSFLIP_WAIT);
- for (int i=0; i<rects.size(); ++i) {
- const QRect &r = rects.at(i);
- const DFBRegion dfbReg = { r.x() + offset.x(), r.y() + offset.y(),
- r.x() + r.width() + offset.x(),
- r.y() + r.height() + offset.y() };
- dfbSurface->Flip(dfbSurface, &dfbReg, i + 1 < rects.size() ? nonWaitFlags : flipFlags);
+ QVarLengthArray<DFBRectangle, 16> dfbRectangles(n);
+ QVarLengthArray<DFBPoint, 16> dfbPoints(n);
+
+ for (int i=0; i<n; ++i) {
+ const QRect &r = rects.at(i).translated(offset);
+ const QRect source = windowRect & r;
+ DFBRectangle &rect = dfbRectangles[i];
+ rect.x = source.x();
+ rect.y = source.y();
+ rect.w = source.width();
+ rect.h = source.height();
+ dfbPoints[i].x = (windowGeometry.x() + source.x());
+ dfbPoints[i].y = (windowGeometry.y() + source.y());
}
- } else {
- const QRect r = region.boundingRect();
- const DFBRegion dfbReg = { r.x() + offset.x(), r.y() + offset.y(),
- r.x() + r.width() + offset.x(),
- r.y() + r.height() + offset.y() };
- dfbSurface->Flip(dfbSurface, &dfbReg, flipFlags);
+ primarySurface->BatchBlit(primarySurface, dfbSurface, dfbRectangles.constData(),
+ dfbPoints.constData(), n);
+ }
+ }
+
+ if (QScreenCursor *cursor = QScreenCursor::instance()) {
+ const QRect cursorRectangle = cursor->boundingRect();
+ if (cursor->isVisible() && !cursor->isAccelerated()
+ && region.intersects(cursorRectangle.translated(-(offset + windowGeometry.topLeft())))) {
+ const QImage image = cursor->image();
+
+ IDirectFBSurface *surface = screen->createDFBSurface(image, QDirectFBScreen::DontTrackSurface);
+ primarySurface->SetBlittingFlags(primarySurface, DSBLIT_BLEND_ALPHACHANNEL);
+ primarySurface->Blit(primarySurface, surface, 0, cursorRectangle.x(), cursorRectangle.y());
+ surface->Release(surface);
+#if (Q_DIRECTFB_VERSION >= 0x010000)
+ primarySurface->ReleaseSource(primarySurface);
+#endif
}
}
+ if (mode == Offscreen) {
+ screen->flipSurface(primarySurface, flipFlags, region, offset + windowGeometry.topLeft());
+ } else {
+ screen->flipSurface(dfbSurface, flipFlags, region, offset);
+ }
+
#ifdef QT_DIRECTFB_TIMING
enum { Secs = 3 };
++frames;
@@ -400,6 +419,12 @@ void QDirectFBWindowSurface::flush(QWidget *widget, const QRegion &region,
void QDirectFBWindowSurface::beginPaint(const QRegion &)
{
+ const int h = height();
+ if (h > engineHeight) {
+ engineHeight = h;
+ delete engine;
+ engine = new QDirectFBPaintEngine(this);
+ }
}
void QDirectFBWindowSurface::endPaint(const QRegion &)
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h
index 7885b73..fefe9f3 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h
@@ -61,13 +61,13 @@ QT_MODULE(Gui)
class QDirectFBWindowSurface : public QWSWindowSurface, public QDirectFBPaintDevice
{
public:
- QDirectFBWindowSurface(DFBSurfaceFlipFlags flipFlags, QDirectFBScreen* scr);
- QDirectFBWindowSurface(DFBSurfaceFlipFlags flipFlags, QDirectFBScreen* scr, QWidget *widget);
+ QDirectFBWindowSurface(DFBSurfaceFlipFlags flipFlags, QDirectFBScreen *scr);
+ QDirectFBWindowSurface(DFBSurfaceFlipFlags flipFlags, QDirectFBScreen *scr, QWidget *widget);
~QDirectFBWindowSurface();
bool isValid() const;
- void setGeometry(const QRect &rect, const QRegion &mask);
+ void setGeometry(const QRect &rect);
QString key() const { return QLatin1String("directfb"); }
QByteArray permanentState() const;
@@ -76,11 +76,9 @@ public:
bool scroll(const QRegion &area, int dx, int dy);
bool move(const QPoint &offset);
- QRegion move(const QPoint &offset, const QRegion &newClip);
QImage image() const { return QImage(); }
QPaintDevice *paintDevice() { return this; }
- QPaintEngine *paintEngine() const;
void flush(QWidget *widget, const QRegion &region, const QPoint &offset);
@@ -88,15 +86,18 @@ public:
void endPaint(const QRegion &);
QImage *buffer(const QWidget *widget);
-
private:
#ifndef QT_NO_DIRECTFB_WM
void createWindow();
IDirectFBWindow *dfbWindow;
#endif
- QDirectFBPaintEngine *engine;
+ int engineHeight;
- bool onscreen;
+ enum Mode {
+ Primary,
+ Offscreen,
+ Window
+ } mode;
QList<QImage*> bufferImages;
DFBSurfaceFlipFlags flipFlags;
diff --git a/src/plugins/graphicssystems/openvg/openvg.pro b/src/plugins/graphicssystems/openvg/openvg.pro
index 0abbfbd..d36570c 100644
--- a/src/plugins/graphicssystems/openvg/openvg.pro
+++ b/src/plugins/graphicssystems/openvg/openvg.pro
@@ -10,11 +10,3 @@ HEADERS = qgraphicssystem_vg_p.h
target.path += $$[QT_INSTALL_PLUGINS]/graphicssystems
INSTALLS += target
-
-!isEmpty(QMAKE_INCDIR_OPENVG): INCLUDEPATH += $$QMAKE_INCDIR_OPENVG
-!isEmpty(QMAKE_LIBDIR_OPENVG): LIBS += -L$$QMAKE_LIBDIR_OPENVG
-!isEmpty(QMAKE_LIBS_OPENVG): LIBS += $$QMAKE_LIBS_OPENVG
-
-!isEmpty(QMAKE_INCDIR_EGL): INCLUDEPATH += $$QMAKE_INCDIR_EGL
-!isEmpty(QMAKE_LIBDIR_EGL): LIBS += -L$$QMAKE_LIBDIR_EGL
-!isEmpty(QMAKE_LIBS_EGL): LIBS += $$QMAKE_LIBS_EGL
diff --git a/src/plugins/graphicssystems/shivavg/shivavg.pro b/src/plugins/graphicssystems/shivavg/shivavg.pro
index 68345af..b8ea12a 100644
--- a/src/plugins/graphicssystems/shivavg/shivavg.pro
+++ b/src/plugins/graphicssystems/shivavg/shivavg.pro
@@ -10,7 +10,3 @@ HEADERS = shivavggraphicssystem.h shivavgwindowsurface.h
target.path += $$[QT_INSTALL_PLUGINS]/graphicssystems
INSTALLS += target
-
-!isEmpty(QMAKE_INCDIR_OPENVG): INCLUDEPATH += $$QMAKE_INCDIR_OPENVG
-!isEmpty(QMAKE_LIBDIR_OPENVG): LIBS += -L$$QMAKE_LIBDIR_OPENVG
-!isEmpty(QMAKE_LIBS_OPENVG): LIBS += $$QMAKE_LIBS_OPENVG
diff --git a/src/plugins/imageformats/ico/qicohandler.cpp b/src/plugins/imageformats/ico/qicohandler.cpp
index 43e35c0..c9e04a4 100644
--- a/src/plugins/imageformats/ico/qicohandler.cpp
+++ b/src/plugins/imageformats/ico/qicohandler.cpp
@@ -522,6 +522,18 @@ QImage ICOReader::iconAt(int index)
ICONDIRENTRY iconEntry;
if (readIconEntry(index, &iconEntry)) {
+ static const uchar pngMagicData[] = { 137, 80, 78, 71, 13, 10, 26, 10 };
+
+ iod->seek(iconEntry.dwImageOffset);
+
+ const QByteArray pngMagic = QByteArray::fromRawData((char*)pngMagicData, sizeof(pngMagicData));
+ const bool isPngImage = (iod->read(pngMagic.size()) == pngMagic);
+
+ if (isPngImage) {
+ iod->seek(iconEntry.dwImageOffset);
+ return QImage::fromData(iod->read(iconEntry.dwBytesInRes), "png");
+ }
+
BMP_INFOHDR header;
if (readBMPHeader(iconEntry.dwImageOffset, &header)) {
icoAttrib.nbits = header.biBitCount ? header.biBitCount : iconEntry.wBitCount;
diff --git a/src/plugins/imageformats/mng/qmnghandler.h b/src/plugins/imageformats/mng/qmnghandler.h
index aa6efd3..b9e37bf 100644
--- a/src/plugins/imageformats/mng/qmnghandler.h
+++ b/src/plugins/imageformats/mng/qmnghandler.h
@@ -74,7 +74,7 @@ class QMngHandler : public QImageIOHandler
virtual bool supportsOption(ImageOption option) const;
private:
- Q_DECLARE_SCOPED_PRIVATE(QMngHandler)
+ Q_DECLARE_PRIVATE(QMngHandler)
QScopedPointer<QMngHandlerPrivate> d_ptr;
};
diff --git a/src/plugins/kbddrivers/kbddrivers.pro b/src/plugins/kbddrivers/kbddrivers.pro
index a34b780..dbab47b 100644
--- a/src/plugins/kbddrivers/kbddrivers.pro
+++ b/src/plugins/kbddrivers/kbddrivers.pro
@@ -1,5 +1,2 @@
TEMPLATE = subdirs
contains(kbd-plugins, linuxinput): SUBDIRS += linuxinput
-contains(kbd-plugins, sl5000): SUBDIRS += sl5000
-contains(kbd-plugins, vr41xx): SUBDIRS += vr41xx
-contains(kbd-plugins, yopy): SUBDIRS += yopy
diff --git a/src/plugins/kbddrivers/sl5000/main.cpp b/src/plugins/kbddrivers/sl5000/main.cpp
deleted file mode 100644
index 4d61266..0000000
--- a/src/plugins/kbddrivers/sl5000/main.cpp
+++ /dev/null
@@ -1,77 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the plugins 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 either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** 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.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://www.qtsoftware.com/contact.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <qkbddriverplugin_qws.h>
-#include <qkbdsl5000_qws.h>
-
-QT_BEGIN_NAMESPACE
-
-class QSL5000KbdDriver : public QKbdDriverPlugin
-{
-public:
- QSL5000KbdDriver();
-
- QStringList keys() const;
- QWSKeyboardHandler* create(const QString &driver, const QString &device);
-};
-
-QSL5000KbdDriver::QSL5000KbdDriver()
- : QKbdDriverPlugin()
-{
-}
-
-QStringList QSL5000KbdDriver::keys() const
-{
- return (QStringList() << QLatin1String("SL5000"));
-}
-
-QWSKeyboardHandler* QSL5000KbdDriver::create(const QString &driver,
- const QString &device)
-{
- Q_UNUSED(device);
- if (driver.compare(QLatin1String("SL5000"), Qt::CaseInsensitive))
- return 0;
- return new QWSSL5000KeyboardHandler(driver);
-}
-
-Q_EXPORT_PLUGIN2(qwssl5000kbddriver, QSL5000KbdDriver)
-
-QT_END_NAMESPACE
diff --git a/src/plugins/kbddrivers/sl5000/sl5000.pro b/src/plugins/kbddrivers/sl5000/sl5000.pro
deleted file mode 100644
index e52cf0d..0000000
--- a/src/plugins/kbddrivers/sl5000/sl5000.pro
+++ /dev/null
@@ -1,16 +0,0 @@
-TARGET = qsl5000kbddriver
-include(../../qpluginbase.pri)
-
-QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/kbddrivers
-target.path = $$[QT_INSTALL_PLUGINS]/kbddrivers
-INSTALLS += target
-
-DEFINES += QT_QWS_KBD_SL5000 QT_QWS_KBD_TTY
-
-HEADERS = $$QT_SOURCE_TREE/src/gui/embedded/qkbdsl5000_qws.h \
- $$QT_SOURCE_TREE/src/gui/embedded/qkbdtty_qws.h
-
-SOURCES = main.cpp \
- $$QT_SOURCE_TREE/src/gui/embedded/qkbdsl5000_qws.cpp \
- $$QT_SOURCE_TREE/src/gui/embedded/qkbdtty_qws.cpp
-
diff --git a/src/plugins/kbddrivers/vr41xx/main.cpp b/src/plugins/kbddrivers/vr41xx/main.cpp
deleted file mode 100644
index 2cba1f7..0000000
--- a/src/plugins/kbddrivers/vr41xx/main.cpp
+++ /dev/null
@@ -1,77 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the plugins 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 either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** 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.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://www.qtsoftware.com/contact.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <qkbddriverplugin_qws.h>
-#include <qkbdvr41xx_qws.h>
-
-QT_BEGIN_NAMESPACE
-
-class QVr41xxKbdDriver : public QKbdDriverPlugin
-{
-public:
- QVr41xxKbdDriver();
-
- QStringList keys() const;
- QWSKeyboardHandler* create(const QString &driver, const QString &device);
-};
-
-QVr41xxKbdDriver::QVr41xxKbdDriver()
- : QKbdDriverPlugin()
-{
-}
-
-QStringList QVr41xxKbdDriver::keys() const
-{
- return (QStringList() << QLatin1String("VR41xx"));
-}
-
-QWSKeyboardHandler* QVr41xxKbdDriver::create(const QString &driver,
- const QString &device)
-{
- Q_UNUSED(device);
- if (driver.compare(QLatin1String("VR41xx"), Qt::CaseInsensitive))
- return 0;
- return new QWSVr41xxKeyboardHandler(driver);
-}
-
-Q_EXPORT_PLUGIN2(qwsvr41xxkbddriver, QVr41xxKbdDriver)
-
-QT_END_NAMESPACE
diff --git a/src/plugins/kbddrivers/vr41xx/vr41xx.pro b/src/plugins/kbddrivers/vr41xx/vr41xx.pro
deleted file mode 100644
index f9f103f..0000000
--- a/src/plugins/kbddrivers/vr41xx/vr41xx.pro
+++ /dev/null
@@ -1,14 +0,0 @@
-TARGET = qvr41xxkbddriver
-include(../../qpluginbase.pri)
-
-QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/kbddrivers
-target.path = $$[QT_INSTALL_PLUGINS]/kbddrivers
-INSTALLS += target
-
-DEFINES += QT_QWS_KBD_VR41XX
-
-HEADERS = $$QT_SOURCE_TREE/src/gui/embedded/qkbdvr41xx_qws.h
-
-SOURCES = main.cpp \
- $$QT_SOURCE_TREE/src/gui/embedded/qkbdvr41xx_qws.cpp
-
diff --git a/src/plugins/kbddrivers/yopy/main.cpp b/src/plugins/kbddrivers/yopy/main.cpp
deleted file mode 100644
index bfddabe..0000000
--- a/src/plugins/kbddrivers/yopy/main.cpp
+++ /dev/null
@@ -1,77 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the plugins 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 either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** 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.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://www.qtsoftware.com/contact.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <qkbddriverplugin_qws.h>
-#include <qkbdyopy_qws.h>
-
-QT_BEGIN_NAMESPACE
-
-class QYopyKbdDriver : public QKbdDriverPlugin
-{
-public:
- QYopyKbdDriver();
-
- QStringList keys() const;
- QWSKeyboardHandler* create(const QString &driver, const QString &device);
-};
-
-QYopyKbdDriver::QYopyKbdDriver()
- : QKbdDriverPlugin()
-{
-}
-
-QStringList QYopyKbdDriver::keys() const
-{
- return (QStringList() << QLatin1String("Yopy"));
-}
-
-QWSKeyboardHandler* QYopyKbdDriver::create(const QString &driver,
- const QString &device)
-{
- Q_UNUSED(device);
- if (driver.compare(QLatin1String("Yopy"), Qt::CaseInsensitive))
- return 0;
- return new QWSYopyKeyboardHandler(driver);
-}
-
-Q_EXPORT_PLUGIN2(qwsyopykbddriver, QYopyKbdDriver)
-
-QT_END_NAMESPACE
diff --git a/src/plugins/kbddrivers/yopy/yopy.pro b/src/plugins/kbddrivers/yopy/yopy.pro
deleted file mode 100644
index 66a663c..0000000
--- a/src/plugins/kbddrivers/yopy/yopy.pro
+++ /dev/null
@@ -1,14 +0,0 @@
-TARGET = qyopykbddriver
-include(../../qpluginbase.pri)
-
-QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/kbddrivers
-target.path = $$[QT_INSTALL_PLUGINS]/kbddrivers
-INSTALLS += target
-
-DEFINES += QT_QWS_KBD_YOPY
-
-HEADERS = $$QT_SOURCE_TREE/src/gui/embedded/qkbdyopy_qws.h
-
-SOURCES = main.cpp \
- $$QT_SOURCE_TREE/src/gui/embedded/qkbdyopy_qws.cpp
-
diff --git a/src/plugins/mousedrivers/bus/bus.pro b/src/plugins/mousedrivers/bus/bus.pro
deleted file mode 100644
index cdb0332..0000000
--- a/src/plugins/mousedrivers/bus/bus.pro
+++ /dev/null
@@ -1,14 +0,0 @@
-TARGET = qbusmousedriver
-include(../../qpluginbase.pri)
-
-QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/mousedrivers
-target.path = $$[QT_INSTALL_PLUGINS]/mousedrivers
-INSTALLS += target
-
-DEFINES += QT_QWS_MOUSE_BUS
-
-HEADERS = $$QT_SOURCE_TREE/src/gui/embedded/qmousebus_qws.h
-
-SOURCES = main.cpp \
- $$QT_SOURCE_TREE/src/gui/embedded/qmousebus_qws.cpp
-
diff --git a/src/plugins/mousedrivers/bus/main.cpp b/src/plugins/mousedrivers/bus/main.cpp
deleted file mode 100644
index f56c890..0000000
--- a/src/plugins/mousedrivers/bus/main.cpp
+++ /dev/null
@@ -1,76 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the plugins 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 either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** 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.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://www.qtsoftware.com/contact.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <qmousedriverplugin_qws.h>
-#include <qmousebus_qws.h>
-
-QT_BEGIN_NAMESPACE
-
-class QBusMouseDriver : public QMouseDriverPlugin
-{
-public:
- QBusMouseDriver();
-
- QStringList keys() const;
- QWSMouseHandler* create(const QString &driver, const QString &device);
-};
-
-QBusMouseDriver::QBusMouseDriver()
- : QMouseDriverPlugin()
-{
-}
-
-QStringList QBusMouseDriver::keys() const
-{
- return (QStringList() << "Bus");
-}
-
-QWSMouseHandler* QBusMouseDriver::create(const QString &driver,
- const QString &device)
-{
- if (driver.compare(QLatin1String("Bus"), Qt::CaseInsensitive))
- return 0;
- return new QWSBusMouseHandler(driver, device);
-}
-
-Q_EXPORT_PLUGIN2(qwsbusmousehandler, QBusMouseDriver)
-
-QT_END_NAMESPACE
diff --git a/src/plugins/mousedrivers/linuxis/linuxis.pro b/src/plugins/mousedrivers/linuxis/linuxis.pro
deleted file mode 100644
index bcc209b..0000000
--- a/src/plugins/mousedrivers/linuxis/linuxis.pro
+++ /dev/null
@@ -1,10 +0,0 @@
-TARGET = linuxismousehandler
-include(../../qpluginbase.pri)
-
-QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/mousedrivers
-target.path = $$[QT_INSTALL_PLUGINS]/mousedrivers
-INSTALLS += target
-
-HEADERS = linuxismousedriverplugin.h linuxismousehandler.h
-SOURCES = linuxismousedriverplugin.cpp linuxismousehandler.cpp
-
diff --git a/src/plugins/mousedrivers/linuxis/linuxismousedriverplugin.cpp b/src/plugins/mousedrivers/linuxis/linuxismousedriverplugin.cpp
deleted file mode 100644
index 4d530d9..0000000
--- a/src/plugins/mousedrivers/linuxis/linuxismousedriverplugin.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the plugins 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 either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** 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.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://www.qtsoftware.com/contact.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "linuxismousedriverplugin.h"
-#include "linuxismousehandler.h"
-
-#include <qdebug.h>
-#if 1
-#define qLog(x) qDebug()
-#else
-#define qLog(x) while (0) qDebug()
-#endif
-LinuxInputSubsystemMouseDriverPlugin::LinuxInputSubsystemMouseDriverPlugin( QObject *parent )
- : QMouseDriverPlugin( parent )
-{
-}
-
-LinuxInputSubsystemMouseDriverPlugin::~LinuxInputSubsystemMouseDriverPlugin()
-{
-}
-
-QWSMouseHandler* LinuxInputSubsystemMouseDriverPlugin::create(const QString& driver, const QString& device)
-{
- if ( driver.toLower() == "linuxis" ) {
- qLog(Input) << "Before call LinuxInputSubsystemMouseHandler()";
- return new LinuxInputSubsystemMouseHandler(device);
- }
- return 0;
-}
-
-QWSMouseHandler* LinuxInputSubsystemMouseDriverPlugin::create(const QString& driver)
-{
- if( driver.toLower() == "linuxis" ) {
- qLog(Input) << "Before call LinuxInputSubsystemMouseHandler()";
- return new LinuxInputSubsystemMouseHandler();
- }
- return 0;
-}
-
-QStringList LinuxInputSubsystemMouseDriverPlugin::keys() const
-{
- return QStringList() << "linuxis";
-}
-
-Q_EXPORT_PLUGIN2(qwslinuxismousehandler, LinuxInputSubsystemMouseDriverPlugin)
diff --git a/src/plugins/mousedrivers/linuxis/linuxismousedriverplugin.h b/src/plugins/mousedrivers/linuxis/linuxismousedriverplugin.h
deleted file mode 100644
index 57759c5..0000000
--- a/src/plugins/mousedrivers/linuxis/linuxismousedriverplugin.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the plugins 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 either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** 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.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://www.qtsoftware.com/contact.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef LINUXISMOUSEDRIVERPLUGIN_H
-#define LINUXISMOUSEDRIVERPLUGIN_H
-
-#include <QtGui/QWSMouseHandlerFactoryInterface>
-
-class LinuxInputSubsystemMouseDriverPlugin : public QMouseDriverPlugin {
- Q_OBJECT
-public:
- LinuxInputSubsystemMouseDriverPlugin( QObject *parent = 0 );
- ~LinuxInputSubsystemMouseDriverPlugin();
-
- QWSMouseHandler* create(const QString& driver);
- QWSMouseHandler* create(const QString& driver, const QString& device);
- QStringList keys()const;
-};
-
-#endif // LINUXISMOUSEDRIVERPLUGIN_H
diff --git a/src/plugins/mousedrivers/linuxis/linuxismousehandler.cpp b/src/plugins/mousedrivers/linuxis/linuxismousehandler.cpp
deleted file mode 100644
index aaa6eae..0000000
--- a/src/plugins/mousedrivers/linuxis/linuxismousehandler.cpp
+++ /dev/null
@@ -1,180 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the plugins 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 either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** 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.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://www.qtsoftware.com/contact.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "linuxismousehandler.h"
-
-#include <QFile>
-#include <QTextStream>
-#include <QScreen>
-#include <QSocketNotifier>
-#include <QDebug>
-
-#include <qdebug.h>
-
-#include <string.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <limits.h>
-
-#include <linux/input.h>
-
-
-#if 1
-#define qLog(x) qDebug()
-#else
-#define qLog(x) while (0) qDebug()
-#endif
-
-
-// sanity check values of the range of possible mouse positions
-#define MOUSE_SAMPLE_MIN 0
-#define MOUSE_SAMPLE_MAX 2000
-
-LinuxInputSubsystemMouseHandler::LinuxInputSubsystemMouseHandler(const QString &device)
- : mouseX(0), mouseY(0), mouseBtn(0), mouseIdx(0)
-{
- qLog(Input) << "Loaded LinuxInputSubsystem touchscreen plugin!";
- setObjectName("LinuxInputSubsystem Mouse Handler");
- mouseFd = ::open(device.toLocal8Bit().constData(), O_RDONLY | O_NDELAY);
- // mouseFd = ::open(device.toLocal8Bit().constData(), O_RDONLY);
- if (mouseFd >= 0) {
- qLog(Input) << "Opened" << device << "as touchscreen input";
- m_notify = new QSocketNotifier(mouseFd, QSocketNotifier::Read, this);
- connect(m_notify, SIGNAL(activated(int)), this, SLOT(readMouseData()));
- } else {
- qWarning("Cannot open %s for touchscreen input (%s)",
- device.toLocal8Bit().constData(), strerror(errno));
- return;
- }
-}
-
-LinuxInputSubsystemMouseHandler::~LinuxInputSubsystemMouseHandler()
-{
- if (mouseFd >= 0)
- ::close(mouseFd);
-}
-
-void LinuxInputSubsystemMouseHandler::suspend()
-{
- m_notify->setEnabled( false );
-}
-
-void LinuxInputSubsystemMouseHandler::resume()
-{
- m_notify->setEnabled( true );
-}
-
-void LinuxInputSubsystemMouseHandler::readMouseData()
-{
- if (!qt_screen)
- return;
-
- int n;
-
- do {
- n = read(mouseFd, mouseBuf + mouseIdx, mouseBufSize - mouseIdx);
- if (n > 0)
- mouseIdx += n;
-
- struct input_event *data;
- int idx = 0;
-
- while (mouseIdx-idx >= (int)sizeof(struct input_event)) {
- uchar *mb = mouseBuf + idx;
- data = (struct input_event *) mb;
- // qLog(Input) << "mouse event type =" << data->type << "code =" << data->code << "value =" << data->value;
- bool unknown = false;
- if (data->type == EV_ABS) {
- if (data->code == ABS_X) {
- //qLog(Input) << "\tABS_X" << data->value;
- mouseX = data->value;
- } else if (data->code == ABS_Y) {
- //qLog(Input) << "\tABS_Y" << data->value;
- mouseY = data->value;
- } else {
- unknown = true;
- }
- } else if (data->type == EV_REL) {
- //qLog(Input) << "\tEV_REL" << hex << data->code << dec << data->value;
- if (data->code == REL_X) {
- mouseX += data->value;
- } else if (data->code == REL_Y) {
- mouseY += data->value;
- } else {
- unknown = true;
- }
- } else if (data->type == EV_KEY && data->code == BTN_TOUCH) {
- qLog(Input) << "\tBTN_TOUCH" << data->value;
- mouseBtn = data->value ? Qt::LeftButton : 0;
- } else if (data->type == EV_KEY) {
- int button = 0;
- switch (data->code) {
- case BTN_LEFT: button = Qt::LeftButton; break;
- case BTN_MIDDLE: button = Qt::MidButton; break;
- case BTN_RIGHT: button = Qt::RightButton; break;
- }
- if (data->value)
- mouseBtn |= button;
- else
- mouseBtn &= ~button;
- } else if (data->type == EV_SYN && data->code == SYN_REPORT) {
- QPoint pos( mouseX, mouseY );
- oldmouse = transform( pos );
- //qLog(Input) << "\tSYN_REPORT" << mouseBtn << pos << oldmouse;
- emit mouseChanged(oldmouse, mouseBtn);
-
- } else {
- unknown = true;
- }
- if (unknown) {
- qWarning("unknown mouse event type=%x, code=%x, value=%x", data->type, data->code, data->value);
- }
- idx += sizeof(struct input_event);
- }
- int surplus = mouseIdx - idx;
- for (int i = 0; i < surplus; i++)
- mouseBuf[i] = mouseBuf[idx+i];
- mouseIdx = surplus;
- } while (n > 0);
-}
-
diff --git a/src/plugins/mousedrivers/linuxis/linuxismousehandler.h b/src/plugins/mousedrivers/linuxis/linuxismousehandler.h
deleted file mode 100644
index c898ddb..0000000
--- a/src/plugins/mousedrivers/linuxis/linuxismousehandler.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the plugins 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 either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** 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.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://www.qtsoftware.com/contact.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef LINUXISMOUSEHANDLER_H
-#define LINUXISMOUSEHANDLER_H
-
-#include <QtGui/QWSCalibratedMouseHandler>
-
-class QSocketNotifier;
-class LinuxInputSubsystemMouseHandler : public QObject, public QWSCalibratedMouseHandler {
- Q_OBJECT
-public:
- LinuxInputSubsystemMouseHandler(const QString &device = QString("/dev/input/event0"));
- ~LinuxInputSubsystemMouseHandler();
-
- void suspend();
- void resume();
-
-private:
- int mouseX, mouseY;
- int mouseBtn;
- static const int mouseBufSize = 2048;
- uchar mouseBuf[mouseBufSize];
- int mouseIdx;
- QPoint oldmouse;
-
- QSocketNotifier *m_notify;
- int mouseFd;
-
-private Q_SLOTS:
- void readMouseData();
-};
-
-#endif // LINUXISMOUSEHANDLER_H
diff --git a/src/plugins/mousedrivers/mousedrivers.pro b/src/plugins/mousedrivers/mousedrivers.pro
index e644361..f89682b 100644
--- a/src/plugins/mousedrivers/mousedrivers.pro
+++ b/src/plugins/mousedrivers/mousedrivers.pro
@@ -1,8 +1,5 @@
TEMPLATE = subdirs
-contains(mouse-plugins, bus): SUBDIRS += bus
contains(mouse-plugins, linuxtp): SUBDIRS += linuxtp
contains(mouse-plugins, pc): SUBDIRS += pc
contains(mouse-plugins, tslib): SUBDIRS += tslib
-contains(mouse-plugins, vr41xx): SUBDIRS += vr41xx
-contains(mouse-plugins, yopy): SUBDIRS += yopy
-contains(mouse-plugins, linuxis): SUBDIRS += linuxis
+contains(mouse-plugins, linuxinput): SUBDIRS += linuxinput
diff --git a/src/plugins/mousedrivers/vr41xx/main.cpp b/src/plugins/mousedrivers/vr41xx/main.cpp
deleted file mode 100644
index 8802a02..0000000
--- a/src/plugins/mousedrivers/vr41xx/main.cpp
+++ /dev/null
@@ -1,76 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the plugins 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 either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** 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.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://www.qtsoftware.com/contact.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <qmousedriverplugin_qws.h>
-#include <qmousevr41xx_qws.h>
-
-QT_BEGIN_NAMESPACE
-
-class QVr41xxMouseDriver : public QMouseDriverPlugin
-{
-public:
- QVr41xxMouseDriver();
-
- QStringList keys() const;
- QWSMouseHandler* create(const QString &driver, const QString &device);
-};
-
-QVr41xxMouseDriver::QVr41xxMouseDriver()
- : QMouseDriverPlugin()
-{
-}
-
-QStringList QVr41xxMouseDriver::keys() const
-{
- return (QStringList() << QLatin1String("VR41xx"));
-}
-
-QWSMouseHandler* QVr41xxMouseDriver::create(const QString &driver,
- const QString &device)
-{
- if (driver.compare(QLatin1String("VR41xx"), Qt::CaseInsensitive))
- return 0;
- return new QWSVr41xxMouseHandler(driver, device);
-}
-
-Q_EXPORT_PLUGIN2(qwsvr41xxmousehandler, QVr41xxMouseDriver)
-
-QT_END_NAMESPACE
diff --git a/src/plugins/mousedrivers/vr41xx/vr41xx.pro b/src/plugins/mousedrivers/vr41xx/vr41xx.pro
deleted file mode 100644
index 1c22d04..0000000
--- a/src/plugins/mousedrivers/vr41xx/vr41xx.pro
+++ /dev/null
@@ -1,14 +0,0 @@
-TARGET = qvr41xxmousedriver
-include(../../qpluginbase.pri)
-
-QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/mousedrivers
-target.path = $$[QT_INSTALL_PLUGINS]/mousedrivers
-INSTALLS += target
-
-DEFINES += QT_QWS_MOUSE_VR41XX
-
-HEADERS = $$QT_SOURCE_TREE/src/gui/embedded/qmousevr41xx_qws.h
-
-SOURCES = main.cpp \
- $$QT_SOURCE_TREE/src/gui/embedded/qmousevr41xx_qws.cpp
-
diff --git a/src/plugins/mousedrivers/yopy/main.cpp b/src/plugins/mousedrivers/yopy/main.cpp
deleted file mode 100644
index 9db9c4f..0000000
--- a/src/plugins/mousedrivers/yopy/main.cpp
+++ /dev/null
@@ -1,76 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the plugins 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 either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** 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.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://www.qtsoftware.com/contact.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <qmousedriverplugin_qws.h>
-#include <qmouseyopy_qws.h>
-
-QT_BEGIN_NAMESPACE
-
-class QYopyMouseDriver : public QMouseDriverPlugin
-{
-public:
- QYopyMouseDriver();
-
- QStringList keys() const;
- QWSMouseHandler* create(const QString &driver, const QString &device);
-};
-
-QYopyMouseDriver::QYopyMouseDriver()
- : QMouseDriverPlugin()
-{
-}
-
-QStringList QYopyMouseDriver::keys() const
-{
- return (QStringList() << QLatin1String("Yopy"));
-}
-
-QWSMouseHandler* QYopyMouseDriver::create(const QString &driver,
- const QString &device)
-{
- if (driver.compare(QLatin1String("yopy"), Qt::CaseInsensitive))
- return 0;
- return new QWSYopyMouseHandler(driver, device);
-}
-
-Q_EXPORT_PLUGIN2(qwsyopymousehandler, QYopyMouseDriver)
-
-QT_END_NAMESPACE
diff --git a/src/plugins/mousedrivers/yopy/yopy.pro b/src/plugins/mousedrivers/yopy/yopy.pro
deleted file mode 100644
index 3045430..0000000
--- a/src/plugins/mousedrivers/yopy/yopy.pro
+++ /dev/null
@@ -1,14 +0,0 @@
-TARGET = qyopymousedriver
-include(../../qpluginbase.pri)
-
-QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/mousedrivers
-target.path = $$[QT_INSTALL_PLUGINS]/mousedrivers
-INSTALLS += target
-
-DEFINES += QT_QWS_MOUSE_YOPY
-
-HEADERS = $$QT_SOURCE_TREE/src/gui/embedded/qmouseyopy_qws.h
-
-SOURCES = main.cpp \
- $$QT_SOURCE_TREE/src/gui/embedded/qmouseyopy_qws.cpp
-
diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro
index 76056a32..004b816 100644
--- a/src/plugins/plugins.pro
+++ b/src/plugins/plugins.pro
@@ -11,3 +11,4 @@ embedded:SUBDIRS *= gfxdrivers decorations mousedrivers kbddrivers
!win32:!embedded:!mac:!symbian:SUBDIRS *= inputmethods
symbian:SUBDIRS += s60
contains(QT_CONFIG, phonon): SUBDIRS *= phonon
+contains(QT_CONFIG, multimedia): SUBDIRS *= audio
diff --git a/src/plugins/s60/src/qdesktopservices_3_1.cpp b/src/plugins/s60/src/qdesktopservices_3_1.cpp
index 0f8e6a6..508009c 100644
--- a/src/plugins/s60/src/qdesktopservices_3_1.cpp
+++ b/src/plugins/s60/src/qdesktopservices_3_1.cpp
@@ -1,9 +1,9 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the $MODULE$ of the Qt Toolkit.
+** This file is part of the plugins of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
@@ -34,7 +34,7 @@
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
+** contact the sales department at http://www.qtsoftware.com/contact.
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/plugins/s60/src/qdesktopservices_3_2.cpp b/src/plugins/s60/src/qdesktopservices_3_2.cpp
index 3708436..a2e8cce 100644
--- a/src/plugins/s60/src/qdesktopservices_3_2.cpp
+++ b/src/plugins/s60/src/qdesktopservices_3_2.cpp
@@ -1,9 +1,9 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the $MODULE$ of the Qt Toolkit.
+** This file is part of the plugins of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
@@ -34,7 +34,7 @@
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
+** contact the sales department at http://www.qtsoftware.com/contact.
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/plugins/s60/src/qlocale_3_1.cpp b/src/plugins/s60/src/qlocale_3_1.cpp
index b2e6a5d..fb148ab 100644
--- a/src/plugins/s60/src/qlocale_3_1.cpp
+++ b/src/plugins/s60/src/qlocale_3_1.cpp
@@ -1,9 +1,9 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the $MODULE$ of the Qt Toolkit.
+** This file is part of the plugins of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
@@ -34,7 +34,7 @@
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
+** contact the sales department at http://www.qtsoftware.com/contact.
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/plugins/s60/src/qlocale_3_2.cpp b/src/plugins/s60/src/qlocale_3_2.cpp
index 7a3a7e5..087d29d 100644
--- a/src/plugins/s60/src/qlocale_3_2.cpp
+++ b/src/plugins/s60/src/qlocale_3_2.cpp
@@ -1,9 +1,9 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the $MODULE$ of the Qt Toolkit.
+** This file is part of the plugins of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
@@ -34,7 +34,7 @@
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
+** contact the sales department at http://www.qtsoftware.com/contact.
** $QT_END_LICENSE$
**
****************************************************************************/