45 #include <QtCore/qatomic.h> 46 #include <QtCore/qrect.h> 47 #include <QtGui/qwindowdefs.h> 49 #ifndef QT_NO_DATASTREAM 50 #include <QtCore/qdatastream.h> 59 template <
class T>
class QVector;
62 #if defined(Q_WS_QWS) || defined(Q_WS_QPA) || defined(Q_WS_X11) || defined(Q_WS_MAC) || defined(Q_WS_WIN) || defined(Q_OS_SYMBIAN) 80 QRegion(
const QRegion ®ion);
83 QRegion &operator=(
const QRegion &);
84 #ifdef Q_COMPILER_RVALUE_REFS 85 inline QRegion &operator=(QRegion &&other)
86 {
qSwap(
d, other.d);
return *
this; }
94 bool contains(
const QPoint &p)
const;
95 bool contains(
const QRect &r)
const;
97 void translate(
int dx,
int dy);
99 QRegion translated(
int dx,
int dy)
const;
103 QRegion unite(
const QRegion &r)
const;
104 QRegion unite(
const QRect &r)
const;
105 QRegion intersect(
const QRegion &r)
const;
106 QRegion intersect(
const QRect &r)
const;
107 QRegion subtract(
const QRegion &r)
const;
108 QRegion eor(
const QRegion &r)
const;
110 inline QRegion
united(
const QRegion &r)
const {
return unite(r); }
112 inline QRegion
intersected(
const QRegion &r)
const {
return intersect(r); }
114 inline QRegion
subtracted(
const QRegion &r)
const {
return subtract(r); }
115 inline QRegion
xored(
const QRegion &r)
const {
return eor(r); }
117 bool intersects(
const QRegion &r)
const;
118 bool intersects(
const QRect &r)
const;
122 void setRects(
const QRect *rect,
int num);
126 int rectCount()
const;
128 const QRegion
operator|(
const QRegion &r)
const;
129 const QRegion
operator+(
const QRegion &r)
const;
131 const QRegion
operator&(
const QRegion &r)
const;
133 const QRegion
operator-(
const QRegion &r)
const;
134 const QRegion
operator^(
const QRegion &r)
const;
135 QRegion& operator|=(
const QRegion &r);
138 QRegion& operator&=(
const QRegion &r);
139 QRegion& operator&=(
const QRect &r);
140 QRegion& operator-=(
const QRegion &r);
141 QRegion& operator^=(
const QRegion &r);
148 Handle handle()
const;
151 #if defined(Q_WS_WIN) 152 inline HRGN handle()
const { ensureHandle();
return d->rgn; }
153 #elif defined(Q_WS_X11) 154 inline Region handle()
const {
if(!
d->rgn) updateX11Region();
return d->rgn; }
155 #elif defined(Q_WS_MAC) 156 #if defined Q_WS_MAC32 159 static QRegion fromQDRgn(
RgnHandle shape);
161 #ifdef QT_MAC_USE_COCOA 163 {
Q_UNUSED(unused);
return toHIMutableShape(); }
165 inline RgnHandle handle()
const {
return handle(
false); }
166 inline RgnHandle handle(
bool)
const {
return toQDRgn(); }
169 static QRegion fromHIShapeRef(
HIShapeRef shape);
170 #elif defined(Q_WS_QWS) || defined(Q_WS_QPA) 171 inline void *handle()
const {
return d->qt_rgn; }
175 #ifndef QT_NO_DATASTREAM 180 QRegion copy()
const;
182 #if defined(Q_WS_WIN) 183 void ensureHandle()
const;
184 QRegion winCombine(
const QRegion &r,
int num)
const;
185 #elif defined(Q_WS_X11) 186 void updateX11Region()
const;
187 void *clipRectangles(
int &num)
const;
189 #elif defined(Q_WS_MAC) 191 const CGRect *inRect,
void *inRefcon);
197 #ifndef QT_NO_DATASTREAM 202 #if defined(Q_WS_WIN) 204 #elif defined(Q_WS_X11) 207 #elif defined(Q_WS_MAC) && !defined(QT_MAC_USE_COCOA) 210 #if defined(Q_WS_QWS) || defined(Q_WS_QPA) || defined(Q_WS_X11) || defined(Q_WS_MAC) || defined(Q_WS_WIN) || defined(Q_OS_SYMBIAN) 214 #if defined(Q_WS_WIN) 226 #ifndef QT_NO_DATASTREAM 231 #ifndef QT_NO_DEBUG_STREAM The QVariant class acts like a union for the most common Qt data types.
The QDebug class provides an output stream for debugging information.
timeval operator-(const timeval &t1, const timeval &t2)
QRegion intersected(const QRegion &r) const
Returns a region which is the intersection of this region and r.
#define QT_END_NAMESPACE
This macro expands to.
RegionType
Specifies the shape of the region to be created.
The QByteArray class provides an array of bytes.
QRegion translated(const QPoint &p) const
Returns a copy of the regtion that is translated {p}.
Q_GUI_EXPORT void * qt_getClipRects(const QRegion &r, int &num)
struct __HIShape * HIMutableShapeRef
The QPolygon class provides a vector of points using integer precision.
const struct __HIShape * HIShapeRef
The QVector class is a template class that provides a dynamic array.
static const QRectF boundingRect(const QPointF *points, int pointCount)
Q_CORE_EXPORT QBitArray operator^(const QBitArray &, const QBitArray &)
The QBitmap class provides monochrome (1-bit depth) pixmaps.
#define QT_BEGIN_NAMESPACE
This macro expands to.
bool operator!=(const QRegion &r) const
Returns true if this region is different from the other region; otherwise returns false...
static bool isEmpty(const char *str)
void translate(const QPoint &p)
Translates the region {point}.
The Rectangle item provides a filled rectangle with an optional border.
The QRegion class specifies a clip region for a painter.
QRegion united(const QRegion &r) const
Returns a region which is the union of this region and r.
QRegion united(const QRect &r) const
Returns a region which is the union of this region and the given rect.
struct OpaqueRgnHandle * RgnHandle
QRegion intersected(const QRect &r) const
Returns a region which is the intersection of this region and the given rect.
void qSwap(T &value1, T &value2)
Q_GUI_EXPORT QDataStream & operator<<(QDataStream &, const QRegion &)
Q_GUI_EXPORT QDataStream & operator>>(QDataStream &, QRegion &)
Q_CORE_EXPORT QBitArray operator &(const QBitArray &, const QBitArray &)
Q_GUI_EXPORT bool qt_region_strictContains(const QRegion ®ion, const QRect &rect)
Returns true if rect is guaranteed to be fully contained in region.
The QPoint class defines a point in the plane using integer precision.
The QRect class defines a rectangle in the plane using integer precision.
int y() const
Returns the y coordinate of this point.
The QDataStream class provides serialization of binary data to a QIODevice.
Q_CORE_EXPORT QBitArray operator|(const QBitArray &, const QBitArray &)
int x() const
Returns the x coordinate of this point.
ByteOrder
The byte order used for reading/writing the data.
QRegion subtracted(const QRegion &r) const
Returns a region which is r subtracted from this region.
QRegion xored(const QRegion &r) const
Returns a region which is the exclusive or (XOR) of this region and r.
timeval & operator+=(timeval &t1, const timeval &t2)
void swap(QRegion &other)
Swaps region other with this region.
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
bool operator==(QBool b1, bool b2)
static bool isNull(const QVariant::Private *d)
timeval operator+(const timeval &t1, const timeval &t2)