qsvgrenderer.sip 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. // qsvgrenderer.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtSvg Python extension module.
  4. //
  5. // Copyright (c) 2026 Riverbank Computing Limited <info@riverbankcomputing.com>
  6. //
  7. // This file is part of PyQt6.
  8. //
  9. // This file may be used under the terms of the GNU General Public License
  10. // version 3.0 as published by the Free Software Foundation and appearing in
  11. // the file LICENSE included in the packaging of this file. Please review the
  12. // following information to ensure the GNU General Public License version 3.0
  13. // requirements will be met: http://www.gnu.org/copyleft/gpl.html.
  14. //
  15. // If you do not wish to use this file under the terms of the GPL version 3.0
  16. // then you may purchase a commercial license. For more information contact
  17. // info@riverbankcomputing.com.
  18. //
  19. // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
  20. // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  21. class QSvgRenderer : public QObject
  22. {
  23. %TypeHeaderCode
  24. #include <qsvgrenderer.h>
  25. %End
  26. %ConvertToSubClassCode
  27. static struct class_graph {
  28. const char *name;
  29. sipTypeDef **type;
  30. int yes, no;
  31. } graph[] = {
  32. {sipName_QSvgRenderer, &sipType_QSvgRenderer, -1, -1},
  33. };
  34. int i = 0;
  35. sipType = NULL;
  36. do
  37. {
  38. struct class_graph *cg = &graph[i];
  39. if (cg->name != NULL && sipCpp->inherits(cg->name))
  40. {
  41. sipType = *cg->type;
  42. i = cg->yes;
  43. }
  44. else
  45. i = cg->no;
  46. }
  47. while (i >= 0);
  48. %End
  49. public:
  50. QSvgRenderer(QObject *parent /TransferThis/ = 0);
  51. QSvgRenderer(const QString &filename, QObject *parent /TransferThis/ = 0) /ReleaseGIL/;
  52. QSvgRenderer(const QByteArray &contents, QObject *parent /TransferThis/ = 0) /ReleaseGIL/;
  53. QSvgRenderer(QXmlStreamReader *contents, QObject *parent /TransferThis/ = 0) /ReleaseGIL/;
  54. virtual ~QSvgRenderer();
  55. bool isValid() const;
  56. QSize defaultSize() const;
  57. bool elementExists(const QString &id) const;
  58. QRect viewBox() const;
  59. QRectF viewBoxF() const;
  60. void setViewBox(const QRect &viewbox);
  61. void setViewBox(const QRectF &viewbox);
  62. bool animated() const;
  63. QRectF boundsOnElement(const QString &id) const;
  64. int framesPerSecond() const;
  65. void setFramesPerSecond(int num);
  66. int currentFrame() const;
  67. void setCurrentFrame(int);
  68. int animationDuration() const;
  69. public slots:
  70. bool load(const QString &filename) /ReleaseGIL/;
  71. bool load(const QByteArray &contents) /ReleaseGIL/;
  72. bool load(QXmlStreamReader *contents) /ReleaseGIL/;
  73. void render(QPainter *p) /ReleaseGIL/;
  74. void render(QPainter *p, const QRectF &bounds) /ReleaseGIL/;
  75. void render(QPainter *painter, const QString &elementId, const QRectF &bounds = QRectF()) /ReleaseGIL/;
  76. signals:
  77. void repaintNeeded();
  78. public:
  79. Qt::AspectRatioMode aspectRatioMode() const;
  80. void setAspectRatioMode(Qt::AspectRatioMode mode);
  81. QTransform transformForElement(const QString &id) const;
  82. %If (Qt_6_7_0 -)
  83. QtSvg::Options options() const;
  84. %End
  85. %If (Qt_6_7_0 -)
  86. void setOptions(QtSvg::Options flags);
  87. %End
  88. %If (Qt_6_7_0 -)
  89. bool isAnimationEnabled() const;
  90. %End
  91. %If (Qt_6_7_0 -)
  92. void setAnimationEnabled(bool enable);
  93. %End
  94. %If (Qt_6_8_0 -)
  95. static void setDefaultOptions(QtSvg::Options flags);
  96. %End
  97. };