42 #include <private/qt_x11_p.h> 50 void QRegion::updateX11Region()
const 52 d->
rgn = XCreateRegion();
60 r.
x =
qMax(SHRT_MIN, rect->
x());
61 r.y =
qMax(SHRT_MIN, rect->
y());
62 r.width =
qMin((
int)USHRT_MAX, rect->
width());
63 r.height =
qMin((
int)USHRT_MAX, rect->
height());
64 XUnionRectWithRegion(&r,
d->
rgn,
d->
rgn);
69 void *QRegion::clipRectangles(
int &num)
const 72 XRectangle *r =
static_cast<XRectangle*
>(malloc(
d->
qt_rgn->
numRects *
sizeof(XRectangle)));
77 r->
x =
qMax(SHRT_MIN, rect->
x());
78 r->y =
qMax(SHRT_MIN, rect->
y());
79 r->width =
qMin((
int)USHRT_MAX, rect->
width());
80 r->height =
qMin((
int)USHRT_MAX, rect->
height());
89 return d->xrectangles;
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
#define QT_END_NAMESPACE
This macro expands to.
int width() const
Returns the width of the rectangle.
int height() const
Returns the height of the rectangle.
#define Q_BASIC_ATOMIC_INITIALIZER(a)
static struct QRegionData shared_empty
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
#define QT_BEGIN_NAMESPACE
This macro expands to.
int y() const
Returns the y-coordinate of the rectangle's top edge.
int x() const
Returns the x-coordinate of the rectangle's left edge.
The QRect class defines a rectangle in the plane using integer precision.
const T * constData() const
Returns a const pointer to the data stored in the vector.