4#include <QtCore/qrandom.h>
18 X11->display =
static_cast<Display *
>(conn->xlib_display());
19 X11->defaultScreen = DefaultScreen(
X11->display);
20 X11->screenCount = ScreenCount(
X11->display);
23 X11->argbVisuals =
new Visual *[
X11->screenCount];
26 for (
int s = 0;
s <
X11->screenCount;
s++) {
31 int widthMM = DisplayWidthMM(
X11->display,
s);
33 screen->dpiX = (DisplayWidth(
X11->display,
s) * 254 + widthMM * 5) / (widthMM * 10);
38 int heightMM = DisplayHeightMM(
X11->display,
s);
40 screen->dpiY = (DisplayHeight(
X11->display,
s) * 254 + heightMM * 5) / (heightMM * 10);
45 X11->argbVisuals[
s] = 0;
46 X11->argbColormaps[
s] = 0;
52 memset(
X11->solid_fills, 0,
sizeof(
X11->solid_fills));
53 for (
int i = 0;
i <
X11->solid_fill_count; ++
i)
54 X11->solid_fills[
i].screen = -1;
55 memset(
X11->pattern_fills, 0,
sizeof(
X11->pattern_fills));
56 for (
int i = 0;
i <
X11->pattern_fill_count; ++
i)
57 X11->pattern_fills[
i].screen = -1;
63 if (
X11->use_xrender) {
66 XRenderPictFormat *
format =
67 XRenderFindVisualFormat(
X11->display,
71 X11->use_xrender =
false;
79 const int numRects =
r.rectCount();
80 const auto input =
r.begin();
82 for (
int i = 0;
i < numRects; ++
i) {
87 out.width =
qMin((
int)USHRT_MAX,
in.width());
88 out.height =
qMin((
int)USHRT_MAX,
in.height());
139 return X11 ?
X11->display : 0;
172 return X11 ?
X11->defaultScreen : 0;
232#if QT_CONFIG(xrender)
235 if (!
X11->use_xrender)
238 XRenderColor
color = preMultiply(
c);
239 for (
int i = 0;
i <
X11->solid_fill_count; ++
i) {
241 &&
X11->solid_fills[
i].color.alpha ==
color.alpha
242 &&
X11->solid_fills[
i].color.red ==
color.red
243 &&
X11->solid_fills[
i].color.green ==
color.green
244 &&
X11->solid_fills[
i].color.blue ==
color.blue)
245 return X11->solid_fills[
i].picture;
250 if (
X11->solid_fills[
i].screen !=
screen &&
X11->solid_fills[
i].picture) {
251 XRenderFreePicture (
X11->display,
X11->solid_fills[
i].picture);
252 X11->solid_fills[
i].picture = 0;
255 if (!
X11->solid_fills[
i].picture) {
257 XRenderPictureAttributes
attrs;
259 X11->solid_fills[
i].picture = XRenderCreatePicture (
X11->display,
pixmap,
260 XRenderFindStandardFormat(
X11->display, PictStandardARGB32),
267 XRenderFillRectangle (
X11->display, PictOpSrc,
X11->solid_fills[
i].picture, &
color, 0, 0, 1, 1);
268 return X11->solid_fills[
i].picture;
271XRenderColor QXcbX11Data::preMultiply(
const QColor &
c)
The QColor class provides colors based on RGB, HSV or CMYK values.
quint32 generate()
Generates a 32-bit random quantity and returns it.
static Q_DECL_CONST_FUNCTION QRandomGenerator * global()
\threadsafe
\inmodule QtCore\reentrant
The QRegion class specifies a clip region for a painter.
bool hasXRender(int major=-1, int minor=-1) const
static bool appDefaultVisual(int screen=-1)
static QXcbX11Info fromScreen(int screen)
static Colormap appColormap(int screen=-1)
static Window appRootWindow(int screen=-1)
static bool appDefaultColormap(int screen=-1)
static int appDepth(int screen=-1)
void setVisual(void *visual)
static Display * display()
Colormap colormap() const
static int appDpiY(int screen=-1)
QXcbX11Info & operator=(const QXcbX11Info &other)
static int appCells(int screen=-1)
static void * appVisual(int screen=-1)
static int appDpiX(int screen=-1)
[Window class with invokable method]
Combined button and popup list for selecting options.
static struct AttrInfo attrs[]
constexpr const T & qMin(const T &a, const T &b)
constexpr const T & qMax(const T &a, const T &b)
GLint GLenum GLsizei GLsizei GLsizei depth
GLint GLsizei GLsizei GLenum format
GLenum GLenum GLenum input
Q_CORE_EXPORT bool qEnvironmentVariableIsSet(const char *varName) noexcept
QT_BEGIN_NAMESPACE typedef uchar * output
QT_BEGIN_NAMESPACE QXcbX11Data * qt_x11Data
QList< XRectangle > qt_region_to_xrectangles(const QRegion &r)
void qt_xcb_native_x11_info_init(QXcbConnection *conn)
QFileInfo info(fileName)
[8]
QTextStream out(stdout)
[7]