12#include <private/qguiapplication_p.h>
15#include <QtCore/QDebug>
17#include <QtGui/qopenglcontext.h>
18#include <QtGui/qscreen.h>
71 void *
result = handlerNativeResourceForIntegration(lowerCaseResource);
104 void *
result = handlerNativeResourceForContext(lowerCaseResource,
context);
111 qWarning(
"nativeResourceForScreen: null screen");
116 void *
result = handlerNativeResourceForScreen(lowerCaseResource,
screen);
123#if QT_CONFIG(xcb_xlib)
150 result =
reinterpret_cast<void *
>(xcbScreen->
root());
154 result = vd->compositingActive() ?
this :
nullptr;
165 void *
result = handlerNativeResourceForWindow(lowerCaseResource,
window);
197 void *
result = handlerNativeResourceForBackingStore(lowerCaseResource,backingStore);
206 if (
const QPlatformCursor *pCursor= primaryScreen->handle()->cursor()) {
207 xcb_cursor_t xcbCursor =
static_cast<const QXcbCursor *
>(pCursor)->xcbCursor(
cursor);
208 return reinterpret_cast<void *
>(
quintptr(xcbCursor));
223 if (lowerCaseResource ==
"setstartupid")
225 if (lowerCaseResource ==
"generatepeekerid")
227 if (lowerCaseResource ==
"removepeekerid")
229 if (lowerCaseResource ==
"peekeventqueue")
251 if (lowerCaseResource ==
"setapptime")
253 else if (lowerCaseResource ==
"setappusertime")
275 if (QFunctionPointer
func = handlerPlatformFunction(lowerCaseFunction))
286 return reinterpret_cast<void *
>(
quintptr(
screen->connection()->time()));
294 return reinterpret_cast<void *
>(
quintptr(
screen->connection()->netWmUserTime()));
302 return reinterpret_cast<void *
>(
quintptr(
screen->connection()->getTimestamp()));
310 return reinterpret_cast<void *
>(
const_cast<char *
>(
connection->startupId().constData()));
319 return reinterpret_cast<void *
>(
connection->primaryScreenNumber());
328 return reinterpret_cast<void *
>(
connection->rootWindow());
334#if QT_CONFIG(xcb_xlib)
356 atspiBusAtom, XCB_ATOM_STRING, 0, 128);
360 char *
data = (
char *)xcb_get_property_value(
reply.get());
361 int length = xcb_get_property_value_length(
reply.get());
425#if QT_CONFIG(xcb_xlib)
427 return screen ?
screen->connection()->xlib_display() :
nullptr;
459 for (
int i = 0;
i < m_handlers.
size();
i++) {
470 for (
int i = 0;
i < m_handlers.
size();
i++) {
481 for (
int i = 0;
i < m_handlers.
size();
i++) {
492 for (
int i = 0;
i < m_handlers.
size();
i++) {
503 for (
int i = 0;
i < m_handlers.
size();
i++) {
512QFunctionPointer QXcbNativeInterface::handlerPlatformFunction(
const QByteArray &function)
const
514 for (
int i = 0;
i < m_handlers.
size();
i++) {
523void *QXcbNativeInterface::handlerNativeResourceForIntegration(
const QByteArray &resource)
const
555void *QXcbNativeInterface::handlerNativeResourceForBackingStore(
const QByteArray &resource,
QBackingStore *backingStore)
const
559 return func(backingStore);
569 xcb_connection_t *conn =
connection->xcb_connection();
573 const QRect geom(geomReply->x, geomReply->y, geomReply->width, geomReply->height);
577 const int oldFieldWidth =
str.fieldWidth();
578 const QChar oldPadChar =
str.padChar();
579 str.setFieldWidth(8);
580 str.setPadChar(u
'0');
582 str.setFieldWidth(oldFieldWidth);
583 str.setPadChar(oldPadChar);
591 const int count = xcb_query_tree_children_length(
reply.get());
592 const xcb_window_t *children = xcb_query_tree_children(
reply.get());
621#include "moc_qxcbnativeinterface.cpp"
The QBackingStore class provides a drawing area for QWindow.
QByteArray toLower() const &
The QCursor class provides a mouse cursor with an arbitrary shape.
static QPlatformIntegration * platformIntegration()
QScreen * primaryScreen
the primary (or default) screen of the application.
qsizetype size() const noexcept
const_reference at(qsizetype i) const noexcept
qsizetype removeAll(const AT &t)
void prepend(rvalue_ref t)
\inmodule QtCore\reentrant
constexpr int height() const noexcept
Returns the height of the rectangle.
constexpr bool isValid() const noexcept
Returns true if the rectangle is valid, otherwise returns false.
constexpr int x() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr int width() const noexcept
Returns the width of the rectangle.
constexpr int y() const noexcept
Returns the y-coordinate of the rectangle's top edge.
The QScreen class is used to query screen properties. \inmodule QtGui.
QString name
a user presentable string representing the screen
QPlatformScreen * handle() const
Get the platform screen handle.
\macro QT_RESTRICTED_CAST_FROM_ASCII
xcb_connection_t * xcb_connection() const
QXcbEventQueue * eventQueue() const
bool(*)(xcb_generic_event_t *event, void *peekerData) PeekerCallback
bool removePeekerId(qint32 peekerId)
qint32 generatePeekerId()
bool peekEventQueue(PeekerCallback peeker, void *peekerData=nullptr, PeekOptions option=PeekDefault, qint32 peekerId=-1)
static QXcbIntegration * instance()
QXcbConnection * connection() const
virtual QPlatformNativeInterface::NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) const
virtual QPlatformNativeInterface::NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) const
virtual QFunctionPointer platformFunction(const QByteArray &function) const
virtual QPlatformNativeInterface::NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) const
virtual QPlatformNativeInterface::NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) const
virtual QPlatformNativeInterface::NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) const
xcb_connection_t * connection() const override
NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) override
void removeHandler(QXcbNativeInterfaceHandler *handler)
NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) override
void addHandler(QXcbNativeInterfaceHandler *handler)
void * connectionForWindow(QWindow *window)
NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) override
static bool peekEventQueue(QXcbEventQueue::PeekerCallback peeker, void *peekerData=nullptr, QXcbEventQueue::PeekOptions option=QXcbEventQueue::PeekDefault, qint32 peekerId=-1)
@ ScreenAntialiasingEnabled
void * displayForWindow(QWindow *window)
static void setAppUserTime(QScreen *screen, xcb_timestamp_t time)
void * nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) override
void * appUserTime(const QXcbScreen *screen)
void * appTime(const QXcbScreen *screen)
static void setAppTime(QScreen *screen, xcb_timestamp_t time)
void * screenForWindow(QWindow *window)
Q_INVOKABLE QString dumpConnectionNativeWindows(const QXcbConnection *connection, WId root) const
void * nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) override
void * getTimestamp(const QXcbScreen *screen)
void * nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor) override
Display * display() const override
Q_INVOKABLE QString dumpNativeWindows(WId root=0) const
void * nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override
void * nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) override
static bool removePeekerId(qint32 peekerId)
static void setStartupId(const char *)
static qint32 generatePeekerId()
void * nativeResourceForIntegration(const QByteArray &resource) override
NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) override
NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) override
QFunctionPointer platformFunction(const QByteArray &function) const override
QXcbConnection * connection() const
QFontEngine::SubpixelAntialiasingType subpixelType() const
xcb_window_t root() const
int antialiasingEnabled() const
QXcbVirtualDesktop * virtualDesktop() const
QFontEngine::HintStyle hintStyle() const
static QString windowTitle(const QXcbConnection *conn, xcb_window_t window)
Combined button and popup list for selecting options.
QTextStream & hex(QTextStream &stream)
Calls QTextStream::setIntegerBase(16) on stream and returns stream.
QTextStream & noforcesign(QTextStream &stream)
Calls QTextStream::setNumberFlags(QTextStream::numberFlags() & ~QTextStream::ForceSign) on stream and...
QTextStream & dec(QTextStream &stream)
Calls QTextStream::setIntegerBase(10) on stream and returns stream.
QTextStream & forcesign(QTextStream &stream)
Calls QTextStream::setNumberFlags(QTextStream::numberFlags() | QTextStream::ForceSign) on stream and ...
#define QByteArrayLiteral(str)
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction function
DBusConnection * connection
static int resourceType(const QByteArray &key)
GLenum GLuint GLint level
GLenum GLuint GLenum GLsizei length
GLenum GLenum GLsizei count
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
#define Q_XCB_REPLY(call,...)
static QXcbSystemTrayTracker * systemTrayTracker(const QScreen *s)
static QT_BEGIN_NAMESPACE int resourceType(const QByteArray &key)
static void dumpNativeWindowsRecursion(const QXcbConnection *connection, xcb_window_t window, int level, QTextStream &str)