Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qt_x11_p.h
Go to the documentation of this file.
1// Copyright (C) 2018 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QT_X11_P_H
5#define QT_X11_P_H
6
7#define register /* C++17 deprecated register */
8#include <X11/Xlib.h>
9#include <X11/Xatom.h>
10#undef register
11
12#if QT_CONFIG(xrender)
13# include "qtessellator_p.h"
14# include <X11/extensions/Xrender.h>
15#endif
16
17#if QT_CONFIG(fontconfig)
18#include <fontconfig/fontconfig.h>
19#endif
20
21#if defined(FT_LCD_FILTER_H)
22#include FT_LCD_FILTER_H
23#endif
24
25#if defined(FC_LCD_FILTER)
26
27#ifndef FC_LCD_FILTER_NONE
28#define FC_LCD_FILTER_NONE FC_LCD_NONE
29#endif
30
31#ifndef FC_LCD_FILTER_DEFAULT
32#define FC_LCD_FILTER_DEFAULT FC_LCD_DEFAULT
33#endif
34
35#ifndef FC_LCD_FILTER_LIGHT
36#define FC_LCD_FILTER_LIGHT FC_LCD_LIGHT
37#endif
38
39#ifndef FC_LCD_FILTER_LEGACY
40#define FC_LCD_FILTER_LEGACY FC_LCD_LEGACY
41#endif
42
43#endif
44
46
47// rename a couple of X defines to get rid of name clashes
48// resolve the conflict between X11's FocusIn and QEvent::FocusIn
49enum {
50 XFocusOut = FocusOut,
51 XFocusIn = FocusIn,
52 XKeyPress = KeyPress,
53 XKeyRelease = KeyRelease,
55 XRevertToParent = RevertToParent,
56 XGrayScale = GrayScale,
57 XCursorShape = CursorShape,
58};
59#undef FocusOut
60#undef FocusIn
61#undef KeyPress
62#undef KeyRelease
63#undef None
64#undef RevertToParent
65#undef GrayScale
66#undef CursorShape
67
68#ifdef FontChange
69#undef FontChange
70#endif
71
75#if QT_CONFIG(xrender)
77#endif
78
79struct QX11InfoData;
80
89
91 Display *display = nullptr;
92
93 // true if Qt is compiled w/ RENDER support and RENDER is supported on the connected Display
94 bool use_xrender = false;
97
99 Visual **argbVisuals = nullptr;
101 int screenCount = 0;
103
104 // options
106 int visual_id = 0;
107 int color_count = 0;
108 bool custom_cmap = false;
109
110 // outside visual/colormap
111 Visual *visual = nullptr;
113
114#if QT_CONFIG(xrender)
115 enum { solid_fill_count = 16 };
116 struct SolidFills {
117 XRenderColor color;
118 int screen;
120 } solid_fills[solid_fill_count];
121 enum { pattern_fill_count = 16 };
122 struct PatternFills {
123 XRenderColor color;
124 XRenderColor bg_color;
125 int screen;
126 int style;
127 bool opaque;
129 } pattern_fills[pattern_fill_count];
130 Picture getSolidFill(int screen, const QColor &c);
131 XRenderColor preMultiply(const QColor &c);
132#endif
133
134 bool fc_antialias = true;
136
138};
139
140extern QXcbX11Data *qt_x11Data;
141#define X11 qt_x11Data
142
155
156template <class T>
157constexpr inline int lowest_bit(T v) noexcept
158{
160 return ((result >> 3) == sizeof(T)) ? -1 : result;
161}
162
164
165#endif // QT_X11_P_H
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition qcolor.h:31
struct wl_display * display
Definition linuxdmabuf.h:41
Combined button and popup list for selecting options.
constexpr uint qCountTrailingZeroBits(quint32 v) noexcept
@ None
Definition qhash.cpp:531
GLsizei const GLfloat * v
[13]
GLuint color
[2]
const GLubyte * c
GLuint64EXT * result
[6]
XID Picture
@ XCursorShape
Definition qt_x11_p.h:57
@ XFocusOut
Definition qt_x11_p.h:50
@ XKeyRelease
Definition qt_x11_p.h:53
@ XGrayScale
Definition qt_x11_p.h:56
@ XNone
Definition qt_x11_p.h:54
@ XRevertToParent
Definition qt_x11_p.h:55
@ XKeyPress
Definition qt_x11_p.h:52
@ XFocusIn
Definition qt_x11_p.h:51
constexpr int lowest_bit(T v) noexcept
Definition qt_x11_p.h:157
DesktopEnvironment
Definition qt_x11_p.h:81
@ DE_UNKNOWN
Definition qt_x11_p.h:82
@ DE_GNOME
Definition qt_x11_p.h:84
@ DE_4DWM
Definition qt_x11_p.h:87
@ DE_KDE
Definition qt_x11_p.h:83
@ DE_MEEGO_COMPOSITOR
Definition qt_x11_p.h:86
@ DE_CDE
Definition qt_x11_p.h:85
QXcbX11Data * qt_x11Data
QScreen * screen
[1]
Definition main.cpp:29
struct _XDisplay Display
@ Q_PRIMITIVE_TYPE
Definition qtypeinfo.h:157
#define Q_DECLARE_TYPEINFO(TYPE, FLAGS)
Definition qtypeinfo.h:180
XID Colormap
Visual * visual
Definition qt_x11_p.h:150
bool defaultColormap
Definition qt_x11_p.h:151
Colormap colormap
Definition qt_x11_p.h:149
bool defaultVisual
Definition qt_x11_p.h:152
int xrender_version
Definition qt_x11_p.h:96
bool custom_cmap
Definition qt_x11_p.h:108
Visual ** argbVisuals
Definition qt_x11_p.h:99
DesktopEnvironment desktopEnvironment
Definition qt_x11_p.h:137
int visual_id
Definition qt_x11_p.h:106
int color_count
Definition qt_x11_p.h:107
int screenCount
Definition qt_x11_p.h:101
Visual * visual
Definition qt_x11_p.h:111
bool use_xrender
Definition qt_x11_p.h:94
bool fc_antialias
Definition qt_x11_p.h:134
Colormap * argbColormaps
Definition qt_x11_p.h:100
int visual_class
Definition qt_x11_p.h:105
Colormap colormap
Definition qt_x11_p.h:112
int defaultScreen
Definition qt_x11_p.h:102
int xrender_major
Definition qt_x11_p.h:95
int fc_hint_style
Definition qt_x11_p.h:135
QX11InfoData * screens
Definition qt_x11_p.h:98