qregion.sip 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. // qregion.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtGui 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 QRegion
  22. {
  23. %TypeHeaderCode
  24. #include <qregion.h>
  25. %End
  26. public:
  27. enum RegionType
  28. {
  29. Rectangle,
  30. Ellipse,
  31. };
  32. QRegion();
  33. QRegion(int x, int y, int w, int h, QRegion::RegionType type = QRegion::Rectangle);
  34. QRegion(const QRect &r, QRegion::RegionType type = QRegion::Rectangle);
  35. QRegion(const QPolygon &a, Qt::FillRule fillRule = Qt::OddEvenFill);
  36. QRegion(const QBitmap &bitmap);
  37. QRegion(const QRegion &region);
  38. QRegion(const QVariant &variant /GetWrapper/) /NoDerived/;
  39. %MethodCode
  40. if (a0->canConvert<QRegion>())
  41. sipCpp = new QRegion(a0->value<QRegion>());
  42. else
  43. sipError = sipBadCallableArg(0, a0Wrapper);
  44. %End
  45. ~QRegion();
  46. bool isEmpty() const;
  47. int __bool__() const;
  48. %MethodCode
  49. sipRes = !sipCpp->isEmpty();
  50. %End
  51. bool contains(const QPoint &p) const;
  52. int __contains__(const QPoint &p) const;
  53. %MethodCode
  54. sipRes = sipCpp->contains(*a0);
  55. %End
  56. bool contains(const QRect &r) const;
  57. int __contains__(const QRect &r) const;
  58. %MethodCode
  59. sipRes = sipCpp->contains(*a0);
  60. %End
  61. void translate(int dx, int dy);
  62. void translate(const QPoint &p);
  63. QRegion translated(int dx, int dy) const;
  64. QRegion translated(const QPoint &p) const;
  65. QRegion united(const QRegion &r) const;
  66. QRegion united(const QRect &r) const;
  67. QRect boundingRect() const;
  68. QRegion operator|(const QRegion &r) const;
  69. void setRects(const QList<QRect> &);
  70. %MethodCode
  71. if (a0->size())
  72. sipCpp->setRects(a0->data(), a0->size());
  73. else
  74. sipCpp->setRects(0, 0);
  75. %End
  76. QRegion operator+(const QRegion &r) const;
  77. QRegion operator+(const QRect &r) const;
  78. QRegion operator&(const QRegion &r) const;
  79. QRegion operator&(const QRect &r) const;
  80. QRegion operator-(const QRegion &r) const;
  81. QRegion operator^(const QRegion &r) const;
  82. QRegion &operator|=(const QRegion &r);
  83. QRegion &operator+=(const QRegion &r);
  84. QRegion &operator+=(const QRect &r);
  85. QRegion &operator&=(const QRegion &r);
  86. QRegion &operator&=(const QRect &r);
  87. QRegion &operator-=(const QRegion &r);
  88. QRegion &operator^=(const QRegion &r);
  89. bool operator==(const QRegion &r) const;
  90. bool operator!=(const QRegion &r) const;
  91. QRegion intersected(const QRegion &r) const;
  92. QRegion intersected(const QRect &r) const;
  93. QRegion subtracted(const QRegion &r) const;
  94. QRegion xored(const QRegion &r) const;
  95. bool intersects(const QRegion &r) const;
  96. bool intersects(const QRect &r) const;
  97. int rectCount() const;
  98. void swap(QRegion &other /Constrained/);
  99. bool isNull() const;
  100. };
  101. QDataStream &operator<<(QDataStream &, const QRegion &) /ReleaseGIL/;
  102. QDataStream &operator>>(QDataStream &, QRegion & /Constrained/) /ReleaseGIL/;