summaryrefslogtreecommitdiffstats
path: root/src/gui/image/qpixmap_s60_p.h
diff options
context:
space:
mode:
authorJani Hautakangas <ext-jani.hautakangas@nokia.com>2009-09-18 14:33:10 +0300
committerJani Hautakangas <ext-jani.hautakangas@nokia.com>2009-09-18 14:33:10 +0300
commitc78dabc55943b76479f7a84bae146f52cbc7bbbf (patch)
tree5ea4392cf14c1126c82603b9ee614c384f28bd9e /src/gui/image/qpixmap_s60_p.h
parent6454aca1b273daa2e54a77f83e1f6d4bae83427d (diff)
Introduce native Symbian bitmap support to QPixmap
This is done to reduce heap consumption and to give a possibility to share bitmaps across process. QPixmap maps to Symbian CFbsBitmap which is stored in Symbian font and bitmap server. Reviewed-by: Jason Barron
Diffstat (limited to 'src/gui/image/qpixmap_s60_p.h')
-rw-r--r--src/gui/image/qpixmap_s60_p.h97
1 files changed, 97 insertions, 0 deletions
diff --git a/src/gui/image/qpixmap_s60_p.h b/src/gui/image/qpixmap_s60_p.h
new file mode 100644
index 0000000000..b56b27041e
--- /dev/null
+++ b/src/gui/image/qpixmap_s60_p.h
@@ -0,0 +1,97 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QPIXMAPDATA_S60_P_H
+#define QPIXMAPDATA_S60_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtGui/private/qpixmap_raster_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class CFbsBitmap;
+class CFbsBitmapDevice;
+class CBitmapContext;
+
+class QSymbianBitmapDataAccess;
+
+class QSymbianFbsHeapLock
+{
+public:
+
+ enum LockAction {
+ Unlock
+ };
+
+ explicit QSymbianFbsHeapLock(LockAction a);
+ ~QSymbianFbsHeapLock();
+ void relock();
+
+private:
+
+ LockAction action;
+ bool wasLocked;
+};
+
+class QS60PixmapData : public QRasterPixmapData
+{
+public:
+ QS60PixmapData(PixelType type);
+ ~QS60PixmapData();
+
+ void resize(int width, int height);
+ void fromImage(const QImage &image, Qt::ImageConversionFlags flags);
+ void copy(const QPixmapData *data, const QRect &rect);
+ bool scroll(int dx, int dy, const QRect &rect);
+
+ int metric(QPaintDevice::PaintDeviceMetric metric) const;
+ void fill(const QColor &color);
+ void setMask(const QBitmap &mask);
+ void setAlphaChannel(const QPixmap &alphaChannel);
+ QImage toImage() const;
+ QPaintEngine* paintEngine() const;
+
+ void beginDataAccess();
+ void endDataAccess(bool readOnly=false) const;
+
+private:
+ void release();
+ void fromSymbianBitmap(CFbsBitmap* bitmap);
+ bool initSymbianBitmapContext();
+
+ QSymbianBitmapDataAccess *symbianBitmapDataAccess;
+
+ CFbsBitmap *cfbsBitmap;
+ CFbsBitmapDevice *bitmapDevice;
+ CBitmapContext *bitmapContext;
+ QPaintEngine *pengine;
+ uchar* bytes;
+
+ friend class QPixmap;
+ friend class QS60WindowSurface;
+ friend class QS60PaintEngine;
+ friend class QS60Data;
+};
+
+QT_END_NAMESPACE
+
+#endif // QPIXMAPDATA_S60_P_H
+