diff options
14 files changed, 224 insertions, 228 deletions
diff --git a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.cpp b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.cpp index ff921fd..38ba82d 100644 --- a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.cpp +++ b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.cpp @@ -12,15 +12,15 @@ ** ****************************************************************************/ -#define ENSURE_RUNNING_MEEGO {if (! MGraphicsSystemHelper::isRunningMeeGo()) { qFatal("Using meego functionality but not running meego graphics system!"); }} +#define ENSURE_RUNNING_MEEGO {if (! QMeeGoGraphicsSystemHelper::isRunningMeeGo()) { qFatal("Using meego functionality but not running meego graphics system!"); }} -#include "mgraphicssystemhelper.h" -#include "../private/qapplication_p.h" -#include "../private/qgraphicssystem_runtime_p.h" -#include "../private/qpixmap_raster_p.h" -#include "mruntime.h" +#include "qmeegographicssystemhelper.h" +#include <private/qapplication_p.h> +#include <private/qgraphicssystem_runtime_p.h> +#include <private/qpixmap_raster_p.h> +#include "qmeegoruntime.h" -QString MGraphicsSystemHelper::runningGraphicsSystemName() +QString QMeeGoGraphicsSystemHelper::runningGraphicsSystemName() { if (! QApplicationPrivate::instance()) { qWarning("Querying graphics system but application not running yet!"); @@ -36,12 +36,12 @@ QString MGraphicsSystemHelper::runningGraphicsSystemName() return name; } -bool MGraphicsSystemHelper::isRunningMeeGo() +bool QMeeGoGraphicsSystemHelper::isRunningMeeGo() { return (runningGraphicsSystemName() == "meego"); } -void MGraphicsSystemHelper::switchToMeeGo() +void QMeeGoGraphicsSystemHelper::switchToMeeGo() { if (runningGraphicsSystemName() == "meego") return; @@ -54,7 +54,7 @@ void MGraphicsSystemHelper::switchToMeeGo() } } -void MGraphicsSystemHelper::switchToRaster() +void QMeeGoGraphicsSystemHelper::switchToRaster() { if (runningGraphicsSystemName() == "raster") return; @@ -67,40 +67,40 @@ void MGraphicsSystemHelper::switchToRaster() } } -Qt::HANDLE MGraphicsSystemHelper::imageToEGLSharedImage(const QImage &image) +Qt::HANDLE QMeeGoGraphicsSystemHelper::imageToEGLSharedImage(const QImage &image) { ENSURE_RUNNING_MEEGO; - return MRuntime::imageToEGLSharedImage(image); + return QMeeGoRuntime::imageToEGLSharedImage(image); } -QPixmap MGraphicsSystemHelper::pixmapFromEGLSharedImage(Qt::HANDLE handle, const QImage &softImage) +QPixmap QMeeGoGraphicsSystemHelper::pixmapFromEGLSharedImage(Qt::HANDLE handle, const QImage &softImage) { // This function is supported when not running meego too. A raster-backed // pixmap will be created... but when you switch back to 'meego', it'll // be replaced with a EGL shared image backing. - return MRuntime::pixmapFromEGLSharedImage(handle, softImage); + return QMeeGoRuntime::pixmapFromEGLSharedImage(handle, softImage); } -QPixmap MGraphicsSystemHelper::pixmapWithGLTexture(int w, int h) +QPixmap QMeeGoGraphicsSystemHelper::pixmapWithGLTexture(int w, int h) { ENSURE_RUNNING_MEEGO; - return MRuntime::pixmapWithGLTexture(w, h); + return QMeeGoRuntime::pixmapWithGLTexture(w, h); } -bool MGraphicsSystemHelper::destroyEGLSharedImage(Qt::HANDLE handle) +bool QMeeGoGraphicsSystemHelper::destroyEGLSharedImage(Qt::HANDLE handle) { ENSURE_RUNNING_MEEGO; - return MRuntime::destroyEGLSharedImage(handle); + return QMeeGoRuntime::destroyEGLSharedImage(handle); } -void MGraphicsSystemHelper::updateEGLSharedImagePixmap(QPixmap *p) +void QMeeGoGraphicsSystemHelper::updateEGLSharedImagePixmap(QPixmap *p) { ENSURE_RUNNING_MEEGO; - return MRuntime::updateEGLSharedImagePixmap(p); + return QMeeGoRuntime::updateEGLSharedImagePixmap(p); } -void MGraphicsSystemHelper::setTranslucent(bool translucent) +void QMeeGoGraphicsSystemHelper::setTranslucent(bool translucent) { ENSURE_RUNNING_MEEGO; - MRuntime::setTranslucent(translucent); + QMeeGoRuntime::setTranslucent(translucent); } diff --git a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.h b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.h index 1966648..069a27c 100644 --- a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.h +++ b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.h @@ -12,12 +12,12 @@ ** ****************************************************************************/ -#ifndef MGRAPHICSSYSTEMHELPER_H -#define MGRAPHICSSYSTEMHELPER_H +#ifndef QMEEGOGRAPHICSSYSTEMHELPER_H +#define QMEEGOGRAPHICSSYSTEMHELPER_H #include <QPixmap> #include <QImage> -#include "mlivepixmap.h" +#include "qmeegolivepixmap.h" class QLibrary; @@ -33,8 +33,8 @@ class QLibrary; \code QPixmap p; - if (MGraphicsSystemHelper::isRunningMeeGo()) { - p = MGraphicsSystemHelper::pixmapWithGLTexture(64, 64); + if (QMeeGoGraphicsSystemHelper::isRunningMeeGo()) { + p = QMeeGoGraphicsSystemHelper::pixmapWithGLTexture(64, 64); } else { p = QPixmap(64, 64); } @@ -44,14 +44,14 @@ class QLibrary; give unpredictable results. The only functions safe to call at all times are: \code - MGraphicsSystemHelper::isRunningMeeGo(); - MGraphicsSystemHelper::runningGraphicsSystemName(); - MGraphicsSystemHelper::switchToMeeGo(); - MGraphicsSystemHelper::switchToRaster(); + QMeeGoGraphicsSystemHelper::isRunningMeeGo(); + QMeeGoGraphicsSystemHelper::runningGraphicsSystemName(); + QMeeGoGraphicsSystemHelper::switchToMeeGo(); + QMeeGoGraphicsSystemHelper::switchToRaster(); \endcode */ -class MGraphicsSystemHelper +class QMeeGoGraphicsSystemHelper { public: //! Returns true if running meego. diff --git a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.pro b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.pro index cab096e..eba6da4 100644 --- a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.pro +++ b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.pro @@ -1,19 +1,11 @@ TEMPLATE = lib -TARGET = meegographicssystemhelper -QT += gui -INCLUDEPATH += '../' -LIBS += -L../plugin -CONFIG += debug -VERSION = 0.1.9 -HEADERS = mgraphicssystemhelper.h moverlaywidget.h mlivepixmap.h mliveimage.h mruntime.h mliveimage_p.h mlivepixmap_p.h -SOURCES = mgraphicssystemhelper.cpp mgraphicssystemhelper.h moverlaywidget.h moverlaywidget.cpp mruntime.cpp mruntime.h mlivepixmap.cpp mlivepixmap.h mliveimage.h mliveimage.cpp mliveimage_p.h mlivepixmap_p.h - -target.path = /usr/lib/ +TARGET = qmeegographicssystemhelper -headers.files = mgraphicssystemhelper.h moverlaywidget.h mlivepixmap.h mliveimage.h -headers.path = /usr/include/meegographicssystemhelper/ +include(../../src/qbase.pri) -pkg.files = meegographicssystemhelper.pc -pkg.path = /usr/lib/pkgconfig/ +QT += gui +INCLUDEPATH += '../../src/plugins/graphicssystems/meego' -INSTALLS += target headers pkg +VERSION = 0.1.9 +HEADERS = qmeegographicssystemhelper.h qmeegooverlaywidget.h qmeegolivepixmap.h qmeegoliveimage.h qmeegoruntime.h qmeegoliveimage_p.h qmeegolivepixmap_p.h +SOURCES = qmeegographicssystemhelper.cpp qmeegooverlaywidget.cpp qmeegoruntime.cpp qmeegolivepixmap.cpp qmeegoliveimage.cpp diff --git a/tools/qmeegographicssystemhelper/qmeegoliveimage.cpp b/tools/qmeegographicssystemhelper/qmeegoliveimage.cpp index 37ead21..f92caf7 100644 --- a/tools/qmeegographicssystemhelper/qmeegoliveimage.cpp +++ b/tools/qmeegographicssystemhelper/qmeegoliveimage.cpp @@ -12,36 +12,36 @@ ** ****************************************************************************/ -#include "mliveimage.h" -#include "mliveimage_p.h" -#include "mlivepixmap.h" -#include "mlivepixmap_p.h" +#include "qmeegoliveimage.h" +#include "qmeegoliveimage_p.h" +#include "qmeegolivepixmap.h" +#include "qmeegolivepixmap_p.h" -/* MLiveImagePrivate */ +/* QMeeGoLiveImagePrivate */ -MLiveImagePrivate::MLiveImagePrivate() +QMeeGoLiveImagePrivate::QMeeGoLiveImagePrivate() { } -MLiveImagePrivate::~MLiveImagePrivate() +QMeeGoLiveImagePrivate::~QMeeGoLiveImagePrivate() { if (attachedPixmaps.length() > 0) - qWarning("Destroying MLiveImage but it still has MLivePixmaps attached!"); + qWarning("Destroying QMeeGoLiveImage but it still has QMeeGoLivePixmaps attached!"); } -void MLiveImagePrivate::attachPixmap(MLivePixmap* pixmap) +void QMeeGoLiveImagePrivate::attachPixmap(QMeeGoLivePixmap* pixmap) { attachedPixmaps << pixmap; } -void MLiveImagePrivate::detachPixmap(MLivePixmap* pixmap) +void QMeeGoLiveImagePrivate::detachPixmap(QMeeGoLivePixmap* pixmap) { attachedPixmaps.removeAll(pixmap); } -/* MLiveImage */ +/* QMeeGoLiveImage */ -MLiveImage* MLiveImage::liveImageWithSize(int w, int h, Format format, int buffers) +QMeeGoLiveImage* QMeeGoLiveImage::liveImageWithSize(int w, int h, Format format, int buffers) { if (format != Format_ARGB32_Premultiplied) { qWarning("Only _ARGB32_Premultiplied format is supported for live images now!"); @@ -53,36 +53,36 @@ MLiveImage* MLiveImage::liveImageWithSize(int w, int h, Format format, int buffe return 0; } - MLiveImage *liveImage = new MLiveImage(w, h); + QMeeGoLiveImage *liveImage = new QMeeGoLiveImage(w, h); return liveImage; } -MLiveImage::MLiveImage(int w, int h) : QImage(w, h, QImage::Format_ARGB32_Premultiplied), d_ptr(new MLiveImagePrivate()) +QMeeGoLiveImage::QMeeGoLiveImage(int w, int h) : QImage(w, h, QImage::Format_ARGB32_Premultiplied), d_ptr(new QMeeGoLiveImagePrivate()) { - Q_D(MLiveImage); + Q_D(QMeeGoLiveImage); d->q_ptr = this; } -MLiveImage::~MLiveImage() +QMeeGoLiveImage::~QMeeGoLiveImage() { } -void MLiveImage::lock(int buffer) +void QMeeGoLiveImage::lock(int buffer) { if (buffer != 0) qWarning("Only locking 0 buffer is supported at the moment!"); } -void MLiveImage::release(int buffer) +void QMeeGoLiveImage::release(int buffer) { - Q_D(MLiveImage); + Q_D(QMeeGoLiveImage); if (buffer != 0) { qWarning("Only locking 0 buffer is supported at the moment!"); return; } - // We need to copy the update image to all the client MLivePixmap's - foreach (MLivePixmap* livePixmap, d->attachedPixmaps) + // We need to copy the update image to all the client QMeeGoLivePixmap's + foreach (QMeeGoLivePixmap* livePixmap, d->attachedPixmaps) livePixmap->d_ptr->copyBackFrom((const void *) bits()); -}
\ No newline at end of file +} diff --git a/tools/qmeegographicssystemhelper/qmeegoliveimage.h b/tools/qmeegographicssystemhelper/qmeegoliveimage.h index f945b34..1a998a3 100644 --- a/tools/qmeegographicssystemhelper/qmeegoliveimage.h +++ b/tools/qmeegographicssystemhelper/qmeegoliveimage.h @@ -12,24 +12,24 @@ ** ****************************************************************************/ -#ifndef MLIVEIMAGE_H -#define MLIVEIMAGE_H +#ifndef QMEEGOLIVEIMAGE_H +#define QMEEGOLIVEIMAGE_H #include <QImage> -class MLivePixmap; -class MLiveImagePrivate; +class QMeeGoLivePixmap; +class QMeeGoLiveImagePrivate; //! A streamable QImage subclass. /*! */ -class MLiveImage : public QImage +class QMeeGoLiveImage : public QImage { public: //! Format specifier. /*! - Used to specify the format of the underlying image data for MLiveImage. + Used to specify the format of the underlying image data for QMeeGoLiveImage. */ enum Format { Format_ARGB32_Premultiplied //! 32bit, AARRGGBB format. The typical Qt format. @@ -51,10 +51,10 @@ public: //! Destroys the image. /*! - It's a mistake to destroy an image before destroying all the MLivePixmaps - built on top of it. You should first destroy all the MLivePixmaps. + It's a mistake to destroy an image before destroying all the QMeeGoLivePixmaps + built on top of it. You should first destroy all the QMeeGoLivePixmaps. */ - virtual ~MLiveImage(); + virtual ~QMeeGoLiveImage(); //! Creates and returns a new live image with the given parameters. /*! @@ -62,18 +62,18 @@ public: The format specifies the color format used by the image. Optionally, a number of buffers can be specfied for a stream-like behavior. */ - static MLiveImage* liveImageWithSize(int w, int h, Format format, int buffers = 1); + static QMeeGoLiveImage* liveImageWithSize(int w, int h, Format format, int buffers = 1); private: - MLiveImage(int w, int h); //! Private bits. - Q_DISABLE_COPY(MLiveImage) - Q_DECLARE_PRIVATE(MLiveImage) + QMeeGoLiveImage(int w, int h); //! Private bits. + Q_DISABLE_COPY(QMeeGoLiveImage) + Q_DECLARE_PRIVATE(QMeeGoLiveImage) protected: - QScopedPointer<MLiveImagePrivate> d_ptr; + QScopedPointer<QMeeGoLiveImagePrivate> d_ptr; - friend class MLivePixmap; - friend class MLivePixmapPrivate; + friend class QMeeGoLivePixmap; + friend class QMeeGoLivePixmapPrivate; }; #endif diff --git a/tools/qmeegographicssystemhelper/qmeegoliveimage_p.h b/tools/qmeegographicssystemhelper/qmeegoliveimage_p.h index 0789b93..aae97da 100644 --- a/tools/qmeegographicssystemhelper/qmeegoliveimage_p.h +++ b/tools/qmeegographicssystemhelper/qmeegoliveimage_p.h @@ -12,25 +12,25 @@ ** ****************************************************************************/ -#include "mliveimage.h" +#include "qmeegoliveimage.h" -#ifndef MLIVEIMAGE_P_H -#define MLIVEIMAGE_P_H +#ifndef QMEEGOLIVEIMAGE_P_H +#define QMEEGOLIVEIMAGE_P_H -class MLiveImagePrivate +class QMeeGoLiveImagePrivate { public: - Q_DECLARE_PUBLIC(MLiveImage); - MLiveImagePrivate(); - virtual ~MLiveImagePrivate(); - void attachPixmap(MLivePixmap* pixmap); - void detachPixmap(MLivePixmap* pixmap); + Q_DECLARE_PUBLIC(QMeeGoLiveImage); + QMeeGoLiveImagePrivate(); + virtual ~QMeeGoLiveImagePrivate(); + void attachPixmap(QMeeGoLivePixmap* pixmap); + void detachPixmap(QMeeGoLivePixmap* pixmap); - QList <MLivePixmap*> attachedPixmaps; - MLiveImage *q_ptr; + QList <QMeeGoLivePixmap*> attachedPixmaps; + QMeeGoLiveImage *q_ptr; - friend class MLivePixmap; - friend class MLivePixmapPrivate; + friend class QMeeGoLivePixmap; + friend class QMeeGoLivePixmapPrivate; }; -#endif
\ No newline at end of file +#endif diff --git a/tools/qmeegographicssystemhelper/qmeegolivepixmap.cpp b/tools/qmeegographicssystemhelper/qmeegolivepixmap.cpp index 2f7abd7..743f4b9 100644 --- a/tools/qmeegographicssystemhelper/qmeegolivepixmap.cpp +++ b/tools/qmeegographicssystemhelper/qmeegolivepixmap.cpp @@ -12,22 +12,22 @@ ** ****************************************************************************/ -#include "mlivepixmap.h" -#include "../private/qimage_p.h" -#include "../private/qpixmap_raster_p.h" -#include "mlivepixmap_p.h" -#include "mliveimage_p.h" +#include "qmeegolivepixmap.h" +#include <private/qimage_p.h> +#include <private/qpixmap_raster_p.h> +#include "qmeegolivepixmap_p.h" +#include "qmeegoliveimage_p.h" #include <QSharedMemory> -/* MLivePixmapPrivate */ +/* QMeeGoLivePixmapPrivate */ -MLivePixmapPrivate::MLivePixmapPrivate() : shm(0), shmSerial(0), owns(true), parentImage(0) +QMeeGoLivePixmapPrivate::QMeeGoLivePixmapPrivate() : shm(0), shmSerial(0), owns(true), parentImage(0) { } -void MLivePixmapPrivate::copyBackFrom(const void *raw) +void QMeeGoLivePixmapPrivate::copyBackFrom(const void *raw) { - Q_Q(MLivePixmap); + Q_Q(QMeeGoLivePixmap); q->detach(); shm->lock(); @@ -36,9 +36,9 @@ void MLivePixmapPrivate::copyBackFrom(const void *raw) shm->unlock(); } -MLivePixmapPrivate::~MLivePixmapPrivate() +QMeeGoLivePixmapPrivate::~QMeeGoLivePixmapPrivate() { - Q_Q(MLivePixmap); + Q_Q(QMeeGoLivePixmap); if (parentImage) parentImage->d_ptr->detachPixmap(q); @@ -50,15 +50,15 @@ MLivePixmapPrivate::~MLivePixmapPrivate() delete shm; } -/* MLivePixmap */ +/* QMeeGoLivePixmap */ -MLivePixmap::MLivePixmap(QPixmapData *p) : QPixmap(p), d_ptr(new MLivePixmapPrivate()) +QMeeGoLivePixmap::QMeeGoLivePixmap(QPixmapData *p) : QPixmap(p), d_ptr(new QMeeGoLivePixmapPrivate()) { - Q_D(MLivePixmap); + Q_D(QMeeGoLivePixmap); d->q_ptr = this; } -MLivePixmap* MLivePixmap::fromLiveImage(MLiveImage *liveImage) +QMeeGoLivePixmap* QMeeGoLivePixmap::fromLiveImage(QMeeGoLiveImage *liveImage) { static int counter = 100; QSharedMemory *shm = NULL; @@ -68,7 +68,7 @@ MLivePixmap* MLivePixmap::fromLiveImage(MLiveImage *liveImage) int h = liveImage->height(); counter++; - shm = new QSharedMemory(QString("MLivePixmap%1").arg(counter)); + shm = new QSharedMemory(QString("QMeeGoLivePixmap%1").arg(counter)); shm->create((w * h * 4) + 2 * sizeof(int)); // +2 to store width & height shm->attach(); @@ -83,7 +83,7 @@ MLivePixmap* MLivePixmap::fromLiveImage(MLiveImage *liveImage) QPixmapData *pmd = new QRasterPixmapData(QPixmapData::PixmapType); pmd->fromImage(img, Qt::NoOpaqueDetection); - MLivePixmap *livePixmap = new MLivePixmap(pmd); + QMeeGoLivePixmap *livePixmap = new QMeeGoLivePixmap(pmd); livePixmap->d_ptr->shm = shm; livePixmap->d_ptr->owns = true; livePixmap->d_ptr->shmSerial = counter; @@ -94,7 +94,7 @@ MLivePixmap* MLivePixmap::fromLiveImage(MLiveImage *liveImage) return livePixmap; } -MLivePixmap* MLivePixmap::fromHandle(Qt::HANDLE handle) +QMeeGoLivePixmap* QMeeGoLivePixmap::fromHandle(Qt::HANDLE handle) { QSharedMemory *shm = NULL; int *header; @@ -102,7 +102,7 @@ MLivePixmap* MLivePixmap::fromHandle(Qt::HANDLE handle) int height; uchar* imgData; - shm = new QSharedMemory(QString("MLivePixmap%1").arg(handle)); + shm = new QSharedMemory(QString("QMeeGoLivePixmap%1").arg(handle)); shm->attach(); shm->lock(); @@ -117,7 +117,7 @@ MLivePixmap* MLivePixmap::fromHandle(Qt::HANDLE handle) QPixmapData *pmd = new QRasterPixmapData(QPixmapData::PixmapType); pmd->fromImage(img, Qt::NoOpaqueDetection); - MLivePixmap *livePixmap = new MLivePixmap(pmd); + QMeeGoLivePixmap *livePixmap = new QMeeGoLivePixmap(pmd); livePixmap->d_ptr->shm = shm; livePixmap->d_ptr->owns = false; livePixmap->d_ptr->shmSerial = handle; @@ -125,12 +125,12 @@ MLivePixmap* MLivePixmap::fromHandle(Qt::HANDLE handle) return livePixmap; } -MLivePixmap::~MLivePixmap() +QMeeGoLivePixmap::~QMeeGoLivePixmap() { } -Qt::HANDLE MLivePixmap::handle() +Qt::HANDLE QMeeGoLivePixmap::handle() { - Q_D(MLivePixmap); + Q_D(QMeeGoLivePixmap); return d->shmSerial; } diff --git a/tools/qmeegographicssystemhelper/qmeegolivepixmap.h b/tools/qmeegographicssystemhelper/qmeegolivepixmap.h index dee4d2a..123b64f 100644 --- a/tools/qmeegographicssystemhelper/qmeegolivepixmap.h +++ b/tools/qmeegographicssystemhelper/qmeegolivepixmap.h @@ -12,13 +12,13 @@ ** ****************************************************************************/ -#ifndef MLIVEPIXMAP_H -#define MLIVEPIXMAP_H +#ifndef QMEEGOLIVEPIXMAP_H +#define QMEEGOLIVEPIXMAP_H #include <QPixmap> -#include "mliveimage.h" +#include "qmeegoliveimage.h" -class MLivePixmapPrivate; +class QMeeGoLivePixmapPrivate; class QSharedMemory; class QImage; @@ -26,46 +26,46 @@ class QImage; /*! */ -class MLivePixmap : public QPixmap +class QMeeGoLivePixmap : public QPixmap { public: - //! Creates new pixmap from the given MLiveImage. + //! Creates new pixmap from the given QMeeGoLiveImage. /*! - The created MLivePixmap will be attached to the given MLiveImage. - Updates to the MLiveImage will be represented on this newly created - MLivePixmap. + The created QMeeGoLivePixmap will be attached to the given QMeeGoLiveImage. + Updates to the QMeeGoLiveImage will be represented on this newly created + QMeeGoLivePixmap. */ - static MLivePixmap* fromLiveImage(MLiveImage *liveImage); + static QMeeGoLivePixmap* fromLiveImage(QMeeGoLiveImage *liveImage); - //! Creates a new MLivePixmap from the specified handle. + //! Creates a new QMeeGoLivePixmap from the specified handle. /*! - The handle can be used to share MLivePixmap cross-process. + The handle can be used to share QMeeGoLivePixmap cross-process. */ - static MLivePixmap* fromHandle(Qt::HANDLE handle); + static QMeeGoLivePixmap* fromHandle(Qt::HANDLE handle); - //! Returns the handle for this MLivePixmap. + //! Returns the handle for this QMeeGoLivePixmap. /*! - The handle can be used to share MLivePixmap cross-process. + The handle can be used to share QMeeGoLivePixmap cross-process. */ Qt::HANDLE handle(); - //! Destroys the MLivePixmap. + //! Destroys the QMeeGoLivePixmap. /*! - All MLivePixmaps attached to a given MLiveImage have to be destroyed - before the MLiveImage itself is destroyed. + All QMeeGoLivePixmaps attached to a given QMeeGoLiveImage have to be destroyed + before the QMeeGoLiveImage itself is destroyed. */ - virtual ~MLivePixmap(); + virtual ~QMeeGoLivePixmap(); private: - MLivePixmap(QPixmapData *p); - Q_DISABLE_COPY(MLivePixmap) - Q_DECLARE_PRIVATE(MLivePixmap) + QMeeGoLivePixmap(QPixmapData *p); + Q_DISABLE_COPY(QMeeGoLivePixmap) + Q_DECLARE_PRIVATE(QMeeGoLivePixmap) protected: - QScopedPointer<MLivePixmapPrivate> d_ptr; //! Private bits. + QScopedPointer<QMeeGoLivePixmapPrivate> d_ptr; //! Private bits. - friend class MLiveImage; - friend class MLiveImagePrivate; + friend class QMeeGoLiveImage; + friend class QMeeGoLiveImagePrivate; }; #endif diff --git a/tools/qmeegographicssystemhelper/qmeegolivepixmap_p.h b/tools/qmeegographicssystemhelper/qmeegolivepixmap_p.h index 4ff64de..20158d6 100644 --- a/tools/qmeegographicssystemhelper/qmeegolivepixmap_p.h +++ b/tools/qmeegographicssystemhelper/qmeegolivepixmap_p.h @@ -12,28 +12,28 @@ ** ****************************************************************************/ -#include "mlivepixmap.h" +#include "qmeegolivepixmap.h" -#ifndef MLIVEPIXMAP_P_H -#define MLIVEPIXMAP_P_H +#ifndef QMEEGOLIVEPIXMAP_P_H +#define QMEEGOLIVEPIXMAP_P_H -class MLivePixmapPrivate +class QMeeGoLivePixmapPrivate { public: - Q_DECLARE_PUBLIC(MLivePixmap); - MLivePixmapPrivate(); + Q_DECLARE_PUBLIC(QMeeGoLivePixmap); + QMeeGoLivePixmapPrivate(); void copyBackFrom(const void *raw); - virtual ~MLivePixmapPrivate(); + virtual ~QMeeGoLivePixmapPrivate(); QSharedMemory *shm; int shmSerial; bool owns; - MLiveImage *parentImage; + QMeeGoLiveImage *parentImage; - MLivePixmap *q_ptr; + QMeeGoLivePixmap *q_ptr; - friend class MLiveImage; - friend class MLiveImagePrivate; + friend class QMeeGoLiveImage; + friend class QMeeGoLiveImagePrivate; }; -#endif
\ No newline at end of file +#endif diff --git a/tools/qmeegographicssystemhelper/qmeegooverlaywidget.cpp b/tools/qmeegographicssystemhelper/qmeegooverlaywidget.cpp index 8f64b3f..e44ad0c 100644 --- a/tools/qmeegographicssystemhelper/qmeegooverlaywidget.cpp +++ b/tools/qmeegographicssystemhelper/qmeegooverlaywidget.cpp @@ -16,37 +16,37 @@ #include <QEvent> #include <QMouseEvent> #include <QCoreApplication> -#include "moverlaywidget.h" -#include "mgraphicssystemhelper.h" -#include "mruntime.h" +#include "qmeegooverlaywidget.h" +#include "qmeegographicssystemhelper.h" +#include "qmeegoruntime.h" -MOverlayWidget::MOverlayWidget(int surfaceWidth, int surfaceHeight, QWidget *parent) : QWidget(parent, 0), +QMeeGoOverlayWidget::QMeeGoOverlayWidget(int surfaceWidth, int surfaceHeight, QWidget *parent) : QWidget(parent, 0), sw(surfaceWidth), sh(surfaceHeight) { - if (! MGraphicsSystemHelper::isRunningMeeGo()) - qFatal("MOverlayWidget can only be used when running with 'meego' graphics system!"); + if (! QMeeGoGraphicsSystemHelper::isRunningMeeGo()) + qFatal("QMeeGoOverlayWidget can only be used when running with 'meego' graphics system!"); - MRuntime::setSurfaceFixedSize(surfaceWidth, surfaceHeight); + QMeeGoRuntime::setSurfaceFixedSize(surfaceWidth, surfaceHeight); scaleW = sw / 864.0; scaleH = sh / 480.0; installEventFilter(this); } -QPoint MOverlayWidget::convertPoint(const QPoint &p) +QPoint QMeeGoOverlayWidget::convertPoint(const QPoint &p) { int x = p.x() * scaleW; int y = p.y() * scaleH; return QPoint(x, y); } -void MOverlayWidget::showEvent(QShowEvent *event) +void QMeeGoOverlayWidget::showEvent(QShowEvent *event) { - MRuntime::setSurfaceScaling(0, 0, width(), height()); + QMeeGoRuntime::setSurfaceScaling(0, 0, width(), height()); } -bool MOverlayWidget::eventFilter(QObject *obj, QEvent *event) +bool QMeeGoOverlayWidget::eventFilter(QObject *obj, QEvent *event) { if (event->spontaneous() == false) return false; diff --git a/tools/qmeegographicssystemhelper/qmeegooverlaywidget.h b/tools/qmeegographicssystemhelper/qmeegooverlaywidget.h index f45a673..f36f407 100644 --- a/tools/qmeegographicssystemhelper/qmeegooverlaywidget.h +++ b/tools/qmeegographicssystemhelper/qmeegooverlaywidget.h @@ -12,8 +12,8 @@ ** ****************************************************************************/ -#ifndef MOVERLAYWIDGET_H -#define MOVERLAYWIDGET_H +#ifndef QMEEGOOVERLAYWIDGET_H +#define QMEEGOOVERLAYWIDGET_H #include <QWidget> @@ -21,7 +21,7 @@ /*! */ -class MOverlayWidget : public QWidget +class QMeeGoOverlayWidget : public QWidget { public: //! Constructs a new scaling widget. @@ -29,7 +29,7 @@ public: The real surface used for this widget will have the specified width and height. */ - MOverlayWidget(int surfaceWidth, int surfaceHeight, QWidget *parent = 0); + QMeeGoOverlayWidget(int surfaceWidth, int surfaceHeight, QWidget *parent = 0); //! Event filtering function. diff --git a/tools/qmeegographicssystemhelper/qmeegoruntime.cpp b/tools/qmeegographicssystemhelper/qmeegoruntime.cpp index b1b0874..1953483 100644 --- a/tools/qmeegographicssystemhelper/qmeegoruntime.cpp +++ b/tools/qmeegographicssystemhelper/qmeegoruntime.cpp @@ -12,101 +12,101 @@ ** ****************************************************************************/ -#include "mruntime.h" +#include "qmeegoruntime.h" #define ENSURE_INITIALIZED {if (!initialized) initialize();} -QLibrary* MRuntime::library = NULL; -bool MRuntime::initialized = false; +QLibrary* QMeeGoRuntime::library = NULL; +bool QMeeGoRuntime::initialized = false; -typedef int (*MImageToEglSharedImageFunc) (const QImage&); -typedef QPixmapData* (*MPixmapDataFromEglSharedImageFunc) (Qt::HANDLE handle, const QImage&); -typedef QPixmapData* (*MPixmapDataWithGLTextureFunc) (int w, int h); -typedef bool (*MDestroyEGLSharedImageFunc) (Qt::HANDLE handle); -typedef void (*MUpdateEglSharedImagePixmapFunc) (QPixmap*); -typedef void (*MSetSurfaceFixedSizeFunc) (int w, int h); -typedef void (*MSetSurfaceScalingFunc) (int x, int y, int w, int h); -typedef void (*MSetTranslucentFunc) (bool translucent); +typedef int (*QMeeGoImageToEglSharedImageFunc) (const QImage&); +typedef QPixmapData* (*QMeeGoPixmapDataFromEglSharedImageFunc) (Qt::HANDLE handle, const QImage&); +typedef QPixmapData* (*QMeeGoPixmapDataWithGLTextureFunc) (int w, int h); +typedef bool (*QMeeGoDestroyEGLSharedImageFunc) (Qt::HANDLE handle); +typedef void (*QMeeGoUpdateEglSharedImagePixmapFunc) (QPixmap*); +typedef void (*QMeeGoSetSurfaceFixedSizeFunc) (int w, int h); +typedef void (*QMeeGoSetSurfaceScalingFunc) (int x, int y, int w, int h); +typedef void (*QMeeGoSetTranslucentFunc) (bool translucent); -static MImageToEglSharedImageFunc m_image_to_egl_shared_image = NULL; -static MPixmapDataFromEglSharedImageFunc m_pixmapdata_from_egl_shared_image = NULL; -static MPixmapDataWithGLTextureFunc m_pixmapdata_with_gl_texture = NULL; -static MDestroyEGLSharedImageFunc m_destroy_egl_shared_image = NULL; -static MUpdateEglSharedImagePixmapFunc m_update_egl_shared_image_pixmap = NULL; -static MSetSurfaceFixedSizeFunc m_set_surface_fixed_size = NULL; -static MSetSurfaceScalingFunc m_set_surface_scaling = NULL; -static MSetTranslucentFunc m_set_translucent = NULL; +static QMeeGoImageToEglSharedImageFunc qt_meego_image_to_egl_shared_image = NULL; +static QMeeGoPixmapDataFromEglSharedImageFunc qt_meego_pixmapdata_from_egl_shared_image = NULL; +static QMeeGoPixmapDataWithGLTextureFunc qt_meego_pixmapdata_with_gl_texture = NULL; +static QMeeGoDestroyEGLSharedImageFunc qt_meego_destroy_egl_shared_image = NULL; +static QMeeGoUpdateEglSharedImagePixmapFunc qt_meego_update_egl_shared_image_pixmap = NULL; +static QMeeGoSetSurfaceFixedSizeFunc qt_meego_set_surface_fixed_size = NULL; +static QMeeGoSetSurfaceScalingFunc qt_meego_set_surface_scaling = NULL; +static QMeeGoSetTranslucentFunc qt_meego_set_translucent = NULL; -void MRuntime::initialize() +void QMeeGoRuntime::initialize() { library = new QLibrary("/usr/lib/qt4/plugins/graphicssystems/libmeegographicssystem.so"); Q_ASSERT(library); - m_image_to_egl_shared_image = (MImageToEglSharedImageFunc) library->resolve("m_image_to_egl_shared_image"); - m_pixmapdata_from_egl_shared_image = (MPixmapDataFromEglSharedImageFunc) library->resolve("m_pixmapdata_from_egl_shared_image"); - m_pixmapdata_with_gl_texture = (MPixmapDataWithGLTextureFunc) library->resolve("m_pixmapdata_with_gl_texture"); - m_destroy_egl_shared_image = (MDestroyEGLSharedImageFunc) library->resolve("m_destroy_egl_shared_image"); - m_update_egl_shared_image_pixmap = (MUpdateEglSharedImagePixmapFunc) library->resolve("m_update_egl_shared_image_pixmap"); - m_set_surface_fixed_size = (MSetSurfaceFixedSizeFunc) library->resolve("m_set_surface_fixed_size"); - m_set_surface_scaling = (MSetSurfaceScalingFunc) library->resolve("m_set_surface_scaling"); - m_set_translucent = (MSetTranslucentFunc) library->resolve("m_set_translucent"); + qt_meego_image_to_egl_shared_image = (QMeeGoImageToEglSharedImageFunc) library->resolve("qt_meego_image_to_egl_shared_image"); + qt_meego_pixmapdata_from_egl_shared_image = (QMeeGoPixmapDataFromEglSharedImageFunc) library->resolve("qt_meego_pixmapdata_from_egl_shared_image"); + qt_meego_pixmapdata_with_gl_texture = (QMeeGoPixmapDataWithGLTextureFunc) library->resolve("qt_meego_pixmapdata_with_gl_texture"); + qt_meego_destroy_egl_shared_image = (QMeeGoDestroyEGLSharedImageFunc) library->resolve("qt_meego_destroy_egl_shared_image"); + qt_meego_update_egl_shared_image_pixmap = (QMeeGoUpdateEglSharedImagePixmapFunc) library->resolve("qt_meego_update_egl_shared_image_pixmap"); + qt_meego_set_surface_fixed_size = (QMeeGoSetSurfaceFixedSizeFunc) library->resolve("qt_meego_set_surface_fixed_size"); + qt_meego_set_surface_scaling = (QMeeGoSetSurfaceScalingFunc) library->resolve("qt_meego_set_surface_scaling"); + qt_meego_set_translucent = (QMeeGoSetTranslucentFunc) library->resolve("qt_meego_set_translucent"); initialized = true; } -Qt::HANDLE MRuntime::imageToEGLSharedImage(const QImage &image) +Qt::HANDLE QMeeGoRuntime::imageToEGLSharedImage(const QImage &image) { ENSURE_INITIALIZED; - Q_ASSERT(m_image_to_egl_shared_image); - return m_image_to_egl_shared_image(image); + Q_ASSERT(qt_meego_image_to_egl_shared_image); + return qt_meego_image_to_egl_shared_image(image); } -QPixmap MRuntime::pixmapFromEGLSharedImage(Qt::HANDLE handle, const QImage &softImage) +QPixmap QMeeGoRuntime::pixmapFromEGLSharedImage(Qt::HANDLE handle, const QImage &softImage) { ENSURE_INITIALIZED; - Q_ASSERT(m_pixmapdata_from_egl_shared_image); - return QPixmap(m_pixmapdata_from_egl_shared_image(handle, softImage)); + Q_ASSERT(qt_meego_pixmapdata_from_egl_shared_image); + return QPixmap(qt_meego_pixmapdata_from_egl_shared_image(handle, softImage)); } -QPixmap MRuntime::pixmapWithGLTexture(int w, int h) +QPixmap QMeeGoRuntime::pixmapWithGLTexture(int w, int h) { ENSURE_INITIALIZED; - Q_ASSERT(m_pixmapdata_with_gl_texture); - return QPixmap(m_pixmapdata_with_gl_texture(w, h)); + Q_ASSERT(qt_meego_pixmapdata_with_gl_texture); + return QPixmap(qt_meego_pixmapdata_with_gl_texture(w, h)); } -bool MRuntime::destroyEGLSharedImage(Qt::HANDLE handle) +bool QMeeGoRuntime::destroyEGLSharedImage(Qt::HANDLE handle) { ENSURE_INITIALIZED; - Q_ASSERT(m_destroy_egl_shared_image); - return m_destroy_egl_shared_image(handle); + Q_ASSERT(qt_meego_destroy_egl_shared_image); + return qt_meego_destroy_egl_shared_image(handle); } -void MRuntime::updateEGLSharedImagePixmap(QPixmap *p) +void QMeeGoRuntime::updateEGLSharedImagePixmap(QPixmap *p) { ENSURE_INITIALIZED; - Q_ASSERT(m_update_egl_shared_image_pixmap); - return m_update_egl_shared_image_pixmap(p); + Q_ASSERT(qt_meego_update_egl_shared_image_pixmap); + return qt_meego_update_egl_shared_image_pixmap(p); } -void MRuntime::setSurfaceFixedSize(int w, int h) +void QMeeGoRuntime::setSurfaceFixedSize(int w, int h) { ENSURE_INITIALIZED; - Q_ASSERT(m_set_surface_fixed_size); - m_set_surface_fixed_size(w, h); + Q_ASSERT(qt_meego_set_surface_fixed_size); + qt_meego_set_surface_fixed_size(w, h); } -void MRuntime::setSurfaceScaling(int x, int y, int w, int h) +void QMeeGoRuntime::setSurfaceScaling(int x, int y, int w, int h) { ENSURE_INITIALIZED; - Q_ASSERT(m_set_surface_scaling); - m_set_surface_scaling(x, y, w, h); + Q_ASSERT(qt_meego_set_surface_scaling); + qt_meego_set_surface_scaling(x, y, w, h); } -void MRuntime::setTranslucent(bool translucent) +void QMeeGoRuntime::setTranslucent(bool translucent) { ENSURE_INITIALIZED; - Q_ASSERT(m_set_translucent); - m_set_translucent(translucent); + Q_ASSERT(qt_meego_set_translucent); + qt_meego_set_translucent(translucent); } diff --git a/tools/qmeegographicssystemhelper/qmeegoruntime.h b/tools/qmeegographicssystemhelper/qmeegoruntime.h index 34474cc..7840626 100644 --- a/tools/qmeegographicssystemhelper/qmeegoruntime.h +++ b/tools/qmeegographicssystemhelper/qmeegoruntime.h @@ -16,7 +16,7 @@ #include <QPixmap> #include <QImage> -class MRuntime +class QMeeGoRuntime { public: static void initialize(); @@ -33,4 +33,4 @@ public: private: static bool initialized; static QLibrary *library; -};
\ No newline at end of file +}; diff --git a/tools/tools.pro b/tools/tools.pro index f254230..8f23fe4 100644 --- a/tools/tools.pro +++ b/tools/tools.pro @@ -43,3 +43,7 @@ embedded: SUBDIRS += makeqpf CONFIG+=ordered QTDIR_build:REQUIRES = "contains(QT_CONFIG, full-config)" + +!win32:!embedded:!mac:!symbian:CONFIG += x11 + +x11:contains(QT_CONFIG, opengles2):contains(QT_CONFIG, egl):SUBDIRS += qmeegographicssystemhelper |