Flow Visualization 1.0
|
00001 /**************************************************************************** 00002 ** 00003 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 00004 ** Contact: Qt Software Information (qt-info@nokia.com) 00005 ** 00006 ** This file is part of the QtGui module of the Qt Toolkit. 00007 ** 00008 ** $QT_BEGIN_LICENSE:LGPL$ 00009 ** Commercial Usage 00010 ** Licensees holding valid Qt Commercial licenses may use this file in 00011 ** accordance with the Qt Commercial License Agreement provided with the 00012 ** Software or, alternatively, in accordance with the terms contained in 00013 ** a written agreement between you and Nokia. 00014 ** 00015 ** GNU Lesser General Public License Usage 00016 ** Alternatively, this file may be used under the terms of the GNU Lesser 00017 ** General Public License version 2.1 as published by the Free Software 00018 ** Foundation and appearing in the file LICENSE.LGPL included in the 00019 ** packaging of this file. Please review the following information to 00020 ** ensure the GNU Lesser General Public License version 2.1 requirements 00021 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 00022 ** 00023 ** In addition, as a special exception, Nokia gives you certain 00024 ** additional rights. These rights are described in the Nokia Qt LGPL 00025 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 00026 ** package. 00027 ** 00028 ** GNU General Public License Usage 00029 ** Alternatively, this file may be used under the terms of the GNU 00030 ** General Public License version 3.0 as published by the Free Software 00031 ** Foundation and appearing in the file LICENSE.GPL included in the 00032 ** packaging of this file. Please review the following information to 00033 ** ensure the GNU General Public License version 3.0 requirements will be 00034 ** met: http://www.gnu.org/copyleft/gpl.html. 00035 ** 00036 ** If you are unsure which license is appropriate for your use, please 00037 ** contact the sales department at qt-sales@nokia.com. 00038 ** $QT_END_LICENSE$ 00039 ** 00040 ****************************************************************************/ 00041 00042 #ifndef QPIXMAPDATA_P_H 00043 #define QPIXMAPDATA_P_H 00044 00045 // 00046 // W A R N I N G 00047 // ------------- 00048 // 00049 // This file is not part of the Qt API. It exists purely as an 00050 // implementation detail. This header file may change from version to 00051 // version without notice, or even be removed. 00052 // 00053 // We mean it. 00054 // 00055 00056 #include <QtGui/qpixmap.h> 00057 #include <QtCore/qatomic.h> 00058 00059 QT_BEGIN_NAMESPACE 00060 00061 class Q_GUI_EXPORT QPixmapData 00062 { 00063 public: 00064 enum PixelType { 00065 // WARNING: Do not change the first two 00066 // Must match QPixmap::Type 00067 PixmapType, BitmapType 00068 }; 00069 enum ClassId { RasterClass, X11Class, MacClass, DirectFBClass, 00070 OpenGLClass, OpenVGClass, CustomClass = 1024 }; 00071 00072 QPixmapData(PixelType pixelpType, int classId); 00073 virtual ~QPixmapData(); 00074 00075 virtual void resize(int width, int height) = 0; 00076 virtual void fromImage(const QImage &image, 00077 Qt::ImageConversionFlags flags) = 0; 00078 virtual void fromFile(const QString &filename, const char *format, 00079 Qt::ImageConversionFlags flags); 00080 virtual void copy(const QPixmapData *data, const QRect &rect); 00081 00082 virtual int metric(QPaintDevice::PaintDeviceMetric metric) const = 0; 00083 virtual void fill(const QColor &color) = 0; 00084 virtual QBitmap mask() const; 00085 virtual void setMask(const QBitmap &mask); 00086 virtual bool hasAlphaChannel() const = 0; 00087 virtual QPixmap transformed(const QTransform &matrix, 00088 Qt::TransformationMode mode) const; 00089 virtual void setAlphaChannel(const QPixmap &alphaChannel); 00090 virtual QPixmap alphaChannel() const; 00091 virtual QImage toImage() const = 0; 00092 virtual QPaintEngine* paintEngine() const = 0; 00093 00094 inline int serialNumber() const { return ser_no; } 00095 00096 inline PixelType pixelType() const { return type; } 00097 inline ClassId classId() const { return static_cast<ClassId>(id); } 00098 00099 virtual QImage* buffer(); 00100 00101 int width() const { return metric(QPaintDevice::PdmWidth); } 00102 int height() const { return metric(QPaintDevice::PdmHeight); } 00103 int numColors() const { return metric(QPaintDevice::PdmNumColors); } 00104 int depth() const { return metric(QPaintDevice::PdmDepth); } 00105 00106 protected: 00107 void setSerialNumber(int serNo); 00108 00109 private: 00110 friend class QPixmap; 00111 friend class QGLContextPrivate; 00112 friend class QX11PixmapData; 00113 00114 QAtomicInt ref; 00115 int detach_no; 00116 00117 PixelType type; 00118 int id; 00119 int ser_no; 00120 uint is_cached; 00121 }; 00122 00123 #ifdef Q_WS_WIN 00124 #ifndef Q_OS_WINCE 00125 QPixmap convertHIconToPixmap( const HICON icon); 00126 #else 00127 QPixmap convertHIconToPixmap( const HICON icon, bool large = false); 00128 #endif 00129 QPixmap loadIconFromShell32( int resourceId, int size ); 00130 #endif 00131 00132 # define QT_XFORM_TYPE_MSBFIRST 0 00133 # define QT_XFORM_TYPE_LSBFIRST 1 00134 # if defined(Q_WS_WIN) 00135 # define QT_XFORM_TYPE_WINDOWSPIXMAP 2 00136 # endif 00137 extern bool qt_xForm_helper(const QTransform&, int, int, int, uchar*, int, int, int, const uchar*, int, int, int); 00138 00139 QT_END_NAMESPACE 00140 00141 #endif // QPIXMAPDATA_P_H