git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/dependencies/tqtinterface@1158880 283d02a7-25f6-0310-bc7c-ecb5cbfe19dav3.5.13-sru
parent
4c3c7eaa2d
commit
c9dc390776
@ -0,0 +1,75 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
||||||
|
** All rights reserved.
|
||||||
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||||
|
**
|
||||||
|
** This file is part of the Qt3Support module of the Qt Toolkit.
|
||||||
|
**
|
||||||
|
** $QT_BEGIN_LICENSE:LGPL$
|
||||||
|
** Commercial Usage
|
||||||
|
** Licensees holding valid Qt Commercial licenses may use this file in
|
||||||
|
** accordance with the Qt Commercial License Agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and Nokia.
|
||||||
|
**
|
||||||
|
** 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.1, 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 have questions regarding the use of this file, please contact
|
||||||
|
** Nokia at qt-info@nokia.com.
|
||||||
|
** $QT_END_LICENSE$
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Q3POINTARRAY_H
|
||||||
|
#define Q3POINTARRAY_H
|
||||||
|
|
||||||
|
#include <QtGui/qpolygon.h>
|
||||||
|
|
||||||
|
QT_BEGIN_HEADER
|
||||||
|
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
QT_MODULE(Qt3SupportLight)
|
||||||
|
|
||||||
|
class Q_COMPAT_EXPORT Q3PointArray : public QPolygon
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
inline Q3PointArray() : QPolygon() {}
|
||||||
|
inline Q3PointArray(const QRect &r, bool closed=false) : QPolygon(r, closed) {}
|
||||||
|
inline Q3PointArray(const QPolygon& a) : QPolygon(a) {}
|
||||||
|
Q3PointArray( int nPoints, const QCOORD *points );
|
||||||
|
|
||||||
|
inline Q3PointArray copy() const { return *this; }
|
||||||
|
inline bool isNull() { return isEmpty(); }
|
||||||
|
void makeEllipse(int x, int y, int w, int h);
|
||||||
|
#ifndef QT_NO_WMATRIX
|
||||||
|
void makeArc(int x, int y, int w, int h, int a1, int a2);
|
||||||
|
void makeArc(int x, int y, int w, int h, int a1, int a2, const QMatrix &matrix);
|
||||||
|
#endif
|
||||||
|
Q3PointArray cubicBezier() const;
|
||||||
|
};
|
||||||
|
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
|
QT_END_HEADER
|
||||||
|
|
||||||
|
#endif // Q3POINTARRAY_H
|
@ -0,0 +1,362 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
||||||
|
** All rights reserved.
|
||||||
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||||
|
**
|
||||||
|
** This file is part of the QtGui module of the Qt Toolkit.
|
||||||
|
**
|
||||||
|
** $QT_BEGIN_LICENSE:LGPL$
|
||||||
|
** Commercial Usage
|
||||||
|
** Licensees holding valid Qt Commercial licenses may use this file in
|
||||||
|
** accordance with the Qt Commercial License Agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and Nokia.
|
||||||
|
**
|
||||||
|
** 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.1, 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 have questions regarding the use of this file, please contact
|
||||||
|
** Nokia at qt-info@nokia.com.
|
||||||
|
** $QT_END_LICENSE$
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef QIMAGE_H
|
||||||
|
#define QIMAGE_H
|
||||||
|
|
||||||
|
#include <QtGui/qtransform.h>
|
||||||
|
#include <QtGui/qpaintdevice.h>
|
||||||
|
#include <QtGui/qrgb.h>
|
||||||
|
#include <QtCore/qbytearray.h>
|
||||||
|
#include <QtCore/qrect.h>
|
||||||
|
#include <QtCore/qstring.h>
|
||||||
|
|
||||||
|
QT_BEGIN_HEADER
|
||||||
|
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
QT_MODULE(Gui)
|
||||||
|
|
||||||
|
class QIODevice;
|
||||||
|
class QStringList;
|
||||||
|
class QMatrix;
|
||||||
|
class QTransform;
|
||||||
|
class QVariant;
|
||||||
|
template <class T> class QList;
|
||||||
|
template <class T> class QVector;
|
||||||
|
|
||||||
|
struct QImageData;
|
||||||
|
class QImageDataMisc; // internal
|
||||||
|
#ifndef QT_NO_IMAGE_TEXT
|
||||||
|
class Q_GUI_EXPORT QImageTextKeyLang {
|
||||||
|
public:
|
||||||
|
QImageTextKeyLang(const char* k, const char* l) : key(k), lang(l) { }
|
||||||
|
QImageTextKeyLang() { }
|
||||||
|
|
||||||
|
QByteArray key;
|
||||||
|
QByteArray lang;
|
||||||
|
|
||||||
|
bool operator< (const QImageTextKeyLang& other) const
|
||||||
|
{ return key < other.key || (key==other.key && lang < other.lang); }
|
||||||
|
bool operator== (const QImageTextKeyLang& other) const
|
||||||
|
{ return key==other.key && lang==other.lang; }
|
||||||
|
inline bool operator!= (const QImageTextKeyLang &other) const
|
||||||
|
{ return !operator==(other); }
|
||||||
|
};
|
||||||
|
#endif //QT_NO_IMAGE_TEXT
|
||||||
|
|
||||||
|
|
||||||
|
class Q_GUI_EXPORT QImage : public QPaintDevice
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
enum InvertMode { InvertRgb, InvertRgba };
|
||||||
|
enum Format {
|
||||||
|
Format_Invalid,
|
||||||
|
Format_Mono,
|
||||||
|
Format_MonoLSB,
|
||||||
|
Format_Indexed8,
|
||||||
|
Format_RGB32,
|
||||||
|
Format_ARGB32,
|
||||||
|
Format_ARGB32_Premultiplied,
|
||||||
|
Format_RGB16,
|
||||||
|
Format_ARGB8565_Premultiplied,
|
||||||
|
Format_RGB666,
|
||||||
|
Format_ARGB6666_Premultiplied,
|
||||||
|
Format_RGB555,
|
||||||
|
Format_ARGB8555_Premultiplied,
|
||||||
|
Format_RGB888,
|
||||||
|
Format_RGB444,
|
||||||
|
Format_ARGB4444_Premultiplied,
|
||||||
|
#if 0
|
||||||
|
// reserved for future use
|
||||||
|
Format_RGB15,
|
||||||
|
Format_Grayscale16,
|
||||||
|
Format_Grayscale8,
|
||||||
|
Format_Grayscale4,
|
||||||
|
Format_Grayscale4LSB,
|
||||||
|
Format_Grayscale2,
|
||||||
|
Format_Grayscale2LSB
|
||||||
|
#endif
|
||||||
|
#ifndef qdoc
|
||||||
|
NImageFormats
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
QImage();
|
||||||
|
QImage(const QSize &size, Format format);
|
||||||
|
QImage(int width, int height, Format format);
|
||||||
|
QImage(uchar *data, int width, int height, Format format);
|
||||||
|
QImage(const uchar *data, int width, int height, Format format);
|
||||||
|
QImage(uchar *data, int width, int height, int bytesPerLine, Format format);
|
||||||
|
QImage(const uchar *data, int width, int height, int bytesPerLine, Format format);
|
||||||
|
|
||||||
|
#ifndef QT_NO_IMAGEFORMAT_XPM
|
||||||
|
explicit QImage(const char * const xpm[]);
|
||||||
|
#endif
|
||||||
|
explicit QImage(const QString &fileName, const char *format = 0);
|
||||||
|
#ifndef QT_NO_CAST_FROM_ASCII
|
||||||
|
explicit QImage(const char *fileName, const char *format = 0);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
QImage(const QImage &);
|
||||||
|
~QImage();
|
||||||
|
|
||||||
|
QImage &operator=(const QImage &);
|
||||||
|
bool isNull() const;
|
||||||
|
|
||||||
|
int devType() const;
|
||||||
|
|
||||||
|
bool operator==(const QImage &) const;
|
||||||
|
bool operator!=(const QImage &) const;
|
||||||
|
operator QVariant() const;
|
||||||
|
void detach();
|
||||||
|
bool isDetached() const;
|
||||||
|
|
||||||
|
QImage copy(const QRect &rect = QRect()) const;
|
||||||
|
inline QImage copy(int x, int y, int w, int h) const
|
||||||
|
{ return copy(QRect(x, y, w, h)); }
|
||||||
|
|
||||||
|
Format format() const;
|
||||||
|
|
||||||
|
QImage convertToFormat(Format f, Qt::ImageConversionFlags flags = Qt::AutoColor) const Q_REQUIRED_RESULT;
|
||||||
|
QImage convertToFormat(Format f, const QVector<QRgb> &colorTable, Qt::ImageConversionFlags flags = Qt::AutoColor) const Q_REQUIRED_RESULT;
|
||||||
|
|
||||||
|
int width() const;
|
||||||
|
int height() const;
|
||||||
|
QSize size() const;
|
||||||
|
QRect rect() const;
|
||||||
|
|
||||||
|
int depth() const;
|
||||||
|
#ifdef QT_DEPRECATED
|
||||||
|
QT_DEPRECATED int numColors() const;
|
||||||
|
#endif
|
||||||
|
int colorCount() const;
|
||||||
|
|
||||||
|
QRgb color(int i) const;
|
||||||
|
void setColor(int i, QRgb c);
|
||||||
|
#ifdef QT_DEPRECATED
|
||||||
|
QT_DEPRECATED void setNumColors(int);
|
||||||
|
#endif
|
||||||
|
void setColorCount(int);
|
||||||
|
|
||||||
|
bool allGray() const;
|
||||||
|
bool isGrayscale() const;
|
||||||
|
|
||||||
|
uchar *bits();
|
||||||
|
const uchar *bits() const;
|
||||||
|
#ifdef QT_DEPRECATED
|
||||||
|
QT_DEPRECATED int numBytes() const;
|
||||||
|
#endif
|
||||||
|
int byteCount() const;
|
||||||
|
|
||||||
|
uchar *scanLine(int);
|
||||||
|
uchar *scanLine(int) const;
|
||||||
|
int bytesPerLine() const;
|
||||||
|
|
||||||
|
bool valid(int x, int y) const;
|
||||||
|
bool valid(const QPoint &pt) const;
|
||||||
|
|
||||||
|
int pixelIndex(int x, int y) const;
|
||||||
|
int pixelIndex(const QPoint &pt) const;
|
||||||
|
|
||||||
|
QRgb pixel(int x, int y) const;
|
||||||
|
QRgb pixel(const QPoint &pt) const;
|
||||||
|
|
||||||
|
void setPixel(int x, int y, uint index_or_rgb);
|
||||||
|
void setPixel(const QPoint &pt, uint index_or_rgb);
|
||||||
|
|
||||||
|
QVector<QRgb> colorTable() const;
|
||||||
|
QRgb *ptrColorTable() const;
|
||||||
|
void setColorTable(const QVector<QRgb> colors);
|
||||||
|
|
||||||
|
void fill(uint pixel);
|
||||||
|
|
||||||
|
bool hasAlphaChannel() const;
|
||||||
|
void setAlphaChannel(const QImage &alphaChannel);
|
||||||
|
QImage alphaChannel() const;
|
||||||
|
QImage createAlphaMask(Qt::ImageConversionFlags flags = Qt::AutoColor) const;
|
||||||
|
#ifndef QT_NO_IMAGE_HEURISTIC_MASK
|
||||||
|
QImage createHeuristicMask(bool clipTight = true) const;
|
||||||
|
#endif
|
||||||
|
QImage createMaskFromColor(QRgb color, Qt::MaskMode mode = Qt::MaskInColor) const;
|
||||||
|
|
||||||
|
inline QImage scaled(int w, int h, Qt::AspectRatioMode aspectMode = Qt::IgnoreAspectRatio,
|
||||||
|
Qt::TransformationMode mode = Qt::FastTransformation) const
|
||||||
|
{ return scaled(QSize(w, h), aspectMode, mode); }
|
||||||
|
QImage scaled(const QSize &s, Qt::AspectRatioMode aspectMode = Qt::IgnoreAspectRatio,
|
||||||
|
Qt::TransformationMode mode = Qt::FastTransformation) const;
|
||||||
|
QImage scaledToWidth(int w, Qt::TransformationMode mode = Qt::FastTransformation) const;
|
||||||
|
QImage scaledToHeight(int h, Qt::TransformationMode mode = Qt::FastTransformation) const;
|
||||||
|
QImage transformed(const QMatrix &matrix, Qt::TransformationMode mode = Qt::FastTransformation) const;
|
||||||
|
static QMatrix trueMatrix(const QMatrix &, int w, int h);
|
||||||
|
QImage transformed(const QTransform &matrix, Qt::TransformationMode mode = Qt::FastTransformation) const;
|
||||||
|
static QTransform trueMatrix(const QTransform &, int w, int h);
|
||||||
|
QImage mirrored(bool horizontally = false, bool vertically = true) const;
|
||||||
|
QImage rgbSwapped() const;
|
||||||
|
void invertPixels(InvertMode = InvertRgb);
|
||||||
|
|
||||||
|
|
||||||
|
bool load(QIODevice *device, const char* format);
|
||||||
|
bool load(const QString &fileName, const char* format=0);
|
||||||
|
bool loadFromData(const uchar *buf, int len, const char *format = 0);
|
||||||
|
inline bool loadFromData(const QByteArray &data, const char* aformat=0)
|
||||||
|
{ return loadFromData(reinterpret_cast<const uchar *>(data.constData()), data.size(), aformat); }
|
||||||
|
|
||||||
|
bool save(const QString &fileName, const char* format=0, int quality=-1) const;
|
||||||
|
bool save(QIODevice *device, const char* format=0, int quality=-1) const;
|
||||||
|
|
||||||
|
static QImage fromData(const uchar *data, int size, const char *format = 0);
|
||||||
|
inline static QImage fromData(const QByteArray &data, const char *format = 0)
|
||||||
|
{ return fromData(reinterpret_cast<const uchar *>(data.constData()), data.size(), format); }
|
||||||
|
|
||||||
|
int serialNumber() const;
|
||||||
|
qint64 cacheKey() const;
|
||||||
|
|
||||||
|
QPaintEngine *paintEngine() const;
|
||||||
|
|
||||||
|
// Auxiliary data
|
||||||
|
int dotsPerMeterX() const;
|
||||||
|
int dotsPerMeterY() const;
|
||||||
|
void setDotsPerMeterX(int);
|
||||||
|
void setDotsPerMeterY(int);
|
||||||
|
QPoint offset() const;
|
||||||
|
void setOffset(const QPoint&);
|
||||||
|
#ifndef QT_NO_IMAGE_TEXT
|
||||||
|
QStringList textKeys() const;
|
||||||
|
QString text(const QString &key = QString()) const;
|
||||||
|
void setText(const QString &key, const QString &value);
|
||||||
|
|
||||||
|
// The following functions are obsolete as of 4.1
|
||||||
|
QString text(const char* key, const char* lang=0) const;
|
||||||
|
QList<QImageTextKeyLang> textList() const;
|
||||||
|
QStringList textLanguages() const;
|
||||||
|
QString text(const QImageTextKeyLang&) const;
|
||||||
|
void setText(const char* key, const char* lang, const QString&);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef QT3_SUPPORT
|
||||||
|
enum Endian { BigEndian, LittleEndian, IgnoreEndian };
|
||||||
|
QT3_SUPPORT_CONSTRUCTOR QImage(int width, int height, int depth, int numColors=0, Endian bitOrder=IgnoreEndian);
|
||||||
|
QT3_SUPPORT_CONSTRUCTOR QImage(const QSize&, int depth, int numColors=0, Endian bitOrder=IgnoreEndian);
|
||||||
|
QT3_SUPPORT_CONSTRUCTOR QImage(uchar *data, int w, int h, int depth, const QRgb *colortable, int numColors, Endian bitOrder);
|
||||||
|
#ifdef Q_WS_QWS
|
||||||
|
QT3_SUPPORT_CONSTRUCTOR QImage(uchar *data, int w, int h, int depth, int pbl, const QRgb *colortable, int numColors, Endian bitOrder);
|
||||||
|
#endif
|
||||||
|
inline QT3_SUPPORT Endian bitOrder() const {
|
||||||
|
Format f = format();
|
||||||
|
return f == Format_Mono ? BigEndian : (f == Format_MonoLSB ? LittleEndian : IgnoreEndian);
|
||||||
|
}
|
||||||
|
QT3_SUPPORT QImage convertDepth(int, Qt::ImageConversionFlags flags = Qt::AutoColor) const;
|
||||||
|
QT3_SUPPORT QImage convertDepthWithPalette(int, QRgb* p, int pc, Qt::ImageConversionFlags flags = Qt::AutoColor) const;
|
||||||
|
QT3_SUPPORT QImage convertBitOrder(Endian) const;
|
||||||
|
QT3_SUPPORT bool hasAlphaBuffer() const;
|
||||||
|
QT3_SUPPORT void setAlphaBuffer(bool);
|
||||||
|
QT3_SUPPORT uchar **jumpTable();
|
||||||
|
QT3_SUPPORT const uchar * const *jumpTable() const;
|
||||||
|
inline QT3_SUPPORT void reset() { *this = QImage(); }
|
||||||
|
static inline QT3_SUPPORT Endian systemByteOrder()
|
||||||
|
{ return QSysInfo::ByteOrder == QSysInfo::BigEndian ? BigEndian : LittleEndian; }
|
||||||
|
inline QT3_SUPPORT QImage swapRGB() const { return rgbSwapped(); }
|
||||||
|
inline QT3_SUPPORT QImage mirror(bool horizontally = false, bool vertically = true) const
|
||||||
|
{ return mirrored(horizontally, vertically); }
|
||||||
|
QT3_SUPPORT bool create(const QSize&, int depth, int numColors=0, Endian bitOrder=IgnoreEndian);
|
||||||
|
QT3_SUPPORT bool create(int width, int height, int depth, int numColors=0, Endian bitOrder=IgnoreEndian);
|
||||||
|
inline QT3_SUPPORT QImage xForm(const QMatrix &matrix) const { return transformed(QTransform(matrix)); }
|
||||||
|
inline QT3_SUPPORT QImage smoothScale(int w, int h, Qt::AspectRatioMode mode = Qt::IgnoreAspectRatio) const
|
||||||
|
{ return scaled(QSize(w, h), mode, Qt::SmoothTransformation); }
|
||||||
|
inline QImage QT3_SUPPORT smoothScale(const QSize &s, Qt::AspectRatioMode mode = Qt::IgnoreAspectRatio) const
|
||||||
|
{ return scaled(s, mode, Qt::SmoothTransformation); }
|
||||||
|
inline QT3_SUPPORT QImage scaleWidth(int w) const { return scaledToWidth(w); }
|
||||||
|
inline QT3_SUPPORT QImage scaleHeight(int h) const { return scaledToHeight(h); }
|
||||||
|
inline QT3_SUPPORT void invertPixels(bool invertAlpha) { invertAlpha ? invertPixels(InvertRgba) : invertPixels(InvertRgb); }
|
||||||
|
inline QT3_SUPPORT QImage copy(int x, int y, int w, int h, Qt::ImageConversionFlags) const
|
||||||
|
{ return copy(QRect(x, y, w, h)); }
|
||||||
|
inline QT3_SUPPORT QImage copy(const QRect &rect, Qt::ImageConversionFlags) const
|
||||||
|
{ return copy(rect); }
|
||||||
|
static QT3_SUPPORT Endian systemBitOrder();
|
||||||
|
inline QT3_SUPPORT_CONSTRUCTOR QImage(const QByteArray &data)
|
||||||
|
{ d = 0; *this = QImage::fromData(data); }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual int metric(PaintDeviceMetric metric) const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
friend class QWSOnScreenSurface;
|
||||||
|
QImageData *d;
|
||||||
|
|
||||||
|
friend class QRasterPixmapData;
|
||||||
|
friend class QPixmapCacheEntry;
|
||||||
|
friend Q_GUI_EXPORT qint64 qt_image_id(const QImage &image);
|
||||||
|
friend const QVector<QRgb> *qt_image_colortable(const QImage &image);
|
||||||
|
|
||||||
|
public:
|
||||||
|
typedef QImageData * DataPtr;
|
||||||
|
inline DataPtr &data_ptr() { return d; }
|
||||||
|
};
|
||||||
|
|
||||||
|
Q_DECLARE_SHARED(QImage)
|
||||||
|
Q_DECLARE_TYPEINFO(QImage, Q_MOVABLE_TYPE);
|
||||||
|
|
||||||
|
// Inline functions...
|
||||||
|
|
||||||
|
Q_GUI_EXPORT_INLINE bool QImage::valid(const QPoint &pt) const { return valid(pt.x(), pt.y()); }
|
||||||
|
Q_GUI_EXPORT_INLINE int QImage::pixelIndex(const QPoint &pt) const { return pixelIndex(pt.x(), pt.y());}
|
||||||
|
Q_GUI_EXPORT_INLINE QRgb QImage::pixel(const QPoint &pt) const { return pixel(pt.x(), pt.y()); }
|
||||||
|
Q_GUI_EXPORT_INLINE void QImage::setPixel(const QPoint &pt, uint index_or_rgb) { setPixel(pt.x(), pt.y(), index_or_rgb); }
|
||||||
|
|
||||||
|
// QImage stream functions
|
||||||
|
|
||||||
|
#if !defined(QT_NO_DATASTREAM)
|
||||||
|
Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QImage &);
|
||||||
|
Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QImage &);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef QT3_SUPPORT
|
||||||
|
Q_GUI_EXPORT QT3_SUPPORT void bitBlt(QImage* dst, int dx, int dy, const QImage* src,
|
||||||
|
int sx=0, int sy=0, int sw=-1, int sh=-1, Qt::ImageConversionFlags flags = Qt::AutoColor);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
|
QT_END_HEADER
|
||||||
|
|
||||||
|
#endif // QIMAGE_H
|
@ -0,0 +1,240 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
||||||
|
** All rights reserved.
|
||||||
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||||
|
**
|
||||||
|
** This file is part of the QtCore module of the Qt Toolkit.
|
||||||
|
**
|
||||||
|
** $QT_BEGIN_LICENSE:LGPL$
|
||||||
|
** Commercial Usage
|
||||||
|
** Licensees holding valid Qt Commercial licenses may use this file in
|
||||||
|
** accordance with the Qt Commercial License Agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and Nokia.
|
||||||
|
**
|
||||||
|
** 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.1, 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 have questions regarding the use of this file, please contact
|
||||||
|
** Nokia at qt-info@nokia.com.
|
||||||
|
** $QT_END_LICENSE$
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef QMETAOBJECT_H
|
||||||
|
#define QMETAOBJECT_H
|
||||||
|
|
||||||
|
#include <QtCore/qobjectdefs.h>
|
||||||
|
#include <QtCore/qvariant.h>
|
||||||
|
|
||||||
|
QT_BEGIN_HEADER
|
||||||
|
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
QT_MODULE(Core)
|
||||||
|
|
||||||
|
template <typename T> class QList;
|
||||||
|
|
||||||
|
class Q_CORE_EXPORT QMetaMethod
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
inline QMetaMethod() : mobj(0),handle(0) {}
|
||||||
|
|
||||||
|
const char *signature() const;
|
||||||
|
const char *typeName() const;
|
||||||
|
QList<QByteArray> parameterTypes() const;
|
||||||
|
QList<QByteArray> parameterNames() const;
|
||||||
|
const char *tag() const;
|
||||||
|
enum Access { Private, Protected, Public };
|
||||||
|
Access access() const;
|
||||||
|
enum MethodType { Method, Signal, Slot, Constructor };
|
||||||
|
MethodType methodType() const;
|
||||||
|
enum Attributes { Compatibility = 0x1, Cloned = 0x2, Scriptable = 0x4 };
|
||||||
|
int attributes() const;
|
||||||
|
int methodIndex() const;
|
||||||
|
|
||||||
|
inline const QMetaObject *enclosingMetaObject() const { return mobj; }
|
||||||
|
|
||||||
|
bool invoke(QObject *object,
|
||||||
|
Qt::ConnectionType connectionType,
|
||||||
|
QGenericReturnArgument returnValue,
|
||||||
|
QGenericArgument val0 = QGenericArgument(0),
|
||||||
|
QGenericArgument val1 = QGenericArgument(),
|
||||||
|
QGenericArgument val2 = QGenericArgument(),
|
||||||
|
QGenericArgument val3 = QGenericArgument(),
|
||||||
|
QGenericArgument val4 = QGenericArgument(),
|
||||||
|
QGenericArgument val5 = QGenericArgument(),
|
||||||
|
QGenericArgument val6 = QGenericArgument(),
|
||||||
|
QGenericArgument val7 = QGenericArgument(),
|
||||||
|
QGenericArgument val8 = QGenericArgument(),
|
||||||
|
QGenericArgument val9 = QGenericArgument()) const;
|
||||||
|
inline bool invoke(QObject *object,
|
||||||
|
QGenericReturnArgument returnValue,
|
||||||
|
QGenericArgument val0 = QGenericArgument(0),
|
||||||
|
QGenericArgument val1 = QGenericArgument(),
|
||||||
|
QGenericArgument val2 = QGenericArgument(),
|
||||||
|
QGenericArgument val3 = QGenericArgument(),
|
||||||
|
QGenericArgument val4 = QGenericArgument(),
|
||||||
|
QGenericArgument val5 = QGenericArgument(),
|
||||||
|
QGenericArgument val6 = QGenericArgument(),
|
||||||
|
QGenericArgument val7 = QGenericArgument(),
|
||||||
|
QGenericArgument val8 = QGenericArgument(),
|
||||||
|
QGenericArgument val9 = QGenericArgument()) const
|
||||||
|
{
|
||||||
|
return invoke(object, Qt::AutoConnection, returnValue,
|
||||||
|
val0, val1, val2, val3, val4, val5, val6, val7, val8, val9);
|
||||||
|
}
|
||||||
|
inline bool invoke(QObject *object,
|
||||||
|
Qt::ConnectionType connectionType,
|
||||||
|
QGenericArgument val0 = QGenericArgument(0),
|
||||||
|
QGenericArgument val1 = QGenericArgument(),
|
||||||
|
QGenericArgument val2 = QGenericArgument(),
|
||||||
|
QGenericArgument val3 = QGenericArgument(),
|
||||||
|
QGenericArgument val4 = QGenericArgument(),
|
||||||
|
QGenericArgument val5 = QGenericArgument(),
|
||||||
|
QGenericArgument val6 = QGenericArgument(),
|
||||||
|
QGenericArgument val7 = QGenericArgument(),
|
||||||
|
QGenericArgument val8 = QGenericArgument(),
|
||||||
|
QGenericArgument val9 = QGenericArgument()) const
|
||||||
|
{
|
||||||
|
return invoke(object, connectionType, QGenericReturnArgument(),
|
||||||
|
val0, val1, val2, val3, val4, val5, val6, val7, val8, val9);
|
||||||
|
}
|
||||||
|
inline bool invoke(QObject *object,
|
||||||
|
QGenericArgument val0 = QGenericArgument(0),
|
||||||
|
QGenericArgument val1 = QGenericArgument(),
|
||||||
|
QGenericArgument val2 = QGenericArgument(),
|
||||||
|
QGenericArgument val3 = QGenericArgument(),
|
||||||
|
QGenericArgument val4 = QGenericArgument(),
|
||||||
|
QGenericArgument val5 = QGenericArgument(),
|
||||||
|
QGenericArgument val6 = QGenericArgument(),
|
||||||
|
QGenericArgument val7 = QGenericArgument(),
|
||||||
|
QGenericArgument val8 = QGenericArgument(),
|
||||||
|
QGenericArgument val9 = QGenericArgument()) const
|
||||||
|
{
|
||||||
|
return invoke(object, Qt::AutoConnection, QGenericReturnArgument(),
|
||||||
|
val0, val1, val2, val3, val4, val5, val6, val7, val8, val9);
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
const QMetaObject *mobj;
|
||||||
|
uint handle;
|
||||||
|
friend struct QMetaObject;
|
||||||
|
};
|
||||||
|
Q_DECLARE_TYPEINFO(QMetaMethod, Q_MOVABLE_TYPE);
|
||||||
|
|
||||||
|
class Q_CORE_EXPORT QMetaEnum
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
inline QMetaEnum() : mobj(0),handle(0) {}
|
||||||
|
|
||||||
|
const char *name() const;
|
||||||
|
bool isFlag() const;
|
||||||
|
|
||||||
|
int keyCount() const;
|
||||||
|
const char *key(int index) const;
|
||||||
|
int value(int index) const;
|
||||||
|
|
||||||
|
const char *scope() const;
|
||||||
|
|
||||||
|
int keyToValue(const char *key) const;
|
||||||
|
const char* valueToKey(int value) const;
|
||||||
|
int keysToValue(const char * keys) const;
|
||||||
|
QByteArray valueToKeys(int value) const;
|
||||||
|
|
||||||
|
inline const QMetaObject *enclosingMetaObject() const { return mobj; }
|
||||||
|
|
||||||
|
inline bool isValid() const { return name() != 0; }
|
||||||
|
private:
|
||||||
|
const QMetaObject *mobj;
|
||||||
|
uint handle;
|
||||||
|
friend struct QMetaObject;
|
||||||
|
};
|
||||||
|
Q_DECLARE_TYPEINFO(QMetaEnum, Q_MOVABLE_TYPE);
|
||||||
|
|
||||||
|
class Q_CORE_EXPORT QMetaProperty
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
QMetaProperty();
|
||||||
|
|
||||||
|
const char *name() const;
|
||||||
|
const char *typeName() const;
|
||||||
|
QVariant::Type type() const;
|
||||||
|
int userType() const;
|
||||||
|
int propertyIndex() const;
|
||||||
|
|
||||||
|
bool isReadable() const;
|
||||||
|
bool isWritable() const;
|
||||||
|
bool isResettable() const;
|
||||||
|
bool isDesignable(const QObject *obj = 0) const;
|
||||||
|
bool isScriptable(const QObject *obj = 0) const;
|
||||||
|
bool isStored(const QObject *obj = 0) const;
|
||||||
|
bool isEditable(const QObject *obj = 0) const;
|
||||||
|
bool isUser(const QObject *obj = 0) const;
|
||||||
|
bool isConstant() const;
|
||||||
|
bool isFinal() const;
|
||||||
|
|
||||||
|
bool isFlagType() const;
|
||||||
|
bool isEnumType() const;
|
||||||
|
QMetaEnum enumerator() const;
|
||||||
|
|
||||||
|
bool hasNotifySignal() const;
|
||||||
|
QMetaMethod notifySignal() const;
|
||||||
|
int notifySignalIndex() const;
|
||||||
|
|
||||||
|
QVariant read(const QObject *obj) const;
|
||||||
|
bool write(QObject *obj, const QVariant &value) const;
|
||||||
|
bool reset(QObject *obj) const;
|
||||||
|
|
||||||
|
bool hasStdCppSet() const;
|
||||||
|
inline bool isValid() const { return isReadable(); }
|
||||||
|
inline const QMetaObject *enclosingMetaObject() const { return mobj; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
const QMetaObject *mobj;
|
||||||
|
uint handle;
|
||||||
|
int idx;
|
||||||
|
QMetaEnum menum;
|
||||||
|
friend struct QMetaObject;
|
||||||
|
|
||||||
|
public:
|
||||||
|
bool writable() const;
|
||||||
|
};
|
||||||
|
|
||||||
|
class Q_CORE_EXPORT QMetaClassInfo
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
inline QMetaClassInfo() : mobj(0),handle(0) {}
|
||||||
|
const char *name() const;
|
||||||
|
const char *value() const;
|
||||||
|
inline const QMetaObject *enclosingMetaObject() const { return mobj; }
|
||||||
|
private:
|
||||||
|
const QMetaObject *mobj;
|
||||||
|
uint handle;
|
||||||
|
friend struct QMetaObject;
|
||||||
|
};
|
||||||
|
Q_DECLARE_TYPEINFO(QMetaClassInfo, Q_MOVABLE_TYPE);
|
||||||
|
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
|
QT_END_HEADER
|
||||||
|
|
||||||
|
#endif // QMETAOBJECT_H
|
@ -0,0 +1,330 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
||||||
|
** All rights reserved.
|
||||||
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||||
|
**
|
||||||
|
** This file is part of the QtGui module of the Qt Toolkit.
|
||||||
|
**
|
||||||
|
** $QT_BEGIN_LICENSE:LGPL$
|
||||||
|
** Commercial Usage
|
||||||
|
** Licensees holding valid Qt Commercial licenses may use this file in
|
||||||
|
** accordance with the Qt Commercial License Agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and Nokia.
|
||||||
|
**
|
||||||
|
** 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.1, 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 have questions regarding the use of this file, please contact
|
||||||
|
** Nokia at qt-info@nokia.com.
|
||||||
|
** $QT_END_LICENSE$
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef QPIXMAP_H
|
||||||
|
#define QPIXMAP_H
|
||||||
|
|
||||||
|
#include <QtGui/qpaintdevice.h>
|
||||||
|
#include <QtGui/qcolor.h>
|
||||||
|
#include <QtCore/qnamespace.h>
|
||||||
|
#include <QtCore/qstring.h> // char*->QString conversion
|
||||||
|
#include <QtCore/qsharedpointer.h>
|
||||||
|
#include <QtGui/qimage.h>
|
||||||
|
#include <QtGui/qtransform.h>
|
||||||
|
|
||||||
|
QT_BEGIN_HEADER
|
||||||
|
|
||||||
|
#if defined(Q_OS_SYMBIAN)
|
||||||
|
class CFbsBitmap;
|
||||||
|
class RSgImage;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
QT_MODULE(Gui)
|
||||||
|
|
||||||
|
class QImageWriter;
|
||||||
|
class QColor;
|
||||||
|
class QVariant;
|
||||||
|
class QX11Info;
|
||||||
|
class QPixmapData;
|
||||||
|
|
||||||
|
class Q_GUI_EXPORT QPixmap : public QPaintDevice
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
QPixmap();
|
||||||
|
explicit QPixmap(QPixmapData *data);
|
||||||
|
QPixmap(int w, int h);
|
||||||
|
QPixmap(const QSize &);
|
||||||
|
QPixmap(const QString& fileName, const char *format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor);
|
||||||
|
#ifndef QT_NO_IMAGEFORMAT_XPM
|
||||||
|
QPixmap(const char * const xpm[]);
|
||||||
|
#endif
|
||||||
|
QPixmap(const QPixmap &);
|
||||||
|
~QPixmap();
|
||||||
|
|
||||||
|
QPixmap &operator=(const QPixmap &);
|
||||||
|
operator QVariant() const;
|
||||||
|
|
||||||
|
bool isNull() const; // ### Qt 5: make inline
|
||||||
|
int devType() const;
|
||||||
|
|
||||||
|
int width() const; // ### Qt 5: make inline
|
||||||
|
int height() const; // ### Qt 5: make inline
|
||||||
|
QSize size() const;
|
||||||
|
QRect rect() const;
|
||||||
|
int depth() const;
|
||||||
|
|
||||||
|
static int defaultDepth();
|
||||||
|
|
||||||
|
void fill(const QColor &fillColor = Qt::white);
|
||||||
|
void fill(const QWidget *widget, const QPoint &ofs);
|
||||||
|
inline void fill(const QWidget *widget, int xofs, int yofs) { fill(widget, QPoint(xofs, yofs)); }
|
||||||
|
|
||||||
|
QBitmap mask() const;
|
||||||
|
void setMask(const QBitmap &);
|
||||||
|
|
||||||
|
QPixmap alphaChannel() const;
|
||||||
|
void setAlphaChannel(const QPixmap &);
|
||||||
|
|
||||||
|
bool hasAlpha() const;
|
||||||
|
bool hasAlphaChannel() const;
|
||||||
|
|
||||||
|
#ifndef QT_NO_IMAGE_HEURISTIC_MASK
|
||||||
|
QBitmap createHeuristicMask(bool clipTight = true) const;
|
||||||
|
#endif
|
||||||
|
QBitmap createMaskFromColor(const QColor &maskColor) const; // ### Qt 5: remove
|
||||||
|
QBitmap createMaskFromColor(const QColor &maskColor, Qt::MaskMode mode) const;
|
||||||
|
|
||||||
|
static QPixmap grabWindow(WId, int x=0, int y=0, int w=-1, int h=-1);
|
||||||
|
static QPixmap grabWidget(QWidget *widget, const QRect &rect);
|
||||||
|
static inline QPixmap grabWidget(QWidget *widget, int x=0, int y=0, int w=-1, int h=-1)
|
||||||
|
{ return grabWidget(widget, QRect(x, y, w, h)); }
|
||||||
|
|
||||||
|
|
||||||
|
inline QPixmap scaled(int w, int h, Qt::AspectRatioMode aspectMode = Qt::IgnoreAspectRatio,
|
||||||
|
Qt::TransformationMode mode = Qt::FastTransformation) const
|
||||||
|
{ return scaled(QSize(w, h), aspectMode, mode); }
|
||||||
|
QPixmap scaled(const QSize &s, Qt::AspectRatioMode aspectMode = Qt::IgnoreAspectRatio,
|
||||||
|
Qt::TransformationMode mode = Qt::FastTransformation) const;
|
||||||
|
QPixmap scaledToWidth(int w, Qt::TransformationMode mode = Qt::FastTransformation) const;
|
||||||
|
QPixmap scaledToHeight(int h, Qt::TransformationMode mode = Qt::FastTransformation) const;
|
||||||
|
QPixmap transformed(const QMatrix &, Qt::TransformationMode mode = Qt::FastTransformation) const;
|
||||||
|
static QMatrix trueMatrix(const QMatrix &m, int w, int h);
|
||||||
|
QPixmap transformed(const QTransform &, Qt::TransformationMode mode = Qt::FastTransformation) const;
|
||||||
|
static QTransform trueMatrix(const QTransform &m, int w, int h);
|
||||||
|
|
||||||
|
QImage toImage() const;
|
||||||
|
static QPixmap fromImage(const QImage &image, Qt::ImageConversionFlags flags = Qt::AutoColor);
|
||||||
|
|
||||||
|
bool load(const QString& fileName, const char *format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor);
|
||||||
|
bool loadFromData(const uchar *buf, uint len, const char* format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor);
|
||||||
|
inline bool loadFromData(const QByteArray &data, const char* format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor);
|
||||||
|
bool save(const QString& fileName, const char* format = 0, int quality = -1) const;
|
||||||
|
bool save(QIODevice* device, const char* format = 0, int quality = -1) const;
|
||||||
|
|
||||||
|
#if defined(Q_WS_WIN)
|
||||||
|
enum HBitmapFormat {
|
||||||
|
NoAlpha,
|
||||||
|
PremultipliedAlpha,
|
||||||
|
Alpha
|
||||||
|
};
|
||||||
|
|
||||||
|
HBITMAP toWinHBITMAP(HBitmapFormat format = NoAlpha) const;
|
||||||
|
HICON toWinHICON() const;
|
||||||
|
|
||||||
|
static QPixmap fromWinHBITMAP(HBITMAP hbitmap, HBitmapFormat format = NoAlpha);
|
||||||
|
static QPixmap fromWinHICON(HICON hicon);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(Q_WS_MAC)
|
||||||
|
CGImageRef toMacCGImageRef() const;
|
||||||
|
static QPixmap fromMacCGImageRef(CGImageRef image);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(Q_OS_SYMBIAN)
|
||||||
|
CFbsBitmap *toSymbianCFbsBitmap() const;
|
||||||
|
static QPixmap fromSymbianCFbsBitmap(CFbsBitmap *bitmap);
|
||||||
|
RSgImage* toSymbianRSgImage() const;
|
||||||
|
static QPixmap fromSymbianRSgImage(RSgImage *sgImage);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
inline QPixmap copy(int x, int y, int width, int height) const;
|
||||||
|
QPixmap copy(const QRect &rect = QRect()) const;
|
||||||
|
|
||||||
|
inline void scroll(int dx, int dy, int x, int y, int width, int height, QRegion *exposed = 0);
|
||||||
|
void scroll(int dx, int dy, const QRect &rect, QRegion *exposed = 0);
|
||||||
|
|
||||||
|
int serialNumber() const;
|
||||||
|
qint64 cacheKey() const;
|
||||||
|
|
||||||
|
bool isDetached() const;
|
||||||
|
void detach();
|
||||||
|
|
||||||
|
bool isQBitmap() const;
|
||||||
|
|
||||||
|
#if defined(Q_WS_QWS)
|
||||||
|
const uchar *qwsBits() const;
|
||||||
|
int qwsBytesPerLine() const;
|
||||||
|
QRgb *clut() const;
|
||||||
|
#ifdef QT_DEPRECATED
|
||||||
|
QT_DEPRECATED int numCols() const;
|
||||||
|
#endif
|
||||||
|
int colorCount() const;
|
||||||
|
#elif defined(Q_WS_MAC)
|
||||||
|
Qt::HANDLE macQDHandle() const;
|
||||||
|
Qt::HANDLE macQDAlphaHandle() const;
|
||||||
|
Qt::HANDLE macCGHandle() const;
|
||||||
|
#elif defined(Q_WS_X11)
|
||||||
|
enum ShareMode { ImplicitlyShared, ExplicitlyShared };
|
||||||
|
|
||||||
|
static QPixmap fromX11Pixmap(Qt::HANDLE pixmap, ShareMode mode = ImplicitlyShared);
|
||||||
|
static int x11SetDefaultScreen(int screen);
|
||||||
|
void x11SetScreen(int screen);
|
||||||
|
const QX11Info &x11Info() const;
|
||||||
|
Qt::HANDLE x11PictureHandle() const;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(Q_WS_X11) || defined(Q_WS_QWS)
|
||||||
|
Qt::HANDLE handle() const;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
QPaintEngine *paintEngine() const;
|
||||||
|
|
||||||
|
inline bool operator!() const { return isNull(); }
|
||||||
|
|
||||||
|
protected:
|
||||||
|
int metric(PaintDeviceMetric) const;
|
||||||
|
|
||||||
|
#ifdef QT3_SUPPORT
|
||||||
|
public:
|
||||||
|
enum ColorMode { Auto, Color, Mono };
|
||||||
|
QT3_SUPPORT_CONSTRUCTOR QPixmap(const QString& fileName, const char *format, ColorMode mode);
|
||||||
|
QT3_SUPPORT bool load(const QString& fileName, const char *format, ColorMode mode);
|
||||||
|
QT3_SUPPORT bool loadFromData(const uchar *buf, uint len, const char* format, ColorMode mode);
|
||||||
|
QT3_SUPPORT_CONSTRUCTOR QPixmap(const QImage& image);
|
||||||
|
QT3_SUPPORT QPixmap &operator=(const QImage &);
|
||||||
|
inline QT3_SUPPORT QImage convertToImage() const { return toImage(); }
|
||||||
|
QT3_SUPPORT bool convertFromImage(const QImage &, ColorMode mode);
|
||||||
|
QT3_SUPPORT bool convertFromImage(const QImage &img, Qt::ImageConversionFlags flags = Qt::AutoColor)
|
||||||
|
{ (*this) = fromImage(img, flags); return !isNull(); }
|
||||||
|
QT3_SUPPORT bool convertFromImage(const QImage &img, int flags);
|
||||||
|
inline QT3_SUPPORT operator QImage() const { return toImage(); }
|
||||||
|
inline QT3_SUPPORT QPixmap xForm(const QMatrix &matrix) const { return transformed(QTransform(matrix)); }
|
||||||
|
inline QT3_SUPPORT bool selfMask() const { return false; }
|
||||||
|
private:
|
||||||
|
void resize_helper(const QSize &s);
|
||||||
|
public:
|
||||||
|
inline QT3_SUPPORT void resize(const QSize &s) { resize_helper(s); }
|
||||||
|
inline QT3_SUPPORT void resize(int width, int height) { resize_helper(QSize(width, height)); }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
private:
|
||||||
|
QExplicitlySharedDataPointer<QPixmapData> data;
|
||||||
|
|
||||||
|
bool doImageIO(QImageWriter *io, int quality) const;
|
||||||
|
|
||||||
|
// ### Qt5: remove the following three lines
|
||||||
|
enum Type { PixmapType, BitmapType }; // must match QPixmapData::PixelType
|
||||||
|
QPixmap(const QSize &s, Type);
|
||||||
|
void init(int, int, Type = PixmapType);
|
||||||
|
|
||||||
|
QPixmap(const QSize &s, int type);
|
||||||
|
void init(int, int, int);
|
||||||
|
void deref();
|
||||||
|
#if defined(Q_WS_WIN)
|
||||||
|
void initAlphaPixmap(uchar *bytes, int length, struct tagBITMAPINFO *bmi);
|
||||||
|
#endif
|
||||||
|
Q_DUMMY_COMPARISON_OPERATOR(QPixmap)
|
||||||
|
#ifdef Q_WS_MAC
|
||||||
|
friend CGContextRef qt_mac_cg_context(const QPaintDevice*);
|
||||||
|
friend CGImageRef qt_mac_create_imagemask(const QPixmap&, const QRectF&);
|
||||||
|
friend IconRef qt_mac_create_iconref(const QPixmap&);
|
||||||
|
friend quint32 *qt_mac_pixmap_get_base(const QPixmap*);
|
||||||
|
friend int qt_mac_pixmap_get_bytes_per_line(const QPixmap*);
|
||||||
|
#endif
|
||||||
|
friend class QPixmapData;
|
||||||
|
friend class QX11PixmapData;
|
||||||
|
friend class QMacPixmapData;
|
||||||
|
friend class QS60PixmapData;
|
||||||
|
friend class QBitmap;
|
||||||
|
friend class QPaintDevice;
|
||||||
|
friend class QPainter;
|
||||||
|
friend class QGLWidget;
|
||||||
|
friend class QX11PaintEngine;
|
||||||
|
friend class QCoreGraphicsPaintEngine;
|
||||||
|
friend class QWidgetPrivate;
|
||||||
|
friend class QRasterPaintEngine;
|
||||||
|
friend class QRasterBuffer;
|
||||||
|
friend class QPixmapCacheEntry;
|
||||||
|
#if !defined(QT_NO_DATASTREAM)
|
||||||
|
friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QPixmap &);
|
||||||
|
#endif
|
||||||
|
friend Q_GUI_EXPORT qint64 qt_pixmap_id(const QPixmap &pixmap);
|
||||||
|
|
||||||
|
public:
|
||||||
|
QPixmapData* pixmapData() const;
|
||||||
|
|
||||||
|
public:
|
||||||
|
typedef QExplicitlySharedDataPointer<QPixmapData> DataPtr;
|
||||||
|
inline DataPtr &data_ptr() { return data; }
|
||||||
|
};
|
||||||
|
|
||||||
|
Q_DECLARE_SHARED(QPixmap)
|
||||||
|
|
||||||
|
inline QPixmap QPixmap::copy(int ax, int ay, int awidth, int aheight) const
|
||||||
|
{
|
||||||
|
return copy(QRect(ax, ay, awidth, aheight));
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void QPixmap::scroll(int dx, int dy, int ax, int ay, int awidth, int aheight, QRegion *exposed)
|
||||||
|
{
|
||||||
|
scroll(dx, dy, QRect(ax, ay, awidth, aheight), exposed);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline bool QPixmap::loadFromData(const QByteArray &buf, const char *format,
|
||||||
|
Qt::ImageConversionFlags flags)
|
||||||
|
{
|
||||||
|
return loadFromData(reinterpret_cast<const uchar *>(buf.constData()), buf.size(), format, flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************
|
||||||
|
QPixmap stream functions
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#if !defined(QT_NO_DATASTREAM)
|
||||||
|
Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QPixmap &);
|
||||||
|
Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QPixmap &);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*****************************************************************************
|
||||||
|
QPixmap (and QImage) helper functions
|
||||||
|
*****************************************************************************/
|
||||||
|
#ifdef QT3_SUPPORT
|
||||||
|
QT3_SUPPORT Q_GUI_EXPORT void copyBlt(QPixmap *dst, int dx, int dy, const QPixmap *src,
|
||||||
|
int sx=0, int sy=0, int sw=-1, int sh=-1);
|
||||||
|
#endif // QT3_SUPPORT
|
||||||
|
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
|
QT_END_HEADER
|
||||||
|
|
||||||
|
#endif // QPIXMAP_H
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue