init
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
# Automatically generated configuration for PyQt5.QtGui.
|
||||
|
||||
sip-version = "6.8.6"
|
||||
sip-abi-version = "12.15"
|
||||
module-tags = ["Qt_5_15_14", "WS_MACX"]
|
||||
module-disabled-features = []
|
||||
@@ -0,0 +1,145 @@
|
||||
// QtGuimod.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%Module(name=PyQt5.QtGui, keyword_arguments="Optional", use_limited_api=True)
|
||||
|
||||
%Import QtCore/QtCoremod.sip
|
||||
|
||||
%Copying
|
||||
Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
|
||||
This file is part of PyQt5.
|
||||
|
||||
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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
then you may purchase a commercial license. For more information contact
|
||||
info@riverbankcomputing.com.
|
||||
|
||||
This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
%End
|
||||
|
||||
%DefaultSupertype sip.simplewrapper
|
||||
|
||||
// Note this is also appended by configure.py but is explicitly needed here (probably a SIP bug).
|
||||
%Include opengl_types.sip
|
||||
|
||||
%Include qabstracttextdocumentlayout.sip
|
||||
%Include qbackingstore.sip
|
||||
%Include qbitmap.sip
|
||||
%Include qcolor.sip
|
||||
%Include qbrush.sip
|
||||
%Include qclipboard.sip
|
||||
%Include qcolorspace.sip
|
||||
%Include qcolortransform.sip
|
||||
%Include qcursor.sip
|
||||
%Include qdesktopservices.sip
|
||||
%Include qdrag.sip
|
||||
%Include qevent.sip
|
||||
%Include qfont.sip
|
||||
%Include qfontdatabase.sip
|
||||
%Include qfontinfo.sip
|
||||
%Include qfontmetrics.sip
|
||||
%Include qgenericmatrix.sip
|
||||
%Include qglyphrun.sip
|
||||
%Include qguiapplication.sip
|
||||
%Include qicon.sip
|
||||
%Include qiconengine.sip
|
||||
%Include qimage.sip
|
||||
%Include qimageiohandler.sip
|
||||
%Include qimagereader.sip
|
||||
%Include qimagewriter.sip
|
||||
%Include qinputmethod.sip
|
||||
%Include qkeysequence.sip
|
||||
%Include qmatrix4x4.sip
|
||||
%Include qmovie.sip
|
||||
%Include qoffscreensurface.sip
|
||||
%Include qopenglbuffer.sip
|
||||
%Include qopenglcontext.sip
|
||||
%Include qopengldebug.sip
|
||||
%Include qopenglframebufferobject.sip
|
||||
%Include qopenglpaintdevice.sip
|
||||
%Include qopenglpixeltransferoptions.sip
|
||||
%Include qopenglshaderprogram.sip
|
||||
%Include qopengltexture.sip
|
||||
%Include qopengltextureblitter.sip
|
||||
%Include qopengltimerquery.sip
|
||||
%Include qopenglversionfunctions.sip
|
||||
%Include qopenglvertexarrayobject.sip
|
||||
%Include qopenglwindow.sip
|
||||
%Include qpagedpaintdevice.sip
|
||||
%Include qpagelayout.sip
|
||||
%Include qpagesize.sip
|
||||
%Include qpainter.sip
|
||||
%Include qpaintdevice.sip
|
||||
%Include qpaintdevicewindow.sip
|
||||
%Include qpaintengine.sip
|
||||
%Include qpainterpath.sip
|
||||
%Include qpalette.sip
|
||||
%Include qpdfwriter.sip
|
||||
%Include qpen.sip
|
||||
%Include qpicture.sip
|
||||
%Include qpixelformat.sip
|
||||
%Include qpixmap.sip
|
||||
%Include qpixmapcache.sip
|
||||
%Include qpolygon.sip
|
||||
%Include qquaternion.sip
|
||||
%Include qrasterwindow.sip
|
||||
%Include qrawfont.sip
|
||||
%Include qregion.sip
|
||||
%Include qrgba64.sip
|
||||
%Include qrgb.sip
|
||||
%Include qscreen.sip
|
||||
%Include qsessionmanager.sip
|
||||
%Include qstandarditemmodel.sip
|
||||
%Include qstatictext.sip
|
||||
%Include qstylehints.sip
|
||||
%Include qsurface.sip
|
||||
%Include qsurfaceformat.sip
|
||||
%Include qsyntaxhighlighter.sip
|
||||
%Include qtextcursor.sip
|
||||
%Include qtextdocument.sip
|
||||
%Include qtextdocumentfragment.sip
|
||||
%Include qtextdocumentwriter.sip
|
||||
%Include qtextformat.sip
|
||||
%Include qtextlayout.sip
|
||||
%Include qtextlist.sip
|
||||
%Include qtextobject.sip
|
||||
%Include qtextoption.sip
|
||||
%Include qtexttable.sip
|
||||
%Include qtouchdevice.sip
|
||||
%Include qtransform.sip
|
||||
%Include qvalidator.sip
|
||||
%Include qvector2d.sip
|
||||
%Include qvector3d.sip
|
||||
%Include qvector4d.sip
|
||||
%Include qwindow.sip
|
||||
%Include qwindowdefs.sip
|
||||
%Include qpygui_qpair.sip
|
||||
%Include qpygui_qlist.sip
|
||||
%Include opengl_types.sip
|
||||
%Include qpygui_qvector.sip
|
||||
@@ -0,0 +1,43 @@
|
||||
// This implements the typedefs for the OpenGL data types.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (PyQt_OpenGL)
|
||||
|
||||
typedef char GLchar;
|
||||
typedef qint8 GLbyte;
|
||||
typedef quint8 GLubyte;
|
||||
typedef quint8 GLboolean;
|
||||
typedef qint16 GLshort;
|
||||
typedef quint16 GLushort;
|
||||
typedef qint32 GLint;
|
||||
typedef qint32 GLsizei;
|
||||
typedef quint32 GLuint;
|
||||
typedef quint32 GLenum;
|
||||
typedef quint32 GLbitfield;
|
||||
%If (PyQt_Desktop_OpenGL)
|
||||
typedef quint64 GLuint64; // This is in OpenGL ES v3.
|
||||
typedef double GLdouble;
|
||||
%End
|
||||
typedef float GLfloat;
|
||||
typedef float GLclampf;
|
||||
typedef long GLintptr;
|
||||
typedef long GLsizeiptr;
|
||||
|
||||
%End
|
||||
@@ -0,0 +1,107 @@
|
||||
// qabstracttextdocumentlayout.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QAbstractTextDocumentLayout : public QObject
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qabstracttextdocumentlayout.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
explicit QAbstractTextDocumentLayout(QTextDocument *doc);
|
||||
virtual ~QAbstractTextDocumentLayout();
|
||||
|
||||
struct Selection
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qabstracttextdocumentlayout.h>
|
||||
%End
|
||||
|
||||
QTextCursor cursor;
|
||||
QTextCharFormat format;
|
||||
};
|
||||
|
||||
struct PaintContext
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qabstracttextdocumentlayout.h>
|
||||
%End
|
||||
|
||||
PaintContext();
|
||||
int cursorPosition;
|
||||
QPalette palette;
|
||||
QRectF clip;
|
||||
QVector<QAbstractTextDocumentLayout::Selection> selections;
|
||||
};
|
||||
|
||||
virtual void draw(QPainter *painter, const QAbstractTextDocumentLayout::PaintContext &context) = 0;
|
||||
virtual int hitTest(const QPointF &point, Qt::HitTestAccuracy accuracy) const = 0;
|
||||
QString anchorAt(const QPointF &pos) const;
|
||||
virtual int pageCount() const = 0;
|
||||
virtual QSizeF documentSize() const = 0;
|
||||
virtual QRectF frameBoundingRect(QTextFrame *frame) const = 0;
|
||||
virtual QRectF blockBoundingRect(const QTextBlock &block) const = 0;
|
||||
void setPaintDevice(QPaintDevice *device);
|
||||
QPaintDevice *paintDevice() const;
|
||||
QTextDocument *document() const;
|
||||
void registerHandler(int objectType, QObject *component);
|
||||
%If (Qt_5_2_0 -)
|
||||
void unregisterHandler(int objectType, QObject *component = 0);
|
||||
%End
|
||||
QTextObjectInterface *handlerForObject(int objectType) const;
|
||||
|
||||
signals:
|
||||
void update(const QRectF &rect = QRectF(0., 0., 1.0E+9, 1.0E+9));
|
||||
void documentSizeChanged(const QSizeF &newSize);
|
||||
void pageCountChanged(int newPages);
|
||||
void updateBlock(const QTextBlock &block);
|
||||
|
||||
protected:
|
||||
virtual void documentChanged(int from, int charsRemoved, int charsAdded) = 0;
|
||||
virtual void resizeInlineObject(QTextInlineObject item, int posInDocument, const QTextFormat &format);
|
||||
virtual void positionInlineObject(QTextInlineObject item, int posInDocument, const QTextFormat &format);
|
||||
virtual void drawInlineObject(QPainter *painter, const QRectF &rect, QTextInlineObject object, int posInDocument, const QTextFormat &format);
|
||||
QTextCharFormat format(int pos);
|
||||
|
||||
public:
|
||||
%If (Qt_5_8_0 -)
|
||||
QString imageAt(const QPointF &pos) const;
|
||||
%End
|
||||
%If (Qt_5_8_0 -)
|
||||
QTextFormat formatAt(const QPointF &pos) const;
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
QTextBlock blockWithMarkerAt(const QPointF &pos) const;
|
||||
%End
|
||||
};
|
||||
|
||||
class QTextObjectInterface /Mixin,PyQtInterface="org.qt-project.Qt.QTextObjectInterface"/
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qabstracttextdocumentlayout.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
virtual ~QTextObjectInterface();
|
||||
virtual QSizeF intrinsicSize(QTextDocument *doc, int posInDocument, const QTextFormat &format) = 0;
|
||||
virtual void drawObject(QPainter *painter, const QRectF &rect, QTextDocument *doc, int posInDocument, const QTextFormat &format) = 0;
|
||||
};
|
||||
@@ -0,0 +1,43 @@
|
||||
// qbackingstore.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QBackingStore /NoDefaultCtors/
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qbackingstore.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
explicit QBackingStore(QWindow *window);
|
||||
~QBackingStore();
|
||||
QWindow *window() const;
|
||||
QPaintDevice *paintDevice();
|
||||
void flush(const QRegion ®ion, QWindow *window = 0, const QPoint &offset = QPoint());
|
||||
void resize(const QSize &size);
|
||||
QSize size() const;
|
||||
bool scroll(const QRegion &area, int dx, int dy);
|
||||
void beginPaint(const QRegion &);
|
||||
void endPaint();
|
||||
void setStaticContents(const QRegion ®ion);
|
||||
QRegion staticContents() const;
|
||||
bool hasStaticContents() const;
|
||||
};
|
||||
@@ -0,0 +1,52 @@
|
||||
// qbitmap.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QBitmap : public QPixmap
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qbitmap.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QBitmap();
|
||||
%If (Qt_5_7_0 -)
|
||||
QBitmap(const QBitmap &other);
|
||||
%End
|
||||
QBitmap(const QPixmap &);
|
||||
QBitmap(int w, int h);
|
||||
explicit QBitmap(const QSize &);
|
||||
QBitmap(const QString &fileName, const char *format = 0);
|
||||
QBitmap(const QVariant &variant /GetWrapper/) /NoDerived/;
|
||||
%MethodCode
|
||||
if (a0->canConvert<QBitmap>())
|
||||
sipCpp = new sipQBitmap(a0->value<QBitmap>());
|
||||
else
|
||||
sipError = sipBadCallableArg(0, a0Wrapper);
|
||||
%End
|
||||
|
||||
virtual ~QBitmap();
|
||||
void clear();
|
||||
static QBitmap fromImage(const QImage &image, Qt::ImageConversionFlags flags = Qt::ImageConversionFlag::AutoColor);
|
||||
static QBitmap fromData(const QSize &size, const uchar *bits, QImage::Format format = QImage::Format_MonoLSB);
|
||||
QBitmap transformed(const QTransform &matrix) const;
|
||||
void swap(QBitmap &other /Constrained/);
|
||||
};
|
||||
@@ -0,0 +1,439 @@
|
||||
// qbrush.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QBrush /TypeHintIn="Union[QBrush, QColor, QGradient]"/
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qbrush.h>
|
||||
%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 (sipCanConvertToType(sipPy, sipType_QBrush, SIP_NO_CONVERTORS) ||
|
||||
sipCanConvertToType(sipPy, sipType_QColor, 0) ||
|
||||
sipCanConvertToType(sipPy, sipType_QGradient, 0));
|
||||
|
||||
if (sipCanConvertToType(sipPy, sipType_QBrush, SIP_NO_CONVERTORS))
|
||||
{
|
||||
*sipCppPtr = reinterpret_cast<QBrush *>(sipConvertToType(sipPy, sipType_QBrush, sipTransferObj, SIP_NO_CONVERTORS, 0, sipIsErr));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int state;
|
||||
|
||||
if (sipCanConvertToType(sipPy, sipType_QColor, 0))
|
||||
{
|
||||
QColor *c = reinterpret_cast<QColor *>(sipConvertToType(sipPy, sipType_QColor, 0, 0, &state, sipIsErr));
|
||||
|
||||
if (*sipIsErr)
|
||||
{
|
||||
sipReleaseType(c, sipType_QColor, state);
|
||||
return 0;
|
||||
}
|
||||
|
||||
*sipCppPtr = new QBrush(*c);
|
||||
|
||||
sipReleaseType(c, sipType_QColor, state);
|
||||
|
||||
return sipGetState(sipTransferObj);
|
||||
}
|
||||
|
||||
QGradient *g = reinterpret_cast<QGradient *>(sipConvertToType(sipPy, sipType_QGradient, 0, 0, &state, sipIsErr));
|
||||
|
||||
if (*sipIsErr)
|
||||
{
|
||||
sipReleaseType(g, sipType_QGradient, state);
|
||||
return 0;
|
||||
}
|
||||
|
||||
*sipCppPtr = new QBrush(*g);
|
||||
|
||||
sipReleaseType(g, sipType_QGradient, state);
|
||||
|
||||
return sipGetState(sipTransferObj);
|
||||
%End
|
||||
|
||||
public:
|
||||
QBrush();
|
||||
QBrush(Qt::BrushStyle bs);
|
||||
QBrush(const QColor &color, Qt::BrushStyle style = Qt::SolidPattern);
|
||||
QBrush(const QColor &color, const QPixmap &pixmap);
|
||||
QBrush(const QPixmap &pixmap);
|
||||
QBrush(const QImage &image);
|
||||
QBrush(const QBrush &brush);
|
||||
QBrush(const QVariant &variant /GetWrapper/) /NoDerived/;
|
||||
%MethodCode
|
||||
if (a0->canConvert<QBrush>())
|
||||
sipCpp = new QBrush(a0->value<QBrush>());
|
||||
else
|
||||
sipError = sipBadCallableArg(0, a0Wrapper);
|
||||
%End
|
||||
|
||||
~QBrush();
|
||||
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;
|
||||
void setTextureImage(const QImage &image);
|
||||
QImage textureImage() const;
|
||||
void setTransform(const QTransform &);
|
||||
QTransform transform() const;
|
||||
void swap(QBrush &other /Constrained/);
|
||||
};
|
||||
|
||||
QDataStream &operator>>(QDataStream &, QBrush & /Constrained/) /ReleaseGIL/;
|
||||
QDataStream &operator<<(QDataStream &, const QBrush & /Constrained/) /ReleaseGIL/;
|
||||
typedef QVector<QPair<qreal, QColor>> QGradientStops;
|
||||
|
||||
class QGradient
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qbrush.h>
|
||||
%End
|
||||
|
||||
%ConvertToSubClassCode
|
||||
switch (sipCpp->type())
|
||||
{
|
||||
case QGradient::ConicalGradient:
|
||||
sipType = sipType_QConicalGradient;
|
||||
break;
|
||||
|
||||
case QGradient::LinearGradient:
|
||||
sipType = sipType_QLinearGradient;
|
||||
break;
|
||||
|
||||
case QGradient::RadialGradient:
|
||||
sipType = sipType_QRadialGradient;
|
||||
break;
|
||||
|
||||
default:
|
||||
sipType = 0;
|
||||
}
|
||||
%End
|
||||
|
||||
public:
|
||||
enum CoordinateMode
|
||||
{
|
||||
LogicalMode,
|
||||
StretchToDeviceMode,
|
||||
ObjectBoundingMode,
|
||||
%If (Qt_5_12_0 -)
|
||||
ObjectMode,
|
||||
%End
|
||||
};
|
||||
|
||||
enum Type
|
||||
{
|
||||
LinearGradient,
|
||||
RadialGradient,
|
||||
ConicalGradient,
|
||||
NoGradient,
|
||||
};
|
||||
|
||||
enum Spread
|
||||
{
|
||||
PadSpread,
|
||||
ReflectSpread,
|
||||
RepeatSpread,
|
||||
};
|
||||
|
||||
%If (Qt_5_12_0 -)
|
||||
|
||||
enum Preset
|
||||
{
|
||||
WarmFlame,
|
||||
NightFade,
|
||||
SpringWarmth,
|
||||
JuicyPeach,
|
||||
YoungPassion,
|
||||
LadyLips,
|
||||
SunnyMorning,
|
||||
RainyAshville,
|
||||
FrozenDreams,
|
||||
WinterNeva,
|
||||
DustyGrass,
|
||||
TemptingAzure,
|
||||
HeavyRain,
|
||||
AmyCrisp,
|
||||
MeanFruit,
|
||||
DeepBlue,
|
||||
RipeMalinka,
|
||||
CloudyKnoxville,
|
||||
MalibuBeach,
|
||||
NewLife,
|
||||
TrueSunset,
|
||||
MorpheusDen,
|
||||
RareWind,
|
||||
NearMoon,
|
||||
WildApple,
|
||||
SaintPetersburg,
|
||||
PlumPlate,
|
||||
EverlastingSky,
|
||||
HappyFisher,
|
||||
Blessing,
|
||||
SharpeyeEagle,
|
||||
LadogaBottom,
|
||||
LemonGate,
|
||||
ItmeoBranding,
|
||||
ZeusMiracle,
|
||||
OldHat,
|
||||
StarWine,
|
||||
HappyAcid,
|
||||
AwesomePine,
|
||||
NewYork,
|
||||
ShyRainbow,
|
||||
MixedHopes,
|
||||
FlyHigh,
|
||||
StrongBliss,
|
||||
FreshMilk,
|
||||
SnowAgain,
|
||||
FebruaryInk,
|
||||
KindSteel,
|
||||
SoftGrass,
|
||||
GrownEarly,
|
||||
SharpBlues,
|
||||
ShadyWater,
|
||||
DirtyBeauty,
|
||||
GreatWhale,
|
||||
TeenNotebook,
|
||||
PoliteRumors,
|
||||
SweetPeriod,
|
||||
WideMatrix,
|
||||
SoftCherish,
|
||||
RedSalvation,
|
||||
BurningSpring,
|
||||
NightParty,
|
||||
SkyGlider,
|
||||
HeavenPeach,
|
||||
PurpleDivision,
|
||||
AquaSplash,
|
||||
SpikyNaga,
|
||||
LoveKiss,
|
||||
CleanMirror,
|
||||
PremiumDark,
|
||||
ColdEvening,
|
||||
CochitiLake,
|
||||
SummerGames,
|
||||
PassionateBed,
|
||||
MountainRock,
|
||||
DesertHump,
|
||||
JungleDay,
|
||||
PhoenixStart,
|
||||
OctoberSilence,
|
||||
FarawayRiver,
|
||||
AlchemistLab,
|
||||
OverSun,
|
||||
PremiumWhite,
|
||||
MarsParty,
|
||||
EternalConstance,
|
||||
JapanBlush,
|
||||
SmilingRain,
|
||||
CloudyApple,
|
||||
BigMango,
|
||||
HealthyWater,
|
||||
AmourAmour,
|
||||
RiskyConcrete,
|
||||
StrongStick,
|
||||
ViciousStance,
|
||||
PaloAlto,
|
||||
HappyMemories,
|
||||
MidnightBloom,
|
||||
Crystalline,
|
||||
PartyBliss,
|
||||
ConfidentCloud,
|
||||
LeCocktail,
|
||||
RiverCity,
|
||||
FrozenBerry,
|
||||
ChildCare,
|
||||
FlyingLemon,
|
||||
NewRetrowave,
|
||||
HiddenJaguar,
|
||||
AboveTheSky,
|
||||
Nega,
|
||||
DenseWater,
|
||||
Seashore,
|
||||
MarbleWall,
|
||||
CheerfulCaramel,
|
||||
NightSky,
|
||||
MagicLake,
|
||||
YoungGrass,
|
||||
ColorfulPeach,
|
||||
GentleCare,
|
||||
PlumBath,
|
||||
HappyUnicorn,
|
||||
AfricanField,
|
||||
SolidStone,
|
||||
OrangeJuice,
|
||||
GlassWater,
|
||||
NorthMiracle,
|
||||
FruitBlend,
|
||||
MillenniumPine,
|
||||
HighFlight,
|
||||
MoleHall,
|
||||
SpaceShift,
|
||||
ForestInei,
|
||||
RoyalGarden,
|
||||
RichMetal,
|
||||
JuicyCake,
|
||||
SmartIndigo,
|
||||
SandStrike,
|
||||
NorseBeauty,
|
||||
AquaGuidance,
|
||||
SunVeggie,
|
||||
SeaLord,
|
||||
BlackSea,
|
||||
GrassShampoo,
|
||||
LandingAircraft,
|
||||
WitchDance,
|
||||
SleeplessNight,
|
||||
AngelCare,
|
||||
CrystalRiver,
|
||||
SoftLipstick,
|
||||
SaltMountain,
|
||||
PerfectWhite,
|
||||
FreshOasis,
|
||||
StrictNovember,
|
||||
MorningSalad,
|
||||
DeepRelief,
|
||||
SeaStrike,
|
||||
NightCall,
|
||||
SupremeSky,
|
||||
LightBlue,
|
||||
MindCrawl,
|
||||
LilyMeadow,
|
||||
SugarLollipop,
|
||||
SweetDessert,
|
||||
MagicRay,
|
||||
TeenParty,
|
||||
FrozenHeat,
|
||||
GagarinView,
|
||||
FabledSunset,
|
||||
PerfectBlue,
|
||||
%If (Qt_5_14_0 -)
|
||||
NumPresets,
|
||||
%End
|
||||
};
|
||||
|
||||
%End
|
||||
QGradient();
|
||||
%If (Qt_5_12_0 -)
|
||||
QGradient(QGradient::Preset);
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
~QGradient();
|
||||
%End
|
||||
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;
|
||||
bool operator!=(const QGradient &other) const;
|
||||
void setSpread(QGradient::Spread aspread);
|
||||
QGradient::CoordinateMode coordinateMode() const;
|
||||
void setCoordinateMode(QGradient::CoordinateMode mode);
|
||||
};
|
||||
|
||||
class QLinearGradient : public QGradient
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qbrush.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QLinearGradient();
|
||||
QLinearGradient(const QPointF &start, const QPointF &finalStop);
|
||||
QLinearGradient(qreal xStart, qreal yStart, qreal xFinalStop, qreal yFinalStop);
|
||||
%If (Qt_5_14_0 -)
|
||||
~QLinearGradient();
|
||||
%End
|
||||
QPointF start() const;
|
||||
QPointF finalStop() const;
|
||||
void setStart(const QPointF &start);
|
||||
void setStart(qreal x, qreal y);
|
||||
void setFinalStop(const QPointF &stop);
|
||||
void setFinalStop(qreal x, qreal y);
|
||||
};
|
||||
|
||||
class QRadialGradient : public QGradient
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qbrush.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QRadialGradient();
|
||||
QRadialGradient(const QPointF ¢er, qreal radius, const QPointF &focalPoint);
|
||||
QRadialGradient(const QPointF ¢er, qreal centerRadius, const QPointF &focalPoint, qreal focalRadius);
|
||||
QRadialGradient(const QPointF ¢er, qreal radius);
|
||||
QRadialGradient(qreal cx, qreal cy, qreal radius, qreal fx, qreal fy);
|
||||
QRadialGradient(qreal cx, qreal cy, qreal centerRadius, qreal fx, qreal fy, qreal focalRadius);
|
||||
QRadialGradient(qreal cx, qreal cy, qreal radius);
|
||||
%If (Qt_5_14_0 -)
|
||||
~QRadialGradient();
|
||||
%End
|
||||
QPointF center() const;
|
||||
QPointF focalPoint() const;
|
||||
qreal radius() const;
|
||||
void setCenter(const QPointF ¢er);
|
||||
void setCenter(qreal x, qreal y);
|
||||
void setFocalPoint(const QPointF &focalPoint);
|
||||
void setFocalPoint(qreal x, qreal y);
|
||||
void setRadius(qreal radius);
|
||||
qreal centerRadius() const;
|
||||
void setCenterRadius(qreal radius);
|
||||
qreal focalRadius() const;
|
||||
void setFocalRadius(qreal radius);
|
||||
};
|
||||
|
||||
class QConicalGradient : public QGradient
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qbrush.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QConicalGradient();
|
||||
QConicalGradient(const QPointF ¢er, qreal startAngle);
|
||||
QConicalGradient(qreal cx, qreal cy, qreal startAngle);
|
||||
%If (Qt_5_14_0 -)
|
||||
~QConicalGradient();
|
||||
%End
|
||||
QPointF center() const;
|
||||
qreal angle() const;
|
||||
void setCenter(const QPointF ¢er);
|
||||
void setCenter(qreal x, qreal y);
|
||||
void setAngle(qreal angle);
|
||||
};
|
||||
@@ -0,0 +1,95 @@
|
||||
// qclipboard.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QClipboard : public QObject
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qclipboard.h>
|
||||
%End
|
||||
|
||||
explicit QClipboard(QObject *parent /TransferThis/);
|
||||
virtual ~QClipboard();
|
||||
|
||||
public:
|
||||
enum Mode
|
||||
{
|
||||
Clipboard,
|
||||
Selection,
|
||||
FindBuffer,
|
||||
};
|
||||
|
||||
void clear(QClipboard::Mode mode = QClipboard::Clipboard);
|
||||
bool supportsFindBuffer() const;
|
||||
bool supportsSelection() const;
|
||||
bool ownsClipboard() const;
|
||||
bool ownsFindBuffer() const;
|
||||
bool ownsSelection() const;
|
||||
QString text(QClipboard::Mode mode = QClipboard::Clipboard) const;
|
||||
SIP_PYTUPLE text(const QString &subtype, QClipboard::Mode mode = QClipboard::Clipboard) const /TypeHint="Tuple[QString, QString]"/;
|
||||
%MethodCode
|
||||
QString *text;
|
||||
QString *subtype = new QString(*a0);
|
||||
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
text = new QString(sipCpp->text(*subtype, a1));
|
||||
Py_END_ALLOW_THREADS
|
||||
|
||||
PyObject *text_obj = sipConvertFromNewType(text, sipType_QString, NULL);
|
||||
PyObject *subtype_obj = sipConvertFromNewType(subtype, sipType_QString, NULL);
|
||||
|
||||
if (text_obj && subtype_obj)
|
||||
sipRes = PyTuple_Pack(2, text_obj, subtype_obj);
|
||||
|
||||
Py_XDECREF(text_obj);
|
||||
Py_XDECREF(subtype_obj);
|
||||
%End
|
||||
|
||||
void setText(const QString &, QClipboard::Mode mode = QClipboard::Clipboard);
|
||||
const QMimeData *mimeData(QClipboard::Mode mode = QClipboard::Clipboard) const;
|
||||
void setMimeData(QMimeData *data /GetWrapper/, QClipboard::Mode mode = QClipboard::Clipboard);
|
||||
%MethodCode
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
sipCpp->setMimeData(a0, a1);
|
||||
Py_END_ALLOW_THREADS
|
||||
|
||||
// Transfer ownership to C++ and make sure the Python object stays alive by
|
||||
// giving it a reference to itself. The cycle will be broken by QMimeData's
|
||||
// virtual dtor. The reason we don't do the obvious and just use /Transfer/ is
|
||||
// that the QClipboard Python object we would transfer ownership to is likely
|
||||
// to be garbage collected immediately afterwards.
|
||||
sipTransferTo(a0Wrapper, a0Wrapper);
|
||||
%End
|
||||
|
||||
QImage image(QClipboard::Mode mode = QClipboard::Clipboard) const;
|
||||
QPixmap pixmap(QClipboard::Mode mode = QClipboard::Clipboard) const;
|
||||
void setImage(const QImage &, QClipboard::Mode mode = QClipboard::Clipboard);
|
||||
void setPixmap(const QPixmap &, QClipboard::Mode mode = QClipboard::Clipboard);
|
||||
|
||||
signals:
|
||||
void changed(QClipboard::Mode mode);
|
||||
void dataChanged();
|
||||
void findBufferChanged();
|
||||
void selectionChanged();
|
||||
|
||||
private:
|
||||
QClipboard(const QClipboard &);
|
||||
};
|
||||
@@ -0,0 +1,388 @@
|
||||
// qcolor.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QColor /TypeHintIn="Union[QColor, Qt.GlobalColor]"/
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qcolor.h>
|
||||
%End
|
||||
|
||||
%ConvertToTypeCode
|
||||
// SIP doesn't support automatic type convertors so we explicitly allow a
|
||||
// Qt::GlobalColor to be used whenever a QColor 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 (PyObject_TypeCheck(sipPy, sipTypeAsPyTypeObject(sipType_Qt_GlobalColor)) ||
|
||||
sipCanConvertToType(sipPy, sipType_QColor, SIP_NO_CONVERTORS));
|
||||
|
||||
if (PyObject_TypeCheck(sipPy, sipTypeAsPyTypeObject(sipType_Qt_GlobalColor)))
|
||||
{
|
||||
*sipCppPtr = new QColor((Qt::GlobalColor)SIPLong_AsLong(sipPy));
|
||||
|
||||
return sipGetState(sipTransferObj);
|
||||
}
|
||||
|
||||
*sipCppPtr = reinterpret_cast<QColor *>(sipConvertToType(sipPy, sipType_QColor, sipTransferObj, SIP_NO_CONVERTORS, 0, sipIsErr));
|
||||
|
||||
return 0;
|
||||
%End
|
||||
|
||||
%PickleCode
|
||||
sipRes = Py_BuildValue((char *)"iiii", sipCpp->red(), sipCpp->green(), sipCpp->blue(), sipCpp->alpha());
|
||||
%End
|
||||
|
||||
public:
|
||||
enum Spec
|
||||
{
|
||||
Invalid,
|
||||
Rgb,
|
||||
Hsv,
|
||||
Cmyk,
|
||||
Hsl,
|
||||
%If (Qt_5_14_0 -)
|
||||
ExtendedRgb,
|
||||
%End
|
||||
};
|
||||
|
||||
QColor(Qt::GlobalColor color /Constrained/);
|
||||
QColor(QRgb rgb);
|
||||
%If (Qt_5_6_0 -)
|
||||
QColor(QRgba64 rgba64);
|
||||
%End
|
||||
QColor(const QVariant &variant /GetWrapper/) /NoDerived/;
|
||||
%MethodCode
|
||||
if (a0->canConvert<QColor>())
|
||||
sipCpp = new QColor(a0->value<QColor>());
|
||||
else
|
||||
sipError = sipBadCallableArg(0, a0Wrapper);
|
||||
%End
|
||||
|
||||
QString name() const;
|
||||
void setNamedColor(const QString &name);
|
||||
static QStringList colorNames();
|
||||
QColor::Spec spec() const;
|
||||
int alpha() const;
|
||||
void setAlpha(int alpha);
|
||||
qreal alphaF() const;
|
||||
void setAlphaF(qreal alpha);
|
||||
int red() const;
|
||||
int green() const;
|
||||
int blue() const;
|
||||
void setRed(int red);
|
||||
void setGreen(int green);
|
||||
void setBlue(int blue);
|
||||
qreal redF() const;
|
||||
qreal greenF() const;
|
||||
qreal blueF() const;
|
||||
void setRedF(qreal red);
|
||||
void setGreenF(qreal green);
|
||||
void setBlueF(qreal blue);
|
||||
void getRgb(int *r, int *g, int *b, int *alpha = 0) const;
|
||||
void setRgb(int r, int g, int b, int alpha = 255);
|
||||
void getRgbF(qreal *r, qreal *g, qreal *b, qreal *alpha = 0) const;
|
||||
void setRgbF(qreal r, qreal g, qreal b, qreal alpha = 1.);
|
||||
QRgb rgba() const;
|
||||
void setRgba(QRgb rgba);
|
||||
QRgb rgb() const;
|
||||
void setRgb(QRgb rgb);
|
||||
int hue() const;
|
||||
int saturation() const;
|
||||
int value() const;
|
||||
qreal hueF() const;
|
||||
qreal saturationF() const;
|
||||
qreal valueF() const;
|
||||
void getHsv(int *h, int *s, int *v, int *alpha = 0) const;
|
||||
void setHsv(int h, int s, int v, int alpha = 255);
|
||||
void getHsvF(qreal *h, qreal *s, qreal *v, qreal *alpha = 0) const;
|
||||
void setHsvF(qreal h, qreal s, qreal v, qreal alpha = 1.);
|
||||
int cyan() const;
|
||||
int magenta() const;
|
||||
int yellow() const;
|
||||
int black() const;
|
||||
qreal cyanF() const;
|
||||
qreal magentaF() const;
|
||||
qreal yellowF() const;
|
||||
qreal blackF() const;
|
||||
void getCmyk(int *c, int *m, int *y, int *k, int *alpha = 0);
|
||||
void setCmyk(int c, int m, int y, int k, int alpha = 255);
|
||||
void getCmykF(qreal *c, qreal *m, qreal *y, qreal *k, qreal *alpha = 0);
|
||||
void setCmykF(qreal c, qreal m, qreal y, qreal k, qreal alpha = 1.);
|
||||
QColor toRgb() const;
|
||||
QColor toHsv() const;
|
||||
QColor toCmyk() const;
|
||||
QColor convertTo(QColor::Spec colorSpec) const;
|
||||
static QColor fromRgb(QRgb rgb);
|
||||
static QColor fromRgba(QRgb rgba);
|
||||
static QColor fromRgb(int r, int g, int b, int alpha = 255);
|
||||
static QColor fromRgbF(qreal r, qreal g, qreal b, qreal alpha = 1.);
|
||||
static QColor fromHsv(int h, int s, int v, int alpha = 255);
|
||||
static QColor fromHsvF(qreal h, qreal s, qreal v, qreal alpha = 1.);
|
||||
static QColor fromCmyk(int c, int m, int y, int k, int alpha = 255);
|
||||
static QColor fromCmykF(qreal c, qreal m, qreal y, qreal k, qreal alpha = 1.);
|
||||
bool operator==(const QColor &c) const;
|
||||
bool operator!=(const QColor &c) const;
|
||||
QColor();
|
||||
QColor(int r, int g, int b, int alpha = 255);
|
||||
QColor(const QString &aname);
|
||||
QColor(const QColor &acolor);
|
||||
bool isValid() const;
|
||||
QColor lighter(int factor = 150) const;
|
||||
QColor darker(int factor = 200) const;
|
||||
int hsvHue() const;
|
||||
int hsvSaturation() const;
|
||||
qreal hsvHueF() const;
|
||||
qreal hsvSaturationF() const;
|
||||
int hslHue() const;
|
||||
int hslSaturation() const;
|
||||
int lightness() const;
|
||||
qreal hslHueF() const;
|
||||
qreal hslSaturationF() const;
|
||||
qreal lightnessF() const;
|
||||
void getHsl(int *h, int *s, int *l, int *alpha = 0) const;
|
||||
void setHsl(int h, int s, int l, int alpha = 255);
|
||||
void getHslF(qreal *h, qreal *s, qreal *l, qreal *alpha = 0) const;
|
||||
void setHslF(qreal h, qreal s, qreal l, qreal alpha = 1.);
|
||||
QColor toHsl() const;
|
||||
static QColor fromHsl(int h, int s, int l, int alpha = 255);
|
||||
static QColor fromHslF(qreal h, qreal s, qreal l, qreal alpha = 1.);
|
||||
static bool isValidColor(const QString &name);
|
||||
%If (Qt_5_2_0 -)
|
||||
|
||||
enum NameFormat
|
||||
{
|
||||
HexRgb,
|
||||
HexArgb,
|
||||
};
|
||||
|
||||
%End
|
||||
%If (Qt_5_2_0 -)
|
||||
QString name(QColor::NameFormat format) const;
|
||||
%End
|
||||
%If (Qt_5_6_0 -)
|
||||
QRgba64 rgba64() const;
|
||||
%End
|
||||
%If (Qt_5_6_0 -)
|
||||
void setRgba64(QRgba64 rgba);
|
||||
%End
|
||||
%If (Qt_5_6_0 -)
|
||||
static QColor fromRgba64(ushort r, ushort g, ushort b, ushort alpha = 65535);
|
||||
%End
|
||||
%If (Qt_5_6_0 -)
|
||||
static QColor fromRgba64(QRgba64 rgba);
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
QColor toExtendedRgb() const;
|
||||
%End
|
||||
};
|
||||
|
||||
QDataStream &operator<<(QDataStream &, const QColor & /Constrained/) /ReleaseGIL/;
|
||||
QDataStream &operator>>(QDataStream &, QColor & /Constrained/) /ReleaseGIL/;
|
||||
%If (Qt_5_14_0 -)
|
||||
%If (PyQt_CONSTEXPR)
|
||||
|
||||
namespace QColorConstants
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qcolor.h>
|
||||
%End
|
||||
|
||||
const QColor Color0;
|
||||
const QColor Color1;
|
||||
const QColor Black;
|
||||
const QColor White;
|
||||
const QColor DarkGray;
|
||||
const QColor Gray;
|
||||
const QColor LightGray;
|
||||
const QColor Red;
|
||||
const QColor Green;
|
||||
const QColor Blue;
|
||||
const QColor Cyan;
|
||||
const QColor Magenta;
|
||||
const QColor Yellow;
|
||||
const QColor DarkRed;
|
||||
const QColor DarkGreen;
|
||||
const QColor DarkBlue;
|
||||
const QColor DarkCyan;
|
||||
const QColor DarkMagenta;
|
||||
const QColor DarkYellow;
|
||||
const QColor Transparent;
|
||||
|
||||
namespace Svg
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qcolor.h>
|
||||
%End
|
||||
|
||||
const QColor aliceblue;
|
||||
const QColor antiquewhite;
|
||||
const QColor aqua;
|
||||
const QColor aquamarine;
|
||||
const QColor azure;
|
||||
const QColor beige;
|
||||
const QColor bisque;
|
||||
const QColor black;
|
||||
const QColor blanchedalmond;
|
||||
const QColor blue;
|
||||
const QColor blueviolet;
|
||||
const QColor brown;
|
||||
const QColor burlywood;
|
||||
const QColor cadetblue;
|
||||
const QColor chartreuse;
|
||||
const QColor chocolate;
|
||||
const QColor coral;
|
||||
const QColor cornflowerblue;
|
||||
const QColor cornsilk;
|
||||
const QColor crimson;
|
||||
const QColor cyan;
|
||||
const QColor darkblue;
|
||||
const QColor darkcyan;
|
||||
const QColor darkgoldenrod;
|
||||
const QColor darkgray;
|
||||
const QColor darkgreen;
|
||||
const QColor darkgrey;
|
||||
const QColor darkkhaki;
|
||||
const QColor darkmagenta;
|
||||
const QColor darkolivegreen;
|
||||
const QColor darkorange;
|
||||
const QColor darkorchid;
|
||||
const QColor darkred;
|
||||
const QColor darksalmon;
|
||||
const QColor darkseagreen;
|
||||
const QColor darkslateblue;
|
||||
const QColor darkslategray;
|
||||
const QColor darkslategrey;
|
||||
const QColor darkturquoise;
|
||||
const QColor darkviolet;
|
||||
const QColor deeppink;
|
||||
const QColor deepskyblue;
|
||||
const QColor dimgray;
|
||||
const QColor dimgrey;
|
||||
const QColor dodgerblue;
|
||||
const QColor firebrick;
|
||||
const QColor floralwhite;
|
||||
const QColor forestgreen;
|
||||
const QColor fuchsia;
|
||||
const QColor gainsboro;
|
||||
const QColor ghostwhite;
|
||||
const QColor gold;
|
||||
const QColor goldenrod;
|
||||
const QColor gray;
|
||||
const QColor green;
|
||||
const QColor greenyellow;
|
||||
const QColor grey;
|
||||
const QColor honeydew;
|
||||
const QColor hotpink;
|
||||
const QColor indianred;
|
||||
const QColor indigo;
|
||||
const QColor ivory;
|
||||
const QColor khaki;
|
||||
const QColor lavender;
|
||||
const QColor lavenderblush;
|
||||
const QColor lawngreen;
|
||||
const QColor lemonchiffon;
|
||||
const QColor lightblue;
|
||||
const QColor lightcoral;
|
||||
const QColor lightcyan;
|
||||
const QColor lightgoldenrodyellow;
|
||||
const QColor lightgray;
|
||||
const QColor lightgreen;
|
||||
const QColor lightgrey;
|
||||
const QColor lightpink;
|
||||
const QColor lightsalmon;
|
||||
const QColor lightseagreen;
|
||||
const QColor lightskyblue;
|
||||
const QColor lightslategray;
|
||||
const QColor lightslategrey;
|
||||
const QColor lightsteelblue;
|
||||
const QColor lightyellow;
|
||||
const QColor lime;
|
||||
const QColor limegreen;
|
||||
const QColor linen;
|
||||
const QColor magenta;
|
||||
const QColor maroon;
|
||||
const QColor mediumaquamarine;
|
||||
const QColor mediumblue;
|
||||
const QColor mediumorchid;
|
||||
const QColor mediumpurple;
|
||||
const QColor mediumseagreen;
|
||||
const QColor mediumslateblue;
|
||||
const QColor mediumspringgreen;
|
||||
const QColor mediumturquoise;
|
||||
const QColor mediumvioletred;
|
||||
const QColor midnightblue;
|
||||
const QColor mintcream;
|
||||
const QColor mistyrose;
|
||||
const QColor moccasin;
|
||||
const QColor navajowhite;
|
||||
const QColor navy;
|
||||
const QColor oldlace;
|
||||
const QColor olive;
|
||||
const QColor olivedrab;
|
||||
const QColor orange;
|
||||
const QColor orangered;
|
||||
const QColor orchid;
|
||||
const QColor palegoldenrod;
|
||||
const QColor palegreen;
|
||||
const QColor paleturquoise;
|
||||
const QColor palevioletred;
|
||||
const QColor papayawhip;
|
||||
const QColor peachpuff;
|
||||
const QColor peru;
|
||||
const QColor pink;
|
||||
const QColor plum;
|
||||
const QColor powderblue;
|
||||
const QColor purple;
|
||||
const QColor red;
|
||||
const QColor rosybrown;
|
||||
const QColor royalblue;
|
||||
const QColor saddlebrown;
|
||||
const QColor salmon;
|
||||
const QColor sandybrown;
|
||||
const QColor seagreen;
|
||||
const QColor seashell;
|
||||
const QColor sienna;
|
||||
const QColor silver;
|
||||
const QColor skyblue;
|
||||
const QColor slateblue;
|
||||
const QColor slategray;
|
||||
const QColor slategrey;
|
||||
const QColor snow;
|
||||
const QColor springgreen;
|
||||
const QColor steelblue;
|
||||
const QColor tan;
|
||||
const QColor teal;
|
||||
const QColor thistle;
|
||||
const QColor tomato;
|
||||
const QColor turquoise;
|
||||
const QColor violet;
|
||||
const QColor wheat;
|
||||
const QColor white;
|
||||
const QColor whitesmoke;
|
||||
const QColor yellow;
|
||||
const QColor yellowgreen;
|
||||
};
|
||||
};
|
||||
|
||||
%End
|
||||
%End
|
||||
@@ -0,0 +1,92 @@
|
||||
// qcolorspace.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (Qt_5_14_0 -)
|
||||
|
||||
class QColorSpace
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qcolorspace.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum NamedColorSpace
|
||||
{
|
||||
SRgb,
|
||||
SRgbLinear,
|
||||
AdobeRgb,
|
||||
DisplayP3,
|
||||
ProPhotoRgb,
|
||||
};
|
||||
|
||||
enum class Primaries
|
||||
{
|
||||
Custom,
|
||||
SRgb,
|
||||
AdobeRgb,
|
||||
DciP3D65,
|
||||
ProPhotoRgb,
|
||||
};
|
||||
|
||||
enum class TransferFunction
|
||||
{
|
||||
Custom,
|
||||
Linear,
|
||||
Gamma,
|
||||
SRgb,
|
||||
ProPhotoRgb,
|
||||
};
|
||||
|
||||
QColorSpace();
|
||||
QColorSpace(QColorSpace::NamedColorSpace namedColorSpace);
|
||||
QColorSpace(QColorSpace::Primaries primaries, QColorSpace::TransferFunction fun, float gamma = 0.F);
|
||||
QColorSpace(QColorSpace::Primaries primaries, float gamma);
|
||||
QColorSpace(const QPointF &whitePoint, const QPointF &redPoint, const QPointF &greenPoint, const QPointF &bluePoint, QColorSpace::TransferFunction fun, float gamma = 0.F);
|
||||
QColorSpace(const QColorSpace &colorSpace);
|
||||
~QColorSpace();
|
||||
void swap(QColorSpace &colorSpace /Constrained/);
|
||||
QColorSpace::Primaries primaries() const;
|
||||
QColorSpace::TransferFunction transferFunction() const;
|
||||
float gamma() const;
|
||||
void setTransferFunction(QColorSpace::TransferFunction transferFunction, float gamma = 0.F);
|
||||
QColorSpace withTransferFunction(QColorSpace::TransferFunction transferFunction, float gamma = 0.F) const;
|
||||
void setPrimaries(QColorSpace::Primaries primariesId);
|
||||
void setPrimaries(const QPointF &whitePoint, const QPointF &redPoint, const QPointF &greenPoint, const QPointF &bluePoint);
|
||||
bool isValid() const;
|
||||
static QColorSpace fromIccProfile(const QByteArray &iccProfile);
|
||||
QByteArray iccProfile() const;
|
||||
QColorTransform transformationToColorSpace(const QColorSpace &colorspace) const;
|
||||
};
|
||||
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
bool operator==(const QColorSpace &colorSpace1, const QColorSpace &colorSpace2);
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
bool operator!=(const QColorSpace &colorSpace1, const QColorSpace &colorSpace2);
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
QDataStream &operator<<(QDataStream &, const QColorSpace & /Constrained/) /ReleaseGIL/;
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
QDataStream &operator>>(QDataStream &, QColorSpace & /Constrained/) /ReleaseGIL/;
|
||||
%End
|
||||
@@ -0,0 +1,41 @@
|
||||
// qcolortransform.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (Qt_5_14_0 -)
|
||||
|
||||
class QColorTransform
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qcolortransform.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QColorTransform();
|
||||
QColorTransform(const QColorTransform &colorTransform);
|
||||
~QColorTransform();
|
||||
void swap(QColorTransform &other /Constrained/);
|
||||
QRgb map(QRgb argb) const;
|
||||
QRgba64 map(QRgba64 rgba64) const;
|
||||
QColor map(const QColor &color) const;
|
||||
};
|
||||
|
||||
%End
|
||||
@@ -0,0 +1,87 @@
|
||||
// qcursor.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QCursor /TypeHintIn="Union[QCursor, Qt.CursorShape]"/
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qcursor.h>
|
||||
%End
|
||||
|
||||
%ConvertToTypeCode
|
||||
// SIP doesn't support automatic type convertors so we explicitly allow a
|
||||
// Qt::CursorShape to be used whenever a QCursor is expected.
|
||||
|
||||
if (sipIsErr == NULL)
|
||||
return (PyObject_TypeCheck(sipPy, sipTypeAsPyTypeObject(sipType_Qt_CursorShape)) ||
|
||||
sipCanConvertToType(sipPy, sipType_QCursor, SIP_NO_CONVERTORS));
|
||||
|
||||
if (PyObject_TypeCheck(sipPy, sipTypeAsPyTypeObject(sipType_Qt_CursorShape)))
|
||||
{
|
||||
*sipCppPtr = new QCursor((Qt::CursorShape)SIPLong_AsLong(sipPy));
|
||||
|
||||
return sipGetState(sipTransferObj);
|
||||
}
|
||||
|
||||
*sipCppPtr = reinterpret_cast<QCursor *>(sipConvertToType(sipPy, sipType_QCursor, sipTransferObj, SIP_NO_CONVERTORS, 0, sipIsErr));
|
||||
|
||||
return 0;
|
||||
%End
|
||||
|
||||
public:
|
||||
QCursor();
|
||||
QCursor(const QBitmap &bitmap, const QBitmap &mask, int hotX = -1, int hotY = -1);
|
||||
QCursor(const QPixmap &pixmap, int hotX = -1, int hotY = -1);
|
||||
QCursor(const QCursor &cursor);
|
||||
QCursor(const QVariant &variant /GetWrapper/) /NoDerived/;
|
||||
%MethodCode
|
||||
if (a0->canConvert<QCursor>())
|
||||
sipCpp = new QCursor(a0->value<QCursor>());
|
||||
else
|
||||
sipError = sipBadCallableArg(0, a0Wrapper);
|
||||
%End
|
||||
|
||||
~QCursor();
|
||||
Qt::CursorShape shape() const;
|
||||
void setShape(Qt::CursorShape newShape);
|
||||
const QBitmap *bitmap() const;
|
||||
const QBitmap *mask() const;
|
||||
QPixmap pixmap() const;
|
||||
QPoint hotSpot() const;
|
||||
static QPoint pos();
|
||||
static void setPos(int x, int y);
|
||||
static void setPos(const QPoint &p);
|
||||
static QPoint pos(const QScreen *screen);
|
||||
static void setPos(QScreen *screen, int x, int y);
|
||||
static void setPos(QScreen *screen, const QPoint &p);
|
||||
%If (Qt_5_7_0 -)
|
||||
void swap(QCursor &other);
|
||||
%End
|
||||
};
|
||||
|
||||
QDataStream &operator<<(QDataStream &outS, const QCursor &cursor /Constrained/) /ReleaseGIL/;
|
||||
QDataStream &operator>>(QDataStream &inS, QCursor &cursor /Constrained/) /ReleaseGIL/;
|
||||
%If (Qt_5_10_0 -)
|
||||
bool operator==(const QCursor &lhs, const QCursor &rhs);
|
||||
%End
|
||||
%If (Qt_5_10_0 -)
|
||||
bool operator!=(const QCursor &lhs, const QCursor &rhs);
|
||||
%End
|
||||
@@ -0,0 +1,67 @@
|
||||
// qdesktopservices.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QDesktopServices
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qdesktopservices.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
static bool openUrl(const QUrl &url) /ReleaseGIL/;
|
||||
static void setUrlHandler(const QString &scheme, QObject *receiver, const char *method);
|
||||
static void setUrlHandler(const QString &scheme, SIP_PYCALLABLE method /TypeHint="Callable[[QUrl], None]"/);
|
||||
%MethodCode
|
||||
// Allow a callable that must be a slot of a QObject, although we never tell
|
||||
// the user if it isn't.
|
||||
sipMethodDef pm;
|
||||
|
||||
if (sipGetMethod(a1, &pm))
|
||||
{
|
||||
int iserr = 0;
|
||||
QObject *receiver = reinterpret_cast<QObject *>(sipForceConvertToType(
|
||||
pm.pm_self, sipType_QObject, NULL, SIP_NOT_NONE, NULL, &iserr));
|
||||
|
||||
if (!iserr)
|
||||
{
|
||||
PyObject *f_name_obj = PyObject_GetAttrString(pm.pm_function, "__name__");
|
||||
|
||||
if (f_name_obj)
|
||||
{
|
||||
// We only want a borrowed reference.
|
||||
Py_DECREF(f_name_obj);
|
||||
|
||||
const char *f_name = sipString_AsASCIIString(&f_name_obj);
|
||||
|
||||
if (f_name)
|
||||
{
|
||||
QDesktopServices::setUrlHandler(*a0, receiver, f_name);
|
||||
|
||||
Py_DECREF(f_name_obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
%End
|
||||
|
||||
static void unsetUrlHandler(const QString &scheme);
|
||||
};
|
||||
@@ -0,0 +1,61 @@
|
||||
// qdrag.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QDrag : public QObject
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qdrag.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
explicit QDrag(QObject *dragSource /TransferThis/);
|
||||
virtual ~QDrag();
|
||||
Qt::DropAction exec(Qt::DropActions supportedActions = Qt::MoveAction) /PyName=exec_,ReleaseGIL/;
|
||||
%If (Py_v3)
|
||||
Qt::DropAction exec(Qt::DropActions supportedActions = Qt::MoveAction) /ReleaseGIL/;
|
||||
%End
|
||||
Qt::DropAction exec(Qt::DropActions supportedActions, Qt::DropAction defaultDropAction) /PyName=exec_,ReleaseGIL/;
|
||||
Qt::DropAction exec(Qt::DropActions supportedActions, Qt::DropAction defaultDropAction) /ReleaseGIL/;
|
||||
void setMimeData(QMimeData *data /Transfer/);
|
||||
QMimeData *mimeData() const;
|
||||
void setPixmap(const QPixmap &);
|
||||
QPixmap pixmap() const;
|
||||
void setHotSpot(const QPoint &hotspot);
|
||||
QPoint hotSpot() const;
|
||||
QObject *source() const;
|
||||
QObject *target() const;
|
||||
void setDragCursor(const QPixmap &cursor, Qt::DropAction action);
|
||||
|
||||
signals:
|
||||
void actionChanged(Qt::DropAction action);
|
||||
void targetChanged(QObject *newTarget);
|
||||
|
||||
public:
|
||||
QPixmap dragCursor(Qt::DropAction action) const;
|
||||
Qt::DropActions supportedActions() const;
|
||||
Qt::DropAction defaultAction() const;
|
||||
%If (Qt_5_7_0 -)
|
||||
%If (WS_X11 || WS_WIN)
|
||||
static void cancel();
|
||||
%End
|
||||
%End
|
||||
};
|
||||
@@ -0,0 +1,942 @@
|
||||
// qevent.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QInputEvent : public QEvent /NoDefaultCtors/
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qevent.h>
|
||||
%End
|
||||
|
||||
%ConvertToSubClassCode
|
||||
switch (sipCpp->type())
|
||||
{
|
||||
case QEvent::ActionAdded:
|
||||
case QEvent::ActionChanged:
|
||||
case QEvent::ActionRemoved:
|
||||
sipType = sipType_QActionEvent;
|
||||
break;
|
||||
|
||||
case QEvent::Close:
|
||||
sipType = sipType_QCloseEvent;
|
||||
break;
|
||||
|
||||
case QEvent::ContextMenu:
|
||||
sipType = sipType_QContextMenuEvent;
|
||||
break;
|
||||
|
||||
case QEvent::DragEnter:
|
||||
sipType = sipType_QDragEnterEvent;
|
||||
break;
|
||||
|
||||
case QEvent::DragLeave:
|
||||
sipType = sipType_QDragLeaveEvent;
|
||||
break;
|
||||
|
||||
case QEvent::DragMove:
|
||||
sipType = sipType_QDragMoveEvent;
|
||||
break;
|
||||
|
||||
case QEvent::Drop:
|
||||
sipType = sipType_QDropEvent;
|
||||
break;
|
||||
|
||||
case QEvent::Enter:
|
||||
sipType = sipType_QEnterEvent;
|
||||
break;
|
||||
|
||||
case QEvent::FileOpen:
|
||||
sipType = sipType_QFileOpenEvent;
|
||||
break;
|
||||
|
||||
case QEvent::FocusIn:
|
||||
case QEvent::FocusOut:
|
||||
sipType = sipType_QFocusEvent;
|
||||
break;
|
||||
|
||||
case QEvent::Hide:
|
||||
sipType = sipType_QHideEvent;
|
||||
break;
|
||||
|
||||
case QEvent::HoverEnter:
|
||||
case QEvent::HoverLeave:
|
||||
case QEvent::HoverMove:
|
||||
sipType = sipType_QHoverEvent;
|
||||
break;
|
||||
|
||||
case QEvent::IconDrag:
|
||||
sipType = sipType_QIconDragEvent;
|
||||
break;
|
||||
|
||||
case QEvent::InputMethod:
|
||||
sipType = sipType_QInputMethodEvent;
|
||||
break;
|
||||
|
||||
case QEvent::KeyPress:
|
||||
case QEvent::KeyRelease:
|
||||
case QEvent::ShortcutOverride:
|
||||
sipType = sipType_QKeyEvent;
|
||||
break;
|
||||
|
||||
case QEvent::MouseButtonDblClick:
|
||||
case QEvent::MouseButtonPress:
|
||||
case QEvent::MouseButtonRelease:
|
||||
case QEvent::MouseMove:
|
||||
sipType = sipType_QMouseEvent;
|
||||
break;
|
||||
|
||||
case QEvent::Move:
|
||||
sipType = sipType_QMoveEvent;
|
||||
break;
|
||||
|
||||
case QEvent::Paint:
|
||||
sipType = sipType_QPaintEvent;
|
||||
break;
|
||||
|
||||
case QEvent::Resize:
|
||||
sipType = sipType_QResizeEvent;
|
||||
break;
|
||||
|
||||
case QEvent::Shortcut:
|
||||
sipType = sipType_QShortcutEvent;
|
||||
break;
|
||||
|
||||
case QEvent::Show:
|
||||
sipType = sipType_QShowEvent;
|
||||
break;
|
||||
|
||||
case QEvent::StatusTip:
|
||||
sipType = sipType_QStatusTipEvent;
|
||||
break;
|
||||
|
||||
case QEvent::TabletMove:
|
||||
case QEvent::TabletPress:
|
||||
case QEvent::TabletRelease:
|
||||
case QEvent::TabletEnterProximity:
|
||||
case QEvent::TabletLeaveProximity:
|
||||
sipType = sipType_QTabletEvent;
|
||||
break;
|
||||
|
||||
case QEvent::ToolTip:
|
||||
case QEvent::WhatsThis:
|
||||
sipType = sipType_QHelpEvent;
|
||||
break;
|
||||
|
||||
case QEvent::WhatsThisClicked:
|
||||
sipType = sipType_QWhatsThisClickedEvent;
|
||||
break;
|
||||
|
||||
case QEvent::Wheel:
|
||||
sipType = sipType_QWheelEvent;
|
||||
break;
|
||||
|
||||
case QEvent::WindowStateChange:
|
||||
sipType = sipType_QWindowStateChangeEvent;
|
||||
break;
|
||||
|
||||
case QEvent::TouchBegin:
|
||||
case QEvent::TouchUpdate:
|
||||
case QEvent::TouchEnd:
|
||||
case QEvent::TouchCancel:
|
||||
sipType = sipType_QTouchEvent;
|
||||
break;
|
||||
|
||||
case QEvent::InputMethodQuery:
|
||||
sipType = sipType_QInputMethodQueryEvent;
|
||||
break;
|
||||
|
||||
case QEvent::Expose:
|
||||
sipType = sipType_QExposeEvent;
|
||||
break;
|
||||
|
||||
case QEvent::ScrollPrepare:
|
||||
sipType = sipType_QScrollPrepareEvent;
|
||||
break;
|
||||
|
||||
case QEvent::Scroll:
|
||||
sipType = sipType_QScrollEvent;
|
||||
break;
|
||||
|
||||
#if QT_VERSION >= 0x050200
|
||||
case QEvent::NativeGesture:
|
||||
sipType = sipType_QNativeGestureEvent;
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if QT_VERSION >= 0x050500
|
||||
case QEvent::PlatformSurface:
|
||||
sipType = sipType_QPlatformSurfaceEvent;
|
||||
break;
|
||||
#endif
|
||||
|
||||
default:
|
||||
sipType = 0;
|
||||
}
|
||||
%End
|
||||
|
||||
public:
|
||||
virtual ~QInputEvent();
|
||||
Qt::KeyboardModifiers modifiers() const;
|
||||
ulong timestamp() const;
|
||||
void setTimestamp(ulong atimestamp);
|
||||
};
|
||||
|
||||
class QMouseEvent : public QInputEvent
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qevent.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QMouseEvent(QEvent::Type type, const QPointF &pos, Qt::MouseButton button, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers);
|
||||
QMouseEvent(QEvent::Type type, const QPointF &pos, const QPointF &globalPos, Qt::MouseButton button, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers);
|
||||
QMouseEvent(QEvent::Type type, const QPointF &pos, const QPointF &windowPos, const QPointF &globalPos, Qt::MouseButton button, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers);
|
||||
%If (Qt_5_6_0 -)
|
||||
QMouseEvent(QEvent::Type type, const QPointF &localPos, const QPointF &windowPos, const QPointF &screenPos, Qt::MouseButton button, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Qt::MouseEventSource source);
|
||||
%End
|
||||
virtual ~QMouseEvent();
|
||||
QPoint pos() const;
|
||||
QPoint globalPos() const;
|
||||
int x() const;
|
||||
int y() const;
|
||||
int globalX() const;
|
||||
int globalY() const;
|
||||
Qt::MouseButton button() const;
|
||||
Qt::MouseButtons buttons() const;
|
||||
const QPointF &localPos() const;
|
||||
const QPointF &windowPos() const;
|
||||
const QPointF &screenPos() const;
|
||||
%If (Qt_5_3_0 -)
|
||||
Qt::MouseEventSource source() const;
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
Qt::MouseEventFlags flags() const;
|
||||
%End
|
||||
};
|
||||
|
||||
class QHoverEvent : public QInputEvent
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qevent.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QHoverEvent(QEvent::Type type, const QPointF &pos, const QPointF &oldPos, Qt::KeyboardModifiers modifiers = Qt::NoModifier);
|
||||
virtual ~QHoverEvent();
|
||||
QPoint pos() const;
|
||||
QPoint oldPos() const;
|
||||
const QPointF &posF() const;
|
||||
const QPointF &oldPosF() const;
|
||||
};
|
||||
|
||||
class QWheelEvent : public QInputEvent
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qevent.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QWheelEvent(const QPointF &pos, const QPointF &globalPos, QPoint pixelDelta, QPoint angleDelta, int qt4Delta, Qt::Orientation qt4Orientation, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers);
|
||||
%If (Qt_5_2_0 -)
|
||||
QWheelEvent(const QPointF &pos, const QPointF &globalPos, QPoint pixelDelta, QPoint angleDelta, int qt4Delta, Qt::Orientation qt4Orientation, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Qt::ScrollPhase phase);
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
QWheelEvent(const QPointF &pos, const QPointF &globalPos, QPoint pixelDelta, QPoint angleDelta, int qt4Delta, Qt::Orientation qt4Orientation, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Qt::ScrollPhase phase, Qt::MouseEventSource source);
|
||||
%End
|
||||
%If (Qt_5_7_0 -)
|
||||
QWheelEvent(const QPointF &pos, const QPointF &globalPos, QPoint pixelDelta, QPoint angleDelta, int qt4Delta, Qt::Orientation qt4Orientation, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Qt::ScrollPhase phase, Qt::MouseEventSource source, bool inverted);
|
||||
%End
|
||||
%If (Qt_5_12_0 -)
|
||||
QWheelEvent(QPointF pos, QPointF globalPos, QPoint pixelDelta, QPoint angleDelta, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Qt::ScrollPhase phase, bool inverted, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized);
|
||||
%End
|
||||
virtual ~QWheelEvent();
|
||||
QPoint pos() const;
|
||||
QPoint globalPos() const;
|
||||
int x() const;
|
||||
int y() const;
|
||||
int globalX() const;
|
||||
int globalY() const;
|
||||
Qt::MouseButtons buttons() const;
|
||||
QPoint pixelDelta() const;
|
||||
QPoint angleDelta() const;
|
||||
const QPointF &posF() const;
|
||||
const QPointF &globalPosF() const;
|
||||
%If (Qt_5_2_0 -)
|
||||
Qt::ScrollPhase phase() const;
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
Qt::MouseEventSource source() const;
|
||||
%End
|
||||
%If (Qt_5_7_0 -)
|
||||
bool inverted() const;
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
QPointF position() const;
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
QPointF globalPosition() const;
|
||||
%End
|
||||
};
|
||||
|
||||
class QTabletEvent : public QInputEvent
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qevent.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum TabletDevice
|
||||
{
|
||||
NoDevice,
|
||||
Puck,
|
||||
Stylus,
|
||||
Airbrush,
|
||||
FourDMouse,
|
||||
XFreeEraser,
|
||||
RotationStylus,
|
||||
};
|
||||
|
||||
enum PointerType
|
||||
{
|
||||
UnknownPointer,
|
||||
Pen,
|
||||
Cursor,
|
||||
Eraser,
|
||||
};
|
||||
|
||||
%If (Qt_5_4_0 -)
|
||||
QTabletEvent(QEvent::Type t, const QPointF &pos, const QPointF &globalPos, int device, int pointerType, qreal pressure, int xTilt, int yTilt, qreal tangentialPressure, qreal rotation, int z, Qt::KeyboardModifiers keyState, qint64 uniqueID, Qt::MouseButton button, Qt::MouseButtons buttons);
|
||||
%End
|
||||
QTabletEvent(QEvent::Type t, const QPointF &pos, const QPointF &globalPos, int device, int pointerType, qreal pressure, int xTilt, int yTilt, qreal tangentialPressure, qreal rotation, int z, Qt::KeyboardModifiers keyState, qint64 uniqueID);
|
||||
virtual ~QTabletEvent();
|
||||
QPoint pos() const;
|
||||
QPoint globalPos() const;
|
||||
int x() const;
|
||||
int y() const;
|
||||
int globalX() const;
|
||||
int globalY() const;
|
||||
qreal hiResGlobalX() const;
|
||||
qreal hiResGlobalY() const;
|
||||
QTabletEvent::TabletDevice device() const;
|
||||
QTabletEvent::PointerType pointerType() const;
|
||||
qint64 uniqueId() const;
|
||||
qreal pressure() const;
|
||||
int z() const;
|
||||
qreal tangentialPressure() const;
|
||||
qreal rotation() const;
|
||||
int xTilt() const;
|
||||
int yTilt() const;
|
||||
const QPointF &posF() const;
|
||||
const QPointF &globalPosF() const;
|
||||
%If (Qt_5_4_0 -)
|
||||
Qt::MouseButton button() const;
|
||||
%End
|
||||
%If (Qt_5_4_0 -)
|
||||
Qt::MouseButtons buttons() const;
|
||||
%End
|
||||
%If (Qt_5_15_0 -)
|
||||
QTabletEvent::TabletDevice deviceType() const;
|
||||
%End
|
||||
};
|
||||
|
||||
class QKeyEvent : public QInputEvent
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qevent.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QKeyEvent(QEvent::Type type, int key, Qt::KeyboardModifiers modifiers, quint32 nativeScanCode, quint32 nativeVirtualKey, quint32 nativeModifiers, const QString &text = QString(), bool autorep = false, ushort count = 1);
|
||||
QKeyEvent(QEvent::Type type, int key, Qt::KeyboardModifiers modifiers, const QString &text = QString(), bool autorep = false, ushort count = 1);
|
||||
virtual ~QKeyEvent();
|
||||
int key() const;
|
||||
Qt::KeyboardModifiers modifiers() const;
|
||||
QString text() const;
|
||||
bool isAutoRepeat() const;
|
||||
int count() const /__len__/;
|
||||
bool matches(QKeySequence::StandardKey key) const;
|
||||
quint32 nativeModifiers() const;
|
||||
quint32 nativeScanCode() const;
|
||||
quint32 nativeVirtualKey() const;
|
||||
};
|
||||
|
||||
class QFocusEvent : public QEvent
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qevent.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QFocusEvent(QEvent::Type type, Qt::FocusReason reason = Qt::OtherFocusReason);
|
||||
virtual ~QFocusEvent();
|
||||
bool gotFocus() const;
|
||||
bool lostFocus() const;
|
||||
Qt::FocusReason reason() const;
|
||||
};
|
||||
|
||||
class QPaintEvent : public QEvent
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qevent.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
explicit QPaintEvent(const QRegion &paintRegion);
|
||||
explicit QPaintEvent(const QRect &paintRect);
|
||||
virtual ~QPaintEvent();
|
||||
const QRect &rect() const;
|
||||
const QRegion ®ion() const;
|
||||
};
|
||||
|
||||
class QMoveEvent : public QEvent
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qevent.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QMoveEvent(const QPoint &pos, const QPoint &oldPos);
|
||||
virtual ~QMoveEvent();
|
||||
const QPoint &pos() const;
|
||||
const QPoint &oldPos() const;
|
||||
};
|
||||
|
||||
class QResizeEvent : public QEvent
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qevent.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QResizeEvent(const QSize &size, const QSize &oldSize);
|
||||
virtual ~QResizeEvent();
|
||||
const QSize &size() const;
|
||||
const QSize &oldSize() const;
|
||||
};
|
||||
|
||||
class QCloseEvent : public QEvent
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qevent.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QCloseEvent();
|
||||
virtual ~QCloseEvent();
|
||||
};
|
||||
|
||||
class QIconDragEvent : public QEvent
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qevent.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QIconDragEvent();
|
||||
virtual ~QIconDragEvent();
|
||||
};
|
||||
|
||||
class QShowEvent : public QEvent
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qevent.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QShowEvent();
|
||||
virtual ~QShowEvent();
|
||||
};
|
||||
|
||||
class QHideEvent : public QEvent
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qevent.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QHideEvent();
|
||||
virtual ~QHideEvent();
|
||||
};
|
||||
|
||||
class QContextMenuEvent : public QInputEvent
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qevent.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum Reason
|
||||
{
|
||||
Mouse,
|
||||
Keyboard,
|
||||
Other,
|
||||
};
|
||||
|
||||
QContextMenuEvent(QContextMenuEvent::Reason reason, const QPoint &pos, const QPoint &globalPos, Qt::KeyboardModifiers modifiers);
|
||||
QContextMenuEvent(QContextMenuEvent::Reason reason, const QPoint &pos, const QPoint &globalPos);
|
||||
QContextMenuEvent(QContextMenuEvent::Reason reason, const QPoint &pos);
|
||||
virtual ~QContextMenuEvent();
|
||||
int x() const;
|
||||
int y() const;
|
||||
int globalX() const;
|
||||
int globalY() const;
|
||||
const QPoint &pos() const;
|
||||
const QPoint &globalPos() const;
|
||||
QContextMenuEvent::Reason reason() const;
|
||||
};
|
||||
|
||||
class QInputMethodEvent : public QEvent
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qevent.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum AttributeType
|
||||
{
|
||||
TextFormat,
|
||||
Cursor,
|
||||
Language,
|
||||
Ruby,
|
||||
Selection,
|
||||
};
|
||||
|
||||
class Attribute
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qevent.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
Attribute(QInputMethodEvent::AttributeType t, int s, int l, QVariant val);
|
||||
%If (Qt_5_8_0 -)
|
||||
Attribute(QInputMethodEvent::AttributeType typ, int s, int l);
|
||||
%End
|
||||
QInputMethodEvent::AttributeType type;
|
||||
int start;
|
||||
int length;
|
||||
QVariant value;
|
||||
};
|
||||
|
||||
QInputMethodEvent();
|
||||
QInputMethodEvent(const QString &preeditText, const QList<QInputMethodEvent::Attribute> &attributes);
|
||||
QInputMethodEvent(const QInputMethodEvent &other);
|
||||
%If (Qt_5_6_0 -)
|
||||
virtual ~QInputMethodEvent();
|
||||
%End
|
||||
void setCommitString(const QString &commitString, int from = 0, int length = 0);
|
||||
const QList<QInputMethodEvent::Attribute> &attributes() const;
|
||||
const QString &preeditString() const;
|
||||
const QString &commitString() const;
|
||||
int replacementStart() const;
|
||||
int replacementLength() const;
|
||||
};
|
||||
|
||||
class QInputMethodQueryEvent : public QEvent
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qevent.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
explicit QInputMethodQueryEvent(Qt::InputMethodQueries queries);
|
||||
virtual ~QInputMethodQueryEvent();
|
||||
Qt::InputMethodQueries queries() const;
|
||||
void setValue(Qt::InputMethodQuery query, const QVariant &value);
|
||||
QVariant value(Qt::InputMethodQuery query) const;
|
||||
};
|
||||
|
||||
class QDropEvent : public QEvent
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qevent.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QDropEvent(const QPointF &pos, Qt::DropActions actions, const QMimeData *data, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, QEvent::Type type = QEvent::Drop);
|
||||
virtual ~QDropEvent();
|
||||
QPoint pos() const;
|
||||
const QPointF &posF() const;
|
||||
Qt::MouseButtons mouseButtons() const;
|
||||
Qt::KeyboardModifiers keyboardModifiers() const;
|
||||
Qt::DropActions possibleActions() const;
|
||||
Qt::DropAction proposedAction() const;
|
||||
void acceptProposedAction();
|
||||
Qt::DropAction dropAction() const;
|
||||
void setDropAction(Qt::DropAction action);
|
||||
QObject *source() const;
|
||||
const QMimeData *mimeData() const;
|
||||
};
|
||||
|
||||
class QDragMoveEvent : public QDropEvent
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qevent.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QDragMoveEvent(const QPoint &pos, Qt::DropActions actions, const QMimeData *data, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, QEvent::Type type = QEvent::DragMove);
|
||||
virtual ~QDragMoveEvent();
|
||||
QRect answerRect() const;
|
||||
void accept();
|
||||
void ignore();
|
||||
void accept(const QRect &r);
|
||||
void ignore(const QRect &r);
|
||||
};
|
||||
|
||||
class QDragEnterEvent : public QDragMoveEvent
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qevent.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QDragEnterEvent(const QPoint &pos, Qt::DropActions actions, const QMimeData *data, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers);
|
||||
virtual ~QDragEnterEvent();
|
||||
};
|
||||
|
||||
class QDragLeaveEvent : public QEvent
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qevent.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QDragLeaveEvent();
|
||||
virtual ~QDragLeaveEvent();
|
||||
};
|
||||
|
||||
class QHelpEvent : public QEvent
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qevent.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QHelpEvent(QEvent::Type type, const QPoint &pos, const QPoint &globalPos);
|
||||
virtual ~QHelpEvent();
|
||||
int x() const;
|
||||
int y() const;
|
||||
int globalX() const;
|
||||
int globalY() const;
|
||||
const QPoint &pos() const;
|
||||
const QPoint &globalPos() const;
|
||||
};
|
||||
|
||||
class QStatusTipEvent : public QEvent
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qevent.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
explicit QStatusTipEvent(const QString &tip);
|
||||
virtual ~QStatusTipEvent();
|
||||
QString tip() const;
|
||||
};
|
||||
|
||||
class QWhatsThisClickedEvent : public QEvent
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qevent.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
explicit QWhatsThisClickedEvent(const QString &href);
|
||||
virtual ~QWhatsThisClickedEvent();
|
||||
QString href() const;
|
||||
};
|
||||
|
||||
class QActionEvent : public QEvent
|
||||
{
|
||||
%TypeHintCode
|
||||
from PyQt5.QtWidgets import QAction
|
||||
%End
|
||||
|
||||
%TypeHeaderCode
|
||||
#include <qevent.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QActionEvent(int type, QAction *action, QAction *before = 0);
|
||||
virtual ~QActionEvent();
|
||||
QAction *action() const;
|
||||
QAction *before() const;
|
||||
};
|
||||
|
||||
class QFileOpenEvent : public QEvent /NoDefaultCtors/
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qevent.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
virtual ~QFileOpenEvent();
|
||||
QString file() const;
|
||||
QUrl url() const;
|
||||
bool openFile(QFile &file, QIODevice::OpenMode flags) const;
|
||||
};
|
||||
|
||||
class QShortcutEvent : public QEvent
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qevent.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QShortcutEvent(const QKeySequence &key, int id, bool ambiguous = false);
|
||||
virtual ~QShortcutEvent();
|
||||
bool isAmbiguous() const;
|
||||
const QKeySequence &key() const;
|
||||
int shortcutId() const;
|
||||
};
|
||||
|
||||
class QWindowStateChangeEvent : public QEvent /NoDefaultCtors/
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qevent.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
virtual ~QWindowStateChangeEvent();
|
||||
Qt::WindowStates oldState() const;
|
||||
};
|
||||
|
||||
class QTouchEvent : public QInputEvent
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qevent.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
class TouchPoint /NoDefaultCtors/
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qevent.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
int id() const;
|
||||
Qt::TouchPointState state() const;
|
||||
QPointF pos() const;
|
||||
QPointF startPos() const;
|
||||
QPointF lastPos() const;
|
||||
QPointF scenePos() const;
|
||||
QPointF startScenePos() const;
|
||||
QPointF lastScenePos() const;
|
||||
QPointF screenPos() const;
|
||||
QPointF startScreenPos() const;
|
||||
QPointF lastScreenPos() const;
|
||||
QPointF normalizedPos() const;
|
||||
QPointF startNormalizedPos() const;
|
||||
QPointF lastNormalizedPos() const;
|
||||
QRectF rect() const;
|
||||
QRectF sceneRect() const;
|
||||
QRectF screenRect() const;
|
||||
qreal pressure() const;
|
||||
|
||||
enum InfoFlag
|
||||
{
|
||||
Pen,
|
||||
%If (Qt_5_8_0 -)
|
||||
Token,
|
||||
%End
|
||||
};
|
||||
|
||||
typedef QFlags<QTouchEvent::TouchPoint::InfoFlag> InfoFlags;
|
||||
QVector2D velocity() const;
|
||||
QTouchEvent::TouchPoint::InfoFlags flags() const;
|
||||
QVector<QPointF> rawScreenPositions() const;
|
||||
%If (Qt_5_8_0 -)
|
||||
QPointingDeviceUniqueId uniqueId() const;
|
||||
%End
|
||||
%If (Qt_5_8_0 -)
|
||||
qreal rotation() const;
|
||||
%End
|
||||
%If (Qt_5_9_0 -)
|
||||
QSizeF ellipseDiameters() const;
|
||||
%End
|
||||
};
|
||||
|
||||
QTouchEvent(QEvent::Type eventType, QTouchDevice *device = 0, Qt::KeyboardModifiers modifiers = Qt::NoModifier, Qt::TouchPointStates touchPointStates = Qt::TouchPointStates(), const QList<QTouchEvent::TouchPoint> &touchPoints = QList<QTouchEvent::TouchPoint>());
|
||||
virtual ~QTouchEvent();
|
||||
QObject *target() const;
|
||||
Qt::TouchPointStates touchPointStates() const;
|
||||
const QList<QTouchEvent::TouchPoint> &touchPoints() const;
|
||||
QWindow *window() const;
|
||||
QTouchDevice *device() const;
|
||||
void setDevice(QTouchDevice *adevice);
|
||||
};
|
||||
|
||||
QFlags<QTouchEvent::TouchPoint::InfoFlag> operator|(QTouchEvent::TouchPoint::InfoFlag f1, QFlags<QTouchEvent::TouchPoint::InfoFlag> f2);
|
||||
QFlags<QTouchEvent::TouchPoint::InfoFlag> operator|(QTouchEvent::TouchPoint::InfoFlag f1, QTouchEvent::TouchPoint::InfoFlag f2);
|
||||
|
||||
class QExposeEvent : public QEvent
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qevent.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
explicit QExposeEvent(const QRegion &rgn);
|
||||
virtual ~QExposeEvent();
|
||||
const QRegion ®ion() const;
|
||||
};
|
||||
|
||||
class QScrollPrepareEvent : public QEvent
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qevent.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
explicit QScrollPrepareEvent(const QPointF &startPos);
|
||||
virtual ~QScrollPrepareEvent();
|
||||
QPointF startPos() const;
|
||||
QSizeF viewportSize() const;
|
||||
QRectF contentPosRange() const;
|
||||
QPointF contentPos() const;
|
||||
void setViewportSize(const QSizeF &size);
|
||||
void setContentPosRange(const QRectF &rect);
|
||||
void setContentPos(const QPointF &pos);
|
||||
};
|
||||
|
||||
class QScrollEvent : public QEvent
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qevent.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum ScrollState
|
||||
{
|
||||
ScrollStarted,
|
||||
ScrollUpdated,
|
||||
ScrollFinished,
|
||||
};
|
||||
|
||||
QScrollEvent(const QPointF &contentPos, const QPointF &overshoot, QScrollEvent::ScrollState scrollState);
|
||||
virtual ~QScrollEvent();
|
||||
QPointF contentPos() const;
|
||||
QPointF overshootDistance() const;
|
||||
QScrollEvent::ScrollState scrollState() const;
|
||||
};
|
||||
|
||||
bool operator==(QKeyEvent *e, QKeySequence::StandardKey key);
|
||||
bool operator==(QKeySequence::StandardKey key, QKeyEvent *e);
|
||||
|
||||
class QEnterEvent : public QEvent
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qevent.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QEnterEvent(const QPointF &localPos, const QPointF &windowPos, const QPointF &screenPos);
|
||||
virtual ~QEnterEvent();
|
||||
QPoint pos() const;
|
||||
QPoint globalPos() const;
|
||||
int x() const;
|
||||
int y() const;
|
||||
int globalX() const;
|
||||
int globalY() const;
|
||||
const QPointF &localPos() const;
|
||||
const QPointF &windowPos() const;
|
||||
const QPointF &screenPos() const;
|
||||
};
|
||||
|
||||
class QAction /External/;
|
||||
%If (Qt_5_2_0 -)
|
||||
|
||||
class QNativeGestureEvent : public QInputEvent
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qevent.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QNativeGestureEvent(Qt::NativeGestureType type, const QPointF &localPos, const QPointF &windowPos, const QPointF &screenPos, qreal value, ulong sequenceId, quint64 intArgument);
|
||||
%If (Qt_5_10_0 -)
|
||||
QNativeGestureEvent(Qt::NativeGestureType type, const QTouchDevice *dev, const QPointF &localPos, const QPointF &windowPos, const QPointF &screenPos, qreal value, ulong sequenceId, quint64 intArgument);
|
||||
%End
|
||||
%If (Qt_5_10_0 -)
|
||||
virtual ~QNativeGestureEvent();
|
||||
%End
|
||||
Qt::NativeGestureType gestureType() const;
|
||||
qreal value() const;
|
||||
const QPoint pos() const;
|
||||
const QPoint globalPos() const;
|
||||
const QPointF &localPos() const;
|
||||
const QPointF &windowPos() const;
|
||||
const QPointF &screenPos() const;
|
||||
%If (Qt_5_10_0 -)
|
||||
const QTouchDevice *device() const;
|
||||
%End
|
||||
};
|
||||
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
|
||||
class QPlatformSurfaceEvent : public QEvent
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qevent.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum SurfaceEventType
|
||||
{
|
||||
SurfaceCreated,
|
||||
SurfaceAboutToBeDestroyed,
|
||||
};
|
||||
|
||||
explicit QPlatformSurfaceEvent(QPlatformSurfaceEvent::SurfaceEventType surfaceEventType);
|
||||
virtual ~QPlatformSurfaceEvent();
|
||||
QPlatformSurfaceEvent::SurfaceEventType surfaceEventType() const;
|
||||
};
|
||||
|
||||
%End
|
||||
%If (Qt_5_8_0 -)
|
||||
|
||||
class QPointingDeviceUniqueId
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qevent.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QPointingDeviceUniqueId();
|
||||
static QPointingDeviceUniqueId fromNumericId(qint64 id);
|
||||
bool isValid() const;
|
||||
qint64 numericId() const;
|
||||
long __hash__() const;
|
||||
%MethodCode
|
||||
sipRes = qHash(*sipCpp);
|
||||
%End
|
||||
};
|
||||
|
||||
%End
|
||||
%If (Qt_5_8_0 -)
|
||||
bool operator==(QPointingDeviceUniqueId lhs, QPointingDeviceUniqueId rhs);
|
||||
%End
|
||||
%If (Qt_5_8_0 -)
|
||||
bool operator!=(QPointingDeviceUniqueId lhs, QPointingDeviceUniqueId rhs);
|
||||
%End
|
||||
236
venv/lib/python3.12/site-packages/PyQt5/bindings/QtGui/qfont.sip
Normal file
236
venv/lib/python3.12/site-packages/PyQt5/bindings/QtGui/qfont.sip
Normal file
@@ -0,0 +1,236 @@
|
||||
// qfont.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QFont
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qfont.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum StyleHint
|
||||
{
|
||||
Helvetica,
|
||||
SansSerif,
|
||||
Times,
|
||||
Serif,
|
||||
Courier,
|
||||
TypeWriter,
|
||||
OldEnglish,
|
||||
Decorative,
|
||||
System,
|
||||
AnyStyle,
|
||||
Cursive,
|
||||
Monospace,
|
||||
Fantasy,
|
||||
};
|
||||
|
||||
enum StyleStrategy
|
||||
{
|
||||
PreferDefault,
|
||||
PreferBitmap,
|
||||
PreferDevice,
|
||||
PreferOutline,
|
||||
ForceOutline,
|
||||
PreferMatch,
|
||||
PreferQuality,
|
||||
PreferAntialias,
|
||||
NoAntialias,
|
||||
%If (Qt_5_4_0 -)
|
||||
NoSubpixelAntialias,
|
||||
%End
|
||||
OpenGLCompatible,
|
||||
NoFontMerging,
|
||||
ForceIntegerMetrics,
|
||||
%If (Qt_5_10_0 -)
|
||||
PreferNoShaping,
|
||||
%End
|
||||
};
|
||||
|
||||
enum Weight
|
||||
{
|
||||
%If (Qt_5_5_0 -)
|
||||
Thin,
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
ExtraLight,
|
||||
%End
|
||||
Light,
|
||||
Normal,
|
||||
%If (Qt_5_5_0 -)
|
||||
Medium,
|
||||
%End
|
||||
DemiBold,
|
||||
Bold,
|
||||
%If (Qt_5_5_0 -)
|
||||
ExtraBold,
|
||||
%End
|
||||
Black,
|
||||
};
|
||||
|
||||
enum Style
|
||||
{
|
||||
StyleNormal,
|
||||
StyleItalic,
|
||||
StyleOblique,
|
||||
};
|
||||
|
||||
enum Stretch
|
||||
{
|
||||
%If (Qt_5_8_0 -)
|
||||
AnyStretch,
|
||||
%End
|
||||
UltraCondensed,
|
||||
ExtraCondensed,
|
||||
Condensed,
|
||||
SemiCondensed,
|
||||
Unstretched,
|
||||
SemiExpanded,
|
||||
Expanded,
|
||||
ExtraExpanded,
|
||||
UltraExpanded,
|
||||
};
|
||||
|
||||
QFont();
|
||||
QFont(const QString &family, int pointSize = -1, int weight = -1, bool italic = false);
|
||||
QFont(const QFont &, QPaintDevice *pd);
|
||||
QFont(const QFont &);
|
||||
QFont(const QVariant &variant /GetWrapper/) /NoDerived/;
|
||||
%MethodCode
|
||||
if (a0->canConvert<QFont>())
|
||||
sipCpp = new QFont(a0->value<QFont>());
|
||||
else
|
||||
sipError = sipBadCallableArg(0, a0Wrapper);
|
||||
%End
|
||||
|
||||
~QFont();
|
||||
QString family() const;
|
||||
void setFamily(const QString &);
|
||||
int pointSize() const;
|
||||
void setPointSize(int);
|
||||
qreal pointSizeF() const;
|
||||
void setPointSizeF(qreal);
|
||||
int pixelSize() const;
|
||||
void setPixelSize(int);
|
||||
int weight() const;
|
||||
void setWeight(int);
|
||||
void setStyle(QFont::Style style);
|
||||
QFont::Style style() const;
|
||||
bool underline() const;
|
||||
void setUnderline(bool);
|
||||
bool overline() const;
|
||||
void setOverline(bool);
|
||||
bool strikeOut() const;
|
||||
void setStrikeOut(bool);
|
||||
bool fixedPitch() const;
|
||||
void setFixedPitch(bool);
|
||||
bool kerning() const;
|
||||
void setKerning(bool);
|
||||
QFont::StyleHint styleHint() const;
|
||||
QFont::StyleStrategy styleStrategy() const;
|
||||
void setStyleHint(QFont::StyleHint hint, QFont::StyleStrategy strategy = QFont::PreferDefault);
|
||||
void setStyleStrategy(QFont::StyleStrategy s);
|
||||
int stretch() const;
|
||||
void setStretch(int);
|
||||
bool rawMode() const;
|
||||
void setRawMode(bool);
|
||||
bool exactMatch() const;
|
||||
bool operator==(const QFont &) const;
|
||||
bool operator!=(const QFont &) const;
|
||||
bool operator<(const QFont &) const;
|
||||
bool isCopyOf(const QFont &) const;
|
||||
void setRawName(const QString &);
|
||||
QString rawName() const;
|
||||
QString key() const;
|
||||
QString toString() const;
|
||||
bool fromString(const QString &);
|
||||
static QString substitute(const QString &);
|
||||
static QStringList substitutes(const QString &);
|
||||
static QStringList substitutions();
|
||||
static void insertSubstitution(const QString &, const QString &);
|
||||
static void insertSubstitutions(const QString &, const QStringList &);
|
||||
static void removeSubstitutions(const QString &);
|
||||
static void initialize();
|
||||
static void cleanup();
|
||||
static void cacheStatistics();
|
||||
QString defaultFamily() const;
|
||||
QString lastResortFamily() const;
|
||||
QString lastResortFont() const;
|
||||
QFont resolve(const QFont &) const;
|
||||
bool bold() const;
|
||||
void setBold(bool enable);
|
||||
bool italic() const;
|
||||
void setItalic(bool b);
|
||||
|
||||
enum Capitalization
|
||||
{
|
||||
MixedCase,
|
||||
AllUppercase,
|
||||
AllLowercase,
|
||||
SmallCaps,
|
||||
Capitalize,
|
||||
};
|
||||
|
||||
enum SpacingType
|
||||
{
|
||||
PercentageSpacing,
|
||||
AbsoluteSpacing,
|
||||
};
|
||||
|
||||
qreal letterSpacing() const;
|
||||
QFont::SpacingType letterSpacingType() const;
|
||||
void setLetterSpacing(QFont::SpacingType type, qreal spacing);
|
||||
qreal wordSpacing() const;
|
||||
void setWordSpacing(qreal spacing);
|
||||
void setCapitalization(QFont::Capitalization);
|
||||
QFont::Capitalization capitalization() const;
|
||||
|
||||
enum HintingPreference
|
||||
{
|
||||
PreferDefaultHinting,
|
||||
PreferNoHinting,
|
||||
PreferVerticalHinting,
|
||||
PreferFullHinting,
|
||||
};
|
||||
|
||||
QString styleName() const;
|
||||
void setStyleName(const QString &styleName);
|
||||
void setHintingPreference(QFont::HintingPreference hintingPreference);
|
||||
QFont::HintingPreference hintingPreference() const;
|
||||
void swap(QFont &other /Constrained/);
|
||||
%If (Qt_5_3_0 -)
|
||||
long __hash__() const;
|
||||
%MethodCode
|
||||
sipRes = qHash(*sipCpp);
|
||||
%End
|
||||
|
||||
%End
|
||||
%If (Qt_5_13_0 -)
|
||||
QStringList families() const;
|
||||
%End
|
||||
%If (Qt_5_13_0 -)
|
||||
void setFamilies(const QStringList &);
|
||||
%End
|
||||
};
|
||||
|
||||
QDataStream &operator<<(QDataStream &, const QFont & /Constrained/) /ReleaseGIL/;
|
||||
QDataStream &operator>>(QDataStream &, QFont & /Constrained/) /ReleaseGIL/;
|
||||
@@ -0,0 +1,112 @@
|
||||
// qfontdatabase.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QFontDatabase
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qfontdatabase.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum WritingSystem
|
||||
{
|
||||
Any,
|
||||
Latin,
|
||||
Greek,
|
||||
Cyrillic,
|
||||
Armenian,
|
||||
Hebrew,
|
||||
Arabic,
|
||||
Syriac,
|
||||
Thaana,
|
||||
Devanagari,
|
||||
Bengali,
|
||||
Gurmukhi,
|
||||
Gujarati,
|
||||
Oriya,
|
||||
Tamil,
|
||||
Telugu,
|
||||
Kannada,
|
||||
Malayalam,
|
||||
Sinhala,
|
||||
Thai,
|
||||
Lao,
|
||||
Tibetan,
|
||||
Myanmar,
|
||||
Georgian,
|
||||
Khmer,
|
||||
SimplifiedChinese,
|
||||
TraditionalChinese,
|
||||
Japanese,
|
||||
Korean,
|
||||
Vietnamese,
|
||||
Other,
|
||||
Symbol,
|
||||
Ogham,
|
||||
Runic,
|
||||
Nko,
|
||||
};
|
||||
|
||||
static QList<int> standardSizes();
|
||||
QFontDatabase();
|
||||
QList<QFontDatabase::WritingSystem> writingSystems() const;
|
||||
QList<QFontDatabase::WritingSystem> writingSystems(const QString &family) const;
|
||||
QStringList families(QFontDatabase::WritingSystem writingSystem = QFontDatabase::Any) const;
|
||||
QStringList styles(const QString &family) const;
|
||||
QList<int> pointSizes(const QString &family, const QString &style = QString());
|
||||
QList<int> smoothSizes(const QString &family, const QString &style);
|
||||
QString styleString(const QFont &font);
|
||||
QString styleString(const QFontInfo &fontInfo);
|
||||
QFont font(const QString &family, const QString &style, int pointSize) const;
|
||||
bool isBitmapScalable(const QString &family, const QString &style = QString()) const;
|
||||
bool isSmoothlyScalable(const QString &family, const QString &style = QString()) const;
|
||||
bool isScalable(const QString &family, const QString &style = QString()) const;
|
||||
bool isFixedPitch(const QString &family, const QString &style = QString()) const;
|
||||
bool italic(const QString &family, const QString &style) const;
|
||||
bool bold(const QString &family, const QString &style) const;
|
||||
int weight(const QString &family, const QString &style) const;
|
||||
static QString writingSystemName(QFontDatabase::WritingSystem writingSystem);
|
||||
static QString writingSystemSample(QFontDatabase::WritingSystem writingSystem);
|
||||
static int addApplicationFont(const QString &fileName);
|
||||
static int addApplicationFontFromData(const QByteArray &fontData);
|
||||
static QStringList applicationFontFamilies(int id);
|
||||
static bool removeApplicationFont(int id);
|
||||
static bool removeAllApplicationFonts();
|
||||
static bool supportsThreadedFontRendering();
|
||||
%If (Qt_5_2_0 -)
|
||||
|
||||
enum SystemFont
|
||||
{
|
||||
GeneralFont,
|
||||
FixedFont,
|
||||
TitleFont,
|
||||
SmallestReadableFont,
|
||||
};
|
||||
|
||||
%End
|
||||
%If (Qt_5_2_0 -)
|
||||
static QFont systemFont(QFontDatabase::SystemFont type);
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
bool isPrivateFamily(const QString &family) const;
|
||||
%End
|
||||
};
|
||||
@@ -0,0 +1,47 @@
|
||||
// qfontinfo.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QFontInfo
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qfontinfo.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QFontInfo(const QFont &);
|
||||
QFontInfo(const QFontInfo &);
|
||||
~QFontInfo();
|
||||
QString family() const;
|
||||
int pixelSize() const;
|
||||
int pointSize() const;
|
||||
qreal pointSizeF() const;
|
||||
bool italic() const;
|
||||
QFont::Style style() const;
|
||||
int weight() const;
|
||||
bool bold() const;
|
||||
bool fixedPitch() const;
|
||||
QFont::StyleHint styleHint() const;
|
||||
bool rawMode() const;
|
||||
bool exactMatch() const;
|
||||
QString styleName() const;
|
||||
void swap(QFontInfo &other /Constrained/);
|
||||
};
|
||||
@@ -0,0 +1,195 @@
|
||||
// qfontmetrics.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QFontMetrics
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qfontmetrics.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
explicit QFontMetrics(const QFont &);
|
||||
QFontMetrics(const QFont &, QPaintDevice *pd);
|
||||
QFontMetrics(const QFontMetrics &);
|
||||
~QFontMetrics();
|
||||
int ascent() const;
|
||||
int descent() const;
|
||||
int height() const;
|
||||
int leading() const;
|
||||
int lineSpacing() const;
|
||||
int minLeftBearing() const;
|
||||
int minRightBearing() const;
|
||||
int maxWidth() const;
|
||||
int xHeight() const;
|
||||
bool inFont(QChar) const;
|
||||
int leftBearing(QChar) const;
|
||||
int rightBearing(QChar) const;
|
||||
int width(QChar) const /PyName=widthChar/;
|
||||
int width(const QString &text, int length = -1) const;
|
||||
QRect boundingRect(QChar) const /PyName=boundingRectChar/;
|
||||
QRect boundingRect(const QString &text) const;
|
||||
QRect boundingRect(const QRect &rect, int flags, const QString &text, int tabStops = 0, SIP_PYLIST tabArray /AllowNone,TypeHint="Optional[List[int]]"/ = 0) const;
|
||||
%MethodCode
|
||||
int *tabarray = qtgui_tabarray(a4);
|
||||
|
||||
sipRes = new QRect(sipCpp->boundingRect(*a0, a1, *a2, a3, tabarray));
|
||||
|
||||
if (!tabarray)
|
||||
delete[] tabarray;
|
||||
%End
|
||||
|
||||
QRect boundingRect(int x, int y, int width, int height, int flags, const QString &text, int tabStops = 0, SIP_PYLIST tabArray /AllowNone,TypeHint="Optional[List[int]]"/ = 0) const;
|
||||
%MethodCode
|
||||
int *tabarray = qtgui_tabarray(a7);
|
||||
|
||||
sipRes = new QRect(sipCpp->boundingRect(a0, a1, a2, a3, a4, *a5, a6, tabarray));
|
||||
|
||||
if (!tabarray)
|
||||
delete[] tabarray;
|
||||
%End
|
||||
|
||||
QSize size(int flags, const QString &text, int tabStops = 0, SIP_PYLIST tabArray /AllowNone,TypeHint="Optional[List[int]]"/ = 0) const;
|
||||
%MethodCode
|
||||
int *tabarray = qtgui_tabarray(a3);
|
||||
|
||||
sipRes = new QSize(sipCpp->size(a0, *a1, a2, tabarray));
|
||||
|
||||
if (!tabarray)
|
||||
delete[] tabarray;
|
||||
%End
|
||||
|
||||
int underlinePos() const;
|
||||
int overlinePos() const;
|
||||
int strikeOutPos() const;
|
||||
int lineWidth() const;
|
||||
int averageCharWidth() const;
|
||||
QString elidedText(const QString &text, Qt::TextElideMode mode, int width, int flags = 0) const;
|
||||
bool operator==(const QFontMetrics &other) const;
|
||||
bool operator!=(const QFontMetrics &other) const;
|
||||
QRect tightBoundingRect(const QString &text) const;
|
||||
bool inFontUcs4(uint character) const;
|
||||
void swap(QFontMetrics &other /Constrained/);
|
||||
%If (Qt_5_8_0 -)
|
||||
int capHeight() const;
|
||||
%End
|
||||
%If (Qt_5_11_0 -)
|
||||
int horizontalAdvance(const QString &, int length = -1) const;
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
qreal fontDpi() const;
|
||||
%End
|
||||
};
|
||||
|
||||
class QFontMetricsF
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qfontmetrics.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
explicit QFontMetricsF(const QFont &);
|
||||
QFontMetricsF(const QFont &, QPaintDevice *pd);
|
||||
QFontMetricsF(const QFontMetrics &);
|
||||
QFontMetricsF(const QFontMetricsF &);
|
||||
~QFontMetricsF();
|
||||
qreal ascent() const;
|
||||
qreal descent() const;
|
||||
qreal height() const;
|
||||
qreal leading() const;
|
||||
qreal lineSpacing() const;
|
||||
qreal minLeftBearing() const;
|
||||
qreal minRightBearing() const;
|
||||
qreal maxWidth() const;
|
||||
qreal xHeight() const;
|
||||
bool inFont(QChar) const;
|
||||
qreal leftBearing(QChar) const;
|
||||
qreal rightBearing(QChar) const;
|
||||
qreal width(QChar) const /PyName=widthChar/;
|
||||
qreal width(const QString &string) const;
|
||||
QRectF boundingRect(QChar) const /PyName=boundingRectChar/;
|
||||
QRectF boundingRect(const QString &string) const;
|
||||
QRectF boundingRect(const QRectF &rect, int flags, const QString &text, int tabStops = 0, SIP_PYLIST tabArray /AllowNone,TypeHint="Optional[List[int]]"/ = 0) const;
|
||||
%MethodCode
|
||||
int *tabarray = qtgui_tabarray(a4);
|
||||
|
||||
sipRes = new QRectF(sipCpp->boundingRect(*a0, a1, *a2, a3, tabarray));
|
||||
|
||||
if (!tabarray)
|
||||
delete[] tabarray;
|
||||
%End
|
||||
|
||||
QSizeF size(int flags, const QString &text, int tabStops = 0, SIP_PYLIST tabArray /AllowNone,TypeHint="Optional[List[int]]"/ = 0) const;
|
||||
%MethodCode
|
||||
int *tabarray = qtgui_tabarray(a3);
|
||||
|
||||
sipRes = new QSizeF(sipCpp->size(a0, *a1, a2, tabarray));
|
||||
|
||||
if (!tabarray)
|
||||
delete[] tabarray;
|
||||
%End
|
||||
|
||||
qreal underlinePos() const;
|
||||
qreal overlinePos() const;
|
||||
qreal strikeOutPos() const;
|
||||
qreal lineWidth() const;
|
||||
qreal averageCharWidth() const;
|
||||
QString elidedText(const QString &text, Qt::TextElideMode mode, qreal width, int flags = 0) const;
|
||||
bool operator==(const QFontMetricsF &other) const;
|
||||
bool operator!=(const QFontMetricsF &other) const;
|
||||
QRectF tightBoundingRect(const QString &text) const;
|
||||
bool inFontUcs4(uint character) const;
|
||||
void swap(QFontMetricsF &other /Constrained/);
|
||||
%If (Qt_5_8_0 -)
|
||||
qreal capHeight() const;
|
||||
%End
|
||||
%If (Qt_5_11_0 -)
|
||||
qreal horizontalAdvance(const QString &string, int length = -1) const;
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
qreal fontDpi() const;
|
||||
%End
|
||||
};
|
||||
|
||||
%ModuleHeaderCode
|
||||
// Used by QFontMetrics and QFontMetricsF.
|
||||
int *qtgui_tabarray(PyObject *l);
|
||||
%End
|
||||
|
||||
%ModuleCode
|
||||
// Convert an optional Python list to a 0 terminated array of integers on the
|
||||
// heap.
|
||||
int *qtgui_tabarray(PyObject *l)
|
||||
{
|
||||
if (!l || l == Py_None)
|
||||
return 0;
|
||||
|
||||
int *arr = new int[PyList_Size(l) + 1];
|
||||
Py_ssize_t i;
|
||||
|
||||
for (i = 0; i < PyList_Size(l); ++i)
|
||||
arr[i] = SIPLong_AsLong(PyList_GetItem(l, i));
|
||||
|
||||
arr[i] = 0;
|
||||
|
||||
return arr;
|
||||
}
|
||||
%End
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,72 @@
|
||||
// qglyphrun.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (PyQt_RawFont)
|
||||
|
||||
class QGlyphRun
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qglyphrun.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QGlyphRun();
|
||||
QGlyphRun(const QGlyphRun &other);
|
||||
~QGlyphRun();
|
||||
QRawFont rawFont() const;
|
||||
void setRawFont(const QRawFont &rawFont);
|
||||
QVector<unsigned int> glyphIndexes() const;
|
||||
void setGlyphIndexes(const QVector<unsigned int> &glyphIndexes);
|
||||
QVector<QPointF> positions() const;
|
||||
void setPositions(const QVector<QPointF> &positions);
|
||||
void clear();
|
||||
bool operator==(const QGlyphRun &other) const;
|
||||
bool operator!=(const QGlyphRun &other) const;
|
||||
void setOverline(bool overline);
|
||||
bool overline() const;
|
||||
void setUnderline(bool underline);
|
||||
bool underline() const;
|
||||
void setStrikeOut(bool strikeOut);
|
||||
bool strikeOut() const;
|
||||
|
||||
enum GlyphRunFlag
|
||||
{
|
||||
Overline,
|
||||
Underline,
|
||||
StrikeOut,
|
||||
RightToLeft,
|
||||
SplitLigature,
|
||||
};
|
||||
|
||||
typedef QFlags<QGlyphRun::GlyphRunFlag> GlyphRunFlags;
|
||||
void setRightToLeft(bool on);
|
||||
bool isRightToLeft() const;
|
||||
void setFlag(QGlyphRun::GlyphRunFlag flag, bool enabled = true);
|
||||
void setFlags(QGlyphRun::GlyphRunFlags flags);
|
||||
QGlyphRun::GlyphRunFlags flags() const;
|
||||
void setBoundingRect(const QRectF &boundingRect);
|
||||
QRectF boundingRect() const;
|
||||
bool isEmpty() const;
|
||||
void swap(QGlyphRun &other /Constrained/);
|
||||
};
|
||||
|
||||
%End
|
||||
@@ -0,0 +1,357 @@
|
||||
// qguiapplication.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QGuiApplication : public QCoreApplication
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qguiapplication.h>
|
||||
%End
|
||||
|
||||
%ConvertToSubClassCode
|
||||
static struct class_graph {
|
||||
const char *name;
|
||||
sipTypeDef **type;
|
||||
int yes, no;
|
||||
} graph[] = {
|
||||
#if QT_VERSION >= 0x050100 && defined(SIP_FEATURE_PyQt_Desktop_OpenGL)
|
||||
{sipName_QOpenGLTimeMonitor, &sipType_QOpenGLTimeMonitor, -1, 1},
|
||||
#else
|
||||
{0, 0, -1, 1},
|
||||
#endif
|
||||
{sipName_QSyntaxHighlighter, &sipType_QSyntaxHighlighter, -1, 2},
|
||||
{sipName_QWindow, &sipType_QWindow, 25, 3},
|
||||
{sipName_QPdfWriter, &sipType_QPdfWriter, -1, 4},
|
||||
{sipName_QMovie, &sipType_QMovie, -1, 5},
|
||||
#if defined(SIP_FEATURE_PyQt_SessionManager)
|
||||
{sipName_QSessionManager, &sipType_QSessionManager, -1, 6},
|
||||
#else
|
||||
{0, 0, -1, 6},
|
||||
#endif
|
||||
{sipName_QAbstractTextDocumentLayout, &sipType_QAbstractTextDocumentLayout, -1, 7},
|
||||
{sipName_QScreen, &sipType_QScreen, -1, 8},
|
||||
{sipName_QTextObject, &sipType_QTextObject, 28, 9},
|
||||
{sipName_QStandardItemModel, &sipType_QStandardItemModel, -1, 10},
|
||||
{sipName_QDrag, &sipType_QDrag, -1, 11},
|
||||
#if defined(SIP_FEATURE_PyQt_OpenGL)
|
||||
{sipName_QOpenGLContextGroup, &sipType_QOpenGLContextGroup, -1, 12},
|
||||
#else
|
||||
{0, 0, -1, 12},
|
||||
#endif
|
||||
{sipName_QValidator, &sipType_QValidator, 32, 13},
|
||||
{sipName_QTextDocument, &sipType_QTextDocument, -1, 14},
|
||||
#if QT_VERSION >= 0x050100 && defined(SIP_FEATURE_PyQt_OpenGL)
|
||||
{sipName_QOpenGLVertexArrayObject, &sipType_QOpenGLVertexArrayObject, -1, 15},
|
||||
#else
|
||||
{0, 0, -1, 15},
|
||||
#endif
|
||||
#if QT_VERSION >= 0x050100 && defined(SIP_FEATURE_PyQt_OpenGL)
|
||||
{sipName_QOpenGLDebugLogger, &sipType_QOpenGLDebugLogger, -1, 16},
|
||||
#else
|
||||
{0, 0, -1, 16},
|
||||
#endif
|
||||
{sipName_QGuiApplication, &sipType_QGuiApplication, -1, 17},
|
||||
#if QT_VERSION >= 0x050100 && defined(SIP_FEATURE_PyQt_Desktop_OpenGL)
|
||||
{sipName_QOpenGLTimerQuery, &sipType_QOpenGLTimerQuery, -1, 18},
|
||||
#else
|
||||
{0, 0, -1, 18},
|
||||
#endif
|
||||
#if QT_VERSION >= 0x050100
|
||||
{sipName_QOffscreenSurface, &sipType_QOffscreenSurface, -1, 19},
|
||||
#else
|
||||
{0, 0, -1, 19},
|
||||
#endif
|
||||
#if defined(SIP_FEATURE_PyQt_OpenGL)
|
||||
{sipName_QOpenGLShaderProgram, &sipType_QOpenGLShaderProgram, -1, 20},
|
||||
#else
|
||||
{0, 0, -1, 20},
|
||||
#endif
|
||||
{sipName_QStyleHints, &sipType_QStyleHints, -1, 21},
|
||||
{sipName_QClipboard, &sipType_QClipboard, -1, 22},
|
||||
#if defined(SIP_FEATURE_PyQt_OpenGL)
|
||||
{sipName_QOpenGLShader, &sipType_QOpenGLShader, -1, 23},
|
||||
#else
|
||||
{0, 0, -1, 23},
|
||||
#endif
|
||||
#if defined(SIP_FEATURE_PyQt_OpenGL)
|
||||
{sipName_QOpenGLContext, &sipType_QOpenGLContext, -1, 24},
|
||||
#else
|
||||
{0, 0, -1, 24},
|
||||
#endif
|
||||
{sipName_QInputMethod, &sipType_QInputMethod, -1, -1},
|
||||
#if QT_VERSION >= 0x050400
|
||||
{sipName_QPaintDeviceWindow, &sipType_QPaintDeviceWindow, 26, -1},
|
||||
#else
|
||||
{0, 0, 26, -1},
|
||||
#endif
|
||||
#if QT_VERSION >= 0x050400 && defined(SIP_FEATURE_PyQt_OpenGL)
|
||||
{sipName_QOpenGLWindow, &sipType_QOpenGLWindow, -1, 27},
|
||||
#else
|
||||
{0, 0, -1, 27},
|
||||
#endif
|
||||
#if QT_VERSION >= 0x050400
|
||||
{sipName_QRasterWindow, &sipType_QRasterWindow, -1, -1},
|
||||
#else
|
||||
{0, 0, -1, -1},
|
||||
#endif
|
||||
{sipName_QTextBlockGroup, &sipType_QTextBlockGroup, 30, 29},
|
||||
{sipName_QTextFrame, &sipType_QTextFrame, 31, -1},
|
||||
{sipName_QTextList, &sipType_QTextList, -1, -1},
|
||||
{sipName_QTextTable, &sipType_QTextTable, -1, -1},
|
||||
#if QT_VERSION >= 0x050100
|
||||
{sipName_QRegularExpressionValidator, &sipType_QRegularExpressionValidator, -1, 33},
|
||||
#else
|
||||
{0, 0, -1, 33},
|
||||
#endif
|
||||
{sipName_QIntValidator, &sipType_QIntValidator, -1, 34},
|
||||
{sipName_QDoubleValidator, &sipType_QDoubleValidator, -1, 35},
|
||||
{sipName_QRegExpValidator, &sipType_QRegExpValidator, -1, -1},
|
||||
};
|
||||
|
||||
int i = 0;
|
||||
|
||||
sipType = NULL;
|
||||
|
||||
do
|
||||
{
|
||||
struct class_graph *cg = &graph[i];
|
||||
|
||||
if (cg->name != NULL && sipCpp->inherits(cg->name))
|
||||
{
|
||||
sipType = *cg->type;
|
||||
i = cg->yes;
|
||||
}
|
||||
else
|
||||
i = cg->no;
|
||||
}
|
||||
while (i >= 0);
|
||||
%End
|
||||
|
||||
public:
|
||||
QGuiApplication(SIP_PYLIST argv /TypeHint="List[str]"/) /PostHook=__pyQtQAppHook__/ [(int &argc, char **argv, int = ApplicationFlags)];
|
||||
%MethodCode
|
||||
// The Python interface is a list of argument strings that is modified.
|
||||
|
||||
int argc;
|
||||
char **argv;
|
||||
|
||||
// Convert the list.
|
||||
if ((argv = pyqt5_qtgui_from_argv_list(a0, argc)) == NULL)
|
||||
sipIsErr = 1;
|
||||
else
|
||||
{
|
||||
// Create it now the arguments are right.
|
||||
static int nargc;
|
||||
nargc = argc;
|
||||
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
sipCpp = new sipQGuiApplication(nargc, argv, QCoreApplication::ApplicationFlags);
|
||||
Py_END_ALLOW_THREADS
|
||||
|
||||
// Now modify the original list.
|
||||
pyqt5_qtgui_update_argv_list(a0, argc, argv);
|
||||
}
|
||||
%End
|
||||
|
||||
virtual ~QGuiApplication() /ReleaseGIL/;
|
||||
%MethodCode
|
||||
pyqt5_qtgui_cleanup_qobjects();
|
||||
%End
|
||||
|
||||
static QWindowList allWindows();
|
||||
static QWindowList topLevelWindows();
|
||||
static QWindow *topLevelAt(const QPoint &pos);
|
||||
static QString platformName();
|
||||
static QWindow *focusWindow();
|
||||
static QObject *focusObject();
|
||||
static QScreen *primaryScreen();
|
||||
static QList<QScreen *> screens();
|
||||
static QCursor *overrideCursor();
|
||||
static void setOverrideCursor(const QCursor &);
|
||||
static void changeOverrideCursor(const QCursor &);
|
||||
static void restoreOverrideCursor();
|
||||
static QFont font();
|
||||
static void setFont(const QFont &);
|
||||
static QClipboard *clipboard();
|
||||
static QPalette palette();
|
||||
static void setPalette(const QPalette &pal);
|
||||
static Qt::KeyboardModifiers keyboardModifiers();
|
||||
static Qt::KeyboardModifiers queryKeyboardModifiers();
|
||||
static Qt::MouseButtons mouseButtons();
|
||||
static void setLayoutDirection(Qt::LayoutDirection direction);
|
||||
static Qt::LayoutDirection layoutDirection();
|
||||
static bool isRightToLeft();
|
||||
static bool isLeftToRight();
|
||||
static void setDesktopSettingsAware(bool on);
|
||||
static bool desktopSettingsAware();
|
||||
static void setQuitOnLastWindowClosed(bool quit);
|
||||
static bool quitOnLastWindowClosed();
|
||||
static int exec() /PostHook=__pyQtPostEventLoopHook__,PreHook=__pyQtPreEventLoopHook__,PyName=exec_,ReleaseGIL/;
|
||||
%If (Py_v3)
|
||||
static int exec() /PostHook=__pyQtPostEventLoopHook__,PreHook=__pyQtPreEventLoopHook__,ReleaseGIL/;
|
||||
%End
|
||||
virtual bool notify(QObject *, QEvent *);
|
||||
|
||||
signals:
|
||||
void fontDatabaseChanged();
|
||||
void screenAdded(QScreen *screen);
|
||||
void lastWindowClosed();
|
||||
void focusObjectChanged(QObject *focusObject);
|
||||
%If (PyQt_SessionManager)
|
||||
void commitDataRequest(QSessionManager &sessionManager);
|
||||
%End
|
||||
%If (PyQt_SessionManager)
|
||||
void saveStateRequest(QSessionManager &sessionManager);
|
||||
%End
|
||||
void focusWindowChanged(QWindow *focusWindow);
|
||||
%If (Qt_5_2_0 -)
|
||||
void applicationStateChanged(Qt::ApplicationState state);
|
||||
%End
|
||||
%If (Qt_5_8_0 -)
|
||||
void applicationDisplayNameChanged();
|
||||
%End
|
||||
|
||||
public:
|
||||
static void setApplicationDisplayName(const QString &name);
|
||||
static QString applicationDisplayName();
|
||||
static QWindow *modalWindow();
|
||||
static QStyleHints *styleHints();
|
||||
static QInputMethod *inputMethod();
|
||||
qreal devicePixelRatio() const;
|
||||
%If (PyQt_SessionManager)
|
||||
bool isSessionRestored() const;
|
||||
%End
|
||||
%If (PyQt_SessionManager)
|
||||
QString sessionId() const;
|
||||
%End
|
||||
%If (PyQt_SessionManager)
|
||||
QString sessionKey() const;
|
||||
%End
|
||||
%If (PyQt_SessionManager)
|
||||
bool isSavingSession() const;
|
||||
%End
|
||||
%If (Qt_5_2_0 -)
|
||||
static Qt::ApplicationState applicationState();
|
||||
%End
|
||||
%If (Qt_5_2_0 -)
|
||||
static void sync();
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
static void setWindowIcon(const QIcon &icon);
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
static QIcon windowIcon();
|
||||
%End
|
||||
|
||||
protected:
|
||||
virtual bool event(QEvent *);
|
||||
|
||||
signals:
|
||||
%If (Qt_5_4_0 -)
|
||||
void screenRemoved(QScreen *screen);
|
||||
%End
|
||||
%If (Qt_5_4_0 -)
|
||||
void layoutDirectionChanged(Qt::LayoutDirection direction);
|
||||
%End
|
||||
%If (Qt_5_4_0 -)
|
||||
void paletteChanged(const QPalette &pal);
|
||||
%End
|
||||
|
||||
public:
|
||||
%If (Qt_5_6_0 -)
|
||||
%If (PyQt_SessionManager)
|
||||
static bool isFallbackSessionManagementEnabled();
|
||||
%End
|
||||
%End
|
||||
%If (Qt_5_6_0 -)
|
||||
%If (PyQt_SessionManager)
|
||||
static void setFallbackSessionManagementEnabled(bool);
|
||||
%End
|
||||
%End
|
||||
|
||||
signals:
|
||||
%If (Qt_5_6_0 -)
|
||||
void primaryScreenChanged(QScreen *screen);
|
||||
%End
|
||||
|
||||
public:
|
||||
%If (Qt_5_7_0 -)
|
||||
static void setDesktopFileName(const QString &name);
|
||||
%End
|
||||
%If (Qt_5_7_0 -)
|
||||
static QString desktopFileName();
|
||||
%End
|
||||
%If (Qt_5_10_0 -)
|
||||
static QScreen *screenAt(const QPoint &point);
|
||||
%End
|
||||
|
||||
signals:
|
||||
%If (Qt_5_11_0 -)
|
||||
void fontChanged(const QFont &font);
|
||||
%End
|
||||
|
||||
public:
|
||||
%If (Qt_5_14_0 -)
|
||||
static void setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy policy);
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
static Qt::HighDpiScaleFactorRoundingPolicy highDpiScaleFactorRoundingPolicy();
|
||||
%End
|
||||
};
|
||||
|
||||
%ModuleHeaderCode
|
||||
// Imports from QtCore.
|
||||
typedef void (*pyqt5_qtgui_cleanup_qobjects_t)();
|
||||
extern pyqt5_qtgui_cleanup_qobjects_t pyqt5_qtgui_cleanup_qobjects;
|
||||
|
||||
typedef char **(*pyqt5_qtgui_from_argv_list_t)(PyObject *, int &);
|
||||
extern pyqt5_qtgui_from_argv_list_t pyqt5_qtgui_from_argv_list;
|
||||
|
||||
typedef void (*pyqt5_qtgui_update_argv_list_t)(PyObject *, int, char **);
|
||||
extern pyqt5_qtgui_update_argv_list_t pyqt5_qtgui_update_argv_list;
|
||||
%End
|
||||
|
||||
%ModuleCode
|
||||
// Imports from QtCore.
|
||||
pyqt5_qtgui_cleanup_qobjects_t pyqt5_qtgui_cleanup_qobjects;
|
||||
pyqt5_qtgui_from_argv_list_t pyqt5_qtgui_from_argv_list;
|
||||
pyqt5_qtgui_update_argv_list_t pyqt5_qtgui_update_argv_list;
|
||||
|
||||
// Forward declarations not in any header files but are part of the API.
|
||||
void qt_set_sequence_auto_mnemonic(bool enable);
|
||||
%End
|
||||
|
||||
%InitialisationCode
|
||||
// Export our own helpers.
|
||||
sipExportSymbol("qtgui_wrap_ancestors", (void *)qtgui_wrap_ancestors);
|
||||
%End
|
||||
|
||||
%PostInitialisationCode
|
||||
// Imports from QtCore.
|
||||
pyqt5_qtgui_cleanup_qobjects = (pyqt5_qtgui_cleanup_qobjects_t)sipImportSymbol("pyqt5_cleanup_qobjects");
|
||||
Q_ASSERT(pyqt5_qtgui_cleanup_qobjects);
|
||||
|
||||
pyqt5_qtgui_from_argv_list = (pyqt5_qtgui_from_argv_list_t)sipImportSymbol("pyqt5_from_argv_list");
|
||||
Q_ASSERT(pyqt5_qtgui_from_argv_list);
|
||||
|
||||
pyqt5_qtgui_update_argv_list = (pyqt5_qtgui_update_argv_list_t)sipImportSymbol("pyqt5_update_argv_list");
|
||||
Q_ASSERT(pyqt5_qtgui_update_argv_list);
|
||||
%End
|
||||
123
venv/lib/python3.12/site-packages/PyQt5/bindings/QtGui/qicon.sip
Normal file
123
venv/lib/python3.12/site-packages/PyQt5/bindings/QtGui/qicon.sip
Normal file
@@ -0,0 +1,123 @@
|
||||
// qicon.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QIcon /Supertype=sip.wrapper/
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qicon.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum Mode
|
||||
{
|
||||
Normal,
|
||||
Disabled,
|
||||
Active,
|
||||
Selected,
|
||||
};
|
||||
|
||||
enum State
|
||||
{
|
||||
On,
|
||||
Off,
|
||||
};
|
||||
|
||||
QIcon();
|
||||
QIcon(const QPixmap &pixmap);
|
||||
QIcon(const QIcon &other);
|
||||
explicit QIcon(const QString &fileName);
|
||||
explicit QIcon(QIconEngine *engine /GetWrapper/);
|
||||
%MethodCode
|
||||
sipCpp = new QIcon(a0);
|
||||
|
||||
// The QIconEngine is implicitly shared by copies of the QIcon and is destroyed
|
||||
// by C++ when the last copy is destroyed. Therefore we need to transfer
|
||||
// ownership but not to associate it with this QIcon. The Python object will
|
||||
// get tidied up when the virtual dtor gets called.
|
||||
sipTransferTo(a0Wrapper, Py_None);
|
||||
%End
|
||||
|
||||
QIcon(const QVariant &variant /GetWrapper/) /NoDerived/;
|
||||
%MethodCode
|
||||
if (a0->canConvert<QIcon>())
|
||||
sipCpp = new QIcon(a0->value<QIcon>());
|
||||
else
|
||||
sipError = sipBadCallableArg(0, a0Wrapper);
|
||||
%End
|
||||
|
||||
~QIcon();
|
||||
QPixmap pixmap(const QSize &size, QIcon::Mode mode = QIcon::Normal, QIcon::State state = QIcon::Off) const;
|
||||
QPixmap pixmap(int w, int h, QIcon::Mode mode = QIcon::Normal, QIcon::State state = QIcon::Off) const;
|
||||
QPixmap pixmap(int extent, QIcon::Mode mode = QIcon::Normal, QIcon::State state = QIcon::Off) const;
|
||||
%If (Qt_5_1_0 -)
|
||||
QPixmap pixmap(QWindow *window, const QSize &size, QIcon::Mode mode = QIcon::Normal, QIcon::State state = QIcon::Off) const;
|
||||
%End
|
||||
QSize actualSize(const QSize &size, QIcon::Mode mode = QIcon::Normal, QIcon::State state = QIcon::Off) const;
|
||||
%If (Qt_5_1_0 -)
|
||||
QSize actualSize(QWindow *window, const QSize &size, QIcon::Mode mode = QIcon::Normal, QIcon::State state = QIcon::Off) const;
|
||||
%End
|
||||
QList<QSize> availableSizes(QIcon::Mode mode = QIcon::Normal, QIcon::State state = QIcon::Off) const;
|
||||
void paint(QPainter *painter, const QRect &rect, Qt::Alignment alignment = Qt::AlignCenter, QIcon::Mode mode = QIcon::Normal, QIcon::State state = QIcon::Off) const;
|
||||
void paint(QPainter *painter, int x, int y, int w, int h, Qt::Alignment alignment = Qt::AlignCenter, QIcon::Mode mode = QIcon::Normal, QIcon::State state = QIcon::Off) const;
|
||||
bool isNull() const;
|
||||
bool isDetached() const;
|
||||
void addPixmap(const QPixmap &pixmap, QIcon::Mode mode = QIcon::Normal, QIcon::State state = QIcon::Off);
|
||||
void addFile(const QString &fileName, const QSize &size = QSize(), QIcon::Mode mode = QIcon::Normal, QIcon::State state = QIcon::Off);
|
||||
qint64 cacheKey() const;
|
||||
%If (Qt_5_7_0 -)
|
||||
static QIcon fromTheme(const QString &name);
|
||||
%End
|
||||
%If (Qt_5_7_0 -)
|
||||
static QIcon fromTheme(const QString &name, const QIcon &fallback);
|
||||
%End
|
||||
%If (- Qt_5_7_0)
|
||||
static QIcon fromTheme(const QString &name, const QIcon &fallback = QIcon());
|
||||
%End
|
||||
static bool hasThemeIcon(const QString &name);
|
||||
static QStringList themeSearchPaths();
|
||||
static void setThemeSearchPaths(const QStringList &searchpath);
|
||||
static QString themeName();
|
||||
static void setThemeName(const QString &path);
|
||||
QString name() const;
|
||||
void swap(QIcon &other /Constrained/);
|
||||
%If (Qt_5_6_0 -)
|
||||
void setIsMask(bool isMask);
|
||||
%End
|
||||
%If (Qt_5_6_0 -)
|
||||
bool isMask() const;
|
||||
%End
|
||||
%If (Qt_5_11_0 -)
|
||||
static QStringList fallbackSearchPaths();
|
||||
%End
|
||||
%If (Qt_5_11_0 -)
|
||||
static void setFallbackSearchPaths(const QStringList &paths);
|
||||
%End
|
||||
%If (Qt_5_12_0 -)
|
||||
static QString fallbackThemeName();
|
||||
%End
|
||||
%If (Qt_5_12_0 -)
|
||||
static void setFallbackThemeName(const QString &name);
|
||||
%End
|
||||
};
|
||||
|
||||
QDataStream &operator<<(QDataStream &, const QIcon & /Constrained/) /ReleaseGIL/;
|
||||
QDataStream &operator>>(QDataStream &, QIcon & /Constrained/) /ReleaseGIL/;
|
||||
@@ -0,0 +1,94 @@
|
||||
// qiconengine.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QIconEngine /Supertype=sip.wrapper/
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qiconengine.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
%If (Qt_5_6_0 -)
|
||||
QIconEngine();
|
||||
%End
|
||||
%If (Qt_5_8_0 -)
|
||||
QIconEngine(const QIconEngine &other);
|
||||
%End
|
||||
virtual ~QIconEngine();
|
||||
virtual void paint(QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state) = 0;
|
||||
virtual QSize actualSize(const QSize &size, QIcon::Mode mode, QIcon::State state);
|
||||
virtual QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state);
|
||||
virtual void addPixmap(const QPixmap &pixmap, QIcon::Mode mode, QIcon::State state);
|
||||
virtual void addFile(const QString &fileName, const QSize &size, QIcon::Mode mode, QIcon::State state);
|
||||
virtual QString key() const;
|
||||
virtual QIconEngine *clone() const = 0 /Factory/;
|
||||
virtual bool read(QDataStream &in);
|
||||
virtual bool write(QDataStream &out) const;
|
||||
|
||||
enum IconEngineHook
|
||||
{
|
||||
AvailableSizesHook,
|
||||
IconNameHook,
|
||||
%If (Qt_5_7_0 -)
|
||||
IsNullHook,
|
||||
%End
|
||||
%If (Qt_5_9_0 -)
|
||||
ScaledPixmapHook,
|
||||
%End
|
||||
};
|
||||
|
||||
struct AvailableSizesArgument
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qiconengine.h>
|
||||
%End
|
||||
|
||||
QIcon::Mode mode;
|
||||
QIcon::State state;
|
||||
QList<QSize> sizes;
|
||||
};
|
||||
|
||||
virtual QList<QSize> availableSizes(QIcon::Mode mode = QIcon::Normal, QIcon::State state = QIcon::Off) const;
|
||||
virtual QString iconName() const;
|
||||
%If (Qt_5_7_0 -)
|
||||
bool isNull() const;
|
||||
%End
|
||||
%If (Qt_5_9_0 -)
|
||||
QPixmap scaledPixmap(const QSize &size, QIcon::Mode mode, QIcon::State state, qreal scale);
|
||||
%End
|
||||
%If (Qt_5_9_0 -)
|
||||
|
||||
struct ScaledPixmapArgument
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qiconengine.h>
|
||||
%End
|
||||
|
||||
QSize size;
|
||||
QIcon::Mode mode;
|
||||
QIcon::State state;
|
||||
qreal scale;
|
||||
QPixmap pixmap;
|
||||
};
|
||||
|
||||
%End
|
||||
};
|
||||
@@ -0,0 +1,316 @@
|
||||
// qimage.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QImage : public QPaintDevice
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qimage.h>
|
||||
%End
|
||||
|
||||
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 (Qt_5_2_0 -)
|
||||
Format_RGBX8888,
|
||||
%End
|
||||
%If (Qt_5_2_0 -)
|
||||
Format_RGBA8888,
|
||||
%End
|
||||
%If (Qt_5_2_0 -)
|
||||
Format_RGBA8888_Premultiplied,
|
||||
%End
|
||||
%If (Qt_5_4_0 -)
|
||||
Format_BGR30,
|
||||
%End
|
||||
%If (Qt_5_4_0 -)
|
||||
Format_A2BGR30_Premultiplied,
|
||||
%End
|
||||
%If (Qt_5_4_0 -)
|
||||
Format_RGB30,
|
||||
%End
|
||||
%If (Qt_5_4_0 -)
|
||||
Format_A2RGB30_Premultiplied,
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
Format_Alpha8,
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
Format_Grayscale8,
|
||||
%End
|
||||
%If (Qt_5_12_0 -)
|
||||
Format_RGBX64,
|
||||
%End
|
||||
%If (Qt_5_12_0 -)
|
||||
Format_RGBA64,
|
||||
%End
|
||||
%If (Qt_5_12_0 -)
|
||||
Format_RGBA64_Premultiplied,
|
||||
%End
|
||||
%If (Qt_5_13_0 -)
|
||||
Format_Grayscale16,
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
Format_BGR888,
|
||||
%End
|
||||
};
|
||||
|
||||
QImage();
|
||||
QImage(const QSize &size, QImage::Format format);
|
||||
QImage(int width, int height, QImage::Format format);
|
||||
QImage(const uchar *data /KeepReference/, int width, int height, QImage::Format format);
|
||||
QImage(void *data, int width, int height, QImage::Format format) [(uchar *data, int width, int height, QImage::Format format)];
|
||||
QImage(const uchar *data /KeepReference/, int width, int height, int bytesPerLine, QImage::Format format);
|
||||
QImage(void *data, int width, int height, int bytesPerLine, QImage::Format format) [(uchar *data, int width, int height, int bytesPerLine, QImage::Format format)];
|
||||
explicit QImage(SIP_PYLIST xpm /TypeHint="List[str]"/) [(const char **xpm)];
|
||||
%MethodCode
|
||||
// The Python interface is a list of strings that make up the image.
|
||||
|
||||
const char **str = QtGui_ListToArray(a0);
|
||||
|
||||
if (str)
|
||||
{
|
||||
sipCpp = new sipQImage(str);
|
||||
QtGui_DeleteArray(str);
|
||||
}
|
||||
else
|
||||
sipIsErr = 1;
|
||||
%End
|
||||
|
||||
QImage(const QString &fileName, const char *format = 0) /ReleaseGIL/;
|
||||
QImage(const QImage &);
|
||||
QImage(const QVariant &variant /GetWrapper/) /NoDerived/;
|
||||
%MethodCode
|
||||
if (a0->canConvert<QImage>())
|
||||
sipCpp = new sipQImage(a0->value<QImage>());
|
||||
else
|
||||
sipError = sipBadCallableArg(0, a0Wrapper);
|
||||
%End
|
||||
|
||||
virtual ~QImage();
|
||||
bool isNull() const;
|
||||
virtual int devType() const;
|
||||
bool operator==(const QImage &) const;
|
||||
bool operator!=(const QImage &) const;
|
||||
void detach();
|
||||
bool isDetached() const;
|
||||
QImage copy(const QRect &rect = QRect()) const;
|
||||
QImage copy(int x, int y, int w, int h) const;
|
||||
QImage::Format format() const;
|
||||
QImage convertToFormat(QImage::Format f, Qt::ImageConversionFlags flags = Qt::ImageConversionFlag::AutoColor) const;
|
||||
QImage convertToFormat(QImage::Format f, const QVector<unsigned int> &colorTable, Qt::ImageConversionFlags flags = Qt::ImageConversionFlag::AutoColor) const;
|
||||
int width() const;
|
||||
int height() const;
|
||||
QSize size() const;
|
||||
QRect rect() const;
|
||||
int depth() const;
|
||||
QRgb color(int i) const;
|
||||
void setColor(int i, QRgb c);
|
||||
bool allGray() const;
|
||||
bool isGrayscale() const;
|
||||
void *bits() [uchar * ()];
|
||||
const void *constBits() const [const uchar * ()];
|
||||
void *scanLine(int) [uchar * (int)];
|
||||
const void *constScanLine(int) const [const uchar * (int)];
|
||||
int bytesPerLine() const;
|
||||
bool valid(const QPoint &pt) const;
|
||||
bool valid(int x, int y) const;
|
||||
int pixelIndex(const QPoint &pt) const;
|
||||
int pixelIndex(int x, int y) const;
|
||||
QRgb pixel(const QPoint &pt) const;
|
||||
QRgb pixel(int x, int y) const;
|
||||
void setPixel(const QPoint &pt, uint index_or_rgb);
|
||||
void setPixel(int x, int y, uint index_or_rgb);
|
||||
QVector<unsigned int> colorTable() const;
|
||||
void setColorTable(const QVector<unsigned int> colors);
|
||||
void fill(Qt::GlobalColor color /Constrained/);
|
||||
void fill(const QColor &color);
|
||||
void fill(uint pixel);
|
||||
bool hasAlphaChannel() const;
|
||||
void setAlphaChannel(const QImage &alphaChannel);
|
||||
QImage createAlphaMask(Qt::ImageConversionFlags flags = Qt::ImageConversionFlag::AutoColor) const;
|
||||
QImage createHeuristicMask(bool clipTight = true) const;
|
||||
QImage scaled(int width, int height, Qt::AspectRatioMode aspectRatioMode = Qt::IgnoreAspectRatio, Qt::TransformationMode transformMode = Qt::FastTransformation) const;
|
||||
QImage scaled(const QSize &size, Qt::AspectRatioMode aspectRatioMode = Qt::IgnoreAspectRatio, Qt::TransformationMode transformMode = Qt::FastTransformation) const;
|
||||
QImage scaledToWidth(int width, Qt::TransformationMode mode = Qt::FastTransformation) const;
|
||||
QImage scaledToHeight(int height, Qt::TransformationMode mode = Qt::FastTransformation) const;
|
||||
QImage mirrored(bool horizontal = false, bool vertical = true) const;
|
||||
QImage rgbSwapped() const;
|
||||
void invertPixels(QImage::InvertMode mode = QImage::InvertRgb);
|
||||
bool load(QIODevice *device, const char *format) /ReleaseGIL/;
|
||||
bool load(const QString &fileName, const char *format = 0) /ReleaseGIL/;
|
||||
bool loadFromData(const uchar *data /Array/, int len /ArraySize/, const char *format = 0);
|
||||
bool loadFromData(const QByteArray &data, const char *format = 0);
|
||||
bool save(const QString &fileName, const char *format = 0, int quality = -1) const /ReleaseGIL/;
|
||||
bool save(QIODevice *device, const char *format = 0, int quality = -1) const /ReleaseGIL/;
|
||||
static QImage fromData(const uchar *data /Array/, int size /ArraySize/, const char *format = 0);
|
||||
static QImage fromData(const QByteArray &data, const char *format = 0);
|
||||
virtual QPaintEngine *paintEngine() const;
|
||||
int dotsPerMeterX() const;
|
||||
int dotsPerMeterY() const;
|
||||
void setDotsPerMeterX(int);
|
||||
void setDotsPerMeterY(int);
|
||||
QPoint offset() const;
|
||||
void setOffset(const QPoint &);
|
||||
QStringList textKeys() const;
|
||||
QString text(const QString &key = QString()) const;
|
||||
void setText(const QString &key, const QString &value);
|
||||
|
||||
protected:
|
||||
virtual int metric(QPaintDevice::PaintDeviceMetric metric) const;
|
||||
%If (Qt_5_5_0 -)
|
||||
QImage smoothScaled(int w, int h) const;
|
||||
%End
|
||||
|
||||
public:
|
||||
QImage createMaskFromColor(QRgb color, Qt::MaskMode mode = Qt::MaskInColor) const;
|
||||
QImage transformed(const QTransform &matrix, Qt::TransformationMode mode = Qt::FastTransformation) const;
|
||||
static QTransform trueMatrix(const QTransform &, int w, int h);
|
||||
qint64 cacheKey() const;
|
||||
int colorCount() const;
|
||||
void setColorCount(int);
|
||||
int byteCount() const;
|
||||
int bitPlaneCount() const;
|
||||
void swap(QImage &other /Constrained/);
|
||||
qreal devicePixelRatio() const;
|
||||
void setDevicePixelRatio(qreal scaleFactor);
|
||||
%If (Qt_5_4_0 -)
|
||||
QPixelFormat pixelFormat() const;
|
||||
%End
|
||||
%If (Qt_5_4_0 -)
|
||||
static QPixelFormat toPixelFormat(QImage::Format format);
|
||||
%End
|
||||
%If (Qt_5_4_0 -)
|
||||
static QImage::Format toImageFormat(QPixelFormat format);
|
||||
%End
|
||||
%If (Qt_5_6_0 -)
|
||||
QColor pixelColor(int x, int y) const;
|
||||
%End
|
||||
%If (Qt_5_6_0 -)
|
||||
QColor pixelColor(const QPoint &pt) const;
|
||||
%End
|
||||
%If (Qt_5_6_0 -)
|
||||
void setPixelColor(int x, int y, const QColor &c);
|
||||
%End
|
||||
%If (Qt_5_6_0 -)
|
||||
void setPixelColor(const QPoint &pt, const QColor &c);
|
||||
%End
|
||||
%If (Qt_5_9_0 -)
|
||||
bool reinterpretAsFormat(QImage::Format f);
|
||||
%End
|
||||
%If (Qt_5_10_0 -)
|
||||
Py_ssize_t sizeInBytes() const [qsizetype ()];
|
||||
%End
|
||||
%If (Qt_5_13_0 -)
|
||||
void convertTo(QImage::Format f, Qt::ImageConversionFlags flags = Qt::ImageConversionFlag::AutoColor);
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
QColorSpace colorSpace() const;
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
QImage convertedToColorSpace(const QColorSpace &) const;
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
void convertToColorSpace(const QColorSpace &);
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
void setColorSpace(const QColorSpace &);
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
void applyColorTransform(const QColorTransform &transform);
|
||||
%End
|
||||
};
|
||||
|
||||
QDataStream &operator<<(QDataStream &, const QImage & /Constrained/) /ReleaseGIL/;
|
||||
QDataStream &operator>>(QDataStream &, QImage & /Constrained/) /ReleaseGIL/;
|
||||
|
||||
%ModuleHeaderCode
|
||||
const char **QtGui_ListToArray(PyObject *lst);
|
||||
void QtGui_DeleteArray(const char **arr);
|
||||
%End
|
||||
|
||||
%ModuleCode
|
||||
// Convert a list of strings to an array of ASCII strings on the heap. Used by
|
||||
// QImage and QPixmap.
|
||||
const char **QtGui_ListToArray(PyObject *lst)
|
||||
{
|
||||
Py_ssize_t nstr = PyList_Size(lst);
|
||||
const char **arr = new const char *[nstr + 1];
|
||||
|
||||
for (Py_ssize_t i = 0; i < nstr; ++i)
|
||||
{
|
||||
PyObject *ascii_obj = PyList_GetItem(lst, i);
|
||||
const char *ascii = sipString_AsASCIIString(&ascii_obj);
|
||||
|
||||
if (!ascii)
|
||||
{
|
||||
while (i-- > 0)
|
||||
delete[] arr[i];
|
||||
|
||||
delete[] arr;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Copy the string.
|
||||
arr[i] = qstrdup(ascii);
|
||||
|
||||
Py_DECREF(ascii_obj);
|
||||
}
|
||||
|
||||
// The sentinal.
|
||||
arr[nstr] = 0;
|
||||
|
||||
return arr;
|
||||
}
|
||||
|
||||
|
||||
// Return a string array created by QtGui_ListToArray() to the heap.
|
||||
void QtGui_DeleteArray(const char **arr)
|
||||
{
|
||||
for (Py_ssize_t i = 0; arr[i]; ++i)
|
||||
delete[] arr[i];
|
||||
|
||||
delete[] arr;
|
||||
}
|
||||
%End
|
||||
@@ -0,0 +1,103 @@
|
||||
// qimageiohandler.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QImageIOHandler
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qimageiohandler.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum ImageOption
|
||||
{
|
||||
Size,
|
||||
ClipRect,
|
||||
Description,
|
||||
ScaledClipRect,
|
||||
ScaledSize,
|
||||
CompressionRatio,
|
||||
Gamma,
|
||||
Quality,
|
||||
Name,
|
||||
SubType,
|
||||
IncrementalReading,
|
||||
Endianness,
|
||||
Animation,
|
||||
BackgroundColor,
|
||||
%If (Qt_5_4_0 -)
|
||||
SupportedSubTypes,
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
OptimizedWrite,
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
ProgressiveScanWrite,
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
ImageTransformation,
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
TransformedByDefault,
|
||||
%End
|
||||
};
|
||||
|
||||
QImageIOHandler();
|
||||
virtual ~QImageIOHandler();
|
||||
void setDevice(QIODevice *device);
|
||||
QIODevice *device() const;
|
||||
void setFormat(const QByteArray &format);
|
||||
QByteArray format() const;
|
||||
virtual bool canRead() const = 0;
|
||||
virtual bool read(QImage *image) = 0;
|
||||
virtual bool write(const QImage &image);
|
||||
virtual QVariant option(QImageIOHandler::ImageOption option) const;
|
||||
virtual void setOption(QImageIOHandler::ImageOption option, const QVariant &value);
|
||||
virtual bool supportsOption(QImageIOHandler::ImageOption option) const;
|
||||
virtual bool jumpToNextImage();
|
||||
virtual bool jumpToImage(int imageNumber);
|
||||
virtual int loopCount() const;
|
||||
virtual int imageCount() const;
|
||||
virtual int nextImageDelay() const;
|
||||
virtual int currentImageNumber() const;
|
||||
virtual QRect currentImageRect() const;
|
||||
%If (Qt_5_5_0 -)
|
||||
|
||||
enum Transformation
|
||||
{
|
||||
TransformationNone,
|
||||
TransformationMirror,
|
||||
TransformationFlip,
|
||||
TransformationRotate180,
|
||||
TransformationRotate90,
|
||||
TransformationMirrorAndRotate90,
|
||||
TransformationFlipAndRotate90,
|
||||
TransformationRotate270,
|
||||
};
|
||||
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
typedef QFlags<QImageIOHandler::Transformation> Transformations;
|
||||
%End
|
||||
|
||||
private:
|
||||
QImageIOHandler(const QImageIOHandler &);
|
||||
};
|
||||
@@ -0,0 +1,114 @@
|
||||
// qimagereader.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QImageReader
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qimagereader.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum ImageReaderError
|
||||
{
|
||||
UnknownError,
|
||||
FileNotFoundError,
|
||||
DeviceError,
|
||||
UnsupportedFormatError,
|
||||
InvalidDataError,
|
||||
};
|
||||
|
||||
QImageReader();
|
||||
QImageReader(QIODevice *device, const QByteArray &format = QByteArray());
|
||||
QImageReader(const QString &fileName, const QByteArray &format = QByteArray());
|
||||
~QImageReader();
|
||||
void setFormat(const QByteArray &format);
|
||||
QByteArray format() const;
|
||||
void setDevice(QIODevice *device);
|
||||
QIODevice *device() const;
|
||||
void setFileName(const QString &fileName);
|
||||
QString fileName() const;
|
||||
QSize size() const;
|
||||
void setClipRect(const QRect &rect);
|
||||
QRect clipRect() const;
|
||||
void setScaledSize(const QSize &size);
|
||||
QSize scaledSize() const;
|
||||
void setScaledClipRect(const QRect &rect);
|
||||
QRect scaledClipRect() const;
|
||||
bool canRead() const;
|
||||
QImage read() /ReleaseGIL/;
|
||||
bool read(QImage *image) /ReleaseGIL/;
|
||||
bool jumpToNextImage();
|
||||
bool jumpToImage(int imageNumber);
|
||||
int loopCount() const;
|
||||
int imageCount() const;
|
||||
int nextImageDelay() const;
|
||||
int currentImageNumber() const;
|
||||
QRect currentImageRect() const;
|
||||
QImageReader::ImageReaderError error() const;
|
||||
QString errorString() const;
|
||||
static QByteArray imageFormat(const QString &fileName);
|
||||
static QByteArray imageFormat(QIODevice *device);
|
||||
static QList<QByteArray> supportedImageFormats();
|
||||
QStringList textKeys() const;
|
||||
QString text(const QString &key) const;
|
||||
void setBackgroundColor(const QColor &color);
|
||||
QColor backgroundColor() const;
|
||||
bool supportsAnimation() const;
|
||||
void setQuality(int quality);
|
||||
int quality() const;
|
||||
bool supportsOption(QImageIOHandler::ImageOption option) const;
|
||||
void setAutoDetectImageFormat(bool enabled);
|
||||
bool autoDetectImageFormat() const;
|
||||
QImage::Format imageFormat() const;
|
||||
void setDecideFormatFromContent(bool ignored);
|
||||
bool decideFormatFromContent() const;
|
||||
%If (Qt_5_1_0 -)
|
||||
static QList<QByteArray> supportedMimeTypes();
|
||||
%End
|
||||
%If (Qt_5_4_0 -)
|
||||
QByteArray subType() const;
|
||||
%End
|
||||
%If (Qt_5_4_0 -)
|
||||
QList<QByteArray> supportedSubTypes() const;
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
QImageIOHandler::Transformations transformation() const;
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
void setAutoTransform(bool enabled);
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
bool autoTransform() const;
|
||||
%End
|
||||
%If (Qt_5_6_0 -)
|
||||
void setGamma(float gamma);
|
||||
%End
|
||||
%If (Qt_5_6_0 -)
|
||||
float gamma() const;
|
||||
%End
|
||||
%If (Qt_5_12_0 -)
|
||||
static QList<QByteArray> imageFormatsForMimeType(const QByteArray &mimeType);
|
||||
%End
|
||||
|
||||
private:
|
||||
QImageReader(const QImageReader &);
|
||||
};
|
||||
@@ -0,0 +1,99 @@
|
||||
// qimagewriter.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QImageWriter
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qimagewriter.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum ImageWriterError
|
||||
{
|
||||
UnknownError,
|
||||
DeviceError,
|
||||
UnsupportedFormatError,
|
||||
%If (Qt_5_10_0 -)
|
||||
InvalidImageError,
|
||||
%End
|
||||
};
|
||||
|
||||
QImageWriter();
|
||||
QImageWriter(QIODevice *device, const QByteArray &format);
|
||||
QImageWriter(const QString &fileName, const QByteArray &format = QByteArray());
|
||||
~QImageWriter();
|
||||
void setFormat(const QByteArray &format);
|
||||
QByteArray format() const;
|
||||
void setDevice(QIODevice *device);
|
||||
QIODevice *device() const;
|
||||
void setFileName(const QString &fileName);
|
||||
QString fileName() const;
|
||||
void setQuality(int quality);
|
||||
int quality() const;
|
||||
void setGamma(float gamma);
|
||||
float gamma() const;
|
||||
bool canWrite() const;
|
||||
bool write(const QImage &image) /ReleaseGIL/;
|
||||
QImageWriter::ImageWriterError error() const;
|
||||
QString errorString() const;
|
||||
static QList<QByteArray> supportedImageFormats();
|
||||
void setText(const QString &key, const QString &text);
|
||||
bool supportsOption(QImageIOHandler::ImageOption option) const;
|
||||
void setCompression(int compression);
|
||||
int compression() const;
|
||||
%If (Qt_5_1_0 -)
|
||||
static QList<QByteArray> supportedMimeTypes();
|
||||
%End
|
||||
%If (Qt_5_4_0 -)
|
||||
void setSubType(const QByteArray &type);
|
||||
%End
|
||||
%If (Qt_5_4_0 -)
|
||||
QByteArray subType() const;
|
||||
%End
|
||||
%If (Qt_5_4_0 -)
|
||||
QList<QByteArray> supportedSubTypes() const;
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
void setOptimizedWrite(bool optimize);
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
bool optimizedWrite() const;
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
void setProgressiveScanWrite(bool progressive);
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
bool progressiveScanWrite() const;
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
QImageIOHandler::Transformations transformation() const;
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
void setTransformation(QImageIOHandler::Transformations orientation);
|
||||
%End
|
||||
%If (Qt_5_12_0 -)
|
||||
static QList<QByteArray> imageFormatsForMimeType(const QByteArray &mimeType);
|
||||
%End
|
||||
|
||||
private:
|
||||
QImageWriter(const QImageWriter &);
|
||||
};
|
||||
@@ -0,0 +1,91 @@
|
||||
// qinputmethod.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QInputMethod : public QObject
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qinputmethod.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QTransform inputItemTransform() const;
|
||||
void setInputItemTransform(const QTransform &transform);
|
||||
QRectF cursorRectangle() const;
|
||||
QRectF keyboardRectangle() const;
|
||||
|
||||
enum Action
|
||||
{
|
||||
Click,
|
||||
ContextMenu,
|
||||
};
|
||||
|
||||
bool isVisible() const;
|
||||
void setVisible(bool visible);
|
||||
bool isAnimating() const;
|
||||
QLocale locale() const;
|
||||
Qt::LayoutDirection inputDirection() const;
|
||||
%If (Qt_5_1_0 -)
|
||||
QRectF inputItemRectangle() const;
|
||||
%End
|
||||
%If (Qt_5_1_0 -)
|
||||
void setInputItemRectangle(const QRectF &rect);
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
static QVariant queryFocusObject(Qt::InputMethodQuery query, QVariant argument);
|
||||
%End
|
||||
|
||||
public slots:
|
||||
void show();
|
||||
void hide();
|
||||
void update(Qt::InputMethodQueries queries);
|
||||
void reset();
|
||||
void commit();
|
||||
void invokeAction(QInputMethod::Action a, int cursorPosition);
|
||||
|
||||
signals:
|
||||
void cursorRectangleChanged();
|
||||
void keyboardRectangleChanged();
|
||||
void visibleChanged();
|
||||
void animatingChanged();
|
||||
void localeChanged();
|
||||
void inputDirectionChanged(Qt::LayoutDirection newDirection);
|
||||
|
||||
public:
|
||||
%If (Qt_5_7_0 -)
|
||||
QRectF anchorRectangle() const;
|
||||
%End
|
||||
%If (Qt_5_7_0 -)
|
||||
QRectF inputItemClipRectangle() const;
|
||||
%End
|
||||
|
||||
signals:
|
||||
%If (Qt_5_7_0 -)
|
||||
void anchorRectangleChanged();
|
||||
%End
|
||||
%If (Qt_5_7_0 -)
|
||||
void inputItemClipRectangleChanged();
|
||||
%End
|
||||
|
||||
private:
|
||||
QInputMethod();
|
||||
virtual ~QInputMethod();
|
||||
};
|
||||
@@ -0,0 +1,246 @@
|
||||
// qkeysequence.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QKeySequence /TypeHintIn="Union[QKeySequence, QKeySequence.StandardKey, QString, int]"/
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qkeysequence.h>
|
||||
%End
|
||||
|
||||
%ConvertToTypeCode
|
||||
// Allow a StandardKey, QString or an integer whenever a QKeySequence is
|
||||
// expected.
|
||||
|
||||
if (sipIsErr == NULL)
|
||||
{
|
||||
if (sipCanConvertToType(sipPy, sipType_QKeySequence, SIP_NO_CONVERTORS))
|
||||
return 1;
|
||||
|
||||
if (PyObject_TypeCheck(sipPy, sipTypeAsPyTypeObject(sipType_QKeySequence_StandardKey)))
|
||||
return 1;
|
||||
|
||||
if (sipCanConvertToType(sipPy, sipType_QString, 0))
|
||||
return 1;
|
||||
|
||||
PyErr_Clear();
|
||||
|
||||
SIPLong_AsLong(sipPy);
|
||||
|
||||
return !PyErr_Occurred();
|
||||
}
|
||||
|
||||
if (sipCanConvertToType(sipPy, sipType_QKeySequence, SIP_NO_CONVERTORS))
|
||||
{
|
||||
*sipCppPtr = reinterpret_cast<QKeySequence *>(sipConvertToType(sipPy, sipType_QKeySequence, sipTransferObj, SIP_NO_CONVERTORS, 0, sipIsErr));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (PyObject_TypeCheck(sipPy, sipTypeAsPyTypeObject(sipType_QKeySequence_StandardKey)))
|
||||
{
|
||||
*sipCppPtr = new QKeySequence((QKeySequence::StandardKey)SIPLong_AsLong(sipPy));
|
||||
|
||||
return sipGetState(sipTransferObj);
|
||||
}
|
||||
|
||||
if (sipCanConvertToType(sipPy, sipType_QString, 0))
|
||||
{
|
||||
int state;
|
||||
QString *qs = reinterpret_cast<QString *>(sipConvertToType(sipPy, sipType_QString, 0, 0, &state, sipIsErr));
|
||||
|
||||
if (*sipIsErr)
|
||||
{
|
||||
sipReleaseType(qs, sipType_QString, state);
|
||||
return 0;
|
||||
}
|
||||
|
||||
*sipCppPtr = new QKeySequence(*qs);
|
||||
|
||||
sipReleaseType(qs, sipType_QString, state);
|
||||
|
||||
return sipGetState(sipTransferObj);
|
||||
}
|
||||
|
||||
int key = SIPLong_AsLong(sipPy);
|
||||
|
||||
*sipCppPtr = new QKeySequence(key);
|
||||
|
||||
return sipGetState(sipTransferObj);
|
||||
%End
|
||||
|
||||
%PickleCode
|
||||
sipRes = Py_BuildValue((char *)"iiii", sipCpp->operator[](0), sipCpp->operator[](1), sipCpp->operator[](2), sipCpp->operator[](3));
|
||||
%End
|
||||
|
||||
public:
|
||||
enum SequenceFormat
|
||||
{
|
||||
NativeText,
|
||||
PortableText,
|
||||
};
|
||||
|
||||
enum SequenceMatch
|
||||
{
|
||||
NoMatch,
|
||||
PartialMatch,
|
||||
ExactMatch,
|
||||
};
|
||||
|
||||
enum StandardKey
|
||||
{
|
||||
UnknownKey,
|
||||
HelpContents,
|
||||
WhatsThis,
|
||||
Open,
|
||||
Close,
|
||||
Save,
|
||||
New,
|
||||
Delete,
|
||||
Cut,
|
||||
Copy,
|
||||
Paste,
|
||||
Undo,
|
||||
Redo,
|
||||
Back,
|
||||
Forward,
|
||||
Refresh,
|
||||
ZoomIn,
|
||||
ZoomOut,
|
||||
Print,
|
||||
AddTab,
|
||||
NextChild,
|
||||
PreviousChild,
|
||||
Find,
|
||||
FindNext,
|
||||
FindPrevious,
|
||||
Replace,
|
||||
SelectAll,
|
||||
Bold,
|
||||
Italic,
|
||||
Underline,
|
||||
MoveToNextChar,
|
||||
MoveToPreviousChar,
|
||||
MoveToNextWord,
|
||||
MoveToPreviousWord,
|
||||
MoveToNextLine,
|
||||
MoveToPreviousLine,
|
||||
MoveToNextPage,
|
||||
MoveToPreviousPage,
|
||||
MoveToStartOfLine,
|
||||
MoveToEndOfLine,
|
||||
MoveToStartOfBlock,
|
||||
MoveToEndOfBlock,
|
||||
MoveToStartOfDocument,
|
||||
MoveToEndOfDocument,
|
||||
SelectNextChar,
|
||||
SelectPreviousChar,
|
||||
SelectNextWord,
|
||||
SelectPreviousWord,
|
||||
SelectNextLine,
|
||||
SelectPreviousLine,
|
||||
SelectNextPage,
|
||||
SelectPreviousPage,
|
||||
SelectStartOfLine,
|
||||
SelectEndOfLine,
|
||||
SelectStartOfBlock,
|
||||
SelectEndOfBlock,
|
||||
SelectStartOfDocument,
|
||||
SelectEndOfDocument,
|
||||
DeleteStartOfWord,
|
||||
DeleteEndOfWord,
|
||||
DeleteEndOfLine,
|
||||
InsertParagraphSeparator,
|
||||
InsertLineSeparator,
|
||||
SaveAs,
|
||||
Preferences,
|
||||
Quit,
|
||||
FullScreen,
|
||||
%If (Qt_5_1_0 -)
|
||||
Deselect,
|
||||
%End
|
||||
%If (Qt_5_2_0 -)
|
||||
DeleteCompleteLine,
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
Backspace,
|
||||
%End
|
||||
%If (Qt_5_6_0 -)
|
||||
Cancel,
|
||||
%End
|
||||
};
|
||||
|
||||
QKeySequence();
|
||||
QKeySequence(const QKeySequence &ks);
|
||||
QKeySequence(const QString &key, QKeySequence::SequenceFormat format = QKeySequence::NativeText);
|
||||
QKeySequence(int k1, int key2 = 0, int key3 = 0, int key4 = 0);
|
||||
QKeySequence(const QVariant &variant /GetWrapper/) /NoDerived/;
|
||||
%MethodCode
|
||||
if (a0->canConvert<QKeySequence>())
|
||||
sipCpp = new QKeySequence(a0->value<QKeySequence>());
|
||||
else
|
||||
sipError = sipBadCallableArg(0, a0Wrapper);
|
||||
%End
|
||||
|
||||
~QKeySequence();
|
||||
int count() const /__len__/;
|
||||
bool isEmpty() const;
|
||||
QKeySequence::SequenceMatch matches(const QKeySequence &seq) const;
|
||||
static QKeySequence mnemonic(const QString &text);
|
||||
int operator[](int i) const;
|
||||
%MethodCode
|
||||
Py_ssize_t idx = sipConvertFromSequenceIndex(a0, sipCpp->count());
|
||||
|
||||
if (idx < 0)
|
||||
sipIsErr = 1;
|
||||
else
|
||||
sipRes = sipCpp->operator[]((uint)idx);
|
||||
%End
|
||||
|
||||
bool operator==(const QKeySequence &other) const;
|
||||
bool operator!=(const QKeySequence &other) const;
|
||||
bool operator<(const QKeySequence &ks) const;
|
||||
bool operator>(const QKeySequence &other) const;
|
||||
bool operator<=(const QKeySequence &other) const;
|
||||
bool operator>=(const QKeySequence &other) const;
|
||||
bool isDetached() const;
|
||||
void swap(QKeySequence &other /Constrained/);
|
||||
QString toString(QKeySequence::SequenceFormat format = QKeySequence::PortableText) const;
|
||||
static QKeySequence fromString(const QString &str, QKeySequence::SequenceFormat format = QKeySequence::PortableText);
|
||||
static QList<QKeySequence> keyBindings(QKeySequence::StandardKey key);
|
||||
%If (Qt_5_1_0 -)
|
||||
static QList<QKeySequence> listFromString(const QString &str, QKeySequence::SequenceFormat format = QKeySequence::PortableText);
|
||||
%End
|
||||
%If (Qt_5_1_0 -)
|
||||
static QString listToString(const QList<QKeySequence> &list, QKeySequence::SequenceFormat format = QKeySequence::PortableText);
|
||||
%End
|
||||
%If (Qt_5_6_0 -)
|
||||
long __hash__() const;
|
||||
%MethodCode
|
||||
sipRes = qHash(*sipCpp);
|
||||
%End
|
||||
|
||||
%End
|
||||
};
|
||||
|
||||
QDataStream &operator<<(QDataStream &in, const QKeySequence &ks /Constrained/) /ReleaseGIL/;
|
||||
QDataStream &operator>>(QDataStream &out, QKeySequence &ks /Constrained/) /ReleaseGIL/;
|
||||
void qt_set_sequence_auto_mnemonic(bool b);
|
||||
@@ -0,0 +1,320 @@
|
||||
// qmatrix4x4.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%ModuleCode
|
||||
#include <qmatrix4x4.h>
|
||||
%End
|
||||
|
||||
class QMatrix4x4
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qmatrix4x4.h>
|
||||
%End
|
||||
|
||||
%PickleCode
|
||||
PYQT_FLOAT data[16];
|
||||
|
||||
// We want the data in row-major order.
|
||||
sipCpp->copyDataTo(data);
|
||||
|
||||
sipRes = Py_BuildValue((char *)"dddddddddddddddd",
|
||||
(double)data[0], (double)data[1], (double)data[2], (double)data[3],
|
||||
(double)data[4], (double)data[5], (double)data[6], (double)data[7],
|
||||
(double)data[8], (double)data[9], (double)data[10], (double)data[11],
|
||||
(double)data[12], (double)data[13], (double)data[14], (double)data[15]);
|
||||
%End
|
||||
|
||||
public:
|
||||
QMatrix4x4();
|
||||
explicit QMatrix4x4(SIP_PYOBJECT values /TypeHint="Sequence[float]"/) [(const float *values)];
|
||||
%MethodCode
|
||||
float values[16];
|
||||
|
||||
if ((sipError = qtgui_matrixDataFromSequence(a0, 16, values)) == sipErrorNone)
|
||||
sipCpp = new QMatrix4x4(values);
|
||||
%End
|
||||
|
||||
QMatrix4x4(float m11, float m12, float m13, float m14, float m21, float m22, float m23, float m24, float m31, float m32, float m33, float m34, float m41, float m42, float m43, float m44);
|
||||
QMatrix4x4(const QTransform &transform);
|
||||
SIP_PYOBJECT __repr__() const /TypeHint="str"/;
|
||||
%MethodCode
|
||||
bool bad = false;
|
||||
int i;
|
||||
PyObject *m[16];
|
||||
PYQT_FLOAT data[16];
|
||||
|
||||
// The raw data is in column-major order but we want row-major order.
|
||||
sipCpp->copyDataTo(data);
|
||||
|
||||
for (i = 0; i < 16; ++i)
|
||||
{
|
||||
m[i] = PyFloat_FromDouble(data[i]);
|
||||
|
||||
if (!m[i])
|
||||
bad = true;
|
||||
}
|
||||
|
||||
if (!bad)
|
||||
{
|
||||
#if PY_MAJOR_VERSION >= 3
|
||||
sipRes = PyUnicode_FromFormat("PyQt5.QtGui.QMatrix4x4("
|
||||
"%R, %R, %R, %R, "
|
||||
"%R, %R, %R, %R, "
|
||||
"%R, %R, %R, %R, "
|
||||
"%R, %R, %R, %R)",
|
||||
m[0], m[1], m[2], m[3],
|
||||
m[4], m[5], m[6], m[7],
|
||||
m[8], m[9], m[10], m[11],
|
||||
m[12], m[13], m[14], m[15]);
|
||||
#else
|
||||
sipRes = PyString_FromString("PyQt5.QtGui.QMatrix4x4(");
|
||||
|
||||
for (i = 0; i < 16; ++i)
|
||||
{
|
||||
if (i != 0)
|
||||
PyString_ConcatAndDel(&sipRes, PyString_FromString(", "));
|
||||
|
||||
PyString_ConcatAndDel(&sipRes, PyObject_Repr(m[i]));
|
||||
}
|
||||
|
||||
PyString_ConcatAndDel(&sipRes, PyString_FromString(")"));
|
||||
#endif
|
||||
}
|
||||
|
||||
for (i = 0; i < 16; ++i)
|
||||
Py_XDECREF(m[i]);
|
||||
%End
|
||||
|
||||
double determinant() const;
|
||||
QMatrix4x4 inverted(bool *invertible = 0) const;
|
||||
QMatrix4x4 transposed() const;
|
||||
QMatrix3x3 normalMatrix() const;
|
||||
void scale(const QVector3D &vector);
|
||||
void scale(float x, float y);
|
||||
void scale(float x, float y, float z);
|
||||
void scale(float factor);
|
||||
void translate(const QVector3D &vector);
|
||||
void translate(float x, float y);
|
||||
void translate(float x, float y, float z);
|
||||
void rotate(float angle, const QVector3D &vector);
|
||||
void rotate(float angle, float x, float y, float z = 0.F);
|
||||
void rotate(const QQuaternion &quaternion);
|
||||
void ortho(const QRect &rect);
|
||||
void ortho(const QRectF &rect);
|
||||
void ortho(float left, float right, float bottom, float top, float nearPlane, float farPlane);
|
||||
void frustum(float left, float right, float bottom, float top, float nearPlane, float farPlane);
|
||||
void perspective(float angle, float aspect, float nearPlane, float farPlane);
|
||||
void lookAt(const QVector3D &eye, const QVector3D ¢er, const QVector3D &up);
|
||||
SIP_PYLIST copyDataTo() const /TypeHint="List[float]"/;
|
||||
%MethodCode
|
||||
float values[16];
|
||||
|
||||
sipCpp->copyDataTo(values);
|
||||
sipError = qtgui_matrixDataAsList(16, values, &sipRes);
|
||||
%End
|
||||
|
||||
QTransform toTransform() const;
|
||||
QTransform toTransform(float distanceToPlane) const;
|
||||
QRect mapRect(const QRect &rect) const;
|
||||
QRectF mapRect(const QRectF &rect) const;
|
||||
SIP_PYLIST data() /TypeHint="List[float]"/;
|
||||
%MethodCode
|
||||
sipError = qtgui_matrixDataAsList(16, sipCpp->constData(), &sipRes);
|
||||
%End
|
||||
|
||||
void optimize();
|
||||
SIP_PYOBJECT __getitem__(SIP_PYOBJECT) const;
|
||||
%MethodCode
|
||||
int row, column;
|
||||
|
||||
if ((sipError = qtgui_matrixParseIndex(a0, 4, 4, &row, &column)) == sipErrorNone)
|
||||
{
|
||||
sipRes = PyFloat_FromDouble(sipCpp->operator()(row, column));
|
||||
|
||||
if (!sipRes)
|
||||
sipError = sipErrorFail;
|
||||
}
|
||||
%End
|
||||
|
||||
void __setitem__(SIP_PYOBJECT, qreal);
|
||||
%MethodCode
|
||||
int row, column;
|
||||
|
||||
if ((sipError = qtgui_matrixParseIndex(a0, 4, 4, &row, &column)) == sipErrorNone)
|
||||
sipCpp->operator()(row, column) = a1;
|
||||
%End
|
||||
|
||||
QVector4D column(int index) const;
|
||||
void setColumn(int index, const QVector4D &value);
|
||||
QVector4D row(int index) const;
|
||||
void setRow(int index, const QVector4D &value);
|
||||
bool isIdentity() const;
|
||||
void setToIdentity();
|
||||
void fill(float value);
|
||||
QMatrix4x4 &operator+=(const QMatrix4x4 &other);
|
||||
QMatrix4x4 &operator-=(const QMatrix4x4 &other);
|
||||
QMatrix4x4 &operator*=(const QMatrix4x4 &other) /__imatmul__/;
|
||||
QMatrix4x4 &operator*=(float factor);
|
||||
QMatrix4x4 &operator/=(float divisor);
|
||||
bool operator==(const QMatrix4x4 &other) const;
|
||||
bool operator!=(const QMatrix4x4 &other) const;
|
||||
QPoint map(const QPoint &point) const;
|
||||
QPointF map(const QPointF &point) const;
|
||||
QVector3D map(const QVector3D &point) const;
|
||||
QVector3D mapVector(const QVector3D &vector) const;
|
||||
QVector4D map(const QVector4D &point) const;
|
||||
%If (Qt_5_4_0 -)
|
||||
void viewport(float left, float bottom, float width, float height, float nearPlane = 0.F, float farPlane = 1.F);
|
||||
%End
|
||||
%If (Qt_5_4_0 -)
|
||||
void viewport(const QRectF &rect);
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
bool isAffine() const;
|
||||
%End
|
||||
};
|
||||
|
||||
QMatrix4x4 operator/(const QMatrix4x4 &matrix, float divisor);
|
||||
QMatrix4x4 operator+(const QMatrix4x4 &m1, const QMatrix4x4 &m2);
|
||||
QMatrix4x4 operator-(const QMatrix4x4 &m1, const QMatrix4x4 &m2);
|
||||
QMatrix4x4 operator*(const QMatrix4x4 &m1, const QMatrix4x4 &m2) /__matmul__/;
|
||||
QVector3D operator*(const QVector3D &vector, const QMatrix4x4 &matrix);
|
||||
QVector3D operator*(const QMatrix4x4 &matrix, const QVector3D &vector);
|
||||
QVector4D operator*(const QVector4D &vector, const QMatrix4x4 &matrix);
|
||||
QVector4D operator*(const QMatrix4x4 &matrix, const QVector4D &vector);
|
||||
QPoint operator*(const QPoint &point, const QMatrix4x4 &matrix);
|
||||
QPointF operator*(const QPointF &point, const QMatrix4x4 &matrix);
|
||||
QPoint operator*(const QMatrix4x4 &matrix, const QPoint &point);
|
||||
QPointF operator*(const QMatrix4x4 &matrix, const QPointF &point);
|
||||
QMatrix4x4 operator-(const QMatrix4x4 &matrix);
|
||||
QMatrix4x4 operator*(float factor, const QMatrix4x4 &matrix);
|
||||
QMatrix4x4 operator*(const QMatrix4x4 &matrix, float factor);
|
||||
bool qFuzzyCompare(const QMatrix4x4 &m1, const QMatrix4x4 &m2);
|
||||
QDataStream &operator<<(QDataStream &, const QMatrix4x4 & /Constrained/) /ReleaseGIL/;
|
||||
QDataStream &operator>>(QDataStream &, QMatrix4x4 & /Constrained/) /ReleaseGIL/;
|
||||
|
||||
%ModuleHeaderCode
|
||||
// Helpers for the matrix classes.
|
||||
typedef float PYQT_FLOAT;
|
||||
|
||||
sipErrorState qtgui_matrixParseIndex(PyObject *tup, int nr_rows,
|
||||
int nr_columns, int *row, int *column);
|
||||
sipErrorState qtgui_matrixDataFromSequence(PyObject *seq, int nr_values,
|
||||
PYQT_FLOAT *values);
|
||||
sipErrorState qtgui_matrixDataAsList(int nr_values, const PYQT_FLOAT *values,
|
||||
PyObject **list);
|
||||
%End
|
||||
|
||||
%ModuleCode
|
||||
// Convert a Python object to a row and column.
|
||||
sipErrorState qtgui_matrixParseIndex(PyObject *tup, int nr_rows,
|
||||
int nr_columns, int *row, int *column)
|
||||
{
|
||||
sipErrorState es = sipErrorContinue;
|
||||
|
||||
if (PyTuple_Check(tup) && PyArg_ParseTuple(tup, "ii", row, column))
|
||||
if (*row >= 0 && *row < nr_rows && *column >= 0 && *column < nr_columns)
|
||||
es = sipErrorNone;
|
||||
|
||||
if (es == sipErrorContinue)
|
||||
PyErr_Format(PyExc_IndexError, "an index must be a row in the range 0 to %d and a column in the range 0 to %d", nr_rows - 1, nr_columns - 1);
|
||||
|
||||
return es;
|
||||
}
|
||||
|
||||
|
||||
// Convert a Python object to an array of qreals.
|
||||
sipErrorState qtgui_matrixDataFromSequence(PyObject *seq, int nr_values,
|
||||
PYQT_FLOAT *values)
|
||||
{
|
||||
sipErrorState es;
|
||||
|
||||
if (PySequence_Size(seq) == nr_values)
|
||||
{
|
||||
es = sipErrorNone;
|
||||
|
||||
for (int i = 0; i < nr_values; ++i)
|
||||
{
|
||||
PyObject *value = PySequence_GetItem(seq, i);
|
||||
|
||||
if (!value)
|
||||
{
|
||||
es = sipErrorFail;
|
||||
break;
|
||||
}
|
||||
|
||||
PyErr_Clear();
|
||||
|
||||
double d = PyFloat_AsDouble(value);
|
||||
|
||||
if (PyErr_Occurred())
|
||||
{
|
||||
Py_DECREF(value);
|
||||
es = sipErrorContinue;
|
||||
break;
|
||||
}
|
||||
|
||||
Py_DECREF(value);
|
||||
|
||||
*values++ = d;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
es = sipErrorContinue;
|
||||
}
|
||||
|
||||
if (es == sipErrorContinue)
|
||||
PyErr_Format(PyExc_TypeError, "a sequence of %d floats is expected",
|
||||
nr_values);
|
||||
|
||||
return es;
|
||||
}
|
||||
|
||||
|
||||
// Convert an array of qreals to a Python list.
|
||||
sipErrorState qtgui_matrixDataAsList(int nr_values, const PYQT_FLOAT *values,
|
||||
PyObject **list)
|
||||
{
|
||||
PyObject *l = PyList_New(nr_values);
|
||||
|
||||
if (!l)
|
||||
return sipErrorFail;
|
||||
|
||||
for (int i = 0; i < nr_values; ++i)
|
||||
{
|
||||
PyObject *value = PyFloat_FromDouble(*values++);
|
||||
|
||||
if (!value)
|
||||
{
|
||||
Py_DECREF(l);
|
||||
return sipErrorFail;
|
||||
}
|
||||
|
||||
PyList_SetItem(l, i, value);
|
||||
}
|
||||
|
||||
*list = l;
|
||||
|
||||
return sipErrorNone;
|
||||
}
|
||||
%End
|
||||
@@ -0,0 +1,95 @@
|
||||
// qmovie.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QMovie : public QObject
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qmovie.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum MovieState
|
||||
{
|
||||
NotRunning,
|
||||
Paused,
|
||||
Running,
|
||||
};
|
||||
|
||||
enum CacheMode
|
||||
{
|
||||
CacheNone,
|
||||
CacheAll,
|
||||
};
|
||||
|
||||
explicit QMovie(QObject *parent /TransferThis/ = 0);
|
||||
QMovie(QIODevice *device, const QByteArray &format = QByteArray(), QObject *parent /TransferThis/ = 0);
|
||||
QMovie(const QString &fileName, const QByteArray &format = QByteArray(), QObject *parent /TransferThis/ = 0);
|
||||
virtual ~QMovie();
|
||||
static QList<QByteArray> supportedFormats();
|
||||
void setDevice(QIODevice *device);
|
||||
QIODevice *device() const;
|
||||
void setFileName(const QString &fileName);
|
||||
QString fileName() const;
|
||||
void setFormat(const QByteArray &format);
|
||||
QByteArray format() const;
|
||||
void setBackgroundColor(const QColor &color);
|
||||
QColor backgroundColor() const;
|
||||
QMovie::MovieState state() const;
|
||||
QRect frameRect() const;
|
||||
QImage currentImage() const;
|
||||
QPixmap currentPixmap() const;
|
||||
bool isValid() const;
|
||||
bool jumpToFrame(int frameNumber);
|
||||
int loopCount() const;
|
||||
int frameCount() const;
|
||||
int nextFrameDelay() const;
|
||||
int currentFrameNumber() const;
|
||||
void setSpeed(int percentSpeed);
|
||||
int speed() const;
|
||||
QSize scaledSize();
|
||||
void setScaledSize(const QSize &size);
|
||||
QMovie::CacheMode cacheMode() const;
|
||||
void setCacheMode(QMovie::CacheMode mode);
|
||||
|
||||
signals:
|
||||
void started();
|
||||
void resized(const QSize &size);
|
||||
void updated(const QRect &rect);
|
||||
void stateChanged(QMovie::MovieState state);
|
||||
void error(QImageReader::ImageReaderError error);
|
||||
void finished();
|
||||
void frameChanged(int frameNumber);
|
||||
|
||||
public slots:
|
||||
void start();
|
||||
bool jumpToNextFrame();
|
||||
void setPaused(bool paused);
|
||||
void stop();
|
||||
|
||||
public:
|
||||
%If (Qt_5_10_0 -)
|
||||
QImageReader::ImageReaderError lastError() const;
|
||||
%End
|
||||
%If (Qt_5_10_0 -)
|
||||
QString lastErrorString() const;
|
||||
%End
|
||||
};
|
||||
@@ -0,0 +1,60 @@
|
||||
// qoffscreensurface.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (Qt_5_1_0 -)
|
||||
|
||||
class QOffscreenSurface : public QObject, public QSurface
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qoffscreensurface.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
explicit QOffscreenSurface(QScreen *screen = 0);
|
||||
%If (Qt_5_10_0 -)
|
||||
QOffscreenSurface(QScreen *screen, QObject *parent /TransferThis/);
|
||||
%End
|
||||
virtual ~QOffscreenSurface();
|
||||
virtual QSurface::SurfaceType surfaceType() const;
|
||||
void create();
|
||||
void destroy();
|
||||
bool isValid() const;
|
||||
void setFormat(const QSurfaceFormat &format);
|
||||
virtual QSurfaceFormat format() const;
|
||||
QSurfaceFormat requestedFormat() const;
|
||||
virtual QSize size() const;
|
||||
QScreen *screen() const;
|
||||
void setScreen(QScreen *screen);
|
||||
|
||||
signals:
|
||||
void screenChanged(QScreen *screen);
|
||||
|
||||
public:
|
||||
%If (Qt_5_9_0 -)
|
||||
void *nativeHandle() const;
|
||||
%End
|
||||
%If (Qt_5_9_0 -)
|
||||
void setNativeHandle(void *handle);
|
||||
%End
|
||||
};
|
||||
|
||||
%End
|
||||
@@ -0,0 +1,108 @@
|
||||
// qopenglbuffer.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (PyQt_OpenGL)
|
||||
|
||||
class QOpenGLBuffer
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qopenglbuffer.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum Type
|
||||
{
|
||||
VertexBuffer,
|
||||
IndexBuffer,
|
||||
PixelPackBuffer,
|
||||
PixelUnpackBuffer,
|
||||
};
|
||||
|
||||
QOpenGLBuffer();
|
||||
explicit QOpenGLBuffer(QOpenGLBuffer::Type type);
|
||||
QOpenGLBuffer(const QOpenGLBuffer &other);
|
||||
~QOpenGLBuffer();
|
||||
|
||||
enum UsagePattern
|
||||
{
|
||||
StreamDraw,
|
||||
StreamRead,
|
||||
StreamCopy,
|
||||
StaticDraw,
|
||||
StaticRead,
|
||||
StaticCopy,
|
||||
DynamicDraw,
|
||||
DynamicRead,
|
||||
DynamicCopy,
|
||||
};
|
||||
|
||||
enum Access
|
||||
{
|
||||
ReadOnly,
|
||||
WriteOnly,
|
||||
ReadWrite,
|
||||
};
|
||||
|
||||
QOpenGLBuffer::Type type() const;
|
||||
QOpenGLBuffer::UsagePattern usagePattern() const;
|
||||
void setUsagePattern(QOpenGLBuffer::UsagePattern value);
|
||||
bool create();
|
||||
bool isCreated() const;
|
||||
void destroy();
|
||||
bool bind();
|
||||
void release();
|
||||
static void release(QOpenGLBuffer::Type type);
|
||||
GLuint bufferId() const;
|
||||
int size() const /__len__/;
|
||||
bool read(int offset, void *data, int count);
|
||||
void write(int offset, const void *data, int count);
|
||||
void allocate(const void *data, int count);
|
||||
void allocate(int count);
|
||||
void *map(QOpenGLBuffer::Access access);
|
||||
bool unmap();
|
||||
%If (Qt_5_4_0 -)
|
||||
|
||||
enum RangeAccessFlag
|
||||
{
|
||||
RangeRead,
|
||||
RangeWrite,
|
||||
RangeInvalidate,
|
||||
RangeInvalidateBuffer,
|
||||
RangeFlushExplicit,
|
||||
RangeUnsynchronized,
|
||||
};
|
||||
|
||||
%End
|
||||
%If (Qt_5_4_0 -)
|
||||
typedef QFlags<QOpenGLBuffer::RangeAccessFlag> RangeAccessFlags;
|
||||
%End
|
||||
%If (Qt_5_4_0 -)
|
||||
void *mapRange(int offset, int count, QOpenGLBuffer::RangeAccessFlags access);
|
||||
%End
|
||||
};
|
||||
|
||||
%End
|
||||
%If (Qt_5_4_0 -)
|
||||
%If (PyQt_OpenGL)
|
||||
QFlags<QOpenGLBuffer::RangeAccessFlag> operator|(QOpenGLBuffer::RangeAccessFlag f1, QFlags<QOpenGLBuffer::RangeAccessFlag> f2);
|
||||
%End
|
||||
%End
|
||||
@@ -0,0 +1,150 @@
|
||||
// qopenglcontext.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (PyQt_OpenGL)
|
||||
|
||||
class QOpenGLContextGroup : public QObject
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qopenglcontext.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
virtual ~QOpenGLContextGroup();
|
||||
QList<QOpenGLContext *> shares() const;
|
||||
static QOpenGLContextGroup *currentContextGroup();
|
||||
|
||||
private:
|
||||
QOpenGLContextGroup();
|
||||
};
|
||||
|
||||
%End
|
||||
%If (PyQt_OpenGL)
|
||||
|
||||
class QOpenGLContext : public QObject
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qopenglcontext.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
explicit QOpenGLContext(QObject *parent /TransferThis/ = 0);
|
||||
virtual ~QOpenGLContext();
|
||||
void setFormat(const QSurfaceFormat &format);
|
||||
void setShareContext(QOpenGLContext *shareContext);
|
||||
void setScreen(QScreen *screen);
|
||||
bool create();
|
||||
bool isValid() const;
|
||||
QSurfaceFormat format() const;
|
||||
QOpenGLContext *shareContext() const;
|
||||
QOpenGLContextGroup *shareGroup() const;
|
||||
QScreen *screen() const;
|
||||
GLuint defaultFramebufferObject() const;
|
||||
bool makeCurrent(QSurface *surface);
|
||||
void doneCurrent();
|
||||
void swapBuffers(QSurface *surface);
|
||||
QFunctionPointer getProcAddress(const QByteArray &procName) const;
|
||||
QSurface *surface() const;
|
||||
static QOpenGLContext *currentContext();
|
||||
static bool areSharing(QOpenGLContext *first, QOpenGLContext *second);
|
||||
QSet<QByteArray> extensions() const;
|
||||
bool hasExtension(const QByteArray &extension) const;
|
||||
|
||||
signals:
|
||||
void aboutToBeDestroyed();
|
||||
|
||||
public:
|
||||
%If (Qt_5_1_0 -)
|
||||
SIP_PYOBJECT versionFunctions(const QOpenGLVersionProfile *versionProfile = 0) const;
|
||||
%MethodCode
|
||||
sipRes = qpyopengl_version_functions(sipCpp, sipSelf, a0);
|
||||
%End
|
||||
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
static void *openGLModuleHandle();
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
|
||||
enum OpenGLModuleType
|
||||
{
|
||||
LibGL,
|
||||
LibGLES,
|
||||
};
|
||||
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
static QOpenGLContext::OpenGLModuleType openGLModuleType();
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
bool isOpenGLES() const;
|
||||
%End
|
||||
%If (Qt_5_4_0 -)
|
||||
void setNativeHandle(const QVariant &handle);
|
||||
%End
|
||||
%If (Qt_5_4_0 -)
|
||||
QVariant nativeHandle() const;
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
static bool supportsThreadedOpenGL();
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
static QOpenGLContext *globalShareContext();
|
||||
%End
|
||||
};
|
||||
|
||||
%End
|
||||
%If (Qt_5_1_0 -)
|
||||
%If (PyQt_OpenGL)
|
||||
|
||||
class QOpenGLVersionProfile
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qopenglcontext.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QOpenGLVersionProfile();
|
||||
explicit QOpenGLVersionProfile(const QSurfaceFormat &format);
|
||||
QOpenGLVersionProfile(const QOpenGLVersionProfile &other);
|
||||
~QOpenGLVersionProfile();
|
||||
QPair<int, int> version() const;
|
||||
void setVersion(int majorVersion, int minorVersion);
|
||||
QSurfaceFormat::OpenGLContextProfile profile() const;
|
||||
void setProfile(QSurfaceFormat::OpenGLContextProfile profile);
|
||||
bool hasProfiles() const;
|
||||
bool isLegacyVersion() const;
|
||||
bool isValid() const;
|
||||
};
|
||||
|
||||
%End
|
||||
%End
|
||||
%If (Qt_5_1_0 -)
|
||||
%If (PyQt_OpenGL)
|
||||
bool operator==(const QOpenGLVersionProfile &lhs, const QOpenGLVersionProfile &rhs);
|
||||
%End
|
||||
%End
|
||||
%If (Qt_5_1_0 -)
|
||||
%If (PyQt_OpenGL)
|
||||
bool operator!=(const QOpenGLVersionProfile &lhs, const QOpenGLVersionProfile &rhs);
|
||||
%End
|
||||
%End
|
||||
@@ -0,0 +1,150 @@
|
||||
// qopengldebug.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (Qt_5_1_0 -)
|
||||
%If (PyQt_OpenGL)
|
||||
|
||||
class QOpenGLDebugMessage
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qopengldebug.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum Source
|
||||
{
|
||||
InvalidSource,
|
||||
APISource,
|
||||
WindowSystemSource,
|
||||
ShaderCompilerSource,
|
||||
ThirdPartySource,
|
||||
ApplicationSource,
|
||||
OtherSource,
|
||||
AnySource,
|
||||
};
|
||||
|
||||
typedef QFlags<QOpenGLDebugMessage::Source> Sources;
|
||||
|
||||
enum Type
|
||||
{
|
||||
InvalidType,
|
||||
ErrorType,
|
||||
DeprecatedBehaviorType,
|
||||
UndefinedBehaviorType,
|
||||
PortabilityType,
|
||||
PerformanceType,
|
||||
OtherType,
|
||||
MarkerType,
|
||||
GroupPushType,
|
||||
GroupPopType,
|
||||
AnyType,
|
||||
};
|
||||
|
||||
typedef QFlags<QOpenGLDebugMessage::Type> Types;
|
||||
|
||||
enum Severity
|
||||
{
|
||||
InvalidSeverity,
|
||||
HighSeverity,
|
||||
MediumSeverity,
|
||||
LowSeverity,
|
||||
NotificationSeverity,
|
||||
AnySeverity,
|
||||
};
|
||||
|
||||
typedef QFlags<QOpenGLDebugMessage::Severity> Severities;
|
||||
QOpenGLDebugMessage();
|
||||
QOpenGLDebugMessage(const QOpenGLDebugMessage &debugMessage);
|
||||
~QOpenGLDebugMessage();
|
||||
void swap(QOpenGLDebugMessage &debugMessage /Constrained/);
|
||||
QOpenGLDebugMessage::Source source() const;
|
||||
QOpenGLDebugMessage::Type type() const;
|
||||
QOpenGLDebugMessage::Severity severity() const;
|
||||
GLuint id() const;
|
||||
QString message() const;
|
||||
static QOpenGLDebugMessage createApplicationMessage(const QString &text, GLuint id = 0, QOpenGLDebugMessage::Severity severity = QOpenGLDebugMessage::NotificationSeverity, QOpenGLDebugMessage::Type type = QOpenGLDebugMessage::OtherType);
|
||||
static QOpenGLDebugMessage createThirdPartyMessage(const QString &text, GLuint id = 0, QOpenGLDebugMessage::Severity severity = QOpenGLDebugMessage::NotificationSeverity, QOpenGLDebugMessage::Type type = QOpenGLDebugMessage::OtherType);
|
||||
bool operator==(const QOpenGLDebugMessage &debugMessage) const;
|
||||
bool operator!=(const QOpenGLDebugMessage &debugMessage) const;
|
||||
};
|
||||
|
||||
%End
|
||||
%End
|
||||
%If (Qt_5_1_0 -)
|
||||
%If (PyQt_OpenGL)
|
||||
QFlags<QOpenGLDebugMessage::Source> operator|(QOpenGLDebugMessage::Source f1, QFlags<QOpenGLDebugMessage::Source> f2);
|
||||
%End
|
||||
%End
|
||||
%If (Qt_5_1_0 -)
|
||||
%If (PyQt_OpenGL)
|
||||
QFlags<QOpenGLDebugMessage::Type> operator|(QOpenGLDebugMessage::Type f1, QFlags<QOpenGLDebugMessage::Type> f2);
|
||||
%End
|
||||
%End
|
||||
%If (Qt_5_1_0 -)
|
||||
%If (PyQt_OpenGL)
|
||||
QFlags<QOpenGLDebugMessage::Severity> operator|(QOpenGLDebugMessage::Severity f1, QFlags<QOpenGLDebugMessage::Severity> f2);
|
||||
%End
|
||||
%End
|
||||
%If (Qt_5_1_0 -)
|
||||
%If (PyQt_OpenGL)
|
||||
|
||||
class QOpenGLDebugLogger : public QObject
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qopengldebug.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum LoggingMode
|
||||
{
|
||||
AsynchronousLogging,
|
||||
SynchronousLogging,
|
||||
};
|
||||
|
||||
explicit QOpenGLDebugLogger(QObject *parent /TransferThis/ = 0);
|
||||
virtual ~QOpenGLDebugLogger();
|
||||
bool initialize();
|
||||
bool isLogging() const;
|
||||
QOpenGLDebugLogger::LoggingMode loggingMode() const;
|
||||
qint64 maximumMessageLength() const;
|
||||
void pushGroup(const QString &name, GLuint id = 0, QOpenGLDebugMessage::Source source = QOpenGLDebugMessage::ApplicationSource);
|
||||
void popGroup();
|
||||
void enableMessages(QOpenGLDebugMessage::Sources sources = QOpenGLDebugMessage::AnySource, QOpenGLDebugMessage::Types types = QOpenGLDebugMessage::AnyType, QOpenGLDebugMessage::Severities severities = QOpenGLDebugMessage::Severity::AnySeverity);
|
||||
void enableMessages(const QVector<unsigned int> &ids, QOpenGLDebugMessage::Sources sources = QOpenGLDebugMessage::AnySource, QOpenGLDebugMessage::Types types = QOpenGLDebugMessage::AnyType);
|
||||
void disableMessages(QOpenGLDebugMessage::Sources sources = QOpenGLDebugMessage::AnySource, QOpenGLDebugMessage::Types types = QOpenGLDebugMessage::AnyType, QOpenGLDebugMessage::Severities severities = QOpenGLDebugMessage::Severity::AnySeverity);
|
||||
void disableMessages(const QVector<unsigned int> &ids, QOpenGLDebugMessage::Sources sources = QOpenGLDebugMessage::AnySource, QOpenGLDebugMessage::Types types = QOpenGLDebugMessage::AnyType);
|
||||
QList<QOpenGLDebugMessage> loggedMessages() const;
|
||||
|
||||
public slots:
|
||||
void logMessage(const QOpenGLDebugMessage &debugMessage);
|
||||
void startLogging(QOpenGLDebugLogger::LoggingMode loggingMode = QOpenGLDebugLogger::AsynchronousLogging);
|
||||
void stopLogging();
|
||||
|
||||
signals:
|
||||
void messageLogged(const QOpenGLDebugMessage &debugMessage);
|
||||
|
||||
private:
|
||||
QOpenGLDebugLogger(const QOpenGLDebugLogger &);
|
||||
};
|
||||
|
||||
%End
|
||||
%End
|
||||
@@ -0,0 +1,145 @@
|
||||
// qopenglframebufferobject.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (PyQt_OpenGL)
|
||||
|
||||
class QOpenGLFramebufferObject
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qopenglframebufferobject.h>
|
||||
%End
|
||||
|
||||
%TypeCode
|
||||
// The defaults are different for desktop OpenGL and OpenGL/ES so pretend the
|
||||
// latter is the former.
|
||||
#if defined(QT_OPENGL_ES)
|
||||
#undef GL_RGBA8
|
||||
#define GL_RGBA8 GL_RGBA
|
||||
#endif
|
||||
%End
|
||||
|
||||
public:
|
||||
enum Attachment
|
||||
{
|
||||
NoAttachment,
|
||||
CombinedDepthStencil,
|
||||
Depth,
|
||||
};
|
||||
|
||||
QOpenGLFramebufferObject(const QSize &size, GLenum target = GL_TEXTURE_2D);
|
||||
QOpenGLFramebufferObject(int width, int height, GLenum target = GL_TEXTURE_2D);
|
||||
QOpenGLFramebufferObject(const QSize &size, QOpenGLFramebufferObject::Attachment attachment, GLenum target = GL_TEXTURE_2D, GLenum internal_format = GL_RGBA8);
|
||||
QOpenGLFramebufferObject(int width, int height, QOpenGLFramebufferObject::Attachment attachment, GLenum target = GL_TEXTURE_2D, GLenum internal_format = GL_RGBA8);
|
||||
QOpenGLFramebufferObject(const QSize &size, const QOpenGLFramebufferObjectFormat &format);
|
||||
QOpenGLFramebufferObject(int width, int height, const QOpenGLFramebufferObjectFormat &format);
|
||||
virtual ~QOpenGLFramebufferObject();
|
||||
QOpenGLFramebufferObjectFormat format() const;
|
||||
bool isValid() const;
|
||||
bool isBound() const;
|
||||
bool bind();
|
||||
bool release();
|
||||
int width() const;
|
||||
int height() const;
|
||||
GLuint texture() const;
|
||||
%If (Qt_5_6_0 -)
|
||||
QVector<unsigned int> textures() const;
|
||||
%End
|
||||
QSize size() const;
|
||||
QImage toImage() const;
|
||||
%If (Qt_5_4_0 -)
|
||||
QImage toImage(bool flipped) const;
|
||||
%End
|
||||
%If (Qt_5_6_0 -)
|
||||
QImage toImage(bool flipped, int colorAttachmentIndex) const;
|
||||
%End
|
||||
QOpenGLFramebufferObject::Attachment attachment() const;
|
||||
void setAttachment(QOpenGLFramebufferObject::Attachment attachment);
|
||||
GLuint handle() const;
|
||||
static bool bindDefault();
|
||||
static bool hasOpenGLFramebufferObjects();
|
||||
static bool hasOpenGLFramebufferBlit();
|
||||
%If (Qt_5_7_0 -)
|
||||
|
||||
enum FramebufferRestorePolicy
|
||||
{
|
||||
DontRestoreFramebufferBinding,
|
||||
RestoreFramebufferBindingToDefault,
|
||||
RestoreFrameBufferBinding,
|
||||
};
|
||||
|
||||
%End
|
||||
static void blitFramebuffer(QOpenGLFramebufferObject *target, const QRect &targetRect, QOpenGLFramebufferObject *source, const QRect &sourceRect, GLbitfield buffers = GL_COLOR_BUFFER_BIT, GLenum filter = GL_NEAREST);
|
||||
static void blitFramebuffer(QOpenGLFramebufferObject *target, QOpenGLFramebufferObject *source, GLbitfield buffers = GL_COLOR_BUFFER_BIT, GLenum filter = GL_NEAREST);
|
||||
%If (Qt_5_6_0 -)
|
||||
static void blitFramebuffer(QOpenGLFramebufferObject *target, const QRect &targetRect, QOpenGLFramebufferObject *source, const QRect &sourceRect, GLbitfield buffers, GLenum filter, int readColorAttachmentIndex, int drawColorAttachmentIndex);
|
||||
%End
|
||||
%If (Qt_5_7_0 -)
|
||||
static void blitFramebuffer(QOpenGLFramebufferObject *target, const QRect &targetRect, QOpenGLFramebufferObject *source, const QRect &sourceRect, GLbitfield buffers, GLenum filter, int readColorAttachmentIndex, int drawColorAttachmentIndex, QOpenGLFramebufferObject::FramebufferRestorePolicy restorePolicy);
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
GLuint takeTexture();
|
||||
%End
|
||||
%If (Qt_5_6_0 -)
|
||||
GLuint takeTexture(int colorAttachmentIndex);
|
||||
%End
|
||||
%If (Qt_5_6_0 -)
|
||||
void addColorAttachment(const QSize &size, GLenum internal_format = 0);
|
||||
%End
|
||||
%If (Qt_5_6_0 -)
|
||||
void addColorAttachment(int width, int height, GLenum internal_format = 0);
|
||||
%End
|
||||
%If (Qt_5_6_0 -)
|
||||
QVector<QSize> sizes() const;
|
||||
%End
|
||||
|
||||
private:
|
||||
QOpenGLFramebufferObject(const QOpenGLFramebufferObject &);
|
||||
};
|
||||
|
||||
%End
|
||||
%If (PyQt_OpenGL)
|
||||
|
||||
class QOpenGLFramebufferObjectFormat
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qopenglframebufferobject.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QOpenGLFramebufferObjectFormat();
|
||||
QOpenGLFramebufferObjectFormat(const QOpenGLFramebufferObjectFormat &other);
|
||||
~QOpenGLFramebufferObjectFormat();
|
||||
void setSamples(int samples);
|
||||
int samples() const;
|
||||
void setMipmap(bool enabled);
|
||||
bool mipmap() const;
|
||||
void setAttachment(QOpenGLFramebufferObject::Attachment attachment);
|
||||
QOpenGLFramebufferObject::Attachment attachment() const;
|
||||
void setTextureTarget(GLenum target);
|
||||
GLenum textureTarget() const;
|
||||
void setInternalTextureFormat(GLenum internalTextureFormat);
|
||||
GLenum internalTextureFormat() const;
|
||||
bool operator==(const QOpenGLFramebufferObjectFormat &other) const;
|
||||
bool operator!=(const QOpenGLFramebufferObjectFormat &other) const;
|
||||
};
|
||||
|
||||
%End
|
||||
@@ -0,0 +1,60 @@
|
||||
// qopenglpaintdevice.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (PyQt_OpenGL)
|
||||
|
||||
class QOpenGLPaintDevice : public QPaintDevice
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qopenglpaintdevice.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QOpenGLPaintDevice();
|
||||
explicit QOpenGLPaintDevice(const QSize &size);
|
||||
QOpenGLPaintDevice(int width, int height);
|
||||
virtual ~QOpenGLPaintDevice();
|
||||
virtual QPaintEngine *paintEngine() const;
|
||||
QOpenGLContext *context() const;
|
||||
QSize size() const;
|
||||
void setSize(const QSize &size);
|
||||
qreal dotsPerMeterX() const;
|
||||
qreal dotsPerMeterY() const;
|
||||
void setDotsPerMeterX(qreal);
|
||||
void setDotsPerMeterY(qreal);
|
||||
void setPaintFlipped(bool flipped);
|
||||
bool paintFlipped() const;
|
||||
virtual void ensureActiveTarget();
|
||||
%If (Qt_5_1_0 -)
|
||||
void setDevicePixelRatio(qreal devicePixelRatio);
|
||||
%End
|
||||
|
||||
protected:
|
||||
virtual int metric(QPaintDevice::PaintDeviceMetric metric) const;
|
||||
|
||||
private:
|
||||
%If (- Qt_5_1_0)
|
||||
QOpenGLPaintDevice(const QOpenGLPaintDevice &);
|
||||
%End
|
||||
};
|
||||
|
||||
%End
|
||||
@@ -0,0 +1,56 @@
|
||||
// qopenglpixeltransferoptions.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (Qt_5_2_0 -)
|
||||
%If (PyQt_OpenGL)
|
||||
|
||||
class QOpenGLPixelTransferOptions
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qopenglpixeltransferoptions.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QOpenGLPixelTransferOptions();
|
||||
QOpenGLPixelTransferOptions(const QOpenGLPixelTransferOptions &);
|
||||
~QOpenGLPixelTransferOptions();
|
||||
void swap(QOpenGLPixelTransferOptions &other /Constrained/);
|
||||
void setAlignment(int alignment);
|
||||
int alignment() const;
|
||||
void setSkipImages(int skipImages);
|
||||
int skipImages() const;
|
||||
void setSkipRows(int skipRows);
|
||||
int skipRows() const;
|
||||
void setSkipPixels(int skipPixels);
|
||||
int skipPixels() const;
|
||||
void setImageHeight(int imageHeight);
|
||||
int imageHeight() const;
|
||||
void setRowLength(int rowLength);
|
||||
int rowLength() const;
|
||||
void setLeastSignificantByteFirst(bool lsbFirst);
|
||||
bool isLeastSignificantBitFirst() const;
|
||||
void setSwapBytesEnabled(bool swapBytes);
|
||||
bool isSwapBytesEnabled() const;
|
||||
};
|
||||
|
||||
%End
|
||||
%End
|
||||
@@ -0,0 +1,364 @@
|
||||
// qopenglshaderprogram.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (PyQt_OpenGL)
|
||||
|
||||
class QOpenGLShader : public QObject
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qopenglshaderprogram.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum ShaderTypeBit
|
||||
{
|
||||
Vertex,
|
||||
Fragment,
|
||||
%If (Qt_5_1_0 -)
|
||||
Geometry,
|
||||
%End
|
||||
%If (Qt_5_1_0 -)
|
||||
TessellationControl,
|
||||
%End
|
||||
%If (Qt_5_1_0 -)
|
||||
TessellationEvaluation,
|
||||
%End
|
||||
%If (Qt_5_1_0 -)
|
||||
Compute,
|
||||
%End
|
||||
};
|
||||
|
||||
typedef QFlags<QOpenGLShader::ShaderTypeBit> ShaderType;
|
||||
QOpenGLShader(QOpenGLShader::ShaderType type, QObject *parent /TransferThis/ = 0);
|
||||
virtual ~QOpenGLShader();
|
||||
QOpenGLShader::ShaderType shaderType() const;
|
||||
bool compileSourceCode(const QByteArray &source);
|
||||
bool compileSourceCode(const QString &source);
|
||||
bool compileSourceFile(const QString &fileName);
|
||||
QByteArray sourceCode() const;
|
||||
bool isCompiled() const;
|
||||
QString log() const;
|
||||
GLuint shaderId() const;
|
||||
static bool hasOpenGLShaders(QOpenGLShader::ShaderType type, QOpenGLContext *context = 0);
|
||||
};
|
||||
|
||||
%End
|
||||
%If (PyQt_OpenGL)
|
||||
QFlags<QOpenGLShader::ShaderTypeBit> operator|(QOpenGLShader::ShaderTypeBit f1, QFlags<QOpenGLShader::ShaderTypeBit> f2);
|
||||
%End
|
||||
%If (PyQt_OpenGL)
|
||||
|
||||
class QOpenGLShaderProgram : public QObject
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qopenglshaderprogram.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
explicit QOpenGLShaderProgram(QObject *parent /TransferThis/ = 0);
|
||||
virtual ~QOpenGLShaderProgram();
|
||||
bool addShader(QOpenGLShader *shader);
|
||||
void removeShader(QOpenGLShader *shader);
|
||||
QList<QOpenGLShader *> shaders() const;
|
||||
bool addShaderFromSourceCode(QOpenGLShader::ShaderType type, const QByteArray &source);
|
||||
bool addShaderFromSourceCode(QOpenGLShader::ShaderType type, const QString &source);
|
||||
bool addShaderFromSourceFile(QOpenGLShader::ShaderType type, const QString &fileName);
|
||||
void removeAllShaders();
|
||||
virtual bool link();
|
||||
bool isLinked() const;
|
||||
QString log() const;
|
||||
bool bind();
|
||||
void release();
|
||||
GLuint programId() const;
|
||||
void bindAttributeLocation(const QByteArray &name, int location);
|
||||
void bindAttributeLocation(const QString &name, int location);
|
||||
int attributeLocation(const QByteArray &name) const;
|
||||
int attributeLocation(const QString &name) const;
|
||||
void setAttributeValue(int location, GLfloat value);
|
||||
void setAttributeValue(int location, GLfloat x, GLfloat y);
|
||||
void setAttributeValue(int location, GLfloat x, GLfloat y, GLfloat z);
|
||||
void setAttributeValue(int location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
|
||||
void setAttributeValue(int location, const QVector2D &value);
|
||||
void setAttributeValue(int location, const QVector3D &value);
|
||||
void setAttributeValue(int location, const QVector4D &value);
|
||||
void setAttributeValue(int location, const QColor &value);
|
||||
void setAttributeValue(const char *name, GLfloat value);
|
||||
void setAttributeValue(const char *name, GLfloat x, GLfloat y);
|
||||
void setAttributeValue(const char *name, GLfloat x, GLfloat y, GLfloat z);
|
||||
void setAttributeValue(const char *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
|
||||
void setAttributeValue(const char *name, const QVector2D &value);
|
||||
void setAttributeValue(const char *name, const QVector3D &value);
|
||||
void setAttributeValue(const char *name, const QVector4D &value);
|
||||
void setAttributeValue(const char *name, const QColor &value);
|
||||
void setAttributeArray(int location, SIP_PYOBJECT values /TypeHint="PYQT_SHADER_ATTRIBUTE_ARRAY"/);
|
||||
%MethodCode
|
||||
const GLfloat *values;
|
||||
int tsize;
|
||||
|
||||
values = qpyopengl_attribute_array(a1, sipSelf, SIPLong_FromLong(a0), &tsize,
|
||||
&sipError);
|
||||
|
||||
if (values)
|
||||
sipCpp->setAttributeArray(a0, values, tsize);
|
||||
%End
|
||||
|
||||
void setAttributeArray(const char *name, SIP_PYOBJECT values /TypeHint="PYQT_SHADER_ATTRIBUTE_ARRAY"/);
|
||||
%MethodCode
|
||||
const GLfloat *values;
|
||||
int tsize;
|
||||
|
||||
values = qpyopengl_attribute_array(a1, sipSelf, SIPBytes_FromString(a0),
|
||||
&tsize, &sipError);
|
||||
|
||||
if (values)
|
||||
sipCpp->setAttributeArray(a0, values, tsize);
|
||||
%End
|
||||
|
||||
void setAttributeBuffer(int location, GLenum type, int offset, int tupleSize, int stride = 0);
|
||||
void setAttributeBuffer(const char *name, GLenum type, int offset, int tupleSize, int stride = 0);
|
||||
void enableAttributeArray(int location);
|
||||
void enableAttributeArray(const char *name);
|
||||
void disableAttributeArray(int location);
|
||||
void disableAttributeArray(const char *name);
|
||||
int uniformLocation(const QByteArray &name) const;
|
||||
int uniformLocation(const QString &name) const;
|
||||
void setUniformValue(int location, GLint value /Constrained/);
|
||||
void setUniformValue(int location, GLfloat value /Constrained/);
|
||||
void setUniformValue(int location, GLfloat x, GLfloat y);
|
||||
void setUniformValue(int location, GLfloat x, GLfloat y, GLfloat z);
|
||||
void setUniformValue(int location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
|
||||
void setUniformValue(int location, const QVector2D &value);
|
||||
void setUniformValue(int location, const QVector3D &value);
|
||||
void setUniformValue(int location, const QVector4D &value);
|
||||
void setUniformValue(int location, const QColor &color);
|
||||
void setUniformValue(int location, const QPoint &point);
|
||||
void setUniformValue(int location, const QPointF &point);
|
||||
void setUniformValue(int location, const QSize &size);
|
||||
void setUniformValue(int location, const QSizeF &size);
|
||||
void setUniformValue(int location, const QMatrix2x2 &value);
|
||||
void setUniformValue(int location, const QMatrix2x3 &value);
|
||||
void setUniformValue(int location, const QMatrix2x4 &value);
|
||||
void setUniformValue(int location, const QMatrix3x2 &value);
|
||||
void setUniformValue(int location, const QMatrix3x3 &value);
|
||||
void setUniformValue(int location, const QMatrix3x4 &value);
|
||||
void setUniformValue(int location, const QMatrix4x2 &value);
|
||||
void setUniformValue(int location, const QMatrix4x3 &value);
|
||||
void setUniformValue(int location, const QMatrix4x4 &value);
|
||||
void setUniformValue(int location, const QTransform &value);
|
||||
void setUniformValue(const char *name, GLint value /Constrained/);
|
||||
void setUniformValue(const char *name, GLfloat value /Constrained/);
|
||||
void setUniformValue(const char *name, GLfloat x, GLfloat y);
|
||||
void setUniformValue(const char *name, GLfloat x, GLfloat y, GLfloat z);
|
||||
void setUniformValue(const char *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
|
||||
void setUniformValue(const char *name, const QVector2D &value);
|
||||
void setUniformValue(const char *name, const QVector3D &value);
|
||||
void setUniformValue(const char *name, const QVector4D &value);
|
||||
void setUniformValue(const char *name, const QColor &color);
|
||||
void setUniformValue(const char *name, const QPoint &point);
|
||||
void setUniformValue(const char *name, const QPointF &point);
|
||||
void setUniformValue(const char *name, const QSize &size);
|
||||
void setUniformValue(const char *name, const QSizeF &size);
|
||||
void setUniformValue(const char *name, const QMatrix2x2 &value);
|
||||
void setUniformValue(const char *name, const QMatrix2x3 &value);
|
||||
void setUniformValue(const char *name, const QMatrix2x4 &value);
|
||||
void setUniformValue(const char *name, const QMatrix3x2 &value);
|
||||
void setUniformValue(const char *name, const QMatrix3x3 &value);
|
||||
void setUniformValue(const char *name, const QMatrix3x4 &value);
|
||||
void setUniformValue(const char *name, const QMatrix4x2 &value);
|
||||
void setUniformValue(const char *name, const QMatrix4x3 &value);
|
||||
void setUniformValue(const char *name, const QMatrix4x4 &value);
|
||||
void setUniformValue(const char *name, const QTransform &value);
|
||||
void setUniformValueArray(int location, SIP_PYOBJECT values /TypeHint="PYQT_SHADER_UNIFORM_VALUE_ARRAY"/);
|
||||
%MethodCode
|
||||
const void *values;
|
||||
const sipTypeDef *array_type;
|
||||
int array_len, tsize;
|
||||
|
||||
values = qpyopengl_uniform_value_array(a1, sipSelf, SIPLong_FromLong(a0),
|
||||
&array_type, &array_len, &tsize, &sipError);
|
||||
|
||||
if (values)
|
||||
{
|
||||
if (array_type == sipType_QVector2D)
|
||||
sipCpp->setUniformValueArray(a0,
|
||||
reinterpret_cast<const QVector2D *>(values), array_len);
|
||||
else if (array_type == sipType_QVector3D)
|
||||
sipCpp->setUniformValueArray(a0,
|
||||
reinterpret_cast<const QVector3D *>(values), array_len);
|
||||
else if (array_type == sipType_QVector4D)
|
||||
sipCpp->setUniformValueArray(a0,
|
||||
reinterpret_cast<const QVector4D *>(values), array_len);
|
||||
else if (array_type == sipType_QMatrix2x2)
|
||||
sipCpp->setUniformValueArray(a0,
|
||||
reinterpret_cast<const QMatrix2x2 *>(values), array_len);
|
||||
else if (array_type == sipType_QMatrix2x3)
|
||||
sipCpp->setUniformValueArray(a0,
|
||||
reinterpret_cast<const QMatrix2x3 *>(values), array_len);
|
||||
else if (array_type == sipType_QMatrix2x4)
|
||||
sipCpp->setUniformValueArray(a0,
|
||||
reinterpret_cast<const QMatrix2x4 *>(values), array_len);
|
||||
else if (array_type == sipType_QMatrix3x2)
|
||||
sipCpp->setUniformValueArray(a0,
|
||||
reinterpret_cast<const QMatrix3x2 *>(values), array_len);
|
||||
else if (array_type == sipType_QMatrix3x3)
|
||||
sipCpp->setUniformValueArray(a0,
|
||||
reinterpret_cast<const QMatrix3x3 *>(values), array_len);
|
||||
else if (array_type == sipType_QMatrix3x4)
|
||||
sipCpp->setUniformValueArray(a0,
|
||||
reinterpret_cast<const QMatrix3x4 *>(values), array_len);
|
||||
else if (array_type == sipType_QMatrix4x2)
|
||||
sipCpp->setUniformValueArray(a0,
|
||||
reinterpret_cast<const QMatrix4x2 *>(values), array_len);
|
||||
else if (array_type == sipType_QMatrix4x3)
|
||||
sipCpp->setUniformValueArray(a0,
|
||||
reinterpret_cast<const QMatrix4x3 *>(values), array_len);
|
||||
else if (array_type == sipType_QMatrix4x4)
|
||||
sipCpp->setUniformValueArray(a0,
|
||||
reinterpret_cast<const QMatrix4x4 *>(values), array_len);
|
||||
else
|
||||
sipCpp->setUniformValueArray(a0,
|
||||
reinterpret_cast<const GLfloat *>(values), array_len, tsize);
|
||||
}
|
||||
%End
|
||||
|
||||
void setUniformValueArray(const char *name, SIP_PYOBJECT values /TypeHint="PYQT_SHADER_UNIFORM_VALUE_ARRAY"/);
|
||||
%MethodCode
|
||||
const void *values;
|
||||
const sipTypeDef *array_type;
|
||||
int array_len, tsize;
|
||||
|
||||
values = qpyopengl_uniform_value_array(a1, sipSelf, SIPBytes_FromString(a0),
|
||||
&array_type, &array_len, &tsize, &sipError);
|
||||
|
||||
if (values)
|
||||
{
|
||||
if (array_type == sipType_QVector2D)
|
||||
sipCpp->setUniformValueArray(a0,
|
||||
reinterpret_cast<const QVector2D *>(values), array_len);
|
||||
else if (array_type == sipType_QVector3D)
|
||||
sipCpp->setUniformValueArray(a0,
|
||||
reinterpret_cast<const QVector3D *>(values), array_len);
|
||||
else if (array_type == sipType_QVector4D)
|
||||
sipCpp->setUniformValueArray(a0,
|
||||
reinterpret_cast<const QVector4D *>(values), array_len);
|
||||
else if (array_type == sipType_QMatrix2x2)
|
||||
sipCpp->setUniformValueArray(a0,
|
||||
reinterpret_cast<const QMatrix2x2 *>(values), array_len);
|
||||
else if (array_type == sipType_QMatrix2x3)
|
||||
sipCpp->setUniformValueArray(a0,
|
||||
reinterpret_cast<const QMatrix2x3 *>(values), array_len);
|
||||
else if (array_type == sipType_QMatrix2x4)
|
||||
sipCpp->setUniformValueArray(a0,
|
||||
reinterpret_cast<const QMatrix2x4 *>(values), array_len);
|
||||
else if (array_type == sipType_QMatrix3x2)
|
||||
sipCpp->setUniformValueArray(a0,
|
||||
reinterpret_cast<const QMatrix3x2 *>(values), array_len);
|
||||
else if (array_type == sipType_QMatrix3x3)
|
||||
sipCpp->setUniformValueArray(a0,
|
||||
reinterpret_cast<const QMatrix3x3 *>(values), array_len);
|
||||
else if (array_type == sipType_QMatrix3x4)
|
||||
sipCpp->setUniformValueArray(a0,
|
||||
reinterpret_cast<const QMatrix3x4 *>(values), array_len);
|
||||
else if (array_type == sipType_QMatrix4x2)
|
||||
sipCpp->setUniformValueArray(a0,
|
||||
reinterpret_cast<const QMatrix4x2 *>(values), array_len);
|
||||
else if (array_type == sipType_QMatrix4x3)
|
||||
sipCpp->setUniformValueArray(a0,
|
||||
reinterpret_cast<const QMatrix4x3 *>(values), array_len);
|
||||
else if (array_type == sipType_QMatrix4x4)
|
||||
sipCpp->setUniformValueArray(a0,
|
||||
reinterpret_cast<const QMatrix4x4 *>(values), array_len);
|
||||
else
|
||||
sipCpp->setUniformValueArray(a0,
|
||||
reinterpret_cast<const GLfloat *>(values), array_len, tsize);
|
||||
}
|
||||
%End
|
||||
|
||||
static bool hasOpenGLShaderPrograms(QOpenGLContext *context = 0);
|
||||
%If (Qt_5_1_0 -)
|
||||
int maxGeometryOutputVertices() const;
|
||||
%End
|
||||
%If (Qt_5_1_0 -)
|
||||
void setPatchVertexCount(int count);
|
||||
%End
|
||||
%If (Qt_5_1_0 -)
|
||||
int patchVertexCount() const;
|
||||
%End
|
||||
%If (Qt_5_1_0 -)
|
||||
void setDefaultOuterTessellationLevels(const QVector<float> &levels);
|
||||
%End
|
||||
%If (Qt_5_1_0 -)
|
||||
QVector<float> defaultOuterTessellationLevels() const;
|
||||
%End
|
||||
%If (Qt_5_1_0 -)
|
||||
void setDefaultInnerTessellationLevels(const QVector<float> &levels);
|
||||
%End
|
||||
%If (Qt_5_1_0 -)
|
||||
QVector<float> defaultInnerTessellationLevels() const;
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
bool create();
|
||||
%End
|
||||
%If (Qt_5_9_0 -)
|
||||
bool addCacheableShaderFromSourceCode(QOpenGLShader::ShaderType type, const QByteArray &source);
|
||||
%End
|
||||
%If (Qt_5_9_0 -)
|
||||
bool addCacheableShaderFromSourceCode(QOpenGLShader::ShaderType type, const QString &source);
|
||||
%End
|
||||
%If (Qt_5_9_0 -)
|
||||
bool addCacheableShaderFromSourceFile(QOpenGLShader::ShaderType type, const QString &fileName);
|
||||
%End
|
||||
};
|
||||
|
||||
%End
|
||||
|
||||
%ModuleHeaderCode
|
||||
#include "qpyopengl_api.h"
|
||||
%End
|
||||
|
||||
%InitialisationCode
|
||||
#if defined(SIP_FEATURE_PyQt_OpenGL)
|
||||
qpyopengl_init();
|
||||
#endif
|
||||
%End
|
||||
|
||||
%ExportedTypeHintCode
|
||||
# Convenient aliases for complicated OpenGL types.
|
||||
PYQT_OPENGL_ARRAY = typing.Union[typing.Sequence[int], typing.Sequence[float],
|
||||
PyQt5.sip.Buffer, None]
|
||||
PYQT_OPENGL_BOUND_ARRAY = typing.Union[typing.Sequence[int],
|
||||
typing.Sequence[float], PyQt5.sip.Buffer, int, None]
|
||||
%End
|
||||
|
||||
%TypeHintCode
|
||||
# Convenient aliases for complicated OpenGL types.
|
||||
PYQT_SHADER_ATTRIBUTE_ARRAY = typing.Union[typing.Sequence['QVector2D'],
|
||||
typing.Sequence['QVector3D'], typing.Sequence['QVector4D'],
|
||||
typing.Sequence[typing.Sequence[float]]]
|
||||
PYQT_SHADER_UNIFORM_VALUE_ARRAY = typing.Union[typing.Sequence['QVector2D'],
|
||||
typing.Sequence['QVector3D'], typing.Sequence['QVector4D'],
|
||||
typing.Sequence['QMatrix2x2'], typing.Sequence['QMatrix2x3'],
|
||||
typing.Sequence['QMatrix2x4'], typing.Sequence['QMatrix3x2'],
|
||||
typing.Sequence['QMatrix3x3'], typing.Sequence['QMatrix3x4'],
|
||||
typing.Sequence['QMatrix4x2'], typing.Sequence['QMatrix4x3'],
|
||||
typing.Sequence['QMatrix4x4'], typing.Sequence[typing.Sequence[float]]]
|
||||
%End
|
||||
@@ -0,0 +1,644 @@
|
||||
// qopengltexture.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (Qt_5_2_0 -)
|
||||
%If (PyQt_OpenGL)
|
||||
|
||||
class QOpenGLTexture
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qopengltexture.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum Target
|
||||
{
|
||||
Target1D,
|
||||
Target1DArray,
|
||||
Target2D,
|
||||
Target2DArray,
|
||||
Target3D,
|
||||
TargetCubeMap,
|
||||
TargetCubeMapArray,
|
||||
Target2DMultisample,
|
||||
Target2DMultisampleArray,
|
||||
TargetRectangle,
|
||||
TargetBuffer,
|
||||
};
|
||||
|
||||
enum BindingTarget
|
||||
{
|
||||
BindingTarget1D,
|
||||
BindingTarget1DArray,
|
||||
BindingTarget2D,
|
||||
BindingTarget2DArray,
|
||||
BindingTarget3D,
|
||||
BindingTargetCubeMap,
|
||||
BindingTargetCubeMapArray,
|
||||
BindingTarget2DMultisample,
|
||||
BindingTarget2DMultisampleArray,
|
||||
BindingTargetRectangle,
|
||||
BindingTargetBuffer,
|
||||
};
|
||||
|
||||
enum MipMapGeneration
|
||||
{
|
||||
GenerateMipMaps,
|
||||
DontGenerateMipMaps,
|
||||
};
|
||||
|
||||
enum TextureUnitReset
|
||||
{
|
||||
ResetTextureUnit,
|
||||
DontResetTextureUnit,
|
||||
};
|
||||
|
||||
explicit QOpenGLTexture(QOpenGLTexture::Target target);
|
||||
QOpenGLTexture(const QImage &image, QOpenGLTexture::MipMapGeneration genMipMaps = QOpenGLTexture::GenerateMipMaps);
|
||||
~QOpenGLTexture();
|
||||
bool create();
|
||||
void destroy();
|
||||
bool isCreated() const;
|
||||
GLuint textureId() const;
|
||||
void bind();
|
||||
void bind(uint unit, QOpenGLTexture::TextureUnitReset reset = QOpenGLTexture::DontResetTextureUnit);
|
||||
void release();
|
||||
void release(uint unit, QOpenGLTexture::TextureUnitReset reset = QOpenGLTexture::DontResetTextureUnit);
|
||||
bool isBound() const;
|
||||
bool isBound(uint unit);
|
||||
static GLuint boundTextureId(QOpenGLTexture::BindingTarget target);
|
||||
static GLuint boundTextureId(uint unit, QOpenGLTexture::BindingTarget target);
|
||||
|
||||
enum TextureFormat
|
||||
{
|
||||
NoFormat,
|
||||
R8_UNorm,
|
||||
RG8_UNorm,
|
||||
RGB8_UNorm,
|
||||
RGBA8_UNorm,
|
||||
R16_UNorm,
|
||||
RG16_UNorm,
|
||||
RGB16_UNorm,
|
||||
RGBA16_UNorm,
|
||||
R8_SNorm,
|
||||
RG8_SNorm,
|
||||
RGB8_SNorm,
|
||||
RGBA8_SNorm,
|
||||
R16_SNorm,
|
||||
RG16_SNorm,
|
||||
RGB16_SNorm,
|
||||
RGBA16_SNorm,
|
||||
R8U,
|
||||
RG8U,
|
||||
RGB8U,
|
||||
RGBA8U,
|
||||
R16U,
|
||||
RG16U,
|
||||
RGB16U,
|
||||
RGBA16U,
|
||||
R32U,
|
||||
RG32U,
|
||||
RGB32U,
|
||||
RGBA32U,
|
||||
R8I,
|
||||
RG8I,
|
||||
RGB8I,
|
||||
RGBA8I,
|
||||
R16I,
|
||||
RG16I,
|
||||
RGB16I,
|
||||
RGBA16I,
|
||||
R32I,
|
||||
RG32I,
|
||||
RGB32I,
|
||||
RGBA32I,
|
||||
R16F,
|
||||
RG16F,
|
||||
RGB16F,
|
||||
RGBA16F,
|
||||
R32F,
|
||||
RG32F,
|
||||
RGB32F,
|
||||
RGBA32F,
|
||||
RGB9E5,
|
||||
RG11B10F,
|
||||
RG3B2,
|
||||
R5G6B5,
|
||||
RGB5A1,
|
||||
RGBA4,
|
||||
RGB10A2,
|
||||
D16,
|
||||
D24,
|
||||
D24S8,
|
||||
D32,
|
||||
D32F,
|
||||
D32FS8X24,
|
||||
RGB_DXT1,
|
||||
RGBA_DXT1,
|
||||
RGBA_DXT3,
|
||||
RGBA_DXT5,
|
||||
R_ATI1N_UNorm,
|
||||
R_ATI1N_SNorm,
|
||||
RG_ATI2N_UNorm,
|
||||
RG_ATI2N_SNorm,
|
||||
RGB_BP_UNSIGNED_FLOAT,
|
||||
RGB_BP_SIGNED_FLOAT,
|
||||
RGB_BP_UNorm,
|
||||
SRGB8,
|
||||
SRGB8_Alpha8,
|
||||
SRGB_DXT1,
|
||||
SRGB_Alpha_DXT1,
|
||||
SRGB_Alpha_DXT3,
|
||||
SRGB_Alpha_DXT5,
|
||||
SRGB_BP_UNorm,
|
||||
DepthFormat,
|
||||
AlphaFormat,
|
||||
RGBFormat,
|
||||
RGBAFormat,
|
||||
LuminanceFormat,
|
||||
LuminanceAlphaFormat,
|
||||
%If (Qt_5_4_0 -)
|
||||
S8,
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
R11_EAC_UNorm,
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
R11_EAC_SNorm,
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
RG11_EAC_UNorm,
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
RG11_EAC_SNorm,
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
RGB8_ETC2,
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
SRGB8_ETC2,
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
RGB8_PunchThrough_Alpha1_ETC2,
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
SRGB8_PunchThrough_Alpha1_ETC2,
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
RGBA8_ETC2_EAC,
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
SRGB8_Alpha8_ETC2_EAC,
|
||||
%End
|
||||
%If (Qt_5_6_0 -)
|
||||
RGB8_ETC1,
|
||||
%End
|
||||
%If (Qt_5_9_0 -)
|
||||
RGBA_ASTC_4x4,
|
||||
%End
|
||||
%If (Qt_5_9_0 -)
|
||||
RGBA_ASTC_5x4,
|
||||
%End
|
||||
%If (Qt_5_9_0 -)
|
||||
RGBA_ASTC_5x5,
|
||||
%End
|
||||
%If (Qt_5_9_0 -)
|
||||
RGBA_ASTC_6x5,
|
||||
%End
|
||||
%If (Qt_5_9_0 -)
|
||||
RGBA_ASTC_6x6,
|
||||
%End
|
||||
%If (Qt_5_9_0 -)
|
||||
RGBA_ASTC_8x5,
|
||||
%End
|
||||
%If (Qt_5_9_0 -)
|
||||
RGBA_ASTC_8x6,
|
||||
%End
|
||||
%If (Qt_5_9_0 -)
|
||||
RGBA_ASTC_8x8,
|
||||
%End
|
||||
%If (Qt_5_9_0 -)
|
||||
RGBA_ASTC_10x5,
|
||||
%End
|
||||
%If (Qt_5_9_0 -)
|
||||
RGBA_ASTC_10x6,
|
||||
%End
|
||||
%If (Qt_5_9_0 -)
|
||||
RGBA_ASTC_10x8,
|
||||
%End
|
||||
%If (Qt_5_9_0 -)
|
||||
RGBA_ASTC_10x10,
|
||||
%End
|
||||
%If (Qt_5_9_0 -)
|
||||
RGBA_ASTC_12x10,
|
||||
%End
|
||||
%If (Qt_5_9_0 -)
|
||||
RGBA_ASTC_12x12,
|
||||
%End
|
||||
%If (Qt_5_9_0 -)
|
||||
SRGB8_Alpha8_ASTC_4x4,
|
||||
%End
|
||||
%If (Qt_5_9_0 -)
|
||||
SRGB8_Alpha8_ASTC_5x4,
|
||||
%End
|
||||
%If (Qt_5_9_0 -)
|
||||
SRGB8_Alpha8_ASTC_5x5,
|
||||
%End
|
||||
%If (Qt_5_9_0 -)
|
||||
SRGB8_Alpha8_ASTC_6x5,
|
||||
%End
|
||||
%If (Qt_5_9_0 -)
|
||||
SRGB8_Alpha8_ASTC_6x6,
|
||||
%End
|
||||
%If (Qt_5_9_0 -)
|
||||
SRGB8_Alpha8_ASTC_8x5,
|
||||
%End
|
||||
%If (Qt_5_9_0 -)
|
||||
SRGB8_Alpha8_ASTC_8x6,
|
||||
%End
|
||||
%If (Qt_5_9_0 -)
|
||||
SRGB8_Alpha8_ASTC_8x8,
|
||||
%End
|
||||
%If (Qt_5_9_0 -)
|
||||
SRGB8_Alpha8_ASTC_10x5,
|
||||
%End
|
||||
%If (Qt_5_9_0 -)
|
||||
SRGB8_Alpha8_ASTC_10x6,
|
||||
%End
|
||||
%If (Qt_5_9_0 -)
|
||||
SRGB8_Alpha8_ASTC_10x8,
|
||||
%End
|
||||
%If (Qt_5_9_0 -)
|
||||
SRGB8_Alpha8_ASTC_10x10,
|
||||
%End
|
||||
%If (Qt_5_9_0 -)
|
||||
SRGB8_Alpha8_ASTC_12x10,
|
||||
%End
|
||||
%If (Qt_5_9_0 -)
|
||||
SRGB8_Alpha8_ASTC_12x12,
|
||||
%End
|
||||
};
|
||||
|
||||
void setFormat(QOpenGLTexture::TextureFormat format);
|
||||
QOpenGLTexture::TextureFormat format() const;
|
||||
void setSize(int width, int height = 1, int depth = 1);
|
||||
int width() const;
|
||||
int height() const;
|
||||
int depth() const;
|
||||
void setMipLevels(int levels);
|
||||
int mipLevels() const;
|
||||
int maximumMipLevels() const;
|
||||
void setLayers(int layers);
|
||||
int layers() const;
|
||||
int faces() const;
|
||||
void allocateStorage();
|
||||
%If (Qt_5_5_0 -)
|
||||
void allocateStorage(QOpenGLTexture::PixelFormat pixelFormat, QOpenGLTexture::PixelType pixelType);
|
||||
%End
|
||||
bool isStorageAllocated() const;
|
||||
QOpenGLTexture *createTextureView(QOpenGLTexture::Target target, QOpenGLTexture::TextureFormat viewFormat, int minimumMipmapLevel, int maximumMipmapLevel, int minimumLayer, int maximumLayer) const /Factory/;
|
||||
bool isTextureView() const;
|
||||
|
||||
enum CubeMapFace
|
||||
{
|
||||
CubeMapPositiveX,
|
||||
CubeMapNegativeX,
|
||||
CubeMapPositiveY,
|
||||
CubeMapNegativeY,
|
||||
CubeMapPositiveZ,
|
||||
CubeMapNegativeZ,
|
||||
};
|
||||
|
||||
enum PixelFormat
|
||||
{
|
||||
NoSourceFormat,
|
||||
Red,
|
||||
RG,
|
||||
RGB,
|
||||
BGR,
|
||||
RGBA,
|
||||
BGRA,
|
||||
Red_Integer,
|
||||
RG_Integer,
|
||||
RGB_Integer,
|
||||
BGR_Integer,
|
||||
RGBA_Integer,
|
||||
BGRA_Integer,
|
||||
Depth,
|
||||
DepthStencil,
|
||||
Alpha,
|
||||
Luminance,
|
||||
LuminanceAlpha,
|
||||
%If (Qt_5_4_0 -)
|
||||
Stencil,
|
||||
%End
|
||||
};
|
||||
|
||||
enum PixelType
|
||||
{
|
||||
NoPixelType,
|
||||
Int8,
|
||||
UInt8,
|
||||
Int16,
|
||||
UInt16,
|
||||
Int32,
|
||||
UInt32,
|
||||
Float16,
|
||||
Float16OES,
|
||||
Float32,
|
||||
UInt32_RGB9_E5,
|
||||
UInt32_RG11B10F,
|
||||
UInt8_RG3B2,
|
||||
UInt8_RG3B2_Rev,
|
||||
UInt16_RGB5A1,
|
||||
UInt16_RGB5A1_Rev,
|
||||
UInt16_R5G6B5,
|
||||
UInt16_R5G6B5_Rev,
|
||||
UInt16_RGBA4,
|
||||
UInt16_RGBA4_Rev,
|
||||
UInt32_RGB10A2,
|
||||
UInt32_RGB10A2_Rev,
|
||||
%If (Qt_5_4_0 -)
|
||||
UInt32_RGBA8,
|
||||
%End
|
||||
%If (Qt_5_4_0 -)
|
||||
UInt32_RGBA8_Rev,
|
||||
%End
|
||||
%If (Qt_5_4_0 -)
|
||||
UInt32_D24S8,
|
||||
%End
|
||||
%If (Qt_5_4_0 -)
|
||||
Float32_D32_UInt32_S8_X24,
|
||||
%End
|
||||
};
|
||||
|
||||
%If (Qt_5_3_0 -)
|
||||
void setData(int mipLevel, int layer, QOpenGLTexture::CubeMapFace cubeFace, QOpenGLTexture::PixelFormat sourceFormat, QOpenGLTexture::PixelType sourceType, const void *data, const QOpenGLPixelTransferOptions * const options = 0);
|
||||
%End
|
||||
%If (- Qt_5_3_0)
|
||||
void setData(int mipLevel, int layer, QOpenGLTexture::CubeMapFace cubeFace, QOpenGLTexture::PixelFormat sourceFormat, QOpenGLTexture::PixelType sourceType, void *data, const QOpenGLPixelTransferOptions * const options = 0);
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
void setData(int mipLevel, int layer, QOpenGLTexture::PixelFormat sourceFormat, QOpenGLTexture::PixelType sourceType, const void *data, const QOpenGLPixelTransferOptions * const options = 0);
|
||||
%End
|
||||
%If (- Qt_5_3_0)
|
||||
void setData(int mipLevel, int layer, QOpenGLTexture::PixelFormat sourceFormat, QOpenGLTexture::PixelType sourceType, void *data, const QOpenGLPixelTransferOptions * const options = 0);
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
void setData(int mipLevel, QOpenGLTexture::PixelFormat sourceFormat, QOpenGLTexture::PixelType sourceType, const void *data, const QOpenGLPixelTransferOptions * const options = 0);
|
||||
%End
|
||||
%If (- Qt_5_3_0)
|
||||
void setData(int mipLevel, QOpenGLTexture::PixelFormat sourceFormat, QOpenGLTexture::PixelType sourceType, void *data, const QOpenGLPixelTransferOptions * const options = 0);
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
void setData(QOpenGLTexture::PixelFormat sourceFormat, QOpenGLTexture::PixelType sourceType, const void *data, const QOpenGLPixelTransferOptions * const options = 0);
|
||||
%End
|
||||
%If (- Qt_5_3_0)
|
||||
void setData(QOpenGLTexture::PixelFormat sourceFormat, QOpenGLTexture::PixelType sourceType, void *data, const QOpenGLPixelTransferOptions * const options = 0);
|
||||
%End
|
||||
void setData(const QImage &image, QOpenGLTexture::MipMapGeneration genMipMaps = QOpenGLTexture::GenerateMipMaps);
|
||||
%If (Qt_5_3_0 -)
|
||||
void setCompressedData(int mipLevel, int layer, QOpenGLTexture::CubeMapFace cubeFace, int dataSize, const void *data, const QOpenGLPixelTransferOptions * const options = 0);
|
||||
%End
|
||||
%If (- Qt_5_3_0)
|
||||
void setCompressedData(int mipLevel, int layer, QOpenGLTexture::CubeMapFace cubeFace, int dataSize, void *data, const QOpenGLPixelTransferOptions * const options = 0);
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
void setCompressedData(int mipLevel, int layer, int dataSize, const void *data, const QOpenGLPixelTransferOptions * const options = 0);
|
||||
%End
|
||||
%If (- Qt_5_3_0)
|
||||
void setCompressedData(int mipLevel, int layer, int dataSize, void *data, const QOpenGLPixelTransferOptions * const options = 0);
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
void setCompressedData(int mipLevel, int dataSize, const void *data, const QOpenGLPixelTransferOptions * const options = 0);
|
||||
%End
|
||||
%If (- Qt_5_3_0)
|
||||
void setCompressedData(int mipLevel, int dataSize, void *data, const QOpenGLPixelTransferOptions * const options = 0);
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
void setCompressedData(int dataSize, const void *data, const QOpenGLPixelTransferOptions * const options = 0);
|
||||
%End
|
||||
%If (- Qt_5_3_0)
|
||||
void setCompressedData(int dataSize, void *data, const QOpenGLPixelTransferOptions * const options = 0);
|
||||
%End
|
||||
|
||||
enum Feature
|
||||
{
|
||||
ImmutableStorage,
|
||||
ImmutableMultisampleStorage,
|
||||
TextureRectangle,
|
||||
TextureArrays,
|
||||
Texture3D,
|
||||
TextureMultisample,
|
||||
TextureBuffer,
|
||||
TextureCubeMapArrays,
|
||||
Swizzle,
|
||||
StencilTexturing,
|
||||
AnisotropicFiltering,
|
||||
NPOTTextures,
|
||||
NPOTTextureRepeat,
|
||||
%If (Qt_5_3_0 -)
|
||||
Texture1D,
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
TextureComparisonOperators,
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
TextureMipMapLevel,
|
||||
%End
|
||||
};
|
||||
|
||||
typedef QFlags<QOpenGLTexture::Feature> Features;
|
||||
static bool hasFeature(QOpenGLTexture::Feature feature);
|
||||
void setMipBaseLevel(int baseLevel);
|
||||
int mipBaseLevel() const;
|
||||
void setMipMaxLevel(int maxLevel);
|
||||
int mipMaxLevel() const;
|
||||
void setMipLevelRange(int baseLevel, int maxLevel);
|
||||
QPair<int, int> mipLevelRange() const;
|
||||
void setAutoMipMapGenerationEnabled(bool enabled);
|
||||
bool isAutoMipMapGenerationEnabled() const;
|
||||
void generateMipMaps();
|
||||
void generateMipMaps(int baseLevel, bool resetBaseLevel = true);
|
||||
|
||||
enum SwizzleComponent
|
||||
{
|
||||
SwizzleRed,
|
||||
SwizzleGreen,
|
||||
SwizzleBlue,
|
||||
SwizzleAlpha,
|
||||
};
|
||||
|
||||
enum SwizzleValue
|
||||
{
|
||||
RedValue,
|
||||
GreenValue,
|
||||
BlueValue,
|
||||
AlphaValue,
|
||||
ZeroValue,
|
||||
OneValue,
|
||||
};
|
||||
|
||||
void setSwizzleMask(QOpenGLTexture::SwizzleComponent component, QOpenGLTexture::SwizzleValue value);
|
||||
void setSwizzleMask(QOpenGLTexture::SwizzleValue r, QOpenGLTexture::SwizzleValue g, QOpenGLTexture::SwizzleValue b, QOpenGLTexture::SwizzleValue a);
|
||||
QOpenGLTexture::SwizzleValue swizzleMask(QOpenGLTexture::SwizzleComponent component) const;
|
||||
|
||||
enum DepthStencilMode
|
||||
{
|
||||
DepthMode,
|
||||
StencilMode,
|
||||
};
|
||||
|
||||
void setDepthStencilMode(QOpenGLTexture::DepthStencilMode mode);
|
||||
QOpenGLTexture::DepthStencilMode depthStencilMode() const;
|
||||
|
||||
enum Filter
|
||||
{
|
||||
Nearest,
|
||||
Linear,
|
||||
NearestMipMapNearest,
|
||||
NearestMipMapLinear,
|
||||
LinearMipMapNearest,
|
||||
LinearMipMapLinear,
|
||||
};
|
||||
|
||||
void setMinificationFilter(QOpenGLTexture::Filter filter);
|
||||
QOpenGLTexture::Filter minificationFilter() const;
|
||||
void setMagnificationFilter(QOpenGLTexture::Filter filter);
|
||||
QOpenGLTexture::Filter magnificationFilter() const;
|
||||
void setMinMagFilters(QOpenGLTexture::Filter minificationFilter, QOpenGLTexture::Filter magnificationFilter);
|
||||
QPair<QOpenGLTexture::Filter, QOpenGLTexture::Filter> minMagFilters() const;
|
||||
void setMaximumAnisotropy(float anisotropy);
|
||||
float maximumAnisotropy() const;
|
||||
|
||||
enum WrapMode
|
||||
{
|
||||
Repeat,
|
||||
MirroredRepeat,
|
||||
ClampToEdge,
|
||||
ClampToBorder,
|
||||
};
|
||||
|
||||
enum CoordinateDirection
|
||||
{
|
||||
DirectionS,
|
||||
DirectionT,
|
||||
DirectionR,
|
||||
};
|
||||
|
||||
void setWrapMode(QOpenGLTexture::WrapMode mode);
|
||||
void setWrapMode(QOpenGLTexture::CoordinateDirection direction, QOpenGLTexture::WrapMode mode);
|
||||
QOpenGLTexture::WrapMode wrapMode(QOpenGLTexture::CoordinateDirection direction) const;
|
||||
void setBorderColor(QColor color);
|
||||
QColor borderColor() const;
|
||||
void setMinimumLevelOfDetail(float value);
|
||||
float minimumLevelOfDetail() const;
|
||||
void setMaximumLevelOfDetail(float value);
|
||||
float maximumLevelOfDetail() const;
|
||||
void setLevelOfDetailRange(float min, float max);
|
||||
QPair<float, float> levelOfDetailRange() const;
|
||||
void setLevelofDetailBias(float bias);
|
||||
float levelofDetailBias() const;
|
||||
%If (Qt_5_4_0 -)
|
||||
QOpenGLTexture::Target target() const;
|
||||
%End
|
||||
%If (Qt_5_4_0 -)
|
||||
void setSamples(int samples);
|
||||
%End
|
||||
%If (Qt_5_4_0 -)
|
||||
int samples() const;
|
||||
%End
|
||||
%If (Qt_5_4_0 -)
|
||||
void setFixedSamplePositions(bool fixed);
|
||||
%End
|
||||
%If (Qt_5_4_0 -)
|
||||
bool isFixedSamplePositions() const;
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
|
||||
enum ComparisonFunction
|
||||
{
|
||||
CompareLessEqual,
|
||||
CompareGreaterEqual,
|
||||
CompareLess,
|
||||
CompareGreater,
|
||||
CompareEqual,
|
||||
CommpareNotEqual,
|
||||
CompareAlways,
|
||||
CompareNever,
|
||||
};
|
||||
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
void setComparisonFunction(QOpenGLTexture::ComparisonFunction function);
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
QOpenGLTexture::ComparisonFunction comparisonFunction() const;
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
|
||||
enum ComparisonMode
|
||||
{
|
||||
CompareRefToTexture,
|
||||
CompareNone,
|
||||
};
|
||||
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
void setComparisonMode(QOpenGLTexture::ComparisonMode mode);
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
QOpenGLTexture::ComparisonMode comparisonMode() const;
|
||||
%End
|
||||
%If (Qt_5_9_0 -)
|
||||
void setData(int mipLevel, int layer, int layerCount, QOpenGLTexture::CubeMapFace cubeFace, QOpenGLTexture::PixelFormat sourceFormat, QOpenGLTexture::PixelType sourceType, const void *data, const QOpenGLPixelTransferOptions * const options = 0);
|
||||
%End
|
||||
%If (Qt_5_9_0 -)
|
||||
void setCompressedData(int mipLevel, int layer, int layerCount, QOpenGLTexture::CubeMapFace cubeFace, int dataSize, const void *data, const QOpenGLPixelTransferOptions * const options = 0);
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
void setData(int xOffset, int yOffset, int zOffset, int width, int height, int depth, QOpenGLTexture::PixelFormat sourceFormat, QOpenGLTexture::PixelType sourceType, const void *data, const QOpenGLPixelTransferOptions * const options = 0);
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
void setData(int xOffset, int yOffset, int zOffset, int width, int height, int depth, int mipLevel, QOpenGLTexture::PixelFormat sourceFormat, QOpenGLTexture::PixelType sourceType, const void *data, const QOpenGLPixelTransferOptions * const options = 0);
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
void setData(int xOffset, int yOffset, int zOffset, int width, int height, int depth, int mipLevel, int layer, QOpenGLTexture::PixelFormat sourceFormat, QOpenGLTexture::PixelType sourceType, const void *data, const QOpenGLPixelTransferOptions * const options = 0);
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
void setData(int xOffset, int yOffset, int zOffset, int width, int height, int depth, int mipLevel, int layer, QOpenGLTexture::CubeMapFace cubeFace, QOpenGLTexture::PixelFormat sourceFormat, QOpenGLTexture::PixelType sourceType, const void *data, const QOpenGLPixelTransferOptions * const options = 0);
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
void setData(int xOffset, int yOffset, int zOffset, int width, int height, int depth, int mipLevel, int layer, QOpenGLTexture::CubeMapFace cubeFace, int layerCount, QOpenGLTexture::PixelFormat sourceFormat, QOpenGLTexture::PixelType sourceType, const void *data, const QOpenGLPixelTransferOptions * const options = 0);
|
||||
%End
|
||||
|
||||
private:
|
||||
QOpenGLTexture(const QOpenGLTexture &);
|
||||
};
|
||||
|
||||
%End
|
||||
%End
|
||||
%If (Qt_5_2_0 -)
|
||||
%If (PyQt_OpenGL)
|
||||
QFlags<QOpenGLTexture::Feature> operator|(QOpenGLTexture::Feature f1, QFlags<QOpenGLTexture::Feature> f2);
|
||||
%End
|
||||
%End
|
||||
@@ -0,0 +1,60 @@
|
||||
// qopengltextureblitter.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (Qt_5_8_0 -)
|
||||
%If (PyQt_OpenGL)
|
||||
|
||||
class QOpenGLTextureBlitter
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qopengltextureblitter.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QOpenGLTextureBlitter();
|
||||
~QOpenGLTextureBlitter();
|
||||
|
||||
enum Origin
|
||||
{
|
||||
OriginBottomLeft,
|
||||
OriginTopLeft,
|
||||
};
|
||||
|
||||
bool create();
|
||||
bool isCreated() const;
|
||||
void destroy();
|
||||
bool supportsExternalOESTarget() const;
|
||||
void bind(GLenum target = GL_TEXTURE_2D);
|
||||
void release();
|
||||
void setRedBlueSwizzle(bool swizzle);
|
||||
void setOpacity(float opacity);
|
||||
void blit(GLuint texture, const QMatrix4x4 &targetTransform, QOpenGLTextureBlitter::Origin sourceOrigin);
|
||||
void blit(GLuint texture, const QMatrix4x4 &targetTransform, const QMatrix3x3 &sourceTransform);
|
||||
static QMatrix4x4 targetTransform(const QRectF &target, const QRect &viewport);
|
||||
static QMatrix3x3 sourceTransform(const QRectF &subTexture, const QSize &textureSize, QOpenGLTextureBlitter::Origin origin);
|
||||
|
||||
private:
|
||||
QOpenGLTextureBlitter(const QOpenGLTextureBlitter &);
|
||||
};
|
||||
|
||||
%End
|
||||
%End
|
||||
@@ -0,0 +1,75 @@
|
||||
// qopengltimerquery.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (Qt_5_1_0 -)
|
||||
%If (PyQt_Desktop_OpenGL)
|
||||
|
||||
class QOpenGLTimerQuery : public QObject
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qopengltimerquery.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
explicit QOpenGLTimerQuery(QObject *parent /TransferThis/ = 0);
|
||||
virtual ~QOpenGLTimerQuery();
|
||||
bool create();
|
||||
void destroy();
|
||||
bool isCreated() const;
|
||||
GLuint objectId() const;
|
||||
void begin();
|
||||
void end();
|
||||
GLuint64 waitForTimestamp() const /ReleaseGIL/;
|
||||
void recordTimestamp();
|
||||
bool isResultAvailable() const;
|
||||
GLuint64 waitForResult() const /ReleaseGIL/;
|
||||
};
|
||||
|
||||
%End
|
||||
%End
|
||||
%If (Qt_5_1_0 -)
|
||||
%If (PyQt_Desktop_OpenGL)
|
||||
|
||||
class QOpenGLTimeMonitor : public QObject
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qopengltimerquery.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
explicit QOpenGLTimeMonitor(QObject *parent /TransferThis/ = 0);
|
||||
virtual ~QOpenGLTimeMonitor();
|
||||
void setSampleCount(int sampleCount);
|
||||
int sampleCount() const;
|
||||
bool create();
|
||||
void destroy();
|
||||
bool isCreated() const;
|
||||
QVector<GLuint> objectIds() const;
|
||||
int recordSample();
|
||||
bool isResultAvailable() const;
|
||||
QVector<GLuint64> waitForSamples() const /ReleaseGIL/;
|
||||
QVector<GLuint64> waitForIntervals() const /ReleaseGIL/;
|
||||
void reset();
|
||||
};
|
||||
|
||||
%End
|
||||
%End
|
||||
@@ -0,0 +1,36 @@
|
||||
// qopenglversionfunctions.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (Qt_5_1_0 -)
|
||||
%If (PyQt_OpenGL)
|
||||
|
||||
class QAbstractOpenGLFunctions /NoDefaultCtors,Supertype=sip.wrapper/
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qopenglversionfunctions.h>
|
||||
%End
|
||||
|
||||
QAbstractOpenGLFunctions(const QAbstractOpenGLFunctions &);
|
||||
};
|
||||
|
||||
%End
|
||||
%End
|
||||
@@ -0,0 +1,71 @@
|
||||
// qopenglvertexarrayobject.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (Qt_5_1_0 -)
|
||||
%If (PyQt_OpenGL)
|
||||
|
||||
class QOpenGLVertexArrayObject : public QObject
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qopenglvertexarrayobject.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
explicit QOpenGLVertexArrayObject(QObject *parent /TransferThis/ = 0);
|
||||
virtual ~QOpenGLVertexArrayObject();
|
||||
bool create();
|
||||
void destroy();
|
||||
bool isCreated() const;
|
||||
GLuint objectId() const;
|
||||
void bind();
|
||||
void release();
|
||||
|
||||
class Binder
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qopenglvertexarrayobject.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
Binder(QOpenGLVertexArrayObject *v);
|
||||
~Binder();
|
||||
void release();
|
||||
void rebind();
|
||||
SIP_PYOBJECT __enter__();
|
||||
%MethodCode
|
||||
// Just return a reference to self.
|
||||
sipRes = sipSelf;
|
||||
Py_INCREF(sipRes);
|
||||
%End
|
||||
|
||||
void __exit__(SIP_PYOBJECT type, SIP_PYOBJECT value, SIP_PYOBJECT traceback);
|
||||
%MethodCode
|
||||
sipCpp->release();
|
||||
%End
|
||||
|
||||
private:
|
||||
Binder(const QOpenGLVertexArrayObject::Binder &);
|
||||
};
|
||||
};
|
||||
|
||||
%End
|
||||
%End
|
||||
@@ -0,0 +1,73 @@
|
||||
// qopenglwindow.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (Qt_5_4_0 -)
|
||||
%If (PyQt_OpenGL)
|
||||
|
||||
class QOpenGLWindow : public QPaintDeviceWindow
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qopenglwindow.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum UpdateBehavior
|
||||
{
|
||||
NoPartialUpdate,
|
||||
PartialUpdateBlit,
|
||||
PartialUpdateBlend,
|
||||
};
|
||||
|
||||
QOpenGLWindow(QOpenGLWindow::UpdateBehavior updateBehavior = QOpenGLWindow::NoPartialUpdate, QWindow *parent /TransferThis/ = 0);
|
||||
%If (Qt_5_5_0 -)
|
||||
QOpenGLWindow(QOpenGLContext *shareContext, QOpenGLWindow::UpdateBehavior updateBehavior = QOpenGLWindow::NoPartialUpdate, QWindow *parent /TransferThis/ = 0);
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
virtual ~QOpenGLWindow();
|
||||
%End
|
||||
QOpenGLWindow::UpdateBehavior updateBehavior() const;
|
||||
bool isValid() const;
|
||||
void makeCurrent();
|
||||
void doneCurrent();
|
||||
QOpenGLContext *context() const;
|
||||
GLuint defaultFramebufferObject() const;
|
||||
QImage grabFramebuffer();
|
||||
%If (Qt_5_5_0 -)
|
||||
QOpenGLContext *shareContext() const;
|
||||
%End
|
||||
|
||||
signals:
|
||||
void frameSwapped();
|
||||
|
||||
protected:
|
||||
virtual void initializeGL();
|
||||
virtual void resizeGL(int w, int h);
|
||||
virtual void paintGL();
|
||||
virtual void paintUnderGL();
|
||||
virtual void paintOverGL();
|
||||
virtual void paintEvent(QPaintEvent *event);
|
||||
virtual void resizeEvent(QResizeEvent *event);
|
||||
virtual int metric(QPaintDevice::PaintDeviceMetric metric) const;
|
||||
};
|
||||
|
||||
%End
|
||||
%End
|
||||
@@ -0,0 +1,403 @@
|
||||
// qpagedpaintdevice.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QPagedPaintDevice : public QPaintDevice
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qpagedpaintdevice.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QPagedPaintDevice();
|
||||
virtual ~QPagedPaintDevice();
|
||||
virtual bool newPage() = 0;
|
||||
|
||||
enum PageSize
|
||||
{
|
||||
A4,
|
||||
B5,
|
||||
Letter,
|
||||
Legal,
|
||||
Executive,
|
||||
A0,
|
||||
A1,
|
||||
A2,
|
||||
A3,
|
||||
A5,
|
||||
A6,
|
||||
A7,
|
||||
A8,
|
||||
A9,
|
||||
B0,
|
||||
B1,
|
||||
B10,
|
||||
B2,
|
||||
B3,
|
||||
B4,
|
||||
B6,
|
||||
B7,
|
||||
B8,
|
||||
B9,
|
||||
C5E,
|
||||
Comm10E,
|
||||
DLE,
|
||||
Folio,
|
||||
Ledger,
|
||||
Tabloid,
|
||||
Custom,
|
||||
%If (Qt_5_3_0 -)
|
||||
A10,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
A3Extra,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
A4Extra,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
A4Plus,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
A4Small,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
A5Extra,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
B5Extra,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
JisB0,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
JisB1,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
JisB2,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
JisB3,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
JisB4,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
JisB5,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
JisB6,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
JisB7,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
JisB8,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
JisB9,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
JisB10,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
AnsiC,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
AnsiD,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
AnsiE,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
LegalExtra,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
LetterExtra,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
LetterPlus,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
LetterSmall,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
TabloidExtra,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
ArchA,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
ArchB,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
ArchC,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
ArchD,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
ArchE,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
Imperial7x9,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
Imperial8x10,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
Imperial9x11,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
Imperial9x12,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
Imperial10x11,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
Imperial10x13,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
Imperial10x14,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
Imperial12x11,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
Imperial15x11,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
ExecutiveStandard,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
Note,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
Quarto,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
Statement,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
SuperA,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
SuperB,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
Postcard,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
DoublePostcard,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
Prc16K,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
Prc32K,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
Prc32KBig,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
FanFoldUS,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
FanFoldGerman,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
FanFoldGermanLegal,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
EnvelopeB4,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
EnvelopeB5,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
EnvelopeB6,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
EnvelopeC0,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
EnvelopeC1,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
EnvelopeC2,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
EnvelopeC3,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
EnvelopeC4,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
EnvelopeC6,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
EnvelopeC65,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
EnvelopeC7,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
Envelope9,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
Envelope11,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
Envelope12,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
Envelope14,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
EnvelopeMonarch,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
EnvelopePersonal,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
EnvelopeChou3,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
EnvelopeChou4,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
EnvelopeInvite,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
EnvelopeItalian,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
EnvelopeKaku2,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
EnvelopeKaku3,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
EnvelopePrc1,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
EnvelopePrc2,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
EnvelopePrc3,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
EnvelopePrc4,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
EnvelopePrc5,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
EnvelopePrc6,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
EnvelopePrc7,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
EnvelopePrc8,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
EnvelopePrc9,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
EnvelopePrc10,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
EnvelopeYou4,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
NPaperSize,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
AnsiA,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
AnsiB,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
EnvelopeC5,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
EnvelopeDL,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
Envelope10,
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
LastPageSize,
|
||||
%End
|
||||
};
|
||||
|
||||
%If (Qt_5_10_0 -)
|
||||
|
||||
enum PdfVersion
|
||||
{
|
||||
PdfVersion_1_4,
|
||||
PdfVersion_A1b,
|
||||
%If (Qt_5_12_0 -)
|
||||
PdfVersion_1_6,
|
||||
%End
|
||||
};
|
||||
|
||||
%End
|
||||
virtual void setPageSize(QPagedPaintDevice::PageSize size);
|
||||
QPagedPaintDevice::PageSize pageSize() const;
|
||||
virtual void setPageSizeMM(const QSizeF &size);
|
||||
QSizeF pageSizeMM() const;
|
||||
|
||||
struct Margins
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qpagedpaintdevice.h>
|
||||
%End
|
||||
|
||||
qreal left;
|
||||
qreal right;
|
||||
qreal top;
|
||||
qreal bottom;
|
||||
};
|
||||
|
||||
virtual void setMargins(const QPagedPaintDevice::Margins &margins);
|
||||
QPagedPaintDevice::Margins margins() const;
|
||||
%If (Qt_5_3_0 -)
|
||||
bool setPageLayout(const QPageLayout &pageLayout);
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
bool setPageSize(const QPageSize &pageSize);
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
bool setPageOrientation(QPageLayout::Orientation orientation);
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
bool setPageMargins(const QMarginsF &margins);
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
bool setPageMargins(const QMarginsF &margins, QPageLayout::Unit units);
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
QPageLayout pageLayout() const;
|
||||
%End
|
||||
};
|
||||
@@ -0,0 +1,97 @@
|
||||
// qpagelayout.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (Qt_5_3_0 -)
|
||||
|
||||
class QPageLayout
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qpagelayout.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum Unit
|
||||
{
|
||||
Millimeter,
|
||||
Point,
|
||||
Inch,
|
||||
Pica,
|
||||
Didot,
|
||||
Cicero,
|
||||
};
|
||||
|
||||
enum Orientation
|
||||
{
|
||||
Portrait,
|
||||
Landscape,
|
||||
};
|
||||
|
||||
enum Mode
|
||||
{
|
||||
StandardMode,
|
||||
FullPageMode,
|
||||
};
|
||||
|
||||
QPageLayout();
|
||||
QPageLayout(const QPageSize &pageSize, QPageLayout::Orientation orientation, const QMarginsF &margins, QPageLayout::Unit units = QPageLayout::Point, const QMarginsF &minMargins = QMarginsF(0, 0, 0, 0));
|
||||
QPageLayout(const QPageLayout &other);
|
||||
~QPageLayout();
|
||||
void swap(QPageLayout &other /Constrained/);
|
||||
bool isEquivalentTo(const QPageLayout &other) const;
|
||||
bool isValid() const;
|
||||
void setMode(QPageLayout::Mode mode);
|
||||
QPageLayout::Mode mode() const;
|
||||
void setPageSize(const QPageSize &pageSize, const QMarginsF &minMargins = QMarginsF(0, 0, 0, 0));
|
||||
QPageSize pageSize() const;
|
||||
void setOrientation(QPageLayout::Orientation orientation);
|
||||
QPageLayout::Orientation orientation() const;
|
||||
void setUnits(QPageLayout::Unit units);
|
||||
QPageLayout::Unit units() const;
|
||||
bool setMargins(const QMarginsF &margins);
|
||||
bool setLeftMargin(qreal leftMargin);
|
||||
bool setRightMargin(qreal rightMargin);
|
||||
bool setTopMargin(qreal topMargin);
|
||||
bool setBottomMargin(qreal bottomMargin);
|
||||
QMarginsF margins() const;
|
||||
QMarginsF margins(QPageLayout::Unit units) const;
|
||||
QMargins marginsPoints() const;
|
||||
QMargins marginsPixels(int resolution) const;
|
||||
void setMinimumMargins(const QMarginsF &minMargins);
|
||||
QMarginsF minimumMargins() const;
|
||||
QMarginsF maximumMargins() const;
|
||||
QRectF fullRect() const;
|
||||
QRectF fullRect(QPageLayout::Unit units) const;
|
||||
QRect fullRectPoints() const;
|
||||
QRect fullRectPixels(int resolution) const;
|
||||
QRectF paintRect() const;
|
||||
QRectF paintRect(QPageLayout::Unit units) const;
|
||||
QRect paintRectPoints() const;
|
||||
QRect paintRectPixels(int resolution) const;
|
||||
};
|
||||
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
bool operator==(const QPageLayout &lhs, const QPageLayout &rhs);
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
bool operator!=(const QPageLayout &lhs, const QPageLayout &rhs);
|
||||
%End
|
||||
@@ -0,0 +1,220 @@
|
||||
// qpagesize.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (Qt_5_3_0 -)
|
||||
|
||||
class QPageSize
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qpagesize.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum PageSizeId
|
||||
{
|
||||
A4,
|
||||
B5,
|
||||
Letter,
|
||||
Legal,
|
||||
Executive,
|
||||
A0,
|
||||
A1,
|
||||
A2,
|
||||
A3,
|
||||
A5,
|
||||
A6,
|
||||
A7,
|
||||
A8,
|
||||
A9,
|
||||
B0,
|
||||
B1,
|
||||
B10,
|
||||
B2,
|
||||
B3,
|
||||
B4,
|
||||
B6,
|
||||
B7,
|
||||
B8,
|
||||
B9,
|
||||
C5E,
|
||||
Comm10E,
|
||||
DLE,
|
||||
Folio,
|
||||
Ledger,
|
||||
Tabloid,
|
||||
Custom,
|
||||
A10,
|
||||
A3Extra,
|
||||
A4Extra,
|
||||
A4Plus,
|
||||
A4Small,
|
||||
A5Extra,
|
||||
B5Extra,
|
||||
JisB0,
|
||||
JisB1,
|
||||
JisB2,
|
||||
JisB3,
|
||||
JisB4,
|
||||
JisB5,
|
||||
JisB6,
|
||||
JisB7,
|
||||
JisB8,
|
||||
JisB9,
|
||||
JisB10,
|
||||
AnsiC,
|
||||
AnsiD,
|
||||
AnsiE,
|
||||
LegalExtra,
|
||||
LetterExtra,
|
||||
LetterPlus,
|
||||
LetterSmall,
|
||||
TabloidExtra,
|
||||
ArchA,
|
||||
ArchB,
|
||||
ArchC,
|
||||
ArchD,
|
||||
ArchE,
|
||||
Imperial7x9,
|
||||
Imperial8x10,
|
||||
Imperial9x11,
|
||||
Imperial9x12,
|
||||
Imperial10x11,
|
||||
Imperial10x13,
|
||||
Imperial10x14,
|
||||
Imperial12x11,
|
||||
Imperial15x11,
|
||||
ExecutiveStandard,
|
||||
Note,
|
||||
Quarto,
|
||||
Statement,
|
||||
SuperA,
|
||||
SuperB,
|
||||
Postcard,
|
||||
DoublePostcard,
|
||||
Prc16K,
|
||||
Prc32K,
|
||||
Prc32KBig,
|
||||
FanFoldUS,
|
||||
FanFoldGerman,
|
||||
FanFoldGermanLegal,
|
||||
EnvelopeB4,
|
||||
EnvelopeB5,
|
||||
EnvelopeB6,
|
||||
EnvelopeC0,
|
||||
EnvelopeC1,
|
||||
EnvelopeC2,
|
||||
EnvelopeC3,
|
||||
EnvelopeC4,
|
||||
EnvelopeC6,
|
||||
EnvelopeC65,
|
||||
EnvelopeC7,
|
||||
Envelope9,
|
||||
Envelope11,
|
||||
Envelope12,
|
||||
Envelope14,
|
||||
EnvelopeMonarch,
|
||||
EnvelopePersonal,
|
||||
EnvelopeChou3,
|
||||
EnvelopeChou4,
|
||||
EnvelopeInvite,
|
||||
EnvelopeItalian,
|
||||
EnvelopeKaku2,
|
||||
EnvelopeKaku3,
|
||||
EnvelopePrc1,
|
||||
EnvelopePrc2,
|
||||
EnvelopePrc3,
|
||||
EnvelopePrc4,
|
||||
EnvelopePrc5,
|
||||
EnvelopePrc6,
|
||||
EnvelopePrc7,
|
||||
EnvelopePrc8,
|
||||
EnvelopePrc9,
|
||||
EnvelopePrc10,
|
||||
EnvelopeYou4,
|
||||
NPageSize,
|
||||
NPaperSize,
|
||||
AnsiA,
|
||||
AnsiB,
|
||||
EnvelopeC5,
|
||||
EnvelopeDL,
|
||||
Envelope10,
|
||||
LastPageSize,
|
||||
};
|
||||
|
||||
enum Unit
|
||||
{
|
||||
Millimeter,
|
||||
Point,
|
||||
Inch,
|
||||
Pica,
|
||||
Didot,
|
||||
Cicero,
|
||||
};
|
||||
|
||||
enum SizeMatchPolicy
|
||||
{
|
||||
FuzzyMatch,
|
||||
FuzzyOrientationMatch,
|
||||
ExactMatch,
|
||||
};
|
||||
|
||||
QPageSize();
|
||||
explicit QPageSize(QPageSize::PageSizeId pageSizeId);
|
||||
QPageSize(const QSize &pointSize, const QString &name = QString(), QPageSize::SizeMatchPolicy matchPolicy = QPageSize::FuzzyMatch);
|
||||
QPageSize(const QSizeF &size, QPageSize::Unit units, const QString &name = QString(), QPageSize::SizeMatchPolicy matchPolicy = QPageSize::FuzzyMatch);
|
||||
QPageSize(const QPageSize &other);
|
||||
~QPageSize();
|
||||
void swap(QPageSize &other /Constrained/);
|
||||
bool isEquivalentTo(const QPageSize &other) const;
|
||||
bool isValid() const;
|
||||
QString key() const;
|
||||
QString name() const;
|
||||
QPageSize::PageSizeId id() const;
|
||||
int windowsId() const;
|
||||
QSizeF definitionSize() const;
|
||||
QPageSize::Unit definitionUnits() const;
|
||||
QSizeF size(QPageSize::Unit units) const;
|
||||
QSize sizePoints() const;
|
||||
QSize sizePixels(int resolution) const;
|
||||
QRectF rect(QPageSize::Unit units) const;
|
||||
QRect rectPoints() const;
|
||||
QRect rectPixels(int resolution) const;
|
||||
static QString key(QPageSize::PageSizeId pageSizeId);
|
||||
static QString name(QPageSize::PageSizeId pageSizeId);
|
||||
static QPageSize::PageSizeId id(const QSize &pointSize, QPageSize::SizeMatchPolicy matchPolicy = QPageSize::FuzzyMatch);
|
||||
static QPageSize::PageSizeId id(const QSizeF &size, QPageSize::Unit units, QPageSize::SizeMatchPolicy matchPolicy = QPageSize::FuzzyMatch);
|
||||
static QPageSize::PageSizeId id(int windowsId);
|
||||
static int windowsId(QPageSize::PageSizeId pageSizeId);
|
||||
static QSizeF definitionSize(QPageSize::PageSizeId pageSizeId);
|
||||
static QPageSize::Unit definitionUnits(QPageSize::PageSizeId pageSizeId);
|
||||
static QSizeF size(QPageSize::PageSizeId pageSizeId, QPageSize::Unit units);
|
||||
static QSize sizePoints(QPageSize::PageSizeId pageSizeId);
|
||||
static QSize sizePixels(QPageSize::PageSizeId pageSizeId, int resolution);
|
||||
};
|
||||
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
bool operator==(const QPageSize &lhs, const QPageSize &rhs);
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
bool operator!=(const QPageSize &lhs, const QPageSize &rhs);
|
||||
%End
|
||||
@@ -0,0 +1,81 @@
|
||||
// qpaintdevice.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QPaintDevice
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qpaintdevice.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum PaintDeviceMetric
|
||||
{
|
||||
PdmWidth,
|
||||
PdmHeight,
|
||||
PdmWidthMM,
|
||||
PdmHeightMM,
|
||||
PdmNumColors,
|
||||
PdmDepth,
|
||||
PdmDpiX,
|
||||
PdmDpiY,
|
||||
PdmPhysicalDpiX,
|
||||
PdmPhysicalDpiY,
|
||||
%If (Qt_5_1_0 -)
|
||||
PdmDevicePixelRatio,
|
||||
%End
|
||||
%If (Qt_5_6_0 -)
|
||||
PdmDevicePixelRatioScaled,
|
||||
%End
|
||||
};
|
||||
|
||||
virtual ~QPaintDevice();
|
||||
virtual QPaintEngine *paintEngine() const = 0;
|
||||
int width() const;
|
||||
int height() const;
|
||||
int widthMM() const;
|
||||
int heightMM() const;
|
||||
int logicalDpiX() const;
|
||||
int logicalDpiY() const;
|
||||
int physicalDpiX() const;
|
||||
int physicalDpiY() const;
|
||||
int depth() const;
|
||||
bool paintingActive() const;
|
||||
int colorCount() const;
|
||||
%If (Qt_5_1_0 -)
|
||||
int devicePixelRatio() const;
|
||||
%End
|
||||
|
||||
protected:
|
||||
QPaintDevice();
|
||||
virtual int metric(QPaintDevice::PaintDeviceMetric metric) const;
|
||||
|
||||
public:
|
||||
%If (Qt_5_6_0 -)
|
||||
qreal devicePixelRatioF() const;
|
||||
%End
|
||||
%If (Qt_5_6_0 -)
|
||||
static qreal devicePixelRatioFScale();
|
||||
%End
|
||||
|
||||
private:
|
||||
QPaintDevice(const QPaintDevice &);
|
||||
};
|
||||
@@ -0,0 +1,45 @@
|
||||
// qpaintdevicewindow.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (Qt_5_4_0 -)
|
||||
|
||||
class QPaintDeviceWindow : public QWindow, public QPaintDevice /NoDefaultCtors/
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qpaintdevicewindow.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
void update(const QRect &rect);
|
||||
void update(const QRegion ®ion);
|
||||
|
||||
public slots:
|
||||
void update();
|
||||
|
||||
protected:
|
||||
virtual void paintEvent(QPaintEvent *event);
|
||||
virtual int metric(QPaintDevice::PaintDeviceMetric metric) const;
|
||||
virtual void exposeEvent(QExposeEvent *);
|
||||
virtual bool event(QEvent *event);
|
||||
};
|
||||
|
||||
%End
|
||||
@@ -0,0 +1,196 @@
|
||||
// qpaintengine.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QTextItem
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qpaintengine.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum RenderFlag
|
||||
{
|
||||
RightToLeft,
|
||||
Overline,
|
||||
Underline,
|
||||
StrikeOut,
|
||||
};
|
||||
|
||||
typedef QFlags<QTextItem::RenderFlag> RenderFlags;
|
||||
qreal descent() const;
|
||||
qreal ascent() const;
|
||||
qreal width() const;
|
||||
QTextItem::RenderFlags renderFlags() const;
|
||||
QString text() const;
|
||||
QFont font() const;
|
||||
};
|
||||
|
||||
QFlags<QTextItem::RenderFlag> operator|(QTextItem::RenderFlag f1, QFlags<QTextItem::RenderFlag> f2);
|
||||
|
||||
class QPaintEngine
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qpaintengine.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum PaintEngineFeature
|
||||
{
|
||||
PrimitiveTransform,
|
||||
PatternTransform,
|
||||
PixmapTransform,
|
||||
PatternBrush,
|
||||
LinearGradientFill,
|
||||
RadialGradientFill,
|
||||
ConicalGradientFill,
|
||||
AlphaBlend,
|
||||
PorterDuff,
|
||||
PainterPaths,
|
||||
Antialiasing,
|
||||
BrushStroke,
|
||||
ConstantOpacity,
|
||||
MaskedBrush,
|
||||
PaintOutsidePaintEvent,
|
||||
PerspectiveTransform,
|
||||
BlendModes,
|
||||
ObjectBoundingModeGradients,
|
||||
RasterOpModes,
|
||||
AllFeatures,
|
||||
};
|
||||
|
||||
typedef QFlags<QPaintEngine::PaintEngineFeature> PaintEngineFeatures;
|
||||
|
||||
enum DirtyFlag
|
||||
{
|
||||
DirtyPen,
|
||||
DirtyBrush,
|
||||
DirtyBrushOrigin,
|
||||
DirtyFont,
|
||||
DirtyBackground,
|
||||
DirtyBackgroundMode,
|
||||
DirtyTransform,
|
||||
DirtyClipRegion,
|
||||
DirtyClipPath,
|
||||
DirtyHints,
|
||||
DirtyCompositionMode,
|
||||
DirtyClipEnabled,
|
||||
DirtyOpacity,
|
||||
AllDirty,
|
||||
};
|
||||
|
||||
typedef QFlags<QPaintEngine::DirtyFlag> DirtyFlags;
|
||||
|
||||
enum PolygonDrawMode
|
||||
{
|
||||
OddEvenMode,
|
||||
WindingMode,
|
||||
ConvexMode,
|
||||
PolylineMode,
|
||||
};
|
||||
|
||||
explicit QPaintEngine(QPaintEngine::PaintEngineFeatures features = QPaintEngine::PaintEngineFeatures());
|
||||
virtual ~QPaintEngine();
|
||||
bool isActive() const;
|
||||
void setActive(bool newState);
|
||||
virtual bool begin(QPaintDevice *pdev) = 0;
|
||||
virtual bool end() = 0;
|
||||
virtual void updateState(const QPaintEngineState &state /NoCopy/) = 0;
|
||||
virtual void drawRects(const QRect *rects /Array/, int rectCount /ArraySize/);
|
||||
virtual void drawRects(const QRectF *rects /Array/, int rectCount /ArraySize/);
|
||||
virtual void drawLines(const QLine *lines /Array/, int lineCount /ArraySize/);
|
||||
virtual void drawLines(const QLineF *lines /Array/, int lineCount /ArraySize/);
|
||||
virtual void drawEllipse(const QRectF &r);
|
||||
virtual void drawEllipse(const QRect &r);
|
||||
virtual void drawPath(const QPainterPath &path);
|
||||
virtual void drawPoints(const QPointF *points /Array/, int pointCount /ArraySize/);
|
||||
virtual void drawPoints(const QPoint *points /Array/, int pointCount /ArraySize/);
|
||||
virtual void drawPolygon(const QPointF *points /Array/, int pointCount /ArraySize/, QPaintEngine::PolygonDrawMode mode);
|
||||
virtual void drawPolygon(const QPoint *points /Array/, int pointCount /ArraySize/, QPaintEngine::PolygonDrawMode mode);
|
||||
virtual void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) = 0;
|
||||
virtual void drawTextItem(const QPointF &p, const QTextItem &textItem /NoCopy/);
|
||||
virtual void drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &s);
|
||||
virtual void drawImage(const QRectF &r, const QImage &pm, const QRectF &sr, Qt::ImageConversionFlags flags = Qt::AutoColor);
|
||||
void setPaintDevice(QPaintDevice *device);
|
||||
QPaintDevice *paintDevice() const;
|
||||
|
||||
enum Type
|
||||
{
|
||||
X11,
|
||||
Windows,
|
||||
QuickDraw,
|
||||
CoreGraphics,
|
||||
MacPrinter,
|
||||
QWindowSystem,
|
||||
PostScript,
|
||||
OpenGL,
|
||||
Picture,
|
||||
SVG,
|
||||
Raster,
|
||||
Direct3D,
|
||||
Pdf,
|
||||
OpenVG,
|
||||
OpenGL2,
|
||||
PaintBuffer,
|
||||
Blitter,
|
||||
%If (Qt_5_3_0 -)
|
||||
Direct2D,
|
||||
%End
|
||||
User,
|
||||
MaxUser,
|
||||
};
|
||||
|
||||
virtual QPaintEngine::Type type() const = 0;
|
||||
QPainter *painter() const;
|
||||
bool hasFeature(QPaintEngine::PaintEngineFeatures feature) const;
|
||||
|
||||
private:
|
||||
QPaintEngine(const QPaintEngine &);
|
||||
};
|
||||
|
||||
QFlags<QPaintEngine::PaintEngineFeature> operator|(QPaintEngine::PaintEngineFeature f1, QFlags<QPaintEngine::PaintEngineFeature> f2);
|
||||
|
||||
class QPaintEngineState
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qpaintengine.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QPaintEngine::DirtyFlags state() const;
|
||||
QPen pen() const;
|
||||
QBrush brush() const;
|
||||
QPointF brushOrigin() const;
|
||||
QBrush backgroundBrush() const;
|
||||
Qt::BGMode backgroundMode() const;
|
||||
QFont font() const;
|
||||
qreal opacity() const;
|
||||
Qt::ClipOperation clipOperation() const;
|
||||
QRegion clipRegion() const;
|
||||
QPainterPath clipPath() const;
|
||||
bool isClipEnabled() const;
|
||||
QPainter::RenderHints renderHints() const;
|
||||
QPainter::CompositionMode compositionMode() const;
|
||||
QPainter *painter() const;
|
||||
QTransform transform() const;
|
||||
bool brushNeedsResolving() const;
|
||||
bool penNeedsResolving() const;
|
||||
};
|
||||
@@ -0,0 +1,561 @@
|
||||
// qpainter.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QPainter
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qpainter.h>
|
||||
%End
|
||||
|
||||
%TypeCode
|
||||
// Return an array on the heap of class instances extracted from a set of
|
||||
// Python arguments.
|
||||
template<class TYPE>
|
||||
static TYPE *qtgui_inst_array(const TYPE *first, PyObject *t, sipTypeDef *td)
|
||||
{
|
||||
TYPE *arr = new TYPE[1 + PyTuple_Size(t)];
|
||||
|
||||
arr[0] = *first;
|
||||
|
||||
for (Py_ssize_t i = 0; i < PyTuple_Size(t); ++i)
|
||||
{
|
||||
int iserr = 0, state;
|
||||
TYPE *itm;
|
||||
|
||||
itm = reinterpret_cast<TYPE *>(sipForceConvertToType(PyTuple_GetItem(t, i), td, 0, SIP_NOT_NONE, &state, &iserr));
|
||||
|
||||
if (iserr)
|
||||
{
|
||||
sipReleaseType(itm, td, state);
|
||||
|
||||
PyErr_Format(PyExc_TypeError, "each argument must be an instance of %s", sipPyTypeName(sipTypeAsPyTypeObject(td)));
|
||||
|
||||
delete[] arr;
|
||||
return 0;
|
||||
}
|
||||
|
||||
arr[1 + i] = *itm;
|
||||
|
||||
sipReleaseType(itm, td, state);
|
||||
}
|
||||
|
||||
return arr;
|
||||
}
|
||||
%End
|
||||
|
||||
public:
|
||||
enum RenderHint
|
||||
{
|
||||
Antialiasing,
|
||||
TextAntialiasing,
|
||||
SmoothPixmapTransform,
|
||||
HighQualityAntialiasing,
|
||||
NonCosmeticDefaultPen,
|
||||
Qt4CompatiblePainting,
|
||||
%If (Qt_5_13_0 -)
|
||||
LosslessImageRendering,
|
||||
%End
|
||||
};
|
||||
|
||||
typedef QFlags<QPainter::RenderHint> RenderHints;
|
||||
QPainter();
|
||||
explicit QPainter(QPaintDevice *);
|
||||
~QPainter();
|
||||
SIP_PYOBJECT __enter__();
|
||||
%MethodCode
|
||||
// Check a device was passed.
|
||||
if (sipCpp->isActive())
|
||||
{
|
||||
// Just return a reference to self.
|
||||
sipRes = sipSelf;
|
||||
Py_INCREF(sipRes);
|
||||
}
|
||||
else
|
||||
{
|
||||
PyErr_SetString(PyExc_ValueError, "QPainter must be created with a device");
|
||||
sipRes = 0;
|
||||
}
|
||||
%End
|
||||
|
||||
void __exit__(SIP_PYOBJECT type, SIP_PYOBJECT value, SIP_PYOBJECT traceback);
|
||||
%MethodCode
|
||||
sipCpp->end();
|
||||
%End
|
||||
|
||||
QPaintDevice *device() const;
|
||||
bool begin(QPaintDevice *);
|
||||
bool end();
|
||||
bool isActive() const;
|
||||
|
||||
enum CompositionMode
|
||||
{
|
||||
CompositionMode_SourceOver,
|
||||
CompositionMode_DestinationOver,
|
||||
CompositionMode_Clear,
|
||||
CompositionMode_Source,
|
||||
CompositionMode_Destination,
|
||||
CompositionMode_SourceIn,
|
||||
CompositionMode_DestinationIn,
|
||||
CompositionMode_SourceOut,
|
||||
CompositionMode_DestinationOut,
|
||||
CompositionMode_SourceAtop,
|
||||
CompositionMode_DestinationAtop,
|
||||
CompositionMode_Xor,
|
||||
CompositionMode_Plus,
|
||||
CompositionMode_Multiply,
|
||||
CompositionMode_Screen,
|
||||
CompositionMode_Overlay,
|
||||
CompositionMode_Darken,
|
||||
CompositionMode_Lighten,
|
||||
CompositionMode_ColorDodge,
|
||||
CompositionMode_ColorBurn,
|
||||
CompositionMode_HardLight,
|
||||
CompositionMode_SoftLight,
|
||||
CompositionMode_Difference,
|
||||
CompositionMode_Exclusion,
|
||||
RasterOp_SourceOrDestination,
|
||||
RasterOp_SourceAndDestination,
|
||||
RasterOp_SourceXorDestination,
|
||||
RasterOp_NotSourceAndNotDestination,
|
||||
RasterOp_NotSourceOrNotDestination,
|
||||
RasterOp_NotSourceXorDestination,
|
||||
RasterOp_NotSource,
|
||||
RasterOp_NotSourceAndDestination,
|
||||
RasterOp_SourceAndNotDestination,
|
||||
RasterOp_NotSourceOrDestination,
|
||||
RasterOp_SourceOrNotDestination,
|
||||
RasterOp_ClearDestination,
|
||||
RasterOp_SetDestination,
|
||||
RasterOp_NotDestination,
|
||||
};
|
||||
|
||||
void setCompositionMode(QPainter::CompositionMode mode);
|
||||
QPainter::CompositionMode compositionMode() const;
|
||||
const QFont &font() const;
|
||||
void setFont(const QFont &f);
|
||||
QFontMetrics fontMetrics() const;
|
||||
QFontInfo fontInfo() const;
|
||||
void setPen(const QColor &color);
|
||||
void setPen(const QPen &pen);
|
||||
void setPen(Qt::PenStyle style);
|
||||
const QPen &pen() const;
|
||||
void setBrush(const QBrush &brush);
|
||||
void setBrush(Qt::BrushStyle style);
|
||||
const QBrush &brush() const;
|
||||
void setBackgroundMode(Qt::BGMode mode);
|
||||
Qt::BGMode backgroundMode() const;
|
||||
QPoint brushOrigin() const;
|
||||
void setBrushOrigin(const QPointF &);
|
||||
void setBackground(const QBrush &bg);
|
||||
const QBrush &background() const;
|
||||
QRegion clipRegion() const;
|
||||
QPainterPath clipPath() const;
|
||||
void setClipRect(const QRectF &rectangle, Qt::ClipOperation operation = Qt::ReplaceClip);
|
||||
void setClipRegion(const QRegion ®ion, Qt::ClipOperation operation = Qt::ReplaceClip);
|
||||
void setClipPath(const QPainterPath &path, Qt::ClipOperation operation = Qt::ReplaceClip);
|
||||
void setClipping(bool enable);
|
||||
bool hasClipping() const;
|
||||
void save();
|
||||
void restore();
|
||||
void scale(qreal sx, qreal sy);
|
||||
void shear(qreal sh, qreal sv);
|
||||
void rotate(qreal a);
|
||||
void translate(const QPointF &offset);
|
||||
QRect window() const;
|
||||
void setWindow(const QRect &window);
|
||||
QRect viewport() const;
|
||||
void setViewport(const QRect &viewport);
|
||||
void setViewTransformEnabled(bool enable);
|
||||
bool viewTransformEnabled() const;
|
||||
void strokePath(const QPainterPath &path, const QPen &pen);
|
||||
void fillPath(const QPainterPath &path, const QBrush &brush);
|
||||
void drawPath(const QPainterPath &path);
|
||||
void drawPoints(const QPolygonF &points);
|
||||
void drawPoints(const QPolygon &points);
|
||||
void drawPoints(const QPointF *points /Array/, int pointCount /ArraySize/);
|
||||
void drawPoints(const QPointF *point, ... /TypeHint="QPointF"/);
|
||||
%MethodCode
|
||||
QPointF *points = qtgui_inst_array<QPointF>(a0, a1, sipType_QPointF);
|
||||
|
||||
if (points)
|
||||
{
|
||||
sipCpp->drawPoints(points, 1 + PyTuple_Size(a1));
|
||||
delete[] points;
|
||||
}
|
||||
else
|
||||
sipIsErr = 1;
|
||||
%End
|
||||
|
||||
void drawPoints(const QPoint *points /Array/, int pointCount /ArraySize/);
|
||||
void drawPoints(const QPoint *point, ... /TypeHint="QPoint"/);
|
||||
%MethodCode
|
||||
QPoint *points = qtgui_inst_array<QPoint>(a0, a1, sipType_QPoint);
|
||||
|
||||
if (points)
|
||||
{
|
||||
sipCpp->drawPoints(points, 1 + PyTuple_Size(a1));
|
||||
delete[] points;
|
||||
}
|
||||
else
|
||||
sipIsErr = 1;
|
||||
%End
|
||||
|
||||
void drawLines(const QLineF *lines /Array/, int lineCount /ArraySize/);
|
||||
void drawLines(const QLineF *line, ... /TypeHint="QLineF"/);
|
||||
%MethodCode
|
||||
QLineF *lines = qtgui_inst_array<QLineF>(a0, a1, sipType_QLineF);
|
||||
|
||||
if (lines)
|
||||
{
|
||||
sipCpp->drawLines(lines, 1 + PyTuple_Size(a1));
|
||||
delete[] lines;
|
||||
}
|
||||
else
|
||||
sipIsErr = 1;
|
||||
%End
|
||||
|
||||
void drawLines(const QPointF *pointPairs /Array/, int lineCount /ArraySize/);
|
||||
%MethodCode
|
||||
sipCpp->drawLines(a0, a1 / 2);
|
||||
%End
|
||||
|
||||
void drawLines(const QPointF *pointPair, ... /TypeHint="QPointF"/);
|
||||
%MethodCode
|
||||
QPointF *pairs = qtgui_inst_array<QPointF>(a0, a1, sipType_QPointF);
|
||||
|
||||
if (pairs)
|
||||
{
|
||||
sipCpp->drawLines(pairs, (1 + PyTuple_Size(a1)) / 2);
|
||||
delete[] pairs;
|
||||
}
|
||||
else
|
||||
sipIsErr = 1;
|
||||
%End
|
||||
|
||||
void drawLines(const QLine *lines /Array/, int lineCount /ArraySize/);
|
||||
void drawLines(const QLine *line, ... /TypeHint="QLine"/);
|
||||
%MethodCode
|
||||
QLine *lines = qtgui_inst_array<QLine>(a0, a1, sipType_QLine);
|
||||
|
||||
if (lines)
|
||||
{
|
||||
sipCpp->drawLines(lines, 1 + PyTuple_Size(a1));
|
||||
delete[] lines;
|
||||
}
|
||||
else
|
||||
sipIsErr = 1;
|
||||
%End
|
||||
|
||||
void drawLines(const QPoint *pointPairs /Array/, int lineCount /ArraySize/);
|
||||
%MethodCode
|
||||
sipCpp->drawLines(a0, a1 / 2);
|
||||
%End
|
||||
|
||||
void drawLines(const QPoint *pointPair, ... /TypeHint="QPoint"/);
|
||||
%MethodCode
|
||||
QPoint *pairs = qtgui_inst_array<QPoint>(a0, a1, sipType_QPoint);
|
||||
|
||||
if (pairs)
|
||||
{
|
||||
sipCpp->drawLines(pairs, (1 + PyTuple_Size(a1)) / 2);
|
||||
delete[] pairs;
|
||||
}
|
||||
else
|
||||
sipIsErr = 1;
|
||||
%End
|
||||
|
||||
void drawRects(const QRectF *rects /Array/, int rectCount /ArraySize/);
|
||||
void drawRects(const QRectF *rect, ... /TypeHint="QRectF"/);
|
||||
%MethodCode
|
||||
QRectF *rects = qtgui_inst_array<QRectF>(a0, a1, sipType_QRectF);
|
||||
|
||||
if (rects)
|
||||
{
|
||||
sipCpp->drawRects(rects, 1 + PyTuple_Size(a1));
|
||||
delete[] rects;
|
||||
}
|
||||
else
|
||||
sipIsErr = 1;
|
||||
%End
|
||||
|
||||
void drawRects(const QRect *rects /Array/, int rectCount /ArraySize/);
|
||||
void drawRects(const QRect *rect, ... /TypeHint="QRect"/);
|
||||
%MethodCode
|
||||
QRect *rects = qtgui_inst_array<QRect>(a0, a1, sipType_QRect);
|
||||
|
||||
if (rects)
|
||||
{
|
||||
sipCpp->drawRects(rects, 1 + PyTuple_Size(a1));
|
||||
delete[] rects;
|
||||
}
|
||||
else
|
||||
sipIsErr = 1;
|
||||
%End
|
||||
|
||||
void drawEllipse(const QRectF &r);
|
||||
void drawEllipse(const QRect &r);
|
||||
void drawPolyline(const QPolygonF &polyline);
|
||||
void drawPolyline(const QPolygon &polyline);
|
||||
void drawPolyline(const QPointF *points /Array/, int pointCount /ArraySize/);
|
||||
void drawPolyline(const QPointF *point, ... /TypeHint="QPointF"/);
|
||||
%MethodCode
|
||||
QPointF *points = qtgui_inst_array<QPointF>(a0, a1, sipType_QPointF);
|
||||
|
||||
if (points)
|
||||
{
|
||||
sipCpp->drawPolyline(points, 1 + PyTuple_Size(a1));
|
||||
delete[] points;
|
||||
}
|
||||
else
|
||||
sipIsErr = 1;
|
||||
%End
|
||||
|
||||
void drawPolyline(const QPoint *points /Array/, int pointCount /ArraySize/);
|
||||
void drawPolyline(const QPoint *point, ... /TypeHint="QPoint"/);
|
||||
%MethodCode
|
||||
QPoint *points = qtgui_inst_array<QPoint>(a0, a1, sipType_QPoint);
|
||||
|
||||
if (points)
|
||||
{
|
||||
sipCpp->drawPolyline(points, 1 + PyTuple_Size(a1));
|
||||
delete[] points;
|
||||
}
|
||||
else
|
||||
sipIsErr = 1;
|
||||
%End
|
||||
|
||||
void drawPolygon(const QPolygonF &points, Qt::FillRule fillRule = Qt::OddEvenFill);
|
||||
void drawPolygon(const QPolygon &points, Qt::FillRule fillRule = Qt::OddEvenFill);
|
||||
void drawPolygon(const QPointF *points /Array/, int pointCount /ArraySize/, Qt::FillRule fillRule = Qt::OddEvenFill);
|
||||
void drawPolygon(const QPointF *point, ... /TypeHint="QPointF"/);
|
||||
%MethodCode
|
||||
QPointF *points = qtgui_inst_array<QPointF>(a0, a1, sipType_QPointF);
|
||||
|
||||
if (points)
|
||||
{
|
||||
sipCpp->drawPolygon(points, 1 + PyTuple_Size(a1));
|
||||
delete[] points;
|
||||
}
|
||||
else
|
||||
sipIsErr = 1;
|
||||
%End
|
||||
|
||||
void drawPolygon(const QPoint *points /Array/, int pointCount /ArraySize/, Qt::FillRule fillRule = Qt::OddEvenFill);
|
||||
void drawPolygon(const QPoint *point, ... /TypeHint="QPoint"/);
|
||||
%MethodCode
|
||||
QPoint *points = qtgui_inst_array<QPoint>(a0, a1, sipType_QPoint);
|
||||
|
||||
if (points)
|
||||
{
|
||||
sipCpp->drawPolygon(points, 1 + PyTuple_Size(a1));
|
||||
delete[] points;
|
||||
}
|
||||
else
|
||||
sipIsErr = 1;
|
||||
%End
|
||||
|
||||
void drawConvexPolygon(const QPolygonF &poly);
|
||||
void drawConvexPolygon(const QPolygon &poly);
|
||||
void drawConvexPolygon(const QPointF *points /Array/, int pointCount /ArraySize/);
|
||||
void drawConvexPolygon(const QPointF *point, ... /TypeHint="QPointF"/);
|
||||
%MethodCode
|
||||
QPointF *points = qtgui_inst_array<QPointF>(a0, a1, sipType_QPointF);
|
||||
|
||||
if (points)
|
||||
{
|
||||
sipCpp->drawConvexPolygon(points, 1 + PyTuple_Size(a1));
|
||||
delete[] points;
|
||||
}
|
||||
else
|
||||
sipIsErr = 1;
|
||||
%End
|
||||
|
||||
void drawConvexPolygon(const QPoint *points /Array/, int pointCount /ArraySize/);
|
||||
void drawConvexPolygon(const QPoint *point, ... /TypeHint="QPoint"/);
|
||||
%MethodCode
|
||||
QPoint *points = qtgui_inst_array<QPoint>(a0, a1, sipType_QPoint);
|
||||
|
||||
if (points)
|
||||
{
|
||||
sipCpp->drawConvexPolygon(points, 1 + PyTuple_Size(a1));
|
||||
delete[] points;
|
||||
}
|
||||
else
|
||||
sipIsErr = 1;
|
||||
%End
|
||||
|
||||
void drawArc(const QRectF &rect, int a, int alen);
|
||||
void drawPie(const QRectF &rect, int a, int alen);
|
||||
void drawChord(const QRectF &rect, int a, int alen);
|
||||
void drawTiledPixmap(const QRectF &rectangle, const QPixmap &pixmap, const QPointF &pos = QPointF());
|
||||
void drawPicture(const QPointF &p, const QPicture &picture);
|
||||
void drawPixmap(const QRectF &targetRect, const QPixmap &pixmap, const QRectF &sourceRect);
|
||||
void setLayoutDirection(Qt::LayoutDirection direction);
|
||||
Qt::LayoutDirection layoutDirection() const;
|
||||
void drawText(const QPointF &p, const QString &s);
|
||||
void drawText(const QRectF &rectangle, int flags, const QString &text, QRectF *boundingRect /Out/ = 0);
|
||||
void drawText(const QRect &rectangle, int flags, const QString &text, QRect *boundingRect /Out/ = 0);
|
||||
void drawText(const QRectF &rectangle, const QString &text, const QTextOption &option = QTextOption());
|
||||
QRectF boundingRect(const QRectF &rect, int flags, const QString &text);
|
||||
QRect boundingRect(const QRect &rect, int flags, const QString &text);
|
||||
QRectF boundingRect(const QRectF &rectangle, const QString &text, const QTextOption &option = QTextOption());
|
||||
void fillRect(const QRectF &, const QBrush &);
|
||||
void fillRect(const QRect &, const QBrush &);
|
||||
void eraseRect(const QRectF &);
|
||||
void setRenderHint(QPainter::RenderHint hint, bool on = true);
|
||||
QPainter::RenderHints renderHints() const;
|
||||
void setRenderHints(QPainter::RenderHints hints, bool on = true);
|
||||
QPaintEngine *paintEngine() const;
|
||||
void drawLine(const QLineF &l);
|
||||
void drawLine(const QLine &line);
|
||||
void drawLine(int x1, int y1, int x2, int y2);
|
||||
void drawLine(const QPoint &p1, const QPoint &p2);
|
||||
void drawLine(const QPointF &p1, const QPointF &p2);
|
||||
void drawRect(const QRectF &rect);
|
||||
void drawRect(int x, int y, int w, int h);
|
||||
void drawRect(const QRect &r);
|
||||
void drawPoint(const QPointF &p);
|
||||
void drawPoint(int x, int y);
|
||||
void drawPoint(const QPoint &p);
|
||||
void drawEllipse(int x, int y, int w, int h);
|
||||
void drawArc(const QRect &r, int a, int alen);
|
||||
void drawArc(int x, int y, int w, int h, int a, int alen);
|
||||
void drawPie(const QRect &rect, int a, int alen);
|
||||
void drawPie(int x, int y, int w, int h, int a, int alen);
|
||||
void drawChord(const QRect &rect, int a, int alen);
|
||||
void drawChord(int x, int y, int w, int h, int a, int alen);
|
||||
void setClipRect(int x, int y, int width, int height, Qt::ClipOperation operation = Qt::ReplaceClip);
|
||||
void setClipRect(const QRect &rectangle, Qt::ClipOperation operation = Qt::ReplaceClip);
|
||||
void eraseRect(const QRect &rect);
|
||||
void eraseRect(int x, int y, int w, int h);
|
||||
void fillRect(int x, int y, int w, int h, const QBrush &b);
|
||||
void setBrushOrigin(int x, int y);
|
||||
void setBrushOrigin(const QPoint &p);
|
||||
void drawTiledPixmap(const QRect &rectangle, const QPixmap &pixmap, const QPoint &pos = QPoint());
|
||||
void drawTiledPixmap(int x, int y, int width, int height, const QPixmap &pixmap, int sx = 0, int sy = 0);
|
||||
void drawPixmap(const QRect &targetRect, const QPixmap &pixmap, const QRect &sourceRect);
|
||||
void drawPixmap(const QPointF &p, const QPixmap &pm);
|
||||
void drawPixmap(const QPoint &p, const QPixmap &pm);
|
||||
void drawPixmap(const QRect &r, const QPixmap &pm);
|
||||
void drawPixmap(int x, int y, const QPixmap &pm);
|
||||
void drawPixmap(int x, int y, int w, int h, const QPixmap &pm);
|
||||
void drawPixmap(int x, int y, int w, int h, const QPixmap &pm, int sx, int sy, int sw, int sh);
|
||||
void drawPixmap(int x, int y, const QPixmap &pm, int sx, int sy, int sw, int sh);
|
||||
void drawPixmap(const QPointF &p, const QPixmap &pm, const QRectF &sr);
|
||||
void drawPixmap(const QPoint &p, const QPixmap &pm, const QRect &sr);
|
||||
void drawImage(const QRectF &r, const QImage &image);
|
||||
void drawImage(const QRect &r, const QImage &image);
|
||||
void drawImage(const QPointF &p, const QImage &image);
|
||||
void drawImage(const QPoint &p, const QImage &image);
|
||||
void drawImage(int x, int y, const QImage &image, int sx = 0, int sy = 0, int sw = -1, int sh = -1, Qt::ImageConversionFlags flags = Qt::ImageConversionFlag::AutoColor);
|
||||
void drawText(const QPoint &p, const QString &s);
|
||||
void drawText(int x, int y, int width, int height, int flags, const QString &text, QRect *boundingRect /Out/ = 0);
|
||||
void drawText(int x, int y, const QString &s);
|
||||
QRect boundingRect(int x, int y, int w, int h, int flags, const QString &text);
|
||||
qreal opacity() const;
|
||||
void setOpacity(qreal opacity);
|
||||
void translate(qreal dx, qreal dy);
|
||||
void translate(const QPoint &offset);
|
||||
void setViewport(int x, int y, int w, int h);
|
||||
void setWindow(int x, int y, int w, int h);
|
||||
bool worldMatrixEnabled() const;
|
||||
void setWorldMatrixEnabled(bool enabled);
|
||||
void drawPicture(int x, int y, const QPicture &p);
|
||||
void drawPicture(const QPoint &pt, const QPicture &p);
|
||||
void setTransform(const QTransform &transform, bool combine = false);
|
||||
const QTransform &transform() const;
|
||||
const QTransform &deviceTransform() const;
|
||||
void resetTransform();
|
||||
void setWorldTransform(const QTransform &matrix, bool combine = false);
|
||||
const QTransform &worldTransform() const;
|
||||
QTransform combinedTransform() const;
|
||||
bool testRenderHint(QPainter::RenderHint hint) const;
|
||||
void drawRoundedRect(const QRectF &rect, qreal xRadius, qreal yRadius, Qt::SizeMode mode = Qt::AbsoluteSize);
|
||||
void drawRoundedRect(int x, int y, int w, int h, qreal xRadius, qreal yRadius, Qt::SizeMode mode = Qt::AbsoluteSize);
|
||||
void drawRoundedRect(const QRect &rect, qreal xRadius, qreal yRadius, Qt::SizeMode mode = Qt::AbsoluteSize);
|
||||
void drawEllipse(const QPointF ¢er, qreal rx, qreal ry);
|
||||
void drawEllipse(const QPoint ¢er, int rx, int ry);
|
||||
void fillRect(const QRectF &, const QColor &color);
|
||||
void fillRect(const QRect &, const QColor &color);
|
||||
void fillRect(int x, int y, int w, int h, const QColor &b);
|
||||
void fillRect(int x, int y, int w, int h, Qt::GlobalColor c);
|
||||
void fillRect(const QRect &r, Qt::GlobalColor c);
|
||||
void fillRect(const QRectF &r, Qt::GlobalColor c);
|
||||
void fillRect(int x, int y, int w, int h, Qt::BrushStyle style);
|
||||
void fillRect(const QRect &r, Qt::BrushStyle style);
|
||||
void fillRect(const QRectF &r, Qt::BrushStyle style);
|
||||
void beginNativePainting();
|
||||
void endNativePainting();
|
||||
|
||||
class PixmapFragment
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qpainter.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
qreal x;
|
||||
qreal y;
|
||||
qreal sourceLeft;
|
||||
qreal sourceTop;
|
||||
qreal width;
|
||||
qreal height;
|
||||
qreal scaleX;
|
||||
qreal scaleY;
|
||||
qreal rotation;
|
||||
qreal opacity;
|
||||
static QPainter::PixmapFragment create(const QPointF &pos, const QRectF &sourceRect, qreal scaleX = 1, qreal scaleY = 1, qreal rotation = 0, qreal opacity = 1) /Factory/;
|
||||
};
|
||||
|
||||
enum PixmapFragmentHint
|
||||
{
|
||||
OpaqueHint,
|
||||
};
|
||||
|
||||
typedef QFlags<QPainter::PixmapFragmentHint> PixmapFragmentHints;
|
||||
void drawPixmapFragments(const QPainter::PixmapFragment *fragments /Array/, int fragmentCount /ArraySize/, const QPixmap &pixmap, QFlags<QPainter::PixmapFragmentHint> hints = 0);
|
||||
void drawStaticText(const QPointF &topLeftPosition, const QStaticText &staticText);
|
||||
void drawStaticText(const QPoint &p, const QStaticText &staticText);
|
||||
void drawStaticText(int x, int y, const QStaticText &staticText);
|
||||
QRectF clipBoundingRect() const;
|
||||
%If (PyQt_RawFont)
|
||||
void drawGlyphRun(const QPointF &position, const QGlyphRun &glyphRun);
|
||||
%End
|
||||
%If (Qt_5_12_0 -)
|
||||
void fillRect(int x, int y, int w, int h, QGradient::Preset preset);
|
||||
%End
|
||||
%If (Qt_5_12_0 -)
|
||||
void fillRect(const QRect &r, QGradient::Preset preset);
|
||||
%End
|
||||
%If (Qt_5_12_0 -)
|
||||
void fillRect(const QRectF &r, QGradient::Preset preset);
|
||||
%End
|
||||
void drawImage(const QRectF &targetRect, const QImage &image, const QRectF &sourceRect, Qt::ImageConversionFlags flags = Qt::ImageConversionFlag::AutoColor);
|
||||
void drawImage(const QRect &targetRect, const QImage &image, const QRect &sourceRect, Qt::ImageConversionFlags flags = Qt::ImageConversionFlag::AutoColor);
|
||||
void drawImage(const QPointF &p, const QImage &image, const QRectF &sr, Qt::ImageConversionFlags flags = Qt::ImageConversionFlag::AutoColor);
|
||||
void drawImage(const QPoint &p, const QImage &image, const QRect &sr, Qt::ImageConversionFlags flags = Qt::ImageConversionFlag::AutoColor);
|
||||
|
||||
private:
|
||||
QPainter(const QPainter &);
|
||||
};
|
||||
|
||||
QFlags<QPainter::RenderHint> operator|(QPainter::RenderHint f1, QFlags<QPainter::RenderHint> f2);
|
||||
@@ -0,0 +1,188 @@
|
||||
// qpainterpath.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QPainterPath
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qpainterpath.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum ElementType
|
||||
{
|
||||
MoveToElement,
|
||||
LineToElement,
|
||||
CurveToElement,
|
||||
CurveToDataElement,
|
||||
};
|
||||
|
||||
class Element
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qpainterpath.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
qreal x;
|
||||
qreal y;
|
||||
QPainterPath::ElementType type;
|
||||
bool isMoveTo() const;
|
||||
bool isLineTo() const;
|
||||
bool isCurveTo() const;
|
||||
bool operator==(const QPainterPath::Element &e) const;
|
||||
bool operator!=(const QPainterPath::Element &e) const;
|
||||
operator QPointF() const;
|
||||
};
|
||||
|
||||
QPainterPath();
|
||||
explicit QPainterPath(const QPointF &startPoint);
|
||||
QPainterPath(const QPainterPath &other);
|
||||
~QPainterPath();
|
||||
void closeSubpath();
|
||||
void moveTo(const QPointF &p);
|
||||
void lineTo(const QPointF &p);
|
||||
void arcTo(const QRectF &rect, qreal startAngle, qreal arcLength);
|
||||
void cubicTo(const QPointF &ctrlPt1, const QPointF &ctrlPt2, const QPointF &endPt);
|
||||
void quadTo(const QPointF &ctrlPt, const QPointF &endPt);
|
||||
QPointF currentPosition() const;
|
||||
void addRect(const QRectF &rect);
|
||||
void addEllipse(const QRectF &rect);
|
||||
void addPolygon(const QPolygonF &polygon);
|
||||
void addText(const QPointF &point, const QFont &f, const QString &text);
|
||||
void addPath(const QPainterPath &path);
|
||||
void addRegion(const QRegion ®ion);
|
||||
void connectPath(const QPainterPath &path);
|
||||
bool contains(const QPointF &pt) const;
|
||||
bool contains(const QRectF &rect) const;
|
||||
bool intersects(const QRectF &rect) const;
|
||||
QRectF boundingRect() const;
|
||||
QRectF controlPointRect() const;
|
||||
Qt::FillRule fillRule() const;
|
||||
void setFillRule(Qt::FillRule fillRule);
|
||||
QPainterPath toReversed() const;
|
||||
QList<QPolygonF> toSubpathPolygons() const;
|
||||
%MethodCode
|
||||
sipRes = new QList<QPolygonF>(sipCpp->toSubpathPolygons());
|
||||
%End
|
||||
|
||||
QList<QPolygonF> toFillPolygons() const;
|
||||
%MethodCode
|
||||
sipRes = new QList<QPolygonF>(sipCpp->toFillPolygons());
|
||||
%End
|
||||
|
||||
QPolygonF toFillPolygon() const;
|
||||
%MethodCode
|
||||
sipRes = new QPolygonF(sipCpp->toFillPolygon());
|
||||
%End
|
||||
|
||||
bool operator==(const QPainterPath &other) const;
|
||||
bool operator!=(const QPainterPath &other) const;
|
||||
void moveTo(qreal x, qreal y);
|
||||
void arcMoveTo(const QRectF &rect, qreal angle);
|
||||
void arcMoveTo(qreal x, qreal y, qreal w, qreal h, qreal angle);
|
||||
void arcTo(qreal x, qreal y, qreal w, qreal h, qreal startAngle, qreal arcLenght);
|
||||
void lineTo(qreal x, qreal y);
|
||||
void cubicTo(qreal ctrlPt1x, qreal ctrlPt1y, qreal ctrlPt2x, qreal ctrlPt2y, qreal endPtx, qreal endPty);
|
||||
void quadTo(qreal ctrlPtx, qreal ctrlPty, qreal endPtx, qreal endPty);
|
||||
void addEllipse(qreal x, qreal y, qreal w, qreal h);
|
||||
void addRect(qreal x, qreal y, qreal w, qreal h);
|
||||
void addText(qreal x, qreal y, const QFont &f, const QString &text);
|
||||
bool isEmpty() const;
|
||||
int elementCount() const;
|
||||
QPainterPath::Element elementAt(int i) const;
|
||||
void setElementPositionAt(int i, qreal x, qreal y);
|
||||
QList<QPolygonF> toSubpathPolygons(const QTransform &matrix) const;
|
||||
QList<QPolygonF> toFillPolygons(const QTransform &matrix) const;
|
||||
QPolygonF toFillPolygon(const QTransform &matrix) const;
|
||||
qreal length() const;
|
||||
qreal percentAtLength(qreal t) const;
|
||||
QPointF pointAtPercent(qreal t) const;
|
||||
qreal angleAtPercent(qreal t) const;
|
||||
qreal slopeAtPercent(qreal t) const;
|
||||
bool intersects(const QPainterPath &p) const;
|
||||
bool contains(const QPainterPath &p) const;
|
||||
QPainterPath united(const QPainterPath &r) const;
|
||||
QPainterPath intersected(const QPainterPath &r) const;
|
||||
QPainterPath subtracted(const QPainterPath &r) const;
|
||||
void addRoundedRect(const QRectF &rect, qreal xRadius, qreal yRadius, Qt::SizeMode mode = Qt::AbsoluteSize);
|
||||
void addRoundedRect(qreal x, qreal y, qreal w, qreal h, qreal xRadius, qreal yRadius, Qt::SizeMode mode = Qt::AbsoluteSize);
|
||||
void addEllipse(const QPointF ¢er, qreal rx, qreal ry);
|
||||
QPainterPath simplified() const;
|
||||
QPainterPath operator&(const QPainterPath &other) const;
|
||||
QPainterPath operator|(const QPainterPath &other) const;
|
||||
QPainterPath operator+(const QPainterPath &other) const;
|
||||
QPainterPath operator-(const QPainterPath &other) const;
|
||||
QPainterPath &operator&=(const QPainterPath &other);
|
||||
QPainterPath &operator|=(const QPainterPath &other);
|
||||
QPainterPath &operator+=(const QPainterPath &other);
|
||||
QPainterPath &operator-=(const QPainterPath &other);
|
||||
void translate(qreal dx, qreal dy);
|
||||
QPainterPath translated(qreal dx, qreal dy) const;
|
||||
void translate(const QPointF &offset);
|
||||
QPainterPath translated(const QPointF &offset) const;
|
||||
void swap(QPainterPath &other /Constrained/);
|
||||
%If (Qt_5_13_0 -)
|
||||
void clear();
|
||||
%End
|
||||
%If (Qt_5_13_0 -)
|
||||
void reserve(int size);
|
||||
%End
|
||||
%If (Qt_5_13_0 -)
|
||||
int capacity() const;
|
||||
%End
|
||||
};
|
||||
|
||||
QDataStream &operator<<(QDataStream &, const QPainterPath & /Constrained/) /ReleaseGIL/;
|
||||
QDataStream &operator>>(QDataStream &, QPainterPath & /Constrained/) /ReleaseGIL/;
|
||||
|
||||
class QPainterPathStroker
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qpainterpath.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QPainterPathStroker();
|
||||
%If (Qt_5_3_0 -)
|
||||
explicit QPainterPathStroker(const QPen &pen);
|
||||
%End
|
||||
~QPainterPathStroker();
|
||||
void setWidth(qreal width);
|
||||
qreal width() const;
|
||||
void setCapStyle(Qt::PenCapStyle style);
|
||||
Qt::PenCapStyle capStyle() const;
|
||||
void setJoinStyle(Qt::PenJoinStyle style);
|
||||
Qt::PenJoinStyle joinStyle() const;
|
||||
void setMiterLimit(qreal length);
|
||||
qreal miterLimit() const;
|
||||
void setCurveThreshold(qreal threshold);
|
||||
qreal curveThreshold() const;
|
||||
void setDashPattern(Qt::PenStyle);
|
||||
void setDashPattern(const QVector<qreal> &dashPattern);
|
||||
QVector<qreal> dashPattern() const;
|
||||
QPainterPath createStroke(const QPainterPath &path) const;
|
||||
void setDashOffset(qreal offset);
|
||||
qreal dashOffset() const;
|
||||
|
||||
private:
|
||||
QPainterPathStroker(const QPainterPathStroker &);
|
||||
};
|
||||
@@ -0,0 +1,133 @@
|
||||
// qpalette.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QPalette
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qpalette.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QPalette();
|
||||
QPalette(const QColor &button);
|
||||
QPalette(Qt::GlobalColor button);
|
||||
QPalette(const QColor &button, const QColor &background);
|
||||
QPalette(const QBrush &foreground, const QBrush &button, const QBrush &light, const QBrush &dark, const QBrush &mid, const QBrush &text, const QBrush &bright_text, const QBrush &base, const QBrush &background);
|
||||
QPalette(const QPalette &palette);
|
||||
QPalette(const QVariant &variant /GetWrapper/) /NoDerived/;
|
||||
%MethodCode
|
||||
if (a0->canConvert<QPalette>())
|
||||
sipCpp = new QPalette(a0->value<QPalette>());
|
||||
else
|
||||
sipError = sipBadCallableArg(0, a0Wrapper);
|
||||
%End
|
||||
|
||||
~QPalette();
|
||||
|
||||
enum ColorGroup
|
||||
{
|
||||
Active,
|
||||
Disabled,
|
||||
Inactive,
|
||||
NColorGroups,
|
||||
Current,
|
||||
All,
|
||||
Normal,
|
||||
};
|
||||
|
||||
enum ColorRole
|
||||
{
|
||||
WindowText,
|
||||
Foreground,
|
||||
Button,
|
||||
Light,
|
||||
Midlight,
|
||||
Dark,
|
||||
Mid,
|
||||
Text,
|
||||
BrightText,
|
||||
ButtonText,
|
||||
Base,
|
||||
Window,
|
||||
Background,
|
||||
Shadow,
|
||||
Highlight,
|
||||
HighlightedText,
|
||||
Link,
|
||||
LinkVisited,
|
||||
AlternateBase,
|
||||
ToolTipBase,
|
||||
ToolTipText,
|
||||
%If (Qt_5_12_0 -)
|
||||
PlaceholderText,
|
||||
%End
|
||||
NoRole,
|
||||
NColorRoles,
|
||||
};
|
||||
|
||||
QPalette::ColorGroup currentColorGroup() const;
|
||||
void setCurrentColorGroup(QPalette::ColorGroup cg);
|
||||
const QColor &color(QPalette::ColorGroup cg, QPalette::ColorRole cr) const;
|
||||
const QBrush &brush(QPalette::ColorGroup cg, QPalette::ColorRole cr) const;
|
||||
void setBrush(QPalette::ColorGroup cg, QPalette::ColorRole cr, const QBrush &brush);
|
||||
void setColorGroup(QPalette::ColorGroup cr, const QBrush &foreground, const QBrush &button, const QBrush &light, const QBrush &dark, const QBrush &mid, const QBrush &text, const QBrush &bright_text, const QBrush &base, const QBrush &background);
|
||||
bool isEqual(QPalette::ColorGroup cr1, QPalette::ColorGroup cr2) const;
|
||||
const QColor &color(QPalette::ColorRole cr) const;
|
||||
const QBrush &brush(QPalette::ColorRole cr) const;
|
||||
const QBrush &windowText() const;
|
||||
const QBrush &button() const;
|
||||
const QBrush &light() const;
|
||||
const QBrush &dark() const;
|
||||
const QBrush &mid() const;
|
||||
const QBrush &text() const;
|
||||
const QBrush &base() const;
|
||||
const QBrush &alternateBase() const;
|
||||
const QBrush &window() const;
|
||||
const QBrush &midlight() const;
|
||||
const QBrush &brightText() const;
|
||||
const QBrush &buttonText() const;
|
||||
const QBrush &shadow() const;
|
||||
const QBrush &highlight() const;
|
||||
const QBrush &highlightedText() const;
|
||||
const QBrush &link() const;
|
||||
const QBrush &linkVisited() const;
|
||||
const QBrush &toolTipBase() const;
|
||||
const QBrush &toolTipText() const;
|
||||
%If (Qt_5_12_0 -)
|
||||
const QBrush &placeholderText() const;
|
||||
%End
|
||||
bool operator==(const QPalette &p) const;
|
||||
bool operator!=(const QPalette &p) const;
|
||||
bool isCopyOf(const QPalette &p) const;
|
||||
QPalette resolve(const QPalette &) const;
|
||||
uint resolve() const;
|
||||
void resolve(uint mask);
|
||||
void setColor(QPalette::ColorGroup acg, QPalette::ColorRole acr, const QColor &acolor);
|
||||
void setColor(QPalette::ColorRole acr, const QColor &acolor);
|
||||
void setBrush(QPalette::ColorRole acr, const QBrush &abrush);
|
||||
bool isBrushSet(QPalette::ColorGroup cg, QPalette::ColorRole cr) const;
|
||||
qint64 cacheKey() const;
|
||||
void swap(QPalette &other /Constrained/);
|
||||
};
|
||||
|
||||
QDataStream &operator<<(QDataStream &s, const QPalette &p /Constrained/) /ReleaseGIL/;
|
||||
QDataStream &operator>>(QDataStream &ds, QPalette &p /Constrained/) /ReleaseGIL/;
|
||||
@@ -0,0 +1,72 @@
|
||||
// qpdfwriter.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QPdfWriter : public QObject, public QPagedPaintDevice
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qpdfwriter.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
explicit QPdfWriter(const QString &filename);
|
||||
explicit QPdfWriter(QIODevice *device);
|
||||
virtual ~QPdfWriter();
|
||||
QString title() const;
|
||||
void setTitle(const QString &title);
|
||||
QString creator() const;
|
||||
void setCreator(const QString &creator);
|
||||
virtual bool newPage();
|
||||
virtual void setPageSize(QPagedPaintDevice::PageSize size);
|
||||
bool setPageSize(const QPageSize &pageSize);
|
||||
virtual void setPageSizeMM(const QSizeF &size);
|
||||
virtual void setMargins(const QPagedPaintDevice::Margins &m);
|
||||
|
||||
protected:
|
||||
virtual QPaintEngine *paintEngine() const;
|
||||
virtual int metric(QPaintDevice::PaintDeviceMetric id) const;
|
||||
|
||||
public:
|
||||
%If (Qt_5_3_0 -)
|
||||
void setResolution(int resolution);
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
int resolution() const;
|
||||
%End
|
||||
%If (Qt_5_10_0 -)
|
||||
void setPdfVersion(QPagedPaintDevice::PdfVersion version);
|
||||
%End
|
||||
%If (Qt_5_10_0 -)
|
||||
QPagedPaintDevice::PdfVersion pdfVersion() const;
|
||||
%End
|
||||
%If (Qt_5_15_0 -)
|
||||
void setDocumentXmpMetadata(const QByteArray &xmpMetadata);
|
||||
%End
|
||||
%If (Qt_5_15_0 -)
|
||||
QByteArray documentXmpMetadata() const;
|
||||
%End
|
||||
%If (Qt_5_15_0 -)
|
||||
void addFileAttachment(const QString &fileName, const QByteArray &data, const QString &mimeType = QString());
|
||||
%End
|
||||
|
||||
private:
|
||||
QPdfWriter(const QPdfWriter &);
|
||||
};
|
||||
103
venv/lib/python3.12/site-packages/PyQt5/bindings/QtGui/qpen.sip
Normal file
103
venv/lib/python3.12/site-packages/PyQt5/bindings/QtGui/qpen.sip
Normal file
@@ -0,0 +1,103 @@
|
||||
// qpen.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QPen /TypeHintIn="Union[QPen, QColor]"/
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qpen.h>
|
||||
%End
|
||||
|
||||
%ConvertToTypeCode
|
||||
// SIP doesn't support automatic type convertors so we explicitly allow a
|
||||
// QColor to be used whenever a QPen is expected.
|
||||
|
||||
if (sipIsErr == NULL)
|
||||
return (sipCanConvertToType(sipPy, sipType_QPen, SIP_NO_CONVERTORS) ||
|
||||
sipCanConvertToType(sipPy, sipType_QColor, 0));
|
||||
|
||||
if (sipCanConvertToType(sipPy, sipType_QPen, SIP_NO_CONVERTORS))
|
||||
{
|
||||
*sipCppPtr = reinterpret_cast<QPen *>(sipConvertToType(sipPy, sipType_QPen, sipTransferObj, SIP_NO_CONVERTORS, 0, sipIsErr));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int state;
|
||||
QColor *c = reinterpret_cast<QColor *>(sipConvertToType(sipPy, sipType_QColor, 0, 0, &state, sipIsErr));
|
||||
|
||||
if (*sipIsErr)
|
||||
{
|
||||
sipReleaseType(c, sipType_QColor, state);
|
||||
return 0;
|
||||
}
|
||||
|
||||
*sipCppPtr = new QPen(*c);
|
||||
|
||||
sipReleaseType(c, sipType_QColor, state);
|
||||
|
||||
return sipGetState(sipTransferObj);
|
||||
%End
|
||||
|
||||
public:
|
||||
QPen();
|
||||
QPen(Qt::PenStyle);
|
||||
QPen(const QBrush &brush, qreal width, Qt::PenStyle style = Qt::SolidLine, Qt::PenCapStyle cap = Qt::SquareCap, Qt::PenJoinStyle join = Qt::BevelJoin);
|
||||
QPen(const QPen &pen);
|
||||
QPen(const QVariant &variant /GetWrapper/) /NoDerived/;
|
||||
%MethodCode
|
||||
if (a0->canConvert<QPen>())
|
||||
sipCpp = new QPen(a0->value<QPen>());
|
||||
else
|
||||
sipError = sipBadCallableArg(0, a0Wrapper);
|
||||
%End
|
||||
|
||||
~QPen();
|
||||
Qt::PenStyle style() const;
|
||||
void setStyle(Qt::PenStyle);
|
||||
qreal widthF() const;
|
||||
void setWidthF(qreal width);
|
||||
int width() const;
|
||||
void setWidth(int width);
|
||||
QColor color() const;
|
||||
void setColor(const QColor &color);
|
||||
QBrush brush() const;
|
||||
void setBrush(const QBrush &brush);
|
||||
bool isSolid() const;
|
||||
Qt::PenCapStyle capStyle() const;
|
||||
void setCapStyle(Qt::PenCapStyle pcs);
|
||||
Qt::PenJoinStyle joinStyle() const;
|
||||
void setJoinStyle(Qt::PenJoinStyle pcs);
|
||||
QVector<qreal> dashPattern() const;
|
||||
void setDashPattern(const QVector<qreal> &pattern);
|
||||
qreal miterLimit() const;
|
||||
void setMiterLimit(qreal limit);
|
||||
bool operator==(const QPen &p) const;
|
||||
bool operator!=(const QPen &p) const;
|
||||
qreal dashOffset() const;
|
||||
void setDashOffset(qreal doffset);
|
||||
bool isCosmetic() const;
|
||||
void setCosmetic(bool cosmetic);
|
||||
void swap(QPen &other /Constrained/);
|
||||
};
|
||||
|
||||
QDataStream &operator<<(QDataStream &, const QPen & /Constrained/) /ReleaseGIL/;
|
||||
QDataStream &operator>>(QDataStream &, QPen & /Constrained/) /ReleaseGIL/;
|
||||
@@ -0,0 +1,187 @@
|
||||
// qpicture.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QPicture : public QPaintDevice
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qpicture.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
explicit QPicture(int formatVersion = -1);
|
||||
QPicture(const QPicture &);
|
||||
virtual ~QPicture();
|
||||
bool isNull() const;
|
||||
virtual int devType() const;
|
||||
uint size() const;
|
||||
const char *data() const /Encoding="None"/;
|
||||
virtual void setData(const char *data /Array/, uint size /ArraySize/);
|
||||
bool play(QPainter *p);
|
||||
bool load(QIODevice *dev, const char *format = 0) /ReleaseGIL/;
|
||||
bool load(const QString &fileName, const char *format = 0) /ReleaseGIL/;
|
||||
bool save(QIODevice *dev, const char *format = 0) /ReleaseGIL/;
|
||||
bool save(const QString &fileName, const char *format = 0) /ReleaseGIL/;
|
||||
QRect boundingRect() const;
|
||||
void setBoundingRect(const QRect &r);
|
||||
void detach();
|
||||
bool isDetached() const;
|
||||
virtual QPaintEngine *paintEngine() const;
|
||||
|
||||
protected:
|
||||
virtual int metric(QPaintDevice::PaintDeviceMetric m) const;
|
||||
|
||||
public:
|
||||
void swap(QPicture &other /Constrained/);
|
||||
};
|
||||
|
||||
class QPictureIO
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qpicture.h>
|
||||
%End
|
||||
|
||||
%TypeCode
|
||||
// This defines the mapping between picture formats and the corresponding
|
||||
// Python i/o handler callables.
|
||||
struct qtgui_pio {
|
||||
const char *format; // The format.
|
||||
PyObject *read; // The read handler.
|
||||
PyObject *write; // The write handler.
|
||||
qtgui_pio *next; // The next in the list.
|
||||
};
|
||||
|
||||
|
||||
// The head of the list.
|
||||
static qtgui_pio *qtgui_pio_head = 0;
|
||||
|
||||
|
||||
// Find the entry for the given picture.
|
||||
static const qtgui_pio *qtgui_pio_find(QPictureIO *pio)
|
||||
{
|
||||
for (const qtgui_pio *p = qtgui_pio_head; p; p = p->next)
|
||||
if (qstrcmp(pio->format(), p->format) == 0)
|
||||
return p;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// This is the C++ read handler.
|
||||
static void qtgui_pio_read(QPictureIO *pio)
|
||||
{
|
||||
const qtgui_pio *p = qtgui_pio_find(pio);
|
||||
|
||||
if (p && p->read)
|
||||
{
|
||||
Py_XDECREF(sipCallMethod(0, p->read, "D", pio, sipType_QPictureIO, NULL));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// This is the C++ write handler.
|
||||
static void qtgui_pio_write(QPictureIO *pio)
|
||||
{
|
||||
const qtgui_pio *p = qtgui_pio_find(pio);
|
||||
|
||||
if (p && p->write)
|
||||
{
|
||||
Py_XDECREF(sipCallMethod(0, p->write, "D", pio, sipType_QPictureIO, NULL));
|
||||
}
|
||||
}
|
||||
%End
|
||||
|
||||
public:
|
||||
QPictureIO();
|
||||
QPictureIO(QIODevice *ioDevice, const char *format);
|
||||
QPictureIO(const QString &fileName, const char *format);
|
||||
~QPictureIO();
|
||||
const QPicture &picture() const;
|
||||
int status() const;
|
||||
const char *format() const;
|
||||
QIODevice *ioDevice() const;
|
||||
QString fileName() const;
|
||||
int quality() const;
|
||||
QString description() const;
|
||||
const char *parameters() const;
|
||||
float gamma() const;
|
||||
void setPicture(const QPicture &);
|
||||
void setStatus(int);
|
||||
void setFormat(const char *);
|
||||
void setIODevice(QIODevice *);
|
||||
void setFileName(const QString &);
|
||||
void setQuality(int);
|
||||
void setDescription(const QString &);
|
||||
void setParameters(const char *);
|
||||
void setGamma(float);
|
||||
bool read() /ReleaseGIL/;
|
||||
bool write() /ReleaseGIL/;
|
||||
static QByteArray pictureFormat(const QString &fileName);
|
||||
static QByteArray pictureFormat(QIODevice *);
|
||||
static QList<QByteArray> inputFormats();
|
||||
static QList<QByteArray> outputFormats();
|
||||
static void defineIOHandler(const char *format, const char *header, const char *flags, SIP_PYCALLABLE read_picture /AllowNone,TypeHint="Optional[Callable[[QPictureIO], None]]"/, SIP_PYCALLABLE write_picture /AllowNone,TypeHint="Optional[Callable[[QPictureIO], None]]"/);
|
||||
%MethodCode
|
||||
// Convert None to NULL.
|
||||
if (a3 == Py_None)
|
||||
a3 = 0;
|
||||
|
||||
if (a4 == Py_None)
|
||||
a4 = 0;
|
||||
|
||||
// See if we already know about the format.
|
||||
qtgui_pio *p;
|
||||
|
||||
for (p = qtgui_pio_head; p; p = p->next)
|
||||
if (qstrcmp(a0, p->format) == 0)
|
||||
break;
|
||||
|
||||
if (!p)
|
||||
{
|
||||
// Handle the new format.
|
||||
p = new qtgui_pio;
|
||||
p->format = qstrdup(a0);
|
||||
p->read = 0;
|
||||
p->write = 0;
|
||||
p->next = qtgui_pio_head;
|
||||
|
||||
qtgui_pio_head = p;
|
||||
}
|
||||
|
||||
// Replace the old callables with the new ones.
|
||||
Py_XDECREF(p->read);
|
||||
p->read = a3;
|
||||
Py_XINCREF(p->read);
|
||||
|
||||
Py_XDECREF(p->write);
|
||||
p->write = a4;
|
||||
Py_XINCREF(p->write);
|
||||
|
||||
// Install the generic handlers.
|
||||
QPictureIO::defineIOHandler(a0, a1, a2, qtgui_pio_read, qtgui_pio_write);
|
||||
%End
|
||||
|
||||
private:
|
||||
QPictureIO(const QPictureIO &);
|
||||
};
|
||||
|
||||
QDataStream &operator<<(QDataStream &in, const QPicture &p /Constrained/) /ReleaseGIL/;
|
||||
QDataStream &operator>>(QDataStream &in, QPicture &p /Constrained/) /ReleaseGIL/;
|
||||
@@ -0,0 +1,159 @@
|
||||
// qpixelformat.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (Qt_5_4_0 -)
|
||||
%ModuleCode
|
||||
#include <qpixelformat.h>
|
||||
%End
|
||||
%End
|
||||
|
||||
%If (Qt_5_4_0 -)
|
||||
|
||||
class QPixelFormat
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qpixelformat.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum ColorModel
|
||||
{
|
||||
RGB,
|
||||
BGR,
|
||||
Indexed,
|
||||
Grayscale,
|
||||
CMYK,
|
||||
HSL,
|
||||
HSV,
|
||||
YUV,
|
||||
%If (Qt_5_5_0 -)
|
||||
Alpha,
|
||||
%End
|
||||
};
|
||||
|
||||
enum AlphaUsage
|
||||
{
|
||||
UsesAlpha,
|
||||
IgnoresAlpha,
|
||||
};
|
||||
|
||||
enum AlphaPosition
|
||||
{
|
||||
AtBeginning,
|
||||
AtEnd,
|
||||
};
|
||||
|
||||
enum AlphaPremultiplied
|
||||
{
|
||||
NotPremultiplied,
|
||||
Premultiplied,
|
||||
};
|
||||
|
||||
enum TypeInterpretation
|
||||
{
|
||||
UnsignedInteger,
|
||||
UnsignedShort,
|
||||
UnsignedByte,
|
||||
FloatingPoint,
|
||||
};
|
||||
|
||||
enum YUVLayout
|
||||
{
|
||||
YUV444,
|
||||
YUV422,
|
||||
YUV411,
|
||||
YUV420P,
|
||||
YUV420SP,
|
||||
YV12,
|
||||
UYVY,
|
||||
YUYV,
|
||||
NV12,
|
||||
NV21,
|
||||
IMC1,
|
||||
IMC2,
|
||||
IMC3,
|
||||
IMC4,
|
||||
Y8,
|
||||
Y16,
|
||||
};
|
||||
|
||||
enum ByteOrder
|
||||
{
|
||||
LittleEndian,
|
||||
BigEndian,
|
||||
CurrentSystemEndian,
|
||||
};
|
||||
|
||||
QPixelFormat();
|
||||
QPixelFormat(QPixelFormat::ColorModel mdl, uchar firstSize /PyInt/, uchar secondSize /PyInt/, uchar thirdSize /PyInt/, uchar fourthSize /PyInt/, uchar fifthSize /PyInt/, uchar alfa /PyInt/, QPixelFormat::AlphaUsage usage, QPixelFormat::AlphaPosition position, QPixelFormat::AlphaPremultiplied premult, QPixelFormat::TypeInterpretation typeInterp, QPixelFormat::ByteOrder byteOrder = QPixelFormat::CurrentSystemEndian, uchar subEnum /PyInt/ = 0);
|
||||
QPixelFormat::ColorModel colorModel() const;
|
||||
uchar channelCount() const /PyInt/;
|
||||
uchar redSize() const /PyInt/;
|
||||
uchar greenSize() const /PyInt/;
|
||||
uchar blueSize() const /PyInt/;
|
||||
uchar cyanSize() const /PyInt/;
|
||||
uchar magentaSize() const /PyInt/;
|
||||
uchar yellowSize() const /PyInt/;
|
||||
uchar blackSize() const /PyInt/;
|
||||
uchar hueSize() const /PyInt/;
|
||||
uchar saturationSize() const /PyInt/;
|
||||
uchar lightnessSize() const /PyInt/;
|
||||
uchar brightnessSize() const /PyInt/;
|
||||
uchar alphaSize() const /PyInt/;
|
||||
uchar bitsPerPixel() const /PyInt/;
|
||||
QPixelFormat::AlphaUsage alphaUsage() const;
|
||||
QPixelFormat::AlphaPosition alphaPosition() const;
|
||||
QPixelFormat::AlphaPremultiplied premultiplied() const;
|
||||
QPixelFormat::TypeInterpretation typeInterpretation() const;
|
||||
QPixelFormat::ByteOrder byteOrder() const;
|
||||
QPixelFormat::YUVLayout yuvLayout() const;
|
||||
uchar subEnum() const /PyInt/;
|
||||
};
|
||||
|
||||
%End
|
||||
%If (Qt_5_4_0 -)
|
||||
bool operator==(QPixelFormat fmt1, QPixelFormat fmt2);
|
||||
%End
|
||||
%If (Qt_5_4_0 -)
|
||||
bool operator!=(QPixelFormat fmt1, QPixelFormat fmt2);
|
||||
%End
|
||||
%If (Qt_5_4_0 -)
|
||||
QPixelFormat qPixelFormatRgba(uchar red /PyInt/, uchar green /PyInt/, uchar blue /PyInt/, uchar alfa /PyInt/, QPixelFormat::AlphaUsage usage, QPixelFormat::AlphaPosition position, QPixelFormat::AlphaPremultiplied premultiplied = QPixelFormat::NotPremultiplied, QPixelFormat::TypeInterpretation typeInterpretation = QPixelFormat::UnsignedInteger);
|
||||
%End
|
||||
%If (Qt_5_4_0 -)
|
||||
QPixelFormat qPixelFormatGrayscale(uchar channelSize /PyInt/, QPixelFormat::TypeInterpretation typeInterpretation = QPixelFormat::UnsignedInteger);
|
||||
%End
|
||||
%If (Qt_5_4_0 -)
|
||||
QPixelFormat qPixelFormatCmyk(uchar channelSize /PyInt/, uchar alphaSize /PyInt/ = 0, QPixelFormat::AlphaUsage alphaUsage = QPixelFormat::IgnoresAlpha, QPixelFormat::AlphaPosition alphaPosition = QPixelFormat::AtBeginning, QPixelFormat::TypeInterpretation typeInterpretation = QPixelFormat::UnsignedInteger);
|
||||
%End
|
||||
%If (Qt_5_4_0 -)
|
||||
QPixelFormat qPixelFormatHsl(uchar channelSize /PyInt/, uchar alphaSize /PyInt/ = 0, QPixelFormat::AlphaUsage alphaUsage = QPixelFormat::IgnoresAlpha, QPixelFormat::AlphaPosition alphaPosition = QPixelFormat::AtBeginning, QPixelFormat::TypeInterpretation typeInterpretation = QPixelFormat::FloatingPoint);
|
||||
%End
|
||||
%If (Qt_5_4_0 -)
|
||||
QPixelFormat qPixelFormatHsv(uchar channelSize /PyInt/, uchar alphaSize /PyInt/ = 0, QPixelFormat::AlphaUsage alphaUsage = QPixelFormat::IgnoresAlpha, QPixelFormat::AlphaPosition alphaPosition = QPixelFormat::AtBeginning, QPixelFormat::TypeInterpretation typeInterpretation = QPixelFormat::FloatingPoint);
|
||||
%End
|
||||
%If (Qt_5_4_0 -)
|
||||
QPixelFormat qPixelFormatYuv(QPixelFormat::YUVLayout layout, uchar alphaSize /PyInt/ = 0, QPixelFormat::AlphaUsage alphaUsage = QPixelFormat::IgnoresAlpha, QPixelFormat::AlphaPosition alphaPosition = QPixelFormat::AtBeginning, QPixelFormat::AlphaPremultiplied premultiplied = QPixelFormat::NotPremultiplied, QPixelFormat::TypeInterpretation typeInterpretation = QPixelFormat::UnsignedByte, QPixelFormat::ByteOrder byteOrder = QPixelFormat::LittleEndian);
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
QPixelFormat qPixelFormatAlpha(uchar channelSize /PyInt/, QPixelFormat::TypeInterpretation typeInterpretation = QPixelFormat::UnsignedInteger);
|
||||
%End
|
||||
@@ -0,0 +1,108 @@
|
||||
// qpixmap.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QPixmap : public QPaintDevice
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qpixmap.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QPixmap();
|
||||
QPixmap(int w, int h);
|
||||
explicit QPixmap(const QSize &);
|
||||
QPixmap(const QString &fileName, const char *format = 0, Qt::ImageConversionFlags flags = Qt::ImageConversionFlag::AutoColor);
|
||||
QPixmap(SIP_PYLIST xpm /TypeHint="List[str]"/) [(const char **xpm)];
|
||||
%MethodCode
|
||||
// The Python interface is a list of strings that make up the image.
|
||||
|
||||
const char **str = QtGui_ListToArray(a0);
|
||||
|
||||
if (str)
|
||||
{
|
||||
sipCpp = new sipQPixmap(str);
|
||||
QtGui_DeleteArray(str);
|
||||
}
|
||||
else
|
||||
sipIsErr = 1;
|
||||
%End
|
||||
|
||||
QPixmap(const QPixmap &);
|
||||
QPixmap(const QVariant &variant /GetWrapper/) /NoDerived/;
|
||||
%MethodCode
|
||||
if (a0->canConvert<QPixmap>())
|
||||
sipCpp = new sipQPixmap(a0->value<QPixmap>());
|
||||
else
|
||||
sipError = sipBadCallableArg(0, a0Wrapper);
|
||||
%End
|
||||
|
||||
virtual ~QPixmap();
|
||||
bool isNull() const;
|
||||
virtual int devType() const;
|
||||
int width() const;
|
||||
int height() const;
|
||||
QSize size() const;
|
||||
QRect rect() const;
|
||||
int depth() const;
|
||||
static int defaultDepth();
|
||||
void fill(const QColor &color = Qt::GlobalColor::white);
|
||||
QBitmap mask() const;
|
||||
void setMask(const QBitmap &);
|
||||
bool hasAlpha() const;
|
||||
bool hasAlphaChannel() const;
|
||||
QBitmap createHeuristicMask(bool clipTight = true) const;
|
||||
QBitmap createMaskFromColor(const QColor &maskColor, Qt::MaskMode mode = Qt::MaskInColor) const;
|
||||
QPixmap scaled(int width, int height, Qt::AspectRatioMode aspectRatioMode = Qt::IgnoreAspectRatio, Qt::TransformationMode transformMode = Qt::FastTransformation) const;
|
||||
QPixmap scaled(const QSize &size, Qt::AspectRatioMode aspectRatioMode = Qt::IgnoreAspectRatio, Qt::TransformationMode transformMode = Qt::FastTransformation) const;
|
||||
QPixmap scaledToWidth(int width, Qt::TransformationMode mode = Qt::FastTransformation) const;
|
||||
QPixmap scaledToHeight(int height, Qt::TransformationMode mode = Qt::FastTransformation) const;
|
||||
QImage toImage() const;
|
||||
static QPixmap fromImage(const QImage &image, Qt::ImageConversionFlags flags = Qt::AutoColor);
|
||||
static QPixmap fromImageReader(QImageReader *imageReader, Qt::ImageConversionFlags flags = Qt::AutoColor);
|
||||
bool convertFromImage(const QImage &img, Qt::ImageConversionFlags flags = Qt::AutoColor);
|
||||
bool load(const QString &fileName, const char *format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor);
|
||||
bool loadFromData(const uchar *buf /Array/, uint len /ArraySize/, const char *format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor);
|
||||
bool loadFromData(const QByteArray &buf, 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;
|
||||
QPixmap copy(const QRect &rect = QRect()) const;
|
||||
void detach();
|
||||
bool isQBitmap() const;
|
||||
virtual QPaintEngine *paintEngine() const;
|
||||
|
||||
protected:
|
||||
virtual int metric(QPaintDevice::PaintDeviceMetric) const;
|
||||
|
||||
public:
|
||||
QPixmap copy(int ax, int ay, int awidth, int aheight) const;
|
||||
QPixmap transformed(const QTransform &transform, Qt::TransformationMode mode = Qt::FastTransformation) const;
|
||||
static QTransform trueMatrix(const QTransform &m, int w, int h);
|
||||
qint64 cacheKey() const;
|
||||
void scroll(int dx, int dy, const QRect &rect, QRegion *exposed /Out/ = 0);
|
||||
void scroll(int dx, int dy, int x, int y, int width, int height, QRegion *exposed /Out/ = 0);
|
||||
void swap(QPixmap &other /Constrained/);
|
||||
qreal devicePixelRatio() const;
|
||||
void setDevicePixelRatio(qreal scaleFactor);
|
||||
};
|
||||
|
||||
QDataStream &operator<<(QDataStream &, const QPixmap & /Constrained/) /ReleaseGIL/;
|
||||
QDataStream &operator>>(QDataStream &, QPixmap & /Constrained/) /ReleaseGIL/;
|
||||
@@ -0,0 +1,80 @@
|
||||
// qpixmapcache.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QPixmapCache
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qpixmapcache.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
class Key
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qpixmapcache.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
Key();
|
||||
Key(const QPixmapCache::Key &other);
|
||||
~Key();
|
||||
bool operator==(const QPixmapCache::Key &key) const;
|
||||
bool operator!=(const QPixmapCache::Key &key) const;
|
||||
%If (Qt_5_6_0 -)
|
||||
void swap(QPixmapCache::Key &other /Constrained/);
|
||||
%End
|
||||
%If (Qt_5_7_0 -)
|
||||
bool isValid() const;
|
||||
%End
|
||||
};
|
||||
|
||||
static int cacheLimit();
|
||||
static void clear();
|
||||
static QPixmap find(const QString &key);
|
||||
%MethodCode
|
||||
sipRes = new QPixmap;
|
||||
|
||||
if (!QPixmapCache::find(*a0, sipRes))
|
||||
{
|
||||
delete sipRes;
|
||||
sipRes = 0;
|
||||
}
|
||||
%End
|
||||
|
||||
static QPixmap find(const QPixmapCache::Key &key);
|
||||
%MethodCode
|
||||
sipRes = new QPixmap;
|
||||
|
||||
if (!QPixmapCache::find(*a0, sipRes))
|
||||
{
|
||||
delete sipRes;
|
||||
sipRes = 0;
|
||||
}
|
||||
%End
|
||||
|
||||
static bool insert(const QString &key, const QPixmap &);
|
||||
static QPixmapCache::Key insert(const QPixmap &pixmap);
|
||||
static void remove(const QString &key);
|
||||
static void remove(const QPixmapCache::Key &key);
|
||||
static bool replace(const QPixmapCache::Key &key, const QPixmap &pixmap);
|
||||
static void setCacheLimit(int);
|
||||
};
|
||||
@@ -0,0 +1,515 @@
|
||||
// qpolygon.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QPolygon
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qpolygon.h>
|
||||
%End
|
||||
|
||||
%TypeCode
|
||||
// Get a set of coordinate pairs of a polygon from a Python list.
|
||||
static int *coordsFromList(PyObject *l, int &nr_points)
|
||||
{
|
||||
int *coords = new int[PyList_Size(l)];
|
||||
nr_points = PyList_Size(l) >> 1;
|
||||
|
||||
for (Py_ssize_t i = 0; i < PyList_Size(l); ++i)
|
||||
{
|
||||
coords[i] = SIPLong_AsLong(PyList_GetItem(l, i));
|
||||
|
||||
if (PyErr_Occurred() != NULL)
|
||||
{
|
||||
delete[] coords;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return coords;
|
||||
}
|
||||
%End
|
||||
|
||||
%PickleCode
|
||||
PyObject *pl = PyList_New(sipCpp->count() * 2);
|
||||
|
||||
for (int p = 0, i = 0; i < sipCpp->count(); ++i, p += 2)
|
||||
{
|
||||
int x, y;
|
||||
|
||||
sipCpp->point(i, &x, &y);
|
||||
|
||||
PyList_SetItem(pl, p, SIPLong_FromLong(x));
|
||||
PyList_SetItem(pl, p + 1, SIPLong_FromLong(y));
|
||||
}
|
||||
|
||||
sipRes = Py_BuildValue((char *)"(N)", pl);
|
||||
%End
|
||||
|
||||
public:
|
||||
QPolygon();
|
||||
~QPolygon();
|
||||
QPolygon(const QPolygon &a);
|
||||
QPolygon(SIP_PYLIST points /TypeHint="List[int]"/) /NoDerived/;
|
||||
%MethodCode
|
||||
int nr_points;
|
||||
int *coords = coordsFromList(a0, nr_points);
|
||||
|
||||
if (coords)
|
||||
{
|
||||
sipCpp = new QPolygon();
|
||||
sipCpp->setPoints(nr_points, coords);
|
||||
delete[] coords;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Invoke the subsequent QVector<QPoint> overload.
|
||||
sipError = sipErrorContinue;
|
||||
}
|
||||
%End
|
||||
|
||||
QPolygon(const QVector<QPoint> &v);
|
||||
QPolygon(const QRect &rectangle, bool closed = false);
|
||||
explicit QPolygon(int asize);
|
||||
QPolygon(const QVariant &variant /GetWrapper/) /NoDerived/;
|
||||
%MethodCode
|
||||
if (a0->canConvert<QPolygon>())
|
||||
sipCpp = new QPolygon(a0->value<QPolygon>());
|
||||
else
|
||||
sipError = sipBadCallableArg(0, a0Wrapper);
|
||||
%End
|
||||
|
||||
void translate(int dx, int dy);
|
||||
QRect boundingRect() const;
|
||||
QPoint point(int index) const;
|
||||
void setPoints(SIP_PYLIST points /TypeHint="List[int]"/);
|
||||
%MethodCode
|
||||
int nr_points;
|
||||
int *coords = coordsFromList(a0, nr_points);
|
||||
|
||||
if (coords)
|
||||
{
|
||||
sipCpp->setPoints(nr_points, coords);
|
||||
delete[] coords;
|
||||
}
|
||||
else
|
||||
{
|
||||
sipIsErr = 1;
|
||||
}
|
||||
%End
|
||||
|
||||
void setPoints(int firstx, int firsty, ... /TypeHint="int"/);
|
||||
%MethodCode
|
||||
// Accept at least one pair of integer coordinates.
|
||||
int nPoints = 1 + ((PyTuple_Size(a2) + 1) >> 1);
|
||||
|
||||
int *points = new int[nPoints * 2];
|
||||
|
||||
points[0] = a0;
|
||||
points[1] = a1;
|
||||
|
||||
for (Py_ssize_t i = 0; i < PyTuple_Size(a2); ++i)
|
||||
points[2 + i] = SIPLong_AsLong(PyTuple_GetItem(a2, i));
|
||||
|
||||
sipCpp->setPoints(nPoints, points);
|
||||
|
||||
delete[] points;
|
||||
%End
|
||||
|
||||
void putPoints(int index, int firstx, int firsty, ... /TypeHint="int"/);
|
||||
%MethodCode
|
||||
// Accept at least one pair of integer coordinates.
|
||||
int nPoints = 1 + ((PyTuple_Size(a3) + 1) >> 1);
|
||||
|
||||
int *points = new int[nPoints * 2];
|
||||
|
||||
points[0] = a1;
|
||||
points[1] = a2;
|
||||
|
||||
for (Py_ssize_t i = 0; i < PyTuple_Size(a3); ++i)
|
||||
points[2 + i] = SIPLong_AsLong(PyTuple_GetItem(a3, i));
|
||||
|
||||
sipCpp->putPoints(a0, nPoints, points);
|
||||
|
||||
delete[] points;
|
||||
%End
|
||||
|
||||
void putPoints(int index, int nPoints, const QPolygon &fromPolygon, int from = 0);
|
||||
void setPoint(int index, const QPoint &pt);
|
||||
void setPoint(int index, int x, int y);
|
||||
void translate(const QPoint &offset);
|
||||
bool containsPoint(const QPoint &pt, Qt::FillRule fillRule) const;
|
||||
QPolygon united(const QPolygon &r) const;
|
||||
QPolygon intersected(const QPolygon &r) const;
|
||||
QPolygon subtracted(const QPolygon &r) const;
|
||||
QPolygon translated(int dx, int dy) const;
|
||||
QPolygon translated(const QPoint &offset) const;
|
||||
// Methods inherited from QVector<QPoint> and Python special methods.
|
||||
// Keep in sync with QPolygonF and QXmlStreamAttributes.
|
||||
|
||||
void append(const QPoint &value);
|
||||
const QPoint &at(int i) const;
|
||||
void clear();
|
||||
bool contains(const QPoint &value) const;
|
||||
int count(const QPoint &value) const;
|
||||
int count() const /__len__/;
|
||||
void *data();
|
||||
|
||||
// Note the Qt return value is discarded as it would require handwritten code
|
||||
// and seems pretty useless.
|
||||
void fill(const QPoint &value, int size = -1);
|
||||
|
||||
QPoint &first();
|
||||
int indexOf(const QPoint &value, int from = 0) const;
|
||||
void insert(int i, const QPoint &value);
|
||||
bool isEmpty() const;
|
||||
QPoint &last();
|
||||
int lastIndexOf(const QPoint &value, int from = -1) const;
|
||||
|
||||
// Note the Qt return type is QVector<QPoint>.
|
||||
QPolygon mid(int pos, int length = -1) const;
|
||||
|
||||
void prepend(const QPoint &value);
|
||||
void remove(int i);
|
||||
void remove(int i, int count);
|
||||
void replace(int i, const QPoint &value);
|
||||
int size() const;
|
||||
QPoint value(int i) const;
|
||||
QPoint value(int i, const QPoint &defaultValue) const;
|
||||
bool operator!=(const QPolygon &other) const;
|
||||
|
||||
// Note the Qt return type is QVector<QPoint>.
|
||||
QPolygon operator+(const QPolygon &other) const;
|
||||
|
||||
QPolygon &operator+=(const QPolygon &other);
|
||||
QPolygon &operator+=(const QPoint &value);
|
||||
bool operator==(const QPolygon &other) const;
|
||||
|
||||
SIP_PYOBJECT operator<<(const QPoint &value);
|
||||
%MethodCode
|
||||
*a0 << *a1;
|
||||
|
||||
sipRes = sipArg0;
|
||||
Py_INCREF(sipRes);
|
||||
%End
|
||||
|
||||
QPoint &operator[](int i);
|
||||
%MethodCode
|
||||
Py_ssize_t idx = sipConvertFromSequenceIndex(a0, sipCpp->count());
|
||||
|
||||
if (idx < 0)
|
||||
sipIsErr = 1;
|
||||
else
|
||||
sipRes = &sipCpp->operator[]((int)idx);
|
||||
%End
|
||||
|
||||
// Some additional Python special methods.
|
||||
|
||||
void __setitem__(int i, const QPoint &value);
|
||||
%MethodCode
|
||||
int len;
|
||||
|
||||
len = sipCpp->count();
|
||||
|
||||
if ((a0 = (int)sipConvertFromSequenceIndex(a0, len)) < 0)
|
||||
sipIsErr = 1;
|
||||
else
|
||||
(*sipCpp)[a0] = *a1;
|
||||
%End
|
||||
|
||||
void __setitem__(SIP_PYSLICE slice, const QPolygon &list);
|
||||
%MethodCode
|
||||
Py_ssize_t start, stop, step, slicelength;
|
||||
|
||||
if (sipConvertFromSliceObject(a0, sipCpp->count(), &start, &stop, &step, &slicelength) < 0)
|
||||
{
|
||||
sipIsErr = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
int vlen = a1->count();
|
||||
|
||||
if (vlen != slicelength)
|
||||
{
|
||||
sipBadLengthForSlice(vlen, slicelength);
|
||||
sipIsErr = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
QVector<QPoint>::const_iterator it = a1->begin();
|
||||
|
||||
for (Py_ssize_t i = 0; i < slicelength; ++i)
|
||||
{
|
||||
(*sipCpp)[start] = *it;
|
||||
start += step;
|
||||
++it;
|
||||
}
|
||||
}
|
||||
}
|
||||
%End
|
||||
|
||||
void __delitem__(int i);
|
||||
%MethodCode
|
||||
if ((a0 = (int)sipConvertFromSequenceIndex(a0, sipCpp->count())) < 0)
|
||||
sipIsErr = 1;
|
||||
else
|
||||
sipCpp->remove(a0);
|
||||
%End
|
||||
|
||||
void __delitem__(SIP_PYSLICE slice);
|
||||
%MethodCode
|
||||
Py_ssize_t start, stop, step, slicelength;
|
||||
|
||||
if (sipConvertFromSliceObject(a0, sipCpp->count(), &start, &stop, &step, &slicelength) < 0)
|
||||
{
|
||||
sipIsErr = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (Py_ssize_t i = 0; i < slicelength; ++i)
|
||||
{
|
||||
sipCpp->remove(start);
|
||||
start += step - 1;
|
||||
}
|
||||
}
|
||||
%End
|
||||
|
||||
QPolygon operator[](SIP_PYSLICE slice);
|
||||
%MethodCode
|
||||
Py_ssize_t start, stop, step, slicelength;
|
||||
|
||||
if (sipConvertFromSliceObject(a0, sipCpp->count(), &start, &stop, &step, &slicelength) < 0)
|
||||
{
|
||||
sipIsErr = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
sipRes = new QPolygon();
|
||||
|
||||
for (Py_ssize_t i = 0; i < slicelength; ++i)
|
||||
{
|
||||
(*sipRes) += (*sipCpp)[start];
|
||||
start += step;
|
||||
}
|
||||
}
|
||||
%End
|
||||
|
||||
int __contains__(const QPoint &value);
|
||||
%MethodCode
|
||||
// It looks like you can't assign QBool to int.
|
||||
sipRes = bool(sipCpp->contains(*a0));
|
||||
%End
|
||||
void swap(QPolygon &other /Constrained/);
|
||||
%If (Qt_5_10_0 -)
|
||||
bool intersects(const QPolygon &r) const;
|
||||
%End
|
||||
};
|
||||
|
||||
class QPolygonF
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qpolygon.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QPolygonF();
|
||||
~QPolygonF();
|
||||
QPolygonF(const QPolygonF &a);
|
||||
QPolygonF(const QVector<QPointF> &v);
|
||||
QPolygonF(const QRectF &r);
|
||||
QPolygonF(const QPolygon &a);
|
||||
explicit QPolygonF(int asize);
|
||||
void translate(const QPointF &offset);
|
||||
QPolygon toPolygon() const;
|
||||
bool isClosed() const;
|
||||
QRectF boundingRect() const;
|
||||
void translate(qreal dx, qreal dy);
|
||||
bool containsPoint(const QPointF &pt, Qt::FillRule fillRule) const;
|
||||
QPolygonF united(const QPolygonF &r) const;
|
||||
QPolygonF intersected(const QPolygonF &r) const;
|
||||
QPolygonF subtracted(const QPolygonF &r) const;
|
||||
QPolygonF translated(const QPointF &offset) const;
|
||||
QPolygonF translated(qreal dx, qreal dy) const;
|
||||
// Methods inherited from QVector<QPointF> and Python special methods.
|
||||
// Keep in sync with QPolygon and QXmlStreamAttributes.
|
||||
|
||||
void append(const QPointF &value);
|
||||
const QPointF &at(int i) const;
|
||||
void clear();
|
||||
bool contains(const QPointF &value) const;
|
||||
int count(const QPointF &value) const;
|
||||
int count() const /__len__/;
|
||||
void *data();
|
||||
|
||||
// Note the Qt return value is discarded as it would require handwritten code
|
||||
// and seems pretty useless.
|
||||
void fill(const QPointF &value, int size = -1);
|
||||
|
||||
QPointF &first();
|
||||
int indexOf(const QPointF &value, int from = 0) const;
|
||||
void insert(int i, const QPointF &value);
|
||||
bool isEmpty() const;
|
||||
QPointF &last();
|
||||
int lastIndexOf(const QPointF &value, int from = -1) const;
|
||||
|
||||
// Note the Qt return type is QVector<QPointF>.
|
||||
QPolygonF mid(int pos, int length = -1) const;
|
||||
|
||||
void prepend(const QPointF &value);
|
||||
void remove(int i);
|
||||
void remove(int i, int count);
|
||||
void replace(int i, const QPointF &value);
|
||||
int size() const;
|
||||
QPointF value(int i) const;
|
||||
QPointF value(int i, const QPointF &defaultValue) const;
|
||||
bool operator!=(const QPolygonF &other) const;
|
||||
|
||||
// Note the Qt return type is QVector<QPointF>.
|
||||
QPolygonF operator+(const QPolygonF &other) const;
|
||||
|
||||
QPolygonF &operator+=(const QPolygonF &other);
|
||||
QPolygonF &operator+=(const QPointF &value);
|
||||
bool operator==(const QPolygonF &other) const;
|
||||
|
||||
SIP_PYOBJECT operator<<(const QPointF &value);
|
||||
%MethodCode
|
||||
*a0 << *a1;
|
||||
|
||||
sipRes = sipArg0;
|
||||
Py_INCREF(sipRes);
|
||||
%End
|
||||
|
||||
QPointF &operator[](int i);
|
||||
%MethodCode
|
||||
Py_ssize_t idx = sipConvertFromSequenceIndex(a0, sipCpp->count());
|
||||
|
||||
if (idx < 0)
|
||||
sipIsErr = 1;
|
||||
else
|
||||
sipRes = &sipCpp->operator[]((int)idx);
|
||||
%End
|
||||
|
||||
// Some additional Python special methods.
|
||||
|
||||
void __setitem__(int i, const QPointF &value);
|
||||
%MethodCode
|
||||
int len;
|
||||
|
||||
len = sipCpp->count();
|
||||
|
||||
if ((a0 = (int)sipConvertFromSequenceIndex(a0, len)) < 0)
|
||||
sipIsErr = 1;
|
||||
else
|
||||
(*sipCpp)[a0] = *a1;
|
||||
%End
|
||||
|
||||
void __setitem__(SIP_PYSLICE slice, const QPolygonF &list);
|
||||
%MethodCode
|
||||
Py_ssize_t start, stop, step, slicelength;
|
||||
|
||||
if (sipConvertFromSliceObject(a0, sipCpp->count(), &start, &stop, &step, &slicelength) < 0)
|
||||
{
|
||||
sipIsErr = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
int vlen = a1->count();
|
||||
|
||||
if (vlen != slicelength)
|
||||
{
|
||||
sipBadLengthForSlice(vlen, slicelength);
|
||||
sipIsErr = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
QVector<QPointF>::const_iterator it = a1->begin();
|
||||
|
||||
for (Py_ssize_t i = 0; i < slicelength; ++i)
|
||||
{
|
||||
(*sipCpp)[start] = *it;
|
||||
start += step;
|
||||
++it;
|
||||
}
|
||||
}
|
||||
}
|
||||
%End
|
||||
|
||||
void __delitem__(int i);
|
||||
%MethodCode
|
||||
if ((a0 = (int)sipConvertFromSequenceIndex(a0, sipCpp->count())) < 0)
|
||||
sipIsErr = 1;
|
||||
else
|
||||
sipCpp->remove(a0);
|
||||
%End
|
||||
|
||||
void __delitem__(SIP_PYSLICE slice);
|
||||
%MethodCode
|
||||
Py_ssize_t start, stop, step, slicelength;
|
||||
|
||||
if (sipConvertFromSliceObject(a0, sipCpp->count(), &start, &stop, &step, &slicelength) < 0)
|
||||
{
|
||||
sipIsErr = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (Py_ssize_t i = 0; i < slicelength; ++i)
|
||||
{
|
||||
sipCpp->remove(start);
|
||||
start += step - 1;
|
||||
}
|
||||
}
|
||||
%End
|
||||
|
||||
QPolygonF operator[](SIP_PYSLICE slice);
|
||||
%MethodCode
|
||||
Py_ssize_t start, stop, step, slicelength;
|
||||
|
||||
if (sipConvertFromSliceObject(a0, sipCpp->count(), &start, &stop, &step, &slicelength) < 0)
|
||||
{
|
||||
sipIsErr = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
sipRes = new QPolygonF();
|
||||
|
||||
for (Py_ssize_t i = 0; i < slicelength; ++i)
|
||||
{
|
||||
(*sipRes) += (*sipCpp)[start];
|
||||
start += step;
|
||||
}
|
||||
}
|
||||
%End
|
||||
|
||||
int __contains__(const QPointF &value);
|
||||
%MethodCode
|
||||
// It looks like you can't assign QBool to int.
|
||||
sipRes = bool(sipCpp->contains(*a0));
|
||||
%End
|
||||
void swap(QPolygonF &other /Constrained/);
|
||||
%If (Qt_5_10_0 -)
|
||||
bool intersects(const QPolygonF &r) const;
|
||||
%End
|
||||
};
|
||||
|
||||
QDataStream &operator<<(QDataStream &stream, const QPolygonF &array /Constrained/) /ReleaseGIL/;
|
||||
QDataStream &operator>>(QDataStream &stream, QPolygonF &array /Constrained/) /ReleaseGIL/;
|
||||
QDataStream &operator<<(QDataStream &stream, const QPolygon &polygon /Constrained/) /ReleaseGIL/;
|
||||
QDataStream &operator>>(QDataStream &stream, QPolygon &polygon /Constrained/) /ReleaseGIL/;
|
||||
@@ -0,0 +1,106 @@
|
||||
// This is the SIP interface definition for the QList based mapped types
|
||||
// specific to the QtGui module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%MappedType QList<QFontDatabase::WritingSystem>
|
||||
/TypeHintIn="Sequence[QFontDatabase.WritingSystem]",
|
||||
TypeHintOut="List[QFontDatabase.WritingSystem]",
|
||||
TypeHintValue="[]"/
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qfontdatabase.h>
|
||||
%End
|
||||
|
||||
%ConvertFromTypeCode
|
||||
PyObject *l = PyList_New(sipCpp->size());
|
||||
|
||||
if (!l)
|
||||
return 0;
|
||||
|
||||
for (int i = 0; i < sipCpp->size(); ++i)
|
||||
{
|
||||
PyObject *eobj = sipConvertFromEnum(sipCpp->at(i),
|
||||
sipType_QFontDatabase_WritingSystem);
|
||||
|
||||
if (!eobj)
|
||||
{
|
||||
Py_DECREF(l);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
PyList_SetItem(l, i, eobj);
|
||||
}
|
||||
|
||||
return l;
|
||||
%End
|
||||
|
||||
%ConvertToTypeCode
|
||||
if (!sipIsErr)
|
||||
return (PySequence_Check(sipPy)
|
||||
#if PY_MAJOR_VERSION < 3
|
||||
&& !PyString_Check(sipPy)
|
||||
#endif
|
||||
&& !PyUnicode_Check(sipPy));
|
||||
|
||||
Py_ssize_t len = PySequence_Size(sipPy);
|
||||
|
||||
if (len < 0)
|
||||
return 0;
|
||||
|
||||
QList<QFontDatabase::WritingSystem> *ql = new QList<QFontDatabase::WritingSystem>;
|
||||
|
||||
for (Py_ssize_t i = 0; i < len; ++i)
|
||||
{
|
||||
PyObject *itm = PySequence_GetItem(sipPy, i);
|
||||
|
||||
if (!itm)
|
||||
{
|
||||
delete ql;
|
||||
*sipIsErr = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int v = sipConvertToEnum(itm, sipType_QFontDatabase_WritingSystem);
|
||||
|
||||
if (PyErr_Occurred())
|
||||
{
|
||||
PyErr_Format(PyExc_TypeError,
|
||||
"element %zd has type '%s' but 'QFontDatabase.WritingSystem' is expected",
|
||||
i, sipPyTypeName(Py_TYPE(itm)));
|
||||
|
||||
Py_DECREF(itm);
|
||||
delete ql;
|
||||
*sipIsErr = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
ql->append(static_cast<QFontDatabase::WritingSystem>(v));
|
||||
|
||||
Py_DECREF(itm);
|
||||
}
|
||||
|
||||
*sipCppPtr = ql;
|
||||
|
||||
return sipGetState(sipTransferObj);
|
||||
%End
|
||||
};
|
||||
@@ -0,0 +1,220 @@
|
||||
// This is the SIP interface definition for the QPair based mapped types
|
||||
// specific to the QtGui module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (Qt_5_2_0 -)
|
||||
|
||||
%If (PyQt_OpenGL)
|
||||
|
||||
%MappedType QPair<QOpenGLTexture::Filter, QOpenGLTexture::Filter>
|
||||
/TypeHint="Tuple[QOpenGLTexture.Filter, QOpenGLTexture.Filter]"/
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <QOpenGLTexture>
|
||||
%End
|
||||
|
||||
%ConvertFromTypeCode
|
||||
return sipBuildResult(NULL, "(FF)", sipCpp->first,
|
||||
sipType_QOpenGLTexture_Filter, sipCpp->second,
|
||||
sipType_QOpenGLTexture_Filter);
|
||||
%End
|
||||
|
||||
%ConvertToTypeCode
|
||||
if (!sipIsErr)
|
||||
return (PySequence_Check(sipPy)
|
||||
#if PY_MAJOR_VERSION < 3
|
||||
&& !PyString_Check(sipPy)
|
||||
#endif
|
||||
&& !PyUnicode_Check(sipPy));
|
||||
|
||||
Py_ssize_t len = PySequence_Size(sipPy);
|
||||
|
||||
if (len != 2)
|
||||
{
|
||||
// A negative length should only be an internal error so let the
|
||||
// original exception stand.
|
||||
if (len >= 0)
|
||||
PyErr_Format(PyExc_TypeError,
|
||||
"sequence has %zd elements but 2 elements are expected",
|
||||
len);
|
||||
|
||||
*sipIsErr = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
PyObject *firstobj = PySequence_GetItem(sipPy, 0);
|
||||
|
||||
if (!firstobj)
|
||||
{
|
||||
*sipIsErr = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int firstv = sipConvertToEnum(firstobj, sipType_QOpenGLTexture_Filter);
|
||||
|
||||
if (PyErr_Occurred())
|
||||
{
|
||||
PyErr_Format(PyExc_TypeError,
|
||||
"the first element has type '%s' but 'QOpenGLTexture.Filter' is expected",
|
||||
sipPyTypeName(Py_TYPE(firstobj)));
|
||||
|
||||
*sipIsErr = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
PyObject *secondobj = PySequence_GetItem(sipPy, 1);
|
||||
|
||||
if (!secondobj)
|
||||
{
|
||||
Py_DECREF(firstobj);
|
||||
*sipIsErr = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int secondv = sipConvertToEnum(secondobj, sipType_QOpenGLTexture_Filter);
|
||||
|
||||
if (PyErr_Occurred())
|
||||
{
|
||||
PyErr_Format(PyExc_TypeError,
|
||||
"the second element has type '%s' but 'QOpenGLTexture.Filter' is expected",
|
||||
sipPyTypeName(Py_TYPE(secondobj)));
|
||||
|
||||
Py_DECREF(secondobj);
|
||||
Py_DECREF(firstobj);
|
||||
*sipIsErr = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
*sipCppPtr = new QPair<QOpenGLTexture::Filter, QOpenGLTexture::Filter>(
|
||||
static_cast<QOpenGLTexture::Filter>(firstv),
|
||||
static_cast<QOpenGLTexture::Filter>(secondv));
|
||||
|
||||
Py_DECREF(secondobj);
|
||||
Py_DECREF(firstobj);
|
||||
|
||||
return sipGetState(sipTransferObj);
|
||||
%End
|
||||
};
|
||||
|
||||
%End
|
||||
|
||||
%End
|
||||
|
||||
|
||||
%If (Qt_5_2_0 -)
|
||||
|
||||
%MappedType QPair<float, float> /TypeHint="Tuple[float, float]"/
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qpair.h>
|
||||
%End
|
||||
|
||||
%ConvertFromTypeCode
|
||||
return Py_BuildValue("(ff)", sipCpp->first, sipCpp->second);
|
||||
%End
|
||||
|
||||
%ConvertToTypeCode
|
||||
if (!sipIsErr)
|
||||
return (PySequence_Check(sipPy)
|
||||
#if PY_MAJOR_VERSION < 3
|
||||
&& !PyString_Check(sipPy)
|
||||
#endif
|
||||
&& !PyUnicode_Check(sipPy));
|
||||
|
||||
Py_ssize_t len = PySequence_Size(sipPy);
|
||||
|
||||
if (len != 2)
|
||||
{
|
||||
// A negative length should only be an internal error so let the
|
||||
// original exception stand.
|
||||
if (len >= 0)
|
||||
PyErr_Format(PyExc_TypeError,
|
||||
"sequence has %zd elements but 2 elements are expected",
|
||||
len);
|
||||
|
||||
*sipIsErr = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
PyObject *firstobj = PySequence_GetItem(sipPy, 0);
|
||||
|
||||
if (!firstobj)
|
||||
{
|
||||
*sipIsErr = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
PyErr_Clear();
|
||||
double first = PyFloat_AsDouble(firstobj);
|
||||
|
||||
if (PyErr_Occurred())
|
||||
{
|
||||
PyErr_Format(PyExc_TypeError,
|
||||
"the first element has type '%s' but 'float' is expected",
|
||||
sipPyTypeName(Py_TYPE(firstobj)));
|
||||
|
||||
*sipIsErr = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
PyObject *secondobj = PySequence_GetItem(sipPy, 1);
|
||||
|
||||
if (!secondobj)
|
||||
{
|
||||
Py_DECREF(firstobj);
|
||||
*sipIsErr = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
PyErr_Clear();
|
||||
double second = PyFloat_AsDouble(secondobj);
|
||||
|
||||
if (PyErr_Occurred())
|
||||
{
|
||||
PyErr_Format(PyExc_TypeError,
|
||||
"the second element has type '%s' but 'float' is expected",
|
||||
sipPyTypeName(Py_TYPE(secondobj)));
|
||||
|
||||
Py_DECREF(secondobj);
|
||||
Py_DECREF(firstobj);
|
||||
*sipIsErr = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
*sipCppPtr = new QPair<float, float>(first, second);;
|
||||
|
||||
Py_DECREF(secondobj);
|
||||
Py_DECREF(firstobj);
|
||||
|
||||
return sipGetState(sipTransferObj);
|
||||
%End
|
||||
};
|
||||
|
||||
%End
|
||||
@@ -0,0 +1,452 @@
|
||||
// This is the SIP interface definition for the QVector based mapped types
|
||||
// specific to the QtGui module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%MappedType QVector<unsigned>
|
||||
/TypeHintIn="Iterable[int]", TypeHintOut="List[int]",
|
||||
TypeHintValue="[]"/
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qvector.h>
|
||||
%End
|
||||
|
||||
%ConvertFromTypeCode
|
||||
PyObject *l = PyList_New(sipCpp->size());
|
||||
|
||||
if (!l)
|
||||
return 0;
|
||||
|
||||
for (int i = 0; i < sipCpp->size(); ++i)
|
||||
{
|
||||
// Convert to a Python long to make sure it doesn't get interpreted as
|
||||
// a signed value.
|
||||
PyObject *pobj = PyLong_FromUnsignedLong(sipCpp->value(i));
|
||||
|
||||
if (!pobj)
|
||||
{
|
||||
Py_DECREF(l);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
PyList_SetItem(l, i, pobj);
|
||||
}
|
||||
|
||||
return l;
|
||||
%End
|
||||
|
||||
%ConvertToTypeCode
|
||||
PyObject *iter = PyObject_GetIter(sipPy);
|
||||
|
||||
if (!sipIsErr)
|
||||
{
|
||||
PyErr_Clear();
|
||||
Py_XDECREF(iter);
|
||||
|
||||
return (iter
|
||||
#if PY_MAJOR_VERSION < 3
|
||||
&& !PyString_Check(sipPy)
|
||||
#endif
|
||||
&& !PyUnicode_Check(sipPy));
|
||||
}
|
||||
|
||||
if (!iter)
|
||||
{
|
||||
*sipIsErr = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
QVector<unsigned> *qv = new QVector<unsigned>;
|
||||
|
||||
for (Py_ssize_t i = 0; ; ++i)
|
||||
{
|
||||
PyErr_Clear();
|
||||
PyObject *itm = PyIter_Next(iter);
|
||||
|
||||
if (!itm)
|
||||
{
|
||||
if (PyErr_Occurred())
|
||||
{
|
||||
delete qv;
|
||||
Py_DECREF(iter);
|
||||
*sipIsErr = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
PyErr_Clear();
|
||||
unsigned long val = PyLong_AsUnsignedLongMask(itm);
|
||||
|
||||
if (PyErr_Occurred())
|
||||
{
|
||||
PyErr_Format(PyExc_TypeError,
|
||||
"index %zd has type '%s' but 'int' is expected", i,
|
||||
sipPyTypeName(Py_TYPE(itm)));
|
||||
|
||||
Py_DECREF(itm);
|
||||
delete qv;
|
||||
Py_DECREF(iter);
|
||||
*sipIsErr = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
qv->append(val);
|
||||
|
||||
Py_DECREF(itm);
|
||||
}
|
||||
|
||||
Py_DECREF(iter);
|
||||
|
||||
*sipCppPtr = qv;
|
||||
|
||||
return sipGetState(sipTransferObj);
|
||||
%End
|
||||
};
|
||||
|
||||
|
||||
%MappedType QVector<float>
|
||||
/TypeHintIn="Iterable[float]", TypeHintOut="List[float]",
|
||||
TypeHintValue="[]"/
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qvector.h>
|
||||
%End
|
||||
|
||||
%ConvertFromTypeCode
|
||||
PyObject *l = PyList_New(sipCpp->size());
|
||||
|
||||
if (!l)
|
||||
return 0;
|
||||
|
||||
for (int i = 0; i < sipCpp->size(); ++i)
|
||||
{
|
||||
PyObject *pobj = PyFloat_FromDouble(sipCpp->value(i));
|
||||
|
||||
if (!pobj)
|
||||
{
|
||||
Py_DECREF(l);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
PyList_SetItem(l, i, pobj);
|
||||
}
|
||||
|
||||
return l;
|
||||
%End
|
||||
|
||||
%ConvertToTypeCode
|
||||
PyObject *iter = PyObject_GetIter(sipPy);
|
||||
|
||||
if (!sipIsErr)
|
||||
{
|
||||
PyErr_Clear();
|
||||
Py_XDECREF(iter);
|
||||
|
||||
return (iter
|
||||
#if PY_MAJOR_VERSION < 3
|
||||
&& !PyString_Check(sipPy)
|
||||
#endif
|
||||
&& !PyUnicode_Check(sipPy));
|
||||
}
|
||||
|
||||
if (!iter)
|
||||
{
|
||||
*sipIsErr = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
QVector<float> *qv = new QVector<float>;
|
||||
|
||||
for (Py_ssize_t i = 0; ; ++i)
|
||||
{
|
||||
PyErr_Clear();
|
||||
PyObject *itm = PyIter_Next(iter);
|
||||
|
||||
if (!itm)
|
||||
{
|
||||
if (PyErr_Occurred())
|
||||
{
|
||||
delete qv;
|
||||
Py_DECREF(iter);
|
||||
*sipIsErr = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
PyErr_Clear();
|
||||
double val = PyFloat_AsDouble(itm);
|
||||
|
||||
if (PyErr_Occurred())
|
||||
{
|
||||
PyErr_Format(PyExc_TypeError,
|
||||
"index %zd has type '%s' but 'int' is expected", i,
|
||||
sipPyTypeName(Py_TYPE(itm)));
|
||||
|
||||
Py_DECREF(itm);
|
||||
delete qv;
|
||||
Py_DECREF(iter);
|
||||
*sipIsErr = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
qv->append(val);
|
||||
|
||||
Py_DECREF(itm);
|
||||
}
|
||||
|
||||
Py_DECREF(iter);
|
||||
|
||||
*sipCppPtr = qv;
|
||||
|
||||
return sipGetState(sipTransferObj);
|
||||
%End
|
||||
};
|
||||
|
||||
|
||||
%If (PyQt_qreal_double)
|
||||
|
||||
%MappedType QVector<qreal>
|
||||
/TypeHintIn="Iterable[float]", TypeHintOut="List[float]",
|
||||
TypeHintValue="[]"/
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qvector.h>
|
||||
%End
|
||||
|
||||
%ConvertFromTypeCode
|
||||
PyObject *l = PyList_New(sipCpp->size());
|
||||
|
||||
if (!l)
|
||||
return 0;
|
||||
|
||||
for (int i = 0; i < sipCpp->size(); ++i)
|
||||
{
|
||||
PyObject *pobj = PyFloat_FromDouble(sipCpp->value(i));
|
||||
|
||||
if (!pobj)
|
||||
{
|
||||
Py_DECREF(l);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
PyList_SetItem(l, i, pobj);
|
||||
}
|
||||
|
||||
return l;
|
||||
%End
|
||||
|
||||
%ConvertToTypeCode
|
||||
PyObject *iter = PyObject_GetIter(sipPy);
|
||||
|
||||
if (!sipIsErr)
|
||||
{
|
||||
PyErr_Clear();
|
||||
Py_XDECREF(iter);
|
||||
|
||||
return (iter
|
||||
#if PY_MAJOR_VERSION < 3
|
||||
&& !PyString_Check(sipPy)
|
||||
#endif
|
||||
&& !PyUnicode_Check(sipPy));
|
||||
}
|
||||
|
||||
if (!iter)
|
||||
{
|
||||
*sipIsErr = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
QVector<qreal> *qv = new QVector<qreal>;
|
||||
|
||||
for (Py_ssize_t i = 0; ; ++i)
|
||||
{
|
||||
PyErr_Clear();
|
||||
PyObject *itm = PyIter_Next(iter);
|
||||
|
||||
if (!itm)
|
||||
{
|
||||
if (PyErr_Occurred())
|
||||
{
|
||||
delete qv;
|
||||
Py_DECREF(iter);
|
||||
*sipIsErr = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
PyErr_Clear();
|
||||
double val = PyFloat_AsDouble(itm);
|
||||
|
||||
if (PyErr_Occurred())
|
||||
{
|
||||
PyErr_Format(PyExc_TypeError,
|
||||
"index %zd has type '%s' but 'int' is expected", i,
|
||||
sipPyTypeName(Py_TYPE(itm)));
|
||||
|
||||
Py_DECREF(itm);
|
||||
delete qv;
|
||||
Py_DECREF(iter);
|
||||
*sipIsErr = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
qv->append(val);
|
||||
|
||||
Py_DECREF(itm);
|
||||
}
|
||||
|
||||
Py_DECREF(iter);
|
||||
|
||||
*sipCppPtr = qv;
|
||||
|
||||
return sipGetState(sipTransferObj);
|
||||
%End
|
||||
};
|
||||
|
||||
%End
|
||||
|
||||
|
||||
%If (PyQt_Desktop_OpenGL)
|
||||
|
||||
%MappedType QVector<GLuint64>
|
||||
/TypeHintIn="Iterable[int]", TypeHintOut="List[int]",
|
||||
TypeHintValue="[]"/
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qvector.h>
|
||||
#include <qopengl.h>
|
||||
%End
|
||||
|
||||
%ConvertFromTypeCode
|
||||
PyObject *l = PyList_New(sipCpp->size());
|
||||
|
||||
if (!l)
|
||||
return 0;
|
||||
|
||||
for (int i = 0; i < sipCpp->size(); ++i)
|
||||
{
|
||||
// Convert to a Python long to make sure it doesn't get interpreted as
|
||||
// a signed value.
|
||||
PyObject *pobj = PyLong_FromUnsignedLongLong(sipCpp->value(i));
|
||||
|
||||
if (!pobj)
|
||||
{
|
||||
Py_DECREF(l);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
PyList_SetItem(l, i, pobj);
|
||||
}
|
||||
|
||||
return l;
|
||||
%End
|
||||
|
||||
%ConvertToTypeCode
|
||||
PyObject *iter = PyObject_GetIter(sipPy);
|
||||
|
||||
if (!sipIsErr)
|
||||
{
|
||||
PyErr_Clear();
|
||||
Py_XDECREF(iter);
|
||||
|
||||
return (iter
|
||||
#if PY_MAJOR_VERSION < 3
|
||||
&& !PyString_Check(sipPy)
|
||||
#endif
|
||||
&& !PyUnicode_Check(sipPy));
|
||||
}
|
||||
|
||||
if (!iter)
|
||||
{
|
||||
*sipIsErr = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
QVector<GLuint64> *qv = new QVector<GLuint64>;
|
||||
|
||||
for (Py_ssize_t i = 0; ; ++i)
|
||||
{
|
||||
PyErr_Clear();
|
||||
PyObject *itm = PyIter_Next(iter);
|
||||
|
||||
if (!itm)
|
||||
{
|
||||
if (PyErr_Occurred())
|
||||
{
|
||||
delete qv;
|
||||
Py_DECREF(iter);
|
||||
*sipIsErr = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
PyErr_Clear();
|
||||
unsigned PY_LONG_LONG val = PyLong_AsUnsignedLongLongMask(itm);
|
||||
|
||||
if (PyErr_Occurred())
|
||||
{
|
||||
PyErr_Format(PyExc_TypeError,
|
||||
"index %zd has type '%s' but 'int' is expected", i,
|
||||
sipPyTypeName(Py_TYPE(itm)));
|
||||
|
||||
Py_DECREF(itm);
|
||||
delete qv;
|
||||
Py_DECREF(iter);
|
||||
*sipIsErr = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
qv->append(val);
|
||||
|
||||
Py_DECREF(itm);
|
||||
}
|
||||
|
||||
Py_DECREF(iter);
|
||||
|
||||
*sipCppPtr = qv;
|
||||
|
||||
return sipGetState(sipTransferObj);
|
||||
%End
|
||||
};
|
||||
|
||||
%End
|
||||
@@ -0,0 +1,161 @@
|
||||
// qquaternion.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%ModuleCode
|
||||
#include <qquaternion.h>
|
||||
%End
|
||||
|
||||
class QQuaternion
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qquaternion.h>
|
||||
%End
|
||||
|
||||
%PickleCode
|
||||
sipRes = Py_BuildValue((char *)"dddd", (double)sipCpp->scalar(),
|
||||
(double)sipCpp->x(), (double)sipCpp->y(), (double)sipCpp->z());
|
||||
%End
|
||||
|
||||
public:
|
||||
QQuaternion();
|
||||
QQuaternion(float aScalar, float xpos, float ypos, float zpos);
|
||||
QQuaternion(float aScalar, const QVector3D &aVector);
|
||||
explicit QQuaternion(const QVector4D &aVector);
|
||||
SIP_PYOBJECT __repr__() const /TypeHint="str"/;
|
||||
%MethodCode
|
||||
PyObject *scalar = PyFloat_FromDouble(sipCpp->scalar());
|
||||
PyObject *x = PyFloat_FromDouble(sipCpp->x());
|
||||
PyObject *y = PyFloat_FromDouble(sipCpp->y());
|
||||
PyObject *z = PyFloat_FromDouble(sipCpp->z());
|
||||
|
||||
if (scalar && x && y && z)
|
||||
{
|
||||
#if PY_MAJOR_VERSION >= 3
|
||||
sipRes = PyUnicode_FromFormat("PyQt5.QtGui.QQuaternion(%R, %R, %R, %R)",
|
||||
scalar, x, y, z);
|
||||
#else
|
||||
sipRes = PyString_FromString("PyQt5.QtGui.QQuaternion(");
|
||||
PyString_ConcatAndDel(&sipRes, PyObject_Repr(scalar));
|
||||
PyString_ConcatAndDel(&sipRes, PyString_FromString(", "));
|
||||
PyString_ConcatAndDel(&sipRes, PyObject_Repr(x));
|
||||
PyString_ConcatAndDel(&sipRes, PyString_FromString(", "));
|
||||
PyString_ConcatAndDel(&sipRes, PyObject_Repr(y));
|
||||
PyString_ConcatAndDel(&sipRes, PyString_FromString(", "));
|
||||
PyString_ConcatAndDel(&sipRes, PyObject_Repr(z));
|
||||
PyString_ConcatAndDel(&sipRes, PyString_FromString(")"));
|
||||
#endif
|
||||
}
|
||||
|
||||
Py_XDECREF(scalar);
|
||||
Py_XDECREF(x);
|
||||
Py_XDECREF(y);
|
||||
Py_XDECREF(z);
|
||||
%End
|
||||
|
||||
float length() const;
|
||||
float lengthSquared() const;
|
||||
QQuaternion normalized() const;
|
||||
void normalize();
|
||||
QVector3D rotatedVector(const QVector3D &vector) const;
|
||||
static QQuaternion fromAxisAndAngle(const QVector3D &axis, float angle);
|
||||
static QQuaternion fromAxisAndAngle(float x, float y, float z, float angle);
|
||||
static QQuaternion slerp(const QQuaternion &q1, const QQuaternion &q2, float t);
|
||||
static QQuaternion nlerp(const QQuaternion &q1, const QQuaternion &q2, float t);
|
||||
bool isNull() const;
|
||||
bool isIdentity() const;
|
||||
float x() const;
|
||||
float y() const;
|
||||
float z() const;
|
||||
float scalar() const;
|
||||
void setX(float aX);
|
||||
void setY(float aY);
|
||||
void setZ(float aZ);
|
||||
void setScalar(float aScalar);
|
||||
QQuaternion conjugate() const;
|
||||
QQuaternion &operator+=(const QQuaternion &quaternion);
|
||||
QQuaternion &operator-=(const QQuaternion &quaternion);
|
||||
QQuaternion &operator*=(float factor);
|
||||
QQuaternion &operator*=(const QQuaternion &quaternion);
|
||||
QQuaternion &operator/=(float divisor);
|
||||
void setVector(const QVector3D &aVector);
|
||||
QVector3D vector() const;
|
||||
void setVector(float aX, float aY, float aZ);
|
||||
QVector4D toVector4D() const;
|
||||
%If (Qt_5_5_0 -)
|
||||
void getAxisAndAngle(QVector3D *axis /Out/, float *angle) const;
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
void getEulerAngles(float *pitch, float *yaw, float *roll) const;
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
static QQuaternion fromEulerAngles(float pitch, float yaw, float roll);
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
QMatrix3x3 toRotationMatrix() const;
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
static QQuaternion fromRotationMatrix(const QMatrix3x3 &rot3x3);
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
void getAxes(QVector3D *xAxis /Out/, QVector3D *yAxis /Out/, QVector3D *zAxis /Out/) const;
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
static QQuaternion fromAxes(const QVector3D &xAxis, const QVector3D &yAxis, const QVector3D &zAxis);
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
static QQuaternion fromDirection(const QVector3D &direction, const QVector3D &up);
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
static QQuaternion rotationTo(const QVector3D &from, const QVector3D &to);
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
static float dotProduct(const QQuaternion &q1, const QQuaternion &q2);
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
QQuaternion inverted() const;
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
QQuaternion conjugated() const;
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
QVector3D toEulerAngles() const;
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
static QQuaternion fromEulerAngles(const QVector3D &eulerAngles);
|
||||
%End
|
||||
};
|
||||
|
||||
const QQuaternion operator*(const QQuaternion &q1, const QQuaternion &q2);
|
||||
bool operator==(const QQuaternion &q1, const QQuaternion &q2);
|
||||
bool operator!=(const QQuaternion &q1, const QQuaternion &q2);
|
||||
const QQuaternion operator+(const QQuaternion &q1, const QQuaternion &q2);
|
||||
const QQuaternion operator-(const QQuaternion &q1, const QQuaternion &q2);
|
||||
const QQuaternion operator*(float factor, const QQuaternion &quaternion);
|
||||
const QQuaternion operator*(const QQuaternion &quaternion, float factor);
|
||||
const QQuaternion operator-(const QQuaternion &quaternion);
|
||||
const QQuaternion operator/(const QQuaternion &quaternion, float divisor);
|
||||
bool qFuzzyCompare(const QQuaternion &q1, const QQuaternion &q2);
|
||||
QDataStream &operator<<(QDataStream &, const QQuaternion & /Constrained/) /ReleaseGIL/;
|
||||
QDataStream &operator>>(QDataStream &, QQuaternion & /Constrained/) /ReleaseGIL/;
|
||||
%If (Qt_5_5_0 -)
|
||||
QVector3D operator*(const QQuaternion &quaternion, const QVector3D &vec);
|
||||
%End
|
||||
@@ -0,0 +1,41 @@
|
||||
// qrasterwindow.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (Qt_5_4_0 -)
|
||||
|
||||
class QRasterWindow : public QPaintDeviceWindow
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qrasterwindow.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
explicit QRasterWindow(QWindow *parent /TransferThis/ = 0);
|
||||
%If (Qt_5_9_0 -)
|
||||
virtual ~QRasterWindow();
|
||||
%End
|
||||
|
||||
protected:
|
||||
virtual int metric(QPaintDevice::PaintDeviceMetric metric) const;
|
||||
};
|
||||
|
||||
%End
|
||||
@@ -0,0 +1,106 @@
|
||||
// qrawfont.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (PyQt_RawFont)
|
||||
|
||||
class QRawFont
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qrawfont.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum AntialiasingType
|
||||
{
|
||||
PixelAntialiasing,
|
||||
SubPixelAntialiasing,
|
||||
};
|
||||
|
||||
QRawFont();
|
||||
QRawFont(const QString &fileName, qreal pixelSize, QFont::HintingPreference hintingPreference = QFont::PreferDefaultHinting);
|
||||
QRawFont(const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference = QFont::PreferDefaultHinting);
|
||||
QRawFont(const QRawFont &other);
|
||||
~QRawFont();
|
||||
bool isValid() const;
|
||||
bool operator==(const QRawFont &other) const;
|
||||
bool operator!=(const QRawFont &other) const;
|
||||
QString familyName() const;
|
||||
QString styleName() const;
|
||||
QFont::Style style() const;
|
||||
int weight() const;
|
||||
QVector<unsigned int> glyphIndexesForString(const QString &text) const;
|
||||
QVector<QPointF> advancesForGlyphIndexes(const QVector<unsigned int> &glyphIndexes) const;
|
||||
%If (Qt_5_1_0 -)
|
||||
QVector<QPointF> advancesForGlyphIndexes(const QVector<unsigned int> &glyphIndexes, QRawFont::LayoutFlags layoutFlags) const;
|
||||
%End
|
||||
QImage alphaMapForGlyph(quint32 glyphIndex, QRawFont::AntialiasingType antialiasingType = QRawFont::SubPixelAntialiasing, const QTransform &transform = QTransform()) const;
|
||||
QPainterPath pathForGlyph(quint32 glyphIndex) const;
|
||||
void setPixelSize(qreal pixelSize);
|
||||
qreal pixelSize() const;
|
||||
QFont::HintingPreference hintingPreference() const;
|
||||
qreal ascent() const;
|
||||
qreal descent() const;
|
||||
qreal leading() const;
|
||||
qreal xHeight() const;
|
||||
qreal averageCharWidth() const;
|
||||
qreal maxCharWidth() const;
|
||||
qreal unitsPerEm() const;
|
||||
void loadFromFile(const QString &fileName, qreal pixelSize, QFont::HintingPreference hintingPreference) /ReleaseGIL/;
|
||||
void loadFromData(const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference) /ReleaseGIL/;
|
||||
bool supportsCharacter(uint ucs4) const;
|
||||
bool supportsCharacter(QChar character) const;
|
||||
QList<QFontDatabase::WritingSystem> supportedWritingSystems() const;
|
||||
QByteArray fontTable(const char *tagName) const;
|
||||
static QRawFont fromFont(const QFont &font, QFontDatabase::WritingSystem writingSystem = QFontDatabase::Any);
|
||||
QRectF boundingRect(quint32 glyphIndex) const;
|
||||
qreal lineThickness() const;
|
||||
qreal underlinePosition() const;
|
||||
void swap(QRawFont &other /Constrained/);
|
||||
%If (Qt_5_1_0 -)
|
||||
|
||||
enum LayoutFlag
|
||||
{
|
||||
SeparateAdvances,
|
||||
KernedAdvances,
|
||||
UseDesignMetrics,
|
||||
};
|
||||
|
||||
%End
|
||||
%If (Qt_5_1_0 -)
|
||||
typedef QFlags<QRawFont::LayoutFlag> LayoutFlags;
|
||||
%End
|
||||
%If (Qt_5_8_0 -)
|
||||
qreal capHeight() const;
|
||||
%End
|
||||
%If (Qt_5_8_0 -)
|
||||
long __hash__() const;
|
||||
%MethodCode
|
||||
sipRes = qHash(*sipCpp);
|
||||
%End
|
||||
|
||||
%End
|
||||
};
|
||||
|
||||
%End
|
||||
%If (Qt_5_1_0 -)
|
||||
QFlags<QRawFont::LayoutFlag> operator|(QRawFont::LayoutFlag f1, QFlags<QRawFont::LayoutFlag> f2);
|
||||
%End
|
||||
@@ -0,0 +1,148 @@
|
||||
// qregion.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QRegion
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qregion.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum RegionType
|
||||
{
|
||||
Rectangle,
|
||||
Ellipse,
|
||||
};
|
||||
|
||||
QRegion();
|
||||
QRegion(int x, int y, int w, int h, QRegion::RegionType type = QRegion::Rectangle);
|
||||
QRegion(const QRect &r, QRegion::RegionType type = QRegion::Rectangle);
|
||||
QRegion(const QPolygon &a, Qt::FillRule fillRule = Qt::OddEvenFill);
|
||||
QRegion(const QBitmap &bitmap);
|
||||
QRegion(const QRegion ®ion);
|
||||
QRegion(const QVariant &variant /GetWrapper/) /NoDerived/;
|
||||
%MethodCode
|
||||
if (a0->canConvert<QRegion>())
|
||||
sipCpp = new QRegion(a0->value<QRegion>());
|
||||
else
|
||||
sipError = sipBadCallableArg(0, a0Wrapper);
|
||||
%End
|
||||
|
||||
~QRegion();
|
||||
bool isEmpty() const;
|
||||
int __bool__() const;
|
||||
%MethodCode
|
||||
sipRes = !sipCpp->isEmpty();
|
||||
%End
|
||||
|
||||
bool contains(const QPoint &p) const;
|
||||
int __contains__(const QPoint &p) const;
|
||||
%MethodCode
|
||||
sipRes = sipCpp->contains(*a0);
|
||||
%End
|
||||
|
||||
bool contains(const QRect &r) const;
|
||||
int __contains__(const QRect &r) const;
|
||||
%MethodCode
|
||||
sipRes = sipCpp->contains(*a0);
|
||||
%End
|
||||
|
||||
void translate(int dx, int dy);
|
||||
void translate(const QPoint &p);
|
||||
QRegion translated(int dx, int dy) const;
|
||||
QRegion translated(const QPoint &p) const;
|
||||
QRegion united(const QRegion &r) const;
|
||||
QRegion united(const QRect &r) const;
|
||||
QRect boundingRect() const;
|
||||
QVector<QRect> rects() const;
|
||||
%If (Qt_5_4_0 -)
|
||||
QRegion operator|(const QRegion &r) const;
|
||||
%End
|
||||
void setRects(const QVector<QRect> &);
|
||||
%MethodCode
|
||||
if (a0->size())
|
||||
sipCpp->setRects(a0->data(), a0->size());
|
||||
else
|
||||
sipCpp->setRects(0, 0);
|
||||
%End
|
||||
|
||||
%If (- Qt_5_4_0)
|
||||
const QRegion operator|(const QRegion &r) const;
|
||||
%End
|
||||
%If (Qt_5_4_0 -)
|
||||
QRegion operator+(const QRegion &r) const;
|
||||
%End
|
||||
%If (- Qt_5_4_0)
|
||||
const QRegion operator+(const QRegion &r) const;
|
||||
%End
|
||||
%If (Qt_5_4_0 -)
|
||||
QRegion operator+(const QRect &r) const;
|
||||
%End
|
||||
%If (- Qt_5_4_0)
|
||||
const QRegion operator+(const QRect &r) const;
|
||||
%End
|
||||
%If (Qt_5_4_0 -)
|
||||
QRegion operator&(const QRegion &r) const;
|
||||
%End
|
||||
%If (- Qt_5_4_0)
|
||||
const QRegion operator&(const QRegion &r) const;
|
||||
%End
|
||||
%If (Qt_5_4_0 -)
|
||||
QRegion operator&(const QRect &r) const;
|
||||
%End
|
||||
%If (- Qt_5_4_0)
|
||||
const QRegion operator&(const QRect &r) const;
|
||||
%End
|
||||
%If (Qt_5_4_0 -)
|
||||
QRegion operator-(const QRegion &r) const;
|
||||
%End
|
||||
%If (- Qt_5_4_0)
|
||||
const QRegion operator-(const QRegion &r) const;
|
||||
%End
|
||||
%If (Qt_5_4_0 -)
|
||||
QRegion operator^(const QRegion &r) const;
|
||||
%End
|
||||
%If (- Qt_5_4_0)
|
||||
const QRegion operator^(const QRegion &r) const;
|
||||
%End
|
||||
QRegion &operator|=(const QRegion &r);
|
||||
QRegion &operator+=(const QRegion &r);
|
||||
QRegion &operator+=(const QRect &r);
|
||||
QRegion &operator&=(const QRegion &r);
|
||||
QRegion &operator&=(const QRect &r);
|
||||
QRegion &operator-=(const QRegion &r);
|
||||
QRegion &operator^=(const QRegion &r);
|
||||
bool operator==(const QRegion &r) const;
|
||||
bool operator!=(const QRegion &r) const;
|
||||
QRegion intersected(const QRegion &r) const;
|
||||
QRegion intersected(const QRect &r) const;
|
||||
QRegion subtracted(const QRegion &r) const;
|
||||
QRegion xored(const QRegion &r) const;
|
||||
bool intersects(const QRegion &r) const;
|
||||
bool intersects(const QRect &r) const;
|
||||
int rectCount() const;
|
||||
void swap(QRegion &other /Constrained/);
|
||||
bool isNull() const;
|
||||
};
|
||||
|
||||
QDataStream &operator<<(QDataStream &, const QRegion & /Constrained/) /ReleaseGIL/;
|
||||
QDataStream &operator>>(QDataStream &, QRegion & /Constrained/) /ReleaseGIL/;
|
||||
@@ -0,0 +1,42 @@
|
||||
// qrgb.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%ModuleCode
|
||||
#include <qrgb.h>
|
||||
%End
|
||||
|
||||
typedef unsigned int QRgb;
|
||||
int qRed(QRgb rgb);
|
||||
int qGreen(QRgb rgb);
|
||||
int qBlue(QRgb rgb);
|
||||
int qAlpha(QRgb rgb);
|
||||
QRgb qRgb(int r, int g, int b);
|
||||
QRgb qRgba(int r, int g, int b, int a);
|
||||
int qGray(int r, int g, int b);
|
||||
int qGray(QRgb rgb);
|
||||
bool qIsGray(QRgb rgb);
|
||||
%If (Qt_5_3_0 -)
|
||||
QRgb qPremultiply(QRgb x);
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
QRgb qUnpremultiply(QRgb p);
|
||||
%End
|
||||
@@ -0,0 +1,90 @@
|
||||
// qrgba64.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (Qt_5_6_0 -)
|
||||
%ModuleCode
|
||||
#include <qrgba64.h>
|
||||
%End
|
||||
%End
|
||||
|
||||
%If (Qt_5_6_0 -)
|
||||
|
||||
class QRgba64
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qrgba64.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
%If (Qt_5_7_0 -)
|
||||
QRgba64();
|
||||
%End
|
||||
static QRgba64 fromRgba64(quint64 c);
|
||||
static QRgba64 fromRgba64(quint16 red, quint16 green, quint16 blue, quint16 alpha);
|
||||
static QRgba64 fromRgba(quint8 red, quint8 green, quint8 blue, quint8 alpha);
|
||||
static QRgba64 fromArgb32(uint rgb);
|
||||
bool isOpaque() const;
|
||||
bool isTransparent() const;
|
||||
quint16 red() const;
|
||||
quint16 green() const;
|
||||
quint16 blue() const;
|
||||
quint16 alpha() const;
|
||||
void setRed(quint16 _red);
|
||||
void setGreen(quint16 _green);
|
||||
void setBlue(quint16 _blue);
|
||||
void setAlpha(quint16 _alpha);
|
||||
quint8 red8() const;
|
||||
quint8 green8() const;
|
||||
quint8 blue8() const;
|
||||
quint8 alpha8() const;
|
||||
uint toArgb32() const;
|
||||
ushort toRgb16() const;
|
||||
QRgba64 premultiplied() const;
|
||||
QRgba64 unpremultiplied() const;
|
||||
operator quint64() const;
|
||||
};
|
||||
|
||||
%End
|
||||
%If (Qt_5_6_0 -)
|
||||
QRgba64 qRgba64(quint16 r, quint16 g, quint16 b, quint16 a);
|
||||
%End
|
||||
%If (Qt_5_6_0 -)
|
||||
QRgba64 qRgba64(quint64 c);
|
||||
%End
|
||||
%If (Qt_5_6_0 -)
|
||||
QRgba64 qPremultiply(QRgba64 c);
|
||||
%End
|
||||
%If (Qt_5_6_0 -)
|
||||
QRgba64 qUnpremultiply(QRgba64 c);
|
||||
%End
|
||||
%If (Qt_5_6_0 -)
|
||||
uint qRed(QRgba64 rgb);
|
||||
%End
|
||||
%If (Qt_5_6_0 -)
|
||||
uint qGreen(QRgba64 rgb);
|
||||
%End
|
||||
%If (Qt_5_6_0 -)
|
||||
uint qBlue(QRgba64 rgb);
|
||||
%End
|
||||
%If (Qt_5_6_0 -)
|
||||
uint qAlpha(QRgba64 rgb);
|
||||
%End
|
||||
@@ -0,0 +1,96 @@
|
||||
// qscreen.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QScreen : public QObject /NoDefaultCtors/
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qscreen.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
%If (Qt_5_4_0 -)
|
||||
virtual ~QScreen();
|
||||
%End
|
||||
QString name() const;
|
||||
int depth() const;
|
||||
QSize size() const;
|
||||
QRect geometry() const;
|
||||
QSizeF physicalSize() const;
|
||||
qreal physicalDotsPerInchX() const;
|
||||
qreal physicalDotsPerInchY() const;
|
||||
qreal physicalDotsPerInch() const;
|
||||
qreal logicalDotsPerInchX() const;
|
||||
qreal logicalDotsPerInchY() const;
|
||||
qreal logicalDotsPerInch() const;
|
||||
QSize availableSize() const;
|
||||
QRect availableGeometry() const;
|
||||
QList<QScreen *> virtualSiblings() const;
|
||||
QSize virtualSize() const;
|
||||
QRect virtualGeometry() const;
|
||||
QSize availableVirtualSize() const;
|
||||
QRect availableVirtualGeometry() const;
|
||||
%If (Qt_5_2_0 -)
|
||||
Qt::ScreenOrientation nativeOrientation() const;
|
||||
%End
|
||||
Qt::ScreenOrientation primaryOrientation() const;
|
||||
Qt::ScreenOrientation orientation() const;
|
||||
Qt::ScreenOrientations orientationUpdateMask() const;
|
||||
void setOrientationUpdateMask(Qt::ScreenOrientations mask);
|
||||
int angleBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b) const;
|
||||
QTransform transformBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b, const QRect &target) const;
|
||||
QRect mapBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b, const QRect &rect) const;
|
||||
bool isPortrait(Qt::ScreenOrientation orientation) const;
|
||||
bool isLandscape(Qt::ScreenOrientation orientation) const;
|
||||
QPixmap grabWindow(WId window, int x = 0, int y = 0, int width = -1, int height = -1);
|
||||
qreal refreshRate() const;
|
||||
qreal devicePixelRatio() const;
|
||||
|
||||
signals:
|
||||
void geometryChanged(const QRect &geometry);
|
||||
void physicalDotsPerInchChanged(qreal dpi);
|
||||
void logicalDotsPerInchChanged(qreal dpi);
|
||||
void primaryOrientationChanged(Qt::ScreenOrientation orientation);
|
||||
void orientationChanged(Qt::ScreenOrientation orientation);
|
||||
void refreshRateChanged(qreal refreshRate);
|
||||
void physicalSizeChanged(const QSizeF &size);
|
||||
void virtualGeometryChanged(const QRect &rect);
|
||||
%If (Qt_5_4_0 -)
|
||||
void availableGeometryChanged(const QRect &geometry);
|
||||
%End
|
||||
|
||||
public:
|
||||
%If (Qt_5_9_0 -)
|
||||
QString manufacturer() const;
|
||||
%End
|
||||
%If (Qt_5_9_0 -)
|
||||
QString model() const;
|
||||
%End
|
||||
%If (Qt_5_9_0 -)
|
||||
QString serialNumber() const;
|
||||
%End
|
||||
%If (Qt_5_15_0 -)
|
||||
QScreen *virtualSiblingAt(QPoint point);
|
||||
%End
|
||||
|
||||
private:
|
||||
QScreen(const QScreen &);
|
||||
};
|
||||
@@ -0,0 +1,62 @@
|
||||
// qsessionmanager.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (PyQt_SessionManager)
|
||||
|
||||
class QSessionManager : public QObject
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qsessionmanager.h>
|
||||
%End
|
||||
|
||||
QSessionManager(QGuiApplication *app /TransferThis/, QString &id, QString &key);
|
||||
virtual ~QSessionManager();
|
||||
|
||||
public:
|
||||
QString sessionId() const;
|
||||
QString sessionKey() const;
|
||||
bool allowsInteraction();
|
||||
bool allowsErrorInteraction();
|
||||
void release();
|
||||
void cancel();
|
||||
|
||||
enum RestartHint
|
||||
{
|
||||
RestartIfRunning,
|
||||
RestartAnyway,
|
||||
RestartImmediately,
|
||||
RestartNever,
|
||||
};
|
||||
|
||||
void setRestartHint(QSessionManager::RestartHint);
|
||||
QSessionManager::RestartHint restartHint() const;
|
||||
void setRestartCommand(const QStringList &);
|
||||
QStringList restartCommand() const;
|
||||
void setDiscardCommand(const QStringList &);
|
||||
QStringList discardCommand() const;
|
||||
void setManagerProperty(const QString &name, const QString &value);
|
||||
void setManagerProperty(const QString &name, const QStringList &value);
|
||||
bool isPhase2() const;
|
||||
void requestPhase2();
|
||||
};
|
||||
|
||||
%End
|
||||
@@ -0,0 +1,223 @@
|
||||
// qstandarditemmodel.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QStandardItemModel : public QAbstractItemModel
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qstandarditemmodel.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
explicit QStandardItemModel(QObject *parent /TransferThis/ = 0);
|
||||
QStandardItemModel(int rows, int columns, QObject *parent /TransferThis/ = 0);
|
||||
virtual ~QStandardItemModel();
|
||||
virtual QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
|
||||
virtual QModelIndex parent(const QModelIndex &child) const;
|
||||
QObject *parent() const;
|
||||
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
virtual bool hasChildren(const QModelIndex &parent = QModelIndex()) const;
|
||||
virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
|
||||
virtual bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
|
||||
virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
||||
virtual bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value, int role = Qt::EditRole);
|
||||
virtual bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex());
|
||||
virtual bool insertColumns(int column, int count, const QModelIndex &parent = QModelIndex());
|
||||
virtual bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex());
|
||||
virtual bool removeColumns(int column, int count, const QModelIndex &parent = QModelIndex());
|
||||
virtual Qt::ItemFlags flags(const QModelIndex &index) const;
|
||||
void clear();
|
||||
virtual Qt::DropActions supportedDropActions() const;
|
||||
virtual QMap<int, QVariant> itemData(const QModelIndex &index) const;
|
||||
virtual bool setItemData(const QModelIndex &index, const QMap<int, QVariant> &roles);
|
||||
virtual void sort(int column, Qt::SortOrder order = Qt::AscendingOrder);
|
||||
QStandardItem *itemFromIndex(const QModelIndex &index) const;
|
||||
QModelIndex indexFromItem(const QStandardItem *item) const;
|
||||
QStandardItem *item(int row, int column = 0) const;
|
||||
void setItem(int row, int column, QStandardItem *item /Transfer/);
|
||||
void setItem(int arow, QStandardItem *aitem /Transfer/);
|
||||
QStandardItem *invisibleRootItem() const /Transfer/;
|
||||
QStandardItem *horizontalHeaderItem(int column) const;
|
||||
void setHorizontalHeaderItem(int column, QStandardItem *item /Transfer/);
|
||||
QStandardItem *verticalHeaderItem(int row) const;
|
||||
void setVerticalHeaderItem(int row, QStandardItem *item /Transfer/);
|
||||
void setHorizontalHeaderLabels(const QStringList &labels);
|
||||
void setVerticalHeaderLabels(const QStringList &labels);
|
||||
void setRowCount(int rows);
|
||||
void setColumnCount(int columns);
|
||||
void appendRow(const QList<QStandardItem *> &items /Transfer/);
|
||||
void appendColumn(const QList<QStandardItem *> &items /Transfer/);
|
||||
void insertRow(int row, const QList<QStandardItem *> &items /Transfer/);
|
||||
void insertColumn(int column, const QList<QStandardItem *> &items /Transfer/);
|
||||
QStandardItem *takeItem(int row, int column = 0) /TransferBack/;
|
||||
QList<QStandardItem *> takeRow(int row) /TransferBack/;
|
||||
QList<QStandardItem *> takeColumn(int column) /TransferBack/;
|
||||
QStandardItem *takeHorizontalHeaderItem(int column) /TransferBack/;
|
||||
QStandardItem *takeVerticalHeaderItem(int row) /TransferBack/;
|
||||
const QStandardItem *itemPrototype() const;
|
||||
void setItemPrototype(const QStandardItem *item /Transfer/);
|
||||
QList<QStandardItem *> findItems(const QString &text, Qt::MatchFlags flags = Qt::MatchExactly, int column = 0) const;
|
||||
int sortRole() const;
|
||||
void setSortRole(int role);
|
||||
void appendRow(QStandardItem *aitem /Transfer/);
|
||||
void insertRow(int arow, QStandardItem *aitem /Transfer/);
|
||||
bool insertRow(int row, const QModelIndex &parent = QModelIndex());
|
||||
bool insertColumn(int column, const QModelIndex &parent = QModelIndex());
|
||||
virtual QStringList mimeTypes() const;
|
||||
virtual QMimeData *mimeData(const QModelIndexList &indexes) const /TransferBack/;
|
||||
virtual bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent);
|
||||
virtual QModelIndex sibling(int row, int column, const QModelIndex &idx) const;
|
||||
void setItemRoleNames(const QHash<int, QByteArray> &roleNames);
|
||||
|
||||
signals:
|
||||
void itemChanged(QStandardItem *item);
|
||||
|
||||
public:
|
||||
%If (Qt_5_12_0 -)
|
||||
bool clearItemData(const QModelIndex &index);
|
||||
%End
|
||||
};
|
||||
|
||||
class QStandardItem /Supertype=sip.wrapper/
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qstandarditemmodel.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QStandardItem();
|
||||
explicit QStandardItem(const QString &text);
|
||||
QStandardItem(const QIcon &icon, const QString &text);
|
||||
QStandardItem(int rows, int columns = 1);
|
||||
virtual ~QStandardItem();
|
||||
virtual QVariant data(int role = Qt::UserRole + 1) const;
|
||||
virtual void setData(const QVariant &value, int role = Qt::UserRole + 1);
|
||||
QString text() const;
|
||||
QIcon icon() const;
|
||||
QString toolTip() const;
|
||||
QString statusTip() const;
|
||||
QString whatsThis() const;
|
||||
QSize sizeHint() const;
|
||||
QFont font() const;
|
||||
Qt::Alignment textAlignment() const;
|
||||
QBrush background() const;
|
||||
QBrush foreground() const;
|
||||
Qt::CheckState checkState() const;
|
||||
QString accessibleText() const;
|
||||
QString accessibleDescription() const;
|
||||
Qt::ItemFlags flags() const;
|
||||
void setFlags(Qt::ItemFlags flags);
|
||||
bool isEnabled() const;
|
||||
void setEnabled(bool enabled);
|
||||
bool isEditable() const;
|
||||
void setEditable(bool editable);
|
||||
bool isSelectable() const;
|
||||
void setSelectable(bool selectable);
|
||||
bool isCheckable() const;
|
||||
void setCheckable(bool checkable);
|
||||
bool isTristate() const;
|
||||
void setTristate(bool tristate);
|
||||
bool isDragEnabled() const;
|
||||
void setDragEnabled(bool dragEnabled);
|
||||
bool isDropEnabled() const;
|
||||
void setDropEnabled(bool dropEnabled);
|
||||
QStandardItem *parent() const;
|
||||
int row() const;
|
||||
int column() const;
|
||||
QModelIndex index() const;
|
||||
QStandardItemModel *model() const;
|
||||
int rowCount() const;
|
||||
void setRowCount(int rows);
|
||||
int columnCount() const;
|
||||
void setColumnCount(int columns);
|
||||
bool hasChildren() const;
|
||||
QStandardItem *child(int row, int column = 0) const;
|
||||
void setChild(int row, int column, QStandardItem *item /Transfer/);
|
||||
void setChild(int arow, QStandardItem *aitem /Transfer/);
|
||||
void insertRow(int row, const QList<QStandardItem *> &items /Transfer/);
|
||||
void insertRow(int arow, QStandardItem *aitem /Transfer/);
|
||||
void insertRows(int row, int count);
|
||||
void insertColumn(int column, const QList<QStandardItem *> &items /Transfer/);
|
||||
void insertColumns(int column, int count);
|
||||
void removeRow(int row);
|
||||
void removeColumn(int column);
|
||||
void removeRows(int row, int count);
|
||||
void removeColumns(int column, int count);
|
||||
QStandardItem *takeChild(int row, int column = 0) /TransferBack/;
|
||||
QList<QStandardItem *> takeRow(int row) /TransferBack/;
|
||||
QList<QStandardItem *> takeColumn(int column) /TransferBack/;
|
||||
void sortChildren(int column, Qt::SortOrder order = Qt::AscendingOrder);
|
||||
virtual QStandardItem *clone() const /Factory/;
|
||||
|
||||
enum ItemType
|
||||
{
|
||||
Type,
|
||||
UserType,
|
||||
};
|
||||
|
||||
virtual int type() const;
|
||||
virtual void read(QDataStream &in);
|
||||
virtual void write(QDataStream &out) const;
|
||||
virtual bool operator<(const QStandardItem &other /NoCopy/) const;
|
||||
void setText(const QString &atext);
|
||||
void setIcon(const QIcon &aicon);
|
||||
void setToolTip(const QString &atoolTip);
|
||||
void setStatusTip(const QString &astatusTip);
|
||||
void setWhatsThis(const QString &awhatsThis);
|
||||
void setSizeHint(const QSize &asizeHint);
|
||||
void setFont(const QFont &afont);
|
||||
void setTextAlignment(Qt::Alignment atextAlignment);
|
||||
void setBackground(const QBrush &abrush);
|
||||
void setForeground(const QBrush &abrush);
|
||||
void setCheckState(Qt::CheckState acheckState);
|
||||
void setAccessibleText(const QString &aaccessibleText);
|
||||
void setAccessibleDescription(const QString &aaccessibleDescription);
|
||||
void appendRow(const QList<QStandardItem *> &items /Transfer/);
|
||||
void appendRow(QStandardItem *aitem /Transfer/);
|
||||
void appendColumn(const QList<QStandardItem *> &items /Transfer/);
|
||||
void insertRows(int row, const QList<QStandardItem *> &items /Transfer/);
|
||||
void appendRows(const QList<QStandardItem *> &items /Transfer/);
|
||||
|
||||
protected:
|
||||
QStandardItem(const QStandardItem &other);
|
||||
void emitDataChanged();
|
||||
|
||||
public:
|
||||
%If (Qt_5_6_0 -)
|
||||
bool isAutoTristate() const;
|
||||
%End
|
||||
%If (Qt_5_6_0 -)
|
||||
void setAutoTristate(bool tristate);
|
||||
%End
|
||||
%If (Qt_5_6_0 -)
|
||||
bool isUserTristate() const;
|
||||
%End
|
||||
%If (Qt_5_6_0 -)
|
||||
void setUserTristate(bool tristate);
|
||||
%End
|
||||
%If (Qt_5_12_0 -)
|
||||
void clearData();
|
||||
%End
|
||||
};
|
||||
|
||||
QDataStream &operator>>(QDataStream &in, QStandardItem &item /Constrained/) /ReleaseGIL/;
|
||||
QDataStream &operator<<(QDataStream &out, const QStandardItem &item /Constrained/) /ReleaseGIL/;
|
||||
@@ -0,0 +1,60 @@
|
||||
// qstatictext.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QStaticText
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qstatictext.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum PerformanceHint
|
||||
{
|
||||
ModerateCaching,
|
||||
AggressiveCaching,
|
||||
};
|
||||
|
||||
QStaticText();
|
||||
%If (Qt_5_10_0 -)
|
||||
explicit QStaticText(const QString &text);
|
||||
%End
|
||||
%If (- Qt_5_10_0)
|
||||
QStaticText(const QString &text);
|
||||
%End
|
||||
QStaticText(const QStaticText &other);
|
||||
~QStaticText();
|
||||
void setText(const QString &text);
|
||||
QString text() const;
|
||||
void setTextFormat(Qt::TextFormat textFormat);
|
||||
Qt::TextFormat textFormat() const;
|
||||
void setTextWidth(qreal textWidth);
|
||||
qreal textWidth() const;
|
||||
void setTextOption(const QTextOption &textOption);
|
||||
QTextOption textOption() const;
|
||||
QSizeF size() const;
|
||||
void prepare(const QTransform &matrix = QTransform(), const QFont &font = QFont());
|
||||
void setPerformanceHint(QStaticText::PerformanceHint performanceHint);
|
||||
QStaticText::PerformanceHint performanceHint() const;
|
||||
bool operator==(const QStaticText &) const;
|
||||
bool operator!=(const QStaticText &) const;
|
||||
void swap(QStaticText &other /Constrained/);
|
||||
};
|
||||
@@ -0,0 +1,139 @@
|
||||
// qstylehints.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QStyleHints : public QObject
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qstylehints.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
int mouseDoubleClickInterval() const;
|
||||
int startDragDistance() const;
|
||||
int startDragTime() const;
|
||||
int startDragVelocity() const;
|
||||
int keyboardInputInterval() const;
|
||||
int keyboardAutoRepeatRate() const;
|
||||
int cursorFlashTime() const;
|
||||
bool showIsFullScreen() const;
|
||||
int passwordMaskDelay() const;
|
||||
qreal fontSmoothingGamma() const;
|
||||
bool useRtlExtensions() const;
|
||||
%If (Qt_5_1_0 -)
|
||||
QChar passwordMaskCharacter() const;
|
||||
%End
|
||||
%If (Qt_5_2_0 -)
|
||||
bool setFocusOnTouchRelease() const;
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
int mousePressAndHoldInterval() const;
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
Qt::TabFocusBehavior tabFocusBehavior() const;
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
bool singleClickActivation() const;
|
||||
%End
|
||||
|
||||
signals:
|
||||
%If (Qt_5_5_0 -)
|
||||
void cursorFlashTimeChanged(int cursorFlashTime);
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
void keyboardInputIntervalChanged(int keyboardInputInterval);
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
void mouseDoubleClickIntervalChanged(int mouseDoubleClickInterval);
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
void startDragDistanceChanged(int startDragDistance);
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
void startDragTimeChanged(int startDragTime);
|
||||
%End
|
||||
%If (Qt_5_7_0 -)
|
||||
void mousePressAndHoldIntervalChanged(int mousePressAndHoldInterval);
|
||||
%End
|
||||
%If (Qt_5_7_0 -)
|
||||
void tabFocusBehaviorChanged(Qt::TabFocusBehavior tabFocusBehavior);
|
||||
%End
|
||||
|
||||
public:
|
||||
%If (Qt_5_6_0 -)
|
||||
bool showIsMaximized() const;
|
||||
%End
|
||||
%If (Qt_5_8_0 -)
|
||||
bool useHoverEffects() const;
|
||||
%End
|
||||
%If (Qt_5_8_0 -)
|
||||
void setUseHoverEffects(bool useHoverEffects);
|
||||
%End
|
||||
|
||||
signals:
|
||||
%If (Qt_5_8_0 -)
|
||||
void useHoverEffectsChanged(bool useHoverEffects);
|
||||
%End
|
||||
|
||||
public:
|
||||
%If (Qt_5_9_0 -)
|
||||
int wheelScrollLines() const;
|
||||
%End
|
||||
|
||||
signals:
|
||||
%If (Qt_5_9_0 -)
|
||||
void wheelScrollLinesChanged(int scrollLines);
|
||||
%End
|
||||
|
||||
public:
|
||||
%If (Qt_5_10_0 -)
|
||||
bool showShortcutsInContextMenus() const;
|
||||
%End
|
||||
%If (Qt_5_11_0 -)
|
||||
int mouseQuickSelectionThreshold() const;
|
||||
%End
|
||||
|
||||
signals:
|
||||
%If (Qt_5_11_0 -)
|
||||
void mouseQuickSelectionThresholdChanged(int threshold);
|
||||
%End
|
||||
|
||||
public:
|
||||
%If (Qt_5_13_0 -)
|
||||
void setShowShortcutsInContextMenus(bool showShortcutsInContextMenus);
|
||||
%End
|
||||
|
||||
signals:
|
||||
%If (Qt_5_13_0 -)
|
||||
void showShortcutsInContextMenusChanged(bool);
|
||||
%End
|
||||
|
||||
public:
|
||||
%If (Qt_5_14_0 -)
|
||||
int mouseDoubleClickDistance() const;
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
int touchDoubleTapDistance() const;
|
||||
%End
|
||||
|
||||
private:
|
||||
QStyleHints();
|
||||
};
|
||||
@@ -0,0 +1,67 @@
|
||||
// qsurface.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QSurface /Abstract/
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qsurface.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum SurfaceClass
|
||||
{
|
||||
Window,
|
||||
%If (Qt_5_1_0 -)
|
||||
Offscreen,
|
||||
%End
|
||||
};
|
||||
|
||||
enum SurfaceType
|
||||
{
|
||||
RasterSurface,
|
||||
OpenGLSurface,
|
||||
%If (Qt_5_3_0 -)
|
||||
RasterGLSurface,
|
||||
%End
|
||||
%If (Qt_5_9_0 -)
|
||||
OpenVGSurface,
|
||||
%End
|
||||
%If (Qt_5_10_0 -)
|
||||
VulkanSurface,
|
||||
%End
|
||||
%If (Qt_5_12_0 -)
|
||||
MetalSurface,
|
||||
%End
|
||||
};
|
||||
|
||||
virtual ~QSurface();
|
||||
QSurface::SurfaceClass surfaceClass() const;
|
||||
virtual QSurfaceFormat format() const = 0;
|
||||
virtual QSurface::SurfaceType surfaceType() const = 0;
|
||||
virtual QSize size() const = 0;
|
||||
%If (Qt_5_3_0 -)
|
||||
bool supportsOpenGL() const;
|
||||
%End
|
||||
|
||||
protected:
|
||||
explicit QSurface(QSurface::SurfaceClass type);
|
||||
};
|
||||
@@ -0,0 +1,147 @@
|
||||
// qsurfaceformat.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QSurfaceFormat
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qsurfaceformat.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum FormatOption
|
||||
{
|
||||
StereoBuffers,
|
||||
DebugContext,
|
||||
DeprecatedFunctions,
|
||||
%If (Qt_5_5_0 -)
|
||||
ResetNotification,
|
||||
%End
|
||||
};
|
||||
|
||||
typedef QFlags<QSurfaceFormat::FormatOption> FormatOptions;
|
||||
|
||||
enum SwapBehavior
|
||||
{
|
||||
DefaultSwapBehavior,
|
||||
SingleBuffer,
|
||||
DoubleBuffer,
|
||||
TripleBuffer,
|
||||
};
|
||||
|
||||
enum RenderableType
|
||||
{
|
||||
DefaultRenderableType,
|
||||
OpenGL,
|
||||
OpenGLES,
|
||||
OpenVG,
|
||||
};
|
||||
|
||||
enum OpenGLContextProfile
|
||||
{
|
||||
NoProfile,
|
||||
CoreProfile,
|
||||
CompatibilityProfile,
|
||||
};
|
||||
|
||||
QSurfaceFormat();
|
||||
QSurfaceFormat(QSurfaceFormat::FormatOptions options);
|
||||
QSurfaceFormat(const QSurfaceFormat &other);
|
||||
~QSurfaceFormat();
|
||||
void setDepthBufferSize(int size);
|
||||
int depthBufferSize() const;
|
||||
void setStencilBufferSize(int size);
|
||||
int stencilBufferSize() const;
|
||||
void setRedBufferSize(int size);
|
||||
int redBufferSize() const;
|
||||
void setGreenBufferSize(int size);
|
||||
int greenBufferSize() const;
|
||||
void setBlueBufferSize(int size);
|
||||
int blueBufferSize() const;
|
||||
void setAlphaBufferSize(int size);
|
||||
int alphaBufferSize() const;
|
||||
void setSamples(int numSamples);
|
||||
int samples() const;
|
||||
void setSwapBehavior(QSurfaceFormat::SwapBehavior behavior);
|
||||
QSurfaceFormat::SwapBehavior swapBehavior() const;
|
||||
bool hasAlpha() const;
|
||||
void setProfile(QSurfaceFormat::OpenGLContextProfile profile);
|
||||
QSurfaceFormat::OpenGLContextProfile profile() const;
|
||||
void setRenderableType(QSurfaceFormat::RenderableType type);
|
||||
QSurfaceFormat::RenderableType renderableType() const;
|
||||
void setMajorVersion(int majorVersion);
|
||||
int majorVersion() const;
|
||||
void setMinorVersion(int minorVersion);
|
||||
int minorVersion() const;
|
||||
void setStereo(bool enable);
|
||||
void setOption(QSurfaceFormat::FormatOptions opt);
|
||||
bool testOption(QSurfaceFormat::FormatOptions opt) const;
|
||||
bool stereo() const;
|
||||
%If (Qt_5_1_0 -)
|
||||
QPair<int, int> version() const;
|
||||
%End
|
||||
%If (Qt_5_1_0 -)
|
||||
void setVersion(int major, int minor);
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
void setOptions(QSurfaceFormat::FormatOptions options);
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
void setOption(QSurfaceFormat::FormatOption option, bool on = true);
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
bool testOption(QSurfaceFormat::FormatOption option) const;
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
QSurfaceFormat::FormatOptions options() const;
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
int swapInterval() const;
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
void setSwapInterval(int interval);
|
||||
%End
|
||||
%If (Qt_5_4_0 -)
|
||||
static void setDefaultFormat(const QSurfaceFormat &format);
|
||||
%End
|
||||
%If (Qt_5_4_0 -)
|
||||
static QSurfaceFormat defaultFormat();
|
||||
%End
|
||||
%If (Qt_5_10_0 -)
|
||||
|
||||
enum ColorSpace
|
||||
{
|
||||
DefaultColorSpace,
|
||||
sRGBColorSpace,
|
||||
};
|
||||
|
||||
%End
|
||||
%If (Qt_5_10_0 -)
|
||||
QSurfaceFormat::ColorSpace colorSpace() const;
|
||||
%End
|
||||
%If (Qt_5_10_0 -)
|
||||
void setColorSpace(QSurfaceFormat::ColorSpace colorSpace);
|
||||
%End
|
||||
};
|
||||
|
||||
bool operator==(const QSurfaceFormat &, const QSurfaceFormat &);
|
||||
bool operator!=(const QSurfaceFormat &, const QSurfaceFormat &);
|
||||
QFlags<QSurfaceFormat::FormatOption> operator|(QSurfaceFormat::FormatOption f1, QFlags<QSurfaceFormat::FormatOption> f2);
|
||||
@@ -0,0 +1,92 @@
|
||||
// qsyntaxhighlighter.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QSyntaxHighlighter : public QObject
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qsyntaxhighlighter.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
explicit QSyntaxHighlighter(QTextDocument *parent /TransferThis/);
|
||||
explicit QSyntaxHighlighter(QObject *parent /TransferThis/);
|
||||
virtual ~QSyntaxHighlighter();
|
||||
void setDocument(QTextDocument *doc /KeepReference/);
|
||||
QTextDocument *document() const;
|
||||
|
||||
public slots:
|
||||
void rehighlight();
|
||||
void rehighlightBlock(const QTextBlock &block);
|
||||
|
||||
protected:
|
||||
virtual void highlightBlock(const QString &text) = 0;
|
||||
void setFormat(int start, int count, const QTextCharFormat &format);
|
||||
void setFormat(int start, int count, const QColor &color);
|
||||
void setFormat(int start, int count, const QFont &font);
|
||||
QTextCharFormat format(int pos) const;
|
||||
int previousBlockState() const;
|
||||
int currentBlockState() const;
|
||||
void setCurrentBlockState(int newState);
|
||||
void setCurrentBlockUserData(QTextBlockUserData *data /GetWrapper/);
|
||||
%MethodCode
|
||||
// Ownership of the user data is with the document not the syntax highlighter.
|
||||
|
||||
typedef PyObject *(*helper_func)(QObject *, const sipTypeDef *);
|
||||
|
||||
static helper_func helper = 0;
|
||||
|
||||
if (!helper)
|
||||
{
|
||||
helper = (helper_func)sipImportSymbol("qtgui_wrap_ancestors");
|
||||
Q_ASSERT(helper);
|
||||
}
|
||||
|
||||
QTextDocument *td = sipCpp->document();
|
||||
|
||||
if (td)
|
||||
{
|
||||
PyObject *py_td = helper(td, sipType_QTextDocument);
|
||||
|
||||
if (!py_td)
|
||||
{
|
||||
sipIsErr = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
sipTransferTo(a0Wrapper, py_td);
|
||||
Py_DECREF(py_td);
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(SIP_PROTECTED_IS_PUBLIC)
|
||||
sipCpp->setCurrentBlockUserData(a0);
|
||||
#else
|
||||
sipCpp->sipProtect_setCurrentBlockUserData(a0);
|
||||
#endif
|
||||
%End
|
||||
|
||||
QTextBlockUserData *currentBlockUserData() const;
|
||||
QTextBlock currentBlock() const;
|
||||
|
||||
private:
|
||||
QSyntaxHighlighter(const QSyntaxHighlighter &);
|
||||
};
|
||||
@@ -0,0 +1,155 @@
|
||||
// qtextcursor.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QTextCursor
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qtextcursor.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QTextCursor();
|
||||
explicit QTextCursor(QTextDocument *document);
|
||||
explicit QTextCursor(QTextFrame *frame);
|
||||
explicit QTextCursor(const QTextBlock &block);
|
||||
QTextCursor(const QTextCursor &cursor);
|
||||
~QTextCursor();
|
||||
bool isNull() const;
|
||||
|
||||
enum MoveMode
|
||||
{
|
||||
MoveAnchor,
|
||||
KeepAnchor,
|
||||
};
|
||||
|
||||
void setPosition(int pos, QTextCursor::MoveMode mode = QTextCursor::MoveAnchor);
|
||||
int position() const;
|
||||
int anchor() const;
|
||||
void insertText(const QString &text);
|
||||
void insertText(const QString &text, const QTextCharFormat &format);
|
||||
|
||||
enum MoveOperation
|
||||
{
|
||||
NoMove,
|
||||
Start,
|
||||
Up,
|
||||
StartOfLine,
|
||||
StartOfBlock,
|
||||
StartOfWord,
|
||||
PreviousBlock,
|
||||
PreviousCharacter,
|
||||
PreviousWord,
|
||||
Left,
|
||||
WordLeft,
|
||||
End,
|
||||
Down,
|
||||
EndOfLine,
|
||||
EndOfWord,
|
||||
EndOfBlock,
|
||||
NextBlock,
|
||||
NextCharacter,
|
||||
NextWord,
|
||||
Right,
|
||||
WordRight,
|
||||
NextCell,
|
||||
PreviousCell,
|
||||
NextRow,
|
||||
PreviousRow,
|
||||
};
|
||||
|
||||
bool movePosition(QTextCursor::MoveOperation op, QTextCursor::MoveMode mode = QTextCursor::MoveAnchor, int n = 1);
|
||||
void deleteChar();
|
||||
void deletePreviousChar();
|
||||
|
||||
enum SelectionType
|
||||
{
|
||||
WordUnderCursor,
|
||||
LineUnderCursor,
|
||||
BlockUnderCursor,
|
||||
Document,
|
||||
};
|
||||
|
||||
void select(QTextCursor::SelectionType selection);
|
||||
bool hasSelection() const;
|
||||
bool hasComplexSelection() const;
|
||||
void removeSelectedText();
|
||||
void clearSelection();
|
||||
int selectionStart() const;
|
||||
int selectionEnd() const;
|
||||
QString selectedText() const;
|
||||
QTextDocumentFragment selection() const;
|
||||
void selectedTableCells(int *firstRow, int *numRows, int *firstColumn, int *numColumns) const;
|
||||
QTextBlock block() const;
|
||||
QTextCharFormat charFormat() const;
|
||||
void setCharFormat(const QTextCharFormat &format);
|
||||
void mergeCharFormat(const QTextCharFormat &modifier);
|
||||
QTextBlockFormat blockFormat() const;
|
||||
void setBlockFormat(const QTextBlockFormat &format);
|
||||
void mergeBlockFormat(const QTextBlockFormat &modifier);
|
||||
QTextCharFormat blockCharFormat() const;
|
||||
void setBlockCharFormat(const QTextCharFormat &format);
|
||||
void mergeBlockCharFormat(const QTextCharFormat &modifier);
|
||||
bool atBlockStart() const;
|
||||
bool atBlockEnd() const;
|
||||
bool atStart() const;
|
||||
bool atEnd() const;
|
||||
void insertBlock();
|
||||
void insertBlock(const QTextBlockFormat &format);
|
||||
void insertBlock(const QTextBlockFormat &format, const QTextCharFormat &charFormat);
|
||||
QTextList *insertList(const QTextListFormat &format);
|
||||
QTextList *insertList(QTextListFormat::Style style);
|
||||
QTextList *createList(const QTextListFormat &format);
|
||||
QTextList *createList(QTextListFormat::Style style);
|
||||
QTextList *currentList() const;
|
||||
QTextTable *insertTable(int rows, int cols, const QTextTableFormat &format);
|
||||
QTextTable *insertTable(int rows, int cols);
|
||||
QTextTable *currentTable() const;
|
||||
QTextFrame *insertFrame(const QTextFrameFormat &format);
|
||||
QTextFrame *currentFrame() const;
|
||||
void insertFragment(const QTextDocumentFragment &fragment);
|
||||
void insertHtml(const QString &html);
|
||||
void insertImage(const QTextImageFormat &format);
|
||||
void insertImage(const QTextImageFormat &format, QTextFrameFormat::Position alignment);
|
||||
void insertImage(const QString &name);
|
||||
void insertImage(const QImage &image, const QString &name = QString());
|
||||
void beginEditBlock();
|
||||
void joinPreviousEditBlock();
|
||||
void endEditBlock();
|
||||
int blockNumber() const;
|
||||
int columnNumber() const;
|
||||
bool operator!=(const QTextCursor &rhs) const;
|
||||
bool operator<(const QTextCursor &rhs) const;
|
||||
bool operator<=(const QTextCursor &rhs) const;
|
||||
bool operator==(const QTextCursor &rhs) const;
|
||||
bool operator>=(const QTextCursor &rhs) const;
|
||||
bool operator>(const QTextCursor &rhs) const;
|
||||
bool isCopyOf(const QTextCursor &other) const;
|
||||
bool visualNavigation() const;
|
||||
void setVisualNavigation(bool b);
|
||||
QTextDocument *document() const;
|
||||
int positionInBlock() const;
|
||||
void setVerticalMovementX(int x);
|
||||
int verticalMovementX() const;
|
||||
void setKeepPositionOnInsert(bool b);
|
||||
bool keepPositionOnInsert() const;
|
||||
void swap(QTextCursor &other /Constrained/);
|
||||
};
|
||||
@@ -0,0 +1,228 @@
|
||||
// qtextdocument.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
namespace Qt
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qtextdocument.h>
|
||||
%End
|
||||
|
||||
bool mightBeRichText(const QString &);
|
||||
QString convertFromPlainText(const QString &plain, Qt::WhiteSpaceMode mode = Qt::WhiteSpacePre);
|
||||
};
|
||||
|
||||
class QTextDocument : public QObject
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qtextdocument.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
explicit QTextDocument(QObject *parent /TransferThis/ = 0);
|
||||
QTextDocument(const QString &text, QObject *parent /TransferThis/ = 0);
|
||||
virtual ~QTextDocument();
|
||||
QTextDocument *clone(QObject *parent /TransferThis/ = 0) const /Factory/;
|
||||
bool isEmpty() const;
|
||||
virtual void clear();
|
||||
void setUndoRedoEnabled(bool enable);
|
||||
bool isUndoRedoEnabled() const;
|
||||
bool isUndoAvailable() const;
|
||||
bool isRedoAvailable() const;
|
||||
void setDocumentLayout(QAbstractTextDocumentLayout *layout /Transfer/);
|
||||
QAbstractTextDocumentLayout *documentLayout() const;
|
||||
|
||||
enum MetaInformation
|
||||
{
|
||||
DocumentTitle,
|
||||
DocumentUrl,
|
||||
};
|
||||
|
||||
void setMetaInformation(QTextDocument::MetaInformation info, const QString &);
|
||||
QString metaInformation(QTextDocument::MetaInformation info) const;
|
||||
QString toHtml(const QByteArray &encoding = QByteArray()) const;
|
||||
void setHtml(const QString &html);
|
||||
QString toPlainText() const;
|
||||
void setPlainText(const QString &text);
|
||||
|
||||
enum FindFlag
|
||||
{
|
||||
FindBackward,
|
||||
FindCaseSensitively,
|
||||
FindWholeWords,
|
||||
};
|
||||
|
||||
typedef QFlags<QTextDocument::FindFlag> FindFlags;
|
||||
QTextCursor find(const QString &subString, int position = 0, QFlags<QTextDocument::FindFlag> options = 0) const;
|
||||
QTextCursor find(const QRegExp &expr, int position = 0, QFlags<QTextDocument::FindFlag> options = 0) const;
|
||||
%If (Qt_5_5_0 -)
|
||||
QTextCursor find(const QRegularExpression &expr, int position = 0, QFlags<QTextDocument::FindFlag> options = 0) const;
|
||||
%End
|
||||
QTextCursor find(const QString &subString, const QTextCursor &cursor, QFlags<QTextDocument::FindFlag> options = 0) const;
|
||||
QTextCursor find(const QRegExp &expr, const QTextCursor &cursor, QFlags<QTextDocument::FindFlag> options = 0) const;
|
||||
%If (Qt_5_5_0 -)
|
||||
QTextCursor find(const QRegularExpression &expr, const QTextCursor &cursor, QFlags<QTextDocument::FindFlag> options = 0) const;
|
||||
%End
|
||||
QTextFrame *rootFrame() const;
|
||||
QTextObject *object(int objectIndex) const;
|
||||
QTextObject *objectForFormat(const QTextFormat &) const;
|
||||
QTextBlock findBlock(int pos) const;
|
||||
QTextBlock begin() const;
|
||||
QTextBlock end() const;
|
||||
void setPageSize(const QSizeF &size);
|
||||
QSizeF pageSize() const;
|
||||
void setDefaultFont(const QFont &font);
|
||||
QFont defaultFont() const;
|
||||
int pageCount() const;
|
||||
bool isModified() const;
|
||||
%If (PyQt_Printer)
|
||||
void print(QPagedPaintDevice *printer) const /PyName=print_/;
|
||||
%End
|
||||
%If (Py_v3)
|
||||
%If (PyQt_Printer)
|
||||
void print(QPagedPaintDevice *printer) const;
|
||||
%End
|
||||
%End
|
||||
|
||||
enum ResourceType
|
||||
{
|
||||
%If (Qt_5_14_0 -)
|
||||
UnknownResource,
|
||||
%End
|
||||
HtmlResource,
|
||||
ImageResource,
|
||||
StyleSheetResource,
|
||||
%If (Qt_5_14_0 -)
|
||||
MarkdownResource,
|
||||
%End
|
||||
UserResource,
|
||||
};
|
||||
|
||||
QVariant resource(int type, const QUrl &name) const;
|
||||
void addResource(int type, const QUrl &name, const QVariant &resource);
|
||||
QVector<QTextFormat> allFormats() const;
|
||||
void markContentsDirty(int from, int length);
|
||||
void setUseDesignMetrics(bool b);
|
||||
bool useDesignMetrics() const;
|
||||
|
||||
signals:
|
||||
void blockCountChanged(int newBlockCount);
|
||||
void contentsChange(int from, int charsRemoves, int charsAdded);
|
||||
void contentsChanged();
|
||||
void cursorPositionChanged(const QTextCursor &cursor);
|
||||
void modificationChanged(bool m);
|
||||
void redoAvailable(bool);
|
||||
void undoAvailable(bool);
|
||||
|
||||
public slots:
|
||||
void undo();
|
||||
void redo();
|
||||
void setModified(bool on = true);
|
||||
|
||||
protected:
|
||||
virtual QTextObject *createObject(const QTextFormat &f) /Factory/;
|
||||
virtual QVariant loadResource(int type, const QUrl &name);
|
||||
|
||||
public:
|
||||
void drawContents(QPainter *p, const QRectF &rect = QRectF());
|
||||
void setTextWidth(qreal width);
|
||||
qreal textWidth() const;
|
||||
qreal idealWidth() const;
|
||||
void adjustSize();
|
||||
QSizeF size() const;
|
||||
int blockCount() const;
|
||||
void setDefaultStyleSheet(const QString &sheet);
|
||||
QString defaultStyleSheet() const;
|
||||
void undo(QTextCursor *cursor);
|
||||
void redo(QTextCursor *cursor);
|
||||
int maximumBlockCount() const;
|
||||
void setMaximumBlockCount(int maximum);
|
||||
QTextOption defaultTextOption() const;
|
||||
void setDefaultTextOption(const QTextOption &option);
|
||||
int revision() const;
|
||||
QTextBlock findBlockByNumber(int blockNumber) const;
|
||||
QTextBlock findBlockByLineNumber(int blockNumber) const;
|
||||
QTextBlock firstBlock() const;
|
||||
QTextBlock lastBlock() const;
|
||||
qreal indentWidth() const;
|
||||
void setIndentWidth(qreal width);
|
||||
|
||||
signals:
|
||||
void undoCommandAdded();
|
||||
void documentLayoutChanged();
|
||||
|
||||
public:
|
||||
QChar characterAt(int pos) const;
|
||||
qreal documentMargin() const;
|
||||
void setDocumentMargin(qreal margin);
|
||||
int lineCount() const;
|
||||
int characterCount() const;
|
||||
int availableUndoSteps() const;
|
||||
int availableRedoSteps() const;
|
||||
|
||||
enum Stacks
|
||||
{
|
||||
UndoStack,
|
||||
RedoStack,
|
||||
UndoAndRedoStacks,
|
||||
};
|
||||
|
||||
void clearUndoRedoStacks(QTextDocument::Stacks stacks = QTextDocument::UndoAndRedoStacks);
|
||||
Qt::CursorMoveStyle defaultCursorMoveStyle() const;
|
||||
void setDefaultCursorMoveStyle(Qt::CursorMoveStyle style);
|
||||
%If (Qt_5_3_0 -)
|
||||
QUrl baseUrl() const;
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
void setBaseUrl(const QUrl &url);
|
||||
%End
|
||||
|
||||
signals:
|
||||
%If (Qt_5_3_0 -)
|
||||
void baseUrlChanged(const QUrl &url);
|
||||
%End
|
||||
|
||||
public:
|
||||
%If (Qt_5_9_0 -)
|
||||
QString toRawText() const;
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
|
||||
enum MarkdownFeature
|
||||
{
|
||||
MarkdownNoHTML,
|
||||
MarkdownDialectCommonMark,
|
||||
MarkdownDialectGitHub,
|
||||
};
|
||||
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
typedef QFlags<QTextDocument::MarkdownFeature> MarkdownFeatures;
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
QString toMarkdown(QTextDocument::MarkdownFeatures features = QTextDocument::MarkdownDialectGitHub) const;
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
void setMarkdown(const QString &markdown, QTextDocument::MarkdownFeatures features = QTextDocument::MarkdownDialectGitHub);
|
||||
%End
|
||||
};
|
||||
|
||||
QFlags<QTextDocument::FindFlag> operator|(QTextDocument::FindFlag f1, QFlags<QTextDocument::FindFlag> f2);
|
||||
@@ -0,0 +1,41 @@
|
||||
// qtextdocumentfragment.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QTextDocumentFragment
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qtextdocumentfragment.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QTextDocumentFragment();
|
||||
explicit QTextDocumentFragment(const QTextDocument *document);
|
||||
explicit QTextDocumentFragment(const QTextCursor &range);
|
||||
QTextDocumentFragment(const QTextDocumentFragment &rhs);
|
||||
~QTextDocumentFragment();
|
||||
bool isEmpty() const;
|
||||
QString toPlainText() const;
|
||||
QString toHtml(const QByteArray &encoding = QByteArray()) const;
|
||||
static QTextDocumentFragment fromPlainText(const QString &plainText);
|
||||
static QTextDocumentFragment fromHtml(const QString &html);
|
||||
static QTextDocumentFragment fromHtml(const QString &html, const QTextDocument *resourceProvider);
|
||||
};
|
||||
@@ -0,0 +1,48 @@
|
||||
// qtextdocumentwriter.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QTextDocumentWriter
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qtextdocumentwriter.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QTextDocumentWriter();
|
||||
QTextDocumentWriter(QIODevice *device, const QByteArray &format);
|
||||
QTextDocumentWriter(const QString &fileName, const QByteArray &format = QByteArray());
|
||||
~QTextDocumentWriter();
|
||||
void setFormat(const QByteArray &format);
|
||||
QByteArray format() const;
|
||||
void setDevice(QIODevice *device);
|
||||
QIODevice *device() const;
|
||||
void setFileName(const QString &fileName);
|
||||
QString fileName() const;
|
||||
bool write(const QTextDocument *document);
|
||||
bool write(const QTextDocumentFragment &fragment);
|
||||
void setCodec(QTextCodec *codec /KeepReference/);
|
||||
QTextCodec *codec() const;
|
||||
static QList<QByteArray> supportedDocumentFormats();
|
||||
|
||||
private:
|
||||
QTextDocumentWriter(const QTextDocumentWriter &);
|
||||
};
|
||||
@@ -0,0 +1,746 @@
|
||||
// qtextformat.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QTextLength
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qtextformat.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum Type
|
||||
{
|
||||
VariableLength,
|
||||
FixedLength,
|
||||
PercentageLength,
|
||||
};
|
||||
|
||||
QTextLength();
|
||||
QTextLength::Type type() const;
|
||||
QTextLength(QTextLength::Type atype, qreal avalue);
|
||||
qreal value(qreal maximumLength) const;
|
||||
qreal rawValue() const;
|
||||
bool operator==(const QTextLength &other) const;
|
||||
bool operator!=(const QTextLength &other) const;
|
||||
QTextLength(const QVariant &variant /GetWrapper/) /NoDerived/;
|
||||
%MethodCode
|
||||
if (a0->canConvert<QTextLength>())
|
||||
sipCpp = new QTextLength(a0->value<QTextLength>());
|
||||
else
|
||||
sipError = sipBadCallableArg(0, a0Wrapper);
|
||||
%End
|
||||
};
|
||||
|
||||
QDataStream &operator<<(QDataStream &, const QTextLength & /Constrained/) /ReleaseGIL/;
|
||||
QDataStream &operator>>(QDataStream &, QTextLength & /Constrained/) /ReleaseGIL/;
|
||||
|
||||
class QTextFormat
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qtextformat.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum FormatType
|
||||
{
|
||||
InvalidFormat,
|
||||
BlockFormat,
|
||||
CharFormat,
|
||||
ListFormat,
|
||||
TableFormat,
|
||||
FrameFormat,
|
||||
UserFormat,
|
||||
};
|
||||
|
||||
enum ObjectTypes
|
||||
{
|
||||
NoObject,
|
||||
ImageObject,
|
||||
TableObject,
|
||||
TableCellObject,
|
||||
UserObject,
|
||||
};
|
||||
|
||||
enum PageBreakFlag
|
||||
{
|
||||
PageBreak_Auto,
|
||||
PageBreak_AlwaysBefore,
|
||||
PageBreak_AlwaysAfter,
|
||||
};
|
||||
|
||||
typedef QFlags<QTextFormat::PageBreakFlag> PageBreakFlags;
|
||||
|
||||
enum Property
|
||||
{
|
||||
ObjectIndex,
|
||||
CssFloat,
|
||||
LayoutDirection,
|
||||
OutlinePen,
|
||||
BackgroundBrush,
|
||||
ForegroundBrush,
|
||||
BlockAlignment,
|
||||
BlockTopMargin,
|
||||
BlockBottomMargin,
|
||||
BlockLeftMargin,
|
||||
BlockRightMargin,
|
||||
TextIndent,
|
||||
BlockIndent,
|
||||
BlockNonBreakableLines,
|
||||
BlockTrailingHorizontalRulerWidth,
|
||||
FontFamily,
|
||||
FontPointSize,
|
||||
FontSizeAdjustment,
|
||||
FontSizeIncrement,
|
||||
FontWeight,
|
||||
FontItalic,
|
||||
FontUnderline,
|
||||
FontOverline,
|
||||
FontStrikeOut,
|
||||
FontFixedPitch,
|
||||
FontPixelSize,
|
||||
TextUnderlineColor,
|
||||
TextVerticalAlignment,
|
||||
TextOutline,
|
||||
IsAnchor,
|
||||
AnchorHref,
|
||||
AnchorName,
|
||||
ObjectType,
|
||||
ListStyle,
|
||||
ListIndent,
|
||||
FrameBorder,
|
||||
FrameMargin,
|
||||
FramePadding,
|
||||
FrameWidth,
|
||||
FrameHeight,
|
||||
TableColumns,
|
||||
TableColumnWidthConstraints,
|
||||
TableCellSpacing,
|
||||
TableCellPadding,
|
||||
TableCellRowSpan,
|
||||
TableCellColumnSpan,
|
||||
ImageName,
|
||||
ImageWidth,
|
||||
ImageHeight,
|
||||
TextUnderlineStyle,
|
||||
TableHeaderRowCount,
|
||||
FullWidthSelection,
|
||||
PageBreakPolicy,
|
||||
TextToolTip,
|
||||
FrameTopMargin,
|
||||
FrameBottomMargin,
|
||||
FrameLeftMargin,
|
||||
FrameRightMargin,
|
||||
FrameBorderBrush,
|
||||
FrameBorderStyle,
|
||||
BackgroundImageUrl,
|
||||
TabPositions,
|
||||
FirstFontProperty,
|
||||
FontCapitalization,
|
||||
FontLetterSpacing,
|
||||
FontWordSpacing,
|
||||
LastFontProperty,
|
||||
TableCellTopPadding,
|
||||
TableCellBottomPadding,
|
||||
TableCellLeftPadding,
|
||||
TableCellRightPadding,
|
||||
FontStyleHint,
|
||||
FontStyleStrategy,
|
||||
FontKerning,
|
||||
LineHeight,
|
||||
LineHeightType,
|
||||
FontHintingPreference,
|
||||
ListNumberPrefix,
|
||||
ListNumberSuffix,
|
||||
FontStretch,
|
||||
FontLetterSpacingType,
|
||||
%If (Qt_5_12_0 -)
|
||||
HeadingLevel,
|
||||
%End
|
||||
%If (Qt_5_12_0 -)
|
||||
ImageQuality,
|
||||
%End
|
||||
%If (Qt_5_13_0 -)
|
||||
FontFamilies,
|
||||
%End
|
||||
%If (Qt_5_13_0 -)
|
||||
FontStyleName,
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
BlockQuoteLevel,
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
BlockCodeLanguage,
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
BlockCodeFence,
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
BlockMarker,
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
TableBorderCollapse,
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
TableCellTopBorder,
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
TableCellBottomBorder,
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
TableCellLeftBorder,
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
TableCellRightBorder,
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
TableCellTopBorderStyle,
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
TableCellBottomBorderStyle,
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
TableCellLeftBorderStyle,
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
TableCellRightBorderStyle,
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
TableCellTopBorderBrush,
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
TableCellBottomBorderBrush,
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
TableCellLeftBorderBrush,
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
TableCellRightBorderBrush,
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
ImageTitle,
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
ImageAltText,
|
||||
%End
|
||||
UserProperty,
|
||||
};
|
||||
|
||||
QTextFormat();
|
||||
explicit QTextFormat(int type);
|
||||
QTextFormat(const QTextFormat &rhs);
|
||||
QTextFormat(const QVariant &variant /GetWrapper/) /NoDerived/;
|
||||
%MethodCode
|
||||
if (a0->canConvert<QTextFormat>())
|
||||
sipCpp = new QTextFormat(a0->value<QTextFormat>());
|
||||
else
|
||||
sipError = sipBadCallableArg(0, a0Wrapper);
|
||||
%End
|
||||
|
||||
~QTextFormat();
|
||||
void merge(const QTextFormat &other);
|
||||
bool isValid() const;
|
||||
int type() const;
|
||||
int objectIndex() const;
|
||||
void setObjectIndex(int object);
|
||||
QVariant property(int propertyId) const;
|
||||
void setProperty(int propertyId, const QVariant &value);
|
||||
void clearProperty(int propertyId);
|
||||
bool hasProperty(int propertyId) const;
|
||||
bool boolProperty(int propertyId) const;
|
||||
int intProperty(int propertyId) const;
|
||||
qreal doubleProperty(int propertyId) const;
|
||||
QString stringProperty(int propertyId) const;
|
||||
QColor colorProperty(int propertyId) const;
|
||||
QPen penProperty(int propertyId) const;
|
||||
QBrush brushProperty(int propertyId) const;
|
||||
QTextLength lengthProperty(int propertyId) const;
|
||||
QVector<QTextLength> lengthVectorProperty(int propertyId) const;
|
||||
void setProperty(int propertyId, const QVector<QTextLength> &lengths);
|
||||
QMap<int, QVariant> properties() const;
|
||||
int objectType() const;
|
||||
bool isCharFormat() const;
|
||||
bool isBlockFormat() const;
|
||||
bool isListFormat() const;
|
||||
bool isFrameFormat() const;
|
||||
bool isImageFormat() const;
|
||||
bool isTableFormat() const;
|
||||
QTextBlockFormat toBlockFormat() const;
|
||||
QTextCharFormat toCharFormat() const;
|
||||
QTextListFormat toListFormat() const;
|
||||
QTextTableFormat toTableFormat() const;
|
||||
QTextFrameFormat toFrameFormat() const;
|
||||
QTextImageFormat toImageFormat() const;
|
||||
bool operator==(const QTextFormat &rhs) const;
|
||||
bool operator!=(const QTextFormat &rhs) const;
|
||||
void setLayoutDirection(Qt::LayoutDirection direction);
|
||||
Qt::LayoutDirection layoutDirection() const;
|
||||
void setBackground(const QBrush &brush);
|
||||
QBrush background() const;
|
||||
void clearBackground();
|
||||
void setForeground(const QBrush &brush);
|
||||
QBrush foreground() const;
|
||||
void clearForeground();
|
||||
void setObjectType(int atype);
|
||||
int propertyCount() const;
|
||||
bool isTableCellFormat() const;
|
||||
QTextTableCellFormat toTableCellFormat() const;
|
||||
void swap(QTextFormat &other /Constrained/);
|
||||
%If (Qt_5_3_0 -)
|
||||
bool isEmpty() const;
|
||||
%End
|
||||
};
|
||||
|
||||
QDataStream &operator<<(QDataStream &, const QTextFormat & /Constrained/) /ReleaseGIL/;
|
||||
QDataStream &operator>>(QDataStream &, QTextFormat & /Constrained/) /ReleaseGIL/;
|
||||
|
||||
class QTextCharFormat : public QTextFormat
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qtextformat.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum VerticalAlignment
|
||||
{
|
||||
AlignNormal,
|
||||
AlignSuperScript,
|
||||
AlignSubScript,
|
||||
AlignMiddle,
|
||||
AlignTop,
|
||||
AlignBottom,
|
||||
AlignBaseline,
|
||||
};
|
||||
|
||||
QTextCharFormat();
|
||||
bool isValid() const;
|
||||
void setFont(const QFont &font);
|
||||
QFont font() const;
|
||||
void setFontFamily(const QString &family);
|
||||
QString fontFamily() const;
|
||||
void setFontPointSize(qreal size);
|
||||
qreal fontPointSize() const;
|
||||
void setFontWeight(int weight);
|
||||
int fontWeight() const;
|
||||
void setFontItalic(bool italic);
|
||||
bool fontItalic() const;
|
||||
void setFontUnderline(bool underline);
|
||||
bool fontUnderline() const;
|
||||
void setFontOverline(bool overline);
|
||||
bool fontOverline() const;
|
||||
void setFontStrikeOut(bool strikeOut);
|
||||
bool fontStrikeOut() const;
|
||||
void setUnderlineColor(const QColor &color);
|
||||
QColor underlineColor() const;
|
||||
void setFontFixedPitch(bool fixedPitch);
|
||||
bool fontFixedPitch() const;
|
||||
void setVerticalAlignment(QTextCharFormat::VerticalAlignment alignment);
|
||||
QTextCharFormat::VerticalAlignment verticalAlignment() const;
|
||||
void setAnchor(bool anchor);
|
||||
bool isAnchor() const;
|
||||
void setAnchorHref(const QString &value);
|
||||
QString anchorHref() const;
|
||||
int tableCellRowSpan() const;
|
||||
int tableCellColumnSpan() const;
|
||||
void setTableCellRowSpan(int atableCellRowSpan);
|
||||
void setTableCellColumnSpan(int atableCellColumnSpan);
|
||||
void setTextOutline(const QPen &pen);
|
||||
QPen textOutline() const;
|
||||
|
||||
enum UnderlineStyle
|
||||
{
|
||||
NoUnderline,
|
||||
SingleUnderline,
|
||||
DashUnderline,
|
||||
DotLine,
|
||||
DashDotLine,
|
||||
DashDotDotLine,
|
||||
WaveUnderline,
|
||||
SpellCheckUnderline,
|
||||
};
|
||||
|
||||
void setUnderlineStyle(QTextCharFormat::UnderlineStyle style);
|
||||
QTextCharFormat::UnderlineStyle underlineStyle() const;
|
||||
void setToolTip(const QString &tip);
|
||||
QString toolTip() const;
|
||||
void setAnchorNames(const QStringList &names);
|
||||
QStringList anchorNames() const;
|
||||
void setFontCapitalization(QFont::Capitalization capitalization);
|
||||
QFont::Capitalization fontCapitalization() const;
|
||||
void setFontLetterSpacing(qreal spacing);
|
||||
qreal fontLetterSpacing() const;
|
||||
void setFontWordSpacing(qreal spacing);
|
||||
qreal fontWordSpacing() const;
|
||||
void setFontStyleHint(QFont::StyleHint hint, QFont::StyleStrategy strategy = QFont::PreferDefault);
|
||||
void setFontStyleStrategy(QFont::StyleStrategy strategy);
|
||||
QFont::StyleHint fontStyleHint() const;
|
||||
QFont::StyleStrategy fontStyleStrategy() const;
|
||||
void setFontKerning(bool enable);
|
||||
bool fontKerning() const;
|
||||
void setFontHintingPreference(QFont::HintingPreference hintingPreference);
|
||||
QFont::HintingPreference fontHintingPreference() const;
|
||||
int fontStretch() const;
|
||||
void setFontStretch(int factor);
|
||||
void setFontLetterSpacingType(QFont::SpacingType letterSpacingType);
|
||||
QFont::SpacingType fontLetterSpacingType() const;
|
||||
%If (Qt_5_3_0 -)
|
||||
|
||||
enum FontPropertiesInheritanceBehavior
|
||||
{
|
||||
FontPropertiesSpecifiedOnly,
|
||||
FontPropertiesAll,
|
||||
};
|
||||
|
||||
%End
|
||||
%If (Qt_5_3_0 -)
|
||||
void setFont(const QFont &font, QTextCharFormat::FontPropertiesInheritanceBehavior behavior);
|
||||
%End
|
||||
%If (Qt_5_13_0 -)
|
||||
void setFontFamilies(const QStringList &families);
|
||||
%End
|
||||
%If (Qt_5_13_0 -)
|
||||
QVariant fontFamilies() const;
|
||||
%End
|
||||
%If (Qt_5_13_0 -)
|
||||
void setFontStyleName(const QString &styleName);
|
||||
%End
|
||||
%If (Qt_5_13_0 -)
|
||||
QVariant fontStyleName() const;
|
||||
%End
|
||||
};
|
||||
|
||||
class QTextBlockFormat : public QTextFormat
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qtextformat.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QTextBlockFormat();
|
||||
bool isValid() const;
|
||||
Qt::Alignment alignment() const;
|
||||
void setTopMargin(qreal margin);
|
||||
qreal topMargin() const;
|
||||
void setBottomMargin(qreal margin);
|
||||
qreal bottomMargin() const;
|
||||
void setLeftMargin(qreal margin);
|
||||
qreal leftMargin() const;
|
||||
void setRightMargin(qreal margin);
|
||||
qreal rightMargin() const;
|
||||
void setTextIndent(qreal margin);
|
||||
qreal textIndent() const;
|
||||
int indent() const;
|
||||
void setNonBreakableLines(bool b);
|
||||
bool nonBreakableLines() const;
|
||||
void setAlignment(Qt::Alignment aalignment);
|
||||
void setIndent(int aindent);
|
||||
void setPageBreakPolicy(QTextFormat::PageBreakFlags flags);
|
||||
QTextFormat::PageBreakFlags pageBreakPolicy() const;
|
||||
void setTabPositions(const QList<QTextOption::Tab> &tabs);
|
||||
QList<QTextOption::Tab> tabPositions() const;
|
||||
|
||||
enum LineHeightTypes
|
||||
{
|
||||
SingleHeight,
|
||||
ProportionalHeight,
|
||||
FixedHeight,
|
||||
MinimumHeight,
|
||||
LineDistanceHeight,
|
||||
};
|
||||
|
||||
void setLineHeight(qreal height, int heightType);
|
||||
qreal lineHeight() const;
|
||||
qreal lineHeight(qreal scriptLineHeight, qreal scaling = 1.) const;
|
||||
int lineHeightType() const;
|
||||
%If (Qt_5_12_0 -)
|
||||
void setHeadingLevel(int alevel);
|
||||
%End
|
||||
%If (Qt_5_12_0 -)
|
||||
int headingLevel() const;
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
|
||||
enum class MarkerType
|
||||
{
|
||||
NoMarker,
|
||||
Unchecked,
|
||||
Checked,
|
||||
};
|
||||
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
void setMarker(QTextBlockFormat::MarkerType marker);
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
QTextBlockFormat::MarkerType marker() const;
|
||||
%End
|
||||
};
|
||||
|
||||
class QTextListFormat : public QTextFormat
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qtextformat.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QTextListFormat();
|
||||
bool isValid() const;
|
||||
|
||||
enum Style
|
||||
{
|
||||
ListDisc,
|
||||
ListCircle,
|
||||
ListSquare,
|
||||
ListDecimal,
|
||||
ListLowerAlpha,
|
||||
ListUpperAlpha,
|
||||
ListLowerRoman,
|
||||
ListUpperRoman,
|
||||
};
|
||||
|
||||
QTextListFormat::Style style() const;
|
||||
int indent() const;
|
||||
void setStyle(QTextListFormat::Style astyle);
|
||||
void setIndent(int aindent);
|
||||
QString numberPrefix() const;
|
||||
QString numberSuffix() const;
|
||||
void setNumberPrefix(const QString &np);
|
||||
void setNumberSuffix(const QString &ns);
|
||||
};
|
||||
|
||||
class QTextImageFormat : public QTextCharFormat
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qtextformat.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QTextImageFormat();
|
||||
bool isValid() const;
|
||||
QString name() const;
|
||||
qreal width() const;
|
||||
qreal height() const;
|
||||
%If (Qt_5_12_0 -)
|
||||
int quality() const;
|
||||
%End
|
||||
void setName(const QString &aname);
|
||||
void setWidth(qreal awidth);
|
||||
void setHeight(qreal aheight);
|
||||
%If (Qt_5_12_0 -)
|
||||
void setQuality(int quality = 100);
|
||||
%End
|
||||
};
|
||||
|
||||
class QTextFrameFormat : public QTextFormat
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qtextformat.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QTextFrameFormat();
|
||||
bool isValid() const;
|
||||
|
||||
enum Position
|
||||
{
|
||||
InFlow,
|
||||
FloatLeft,
|
||||
FloatRight,
|
||||
};
|
||||
|
||||
void setPosition(QTextFrameFormat::Position f);
|
||||
QTextFrameFormat::Position position() const;
|
||||
qreal border() const;
|
||||
qreal margin() const;
|
||||
qreal padding() const;
|
||||
void setWidth(const QTextLength &length);
|
||||
QTextLength width() const;
|
||||
QTextLength height() const;
|
||||
void setBorder(qreal aborder);
|
||||
void setMargin(qreal amargin);
|
||||
void setPadding(qreal apadding);
|
||||
void setWidth(qreal awidth);
|
||||
void setHeight(qreal aheight);
|
||||
void setHeight(const QTextLength &aheight);
|
||||
void setPageBreakPolicy(QTextFormat::PageBreakFlags flags);
|
||||
QTextFormat::PageBreakFlags pageBreakPolicy() const;
|
||||
|
||||
enum BorderStyle
|
||||
{
|
||||
BorderStyle_None,
|
||||
BorderStyle_Dotted,
|
||||
BorderStyle_Dashed,
|
||||
BorderStyle_Solid,
|
||||
BorderStyle_Double,
|
||||
BorderStyle_DotDash,
|
||||
BorderStyle_DotDotDash,
|
||||
BorderStyle_Groove,
|
||||
BorderStyle_Ridge,
|
||||
BorderStyle_Inset,
|
||||
BorderStyle_Outset,
|
||||
};
|
||||
|
||||
void setBorderBrush(const QBrush &brush);
|
||||
QBrush borderBrush() const;
|
||||
void setBorderStyle(QTextFrameFormat::BorderStyle style);
|
||||
QTextFrameFormat::BorderStyle borderStyle() const;
|
||||
qreal topMargin() const;
|
||||
qreal bottomMargin() const;
|
||||
qreal leftMargin() const;
|
||||
qreal rightMargin() const;
|
||||
void setTopMargin(qreal amargin);
|
||||
void setBottomMargin(qreal amargin);
|
||||
void setLeftMargin(qreal amargin);
|
||||
void setRightMargin(qreal amargin);
|
||||
};
|
||||
|
||||
class QTextTableFormat : public QTextFrameFormat
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qtextformat.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QTextTableFormat();
|
||||
bool isValid() const;
|
||||
int columns() const;
|
||||
void setColumnWidthConstraints(const QVector<QTextLength> &constraints);
|
||||
QVector<QTextLength> columnWidthConstraints() const;
|
||||
void clearColumnWidthConstraints();
|
||||
qreal cellSpacing() const;
|
||||
void setCellSpacing(qreal spacing);
|
||||
qreal cellPadding() const;
|
||||
Qt::Alignment alignment() const;
|
||||
void setColumns(int acolumns);
|
||||
void setCellPadding(qreal apadding);
|
||||
void setAlignment(Qt::Alignment aalignment);
|
||||
void setHeaderRowCount(int count);
|
||||
int headerRowCount() const;
|
||||
%If (Qt_5_14_0 -)
|
||||
void setBorderCollapse(bool borderCollapse);
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
bool borderCollapse() const;
|
||||
%End
|
||||
};
|
||||
|
||||
QFlags<QTextFormat::PageBreakFlag> operator|(QTextFormat::PageBreakFlag f1, QFlags<QTextFormat::PageBreakFlag> f2);
|
||||
|
||||
class QTextTableCellFormat : public QTextCharFormat
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qtextformat.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QTextTableCellFormat();
|
||||
bool isValid() const;
|
||||
void setTopPadding(qreal padding);
|
||||
qreal topPadding() const;
|
||||
void setBottomPadding(qreal padding);
|
||||
qreal bottomPadding() const;
|
||||
void setLeftPadding(qreal padding);
|
||||
qreal leftPadding() const;
|
||||
void setRightPadding(qreal padding);
|
||||
qreal rightPadding() const;
|
||||
void setPadding(qreal padding);
|
||||
%If (Qt_5_14_0 -)
|
||||
void setTopBorder(qreal width);
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
qreal topBorder() const;
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
void setBottomBorder(qreal width);
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
qreal bottomBorder() const;
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
void setLeftBorder(qreal width);
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
qreal leftBorder() const;
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
void setRightBorder(qreal width);
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
qreal rightBorder() const;
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
void setBorder(qreal width);
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
void setTopBorderStyle(QTextFrameFormat::BorderStyle style);
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
QTextFrameFormat::BorderStyle topBorderStyle() const;
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
void setBottomBorderStyle(QTextFrameFormat::BorderStyle style);
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
QTextFrameFormat::BorderStyle bottomBorderStyle() const;
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
void setLeftBorderStyle(QTextFrameFormat::BorderStyle style);
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
QTextFrameFormat::BorderStyle leftBorderStyle() const;
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
void setRightBorderStyle(QTextFrameFormat::BorderStyle style);
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
QTextFrameFormat::BorderStyle rightBorderStyle() const;
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
void setBorderStyle(QTextFrameFormat::BorderStyle style);
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
void setTopBorderBrush(const QBrush &brush);
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
QBrush topBorderBrush() const;
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
void setBottomBorderBrush(const QBrush &brush);
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
QBrush bottomBorderBrush() const;
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
void setLeftBorderBrush(const QBrush &brush);
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
QBrush leftBorderBrush() const;
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
void setRightBorderBrush(const QBrush &brush);
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
QBrush rightBorderBrush() const;
|
||||
%End
|
||||
%If (Qt_5_14_0 -)
|
||||
void setBorderBrush(const QBrush &brush);
|
||||
%End
|
||||
};
|
||||
@@ -0,0 +1,185 @@
|
||||
// qtextlayout.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QTextInlineObject
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qtextlayout.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
bool isValid() const;
|
||||
QRectF rect() const;
|
||||
qreal width() const;
|
||||
qreal ascent() const;
|
||||
qreal descent() const;
|
||||
qreal height() const;
|
||||
Qt::LayoutDirection textDirection() const;
|
||||
void setWidth(qreal w);
|
||||
void setAscent(qreal a);
|
||||
void setDescent(qreal d);
|
||||
int textPosition() const;
|
||||
int formatIndex() const;
|
||||
QTextFormat format() const;
|
||||
};
|
||||
|
||||
class QTextLayout
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qtextlayout.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QTextLayout();
|
||||
QTextLayout(const QString &text);
|
||||
QTextLayout(const QString &text, const QFont &font, QPaintDevice *paintDevice = 0);
|
||||
QTextLayout(const QTextBlock &b);
|
||||
~QTextLayout();
|
||||
void setFont(const QFont &f);
|
||||
QFont font() const;
|
||||
void setText(const QString &string);
|
||||
QString text() const;
|
||||
void setTextOption(const QTextOption &option);
|
||||
const QTextOption &textOption() const;
|
||||
void setPreeditArea(int position, const QString &text);
|
||||
int preeditAreaPosition() const;
|
||||
QString preeditAreaText() const;
|
||||
|
||||
struct FormatRange
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qtextlayout.h>
|
||||
%End
|
||||
|
||||
int start;
|
||||
int length;
|
||||
QTextCharFormat format;
|
||||
};
|
||||
|
||||
void setAdditionalFormats(const QList<QTextLayout::FormatRange> &overrides);
|
||||
QList<QTextLayout::FormatRange> additionalFormats() const;
|
||||
void clearAdditionalFormats();
|
||||
void setCacheEnabled(bool enable);
|
||||
bool cacheEnabled() const;
|
||||
void beginLayout();
|
||||
void endLayout();
|
||||
QTextLine createLine();
|
||||
int lineCount() const;
|
||||
QTextLine lineAt(int i) const;
|
||||
QTextLine lineForTextPosition(int pos) const;
|
||||
|
||||
enum CursorMode
|
||||
{
|
||||
SkipCharacters,
|
||||
SkipWords,
|
||||
};
|
||||
|
||||
bool isValidCursorPosition(int pos) const;
|
||||
int nextCursorPosition(int oldPos, QTextLayout::CursorMode mode = QTextLayout::SkipCharacters) const;
|
||||
int previousCursorPosition(int oldPos, QTextLayout::CursorMode mode = QTextLayout::SkipCharacters) const;
|
||||
void draw(QPainter *p, const QPointF &pos, const QVector<QTextLayout::FormatRange> &selections = QVector<QTextLayout::FormatRange>(), const QRectF &clip = QRectF()) const;
|
||||
void drawCursor(QPainter *p, const QPointF &pos, int cursorPosition) const;
|
||||
void drawCursor(QPainter *p, const QPointF &pos, int cursorPosition, int width) const;
|
||||
QPointF position() const;
|
||||
void setPosition(const QPointF &p);
|
||||
QRectF boundingRect() const;
|
||||
qreal minimumWidth() const;
|
||||
qreal maximumWidth() const;
|
||||
void clearLayout();
|
||||
void setCursorMoveStyle(Qt::CursorMoveStyle style);
|
||||
Qt::CursorMoveStyle cursorMoveStyle() const;
|
||||
int leftCursorPosition(int oldPos) const;
|
||||
int rightCursorPosition(int oldPos) const;
|
||||
%If (PyQt_RawFont)
|
||||
QList<QGlyphRun> glyphRuns(int from = -1, int length = -1) const;
|
||||
%End
|
||||
%If (Qt_5_6_0 -)
|
||||
void setFormats(const QVector<QTextLayout::FormatRange> &overrides);
|
||||
%End
|
||||
%If (Qt_5_6_0 -)
|
||||
QVector<QTextLayout::FormatRange> formats() const;
|
||||
%End
|
||||
%If (Qt_5_6_0 -)
|
||||
void clearFormats();
|
||||
%End
|
||||
|
||||
private:
|
||||
QTextLayout(const QTextLayout &);
|
||||
};
|
||||
|
||||
class QTextLine
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qtextlayout.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QTextLine();
|
||||
bool isValid() const;
|
||||
QRectF rect() const;
|
||||
qreal x() const;
|
||||
qreal y() const;
|
||||
qreal width() const;
|
||||
qreal ascent() const;
|
||||
qreal descent() const;
|
||||
qreal height() const;
|
||||
qreal naturalTextWidth() const;
|
||||
QRectF naturalTextRect() const;
|
||||
|
||||
enum Edge
|
||||
{
|
||||
Leading,
|
||||
Trailing,
|
||||
};
|
||||
|
||||
enum CursorPosition
|
||||
{
|
||||
CursorBetweenCharacters,
|
||||
CursorOnCharacter,
|
||||
};
|
||||
|
||||
qreal cursorToX(int *cursorPos /In,Out/, QTextLine::Edge edge = QTextLine::Leading) const;
|
||||
int xToCursor(qreal x, QTextLine::CursorPosition edge = QTextLine::CursorBetweenCharacters) const;
|
||||
void setLineWidth(qreal width);
|
||||
void setNumColumns(int columns);
|
||||
void setNumColumns(int columns, qreal alignmentWidth);
|
||||
void setPosition(const QPointF &pos);
|
||||
int textStart() const;
|
||||
int textLength() const;
|
||||
int lineNumber() const;
|
||||
void draw(QPainter *painter, const QPointF &position, const QTextLayout::FormatRange *selection = 0) const;
|
||||
QPointF position() const;
|
||||
qreal leading() const;
|
||||
void setLeadingIncluded(bool included);
|
||||
bool leadingIncluded() const;
|
||||
qreal horizontalAdvance() const;
|
||||
%If (PyQt_RawFont)
|
||||
QList<QGlyphRun> glyphRuns(int from = -1, int length = -1) const;
|
||||
%End
|
||||
};
|
||||
|
||||
%If (Qt_5_6_0 -)
|
||||
bool operator==(const QTextLayout::FormatRange &lhs, const QTextLayout::FormatRange &rhs);
|
||||
%End
|
||||
%If (Qt_5_6_0 -)
|
||||
bool operator!=(const QTextLayout::FormatRange &lhs, const QTextLayout::FormatRange &rhs);
|
||||
%End
|
||||
@@ -0,0 +1,44 @@
|
||||
// qtextlist.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QTextList : public QTextBlockGroup
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qtextlist.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
explicit QTextList(QTextDocument *doc);
|
||||
virtual ~QTextList();
|
||||
int count() const /__len__/;
|
||||
QTextBlock item(int i) const;
|
||||
int itemNumber(const QTextBlock &) const;
|
||||
QString itemText(const QTextBlock &) const;
|
||||
void removeItem(int i);
|
||||
void remove(const QTextBlock &);
|
||||
void add(const QTextBlock &block);
|
||||
QTextListFormat format() const;
|
||||
void setFormat(const QTextListFormat &aformat);
|
||||
|
||||
private:
|
||||
QTextList(const QTextList &);
|
||||
};
|
||||
@@ -0,0 +1,296 @@
|
||||
// qtextobject.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QTextObject : public QObject
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qtextobject.h>
|
||||
%End
|
||||
|
||||
protected:
|
||||
explicit QTextObject(QTextDocument *doc);
|
||||
virtual ~QTextObject();
|
||||
void setFormat(const QTextFormat &format);
|
||||
|
||||
public:
|
||||
QTextFormat format() const;
|
||||
int formatIndex() const;
|
||||
QTextDocument *document() const;
|
||||
int objectIndex() const;
|
||||
};
|
||||
|
||||
class QTextBlockGroup : public QTextObject
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qtextobject.h>
|
||||
%End
|
||||
|
||||
protected:
|
||||
explicit QTextBlockGroup(QTextDocument *doc);
|
||||
virtual ~QTextBlockGroup();
|
||||
virtual void blockInserted(const QTextBlock &block);
|
||||
virtual void blockRemoved(const QTextBlock &block);
|
||||
virtual void blockFormatChanged(const QTextBlock &block);
|
||||
QList<QTextBlock> blockList() const;
|
||||
};
|
||||
|
||||
class QTextFrame : public QTextObject
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qtextobject.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
explicit QTextFrame(QTextDocument *doc);
|
||||
virtual ~QTextFrame();
|
||||
QTextFrameFormat frameFormat() const;
|
||||
QTextCursor firstCursorPosition() const;
|
||||
QTextCursor lastCursorPosition() const;
|
||||
int firstPosition() const;
|
||||
int lastPosition() const;
|
||||
QList<QTextFrame *> childFrames() const;
|
||||
QTextFrame *parentFrame() const;
|
||||
|
||||
class iterator
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qtextobject.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
iterator();
|
||||
iterator(const QTextFrame::iterator &o);
|
||||
QTextFrame *parentFrame() const;
|
||||
QTextFrame *currentFrame() const;
|
||||
QTextBlock currentBlock() const;
|
||||
bool atEnd() const;
|
||||
bool operator==(const QTextFrame::iterator &o) const;
|
||||
bool operator!=(const QTextFrame::iterator &o) const;
|
||||
QTextFrame::iterator &operator+=(int);
|
||||
%MethodCode
|
||||
if (a0 > 0)
|
||||
while (a0--)
|
||||
(*sipCpp)++;
|
||||
else if (a0 < 0)
|
||||
while (a0++)
|
||||
(*sipCpp)--;
|
||||
%End
|
||||
|
||||
QTextFrame::iterator &operator-=(int);
|
||||
%MethodCode
|
||||
if (a0 > 0)
|
||||
while (a0--)
|
||||
(*sipCpp)--;
|
||||
else if (a0 < 0)
|
||||
while (a0++)
|
||||
(*sipCpp)++;
|
||||
%End
|
||||
};
|
||||
|
||||
typedef QTextFrame::iterator Iterator;
|
||||
QTextFrame::iterator begin() const;
|
||||
QTextFrame::iterator end() const;
|
||||
void setFrameFormat(const QTextFrameFormat &aformat);
|
||||
};
|
||||
|
||||
class QTextBlock /Supertype=sip.wrapper/
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qtextobject.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QTextBlock();
|
||||
QTextBlock(const QTextBlock &o);
|
||||
bool isValid() const;
|
||||
bool operator==(const QTextBlock &o) const;
|
||||
bool operator!=(const QTextBlock &o) const;
|
||||
bool operator<(const QTextBlock &o) const;
|
||||
int position() const;
|
||||
int length() const;
|
||||
bool contains(int position) const;
|
||||
QTextLayout *layout() const;
|
||||
QTextBlockFormat blockFormat() const;
|
||||
int blockFormatIndex() const;
|
||||
QTextCharFormat charFormat() const;
|
||||
int charFormatIndex() const;
|
||||
QString text() const;
|
||||
const QTextDocument *document() const;
|
||||
QTextList *textList() const;
|
||||
|
||||
class iterator
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qtextobject.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
iterator();
|
||||
iterator(const QTextBlock::iterator &o);
|
||||
QTextFragment fragment() const;
|
||||
bool atEnd() const;
|
||||
bool operator==(const QTextBlock::iterator &o) const;
|
||||
bool operator!=(const QTextBlock::iterator &o) const;
|
||||
QTextBlock::iterator &operator+=(int);
|
||||
%MethodCode
|
||||
if (a0 > 0)
|
||||
while (a0--)
|
||||
(*sipCpp)++;
|
||||
else if (a0 < 0)
|
||||
while (a0++)
|
||||
(*sipCpp)--;
|
||||
%End
|
||||
|
||||
QTextBlock::iterator &operator-=(int);
|
||||
%MethodCode
|
||||
if (a0 > 0)
|
||||
while (a0--)
|
||||
(*sipCpp)--;
|
||||
else if (a0 < 0)
|
||||
while (a0++)
|
||||
(*sipCpp)++;
|
||||
%End
|
||||
};
|
||||
|
||||
typedef QTextBlock::iterator Iterator;
|
||||
QTextBlock::iterator begin() const;
|
||||
QTextBlock::iterator end() const;
|
||||
QTextBlock next() const;
|
||||
QTextBlock previous() const;
|
||||
QTextBlockUserData *userData() const;
|
||||
void setUserData(QTextBlockUserData *data /GetWrapper/);
|
||||
%MethodCode
|
||||
// Ownership of the user data is with the document not the text block.
|
||||
const QTextDocument *td = sipCpp->document();
|
||||
|
||||
if (td)
|
||||
{
|
||||
PyObject *py_td = qtgui_wrap_ancestors(const_cast<QTextDocument *>(td),
|
||||
sipType_QTextDocument);
|
||||
|
||||
if (!py_td)
|
||||
{
|
||||
sipIsErr = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
sipTransferTo(a0Wrapper, py_td);
|
||||
Py_DECREF(py_td);
|
||||
}
|
||||
}
|
||||
|
||||
sipCpp->setUserData(a0);
|
||||
%End
|
||||
|
||||
int userState() const;
|
||||
void setUserState(int state);
|
||||
void clearLayout();
|
||||
int revision() const;
|
||||
void setRevision(int rev);
|
||||
bool isVisible() const;
|
||||
void setVisible(bool visible);
|
||||
int blockNumber() const;
|
||||
int firstLineNumber() const;
|
||||
void setLineCount(int count);
|
||||
int lineCount() const;
|
||||
Qt::LayoutDirection textDirection() const;
|
||||
%If (Qt_5_3_0 -)
|
||||
QVector<QTextLayout::FormatRange> textFormats() const;
|
||||
%End
|
||||
};
|
||||
|
||||
class QTextFragment
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qtextobject.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QTextFragment();
|
||||
QTextFragment(const QTextFragment &o);
|
||||
bool isValid() const;
|
||||
bool operator==(const QTextFragment &o) const;
|
||||
bool operator!=(const QTextFragment &o) const;
|
||||
bool operator<(const QTextFragment &o) const;
|
||||
int position() const;
|
||||
int length() const;
|
||||
bool contains(int position) const;
|
||||
QTextCharFormat charFormat() const;
|
||||
int charFormatIndex() const;
|
||||
QString text() const;
|
||||
%If (PyQt_RawFont)
|
||||
QList<QGlyphRun> glyphRuns(int from = -1, int length = -1) const;
|
||||
%End
|
||||
};
|
||||
|
||||
class QTextBlockUserData /Supertype=sip.wrapper/
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qtextobject.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
virtual ~QTextBlockUserData();
|
||||
};
|
||||
|
||||
%ModuleHeaderCode
|
||||
PyObject *qtgui_wrap_ancestors(QObject *obj, const sipTypeDef *td);
|
||||
%End
|
||||
|
||||
%ModuleCode
|
||||
// Wrap a QObject and ensure that it's ancestors are all wrapped with the
|
||||
// correct ownerships.
|
||||
static PyObject *qtgui_wrap_ancestors_worker(QObject *obj)
|
||||
{
|
||||
if (!obj)
|
||||
{
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
}
|
||||
|
||||
PyObject *py_parent = qtgui_wrap_ancestors_worker(obj->parent());
|
||||
|
||||
if (!py_parent)
|
||||
return 0;
|
||||
|
||||
PyObject *py_obj = sipConvertFromType(obj, sipType_QObject,
|
||||
(py_parent != Py_None ? py_parent : 0));
|
||||
|
||||
Py_DECREF(py_parent);
|
||||
return py_obj;
|
||||
}
|
||||
|
||||
PyObject *qtgui_wrap_ancestors(QObject *obj, const sipTypeDef *td)
|
||||
{
|
||||
PyObject *py_parent = qtgui_wrap_ancestors_worker(obj->parent());
|
||||
|
||||
if (!py_parent)
|
||||
return 0;
|
||||
|
||||
PyObject *py_obj = sipConvertFromType(obj, td,
|
||||
(py_parent != Py_None ? py_parent : 0));
|
||||
|
||||
Py_DECREF(py_parent);
|
||||
|
||||
return py_obj;
|
||||
}
|
||||
%End
|
||||
@@ -0,0 +1,106 @@
|
||||
// qtextoption.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QTextOption
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qtextoption.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QTextOption();
|
||||
QTextOption(Qt::Alignment alignment);
|
||||
~QTextOption();
|
||||
QTextOption(const QTextOption &o);
|
||||
Qt::Alignment alignment() const;
|
||||
void setTextDirection(Qt::LayoutDirection aDirection);
|
||||
Qt::LayoutDirection textDirection() const;
|
||||
|
||||
enum WrapMode
|
||||
{
|
||||
NoWrap,
|
||||
WordWrap,
|
||||
ManualWrap,
|
||||
WrapAnywhere,
|
||||
WrapAtWordBoundaryOrAnywhere,
|
||||
};
|
||||
|
||||
void setWrapMode(QTextOption::WrapMode wrap);
|
||||
QTextOption::WrapMode wrapMode() const;
|
||||
|
||||
enum Flag
|
||||
{
|
||||
IncludeTrailingSpaces,
|
||||
ShowTabsAndSpaces,
|
||||
ShowLineAndParagraphSeparators,
|
||||
AddSpaceForLineAndParagraphSeparators,
|
||||
SuppressColors,
|
||||
%If (Qt_5_7_0 -)
|
||||
ShowDocumentTerminator,
|
||||
%End
|
||||
};
|
||||
|
||||
typedef QFlags<QTextOption::Flag> Flags;
|
||||
QTextOption::Flags flags() const;
|
||||
qreal tabStop() const;
|
||||
void setTabArray(const QList<qreal> &tabStops);
|
||||
QList<qreal> tabArray() const;
|
||||
void setUseDesignMetrics(bool b);
|
||||
bool useDesignMetrics() const;
|
||||
void setAlignment(Qt::Alignment aalignment);
|
||||
void setFlags(QTextOption::Flags flags);
|
||||
void setTabStop(qreal atabStop);
|
||||
|
||||
enum TabType
|
||||
{
|
||||
LeftTab,
|
||||
RightTab,
|
||||
CenterTab,
|
||||
DelimiterTab,
|
||||
};
|
||||
|
||||
struct Tab
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qtextoption.h>
|
||||
%End
|
||||
|
||||
Tab();
|
||||
Tab(qreal pos, QTextOption::TabType tabType, QChar delim = QChar());
|
||||
bool operator==(const QTextOption::Tab &other) const;
|
||||
bool operator!=(const QTextOption::Tab &other) const;
|
||||
qreal position;
|
||||
QTextOption::TabType type;
|
||||
QChar delimiter;
|
||||
};
|
||||
|
||||
void setTabs(const QList<QTextOption::Tab> &tabStops);
|
||||
QList<QTextOption::Tab> tabs() const;
|
||||
%If (Qt_5_10_0 -)
|
||||
void setTabStopDistance(qreal tabStopDistance);
|
||||
%End
|
||||
%If (Qt_5_10_0 -)
|
||||
qreal tabStopDistance() const;
|
||||
%End
|
||||
};
|
||||
|
||||
QFlags<QTextOption::Flag> operator|(QTextOption::Flag f1, QFlags<QTextOption::Flag> f2);
|
||||
@@ -0,0 +1,75 @@
|
||||
// qtexttable.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QTextTableCell
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qtexttable.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QTextTableCell();
|
||||
~QTextTableCell();
|
||||
QTextTableCell(const QTextTableCell &o);
|
||||
QTextCharFormat format() const;
|
||||
void setFormat(const QTextCharFormat &format);
|
||||
int row() const;
|
||||
int column() const;
|
||||
int rowSpan() const;
|
||||
int columnSpan() const;
|
||||
bool isValid() const;
|
||||
QTextCursor firstCursorPosition() const;
|
||||
QTextCursor lastCursorPosition() const;
|
||||
int tableCellFormatIndex() const;
|
||||
bool operator==(const QTextTableCell &other) const;
|
||||
bool operator!=(const QTextTableCell &other) const;
|
||||
};
|
||||
|
||||
class QTextTable : public QTextFrame
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qtexttable.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
explicit QTextTable(QTextDocument *doc);
|
||||
virtual ~QTextTable();
|
||||
void resize(int rows, int cols);
|
||||
void insertRows(int pos, int num);
|
||||
void insertColumns(int pos, int num);
|
||||
void removeRows(int pos, int num);
|
||||
void removeColumns(int pos, int num);
|
||||
void mergeCells(int row, int col, int numRows, int numCols);
|
||||
void mergeCells(const QTextCursor &cursor);
|
||||
void splitCell(int row, int col, int numRows, int numCols);
|
||||
int rows() const;
|
||||
int columns() const;
|
||||
QTextTableCell cellAt(int row, int col) const;
|
||||
QTextTableCell cellAt(int position) const;
|
||||
QTextTableCell cellAt(const QTextCursor &c) const;
|
||||
QTextCursor rowStart(const QTextCursor &c) const;
|
||||
QTextCursor rowEnd(const QTextCursor &c) const;
|
||||
QTextTableFormat format() const;
|
||||
void setFormat(const QTextTableFormat &aformat);
|
||||
void appendRows(int count);
|
||||
void appendColumns(int count);
|
||||
};
|
||||
@@ -0,0 +1,67 @@
|
||||
// qtouchdevice.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QTouchDevice
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qtouchdevice.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum DeviceType
|
||||
{
|
||||
TouchScreen,
|
||||
TouchPad,
|
||||
};
|
||||
|
||||
enum CapabilityFlag
|
||||
{
|
||||
Position,
|
||||
Area,
|
||||
Pressure,
|
||||
Velocity,
|
||||
RawPositions,
|
||||
NormalizedPosition,
|
||||
%If (Qt_5_5_0 -)
|
||||
MouseEmulation,
|
||||
%End
|
||||
};
|
||||
|
||||
typedef QFlags<QTouchDevice::CapabilityFlag> Capabilities;
|
||||
QTouchDevice();
|
||||
~QTouchDevice();
|
||||
static QList<const QTouchDevice *> devices();
|
||||
QString name() const;
|
||||
QTouchDevice::DeviceType type() const;
|
||||
QTouchDevice::Capabilities capabilities() const;
|
||||
void setName(const QString &name);
|
||||
void setType(QTouchDevice::DeviceType devType);
|
||||
void setCapabilities(QTouchDevice::Capabilities caps);
|
||||
%If (Qt_5_2_0 -)
|
||||
int maximumTouchPoints() const;
|
||||
%End
|
||||
%If (Qt_5_2_0 -)
|
||||
void setMaximumTouchPoints(int max);
|
||||
%End
|
||||
};
|
||||
|
||||
QFlags<QTouchDevice::CapabilityFlag> operator|(QTouchDevice::CapabilityFlag f1, QFlags<QTouchDevice::CapabilityFlag> f2);
|
||||
@@ -0,0 +1,132 @@
|
||||
// qtransform.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%ModuleCode
|
||||
#include <qtransform.h>
|
||||
%End
|
||||
|
||||
class QTransform
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qtransform.h>
|
||||
%End
|
||||
|
||||
%PickleCode
|
||||
sipRes = Py_BuildValue((char *)"ddddddddd", sipCpp->m11(), sipCpp->m12(), sipCpp->m13(), sipCpp->m21(), sipCpp->m22(), sipCpp->m23(), sipCpp->m31(), sipCpp->m32(), sipCpp->m33());
|
||||
%End
|
||||
|
||||
public:
|
||||
enum TransformationType
|
||||
{
|
||||
TxNone,
|
||||
TxTranslate,
|
||||
TxScale,
|
||||
TxRotate,
|
||||
TxShear,
|
||||
TxProject,
|
||||
};
|
||||
|
||||
QTransform();
|
||||
QTransform(qreal m11, qreal m12, qreal m13, qreal m21, qreal m22, qreal m23, qreal m31, qreal m32, qreal m33 = 1.0e+0);
|
||||
QTransform(qreal h11, qreal h12, qreal h13, qreal h21, qreal h22, qreal h23);
|
||||
%If (Qt_5_7_0 -)
|
||||
QTransform(const QTransform &other);
|
||||
%End
|
||||
QTransform::TransformationType type() const;
|
||||
void setMatrix(qreal m11, qreal m12, qreal m13, qreal m21, qreal m22, qreal m23, qreal m31, qreal m32, qreal m33);
|
||||
QTransform inverted(bool *invertible = 0) const;
|
||||
QTransform adjoint() const;
|
||||
QTransform transposed() const;
|
||||
QTransform &translate(qreal dx, qreal dy);
|
||||
QTransform &scale(qreal sx, qreal sy);
|
||||
QTransform &shear(qreal sh, qreal sv);
|
||||
QTransform &rotate(qreal angle, Qt::Axis axis = Qt::ZAxis);
|
||||
QTransform &rotateRadians(qreal angle, Qt::Axis axis = Qt::ZAxis);
|
||||
static bool squareToQuad(const QPolygonF &square, QTransform &result);
|
||||
static bool quadToSquare(const QPolygonF &quad, QTransform &result);
|
||||
static bool quadToQuad(const QPolygonF &one, const QPolygonF &two, QTransform &result);
|
||||
bool operator==(const QTransform &) const;
|
||||
bool operator!=(const QTransform &) const;
|
||||
QTransform &operator*=(const QTransform &) /__imatmul__/;
|
||||
QTransform operator*(const QTransform &o) const /__matmul__/;
|
||||
void reset();
|
||||
void map(int x /Constrained/, int y /Constrained/, int *tx, int *ty) const;
|
||||
void map(qreal x, qreal y, qreal *tx, qreal *ty) const;
|
||||
QPoint map(const QPoint &p) const;
|
||||
QPointF map(const QPointF &p) const;
|
||||
QLine map(const QLine &l) const;
|
||||
QLineF map(const QLineF &l) const;
|
||||
QPolygonF map(const QPolygonF &a) const;
|
||||
QPolygon map(const QPolygon &a) const;
|
||||
QRegion map(const QRegion &r) const;
|
||||
QPainterPath map(const QPainterPath &p) const;
|
||||
QPolygon mapToPolygon(const QRect &r) const;
|
||||
QRect mapRect(const QRect &) const;
|
||||
QRectF mapRect(const QRectF &) const;
|
||||
bool isAffine() const;
|
||||
bool isIdentity() const;
|
||||
bool isInvertible() const;
|
||||
bool isScaling() const;
|
||||
bool isRotating() const;
|
||||
bool isTranslating() const;
|
||||
qreal determinant() const;
|
||||
qreal m11() const;
|
||||
qreal m12() const;
|
||||
qreal m13() const;
|
||||
qreal m21() const;
|
||||
qreal m22() const;
|
||||
qreal m23() const;
|
||||
qreal m31() const;
|
||||
qreal m32() const;
|
||||
qreal m33() const;
|
||||
qreal dx() const;
|
||||
qreal dy() const;
|
||||
static QTransform fromTranslate(qreal dx, qreal dy);
|
||||
static QTransform fromScale(qreal dx, qreal dy);
|
||||
QTransform &operator*=(qreal num);
|
||||
QTransform &operator/=(qreal div);
|
||||
QTransform &operator+=(qreal num);
|
||||
QTransform &operator-=(qreal num);
|
||||
%If (Qt_5_6_0 -)
|
||||
long __hash__() const;
|
||||
%MethodCode
|
||||
sipRes = qHash(*sipCpp);
|
||||
%End
|
||||
|
||||
%End
|
||||
};
|
||||
|
||||
QDataStream &operator<<(QDataStream &, const QTransform & /Constrained/) /ReleaseGIL/;
|
||||
QDataStream &operator>>(QDataStream &, QTransform & /Constrained/) /ReleaseGIL/;
|
||||
QPoint operator*(const QPoint &p, const QTransform &m);
|
||||
QPointF operator*(const QPointF &p, const QTransform &m);
|
||||
QLineF operator*(const QLineF &l, const QTransform &m);
|
||||
QLine operator*(const QLine &l, const QTransform &m);
|
||||
QPolygon operator*(const QPolygon &a, const QTransform &m);
|
||||
QPolygonF operator*(const QPolygonF &a, const QTransform &m);
|
||||
QRegion operator*(const QRegion &r, const QTransform &m);
|
||||
QPainterPath operator*(const QPainterPath &p, const QTransform &m);
|
||||
QTransform operator*(const QTransform &a, qreal n);
|
||||
QTransform operator/(const QTransform &a, qreal n);
|
||||
QTransform operator+(const QTransform &a, qreal n);
|
||||
QTransform operator-(const QTransform &a, qreal n);
|
||||
bool qFuzzyCompare(const QTransform &t1, const QTransform &t2);
|
||||
@@ -0,0 +1,129 @@
|
||||
// qvalidator.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QValidator : public QObject
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qvalidator.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
explicit QValidator(QObject *parent /TransferThis/ = 0);
|
||||
virtual ~QValidator();
|
||||
|
||||
enum State
|
||||
{
|
||||
Invalid,
|
||||
Intermediate,
|
||||
Acceptable,
|
||||
};
|
||||
|
||||
virtual QValidator::State validate(QString & /In,Out/, int & /In,Out/) const = 0;
|
||||
virtual void fixup(QString & /In,Out/) const;
|
||||
void setLocale(const QLocale &locale);
|
||||
QLocale locale() const;
|
||||
|
||||
signals:
|
||||
void changed();
|
||||
};
|
||||
|
||||
class QIntValidator : public QValidator
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qvalidator.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
explicit QIntValidator(QObject *parent /TransferThis/ = 0);
|
||||
QIntValidator(int bottom, int top, QObject *parent /TransferThis/ = 0);
|
||||
virtual ~QIntValidator();
|
||||
virtual QValidator::State validate(QString & /In,Out/, int & /In,Out/) const;
|
||||
virtual void fixup(QString &input /In,Out/) const;
|
||||
void setBottom(int);
|
||||
void setTop(int);
|
||||
virtual void setRange(int bottom, int top);
|
||||
int bottom() const;
|
||||
int top() const;
|
||||
};
|
||||
|
||||
class QDoubleValidator : public QValidator
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qvalidator.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
explicit QDoubleValidator(QObject *parent /TransferThis/ = 0);
|
||||
QDoubleValidator(double bottom, double top, int decimals, QObject *parent /TransferThis/ = 0);
|
||||
virtual ~QDoubleValidator();
|
||||
virtual QValidator::State validate(QString & /In,Out/, int & /In,Out/) const;
|
||||
virtual void setRange(double minimum, double maximum, int decimals = 0);
|
||||
void setBottom(double);
|
||||
void setTop(double);
|
||||
void setDecimals(int);
|
||||
double bottom() const;
|
||||
double top() const;
|
||||
int decimals() const;
|
||||
|
||||
enum Notation
|
||||
{
|
||||
StandardNotation,
|
||||
ScientificNotation,
|
||||
};
|
||||
|
||||
void setNotation(QDoubleValidator::Notation);
|
||||
QDoubleValidator::Notation notation() const;
|
||||
};
|
||||
|
||||
class QRegExpValidator : public QValidator
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qvalidator.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
explicit QRegExpValidator(QObject *parent /TransferThis/ = 0);
|
||||
QRegExpValidator(const QRegExp &rx, QObject *parent /TransferThis/ = 0);
|
||||
virtual ~QRegExpValidator();
|
||||
virtual QValidator::State validate(QString &input /In,Out/, int &pos /In,Out/) const;
|
||||
void setRegExp(const QRegExp &rx);
|
||||
const QRegExp ®Exp() const;
|
||||
};
|
||||
|
||||
%If (Qt_5_1_0 -)
|
||||
|
||||
class QRegularExpressionValidator : public QValidator
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qvalidator.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
explicit QRegularExpressionValidator(QObject *parent /TransferThis/ = 0);
|
||||
QRegularExpressionValidator(const QRegularExpression &re, QObject *parent /TransferThis/ = 0);
|
||||
virtual ~QRegularExpressionValidator();
|
||||
virtual QValidator::State validate(QString &input /In,Out/, int &pos /In,Out/) const;
|
||||
QRegularExpression regularExpression() const;
|
||||
void setRegularExpression(const QRegularExpression &re);
|
||||
};
|
||||
|
||||
%End
|
||||
@@ -0,0 +1,113 @@
|
||||
// qvector2d.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%ModuleCode
|
||||
#include <qvector2d.h>
|
||||
%End
|
||||
|
||||
class QVector2D
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qvector2d.h>
|
||||
%End
|
||||
|
||||
%PickleCode
|
||||
sipRes = Py_BuildValue((char *)"dd", (double)sipCpp->x(), (double)sipCpp->y());
|
||||
%End
|
||||
|
||||
public:
|
||||
QVector2D();
|
||||
QVector2D(float xpos, float ypos);
|
||||
explicit QVector2D(const QPoint &point);
|
||||
explicit QVector2D(const QPointF &point);
|
||||
explicit QVector2D(const QVector3D &vector);
|
||||
explicit QVector2D(const QVector4D &vector);
|
||||
SIP_PYOBJECT __repr__() const /TypeHint="str"/;
|
||||
%MethodCode
|
||||
PyObject *x = PyFloat_FromDouble(sipCpp->x());
|
||||
PyObject *y = PyFloat_FromDouble(sipCpp->y());
|
||||
|
||||
if (x && y)
|
||||
{
|
||||
#if PY_MAJOR_VERSION >= 3
|
||||
sipRes = PyUnicode_FromFormat("PyQt5.QtGui.QVector2D(%R, %R)", x, y);
|
||||
#else
|
||||
sipRes = PyString_FromString("PyQt5.QtGui.QVector2D(");
|
||||
PyString_ConcatAndDel(&sipRes, PyObject_Repr(x));
|
||||
PyString_ConcatAndDel(&sipRes, PyString_FromString(", "));
|
||||
PyString_ConcatAndDel(&sipRes, PyObject_Repr(y));
|
||||
PyString_ConcatAndDel(&sipRes, PyString_FromString(")"));
|
||||
#endif
|
||||
}
|
||||
|
||||
Py_XDECREF(x);
|
||||
Py_XDECREF(y);
|
||||
%End
|
||||
|
||||
float length() const;
|
||||
float lengthSquared() const;
|
||||
QVector2D normalized() const;
|
||||
void normalize();
|
||||
static float dotProduct(const QVector2D &v1, const QVector2D &v2);
|
||||
QVector3D toVector3D() const;
|
||||
QVector4D toVector4D() const;
|
||||
bool isNull() const;
|
||||
float x() const;
|
||||
float y() const;
|
||||
void setX(float aX);
|
||||
void setY(float aY);
|
||||
QVector2D &operator+=(const QVector2D &vector);
|
||||
QVector2D &operator-=(const QVector2D &vector);
|
||||
QVector2D &operator*=(float factor);
|
||||
QVector2D &operator*=(const QVector2D &vector);
|
||||
QVector2D &operator/=(float divisor);
|
||||
%If (Qt_5_5_0 -)
|
||||
QVector2D &operator/=(const QVector2D &vector);
|
||||
%End
|
||||
QPoint toPoint() const;
|
||||
QPointF toPointF() const;
|
||||
%If (Qt_5_1_0 -)
|
||||
float distanceToPoint(const QVector2D &point) const;
|
||||
%End
|
||||
%If (Qt_5_1_0 -)
|
||||
float distanceToLine(const QVector2D &point, const QVector2D &direction) const;
|
||||
%End
|
||||
%If (Qt_5_2_0 -)
|
||||
float operator[](int i) const;
|
||||
%End
|
||||
};
|
||||
|
||||
bool operator==(const QVector2D &v1, const QVector2D &v2);
|
||||
bool operator!=(const QVector2D &v1, const QVector2D &v2);
|
||||
const QVector2D operator+(const QVector2D &v1, const QVector2D &v2);
|
||||
const QVector2D operator-(const QVector2D &v1, const QVector2D &v2);
|
||||
const QVector2D operator*(float factor, const QVector2D &vector);
|
||||
const QVector2D operator*(const QVector2D &vector, float factor);
|
||||
const QVector2D operator*(const QVector2D &v1, const QVector2D &v2);
|
||||
const QVector2D operator-(const QVector2D &vector);
|
||||
const QVector2D operator/(const QVector2D &vector, float divisor);
|
||||
%If (Qt_5_5_0 -)
|
||||
const QVector2D operator/(const QVector2D &vector, const QVector2D &divisor);
|
||||
%End
|
||||
bool qFuzzyCompare(const QVector2D &v1, const QVector2D &v2);
|
||||
QDataStream &operator<<(QDataStream &, const QVector2D & /Constrained/) /ReleaseGIL/;
|
||||
QDataStream &operator>>(QDataStream &, QVector2D & /Constrained/) /ReleaseGIL/;
|
||||
@@ -0,0 +1,131 @@
|
||||
// qvector3d.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%ModuleCode
|
||||
#include <qvector3d.h>
|
||||
%End
|
||||
|
||||
class QVector3D
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qvector3d.h>
|
||||
%End
|
||||
|
||||
%PickleCode
|
||||
sipRes = Py_BuildValue((char *)"ddd", (double)sipCpp->x(), (double)sipCpp->y(),
|
||||
(double)sipCpp->z());
|
||||
%End
|
||||
|
||||
public:
|
||||
QVector3D();
|
||||
QVector3D(float xpos, float ypos, float zpos);
|
||||
explicit QVector3D(const QPoint &point);
|
||||
explicit QVector3D(const QPointF &point);
|
||||
QVector3D(const QVector2D &vector);
|
||||
QVector3D(const QVector2D &vector, float zpos);
|
||||
explicit QVector3D(const QVector4D &vector);
|
||||
SIP_PYOBJECT __repr__() const /TypeHint="str"/;
|
||||
%MethodCode
|
||||
PyObject *x = PyFloat_FromDouble(sipCpp->x());
|
||||
PyObject *y = PyFloat_FromDouble(sipCpp->y());
|
||||
PyObject *z = PyFloat_FromDouble(sipCpp->z());
|
||||
|
||||
if (x && y && z)
|
||||
{
|
||||
#if PY_MAJOR_VERSION >= 3
|
||||
sipRes = PyUnicode_FromFormat("PyQt5.QtGui.QVector3D(%R, %R, %R)", x, y,
|
||||
z);
|
||||
#else
|
||||
sipRes = PyString_FromString("PyQt5.QtGui.QVector3D(");
|
||||
PyString_ConcatAndDel(&sipRes, PyObject_Repr(x));
|
||||
PyString_ConcatAndDel(&sipRes, PyString_FromString(", "));
|
||||
PyString_ConcatAndDel(&sipRes, PyObject_Repr(y));
|
||||
PyString_ConcatAndDel(&sipRes, PyString_FromString(", "));
|
||||
PyString_ConcatAndDel(&sipRes, PyObject_Repr(z));
|
||||
PyString_ConcatAndDel(&sipRes, PyString_FromString(")"));
|
||||
#endif
|
||||
}
|
||||
|
||||
Py_XDECREF(x);
|
||||
Py_XDECREF(y);
|
||||
Py_XDECREF(z);
|
||||
%End
|
||||
|
||||
float length() const;
|
||||
float lengthSquared() const;
|
||||
QVector3D normalized() const;
|
||||
void normalize();
|
||||
static float dotProduct(const QVector3D &v1, const QVector3D &v2);
|
||||
static QVector3D crossProduct(const QVector3D &v1, const QVector3D &v2);
|
||||
static QVector3D normal(const QVector3D &v1, const QVector3D &v2);
|
||||
static QVector3D normal(const QVector3D &v1, const QVector3D &v2, const QVector3D &v3);
|
||||
float distanceToPlane(const QVector3D &plane, const QVector3D &normal) const;
|
||||
float distanceToPlane(const QVector3D &plane1, const QVector3D &plane2, const QVector3D &plane3) const;
|
||||
float distanceToLine(const QVector3D &point, const QVector3D &direction) const;
|
||||
QVector2D toVector2D() const;
|
||||
QVector4D toVector4D() const;
|
||||
bool isNull() const;
|
||||
float x() const;
|
||||
float y() const;
|
||||
float z() const;
|
||||
void setX(float aX);
|
||||
void setY(float aY);
|
||||
void setZ(float aZ);
|
||||
QVector3D &operator+=(const QVector3D &vector);
|
||||
QVector3D &operator-=(const QVector3D &vector);
|
||||
QVector3D &operator*=(float factor);
|
||||
QVector3D &operator*=(const QVector3D &vector);
|
||||
QVector3D &operator/=(float divisor);
|
||||
%If (Qt_5_5_0 -)
|
||||
QVector3D &operator/=(const QVector3D &vector);
|
||||
%End
|
||||
QPoint toPoint() const;
|
||||
QPointF toPointF() const;
|
||||
%If (Qt_5_1_0 -)
|
||||
float distanceToPoint(const QVector3D &point) const;
|
||||
%End
|
||||
%If (Qt_5_2_0 -)
|
||||
float operator[](int i) const;
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
QVector3D project(const QMatrix4x4 &modelView, const QMatrix4x4 &projection, const QRect &viewport) const;
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
QVector3D unproject(const QMatrix4x4 &modelView, const QMatrix4x4 &projection, const QRect &viewport) const;
|
||||
%End
|
||||
};
|
||||
|
||||
bool operator==(const QVector3D &v1, const QVector3D &v2);
|
||||
bool operator!=(const QVector3D &v1, const QVector3D &v2);
|
||||
const QVector3D operator+(const QVector3D &v1, const QVector3D &v2);
|
||||
const QVector3D operator-(const QVector3D &v1, const QVector3D &v2);
|
||||
const QVector3D operator*(float factor, const QVector3D &vector);
|
||||
const QVector3D operator*(const QVector3D &vector, float factor);
|
||||
const QVector3D operator*(const QVector3D &v1, const QVector3D &v2);
|
||||
const QVector3D operator-(const QVector3D &vector);
|
||||
const QVector3D operator/(const QVector3D &vector, float divisor);
|
||||
%If (Qt_5_5_0 -)
|
||||
const QVector3D operator/(const QVector3D &vector, const QVector3D &divisor);
|
||||
%End
|
||||
bool qFuzzyCompare(const QVector3D &v1, const QVector3D &v2);
|
||||
QDataStream &operator<<(QDataStream &, const QVector3D & /Constrained/) /ReleaseGIL/;
|
||||
QDataStream &operator>>(QDataStream &, QVector3D & /Constrained/) /ReleaseGIL/;
|
||||
@@ -0,0 +1,125 @@
|
||||
// qvector4d.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%ModuleCode
|
||||
#include <qvector4d.h>
|
||||
%End
|
||||
|
||||
class QVector4D
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qvector4d.h>
|
||||
%End
|
||||
|
||||
%PickleCode
|
||||
sipRes = Py_BuildValue((char *)"dddd", (double)sipCpp->x(),
|
||||
(double)sipCpp->y(), (double)sipCpp->z(), (double)sipCpp->w());
|
||||
%End
|
||||
|
||||
public:
|
||||
QVector4D();
|
||||
QVector4D(float xpos, float ypos, float zpos, float wpos);
|
||||
explicit QVector4D(const QPoint &point);
|
||||
explicit QVector4D(const QPointF &point);
|
||||
QVector4D(const QVector2D &vector);
|
||||
QVector4D(const QVector2D &vector, float zpos, float wpos);
|
||||
QVector4D(const QVector3D &vector);
|
||||
QVector4D(const QVector3D &vector, float wpos);
|
||||
SIP_PYOBJECT __repr__() const /TypeHint="str"/;
|
||||
%MethodCode
|
||||
PyObject *x = PyFloat_FromDouble(sipCpp->x());
|
||||
PyObject *y = PyFloat_FromDouble(sipCpp->y());
|
||||
PyObject *z = PyFloat_FromDouble(sipCpp->z());
|
||||
PyObject *w = PyFloat_FromDouble(sipCpp->w());
|
||||
|
||||
if (x && y && z && w)
|
||||
{
|
||||
#if PY_MAJOR_VERSION >= 3
|
||||
sipRes = PyUnicode_FromFormat("PyQt5.QtGui.QVector4D(%R, %R, %R, %R)", x,
|
||||
y, z, w);
|
||||
#else
|
||||
sipRes = PyString_FromString("PyQt5.QtGui.QVector4D(");
|
||||
PyString_ConcatAndDel(&sipRes, PyObject_Repr(x));
|
||||
PyString_ConcatAndDel(&sipRes, PyString_FromString(", "));
|
||||
PyString_ConcatAndDel(&sipRes, PyObject_Repr(y));
|
||||
PyString_ConcatAndDel(&sipRes, PyString_FromString(", "));
|
||||
PyString_ConcatAndDel(&sipRes, PyObject_Repr(z));
|
||||
PyString_ConcatAndDel(&sipRes, PyString_FromString(", "));
|
||||
PyString_ConcatAndDel(&sipRes, PyObject_Repr(w));
|
||||
PyString_ConcatAndDel(&sipRes, PyString_FromString(")"));
|
||||
#endif
|
||||
}
|
||||
|
||||
Py_XDECREF(x);
|
||||
Py_XDECREF(y);
|
||||
Py_XDECREF(z);
|
||||
Py_XDECREF(w);
|
||||
%End
|
||||
|
||||
float length() const;
|
||||
float lengthSquared() const;
|
||||
QVector4D normalized() const;
|
||||
void normalize();
|
||||
static float dotProduct(const QVector4D &v1, const QVector4D &v2);
|
||||
QVector2D toVector2D() const;
|
||||
QVector2D toVector2DAffine() const;
|
||||
QVector3D toVector3D() const;
|
||||
QVector3D toVector3DAffine() const;
|
||||
bool isNull() const;
|
||||
float x() const;
|
||||
float y() const;
|
||||
float z() const;
|
||||
float w() const;
|
||||
void setX(float aX);
|
||||
void setY(float aY);
|
||||
void setZ(float aZ);
|
||||
void setW(float aW);
|
||||
QVector4D &operator+=(const QVector4D &vector);
|
||||
QVector4D &operator-=(const QVector4D &vector);
|
||||
QVector4D &operator*=(float factor);
|
||||
QVector4D &operator*=(const QVector4D &vector);
|
||||
QVector4D &operator/=(float divisor);
|
||||
%If (Qt_5_5_0 -)
|
||||
QVector4D &operator/=(const QVector4D &vector);
|
||||
%End
|
||||
QPoint toPoint() const;
|
||||
QPointF toPointF() const;
|
||||
%If (Qt_5_2_0 -)
|
||||
float operator[](int i) const;
|
||||
%End
|
||||
};
|
||||
|
||||
bool operator==(const QVector4D &v1, const QVector4D &v2);
|
||||
bool operator!=(const QVector4D &v1, const QVector4D &v2);
|
||||
const QVector4D operator+(const QVector4D &v1, const QVector4D &v2);
|
||||
const QVector4D operator-(const QVector4D &v1, const QVector4D &v2);
|
||||
const QVector4D operator*(float factor, const QVector4D &vector);
|
||||
const QVector4D operator*(const QVector4D &vector, float factor);
|
||||
const QVector4D operator*(const QVector4D &v1, const QVector4D &v2);
|
||||
const QVector4D operator-(const QVector4D &vector);
|
||||
const QVector4D operator/(const QVector4D &vector, float divisor);
|
||||
%If (Qt_5_5_0 -)
|
||||
const QVector4D operator/(const QVector4D &vector, const QVector4D &divisor);
|
||||
%End
|
||||
bool qFuzzyCompare(const QVector4D &v1, const QVector4D &v2);
|
||||
QDataStream &operator<<(QDataStream &, const QVector4D & /Constrained/) /ReleaseGIL/;
|
||||
QDataStream &operator>>(QDataStream &, QVector4D & /Constrained/) /ReleaseGIL/;
|
||||
@@ -0,0 +1,249 @@
|
||||
// qwindow.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QWindow : public QObject, public QSurface
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qwindow.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
explicit QWindow(QScreen *screen = 0);
|
||||
explicit QWindow(QWindow *parent /TransferThis/);
|
||||
virtual ~QWindow();
|
||||
void setSurfaceType(QSurface::SurfaceType surfaceType);
|
||||
virtual QSurface::SurfaceType surfaceType() const;
|
||||
bool isVisible() const;
|
||||
void create();
|
||||
WId winId() const;
|
||||
QWindow *parent() const;
|
||||
void setParent(QWindow *parent /Transfer/);
|
||||
bool isTopLevel() const;
|
||||
bool isModal() const;
|
||||
Qt::WindowModality modality() const;
|
||||
void setModality(Qt::WindowModality modality);
|
||||
void setFormat(const QSurfaceFormat &format);
|
||||
virtual QSurfaceFormat format() const;
|
||||
QSurfaceFormat requestedFormat() const;
|
||||
void setFlags(Qt::WindowFlags flags);
|
||||
Qt::WindowFlags flags() const;
|
||||
Qt::WindowType type() const;
|
||||
QString title() const;
|
||||
void setOpacity(qreal level);
|
||||
|
||||
public slots:
|
||||
void requestActivate();
|
||||
|
||||
public:
|
||||
bool isActive() const;
|
||||
void reportContentOrientationChange(Qt::ScreenOrientation orientation);
|
||||
Qt::ScreenOrientation contentOrientation() const;
|
||||
qreal devicePixelRatio() const;
|
||||
Qt::WindowState windowState() const;
|
||||
void setWindowState(Qt::WindowState state);
|
||||
void setTransientParent(QWindow *parent);
|
||||
QWindow *transientParent() const;
|
||||
|
||||
enum AncestorMode
|
||||
{
|
||||
ExcludeTransients,
|
||||
IncludeTransients,
|
||||
};
|
||||
|
||||
bool isAncestorOf(const QWindow *child, QWindow::AncestorMode mode = QWindow::IncludeTransients) const;
|
||||
bool isExposed() const;
|
||||
int minimumWidth() const;
|
||||
int minimumHeight() const;
|
||||
int maximumWidth() const;
|
||||
int maximumHeight() const;
|
||||
QSize minimumSize() const;
|
||||
QSize maximumSize() const;
|
||||
QSize baseSize() const;
|
||||
QSize sizeIncrement() const;
|
||||
void setMinimumSize(const QSize &size);
|
||||
void setMaximumSize(const QSize &size);
|
||||
void setBaseSize(const QSize &size);
|
||||
void setSizeIncrement(const QSize &size);
|
||||
void setGeometry(int posx, int posy, int w, int h);
|
||||
void setGeometry(const QRect &rect);
|
||||
QRect geometry() const;
|
||||
QMargins frameMargins() const;
|
||||
QRect frameGeometry() const;
|
||||
QPoint framePosition() const;
|
||||
void setFramePosition(const QPoint &point);
|
||||
int width() const;
|
||||
int height() const;
|
||||
int x() const;
|
||||
int y() const;
|
||||
virtual QSize size() const;
|
||||
QPoint position() const;
|
||||
void setPosition(const QPoint &pt);
|
||||
void setPosition(int posx, int posy);
|
||||
void resize(const QSize &newSize);
|
||||
void resize(int w, int h);
|
||||
void setFilePath(const QString &filePath);
|
||||
QString filePath() const;
|
||||
void setIcon(const QIcon &icon);
|
||||
QIcon icon() const;
|
||||
void destroy();
|
||||
bool setKeyboardGrabEnabled(bool grab);
|
||||
bool setMouseGrabEnabled(bool grab);
|
||||
QScreen *screen() const;
|
||||
void setScreen(QScreen *screen);
|
||||
virtual QObject *focusObject() const;
|
||||
QPoint mapToGlobal(const QPoint &pos) const;
|
||||
QPoint mapFromGlobal(const QPoint &pos) const;
|
||||
QCursor cursor() const;
|
||||
void setCursor(const QCursor &);
|
||||
void unsetCursor();
|
||||
|
||||
public slots:
|
||||
void setVisible(bool visible);
|
||||
void show() /ReleaseGIL/;
|
||||
void hide();
|
||||
void showMinimized() /ReleaseGIL/;
|
||||
void showMaximized() /ReleaseGIL/;
|
||||
void showFullScreen() /ReleaseGIL/;
|
||||
void showNormal() /ReleaseGIL/;
|
||||
bool close();
|
||||
void raise() /PyName=raise_/;
|
||||
void lower();
|
||||
void setTitle(const QString &);
|
||||
void setX(int arg);
|
||||
void setY(int arg);
|
||||
void setWidth(int arg);
|
||||
void setHeight(int arg);
|
||||
void setMinimumWidth(int w);
|
||||
void setMinimumHeight(int h);
|
||||
void setMaximumWidth(int w);
|
||||
void setMaximumHeight(int h);
|
||||
%If (Qt_5_1_0 -)
|
||||
void alert(int msec);
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
void requestUpdate();
|
||||
%End
|
||||
|
||||
signals:
|
||||
void screenChanged(QScreen *screen);
|
||||
void modalityChanged(Qt::WindowModality modality);
|
||||
void windowStateChanged(Qt::WindowState windowState);
|
||||
void xChanged(int arg);
|
||||
void yChanged(int arg);
|
||||
void widthChanged(int arg);
|
||||
void heightChanged(int arg);
|
||||
void minimumWidthChanged(int arg);
|
||||
void minimumHeightChanged(int arg);
|
||||
void maximumWidthChanged(int arg);
|
||||
void maximumHeightChanged(int arg);
|
||||
void visibleChanged(bool arg);
|
||||
void contentOrientationChanged(Qt::ScreenOrientation orientation);
|
||||
void focusObjectChanged(QObject *object);
|
||||
%If (Qt_5_3_0 -)
|
||||
void windowTitleChanged(const QString &title);
|
||||
%End
|
||||
|
||||
protected:
|
||||
virtual void exposeEvent(QExposeEvent *);
|
||||
virtual void resizeEvent(QResizeEvent *);
|
||||
virtual void moveEvent(QMoveEvent *);
|
||||
virtual void focusInEvent(QFocusEvent *);
|
||||
virtual void focusOutEvent(QFocusEvent *);
|
||||
virtual void showEvent(QShowEvent *);
|
||||
virtual void hideEvent(QHideEvent *);
|
||||
virtual bool event(QEvent *);
|
||||
virtual void keyPressEvent(QKeyEvent *);
|
||||
virtual void keyReleaseEvent(QKeyEvent *);
|
||||
virtual void mousePressEvent(QMouseEvent *);
|
||||
virtual void mouseReleaseEvent(QMouseEvent *);
|
||||
virtual void mouseDoubleClickEvent(QMouseEvent *);
|
||||
virtual void mouseMoveEvent(QMouseEvent *);
|
||||
virtual void wheelEvent(QWheelEvent *);
|
||||
virtual void touchEvent(QTouchEvent *);
|
||||
virtual void tabletEvent(QTabletEvent *);
|
||||
|
||||
public:
|
||||
%If (Qt_5_1_0 -)
|
||||
|
||||
enum Visibility
|
||||
{
|
||||
Hidden,
|
||||
AutomaticVisibility,
|
||||
Windowed,
|
||||
Minimized,
|
||||
Maximized,
|
||||
FullScreen,
|
||||
};
|
||||
|
||||
%End
|
||||
%If (Qt_5_1_0 -)
|
||||
QWindow::Visibility visibility() const;
|
||||
%End
|
||||
%If (Qt_5_1_0 -)
|
||||
void setVisibility(QWindow::Visibility v);
|
||||
%End
|
||||
%If (Qt_5_1_0 -)
|
||||
qreal opacity() const;
|
||||
%End
|
||||
%If (Qt_5_1_0 -)
|
||||
void setMask(const QRegion ®ion);
|
||||
%End
|
||||
%If (Qt_5_1_0 -)
|
||||
QRegion mask() const;
|
||||
%End
|
||||
%If (Qt_5_1_0 -)
|
||||
static QWindow *fromWinId(WId id);
|
||||
%End
|
||||
|
||||
signals:
|
||||
%If (Qt_5_1_0 -)
|
||||
void visibilityChanged(QWindow::Visibility visibility);
|
||||
%End
|
||||
%If (Qt_5_1_0 -)
|
||||
void activeChanged();
|
||||
%End
|
||||
%If (Qt_5_1_0 -)
|
||||
void opacityChanged(qreal opacity);
|
||||
%End
|
||||
|
||||
public:
|
||||
%If (Qt_5_9_0 -)
|
||||
QWindow *parent(QWindow::AncestorMode mode) const;
|
||||
%End
|
||||
%If (Qt_5_9_0 -)
|
||||
void setFlag(Qt::WindowType, bool on = true);
|
||||
%End
|
||||
%If (Qt_5_10_0 -)
|
||||
Qt::WindowStates windowStates() const;
|
||||
%End
|
||||
%If (Qt_5_10_0 -)
|
||||
void setWindowStates(Qt::WindowStates states);
|
||||
%End
|
||||
|
||||
public slots:
|
||||
%If (Qt_5_15_0 -)
|
||||
bool startSystemResize(Qt::Edges edges);
|
||||
%End
|
||||
%If (Qt_5_15_0 -)
|
||||
bool startSystemMove();
|
||||
%End
|
||||
};
|
||||
@@ -0,0 +1,24 @@
|
||||
// qwindowdefs.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtGui Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
typedef QList<QWindow *> QWindowList;
|
||||
typedef quintptr WId;
|
||||
Reference in New Issue
Block a user