diff --git a/xcb/dforeignplatformwindow_x11.cpp b/xcb/dforeignplatformwindow_x11.cpp index 20e9ee38..a0d41dbe 100644 --- a/xcb/dforeignplatformwindow_x11.cpp +++ b/xcb/dforeignplatformwindow_x11.cpp @@ -131,7 +131,7 @@ void DForeignPlatformWindow::handleConfigureNotifyEvent(const xcb_configure_noti { bool fromSendEvent = (event->response_type & 0x80); QPoint pos(event->x, event->y); - if (!parent() && !fromSendEvent) { + if (!QPlatformWindow::parent() && !fromSendEvent) { // Do not trust the position, query it instead. xcb_translate_coordinates_cookie_t cookie = xcb_translate_coordinates(xcb_connection(), xcb_window(), xcbScreen()->root(), 0, 0); @@ -144,7 +144,7 @@ void DForeignPlatformWindow::handleConfigureNotifyEvent(const xcb_configure_noti } QRect actualGeometry = QRect(pos, QSize(event->width, event->height)); - QPlatformScreen *newScreen = parent() ? parent()->screen() : screenForGeometry(actualGeometry); + QPlatformScreen *newScreen = QPlatformWindow::parent() ? QPlatformWindow::parent()->screen() : screenForGeometry(actualGeometry); if (!newScreen) return; diff --git a/xcb/libqt6xcbqpa-dev/6.6.2/gl_integrations/qxcbglintegration.h b/xcb/libqt6xcbqpa-dev/6.6.2/gl_integrations/qxcbglintegration.h new file mode 100644 index 00000000..c6492f02 --- /dev/null +++ b/xcb/libqt6xcbqpa-dev/6.6.2/gl_integrations/qxcbglintegration.h @@ -0,0 +1,41 @@ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +#ifndef QXCBGLINTEGRATION_H + +#include "qxcbexport.h" +#include "qxcbwindow.h" + +#include + +QT_BEGIN_NAMESPACE + +class QPlatformOffscreenSurface; +class QOffscreenSurface; +class QXcbNativeInterfaceHandler; + +Q_DECLARE_EXPORTED_LOGGING_CATEGORY(lcQpaGl, Q_XCB_EXPORT) + +class Q_XCB_EXPORT QXcbGlIntegration +{ +public: + QXcbGlIntegration(); + virtual ~QXcbGlIntegration(); + virtual bool initialize(QXcbConnection *connection) = 0; + + virtual bool supportsThreadedOpenGL() const { return false; } + virtual bool supportsSwitchableWidgetComposition() const { return true; } + virtual bool handleXcbEvent(xcb_generic_event_t *event, uint responseType); + + virtual QXcbWindow *createWindow(QWindow *window) const = 0; +#ifndef QT_NO_OPENGL + virtual QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const = 0; +#endif + virtual QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const = 0; + + virtual QXcbNativeInterfaceHandler *nativeInterfaceHandler() const { return nullptr; } +}; + +QT_END_NAMESPACE + +#endif //QXCBGLINTEGRATION_H diff --git a/xcb/libqt6xcbqpa-dev/6.6.2/gl_integrations/qxcbglintegrationfactory.h b/xcb/libqt6xcbqpa-dev/6.6.2/gl_integrations/qxcbglintegrationfactory.h new file mode 100644 index 00000000..bb169aee --- /dev/null +++ b/xcb/libqt6xcbqpa-dev/6.6.2/gl_integrations/qxcbglintegrationfactory.h @@ -0,0 +1,22 @@ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +#ifndef QXCBGLINTEGRATIONFACTORY_H +#define QXCBGLINTEGRATIONFACTORY_H + +#include + +QT_BEGIN_NAMESPACE + +class QXcbGlIntegration; + +class QXcbGlIntegrationFactory +{ +public: + static QXcbGlIntegration *create(const QString &name); +}; + +QT_END_NAMESPACE + +#endif //QXCBGLINTEGRATIONFACTORY_H + diff --git a/xcb/libqt6xcbqpa-dev/6.6.2/gl_integrations/qxcbglintegrationplugin.h b/xcb/libqt6xcbqpa-dev/6.6.2/gl_integrations/qxcbglintegrationplugin.h new file mode 100644 index 00000000..3de9d3f4 --- /dev/null +++ b/xcb/libqt6xcbqpa-dev/6.6.2/gl_integrations/qxcbglintegrationplugin.h @@ -0,0 +1,32 @@ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +#ifndef QXCBGLINTEGRATIONPLUGIN_H +#define QXCBGLINTEGRATIONPLUGIN_H + +#include "qxcbexport.h" +#include +#include + +QT_BEGIN_NAMESPACE + +#define QXcbGlIntegrationFactoryInterface_iid "org.qt-project.Qt.QPA.Xcb.QXcbGlIntegrationFactoryInterface.5.5" + +class QXcbGlIntegration; + +class Q_XCB_EXPORT QXcbGlIntegrationPlugin : public QObject +{ + Q_OBJECT +public: + explicit QXcbGlIntegrationPlugin(QObject *parent = nullptr) + : QObject(parent) + { } + + virtual QXcbGlIntegration *create() = 0; + // the pattern expected by qLoadPlugin calls for a QString argument. + // we don't need it, so don't bother subclasses with it: + QXcbGlIntegration *create(const QString &) { return create(); } +}; +QT_END_NAMESPACE + +#endif //QXCBGLINTEGRATIONPLUGIN_H diff --git a/xcb/libqt6xcbqpa-dev/6.6.2/gl_integrations/qxcbnativeinterfacehandler.h b/xcb/libqt6xcbqpa-dev/6.6.2/gl_integrations/qxcbnativeinterfacehandler.h new file mode 100644 index 00000000..58c28c85 --- /dev/null +++ b/xcb/libqt6xcbqpa-dev/6.6.2/gl_integrations/qxcbnativeinterfacehandler.h @@ -0,0 +1,34 @@ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +#ifndef QXCBNATIVEINTERFACEHANDLER_H +#define QXCBNATIVEINTERFACEHANDLER_H + +#include +#include + +#include "qxcbexport.h" + +QT_BEGIN_NAMESPACE + +class QXcbNativeInterface; +class Q_XCB_EXPORT QXcbNativeInterfaceHandler +{ +public: + QXcbNativeInterfaceHandler(QXcbNativeInterface *nativeInterface); + virtual ~QXcbNativeInterfaceHandler(); + + virtual QPlatformNativeInterface::NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) const; + virtual QPlatformNativeInterface::NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) const; + virtual QPlatformNativeInterface::NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) const; + virtual QPlatformNativeInterface::NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) const; + virtual QPlatformNativeInterface::NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) const; + + virtual QFunctionPointer platformFunction(const QByteArray &function) const; +protected: + QXcbNativeInterface *m_native_interface; +}; + +QT_END_NAMESPACE + +#endif //QXCBNATIVEINTERFACEHANDLER_H diff --git a/xcb/libqt6xcbqpa-dev/6.6.2/nativepainting/qbackingstore_x11_p.h b/xcb/libqt6xcbqpa-dev/6.6.2/nativepainting/qbackingstore_x11_p.h new file mode 100644 index 00000000..f57a5be9 --- /dev/null +++ b/xcb/libqt6xcbqpa-dev/6.6.2/nativepainting/qbackingstore_x11_p.h @@ -0,0 +1,40 @@ +// Copyright (C) 2018 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +#ifndef QBACKINGSTORE_X11_H +#define QBACKINGSTORE_X11_H + +#include + +typedef struct _XDisplay Display; + +QT_BEGIN_NAMESPACE + +class QXcbWindow; + +class QXcbNativeBackingStore : public QPlatformBackingStore +{ +public: + QXcbNativeBackingStore(QWindow *window); + ~QXcbNativeBackingStore(); + + QPaintDevice *paintDevice() override; + void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; + + QImage toImage() const override; + + void resize(const QSize &size, const QRegion &staticContents) override; + bool scroll(const QRegion &area, int dx, int dy) override; + + void beginPaint(const QRegion ®ion) override; + +private: + Display *display() const; + + QPixmap m_pixmap; + bool m_translucentBackground; +}; + +QT_END_NAMESPACE + +#endif // QBACKINGSTORE_X11_H diff --git a/xcb/libqt6xcbqpa-dev/6.6.2/nativepainting/qcolormap_x11_p.h b/xcb/libqt6xcbqpa-dev/6.6.2/nativepainting/qcolormap_x11_p.h new file mode 100644 index 00000000..eedf798e --- /dev/null +++ b/xcb/libqt6xcbqpa-dev/6.6.2/nativepainting/qcolormap_x11_p.h @@ -0,0 +1,45 @@ +// Copyright (C) 2018 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +#ifndef QCOLORMAP_X11_H +#define QCOLORMAP_X11_H + +#include +#include + +QT_BEGIN_NAMESPACE + +class QXcbColormapPrivate; +class QXcbColormap +{ +public: + enum Mode { Direct, Indexed, Gray }; + + static void initialize(); + static void cleanup(); + + static QXcbColormap instance(int screen = -1); + + QXcbColormap(const QXcbColormap &colormap); + ~QXcbColormap(); + + QXcbColormap &operator=(const QXcbColormap &colormap); + + Mode mode() const; + + int depth() const; + int size() const; + + uint pixel(const QColor &color) const; + const QColor colorAt(uint pixel) const; + + const QList colormap() const; + +private: + QXcbColormap(); + QXcbColormapPrivate *d; +}; + +QT_END_NAMESPACE + +#endif // QCOLORMAP_X11_H diff --git a/xcb/libqt6xcbqpa-dev/6.6.2/nativepainting/qpaintengine_x11_p.h b/xcb/libqt6xcbqpa-dev/6.6.2/nativepainting/qpaintengine_x11_p.h new file mode 100644 index 00000000..f799fdd9 --- /dev/null +++ b/xcb/libqt6xcbqpa-dev/6.6.2/nativepainting/qpaintengine_x11_p.h @@ -0,0 +1,88 @@ +// Copyright (C) 2018 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +#ifndef QPAINTENGINE_X11_H +#define QPAINTENGINE_X11_H + +#include + +typedef unsigned long XID; +typedef XID Drawable; +typedef struct _XGC *GC; + +QT_BEGIN_NAMESPACE + +extern "C" { +Drawable qt_x11Handle(const QPaintDevice *pd); +GC qt_x11_get_pen_gc(QPainter *); +GC qt_x11_get_brush_gc(QPainter *); +} + +class QX11PaintEnginePrivate; +class QX11PaintEngine : public QPaintEngine +{ + Q_DECLARE_PRIVATE(QX11PaintEngine) +public: + QX11PaintEngine(); + ~QX11PaintEngine(); + + bool begin(QPaintDevice *pdev) override; + bool end() override; + + void updateState(const QPaintEngineState &state) override; + + void updatePen(const QPen &pen); + void updateBrush(const QBrush &brush, const QPointF &pt); + void updateRenderHints(QPainter::RenderHints hints); + void updateFont(const QFont &font); + void updateMatrix(const QTransform &matrix); + void updateClipRegion_dev(const QRegion ®ion, Qt::ClipOperation op); + + void drawLines(const QLine *lines, int lineCount) override; + void drawLines(const QLineF *lines, int lineCount) override; + + void drawRects(const QRect *rects, int rectCount) override; + void drawRects(const QRectF *rects, int rectCount) override; + + void drawPoints(const QPoint *points, int pointCount) override; + void drawPoints(const QPointF *points, int pointCount) override; + + void drawEllipse(const QRect &r) override; + void drawEllipse(const QRectF &r) override; + + virtual void drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode) override; + inline void drawPolygon(const QPoint *points, int pointCount, PolygonDrawMode mode) override + { QPaintEngine::drawPolygon(points, pointCount, mode); } + + void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) override; + void drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &s) override; + void drawPath(const QPainterPath &path) override; + void drawTextItem(const QPointF &p, const QTextItem &textItem) override; + void drawImage(const QRectF &r, const QImage &img, const QRectF &sr, + Qt::ImageConversionFlags flags = Qt::AutoColor) override; + + virtual Drawable handle() const; + inline Type type() const override { return QPaintEngine::X11; } + + QPainter::RenderHints supportedRenderHints() const; + +protected: + QX11PaintEngine(QX11PaintEnginePrivate &dptr); + +#if QT_CONFIG(fontconfig) + void drawFreetype(const QPointF &p, const QTextItemInt &ti); + bool drawCachedGlyphs(const QTransform &transform, const QTextItemInt &ti); +#endif // QT_CONFIG(fontconfig) + + friend class QPixmap; + friend class QFontEngineBox; + friend GC qt_x11_get_pen_gc(QPainter *); + friend GC qt_x11_get_brush_gc(QPainter *); + +private: + Q_DISABLE_COPY_MOVE(QX11PaintEngine) +}; + +QT_END_NAMESPACE + +#endif // QPAINTENGINE_X11_H diff --git a/xcb/libqt6xcbqpa-dev/6.6.2/nativepainting/qpixmap_x11_p.h b/xcb/libqt6xcbqpa-dev/6.6.2/nativepainting/qpixmap_x11_p.h new file mode 100644 index 00000000..7d830baa --- /dev/null +++ b/xcb/libqt6xcbqpa-dev/6.6.2/nativepainting/qpixmap_x11_p.h @@ -0,0 +1,133 @@ +// Copyright (C) 2018 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +#ifndef QX11PLATFORMPIXMAP_H +#define QX11PLATFORMPIXMAP_H + +#include +#include + +#include +#include "qxcbnativepainting.h" + +typedef unsigned long XID; +typedef XID Drawable; +typedef XID Picture; +typedef XID Pixmap; + +QT_BEGIN_NAMESPACE + +class QX11PaintEngine; +struct QXImageWrapper; + +class QX11PlatformPixmap : public QPlatformPixmap +{ +public: + QX11PlatformPixmap(PixelType pixelType); + ~QX11PlatformPixmap(); + + QPlatformPixmap *createCompatiblePlatformPixmap() const override; + void resize(int width, int height) override; + void fromImage(const QImage &img, Qt::ImageConversionFlags flags) override; + void copy(const QPlatformPixmap *data, const QRect &rect) override; + bool scroll(int dx, int dy, const QRect &rect) override; + int metric(QPaintDevice::PaintDeviceMetric metric) const override; + void fill(const QColor &fillColor) override; + QBitmap mask() const override; + void setMask(const QBitmap &mask) override; + bool hasAlphaChannel() const override; + QPixmap transformed(const QTransform &matrix, Qt::TransformationMode mode) const override; + QImage toImage() const override; + QImage toImage(const QRect &rect) const override; + QPaintEngine *paintEngine() const override; + qreal devicePixelRatio() const override; + void setDevicePixelRatio(qreal scaleFactor) override; + + inline Drawable handle() const { return hd; } + inline Picture x11PictureHandle() const { return picture; } + inline const QXcbX11Info *x11_info() const { return &xinfo; } + + Pixmap x11ConvertToDefaultDepth(); + static XID createBitmapFromImage(const QImage &image); + +#if QT_CONFIG(xrender) + void convertToARGB32(bool preserveContents = true); +#endif + + bool isBackingStore() const; + void setIsBackingStore(bool on); +private: + friend class QX11PaintEngine; + friend const QXcbX11Info &qt_x11Info(const QPixmap &pixmap); + friend void qt_x11SetScreen(QPixmap &pixmap, int screen); + + void release(); + QImage toImage(const QXImageWrapper &xi, const QRect &rect) const; + QBitmap mask_to_bitmap(int screen) const; + static Pixmap bitmap_to_mask(const QBitmap &, int screen); + void bitmapFromImage(const QImage &image); + bool canTakeQImageFromXImage(const QXImageWrapper &xi) const; + QImage takeQImageFromXImage(const QXImageWrapper &xi) const; + + Pixmap hd = 0; + + enum Flag { + NoFlags = 0x0, + Uninitialized = 0x1, + Readonly = 0x2, + InvertedWhenBoundToTexture = 0x4, + GlSurfaceCreatedWithAlpha = 0x8, + IsBackingStore = 0x10 + }; + uint flags; + + QXcbX11Info xinfo; + Pixmap x11_mask; + Picture picture; + Picture mask_picture; + Pixmap hd2; // sorted in the default display depth + //QPixmap::ShareMode share_mode; + qreal dpr; + + QX11PaintEngine *pengine; +}; + +inline QX11PlatformPixmap *qt_x11Pixmap(const QPixmap &pixmap) +{ + return (pixmap.handle() && pixmap.handle()->classId() == QPlatformPixmap::X11Class) + ? static_cast(pixmap.handle()) + : nullptr; +} + +inline Picture qt_x11PictureHandle(const QPixmap &pixmap) +{ + if (QX11PlatformPixmap *pm = qt_x11Pixmap(pixmap)) + return pm->x11PictureHandle(); + + return 0; +} + +inline Pixmap qt_x11PixmapHandle(const QPixmap &pixmap) +{ + if (QX11PlatformPixmap *pm = qt_x11Pixmap(pixmap)) + return pm->handle(); + + return 0; +} + +inline const QXcbX11Info &qt_x11Info(const QPixmap &pixmap) +{ + if (QX11PlatformPixmap *pm = qt_x11Pixmap(pixmap)) { + return pm->xinfo; + } else { + static QXcbX11Info nullX11Info; + return nullX11Info; + } +} + +int qt_x11SetDefaultScreen(int screen); +void qt_x11SetScreen(QPixmap &pixmap, int screen); + +QT_END_NAMESPACE + +#endif // QX11PLATFORMPIXMAP_H diff --git a/xcb/libqt6xcbqpa-dev/6.6.2/nativepainting/qpolygonclipper_p.h b/xcb/libqt6xcbqpa-dev/6.6.2/nativepainting/qpolygonclipper_p.h new file mode 100644 index 00000000..e640fc11 --- /dev/null +++ b/xcb/libqt6xcbqpa-dev/6.6.2/nativepainting/qpolygonclipper_p.h @@ -0,0 +1,280 @@ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +#ifndef QPOLYGONCLIPPER_P_H +#define QPOLYGONCLIPPER_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of other Qt classes. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include + +QT_BEGIN_NAMESPACE + +/* based on sutherland-hodgman line-by-line clipping, as described in + Computer Graphics and Principles */ +template class QPolygonClipper +{ +public: + QPolygonClipper() : + buffer1(0), buffer2(0) + { + x1 = y1 = x2 = y2 = 0; + } + + ~QPolygonClipper() + { + } + + void setBoundingRect(const QRect bounds) + { + x1 = bounds.x(); + x2 = bounds.x() + bounds.width(); + y1 = bounds.y(); + y2 = bounds.y() + bounds.height(); + } + + QRect boundingRect() + { + return QRect(QPoint(x1, y1), QPoint(x2, y2)); + } + + inline OutType intersectLeft(const OutType &p1, const OutType &p2) + { + OutType t; + qreal dy = (p1.y - p2.y) / qreal(p1.x - p2.x); + t.x = x1; + t.y = static_cast(p2.y + (x1 - p2.x) * dy); + return t; + } + + + inline OutType intersectRight(const OutType &p1, const OutType &p2) + { + OutType t; + qreal dy = (p1.y - p2.y) / qreal(p1.x - p2.x); + t.x = x2; + t.y = static_cast(p2.y + (x2 - p2.x) * dy); + return t; + } + + + inline OutType intersectTop(const OutType &p1, const OutType &p2) + { + OutType t; + qreal dx = (p1.x - p2.x) / qreal(p1.y - p2.y); + t.x = static_cast(p2.x + (y1 - p2.y) * dx); + t.y = y1; + return t; + } + + + inline OutType intersectBottom(const OutType &p1, const OutType &p2) + { + OutType t; + qreal dx = (p1.x - p2.x) / qreal(p1.y - p2.y); + t.x = static_cast(p2.x + (y2 - p2.y) * dx); + t.y = y2; + return t; + } + + + void clipPolygon(const InType *inPoints, int inCount, OutType **outPoints, int *outCount, + bool closePolygon = true) + { + Q_ASSERT(outPoints); + Q_ASSERT(outCount); + + if (inCount < 2) { + *outCount = 0; + return; + } + + buffer1.reset(); + buffer2.reset(); + + QDataBuffer *source = &buffer1; + QDataBuffer *clipped = &buffer2; + + // Gather some info since we are iterating through the points anyway.. + bool doLeft = false, doRight = false, doTop = false, doBottom = false; + OutType ot; + for (int i=0; iadd(ot); + + if (ot.x < x1) + doLeft = true; + else if (ot.x > x2) + doRight = true; + if (ot.y < y1) + doTop = true; + else if (ot.y > y2) + doBottom = true; + } + + if (doLeft && clipped->size() > 1) { + QDataBuffer *tmp = source; + source = clipped; + clipped = tmp; + clipped->reset(); + int lastPos, start; + if (closePolygon) { + lastPos = source->size() - 1; + start = 0; + } else { + lastPos = 0; + start = 1; + if (source->at(0).x >= x1) + clipped->add(source->at(0)); + } + for (int i=start; iat(i); + const OutType &ppt = source->at(lastPos); + + if (cpt.x >= x1) { + if (ppt.x >= x1) { + clipped->add(cpt); + } else { + clipped->add(intersectLeft(cpt, ppt)); + clipped->add(cpt); + } + } else if (ppt.x >= x1) { + clipped->add(intersectLeft(cpt, ppt)); + } + lastPos = i; + } + } + + if (doRight && clipped->size() > 1) { + QDataBuffer *tmp = source; + source = clipped; + clipped = tmp; + clipped->reset(); + int lastPos, start; + if (closePolygon) { + lastPos = source->size() - 1; + start = 0; + } else { + lastPos = 0; + start = 1; + if (source->at(0).x <= x2) + clipped->add(source->at(0)); + } + for (int i=start; isize(); ++i) { + const OutType &cpt = source->at(i); + const OutType &ppt = source->at(lastPos); + + if (cpt.x <= x2) { + if (ppt.x <= x2) { + clipped->add(cpt); + } else { + clipped->add(intersectRight(cpt, ppt)); + clipped->add(cpt); + } + } else if (ppt.x <= x2) { + clipped->add(intersectRight(cpt, ppt)); + } + + lastPos = i; + } + + } + + if (doTop && clipped->size() > 1) { + QDataBuffer *tmp = source; + source = clipped; + clipped = tmp; + clipped->reset(); + int lastPos, start; + if (closePolygon) { + lastPos = source->size() - 1; + start = 0; + } else { + lastPos = 0; + start = 1; + if (source->at(0).y >= y1) + clipped->add(source->at(0)); + } + for (int i=start; isize(); ++i) { + const OutType &cpt = source->at(i); + const OutType &ppt = source->at(lastPos); + + if (cpt.y >= y1) { + if (ppt.y >= y1) { + clipped->add(cpt); + } else { + clipped->add(intersectTop(cpt, ppt)); + clipped->add(cpt); + } + } else if (ppt.y >= y1) { + clipped->add(intersectTop(cpt, ppt)); + } + + lastPos = i; + } + } + + if (doBottom && clipped->size() > 1) { + QDataBuffer *tmp = source; + source = clipped; + clipped = tmp; + clipped->reset(); + int lastPos, start; + if (closePolygon) { + lastPos = source->size() - 1; + start = 0; + } else { + lastPos = 0; + start = 1; + if (source->at(0).y <= y2) + clipped->add(source->at(0)); + } + for (int i=start; isize(); ++i) { + const OutType &cpt = source->at(i); + const OutType &ppt = source->at(lastPos); + + if (cpt.y <= y2) { + if (ppt.y <= y2) { + clipped->add(cpt); + } else { + clipped->add(intersectBottom(cpt, ppt)); + clipped->add(cpt); + } + } else if (ppt.y <= y2) { + clipped->add(intersectBottom(cpt, ppt)); + } + lastPos = i; + } + } + + if (closePolygon && clipped->size() > 0) { + // close clipped polygon + if (clipped->at(0).x != clipped->at(clipped->size()-1).x || + clipped->at(0).y != clipped->at(clipped->size()-1).y) { + OutType ot = clipped->at(0); + clipped->add(ot); + } + } + *outCount = clipped->size(); + *outPoints = clipped->data(); + } + +private: + int x1, x2, y1, y2; + QDataBuffer buffer1; + QDataBuffer buffer2; +}; + +QT_END_NAMESPACE + +#endif // QPOLYGONCLIPPER_P_H diff --git a/xcb/libqt6xcbqpa-dev/6.6.2/nativepainting/qt_x11_p.h b/xcb/libqt6xcbqpa-dev/6.6.2/nativepainting/qt_x11_p.h new file mode 100644 index 00000000..66e0aa2c --- /dev/null +++ b/xcb/libqt6xcbqpa-dev/6.6.2/nativepainting/qt_x11_p.h @@ -0,0 +1,165 @@ +// Copyright (C) 2018 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +#ifndef QT_X11_P_H +#define QT_X11_P_H + +#define register /* C++17 deprecated register */ +#include +#include +#undef register + +#if QT_CONFIG(xrender) +# include "qtessellator_p.h" +# include +#endif + +#if QT_CONFIG(fontconfig) +#include +#endif + +#if defined(FT_LCD_FILTER_H) +#include FT_LCD_FILTER_H +#endif + +#if defined(FC_LCD_FILTER) + +#ifndef FC_LCD_FILTER_NONE +#define FC_LCD_FILTER_NONE FC_LCD_NONE +#endif + +#ifndef FC_LCD_FILTER_DEFAULT +#define FC_LCD_FILTER_DEFAULT FC_LCD_DEFAULT +#endif + +#ifndef FC_LCD_FILTER_LIGHT +#define FC_LCD_FILTER_LIGHT FC_LCD_LIGHT +#endif + +#ifndef FC_LCD_FILTER_LEGACY +#define FC_LCD_FILTER_LEGACY FC_LCD_LEGACY +#endif + +#endif + +QT_BEGIN_NAMESPACE + +// rename a couple of X defines to get rid of name clashes +// resolve the conflict between X11's FocusIn and QEvent::FocusIn +enum { + XFocusOut = FocusOut, + XFocusIn = FocusIn, + XKeyPress = KeyPress, + XKeyRelease = KeyRelease, + XNone = None, + XRevertToParent = RevertToParent, + XGrayScale = GrayScale, + XCursorShape = CursorShape, +}; +#undef FocusOut +#undef FocusIn +#undef KeyPress +#undef KeyRelease +#undef None +#undef RevertToParent +#undef GrayScale +#undef CursorShape + +#ifdef FontChange +#undef FontChange +#endif + +Q_DECLARE_TYPEINFO(XPoint, Q_PRIMITIVE_TYPE); +Q_DECLARE_TYPEINFO(XRectangle, Q_PRIMITIVE_TYPE); +Q_DECLARE_TYPEINFO(XChar2b, Q_PRIMITIVE_TYPE); +#if QT_CONFIG(xrender) +Q_DECLARE_TYPEINFO(XGlyphElt32, Q_PRIMITIVE_TYPE); +#endif + +struct QX11InfoData; + +enum DesktopEnvironment { + DE_UNKNOWN, + DE_KDE, + DE_GNOME, + DE_CDE, + DE_MEEGO_COMPOSITOR, + DE_4DWM +}; + +struct QXcbX11Data { + Display *display = nullptr; + + // true if Qt is compiled w/ RENDER support and RENDER is supported on the connected Display + bool use_xrender = false; + int xrender_major = 0; + int xrender_version = 0; + + QX11InfoData *screens = nullptr; + Visual **argbVisuals = nullptr; + Colormap *argbColormaps = nullptr; + int screenCount = 0; + int defaultScreen = 0; + + // options + int visual_class = 0; + int visual_id = 0; + int color_count = 0; + bool custom_cmap = false; + + // outside visual/colormap + Visual *visual = nullptr; + Colormap colormap = 0; + +#if QT_CONFIG(xrender) + enum { solid_fill_count = 16 }; + struct SolidFills { + XRenderColor color; + int screen; + Picture picture; + } solid_fills[solid_fill_count]; + enum { pattern_fill_count = 16 }; + struct PatternFills { + XRenderColor color; + XRenderColor bg_color; + int screen; + int style; + bool opaque; + Picture picture; + } pattern_fills[pattern_fill_count]; + Picture getSolidFill(int screen, const QColor &c); + XRenderColor preMultiply(const QColor &c); +#endif + + bool fc_antialias = true; + int fc_hint_style = 0; + + DesktopEnvironment desktopEnvironment = DE_GNOME; +}; + +extern QXcbX11Data *qt_x11Data; +#define X11 qt_x11Data + +struct QX11InfoData { + int screen; + int dpiX; + int dpiY; + int depth; + int cells; + Colormap colormap; + Visual *visual; + bool defaultColormap; + bool defaultVisual; + int subpixel = 0; +}; + +template +constexpr inline int lowest_bit(T v) noexcept +{ + int result = qCountTrailingZeroBits(v); + return ((result >> 3) == sizeof(T)) ? -1 : result; +} + +QT_END_NAMESPACE + +#endif // QT_X11_P_H diff --git a/xcb/libqt6xcbqpa-dev/6.6.2/nativepainting/qtessellator_p.h b/xcb/libqt6xcbqpa-dev/6.6.2/nativepainting/qtessellator_p.h new file mode 100644 index 00000000..70379c9e --- /dev/null +++ b/xcb/libqt6xcbqpa-dev/6.6.2/nativepainting/qtessellator_p.h @@ -0,0 +1,53 @@ +// Copyright (C) 2018 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +#ifndef QTESSELATOR_P_H +#define QTESSELATOR_P_H + +#include +#include + +QT_BEGIN_NAMESPACE + +class QTessellatorPrivate; + +typedef int Q27Dot5; +#define Q27Dot5ToDouble(i) ((i)/32.) +#define FloatToQ27Dot5(i) (int)((i) * 32) +#define IntToQ27Dot5(i) ((i) << 5) +#define Q27Dot5ToXFixed(i) ((i) << 11) +#define Q27Dot5Factor 32 + +class QTessellator { +public: + QTessellator(); + virtual ~QTessellator(); + + QRectF tessellate(const QPointF *points, int nPoints); + void tessellateConvex(const QPointF *points, int nPoints); + void tessellateRect(const QPointF &a, const QPointF &b, qreal width); + + void setWinding(bool w); + + struct Vertex { + Q27Dot5 x; + Q27Dot5 y; + }; + struct Trapezoid { + Q27Dot5 top; + Q27Dot5 bottom; + const Vertex *topLeft; + const Vertex *bottomLeft; + const Vertex *topRight; + const Vertex *bottomRight; + }; + virtual void addTrap(const Trapezoid &trap) = 0; + +private: + friend class QTessellatorPrivate; + QTessellatorPrivate *d; +}; + +QT_END_NAMESPACE + +#endif diff --git a/xcb/libqt6xcbqpa-dev/6.6.2/nativepainting/qxcbnativepainting.h b/xcb/libqt6xcbqpa-dev/6.6.2/nativepainting/qxcbnativepainting.h new file mode 100644 index 00000000..5ee42986 --- /dev/null +++ b/xcb/libqt6xcbqpa-dev/6.6.2/nativepainting/qxcbnativepainting.h @@ -0,0 +1,66 @@ +// Copyright (C) 2018 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +#ifndef QXCBNATIVEPAINTING_H +#define QXCBNATIVEPAINTING_H + +#include +#include "qt_x11_p.h" + +typedef struct _FcPattern FcPattern; +typedef unsigned long XID; +typedef XID Colormap; +typedef XID Window; +typedef struct _XDisplay Display; + +QT_BEGIN_NAMESPACE + +class QXcbConnection; +class QPixmap; + +void qt_xcb_native_x11_info_init(QXcbConnection *conn); +QList qt_region_to_xrectangles(const QRegion &r); + +class QXcbX11InfoData; +class QXcbX11Info +{ +public: + QXcbX11Info(); + ~QXcbX11Info(); + QXcbX11Info(const QXcbX11Info &other); + QXcbX11Info &operator=(const QXcbX11Info &other); + + static QXcbX11Info fromScreen(int screen); + static Display *display(); + + int depth() const; + void setDepth(int depth); + + int screen() const; + Colormap colormap() const; + + void *visual() const; + void setVisual(void *visual); + + static int appScreen(); + static int appDepth(int screen = -1); + static int appCells(int screen = -1); + static Colormap appColormap(int screen = -1); + static void *appVisual(int screen = -1); + static Window appRootWindow(int screen = -1); + static bool appDefaultColormap(int screen = -1); + static bool appDefaultVisual(int screen = -1); + static int appDpiX(int screen = -1); + static int appDpiY(int screen = -1); + +private: + QSharedDataPointer d; + + friend class QX11PaintEngine; + friend class QX11PlatformPixmap; + friend void qt_x11SetScreen(QPixmap &pixmap, int screen); +}; + +QT_END_NAMESPACE + +#endif // QXCBNATIVEPAINTING_H diff --git a/xcb/libqt6xcbqpa-dev/6.6.2/qt_xlib_wrapper.h b/xcb/libqt6xcbqpa-dev/6.6.2/qt_xlib_wrapper.h new file mode 100644 index 00000000..642dbdea --- /dev/null +++ b/xcb/libqt6xcbqpa-dev/6.6.2/qt_xlib_wrapper.h @@ -0,0 +1,17 @@ +// Copyright (C) 2022 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +#ifndef QT_XLIB_WRAPPER_H +#define QT_XLIB_WRAPPER_H + +#ifdef __cplusplus +extern "C" { +#endif + + typedef struct _XDisplay Display; + void qt_XFlush(Display *dpy); + +#ifdef __cplusplus +} +#endif + +#endif // QT_XLIB_WRAPPER_H diff --git a/xcb/libqt6xcbqpa-dev/6.6.2/qxcbatom.h b/xcb/libqt6xcbqpa-dev/6.6.2/qxcbatom.h new file mode 100644 index 00000000..bc677eaf --- /dev/null +++ b/xcb/libqt6xcbqpa-dev/6.6.2/qxcbatom.h @@ -0,0 +1,230 @@ +// Copyright (C) 2018 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +#ifndef QXCBATOM_H +#define QXCBATOM_H + +#include + +class QXcbAtom +{ +public: + enum Atom { + // window-manager <-> client protocols + AtomWM_PROTOCOLS, + AtomWM_DELETE_WINDOW, + AtomWM_TAKE_FOCUS, + Atom_NET_WM_PING, + Atom_NET_WM_CONTEXT_HELP, + Atom_NET_WM_SYNC_REQUEST, + Atom_NET_WM_SYNC_REQUEST_COUNTER, + AtomMANAGER, // System tray notification + Atom_NET_SYSTEM_TRAY_OPCODE, // System tray operation + + // ICCCM window state + AtomWM_STATE, + AtomWM_CHANGE_STATE, + AtomWM_CLASS, + AtomWM_NAME, + + // Session management + AtomWM_CLIENT_LEADER, + AtomWM_WINDOW_ROLE, + AtomSM_CLIENT_ID, + AtomWM_CLIENT_MACHINE, + + // Clipboard + AtomCLIPBOARD, + AtomINCR, + AtomTARGETS, + AtomMULTIPLE, + AtomTIMESTAMP, + AtomSAVE_TARGETS, + AtomCLIP_TEMPORARY, + Atom_QT_SELECTION, + Atom_QT_CLIPBOARD_SENTINEL, + Atom_QT_SELECTION_SENTINEL, + AtomCLIPBOARD_MANAGER, + + AtomRESOURCE_MANAGER, + + Atom_XSETROOT_ID, + + Atom_QT_SCROLL_DONE, + Atom_QT_INPUT_ENCODING, + + // Qt/XCB specific + Atom_QT_CLOSE_CONNECTION, + + Atom_QT_GET_TIMESTAMP, + + Atom_MOTIF_WM_HINTS, + + AtomDTWM_IS_RUNNING, + AtomENLIGHTENMENT_DESKTOP, + Atom_DT_SAVE_MODE, + Atom_SGI_DESKS_MANAGER, + + // EWMH (aka NETWM) + Atom_NET_SUPPORTED, + Atom_NET_VIRTUAL_ROOTS, + Atom_NET_WORKAREA, + + Atom_NET_MOVERESIZE_WINDOW, + Atom_NET_WM_MOVERESIZE, + + Atom_NET_WM_NAME, + Atom_NET_WM_ICON_NAME, + Atom_NET_WM_ICON, + + Atom_NET_WM_PID, + + Atom_NET_WM_WINDOW_OPACITY, + + Atom_NET_WM_STATE, + Atom_NET_WM_STATE_ABOVE, + Atom_NET_WM_STATE_BELOW, + Atom_NET_WM_STATE_FULLSCREEN, + Atom_NET_WM_STATE_MAXIMIZED_HORZ, + Atom_NET_WM_STATE_MAXIMIZED_VERT, + Atom_NET_WM_STATE_MODAL, + Atom_NET_WM_STATE_STAYS_ON_TOP, + Atom_NET_WM_STATE_DEMANDS_ATTENTION, + Atom_NET_WM_STATE_HIDDEN, + + Atom_NET_WM_USER_TIME, + Atom_NET_WM_USER_TIME_WINDOW, + Atom_NET_WM_FULL_PLACEMENT, + + Atom_NET_WM_WINDOW_TYPE, + Atom_NET_WM_WINDOW_TYPE_DESKTOP, + Atom_NET_WM_WINDOW_TYPE_DOCK, + Atom_NET_WM_WINDOW_TYPE_TOOLBAR, + Atom_NET_WM_WINDOW_TYPE_MENU, + Atom_NET_WM_WINDOW_TYPE_UTILITY, + Atom_NET_WM_WINDOW_TYPE_SPLASH, + Atom_NET_WM_WINDOW_TYPE_DIALOG, + Atom_NET_WM_WINDOW_TYPE_DROPDOWN_MENU, + Atom_NET_WM_WINDOW_TYPE_POPUP_MENU, + Atom_NET_WM_WINDOW_TYPE_TOOLTIP, + Atom_NET_WM_WINDOW_TYPE_NOTIFICATION, + Atom_NET_WM_WINDOW_TYPE_COMBO, + Atom_NET_WM_WINDOW_TYPE_DND, + Atom_NET_WM_WINDOW_TYPE_NORMAL, + Atom_KDE_NET_WM_WINDOW_TYPE_OVERRIDE, + + Atom_KDE_NET_WM_DESKTOP_FILE, + Atom_KDE_NET_WM_FRAME_STRUT, + Atom_NET_FRAME_EXTENTS, + + Atom_NET_STARTUP_INFO, + Atom_NET_STARTUP_INFO_BEGIN, + Atom_NET_STARTUP_ID, + + Atom_NET_SUPPORTING_WM_CHECK, + + Atom_NET_WM_CM_S0, + + Atom_NET_SYSTEM_TRAY_VISUAL, + + Atom_NET_ACTIVE_WINDOW, + + // Property formats + AtomTEXT, + AtomUTF8_STRING, + AtomCARDINAL, + + // Xdnd + AtomXdndEnter, + AtomXdndPosition, + AtomXdndStatus, + AtomXdndLeave, + AtomXdndDrop, + AtomXdndFinished, + AtomXdndTypelist, + AtomXdndActionList, + + AtomXdndSelection, + + AtomXdndAware, + AtomXdndProxy, + + AtomXdndActionCopy, + AtomXdndActionLink, + AtomXdndActionMove, + AtomXdndActionAsk, + AtomXdndActionPrivate, + + // Xkb + Atom_XKB_RULES_NAMES, + + // XEMBED + Atom_XEMBED, + Atom_XEMBED_INFO, + + // XInput2 + AtomButtonLeft, + AtomButtonMiddle, + AtomButtonRight, + AtomButtonWheelUp, + AtomButtonWheelDown, + AtomButtonHorizWheelLeft, + AtomButtonHorizWheelRight, + AtomAbsMTPositionX, + AtomAbsMTPositionY, + AtomAbsMTTouchMajor, + AtomAbsMTTouchMinor, + AtomAbsMTOrientation, + AtomAbsMTPressure, + AtomAbsMTTrackingID, + AtomMaxContacts, + AtomRelX, + AtomRelY, + // XInput2 tablet + AtomAbsX, + AtomAbsY, + AtomAbsPressure, + AtomAbsTiltX, + AtomAbsTiltY, + AtomAbsWheel, + AtomAbsDistance, + AtomWacomSerialIDs, + AtomINTEGER, + AtomRelHorizWheel, + AtomRelVertWheel, + AtomRelHorizScroll, + AtomRelVertScroll, + + Atom_XSETTINGS_SETTINGS, + + Atom_COMPIZ_DECOR_PENDING, + Atom_COMPIZ_DECOR_REQUEST, + Atom_COMPIZ_DECOR_DELETE_PIXMAP, + Atom_COMPIZ_TOOLKIT_ACTION, + Atom_GTK_APPLICATION_ID, + Atom_GTK_LOAD_ICONTHEMES, + + AtomAT_SPI_BUS, + + AtomEDID, + AtomEDID_DATA, + AtomXFree86_DDC_EDID1_RAWDATA, + + Atom_ICC_PROFILE, + + NAtoms + }; + + QXcbAtom(); + void initialize(xcb_connection_t *connection); + + inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } + QXcbAtom::Atom qatom(xcb_atom_t atom) const; + +protected: + void initializeAllAtoms(xcb_connection_t *connection); + +private: + xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; +}; + +#endif // QXCBATOM_H diff --git a/xcb/libqt6xcbqpa-dev/6.6.2/qxcbbackingstore.h b/xcb/libqt6xcbqpa-dev/6.6.2/qxcbbackingstore.h new file mode 100644 index 00000000..979b2543 --- /dev/null +++ b/xcb/libqt6xcbqpa-dev/6.6.2/qxcbbackingstore.h @@ -0,0 +1,81 @@ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +#ifndef QXCBBACKINGSTORE_H +#define QXCBBACKINGSTORE_H + +#include +#include + +#include + +#include "qxcbobject.h" + +QT_BEGIN_NAMESPACE + +class QXcbBackingStoreImage; + +class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore +{ +public: + QXcbBackingStore(QWindow *window); + ~QXcbBackingStore(); + + QPaintDevice *paintDevice() override; + void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; + FlushResult rhiFlush(QWindow *window, + qreal sourceDevicePixelRatio, + const QRegion ®ion, + const QPoint &offset, + QPlatformTextureList *textures, + bool translucentBackground) override; + QImage toImage() const override; + + QPlatformGraphicsBuffer *graphicsBuffer() const override; + + void resize(const QSize &size, const QRegion &staticContents) override; + bool scroll(const QRegion &area, int dx, int dy) override; + + void beginPaint(const QRegion &) override; + void endPaint() override; + + static bool createSystemVShmSegment(xcb_connection_t *c, size_t segmentSize = 1, + void *shmInfo = nullptr); + +protected: + virtual void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset); + virtual void recreateImage(QXcbWindow *win, const QSize &size); + + QXcbBackingStoreImage *m_image = nullptr; + QStack m_paintRegions; + QImage m_rgbImage; +}; + +class QXcbSystemTrayBackingStore : public QXcbBackingStore +{ +public: + QXcbSystemTrayBackingStore(QWindow *window); + ~QXcbSystemTrayBackingStore(); + + void beginPaint(const QRegion &) override; + +protected: + void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset) override; + void recreateImage(QXcbWindow *win, const QSize &size) override; + +private: + void initXRenderMode(); + + xcb_pixmap_t m_xrenderPixmap = XCB_NONE; + xcb_render_picture_t m_xrenderPicture = XCB_NONE; + xcb_render_pictformat_t m_xrenderPictFormat = XCB_NONE; + xcb_render_picture_t m_windowPicture = XCB_NONE; + + bool m_usingXRenderMode = false; + bool m_useGrabbedBackgound = false; + QPixmap m_grabbedBackground; +}; + +QT_END_NAMESPACE + +#endif diff --git a/xcb/libqt6xcbqpa-dev/6.6.2/qxcbclipboard.h b/xcb/libqt6xcbqpa-dev/6.6.2/qxcbclipboard.h new file mode 100644 index 00000000..79c48a0a --- /dev/null +++ b/xcb/libqt6xcbqpa-dev/6.6.2/qxcbclipboard.h @@ -0,0 +1,113 @@ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +#ifndef QXCBCLIPBOARD_H +#define QXCBCLIPBOARD_H + +#include +#include +#include +#include + +#include +#include + +QT_BEGIN_NAMESPACE + +#ifndef QT_NO_CLIPBOARD + +class QXcbConnection; +class QXcbScreen; +class QXcbClipboard; +class QXcbClipboardMime; + +class QXcbClipboardTransaction : public QObject +{ + Q_OBJECT +public: + QXcbClipboardTransaction(QXcbClipboard *clipboard, xcb_window_t w, xcb_atom_t p, + QByteArray d, xcb_atom_t t, int f); + ~QXcbClipboardTransaction(); + + bool updateIncrementalProperty(const xcb_property_notify_event_t *event); + +protected: + void timerEvent(QTimerEvent *ev) override; + +private: + QXcbClipboard *m_clipboard; + xcb_window_t m_window; + xcb_atom_t m_property; + QByteArray m_data; + xcb_atom_t m_target; + uint8_t m_format; + uint m_offset = 0; + int m_abortTimerId = 0; +}; + +class QXcbClipboard : public QXcbObject, public QPlatformClipboard +{ +public: + QXcbClipboard(QXcbConnection *connection); + ~QXcbClipboard(); + + QMimeData *mimeData(QClipboard::Mode mode) override; + void setMimeData(QMimeData *data, QClipboard::Mode mode) override; + + bool supportsMode(QClipboard::Mode mode) const override; + bool ownsMode(QClipboard::Mode mode) const override; + + QXcbScreen *screen() const; + + xcb_window_t requestor() const; + void setRequestor(xcb_window_t window); + + void handleSelectionRequest(xcb_selection_request_event_t *event); + void handleSelectionClearRequest(xcb_selection_clear_event_t *event); + void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); + + bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); + QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); + + QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); + + bool handlePropertyNotify(const xcb_generic_event_t *event); + + QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); + + int increment() const { return m_maxPropertyRequestDataBytes; } + int clipboardTimeout() const { return clipboard_timeout; } + + void removeTransaction(xcb_window_t window) { m_transactions.remove(window); } + +private: + xcb_generic_event_t *waitForClipboardEvent(xcb_window_t window, int type, bool checkManager = false); + + xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); + xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); + + xcb_atom_t atomForMode(QClipboard::Mode mode) const; + QClipboard::Mode modeForAtom(xcb_atom_t atom) const; + + // Selection and Clipboard + QScopedPointer m_xClipboard[2]; + QMimeData *m_clientClipboard[2]; + xcb_timestamp_t m_timestamp[2]; + + xcb_window_t m_requestor = XCB_NONE; + + static const int clipboard_timeout; + + int m_maxPropertyRequestDataBytes = 0; + bool m_clipboard_closing = false; + xcb_timestamp_t m_incr_receive_time = 0; + + using TransactionMap = QMap; + TransactionMap m_transactions; +}; + +#endif // QT_NO_CLIPBOARD + +QT_END_NAMESPACE + +#endif // QXCBCLIPBOARD_H diff --git a/xcb/libqt6xcbqpa-dev/6.6.2/qxcbconnection.h b/xcb/libqt6xcbqpa-dev/6.6.2/qxcbconnection.h new file mode 100644 index 00000000..abc17b21 --- /dev/null +++ b/xcb/libqt6xcbqpa-dev/6.6.2/qxcbconnection.h @@ -0,0 +1,385 @@ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +#ifndef QXCBCONNECTION_H +#define QXCBCONNECTION_H + +#include +#include + +#include +#include +#include +#include "qxcbexport.h" +#include +#include +#include +#include +#include + +#include "qxcbeventqueue.h" +#include "qxcbconnection_basic.h" + +#if QT_CONFIG(tabletevent) +#include +#endif + +QT_BEGIN_NAMESPACE + +Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput) +Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices) +Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputEvents) +Q_DECLARE_LOGGING_CATEGORY(lcQpaScreen) +Q_DECLARE_LOGGING_CATEGORY(lcQpaEvents) +Q_DECLARE_LOGGING_CATEGORY(lcQpaPeeker) +Q_DECLARE_LOGGING_CATEGORY(lcQpaKeyboard) +Q_DECLARE_LOGGING_CATEGORY(lcQpaClipboard) +Q_DECLARE_LOGGING_CATEGORY(lcQpaXDnd) +Q_DECLARE_LOGGING_CATEGORY(lcQpaEventReader) + +class QXcbVirtualDesktop; +class QXcbScreen; +class QXcbWindow; +class QXcbDrag; +class QXcbKeyboard; +class QXcbScrollingDevice; +class QXcbScrollingDevicePrivate; +class QXcbClipboard; +class QXcbWMSupport; +class QXcbNativeInterface; +class QXcbSystemTrayTracker; +class QXcbGlIntegration; + +class QXcbWindowEventListener +{ +public: + virtual ~QXcbWindowEventListener() {} + virtual bool handleNativeEvent(xcb_generic_event_t *) { return false; } + + virtual void handleExposeEvent(const xcb_expose_event_t *) {} + virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} + virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} + virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} + virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} + virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} + virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} + virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} + virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} + virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} + virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} + virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} + virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} + virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} + virtual void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource = Qt::MouseEventNotSynthesized) {} + virtual void handleXIEnterLeave(xcb_ge_event_t *) {} + virtual QXcbWindow *toWindow() { return nullptr; } +}; + +typedef QHash WindowMapper; + +class QXcbSyncWindowRequest : public QEvent +{ +public: + QXcbSyncWindowRequest(QXcbWindow *w) : QEvent(QEvent::Type(QEvent::User + 1)), m_window(w) { } + + QXcbWindow *window() const { return m_window; } + void invalidate(); + +private: + QXcbWindow *m_window; +}; + +class Q_XCB_EXPORT QXcbConnection : public QXcbBasicConnection +{ + Q_OBJECT +public: + QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName = nullptr); + ~QXcbConnection(); + + QXcbConnection *connection() const { return const_cast(this); } + QXcbEventQueue *eventQueue() const { return m_eventQueue; } + + const QList &virtualDesktops() const { return m_virtualDesktops; } + const QList &screens() const { return m_screens; } + QXcbVirtualDesktop *primaryVirtualDesktop() const { + return m_virtualDesktops.value(primaryScreenNumber()); + } + QXcbScreen *primaryScreen() const; + + const xcb_format_t *formatForDepth(uint8_t depth) const; + + bool imageNeedsEndianSwap() const + { + if (!hasShm()) + return false; // The non-Shm path does its own swapping +#if Q_BYTE_ORDER == Q_BIG_ENDIAN + return setup()->image_byte_order != XCB_IMAGE_ORDER_MSB_FIRST; +#else + return setup()->image_byte_order != XCB_IMAGE_ORDER_LSB_FIRST; +#endif + } + + QXcbKeyboard *keyboard() const { return m_keyboard; } + +#ifndef QT_NO_CLIPBOARD + QXcbClipboard *clipboard() const { return m_clipboard; } +#endif +#if QT_CONFIG(draganddrop) + QXcbDrag *drag() const { return m_drag; } +#endif + + QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } + xcb_window_t rootWindow(); + xcb_window_t clientLeader(); + + bool hasDefaultVisualId() const { return m_defaultVisualId != UINT_MAX; } + xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; } + + void sync(); + + void handleXcbError(xcb_generic_error_t *error); + void printXcbError(const char *message, xcb_generic_error_t *error); + void handleXcbEvent(xcb_generic_event_t *event); + void printXcbEvent(const QLoggingCategory &log, const char *message, + xcb_generic_event_t *event) const; + + void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); + void removeWindowEventListener(xcb_window_t id); + QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); + QXcbWindow *platformWindowFromId(xcb_window_t id); + + inline xcb_timestamp_t time() const { return m_time; } + inline void setTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_time)) m_time = t; } + + inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } + inline void setNetWmUserTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_netWmUserTime)) m_netWmUserTime = t; } + + xcb_timestamp_t getTimestamp(); + xcb_window_t selectionOwner(xcb_atom_t atom) const; + xcb_window_t qtSelectionOwner(); + + void setButtonState(Qt::MouseButton button, bool down); + Qt::MouseButtons buttonState() const { return m_buttonState; } + Qt::MouseButton button() const { return m_button; } + Qt::MouseButton translateMouseButton(xcb_button_t s); + + QXcbWindow *focusWindow() const { return m_focusWindow; } + void setFocusWindow(QWindow *); + QXcbWindow *mouseGrabber() const { return m_mouseGrabber; } + void setMouseGrabber(QXcbWindow *); + QXcbWindow *mousePressWindow() const { return m_mousePressWindow; } + void setMousePressWindow(QXcbWindow *); + + QByteArray startupId() const; + void setStartupId(const QByteArray &nextId); + + void grabServer(); + void ungrabServer(); + + QString windowManagerName() const; + + QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } + + QXcbSystemTrayTracker *systemTrayTracker() const; + + Qt::MouseButtons queryMouseButtons() const; + Qt::KeyboardModifiers queryKeyboardModifiers() const; + + bool isUserInputEvent(xcb_generic_event_t *event) const; + + void xi2SelectStateEvents(); + void xi2SelectDeviceEvents(xcb_window_t window); + bool xi2SetMouseGrabEnabled(xcb_window_t w, bool grab); + + Qt::MouseButton xiToQtMouseButton(uint32_t b); + void xi2UpdateScrollingDevices(); + bool isTouchScreen(int id); + + bool startSystemMoveResizeForTouch(xcb_window_t window, int edges); + void abortSystemMoveResize(xcb_window_t window); + bool isDuringSystemMoveResize() const; + void setDuringSystemMoveResize(bool during); + + bool canGrab() const { return m_canGrabServer; } + + QXcbGlIntegration *glIntegration() const; + + void flush() { xcb_flush(xcb_connection()); } + void processXcbEvents(QEventLoop::ProcessEventsFlags flags); + + QTimer &focusInTimer() { return m_focusInTimer; } + +protected: + bool event(QEvent *e) override; + +private: + void xrandrSelectEvents(); + QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc) const; + QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output) const; + QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow) const; + void updateScreens(const xcb_randr_notify_event_t *event); + bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); + void updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange); + QXcbScreen *createScreen(QXcbVirtualDesktop *virtualDesktop, + const xcb_randr_output_change_t &outputChange, + xcb_randr_get_output_info_reply_t *outputInfo); + void destroyScreen(QXcbScreen *screen); + void initializeScreens(bool initialized); + void initializeScreensWithoutXRandR(xcb_screen_iterator_t *it, int screenNumber, QXcbScreen **primaryScreen); + void initializeScreensFromOutput(xcb_screen_iterator_t *it, int screenNumber, QXcbScreen **primaryScreen); + + void updateScreen_monitor(QXcbScreen *screen, xcb_randr_monitor_info_t *monitorInfo, xcb_timestamp_t timestamp = XCB_NONE); + QXcbScreen *createScreen_monitor(QXcbVirtualDesktop *virtualDesktop, + xcb_randr_monitor_info_t *monitorInfo, xcb_timestamp_t timestamp = XCB_NONE); + QXcbVirtualDesktop* virtualDesktopForNumber(int n) const; + QXcbScreen* findScreenForMonitorInfo(const QList &screens, xcb_randr_monitor_info_t *monitorInfo); + void initializeScreensFromMonitor(xcb_screen_iterator_t *it, int screenNumber, QXcbScreen **primaryScreen, bool initialized); + + bool compressEvent(xcb_generic_event_t *event) const; + inline bool timeGreaterThan(xcb_timestamp_t a, xcb_timestamp_t b) const + { return static_cast(a - b) > 0 || b == XCB_CURRENT_TIME; } + + void xi2SetupSlavePointerDevice(void *info, bool removeExisting = true, QPointingDevice *master = nullptr); + void xi2SetupDevices(); + // TODO get rid of this: store minimal necessary info in a subclass of QPointingDevicePrivate + struct TouchDeviceData { + QPointingDevice *qtTouchDevice = nullptr; + QHash touchPoints; + QHash pointPressedPosition; // in screen coordinates where each point was pressed + struct ValuatorClassInfo { + double min = 0; + double max = 0; + int number = -1; + QXcbAtom::Atom label; + }; + QList valuatorInfo; + + // Stuff that is relevant only for touchpads + QPointF firstPressedPosition; // in screen coordinates where the first point was pressed + QPointF firstPressedNormalPosition; // device coordinates (0 to 1, 0 to 1) where the first point was pressed + QSizeF size; // device size in mm + bool providesTouchOrientation = false; + }; + TouchDeviceData *populateTouchDevices(void *info, QXcbScrollingDevicePrivate *scrollingDeviceP, bool *used = nullptr); + TouchDeviceData *touchDeviceForId(int id); + void xi2HandleEvent(xcb_ge_event_t *event); + void xi2HandleGesturePinchEvent(void *event); + void xi2HandleGestureSwipeEvent(void *event); + void xi2HandleHierarchyEvent(void *event); + void xi2HandleDeviceChangedEvent(void *event); + void xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow); +#if QT_CONFIG(tabletevent) + // TODO get rid of this: store minimal necessary info in a subclass of QXcbScrollingDevice (some tablets can scroll) + struct TabletData { + int deviceId = 0; + QString name; + QPointingDevice::PointerType pointerType = QPointingDevice::PointerType::Unknown; + QInputDevice::DeviceType tool = QInputDevice::DeviceType::Stylus; + Qt::MouseButtons buttons; + qint64 serialId = 0; + bool inProximity = false; + struct ValuatorClassInfo { + double minVal = 0; + double maxVal = 0; + double curVal = 0; + int number = -1; + }; + QHash valuatorInfo; + }; + friend class QTypeInfo; + friend class QTypeInfo; + bool xi2HandleTabletEvent(const void *event, TabletData *tabletData); + void xi2ReportTabletEvent(const void *event, TabletData *tabletData); + QList m_tabletData; + TabletData *tabletDataForDevice(int id); +#endif // QT_CONFIG(tabletevent) + void xi2HandleScrollEvent(void *event, const QPointingDevice *scrollingDevice); + void xi2UpdateScrollingDevice(QInputDevice *scrollingDevice); + QXcbScrollingDevice *scrollingDeviceForId(int id); + + static bool xi2GetValuatorValueIfSet(const void *event, int valuatorNum, double *value); + + QHash m_touchDevices; + + struct StartSystemMoveResizeInfo { + xcb_window_t window = XCB_NONE; + uint16_t deviceid; + uint32_t pointid; + int edges; + } m_startSystemMoveResizeInfo; + bool m_duringSystemMoveResize; + + const bool m_canGrabServer; + const xcb_visualid_t m_defaultVisualId; + + QList m_virtualDesktops; + QList m_screens; + + xcb_timestamp_t m_time = XCB_CURRENT_TIME; + xcb_timestamp_t m_netWmUserTime = XCB_CURRENT_TIME; + + QXcbKeyboard *m_keyboard = nullptr; +#ifndef QT_NO_CLIPBOARD + QXcbClipboard *m_clipboard = nullptr; +#endif +#if QT_CONFIG(draganddrop) + QXcbDrag *m_drag = nullptr; +#endif + QScopedPointer m_wmSupport; + QXcbNativeInterface *m_nativeInterface = nullptr; + + QXcbEventQueue *m_eventQueue = nullptr; + + WindowMapper m_mapper; + + Qt::MouseButtons m_buttonState; + Qt::MouseButton m_button = Qt::NoButton; + + QXcbWindow *m_focusWindow = nullptr; + QXcbWindow *m_mouseGrabber = nullptr; + QXcbWindow *m_mousePressWindow = nullptr; + +#if QT_CONFIG(gestures) + qreal m_lastPinchScale = 0; +#endif + + xcb_window_t m_clientLeader = 0; + QByteArray m_startupId; + QXcbSystemTrayTracker *m_systemTrayTracker = nullptr; + mutable QXcbGlIntegration *m_glIntegration = nullptr; + mutable bool m_glIntegrationInitialized = false; + bool m_xiGrab = false; + QList m_xiMasterPointerIds; + QList m_xiSlavePointerIds; + + xcb_window_t m_qtSelectionOwner = 0; + + friend class QXcbEventQueue; + + QTimer m_focusInTimer; + +}; +#if QT_CONFIG(tabletevent) +Q_DECLARE_TYPEINFO(QXcbConnection::TabletData::ValuatorClassInfo, Q_PRIMITIVE_TYPE); +Q_DECLARE_TYPEINFO(QXcbConnection::TabletData, Q_RELOCATABLE_TYPE); +#endif + +class QXcbConnectionGrabber +{ +public: + Q_NODISCARD_CTOR QXcbConnectionGrabber(QXcbConnection *connection); + ~QXcbConnectionGrabber(); + void release(); +private: + QXcbConnection *m_connection; +}; + +// The xcb_send_event() requires all events to have 32 bytes. It calls memcpy() on the +// passed in event. If the passed in event is less than 32 bytes, memcpy() reaches into +// unrelated memory. +template +struct alignas(32) q_padded_xcb_event : T { }; + +QT_END_NAMESPACE + +#endif diff --git a/xcb/libqt6xcbqpa-dev/6.6.2/qxcbconnection_basic.h b/xcb/libqt6xcbqpa-dev/6.6.2/qxcbconnection_basic.h new file mode 100644 index 00000000..d44805b3 --- /dev/null +++ b/xcb/libqt6xcbqpa-dev/6.6.2/qxcbconnection_basic.h @@ -0,0 +1,142 @@ +// Copyright (C) 2018 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +#ifndef QXCBBASICCONNECTION_H +#define QXCBBASICCONNECTION_H + +#include "qxcbatom.h" +#include "qxcbexport.h" + +#include +#include +#include +#include +#include + +#include + +#include + +QT_BEGIN_NAMESPACE + +Q_DECLARE_LOGGING_CATEGORY(lcQpaXcb) + +class Q_XCB_EXPORT QXcbBasicConnection : public QObject +{ + Q_OBJECT +public: + QXcbBasicConnection(const char *displayName); + ~QXcbBasicConnection(); + +#if QT_CONFIG(xcb_xlib) + void *xlib_display() const { return m_xlibDisplay; } +#endif + const char *displayName() const { return m_displayName.constData(); } + int primaryScreenNumber() const { return m_primaryScreenNumber; } + xcb_connection_t *xcb_connection() const { return m_xcbConnection; } + bool isConnected() const { + return m_xcbConnection && !xcb_connection_has_error(m_xcbConnection); + } + const xcb_setup_t *setup() const { return m_setup; } + + size_t maxRequestDataBytes(size_t requestSize) const; + + inline xcb_atom_t atom(QXcbAtom::Atom qatom) const { return m_xcbAtom.atom(qatom); } + QXcbAtom::Atom qatom(xcb_atom_t atom) const { return m_xcbAtom.qatom(atom); } + xcb_atom_t internAtom(const char *name); + QByteArray atomName(xcb_atom_t atom); + + bool hasXFixes() const { return m_hasXFixes; } + bool hasXShape() const { return m_hasXhape; } + bool hasXRandr() const { return m_hasXRandr; } + bool hasInputShape() const { return m_hasInputShape; } + bool hasXKB() const { return m_hasXkb; } + bool hasXRender(int major = -1, int minor = -1) const { + if (m_hasXRender && major != -1 && minor != -1) + return m_xrenderVersion >= qMakePair(major, minor); + + return m_hasXRender; + } + bool hasXInput2() const { return m_xi2Enabled; } + bool hasShm() const { return m_hasShm; } + bool hasShmFd() const { return m_hasShmFd; } + bool hasXSync() const { return m_hasXSync; } + bool hasBigRequest() const; + + bool isAtLeastXRandR12() const { return m_hasXRandr && m_xrandr1Minor >= 2; } + bool isAtLeastXRandR15() const { return m_hasXRandr && m_xrandr1Minor >= 5; } + + bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } + bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; } + bool isAtLeastXI24() const { return m_xi2Enabled && m_xi2Minor >= 4; } + bool isXIEvent(xcb_generic_event_t *event) const; + bool isXIType(xcb_generic_event_t *event, uint16_t type) const; + + bool isXFixesType(uint responseType, int eventType) const; + bool isXRandrType(uint responseType, int eventType) const; + bool isXkbType(uint responseType) const; // https://bugs.freedesktop.org/show_bug.cgi?id=51295 + +protected: + void initializeShm(); + void initializeXFixes(); + void initializeXRender(); + void initializeXRandr(); + void initializeXShape(); + void initializeXKB(); + void initializeXSync(); + void initializeXInput2(); + +private: +#if QT_CONFIG(xcb_xlib) + void *m_xlibDisplay = nullptr; +#endif + QByteArray m_displayName; + xcb_connection_t *m_xcbConnection = nullptr; + int m_primaryScreenNumber = 0; + const xcb_setup_t *m_setup = nullptr; + QXcbAtom m_xcbAtom; + + bool m_hasXFixes = false; + bool m_hasXhape = false; + bool m_hasInputShape; + bool m_hasXRandr = false; + bool m_hasXkb = false; + bool m_hasXRender = false; + bool m_hasShm = false; + bool m_hasShmFd = false; + bool m_hasXSync = false; + + QPair m_xrenderVersion; + + bool m_xi2Enabled = false; + int m_xi2Minor = -1; + int m_xiOpCode = -1; + uint32_t m_xinputFirstEvent = 0; + + int m_xrandr1Minor = -1; + + uint32_t m_xfixesFirstEvent = 0; + uint32_t m_xrandrFirstEvent = 0; + uint32_t m_xkbFirstEvent = 0; + + uint32_t m_maximumRequestLength = 0; +}; + +#define Q_XCB_REPLY_CONNECTION_ARG(connection, ...) connection + +struct QStdFreeDeleter { + void operator()(void *p) const noexcept { return std::free(p); } +}; + +#define Q_XCB_REPLY(call, ...) \ + std::unique_ptr( \ + call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call(__VA_ARGS__), nullptr) \ + ) + +#define Q_XCB_REPLY_UNCHECKED(call, ...) \ + std::unique_ptr( \ + call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call##_unchecked(__VA_ARGS__), nullptr) \ + ) + +QT_END_NAMESPACE + +#endif // QXCBBASICCONNECTION_H diff --git a/xcb/libqt6xcbqpa-dev/6.6.2/qxcbcursor.h b/xcb/libqt6xcbqpa-dev/6.6.2/qxcbcursor.h new file mode 100644 index 00000000..bf26861e --- /dev/null +++ b/xcb/libqt6xcbqpa-dev/6.6.2/qxcbcursor.h @@ -0,0 +1,97 @@ +// Copyright (C) 2022 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +#ifndef QXCBCURSOR_H +#define QXCBCURSOR_H + +#include +#include "qxcbscreen.h" +#include + +#include + +QT_BEGIN_NAMESPACE + +#ifndef QT_NO_CURSOR + +struct QXcbCursorCacheKey +{ + explicit QXcbCursorCacheKey(const QCursor &c); + explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} + QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} + + Qt::CursorShape shape; + qint64 bitmapCacheKey; + qint64 maskCacheKey; +}; + +inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) +{ + return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; +} + +inline size_t qHash(const QXcbCursorCacheKey &k, size_t seed) noexcept +{ + return (size_t(k.shape) + size_t(k.bitmapCacheKey) + size_t(k.maskCacheKey)) ^ seed; +} + +#endif // !QT_NO_CURSOR + +class QXcbCursor : public QXcbObject, public QPlatformCursor +{ +public: + QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); + ~QXcbCursor(); +#ifndef QT_NO_CURSOR + void changeCursor(QCursor *cursor, QWindow *window) override; +#endif + QPoint pos() const override; + void setPos(const QPoint &pos) override; + + QSize size() const override; + + void updateContext(); + + static void queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask = nullptr); + +#ifndef QT_NO_CURSOR + xcb_cursor_t xcbCursor(const QCursor &c) const + { return m_cursorHash.value(QXcbCursorCacheKey(c), xcb_cursor_t(0)); } +#endif + +private: + +#ifndef QT_NO_CURSOR + typedef QHash CursorHash; + + struct CachedCursor + { + explicit CachedCursor(xcb_connection_t *conn, xcb_cursor_t c) + : cursor(c), connection(conn) {} + ~CachedCursor() { xcb_free_cursor(connection, cursor); } + xcb_cursor_t cursor; + xcb_connection_t *connection; + }; + typedef QCache BitmapCursorCache; + + xcb_cursor_t createFontCursor(int cshape); + xcb_cursor_t createBitmapCursor(QCursor *cursor); + xcb_cursor_t createNonStandardCursor(int cshape); +#endif + + QXcbScreen *m_screen; + xcb_cursor_context_t *m_cursorContext; +#ifndef QT_NO_CURSOR + CursorHash m_cursorHash; + BitmapCursorCache m_bitmapCache; +#endif + static void cursorThemePropertyChanged(QXcbVirtualDesktop *screen, + const QByteArray &name, + const QVariant &property, + void *handle); + bool m_callbackForPropertyRegistered; +}; + +QT_END_NAMESPACE + +#endif diff --git a/xcb/libqt6xcbqpa-dev/6.6.2/qxcbcursorfont.h b/xcb/libqt6xcbqpa-dev/6.6.2/qxcbcursorfont.h new file mode 100644 index 00000000..fe74e276 --- /dev/null +++ b/xcb/libqt6xcbqpa-dev/6.6.2/qxcbcursorfont.h @@ -0,0 +1,88 @@ +// Copyright (C) 2022 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +// copied from + +#ifndef QXCBCURSORFONT_H +#define QXCBCURSORFONT_H + +#define XC_num_glyphs 154 +#define XC_X_cursor 0 +#define XC_arrow 2 +#define XC_based_arrow_down 4 +#define XC_based_arrow_up 6 +#define XC_boat 8 +#define XC_bogosity 10 +#define XC_bottom_left_corner 12 +#define XC_bottom_right_corner 14 +#define XC_bottom_side 16 +#define XC_bottom_tee 18 +#define XC_box_spiral 20 +#define XC_center_ptr 22 +#define XC_circle 24 +#define XC_clock 26 +#define XC_coffee_mug 28 +#define XC_cross 30 +#define XC_cross_reverse 32 +#define XC_crosshair 34 +#define XC_diamond_cross 36 +#define XC_dot 38 +#define XC_dotbox 40 +#define XC_double_arrow 42 +#define XC_draft_large 44 +#define XC_draft_small 46 +#define XC_draped_box 48 +#define XC_exchange 50 +#define XC_fleur 52 +#define XC_gobbler 54 +#define XC_gumby 56 +#define XC_hand1 58 +#define XC_hand2 60 +#define XC_heart 62 +#define XC_icon 64 +#define XC_iron_cross 66 +#define XC_left_ptr 68 +#define XC_left_side 70 +#define XC_left_tee 72 +#define XC_leftbutton 74 +#define XC_ll_angle 76 +#define XC_lr_angle 78 +#define XC_man 80 +#define XC_middlebutton 82 +#define XC_mouse 84 +#define XC_pencil 86 +#define XC_pirate 88 +#define XC_plus 90 +#define XC_question_arrow 92 +#define XC_right_ptr 94 +#define XC_right_side 96 +#define XC_right_tee 98 +#define XC_rightbutton 100 +#define XC_rtl_logo 102 +#define XC_sailboat 104 +#define XC_sb_down_arrow 106 +#define XC_sb_h_double_arrow 108 +#define XC_sb_left_arrow 110 +#define XC_sb_right_arrow 112 +#define XC_sb_up_arrow 114 +#define XC_sb_v_double_arrow 116 +#define XC_shuttle 118 +#define XC_sizing 120 +#define XC_spider 122 +#define XC_spraycan 124 +#define XC_star 126 +#define XC_target 128 +#define XC_tcross 130 +#define XC_top_left_arrow 132 +#define XC_top_left_corner 134 +#define XC_top_right_corner 136 +#define XC_top_side 138 +#define XC_top_tee 140 +#define XC_trek 142 +#define XC_ul_angle 144 +#define XC_umbrella 146 +#define XC_ur_angle 148 +#define XC_watch 150 +#define XC_xterm 152 + +#endif /* QXCBCURSORFONT_H */ diff --git a/xcb/libqt6xcbqpa-dev/6.6.2/qxcbdrag.h b/xcb/libqt6xcbqpa-dev/6.6.2/qxcbdrag.h new file mode 100644 index 00000000..ae7cc915 --- /dev/null +++ b/xcb/libqt6xcbqpa-dev/6.6.2/qxcbdrag.h @@ -0,0 +1,161 @@ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +#ifndef QXCBDRAG_H +#define QXCBDRAG_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +QT_REQUIRE_CONFIG(draganddrop); + +QT_BEGIN_NAMESPACE + +class QWindow; +class QPlatformWindow; +class QXcbConnection; +class QXcbWindow; +class QXcbDropData; +class QXcbScreen; +class QDrag; +class QShapedPixmapWindow; + +class QXcbDrag : public QXcbObject, public QBasicDrag, public QXcbWindowEventListener +{ +public: + QXcbDrag(QXcbConnection *c); + ~QXcbDrag(); + + bool eventFilter(QObject *o, QEvent *e) override; + + void startDrag() override; + void cancel() override; + void move(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; + void drop(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; + void endDrag() override; + + Qt::DropAction defaultAction(Qt::DropActions possibleActions, Qt::KeyboardModifiers modifiers) const override; + + void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; + + void handleEnter(QPlatformWindow *window, const xcb_client_message_event_t *event, xcb_window_t proxy = 0); + void handlePosition(QPlatformWindow *w, const xcb_client_message_event_t *event); + void handleLeave(QPlatformWindow *w, const xcb_client_message_event_t *event); + void handleDrop(QPlatformWindow *, const xcb_client_message_event_t *event, + Qt::MouseButtons b = { }, Qt::KeyboardModifiers mods = { }); + + void handleStatus(const xcb_client_message_event_t *event); + void handleSelectionRequest(const xcb_selection_request_event_t *event); + void handleFinished(const xcb_client_message_event_t *event); + + bool dndEnable(QXcbWindow *win, bool on); + bool ownsDragObject() const override; + + void updatePixmap(); + xcb_timestamp_t targetTime() { return target_time; } + +protected: + void timerEvent(QTimerEvent* e) override; + + bool findXdndAwareTarget(const QPoint &globalPos, xcb_window_t *target_out); + +private: + friend class QXcbDropData; + + void init(); + + void handle_xdnd_position(QPlatformWindow *w, const xcb_client_message_event_t *event, + Qt::MouseButtons b = { }, Qt::KeyboardModifiers mods = { }); + void handle_xdnd_status(const xcb_client_message_event_t *event); + void send_leave(); + + Qt::DropAction toDropAction(xcb_atom_t atom) const; + Qt::DropActions toDropActions(const QList &atoms) const; + xcb_atom_t toXdndAction(Qt::DropAction a) const; + + void readActionList(); + void setActionList(Qt::DropAction requestedAction, Qt::DropActions supportedActions); + void startListeningForActionListChanges(); + void stopListeningForActionListChanges(); + + QPointer initiatorWindow; + QPointer currentWindow; + QPoint currentPosition; + + QXcbDropData *m_dropData; + Qt::DropAction accepted_drop_action; + + QWindow *desktop_proxy; + + xcb_atom_t xdnd_dragsource; + + // the types in this drop. 100 is no good, but at least it's big. + enum { xdnd_max_type = 100 }; + QList xdnd_types; + + // timestamp from XdndPosition and XdndDroptime for retrieving the data + xcb_timestamp_t target_time; + xcb_timestamp_t source_time; + + // rectangle in which the answer will be the same + QRect source_sameanswer; + bool waiting_for_status; + + // helpers for setting executed drop action outside application + bool dropped; + bool canceled; + + // A window from Unity DnD Manager, which does not respect the XDnD spec + xcb_window_t xdndCollectionWindow = XCB_NONE; + + // top-level window we sent position to last. + xcb_window_t current_target; + // window to send events to (always valid if current_target) + xcb_window_t current_proxy_target; + + QXcbVirtualDesktop *current_virtual_desktop; + + // 10 minute timer used to discard old XdndDrop transactions + static constexpr std::chrono::minutes XdndDropTransactionTimeout{10}; + int cleanup_timer; + + QList drag_types; + + QList current_actions; + QList drop_actions; + + struct Transaction + { + xcb_timestamp_t timestamp; + xcb_window_t target; + xcb_window_t proxy_target; + QPlatformWindow *targetWindow; +// QWidget *embedding_widget; + QPointer drag; + QTime time; + }; + friend class QTypeInfo; + QList transactions; + + int transaction_expiry_timer; + void restartDropExpiryTimer(); + int findTransactionByWindow(xcb_window_t window); + int findTransactionByTime(xcb_timestamp_t timestamp); + xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); +}; +Q_DECLARE_TYPEINFO(QXcbDrag::Transaction, Q_RELOCATABLE_TYPE); + +QT_END_NAMESPACE + +#endif diff --git a/xcb/libqt6xcbqpa-dev/6.6.2/qxcbeventdispatcher.h b/xcb/libqt6xcbqpa-dev/6.6.2/qxcbeventdispatcher.h new file mode 100644 index 00000000..9c7e745a --- /dev/null +++ b/xcb/libqt6xcbqpa-dev/6.6.2/qxcbeventdispatcher.h @@ -0,0 +1,72 @@ +// Copyright (C) 2018 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +#ifndef QXCBEVENTDISPATCHER_H +#define QXCBEVENTDISPATCHER_H + +#include +#include + +#include +#if QT_CONFIG(glib) +#include +#include +#endif + +QT_BEGIN_NAMESPACE + +class QXcbConnection; + +class QXcbUnixEventDispatcher : public QEventDispatcherUNIX +{ + Q_OBJECT +public: + explicit QXcbUnixEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); + ~QXcbUnixEventDispatcher(); + bool processEvents(QEventLoop::ProcessEventsFlags flags) override; + +private: + QXcbConnection *m_connection; +}; + +#if QT_CONFIG(glib) + +struct XcbEventSource; +class QXcbGlibEventDispatcherPrivate; + +class QXcbGlibEventDispatcher : public QEventDispatcherGlib +{ + Q_OBJECT + Q_DECLARE_PRIVATE(QXcbGlibEventDispatcher) + +public: + explicit QXcbGlibEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); + ~QXcbGlibEventDispatcher(); + + bool processEvents(QEventLoop::ProcessEventsFlags flags) override; + QEventLoop::ProcessEventsFlags flags() const { return m_flags; } + +private: + XcbEventSource *m_xcbEventSource; + GSourceFuncs m_xcbEventSourceFuncs; + QEventLoop::ProcessEventsFlags m_flags; +}; + +class QXcbGlibEventDispatcherPrivate : public QEventDispatcherGlibPrivate +{ + Q_DECLARE_PUBLIC(QXcbGlibEventDispatcher) + +public: + QXcbGlibEventDispatcherPrivate(); +}; + +#endif // QT_CONFIG(glib) + +class QXcbEventDispatcher +{ +public: + static QAbstractEventDispatcher *createEventDispatcher(QXcbConnection *connection); +}; + +QT_END_NAMESPACE + +#endif // QXCBEVENTDISPATCHER_H diff --git a/xcb/libqt6xcbqpa-dev/6.6.2/qxcbeventqueue.h b/xcb/libqt6xcbqpa-dev/6.6.2/qxcbeventqueue.h new file mode 100644 index 00000000..7d8f6d54 --- /dev/null +++ b/xcb/libqt6xcbqpa-dev/6.6.2/qxcbeventqueue.h @@ -0,0 +1,151 @@ +// Copyright (C) 2018 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +#ifndef QXCBEVENTQUEUE_H +#define QXCBEVENTQUEUE_H + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +QT_BEGIN_NAMESPACE + +struct QXcbEventNode { + QXcbEventNode(xcb_generic_event_t *e = nullptr) + : event(e) { } + + xcb_generic_event_t *event; + QXcbEventNode *next = nullptr; + bool fromHeap = false; +}; + +class QXcbConnection; +class QAbstractEventDispatcher; + +class QXcbEventQueue : public QThread +{ + Q_OBJECT +public: + QXcbEventQueue(QXcbConnection *connection); + ~QXcbEventQueue(); + + enum { PoolSize = 100 }; // 2.4 kB with 100 nodes + + enum PeekOption { + // See qx11info_x11.cpp in X11 Extras module. + PeekDefault = 0, + // See qx11info_x11.cpp in X11 Extras module. + PeekFromCachedIndex = 1, + // Used by the event compression algorithms to determine if + // the currently processed event (which has been already dequeued) + // can be compressed. Returns from the QXcbEventQueue::peek() + // on the first match. + PeekRetainMatch = 2, + // Marks the event in the node as "nullptr". The actual + // node remains in the queue. The nodes are unlinked only + // by dequeueNode(). Returns from the QXcbEventQueue::peek() + // on the first match. + PeekConsumeMatch = 3, + // Same as above, but continues to the next node in the + // queue. Repeats this until the flushed tailed node has + // been reached. + PeekConsumeMatchAndContinue = 4 + }; + Q_DECLARE_FLAGS(PeekOptions, PeekOption) + + void run() override; + + bool isEmpty() const { return m_head == m_flushedTail && !m_head->event; } + xcb_generic_event_t *takeFirst(QEventLoop::ProcessEventsFlags flags); + xcb_generic_event_t *takeFirst(); + void flushBufferedEvents(); + void wakeUpDispatcher(); + + // ### peek() and peekEventQueue() could be unified. Note that peekEventQueue() + // is public API exposed via QX11Extras/QX11Info. PeekOption could be reworked to + // have values that can be OR-ed together. + template + xcb_generic_event_t *peek(Peeker &&peeker) { + return peek(PeekConsumeMatch, std::forward(peeker)); + } + template + inline xcb_generic_event_t *peek(PeekOption config, Peeker &&peeker); + + qint32 generatePeekerId(); + bool removePeekerId(qint32 peekerId); + + using PeekerCallback = bool (*)(xcb_generic_event_t *event, void *peekerData); + bool peekEventQueue(PeekerCallback peeker, void *peekerData = nullptr, + PeekOptions option = PeekDefault, qint32 peekerId = -1); + + const QXcbEventNode *flushedTail() const { return m_flushedTail; } + void waitForNewEvents(const QXcbEventNode *sinceFlushedTail, + unsigned long time = (std::numeric_limits::max)()); + +private: + QXcbEventNode *qXcbEventNodeFactory(xcb_generic_event_t *event); + void dequeueNode(); + + void sendCloseConnectionEvent() const; + bool isCloseConnectionEvent(const xcb_generic_event_t *event); + + QXcbEventNode *m_head = nullptr; + QXcbEventNode *m_flushedTail = nullptr; + std::atomic m_tail { nullptr }; + std::atomic_uint m_nodesRestored { 0 }; + + QXcbConnection *m_connection = nullptr; + bool m_closeConnectionDetected = false; + + uint m_freeNodes = PoolSize; + uint m_poolIndex = 0; + + qint32 m_peekerIdSource = 0; + bool m_queueModified = false; + bool m_peekerIndexCacheDirty = false; + QHash m_peekerToNode; + + QList m_inputEvents; + + // debug stats + quint64 m_nodesOnHeap = 0; + + QMutex m_newEventsMutex; + QWaitCondition m_newEventsCondition; +}; + +template +xcb_generic_event_t *QXcbEventQueue::peek(PeekOption option, Peeker &&peeker) +{ + flushBufferedEvents(); + if (isEmpty()) + return nullptr; + + QXcbEventNode *node = m_head; + do { + xcb_generic_event_t *event = node->event; + if (event && peeker(event, event->response_type & ~0x80)) { + if (option == PeekConsumeMatch || option == PeekConsumeMatchAndContinue) + node->event = nullptr; + + if (option != PeekConsumeMatchAndContinue) + return event; + } + if (node == m_flushedTail) + break; + node = node->next; + } while (true); + + return nullptr; +} + +QT_END_NAMESPACE + +#endif diff --git a/xcb/libqt6xcbqpa-dev/6.6.2/qxcbexport.h b/xcb/libqt6xcbqpa-dev/6.6.2/qxcbexport.h new file mode 100644 index 00000000..1a163415 --- /dev/null +++ b/xcb/libqt6xcbqpa-dev/6.6.2/qxcbexport.h @@ -0,0 +1,19 @@ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +#ifndef QXCBEXPORT_H +#define QXCBEXPORT_H + +#include + +QT_BEGIN_NAMESPACE + +# if defined(QT_BUILD_XCB_PLUGIN) +# define Q_XCB_EXPORT Q_DECL_EXPORT +# else +# define Q_XCB_EXPORT Q_DECL_IMPORT +# endif + +QT_END_NAMESPACE +#endif //QXCBEXPORT_H + diff --git a/xcb/libqt6xcbqpa-dev/6.6.2/qxcbimage.h b/xcb/libqt6xcbqpa-dev/6.6.2/qxcbimage.h new file mode 100644 index 00000000..e5501028 --- /dev/null +++ b/xcb/libqt6xcbqpa-dev/6.6.2/qxcbimage.h @@ -0,0 +1,26 @@ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +#ifndef QXCBIMAGE_H +#define QXCBIMAGE_H + +#include "qxcbscreen.h" +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +bool qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual, + QImage::Format *imageFormat, bool *needsRgbSwap = nullptr); +QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, + int width, int height, int depth, + const xcb_visualtype_t *visual); +xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); +xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, + const QPoint &spot); + +QT_END_NAMESPACE + +#endif diff --git a/xcb/libqt6xcbqpa-dev/6.6.2/qxcbintegration.h b/xcb/libqt6xcbqpa-dev/6.6.2/qxcbintegration.h new file mode 100644 index 00000000..9284f6de --- /dev/null +++ b/xcb/libqt6xcbqpa-dev/6.6.2/qxcbintegration.h @@ -0,0 +1,131 @@ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +#ifndef QXCBINTEGRATION_H +#define QXCBINTEGRATION_H + +#include +#include +#include +#include + +#include "qxcbexport.h" + +#include + +QT_BEGIN_NAMESPACE + +class QXcbConnection; +class QAbstractEventDispatcher; +class QXcbNativeInterface; + +class Q_XCB_EXPORT QXcbIntegration : public QPlatformIntegration +#ifndef QT_NO_OPENGL +# if QT_CONFIG(xcb_glx_plugin) + , public QNativeInterface::Private::QGLXIntegration +# endif +# if QT_CONFIG(egl) + , public QNativeInterface::Private::QEGLIntegration +# endif +#endif +{ +public: + QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); + ~QXcbIntegration(); + + QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const override; + QPlatformWindow *createPlatformWindow(QWindow *window) const override; + QPlatformWindow *createForeignWindow(QWindow *window, WId nativeHandle) const override; +#ifndef QT_NO_OPENGL + QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; +# if QT_CONFIG(xcb_glx_plugin) + QOpenGLContext *createOpenGLContext(GLXContext context, void *visualInfo, QOpenGLContext *shareContext) const override; +# endif +# if QT_CONFIG(egl) + QOpenGLContext *createOpenGLContext(EGLContext context, EGLDisplay display, QOpenGLContext *shareContext) const override; +# endif +#endif + QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override; + + QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; + + bool hasCapability(Capability cap) const override; + QAbstractEventDispatcher *createEventDispatcher() const override; + void initialize() override; + + void moveToScreen(QWindow *window, int screen); + + QPlatformFontDatabase *fontDatabase() const override; + + QPlatformNativeInterface *nativeInterface()const override; + +#ifndef QT_NO_CLIPBOARD + QPlatformClipboard *clipboard() const override; +#endif +#if QT_CONFIG(draganddrop) + QPlatformDrag *drag() const override; +#endif + + QPlatformInputContext *inputContext() const override; + +#if QT_CONFIG(accessibility) + QPlatformAccessibility *accessibility() const override; +#endif + + QPlatformServices *services() const override; + + Qt::KeyboardModifiers queryKeyboardModifiers() const override; + QList possibleKeys(const QKeyEvent *e) const override; + + QStringList themeNames() const override; + QPlatformTheme *createPlatformTheme(const QString &name) const override; + QVariant styleHint(StyleHint hint) const override; + + bool hasConnection() const { return m_connection; } + QXcbConnection *connection() const { return m_connection; } + + QByteArray wmClass() const; + +#if QT_CONFIG(xcb_sm) + QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const override; +#endif + + void sync() override; + + void beep() const override; + + bool nativePaintingEnabled() const; + +#if QT_CONFIG(vulkan) + QPlatformVulkanInstance *createPlatformVulkanInstance(QVulkanInstance *instance) const override; +#endif + + static QXcbIntegration *instance() { return m_instance; } + + void setApplicationBadge(qint64 number) override; + +private: + QXcbConnection *m_connection = nullptr; + + QScopedPointer m_fontDatabase; + QScopedPointer m_nativeInterface; + + QScopedPointer m_inputContext; + +#if QT_CONFIG(accessibility) + mutable QScopedPointer m_accessibility; +#endif + + QScopedPointer m_services; + + mutable QByteArray m_wmClass; + const char *m_instanceName; + bool m_canGrab; + xcb_visualid_t m_defaultVisualId; + + static QXcbIntegration *m_instance; +}; + +QT_END_NAMESPACE + +#endif diff --git a/xcb/libqt6xcbqpa-dev/6.6.2/qxcbkeyboard.h b/xcb/libqt6xcbqpa-dev/6.6.2/qxcbkeyboard.h new file mode 100644 index 00000000..15b08fbe --- /dev/null +++ b/xcb/libqt6xcbqpa-dev/6.6.2/qxcbkeyboard.h @@ -0,0 +1,105 @@ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +#ifndef QXCBKEYBOARD_H +#define QXCBKEYBOARD_H + +#include "qxcbobject.h" + +#include +#define explicit dont_use_cxx_explicit +#include +#undef explicit + +#include +#include + +#include + +QT_BEGIN_NAMESPACE + +class QXcbKeyboard : public QXcbObject +{ +public: + QXcbKeyboard(QXcbConnection *connection); + + ~QXcbKeyboard(); + + void initialize(); + void selectEvents(); + + void handleKeyPressEvent(const xcb_key_press_event_t *event); + void handleKeyReleaseEvent(const xcb_key_release_event_t *event); + + Qt::KeyboardModifiers translateModifiers(int s) const; + void updateKeymap(xcb_mapping_notify_event_t *event); + void updateKeymap(); + QList possibleKeys(const QKeyEvent *event) const; + + void updateXKBMods(); + xkb_mod_mask_t xkbModMask(quint16 state); + void updateXKBStateFromCore(quint16 state); + void updateXKBStateFromXI(void *modInfo, void *groupInfo); + + int coreDeviceId() const { return core_device_id; } + void updateXKBState(xcb_xkb_state_notify_event_t *state); + + void handleStateChanges(xkb_state_component changedComponents); + +protected: + void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, + quint16 state, xcb_timestamp_t time, bool fromSendEvent); + + void resolveMaskConflicts(); + + typedef QMap KeysymModifierMap; + struct xkb_keymap *keymapFromCore(const KeysymModifierMap &keysymMods); + + void updateModifiers(const KeysymModifierMap &keysymMods); + KeysymModifierMap keysymsToModifiers(); + + void updateVModMapping(); + void updateVModToRModMapping(); + +private: + bool m_config = false; + bool m_isAutoRepeat = false; + xcb_keycode_t m_autoRepeatCode = 0; + + struct _mod_masks { + uint alt; + uint altgr; + uint meta; + uint super; + uint hyper; + }; + + _mod_masks rmod_masks; + + xcb_key_symbols_t *m_key_symbols = nullptr; + struct _xkb_mods { + xkb_mod_index_t shift; + xkb_mod_index_t lock; + xkb_mod_index_t control; + xkb_mod_index_t mod1; + xkb_mod_index_t mod2; + xkb_mod_index_t mod3; + xkb_mod_index_t mod4; + xkb_mod_index_t mod5; + }; + _xkb_mods xkb_mods; + + _mod_masks vmod_masks; + int core_device_id; + + QXkbCommon::ScopedXKBState m_xkbState; + QXkbCommon::ScopedXKBKeymap m_xkbKeymap; + QXkbCommon::ScopedXKBContext m_xkbContext; + + bool m_superAsMeta = false; + bool m_hyperAsMeta = false; +}; + +QT_END_NAMESPACE + +#endif diff --git a/xcb/libqt6xcbqpa-dev/6.6.2/qxcbmime.h b/xcb/libqt6xcbqpa-dev/6.6.2/qxcbmime.h new file mode 100644 index 00000000..4c99c39c --- /dev/null +++ b/xcb/libqt6xcbqpa-dev/6.6.2/qxcbmime.h @@ -0,0 +1,34 @@ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +#ifndef QXCBMIME_H +#define QXCBMIME_H + +#include + +#include + +#include "qxcbintegration.h" +#include "qxcbconnection.h" + +QT_BEGIN_NAMESPACE + +class QXcbMime : public QInternalMimeData { + Q_OBJECT +public: + QXcbMime(); + ~QXcbMime(); + + static QList mimeAtomsForFormat(QXcbConnection *connection, const QString &format); + static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); + static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, + xcb_atom_t *atomFormat, int *dataFormat); + static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, + QMetaType requestedType, bool hasUtf8); + static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QMetaType requestedType, + const QList &atoms, bool *hasUtf8); +}; + +QT_END_NAMESPACE + +#endif // QXCBMIME_H diff --git a/xcb/libqt6xcbqpa-dev/6.6.2/qxcbnativeinterface.h b/xcb/libqt6xcbqpa-dev/6.6.2/qxcbnativeinterface.h new file mode 100644 index 00000000..62bfb4c6 --- /dev/null +++ b/xcb/libqt6xcbqpa-dev/6.6.2/qxcbnativeinterface.h @@ -0,0 +1,123 @@ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +#ifndef QXCBNATIVEINTERFACE_H +#define QXCBNATIVEINTERFACE_H + +#include +#include + +#include + +#include + +#include "qxcbexport.h" +#include "qxcbconnection.h" + +QT_BEGIN_NAMESPACE + +class QXcbScreen; +class QXcbNativeInterfaceHandler; + +class Q_XCB_EXPORT QXcbNativeInterface : public QPlatformNativeInterface + , public QNativeInterface::QX11Application +{ + Q_OBJECT +public: + enum ResourceType { + XDisplay, + Connection, + Screen, + AppTime, + AppUserTime, + ScreenHintStyle, + StartupId, + TrayWindow, + GetTimestamp, + X11Screen, + RootWindow, + ScreenSubpixelType, + ScreenAntialiasingEnabled, + AtspiBus, + CompositingEnabled, + VkSurface, + GeneratePeekerId, + RemovePeekerId, + PeekEventQueue + }; + + QXcbNativeInterface(); + + void *nativeResourceForIntegration(const QByteArray &resource) override; + void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) override; + void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override; + void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) override; + void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) override; +#ifndef QT_NO_CURSOR + void *nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor) override; +#endif + + NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) override; + NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) override; + NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) override; + NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) override; + NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) override; + + QFunctionPointer platformFunction(const QByteArray &function) const override; + + inline const QByteArray &nativeEventType() const { return m_nativeEventType; } + + void *displayForWindow(QWindow *window); + void *connectionForWindow(QWindow *window); + void *screenForWindow(QWindow *window); + void *appTime(const QXcbScreen *screen); + void *appUserTime(const QXcbScreen *screen); + void *getTimestamp(const QXcbScreen *screen); + void *startupId(); + void *x11Screen(); + void *rootWindow(); + + Display *display() const override; + xcb_connection_t *connection() const override; + + void *atspiBus(); + static void setStartupId(const char *); + static void setAppTime(QScreen *screen, xcb_timestamp_t time); + static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); + + static qint32 generatePeekerId(); + static bool removePeekerId(qint32 peekerId); + static bool peekEventQueue(QXcbEventQueue::PeekerCallback peeker, void *peekerData = nullptr, + QXcbEventQueue::PeekOptions option = QXcbEventQueue::PeekDefault, + qint32 peekerId = -1); + + Q_INVOKABLE QString dumpConnectionNativeWindows(const QXcbConnection *connection, WId root) const; + Q_INVOKABLE QString dumpNativeWindows(WId root = 0) const; + + void addHandler(QXcbNativeInterfaceHandler *handler); + void removeHandler(QXcbNativeInterfaceHandler *handler); +signals: + void systemTrayWindowChanged(QScreen *screen); + +private: + const QByteArray m_nativeEventType = QByteArrayLiteral("xcb_generic_event_t"); + + static QXcbScreen *qPlatformScreenForWindow(QWindow *window); + + QList m_handlers; + NativeResourceForIntegrationFunction handlerNativeResourceFunctionForIntegration(const QByteArray &resource) const; + NativeResourceForContextFunction handlerNativeResourceFunctionForContext(const QByteArray &resource) const; + NativeResourceForScreenFunction handlerNativeResourceFunctionForScreen(const QByteArray &resource) const; + NativeResourceForWindowFunction handlerNativeResourceFunctionForWindow(const QByteArray &resource) const; + NativeResourceForBackingStoreFunction handlerNativeResourceFunctionForBackingStore(const QByteArray &resource) const; + QFunctionPointer handlerPlatformFunction(const QByteArray &function) const; + void *handlerNativeResourceForIntegration(const QByteArray &resource) const; + void *handlerNativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) const; + void *handlerNativeResourceForScreen(const QByteArray &resource, QScreen *screen) const; + void *handlerNativeResourceForWindow(const QByteArray &resource, QWindow *window) const; + void *handlerNativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) const; +}; + +QT_END_NAMESPACE + +#endif // QXCBNATIVEINTERFACE_H diff --git a/xcb/libqt6xcbqpa-dev/6.6.2/qxcbobject.h b/xcb/libqt6xcbqpa-dev/6.6.2/qxcbobject.h new file mode 100644 index 00000000..965ec636 --- /dev/null +++ b/xcb/libqt6xcbqpa-dev/6.6.2/qxcbobject.h @@ -0,0 +1,28 @@ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +#ifndef QXCBOBJECT_H +#define QXCBOBJECT_H + +#include "qxcbconnection.h" + +QT_BEGIN_NAMESPACE + +class QXcbObject +{ +public: + QXcbObject(QXcbConnection *connection = nullptr) : m_connection(connection) {} + + void setConnection(QXcbConnection *connection) { m_connection = connection; } + QXcbConnection *connection() const { return m_connection; } + + xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } + xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } + +private: + QXcbConnection *m_connection; +}; + +QT_END_NAMESPACE + +#endif diff --git a/xcb/libqt6xcbqpa-dev/6.6.2/qxcbscreen.h b/xcb/libqt6xcbqpa-dev/6.6.2/qxcbscreen.h new file mode 100644 index 00000000..49165d3b --- /dev/null +++ b/xcb/libqt6xcbqpa-dev/6.6.2/qxcbscreen.h @@ -0,0 +1,232 @@ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +#ifndef QXCBSCREEN_H +#define QXCBSCREEN_H + +#include +#include +#include + +#include +#include +#include + +#include "qxcbobject.h" + +#include + +#include + +#include + +QT_BEGIN_NAMESPACE + +class QXcbConnection; +class QXcbCursor; +class QXcbXSettings; +#ifndef QT_NO_DEBUG_STREAM +class QDebug; +#endif + +class QXcbVirtualDesktop : public QXcbObject +{ +public: + QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t *screen, int number); + ~QXcbVirtualDesktop(); + + xcb_screen_t *screen() const { return m_screen; } + int number() const { return m_number; } + QSize size() const { return QSize(m_screen->width_in_pixels, m_screen->height_in_pixels); } + QSize physicalSize() const { return QSize(m_screen->width_in_millimeters, m_screen->height_in_millimeters); } + QDpi dpi() const; + xcb_window_t root() const { return m_screen->root; } + QXcbScreen *screenAt(const QPoint &pos) const; + + QList screens() const { return m_screens; } + void setScreens(QList &&sl) { m_screens = std::move(sl); } + void removeScreen(QPlatformScreen *s) { m_screens.removeOne(s); } + void addScreen(QPlatformScreen *s); + void setPrimaryScreen(QPlatformScreen *s); + + QXcbXSettings *xSettings() const; + + bool compositingActive() const; + + void updateWorkArea(); + QRect availableGeometry(const QRect &screenGeometry) const; + + void handleXFixesSelectionNotify(xcb_xfixes_selection_notify_event_t *notify_event); + void subscribeToXFixesSelectionNotify(); + + void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); + + int forcedDpi() const { return m_forcedDpi; } + QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } + QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; } + int antialiasingEnabled() const { return m_antialiasingEnabled; } + + QString windowManagerName() const { return m_windowManagerName; } + + QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; + + const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const; + const xcb_visualtype_t *visualForId(xcb_visualid_t) const; + quint8 depthOfVisual(xcb_visualid_t) const; + xcb_colormap_t colormapForVisual(xcb_visualid_t) const; + +private: + QRect getWorkArea() const; + + static bool xResource(const QByteArray &identifier, + const QByteArray &expectedIdentifier, + QByteArray &stringValue); + void readXResources(); + + bool setDpiFromXSettings(const QVariant &property); + + xcb_screen_t *m_screen; + const int m_number; + QList m_screens; + + QXcbXSettings *m_xSettings = nullptr; + xcb_atom_t m_net_wm_cm_atom = 0; + bool m_compositingActive = false; + + QRect m_workArea; + + int m_forcedDpi = -1; + QFontEngine::HintStyle m_hintStyle = QFontEngine::HintStyle(-1); + QFontEngine::SubpixelAntialiasingType m_subpixelType = QFontEngine::SubpixelAntialiasingType(-1); + int m_antialiasingEnabled = -1; + QString m_windowManagerName; + QMap m_visuals; + QMap m_visualDepths; + mutable QMap m_visualColormaps; + uint16_t m_rotation = 0; + + friend class QXcbConnection; +}; + +class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen + , public QNativeInterface::Private::QXcbScreen +{ +public: + QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, + xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); + QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, + xcb_randr_monitor_info_t *monitorInfo, xcb_timestamp_t timestamp = XCB_NONE); + ~QXcbScreen(); + + QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); + QString getName(xcb_randr_monitor_info_t *monitorInfo); + + QPixmap grabWindow(WId window, int x, int y, int width, int height) const override; + + QWindow *topLevelAt(const QPoint &point) const override; + + QString manufacturer() const override; + QString model() const override; + QString serialNumber() const override; + + QRect geometry() const override { return m_geometry; } + QRect availableGeometry() const override; + int depth() const override { return screen()->root_depth; } + QImage::Format format() const override; + QColorSpace colorSpace() const override { return m_colorSpace; } + QSizeF physicalSize() const override { return m_sizeMillimeters; } + QDpi logicalDpi() const override; + QDpi logicalBaseDpi() const override { return QDpi(96, 96); } + QPlatformCursor *cursor() const override; + qreal refreshRate() const override { return m_refreshRate; } + Qt::ScreenOrientation orientation() const override { return m_orientation; } + QList virtualSiblings() const override { return m_virtualDesktop->screens(); } + QXcbVirtualDesktop *virtualDesktop() const { return m_virtualDesktop; } + + void setPrimary(bool primary) { m_primary = primary; } + bool isPrimary() const { return m_primary; } + + int screenNumber() const { return m_virtualDesktop->number(); } + int virtualDesktopNumber() const override { return screenNumber(); } + + xcb_screen_t *screen() const { return m_virtualDesktop->screen(); } + xcb_window_t root() const { return screen()->root; } + xcb_randr_output_t output() const { return m_output; } + xcb_randr_crtc_t crtc() const { return m_crtc; } + xcb_randr_mode_t mode() const { return m_mode; } + + QList outputs() const { return m_outputs; } + QList crtcs() const { return m_crtcs; } + + void setOutput(xcb_randr_output_t outputId, + xcb_randr_get_output_info_reply_t *outputInfo); + void setCrtc(xcb_randr_crtc_t crtc) { m_crtc = crtc; } + void setMonitor(xcb_randr_monitor_info_t *monitorInfo, xcb_timestamp_t timestamp = XCB_NONE); + QString defaultName(); + bool isPrimaryInXScreen(); + + void windowShown(QXcbWindow *window); + QString windowManagerName() const { return m_virtualDesktop->windowManagerName(); } + + QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; + + const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const { return m_virtualDesktop->visualForFormat(format); } + const xcb_visualtype_t *visualForId(xcb_visualid_t visualid) const; + xcb_colormap_t colormapForVisual(xcb_visualid_t visualid) const { return m_virtualDesktop->colormapForVisual(visualid); } + quint8 depthOfVisual(xcb_visualid_t visualid) const { return m_virtualDesktop->depthOfVisual(visualid); } + + QString name() const override { return m_outputName; } + + void updateGeometry(const QRect &geometry, uint8_t rotation); + void updateGeometry(xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME); + void updateAvailableGeometry(); + void updateRefreshRate(xcb_randr_mode_t mode); + + QFontEngine::HintStyle hintStyle() const { return m_virtualDesktop->hintStyle(); } + QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_virtualDesktop->subpixelType(); } + int antialiasingEnabled() const { return m_virtualDesktop->antialiasingEnabled(); } + + QXcbXSettings *xSettings() const; + +private: + void sendStartupMessage(const QByteArray &message) const; + int forcedDpi() const; + + void updateColorSpaceAndEdid(); + QByteArray getOutputProperty(xcb_atom_t atom) const; + QByteArray getEdid() const; + + QXcbVirtualDesktop *m_virtualDesktop; + xcb_randr_monitor_info_t *m_monitor; + xcb_randr_output_t m_output; + xcb_randr_crtc_t m_crtc; + xcb_randr_mode_t m_mode = XCB_NONE; + bool m_primary = false; + + bool m_singlescreen = false; + + QList m_outputs; + QList m_crtcs; + + QString m_outputName; + QSizeF m_outputSizeMillimeters; + QSizeF m_sizeMillimeters; + QRect m_geometry; + QRect m_availableGeometry; + QColorSpace m_colorSpace; + Qt::ScreenOrientation m_orientation = Qt::PrimaryOrientation; + std::unique_ptr m_cursor; + qreal m_refreshRate = 60.0; + QEdidParser m_edid; + + friend class QXcbConnection; + friend class QXcbVirtualDesktop; +}; + +#ifndef QT_NO_DEBUG_STREAM +Q_GUI_EXPORT QDebug operator<<(QDebug, const QXcbScreen *); +#endif + +QT_END_NAMESPACE + +#endif diff --git a/xcb/libqt6xcbqpa-dev/6.6.2/qxcbscrollingdevice_p.h b/xcb/libqt6xcbqpa-dev/6.6.2/qxcbscrollingdevice_p.h new file mode 100644 index 00000000..3ee0c06a --- /dev/null +++ b/xcb/libqt6xcbqpa-dev/6.6.2/qxcbscrollingdevice_p.h @@ -0,0 +1,56 @@ +// Copyright (C) 2020 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +#ifndef QXCBSCROLLINGDEVICE_P_H +#define QXCBSCROLLINGDEVICE_P_H + +#include + +QT_BEGIN_NAMESPACE + +class QXcbScrollingDevicePrivate : public QPointingDevicePrivate +{ + Q_DECLARE_PUBLIC(QPointingDevice) +public: + QXcbScrollingDevicePrivate(const QString &name, qint64 id, QPointingDevice::Capabilities caps, + int buttonCount = 3, const QString &seatName = QString()); + + // scrolling-related data + int verticalIndex = 0; + int horizontalIndex = 0; + double verticalIncrement = 0; + double horizontalIncrement = 0; + Qt::Orientations orientations; + Qt::Orientations legacyOrientations; + mutable QPointF lastScrollPosition; + // end of scrolling-related data +}; + +class QXcbScrollingDevice : public QPointingDevice +{ + Q_OBJECT +public: + QXcbScrollingDevice(QXcbScrollingDevicePrivate &d, QObject *parent) + : QPointingDevice(d, parent) {} + + QXcbScrollingDevice(const QString &name, qint64 deviceId, Capabilities caps, int buttonCount, + const QString &seatName = QString(), QObject *parent = nullptr) + : QPointingDevice(*new QXcbScrollingDevicePrivate(name, deviceId, caps, buttonCount, seatName), parent) + { + } + + inline static QXcbScrollingDevicePrivate *get(QXcbScrollingDevice *q) + { + return static_cast(QObjectPrivate::get(q)); + } + + inline static const QXcbScrollingDevicePrivate *get(const QXcbScrollingDevice *q) + { + return static_cast(QObjectPrivate::get(q)); + } + +}; + +QT_END_NAMESPACE + +#endif // QXCBSCROLLINGDEVICE_P_H diff --git a/xcb/libqt6xcbqpa-dev/6.6.2/qxcbsessionmanager.h b/xcb/libqt6xcbqpa-dev/6.6.2/qxcbsessionmanager.h new file mode 100644 index 00000000..10759319 --- /dev/null +++ b/xcb/libqt6xcbqpa-dev/6.6.2/qxcbsessionmanager.h @@ -0,0 +1,58 @@ +// Copyright (C) 2013 Teo Mrnjavac +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +#ifndef QXCBSESSIONMANAGER_H +#define QXCBSESSIONMANAGER_H + +// +// W A R N I N G +// ------------- +// +// This file is part of the QPA API and is not meant to be used +// in applications. Usage of this API may make your code +// source and binary incompatible with future versions of Qt. +// + +#include + +#ifndef QT_NO_SESSIONMANAGER + +QT_BEGIN_NAMESPACE + +class QEventLoop; + +class QXcbSessionManager : public QPlatformSessionManager +{ +public: + QXcbSessionManager(const QString &id, const QString &key); + virtual ~QXcbSessionManager(); + + void *handle() const; + + void setSessionId(const QString &id) { m_sessionId = id; } + void setSessionKey(const QString &key) { m_sessionKey = key; } + + bool allowsInteraction() override; + bool allowsErrorInteraction() override; + void release() override; + + void cancel() override; + + void setManagerProperty(const QString &name, const QString &value) override; + void setManagerProperty(const QString &name, const QStringList &value) override; + + bool isPhase2() const override; + void requestPhase2() override; + + void exitEventLoop(); + +private: + QEventLoop *m_eventLoop; +}; + +QT_END_NAMESPACE + +#endif //QT_NO_SESSIONMANAGER + +#endif //QXCBSESSIONMANAGER_H diff --git a/xcb/libqt6xcbqpa-dev/6.6.2/qxcbsystemtraytracker.h b/xcb/libqt6xcbqpa-dev/6.6.2/qxcbsystemtraytracker.h new file mode 100644 index 00000000..5c054626 --- /dev/null +++ b/xcb/libqt6xcbqpa-dev/6.6.2/qxcbsystemtraytracker.h @@ -0,0 +1,49 @@ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +#ifndef QXCBSYSTEMTRAYTRACKER_H +#define QXCBSYSTEMTRAYTRACKER_H + +#include "qxcbconnection.h" + +#include + +QT_BEGIN_NAMESPACE + +class QXcbConnection; +class QScreen; + +class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener +{ + Q_OBJECT +public: + static QXcbSystemTrayTracker *create(QXcbConnection *connection); + + xcb_window_t trayWindow(); + void requestSystemTrayWindowDock(xcb_window_t window) const; + + void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); + + void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) override; + + xcb_visualid_t visualId(); +signals: + void systemTrayWindowChanged(QScreen *screen); + +private: + explicit QXcbSystemTrayTracker(QXcbConnection *connection, + xcb_atom_t trayAtom, + xcb_atom_t selection); + + void emitSystemTrayWindowChanged(); + xcb_visualid_t netSystemTrayVisual(); + + const xcb_atom_t m_selection; + const xcb_atom_t m_trayAtom; + QXcbConnection *m_connection; + xcb_window_t m_trayWindow = 0; +}; + +QT_END_NAMESPACE + +#endif // QXCBSYSTEMTRAYTRACKER_H diff --git a/xcb/libqt6xcbqpa-dev/6.6.2/qxcbvulkaninstance.h b/xcb/libqt6xcbqpa-dev/6.6.2/qxcbvulkaninstance.h new file mode 100644 index 00000000..445cd706 --- /dev/null +++ b/xcb/libqt6xcbqpa-dev/6.6.2/qxcbvulkaninstance.h @@ -0,0 +1,40 @@ +// Copyright (C) 2017 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +#ifndef QXCBVULKANINSTANCE_H +#define QXCBVULKANINSTANCE_H + +#if defined(VULKAN_H_) && !defined(VK_USE_PLATFORM_XCB_KHR) +#error "vulkan.h included without xcb WSI" +#endif + +#define VK_USE_PLATFORM_XCB_KHR + +#include +#include + +QT_BEGIN_NAMESPACE + +class QXcbWindow; + +class QXcbVulkanInstance : public QBasicPlatformVulkanInstance +{ +public: + QXcbVulkanInstance(QVulkanInstance *instance); + ~QXcbVulkanInstance(); + + void createOrAdoptInstance() override; + bool supportsPresent(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, QWindow *window) override; + void presentQueued(QWindow *window) override; + + VkSurfaceKHR createSurface(QXcbWindow *window); + +private: + QVulkanInstance *m_instance; + PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR m_getPhysDevPresSupport; + PFN_vkCreateXcbSurfaceKHR m_createSurface; +}; + +QT_END_NAMESPACE + +#endif // QXCBVULKANINSTANCE_H diff --git a/xcb/libqt6xcbqpa-dev/6.6.2/qxcbvulkanwindow.h b/xcb/libqt6xcbqpa-dev/6.6.2/qxcbvulkanwindow.h new file mode 100644 index 00000000..377acd2e --- /dev/null +++ b/xcb/libqt6xcbqpa-dev/6.6.2/qxcbvulkanwindow.h @@ -0,0 +1,29 @@ +// Copyright (C) 2017 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +#ifndef QXCBVULKANWINDOW_H +#define QXCBVULKANWINDOW_H + +#include "qxcbwindow.h" +#include "qxcbvulkaninstance.h" + +QT_BEGIN_NAMESPACE + +class QXcbVulkanWindow : public QXcbWindow +{ +public: + QXcbVulkanWindow(QWindow *window); + ~QXcbVulkanWindow(); + + VkSurfaceKHR *surface(); + +protected: + void resolveFormat(const QSurfaceFormat &format) override; + +private: + VkSurfaceKHR m_surface; +}; + +QT_END_NAMESPACE + +#endif // QXCBVULKANWINDOW_H diff --git a/xcb/libqt6xcbqpa-dev/6.6.2/qxcbwindow.h b/xcb/libqt6xcbqpa-dev/6.6.2/qxcbwindow.h new file mode 100644 index 00000000..415dff09 --- /dev/null +++ b/xcb/libqt6xcbqpa-dev/6.6.2/qxcbwindow.h @@ -0,0 +1,283 @@ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +#ifndef QXCBWINDOW_H +#define QXCBWINDOW_H + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "qxcbobject.h" + +QT_BEGIN_NAMESPACE + +class QXcbScreen; +class QXcbSyncWindowRequest; +class QIcon; + +class Q_XCB_EXPORT QXcbWindow : public QObject, public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow + , public QNativeInterface::Private::QXcbWindow +{ + Q_OBJECT +public: + enum NetWmState { + NetWmStateAbove = 0x1, + NetWmStateBelow = 0x2, + NetWmStateFullScreen = 0x4, + NetWmStateMaximizedHorz = 0x8, + NetWmStateMaximizedVert = 0x10, + NetWmStateModal = 0x20, + NetWmStateStaysOnTop = 0x40, + NetWmStateDemandsAttention = 0x80, + NetWmStateHidden = 0x100 + }; + + Q_DECLARE_FLAGS(NetWmStates, NetWmState) + + enum RecreationReason { + RecreationNotNeeded = 0, + WindowStaysOnTopHintChanged = 0x1, + WindowStaysOnBottomHintChanged = 0x2 + }; + Q_DECLARE_FLAGS(RecreationReasons, RecreationReason) + + QXcbWindow(QWindow *window); + ~QXcbWindow(); + + void setGeometry(const QRect &rect) override; + + QMargins frameMargins() const override; + + void setVisible(bool visible) override; + void setWindowFlags(Qt::WindowFlags flags) override; + void setWindowState(Qt::WindowStates state) override; + WId winId() const override; + void setParent(const QPlatformWindow *window) override; + + bool isExposed() const override; + bool isEmbedded() const override; + QPoint mapToGlobal(const QPoint &pos) const override; + QPoint mapFromGlobal(const QPoint &pos) const override; + + void setWindowTitle(const QString &title) override; + void setWindowIconText(const QString &title) override; + void setWindowIcon(const QIcon &icon) override; + void raise() override; + void lower() override; + void propagateSizeHints() override; + + void requestActivateWindow() override; + + bool setKeyboardGrabEnabled(bool grab) override; + bool setMouseGrabEnabled(bool grab) override; + + QSurfaceFormat format() const override; + + bool windowEvent(QEvent *event) override; + + bool startSystemResize(Qt::Edges edges) override; + bool startSystemMove() override; + + void setOpacity(qreal level) override; + void setMask(const QRegion ®ion) override; + + void setAlertState(bool enabled) override; + bool isAlertState() const override { return m_alertState; } + + xcb_window_t xcb_window() const { return m_window; } + uint depth() const { return m_depth; } + QImage::Format imageFormat() const { return m_imageFormat; } + bool imageNeedsRgbSwap() const { return m_imageRgbSwap; } + + bool handleNativeEvent(xcb_generic_event_t *event) override; + + void handleExposeEvent(const xcb_expose_event_t *event) override; + void handleClientMessageEvent(const xcb_client_message_event_t *event) override; + void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) override; + void handleMapNotifyEvent(const xcb_map_notify_event_t *event) override; + void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) override; + void handleButtonPressEvent(const xcb_button_press_event_t *event) override; + void handleButtonReleaseEvent(const xcb_button_release_event_t *event) override; + void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) override; + + void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) override; + void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) override; + void handleFocusInEvent(const xcb_focus_in_event_t *event) override; + void handleFocusOutEvent(const xcb_focus_out_event_t *event) override; + void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; + void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized) override; + void handleXIEnterLeave(xcb_ge_event_t *) override; + + QXcbWindow *toWindow() override; + + void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, + Qt::KeyboardModifiers modifiers, QEvent::Type type, Qt::MouseEventSource source); + + void updateNetWmUserTime(xcb_timestamp_t timestamp); + void updateWmTransientFor(); + void registerWmTransientForChild(QXcbWindow *); + + WindowTypes wmWindowTypes() const; + void setWmWindowType(WindowTypes types, Qt::WindowFlags flags); + void setWindowType(WindowTypes windowTypes) override { setWmWindowType(windowTypes, window()->flags()); } + void setWindowRole(const QString &role) override; + + void setParentRelativeBackPixmap(); + bool requestSystemTrayWindowDock(); + uint visualId() const override; + + bool needsSync() const; + + void postSyncWindowRequest(); + void clearSyncWindowRequest() { m_pendingSyncRequest = nullptr; } + + QXcbScreen *xcbScreen() const; + + QPoint lastPointerPosition() const { return m_lastPointerPosition; } + QPoint lastPointerGlobalPosition() const { return m_lastPointerGlobalPosition; } + + bool startSystemMoveResize(const QPoint &pos, int edges); + void doStartSystemMoveResize(const QPoint &globalPos, int edges); + + static bool isTrayIconWindow(QWindow *window) + { + return window->objectName() == QLatin1StringView("QSystemTrayIconSysWindow"); + } + + virtual void create(); + virtual void destroy(); + + static void setWindowTitle(const QXcbConnection *conn, xcb_window_t window, const QString &title); + static QString windowTitle(const QXcbConnection *conn, xcb_window_t window); + + int swapInterval() const { return m_swapInterval; } + void setSwapInterval(int swapInterval) { m_swapInterval = swapInterval; } + +public Q_SLOTS: + void updateSyncRequestCounter(); + +protected: + virtual void resolveFormat(const QSurfaceFormat &format) { m_format = format; } + virtual const xcb_visualtype_t *createVisual(); + void setImageFormatForVisual(const xcb_visualtype_t *visual); + + QXcbScreen *parentScreen(); + QXcbScreen *initialScreen() const; + + void setNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); + void setNetWmState(Qt::WindowFlags flags); + void setNetWmState(Qt::WindowStates state); + void setNetWmStateOnUnmappedWindow(); + NetWmStates netWmStates(); + + void setMotifWmHints(Qt::WindowFlags flags); + + void setTransparentForMouseEvents(bool transparent); + void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); + + void sendXEmbedMessage(xcb_window_t window, quint32 message, + quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); + void handleXEmbedMessage(const xcb_client_message_event_t *event); + + void show(); + void hide(); + + bool relayFocusToModalWindow() const; + void doFocusIn(); + void doFocusOut(); + + void handleButtonPressEvent(int event_x, int event_y, int root_x, int root_y, + int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, + QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); + + void handleButtonReleaseEvent(int event_x, int event_y, int root_x, int root_y, + int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, + QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); + + void handleMotionNotifyEvent(int event_x, int event_y, int root_x, int root_y, + Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, + QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); + + void handleEnterNotifyEvent(int event_x, int event_y, int root_x, int root_y, + quint8 mode, quint8 detail, xcb_timestamp_t timestamp); + + void handleLeaveNotifyEvent(int root_x, int root_y, + quint8 mode, quint8 detail, xcb_timestamp_t timestamp); + + xcb_window_t m_window = 0; + + uint m_depth = 0; + QImage::Format m_imageFormat = QImage::Format_ARGB32_Premultiplied; + bool m_imageRgbSwap = false; + + xcb_sync_int64_t m_syncValue; + xcb_sync_counter_t m_syncCounter = 0; + + Qt::WindowStates m_windowState = Qt::WindowNoState; + + QMutex m_mappedMutex; + bool m_mapped = false; + bool m_transparent = false; + bool m_deferredActivation = false; + bool m_embedded = false; + bool m_alertState = false; + bool m_minimized = false; + bool m_trayIconWindow = false; + xcb_window_t m_netWmUserTimeWindow = XCB_NONE; + + QSurfaceFormat m_format; + + mutable bool m_dirtyFrameMargins = false; + mutable QMargins m_frameMargins; + + QRegion m_exposeRegion; + QSize m_oldWindowSize; + QPoint m_lastPointerPosition; + QPoint m_lastPointerGlobalPosition; + + xcb_visualid_t m_visualId = 0; + // Last sent state. Initialized to an invalid state, on purpose. + Qt::WindowStates m_lastWindowStateEvent = Qt::WindowActive; + + enum SyncState { + NoSyncNeeded, + SyncReceived, + SyncAndConfigureReceived + }; + SyncState m_syncState = NoSyncNeeded; + + QXcbSyncWindowRequest *m_pendingSyncRequest = nullptr; + int m_swapInterval = -1; + + qreal m_sizeHintsScaleFactor = 1.0; + + RecreationReasons m_recreationReasons = RecreationNotNeeded; + + QList> m_wmTransientForChildren; +}; + +class QXcbForeignWindow : public QXcbWindow +{ +public: + QXcbForeignWindow(QWindow *window, WId nativeHandle); + ~QXcbForeignWindow(); + bool isForeignWindow() const override { return true; } + +protected: + void create() override {} // No-op +}; + +QList qRegionToXcbRectangleList(const QRegion ®ion); + +QT_END_NAMESPACE + +Q_DECLARE_METATYPE(QXcbWindow*) + +#endif diff --git a/xcb/libqt6xcbqpa-dev/6.6.2/qxcbwmsupport.h b/xcb/libqt6xcbqpa-dev/6.6.2/qxcbwmsupport.h new file mode 100644 index 00000000..77ad55c4 --- /dev/null +++ b/xcb/libqt6xcbqpa-dev/6.6.2/qxcbwmsupport.h @@ -0,0 +1,32 @@ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +#ifndef QXCBWMSUPPORT_H +#define QXCBWMSUPPORT_H + +#include "qxcbobject.h" +#include "qxcbconnection.h" +#include + +QT_BEGIN_NAMESPACE + +class QXcbWMSupport : public QXcbObject +{ +public: + QXcbWMSupport(QXcbConnection *c); + + + bool isSupportedByWM(xcb_atom_t atom) const; + const QList &virtualRoots() const { return net_virtual_roots; } + +private: + friend class QXcbConnection; + void updateNetWMAtoms(); + void updateVirtualRoots(); + + QList net_wm_atoms; + QList net_virtual_roots; +}; + +QT_END_NAMESPACE + +#endif diff --git a/xcb/libqt6xcbqpa-dev/6.6.2/qxcbxsettings.h b/xcb/libqt6xcbqpa-dev/6.6.2/qxcbxsettings.h new file mode 100644 index 00000000..efcaae8a --- /dev/null +++ b/xcb/libqt6xcbqpa-dev/6.6.2/qxcbxsettings.h @@ -0,0 +1,35 @@ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +#ifndef QXCBXSETTINGS_H +#define QXCBXSETTINGS_H + +#include "qxcbscreen.h" + +QT_BEGIN_NAMESPACE + +class QXcbXSettingsPrivate; + +class QXcbXSettings : public QXcbWindowEventListener +{ + Q_DECLARE_PRIVATE(QXcbXSettings) +public: + QXcbXSettings(QXcbVirtualDesktop *screen); + ~QXcbXSettings(); + bool initialized() const; + + QVariant setting(const QByteArray &property) const; + + typedef void (*PropertyChangeFunc)(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); + void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); + void removeCallbackForHandle(const QByteArray &property, void *handle); + void removeCallbackForHandle(void *handle); + + void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; +private: + QXcbXSettingsPrivate *d_ptr; +}; + +QT_END_NAMESPACE + +#endif // QXCBXSETTINGS_H diff --git a/xcb/linux.cmake b/xcb/linux.cmake index 940361d4..526140ea 100644 --- a/xcb/linux.cmake +++ b/xcb/linux.cmake @@ -72,17 +72,25 @@ else() add_definitions(-DXCB_USE_RENDER) endif() -if(${QT_VERSION_MAJOR} STREQUAL "5") - list(GET Qt5Core_INCLUDE_DIRS 0 dir) - if(EXISTS ${dir}QtXcb/${Qt5_VERSION}/QtXcb/private) - include_directories(${dir}QtXcb/${Qt5_VERSION}/QtXcb/private) - elseif(EXISTS ${QT_XCB_PRIVATE_HEADERS}) - include_directories(${QT_XCB_PRIVATE_HEADERS}) - elseif(EXISTS ${CMAKE_CURRENT_LIST_DIR}/libqt5xcbqpa-dev/${Qt5_VERSION}) - include_directories(${CMAKE_CURRENT_LIST_DIR}/libqt5xcbqpa-dev/${Qt5_VERSION}) +if(EXISTS ${QT_XCB_PRIVATE_HEADERS}) + include_directories(${QT_XCB_PRIVATE_HEADERS}) +else() + if(${QT_VERSION_MAJOR} STREQUAL "5") + list(GET Qt5Core_INCLUDE_DIRS 0 dir) + if(EXISTS ${dir}QtXcb/${Qt5_VERSION}/QtXcb/private) + include_directories(${dir}QtXcb/${Qt5_VERSION}/QtXcb/private) + elseif(EXISTS ${CMAKE_CURRENT_LIST_DIR}/libqt5xcbqpa-dev/${Qt5_VERSION}) + include_directories(${CMAKE_CURRENT_LIST_DIR}/libqt5xcbqpa-dev/${Qt5_VERSION}) + else() + message(FATAL_ERROR "Not support Qt Version: ${Qt5_VERSION}") + endif() + elseif(${QT_VERSION_MAJOR} STREQUAL "6") + if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/libqt6xcbqpa-dev/${Qt6_VERSION}) + include_directories(${CMAKE_CURRENT_LIST_DIR}/libqt6xcbqpa-dev/${Qt6_VERSION}) + else() + message(FATAL_ERROR "Not support Qt Version: ${Qt6_VERSION}") + endif() else() - message(FATAL_ERROR "Not support Qt Version: ${Qt5_VERSION}") + message(FATAL_ERROR "Not support Qt Version: ${QT_VERSION_MAJOR}") endif() -else() - include_directories(${CMAKE_CURRENT_LIST_DIR}/libqt6xcbqpa-dev/${Qt6_VERSION}) endif() diff --git a/xcb/windoweventhook.cpp b/xcb/windoweventhook.cpp index f1bf8174..9589013c 100644 --- a/xcb/windoweventhook.cpp +++ b/xcb/windoweventhook.cpp @@ -2,6 +2,16 @@ // // SPDX-License-Identifier: LGPL-3.0-or-later +// Fix compilation issue with multi-herited QXcbWindow since 6.6.2 +#include +QT_BEGIN_NAMESPACE +class QXcbWindow; +class QPlatformWindow; +inline QDebug operator<<(QDebug dbg, const QXcbWindow *window) { + return dbg << (const QPlatformWindow*)(window); +} +QT_END_NAMESPACE + #include "windoweventhook.h" #include "vtablehook.h" #include "utility.h"