// qbrush.sip generated by MetaSIP on Fri Sep 28 17:07:47 2007 // // This file is part of the QtGui Python extension module. // // Copyright (c) 2007 // Phil Thompson // // This file is part of PyQt. // // This copy of PyQt is free software; you can redistribute it and/or modify it // under the terms of the GNU General Public License version 2 as published by // the Free Software Foundation and appearing in the file LICENSE included in the // packaging of this file. // // PyQt is supplied in the hope that it will be useful, but WITHOUT ANY // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS // FOR A PARTICULAR PURPOSE. See the GNU General Public License for more // details. // // You should have received a copy of the GNU General Public License along with // PyQt; see the file LICENSE. If not, write to the Free Software Foundation, // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. %ModuleCode #include %End class QBrush { %TypeHeaderCode #include %End %ConvertToTypeCode // SIP doesn't support automatic type convertors so we explicitly allow a // QColor or a QGradient to be used whenever a QBrush is expected. Note that // SIP must process QColor before QBrush so that the former's QVariant cast // operator is applied before the latter's. if (sipIsErr == NULL) return (sipCanConvertToInstance(sipPy, sipClass_QBrush, SIP_NO_CONVERTORS) || sipCanConvertToInstance(sipPy, sipClass_QColor, 0) || sipCanConvertToInstance(sipPy, sipClass_QGradient, 0)); if (sipCanConvertToInstance(sipPy, sipClass_QBrush, SIP_NO_CONVERTORS)) { *sipCppPtr = reinterpret_cast(sipConvertToInstance(sipPy, sipClass_QBrush, sipTransferObj, SIP_NO_CONVERTORS, 0, sipIsErr)); return 0; } int state; if (sipCanConvertToInstance(sipPy, sipClass_QColor, 0)) { QColor *c = reinterpret_cast(sipConvertToInstance(sipPy, sipClass_QColor, 0, 0, &state, sipIsErr)); if (*sipIsErr) { sipReleaseInstance(c, sipClass_QColor, state); return 0; } *sipCppPtr = new QBrush(*c); sipReleaseInstance(c, sipClass_QColor, state); return sipGetState(sipTransferObj); } QGradient *g = reinterpret_cast(sipConvertToInstance(sipPy, sipClass_QGradient, 0, 0, &state, sipIsErr)); if (*sipIsErr) { sipReleaseInstance(g, sipClass_QGradient, state); return 0; } *sipCppPtr = new QBrush(*g); sipReleaseInstance(g, sipClass_QGradient, state); return sipGetState(sipTransferObj); %End public: QBrush(); QBrush(Qt::BrushStyle bs); QBrush(const QColor &color, Qt::BrushStyle bs = Qt::SolidPattern); QBrush(Qt::GlobalColor color, Qt::BrushStyle bs = Qt::SolidPattern); QBrush(const QColor &color, const QPixmap &pixmap); QBrush(Qt::GlobalColor color, const QPixmap &pixmap); QBrush(const QPixmap &pixmap); %If (Qt_4_2_0 -) QBrush(const QImage &image); %End QBrush(const QGradient &gradient); QBrush(const QBrush &brush); QBrush(const QVariant &variant) /NoDerived/; %MethodCode sipCpp = new QBrush(qVariantValue(*a0)); %End ~QBrush(); operator QVariant() const; void setStyle(Qt::BrushStyle); QPixmap texture() const; void setTexture(const QPixmap &pixmap); void setColor(const QColor &color); const QGradient *gradient() const; bool isOpaque() const; bool operator==(const QBrush &b) const; bool operator!=(const QBrush &b) const; void setColor(Qt::GlobalColor acolor); Qt::BrushStyle style() const; const QColor &color() const; %If (Qt_4_2_0 -) void setMatrix(const QMatrix &mat); %End %If (Qt_4_2_0 -) const QMatrix &matrix() const; %End %If (Qt_4_2_0 -) void setTextureImage(const QImage &image); %End %If (Qt_4_2_0 -) QImage textureImage() const; %End %If (Qt_4_3_0 -) void setTransform(const QTransform &); %End %If (Qt_4_3_0 -) QTransform transform() const; %End }; QDataStream &operator>>(QDataStream &, QBrush & /Constrained/); QDataStream &operator<<(QDataStream &, const QBrush & /Constrained/); typedef QVector > QGradientStops; class QGradient { %TypeHeaderCode #include %End public: enum Type { LinearGradient, RadialGradient, ConicalGradient, NoGradient, }; enum Spread { PadSpread, ReflectSpread, RepeatSpread, }; QGradient(); QGradient::Type type() const; QGradient::Spread spread() const; void setColorAt(qreal pos, const QColor &color); void setStops(const QGradientStops &stops); QGradientStops stops() const; bool operator==(const QGradient &gradient) const; %If (Qt_4_2_0 -) bool operator!=(const QGradient &other) const; %End void setSpread(QGradient::Spread aspread); }; class QLinearGradient : QGradient { %TypeHeaderCode #include %End public: %If (Qt_4_2_0 -) QLinearGradient(); %End QLinearGradient(const QPointF &start, const QPointF &finalStop); QLinearGradient(qreal xStart, qreal yStart, qreal xFinalStop, qreal yFinalStop); QPointF start() const; QPointF finalStop() const; %If (Qt_4_2_0 -) void setStart(const QPointF &start); %End %If (Qt_4_2_0 -) void setStart(qreal x, qreal y); %End %If (Qt_4_2_0 -) void setFinalStop(const QPointF &stop); %End %If (Qt_4_2_0 -) void setFinalStop(qreal x, qreal y); %End }; class QRadialGradient : QGradient { %TypeHeaderCode #include %End public: %If (Qt_4_2_0 -) QRadialGradient(); %End %If (Qt_4_2_0 -) QRadialGradient(const QPointF ¢er, qreal radius, const QPointF &focalPoint); %End %If (Qt_4_2_0 -) QRadialGradient(const QPointF ¢er, qreal radius); %End %If (- Qt_4_2_0) QRadialGradient(const QPointF ¢er, qreal radius, const QPointF &focalPoint = QPointF()); %End %If (Qt_4_2_0 -) QRadialGradient(qreal cx, qreal cy, qreal radius, qreal fx, qreal fy); %End %If (Qt_4_2_0 -) QRadialGradient(qreal cx, qreal cy, qreal radius); %End %If (- Qt_4_2_0) QRadialGradient(qreal cx, qreal cy, qreal radius, qreal fx = 0, qreal fy = 0); %End QPointF center() const; QPointF focalPoint() const; qreal radius() const; %If (Qt_4_2_0 -) void setCenter(const QPointF ¢er); %End %If (Qt_4_2_0 -) void setCenter(qreal x, qreal y); %End %If (Qt_4_2_0 -) void setFocalPoint(const QPointF &focalPoint); %End %If (Qt_4_2_0 -) void setFocalPoint(qreal x, qreal y); %End %If (Qt_4_2_0 -) void setRadius(qreal radius); %End }; class QConicalGradient : QGradient { %TypeHeaderCode #include %End public: %If (Qt_4_2_0 -) QConicalGradient(); %End QConicalGradient(const QPointF ¢er, qreal startAngle); QConicalGradient(qreal cx, qreal cy, qreal startAngle); QPointF center() const; qreal angle() const; %If (Qt_4_2_0 -) void setCenter(const QPointF ¢er); %End %If (Qt_4_2_0 -) void setCenter(qreal x, qreal y); %End %If (Qt_4_2_0 -) void setAngle(qreal angle); %End }; %If (Qt_4_3_0 -) void qSwap(QBrush &value1, QBrush &value2); %End