1// qregion.sip generated by MetaSIP
2//
3// This file is part of the QtGui Python extension module.
4//
5// Copyright (c) 2021 Riverbank Computing Limited <info@riverbankcomputing.com>
6//
7// This file is part of PyQt5.
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
22
23class QRegion
24{
25%TypeHeaderCode
26#include <qregion.h>
27%End
28
29public:
30    enum RegionType
31    {
32        Rectangle,
33        Ellipse,
34    };
35
36    QRegion();
37    QRegion(int x, int y, int w, int h, QRegion::RegionType type = QRegion::Rectangle);
38    QRegion(const QRect &r, QRegion::RegionType type = QRegion::Rectangle);
39    QRegion(const QPolygon &a, Qt::FillRule fillRule = Qt::OddEvenFill);
40    QRegion(const QBitmap &bitmap);
41    QRegion(const QRegion &region);
42    QRegion(const QVariant &variant /GetWrapper/) /NoDerived/;
43%MethodCode
44        if (a0->canConvert<QRegion>())
45            sipCpp = new QRegion(a0->value<QRegion>());
46        else
47            sipError = sipBadCallableArg(0, a0Wrapper);
48%End
49
50    ~QRegion();
51    bool isEmpty() const;
52    int __bool__() const;
53%MethodCode
54        sipRes = !sipCpp->isEmpty();
55%End
56
57    bool contains(const QPoint &p) const;
58    int __contains__(const QPoint &p) const;
59%MethodCode
60        sipRes = sipCpp->contains(*a0);
61%End
62
63    bool contains(const QRect &r) const;
64    int __contains__(const QRect &r) const;
65%MethodCode
66        sipRes = sipCpp->contains(*a0);
67%End
68
69    void translate(int dx, int dy);
70    void translate(const QPoint &p);
71    QRegion translated(int dx, int dy) const;
72    QRegion translated(const QPoint &p) const;
73    QRegion united(const QRegion &r) const;
74    QRegion united(const QRect &r) const;
75    QRect boundingRect() const;
76    QVector<QRect> rects() const;
77%If (Qt_5_4_0 -)
78    QRegion operator|(const QRegion &r) const;
79%End
80    void setRects(const QVector<QRect> &);
81%MethodCode
82        if (a0->size())
83            sipCpp->setRects(a0->data(), a0->size());
84        else
85            sipCpp->setRects(0, 0);
86%End
87
88%If (- Qt_5_4_0)
89    const QRegion operator|(const QRegion &r) const;
90%End
91%If (Qt_5_4_0 -)
92    QRegion operator+(const QRegion &r) const;
93%End
94%If (- Qt_5_4_0)
95    const QRegion operator+(const QRegion &r) const;
96%End
97%If (Qt_5_4_0 -)
98    QRegion operator+(const QRect &r) const;
99%End
100%If (- Qt_5_4_0)
101    const QRegion operator+(const QRect &r) const;
102%End
103%If (Qt_5_4_0 -)
104    QRegion operator&(const QRegion &r) const;
105%End
106%If (- Qt_5_4_0)
107    const QRegion operator&(const QRegion &r) const;
108%End
109%If (Qt_5_4_0 -)
110    QRegion operator&(const QRect &r) const;
111%End
112%If (- Qt_5_4_0)
113    const QRegion operator&(const QRect &r) const;
114%End
115%If (Qt_5_4_0 -)
116    QRegion operator-(const QRegion &r) const;
117%End
118%If (- Qt_5_4_0)
119    const QRegion operator-(const QRegion &r) const;
120%End
121%If (Qt_5_4_0 -)
122    QRegion operator^(const QRegion &r) const;
123%End
124%If (- Qt_5_4_0)
125    const QRegion operator^(const QRegion &r) const;
126%End
127    QRegion &operator|=(const QRegion &r);
128    QRegion &operator+=(const QRegion &r);
129    QRegion &operator+=(const QRect &r);
130    QRegion &operator&=(const QRegion &r);
131    QRegion &operator&=(const QRect &r);
132    QRegion &operator-=(const QRegion &r);
133    QRegion &operator^=(const QRegion &r);
134    bool operator==(const QRegion &r) const;
135    bool operator!=(const QRegion &r) const;
136    QRegion intersected(const QRegion &r) const;
137    QRegion intersected(const QRect &r) const;
138    QRegion subtracted(const QRegion &r) const;
139    QRegion xored(const QRegion &r) const;
140    bool intersects(const QRegion &r) const;
141    bool intersects(const QRect &r) const;
142    int rectCount() const;
143    void swap(QRegion &other /Constrained/);
144    bool isNull() const;
145};
146
147QDataStream &operator<<(QDataStream &, const QRegion & /Constrained/) /ReleaseGIL/;
148QDataStream &operator>>(QDataStream &, QRegion & /Constrained/) /ReleaseGIL/;
149