3#ifndef QXCBBASICCONNECTION_H
4#define QXCBBASICCONNECTION_H
10#include <QtCore/QObject>
11#include <QtCore/QByteArray>
12#include <QtCore/QLoggingCategory>
13#include <QtGui/private/qtguiglobal_p.h>
30#if QT_CONFIG(xcb_xlib)
31 void *xlib_display()
const {
return m_xlibDisplay; }
33 const char *
displayName()
const {
return m_displayName.constData(); }
37 return m_xcbConnection && !xcb_connection_has_error(m_xcbConnection);
39 const xcb_setup_t *
setup()
const {
return m_setup; }
41 size_t maxRequestDataBytes(
size_t requestSize)
const;
45 xcb_atom_t internAtom(
const char *
name);
52 bool hasXKB()
const {
return m_hasXkb; }
54 if (m_hasXRender && major != -1 && minor != -1)
55 return m_xrenderVersion >=
qMakePair(major, minor);
60 bool hasShm()
const {
return m_hasShm; }
63 bool hasBigRequest()
const;
71 bool isXIEvent(xcb_generic_event_t *
event)
const;
72 bool isXIType(xcb_generic_event_t *
event, uint16_t
type)
const;
74 bool isXFixesType(
uint responseType,
int eventType)
const;
75 bool isXRandrType(
uint responseType,
int eventType)
const;
76 bool isXkbType(
uint responseType)
const;
80 void initializeXFixes();
81 void initializeXRender();
82 void initializeXRandr();
83 void initializeXShape();
85 void initializeXSync();
86 void initializeXInput2();
89#if QT_CONFIG(xcb_xlib)
90 void *m_xlibDisplay =
nullptr;
93 xcb_connection_t *m_xcbConnection =
nullptr;
94 int m_primaryScreenNumber = 0;
95 const xcb_setup_t *m_setup =
nullptr;
98 bool m_hasXFixes =
false;
99 bool m_hasXhape =
false;
100 bool m_hasInputShape;
101 bool m_hasXRandr =
false;
102 bool m_hasXkb =
false;
103 bool m_hasXRender =
false;
104 bool m_hasShm =
false;
105 bool m_hasShmFd =
false;
106 bool m_hasXSync =
false;
110 bool m_xi2Enabled =
false;
113 uint32_t m_xinputFirstEvent = 0;
115 int m_xrandr1Minor = -1;
117 uint32_t m_xfixesFirstEvent = 0;
118 uint32_t m_xrandrFirstEvent = 0;
119 uint32_t m_xkbFirstEvent = 0;
121 uint32_t m_maximumRequestLength = 0;
124#define Q_XCB_REPLY_CONNECTION_ARG(connection, ...) connection
130#define Q_XCB_REPLY(call, ...) \
131 std::unique_ptr<call##_reply_t, QStdFreeDeleter>( \
132 call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call(__VA_ARGS__), nullptr) \
135#define Q_XCB_REPLY_UNCHECKED(call, ...) \
136 std::unique_ptr<call##_reply_t, QStdFreeDeleter>( \
137 call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call##_unchecked(__VA_ARGS__), nullptr) \
bool hasInputShape() const
bool isAtLeastXRandR15() const
QXcbAtom::Atom qatom(xcb_atom_t atom) const
int primaryScreenNumber() const
bool isAtLeastXI22() const
bool isAtLeastXI24() const
xcb_connection_t * xcb_connection() const
const char * displayName() const
const xcb_setup_t * setup() const
bool hasXRender(int major=-1, int minor=-1) const
bool isAtLeastXI21() const
bool isAtLeastXRandR12() const
xcb_atom_t atom(QXcbAtom::Atom qatom) const
Combined button and popup list for selecting options.
static QString displayName(CGDirectDisplayID displayID)
std::pair< T1, T2 > QPair
#define Q_DECLARE_LOGGING_CATEGORY(name)
constexpr decltype(auto) qMakePair(T1 &&value1, T2 &&value2) noexcept(noexcept(std::make_pair(std::forward< T1 >(value1), std::forward< T2 >(value2))))
void operator()(void *p) const noexcept