diff options
Diffstat (limited to 'src/platformsupport')
71 files changed, 2547 insertions, 460 deletions
diff --git a/src/platformsupport/devicediscovery/qdevicediscovery_dummy_p.h b/src/platformsupport/devicediscovery/qdevicediscovery_dummy_p.h index fea3a06cbd..fe669c8dec 100644 --- a/src/platformsupport/devicediscovery/qdevicediscovery_dummy_p.h +++ b/src/platformsupport/devicediscovery/qdevicediscovery_dummy_p.h @@ -61,7 +61,7 @@ class QDeviceDiscoveryDummy : public QDeviceDiscovery public: QDeviceDiscoveryDummy(QDeviceTypes types, QObject *parent = 0); - QStringList scanConnectedDevices() Q_DECL_OVERRIDE; + QStringList scanConnectedDevices() override; }; QT_END_NAMESPACE diff --git a/src/platformsupport/devicediscovery/qdevicediscovery_static_p.h b/src/platformsupport/devicediscovery/qdevicediscovery_static_p.h index ab5a9c6f12..93110c3c55 100644 --- a/src/platformsupport/devicediscovery/qdevicediscovery_static_p.h +++ b/src/platformsupport/devicediscovery/qdevicediscovery_static_p.h @@ -61,7 +61,7 @@ class QDeviceDiscoveryStatic : public QDeviceDiscovery public: QDeviceDiscoveryStatic(QDeviceTypes types, QObject *parent = 0); - QStringList scanConnectedDevices() Q_DECL_OVERRIDE; + QStringList scanConnectedDevices() override; private: bool checkDeviceType(const QString &device); diff --git a/src/platformsupport/devicediscovery/qdevicediscovery_udev_p.h b/src/platformsupport/devicediscovery/qdevicediscovery_udev_p.h index 3c53ef3f17..28618d0b21 100644 --- a/src/platformsupport/devicediscovery/qdevicediscovery_udev_p.h +++ b/src/platformsupport/devicediscovery/qdevicediscovery_udev_p.h @@ -63,7 +63,7 @@ class QDeviceDiscoveryUDev : public QDeviceDiscovery public: QDeviceDiscoveryUDev(QDeviceTypes types, struct udev *udev, QObject *parent = 0); ~QDeviceDiscoveryUDev(); - QStringList scanConnectedDevices() Q_DECL_OVERRIDE; + QStringList scanConnectedDevices() override; private slots: void handleUDevNotification(); diff --git a/src/platformsupport/edid/qedidvendortable_p.h b/src/platformsupport/edid/qedidvendortable_p.h index d09642d649..948a9cecfc 100644 --- a/src/platformsupport/edid/qedidvendortable_p.h +++ b/src/platformsupport/edid/qedidvendortable_p.h @@ -47,6 +47,15 @@ #ifndef QEDIDVENDORTABLE_P_H #define QEDIDVENDORTABLE_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// + QT_BEGIN_NAMESPACE typedef struct VendorTable { diff --git a/src/platformsupport/eglconvenience/qeglpbuffer_p.h b/src/platformsupport/eglconvenience/qeglpbuffer_p.h index 38370c0e62..eed8cd9dca 100644 --- a/src/platformsupport/eglconvenience/qeglpbuffer_p.h +++ b/src/platformsupport/eglconvenience/qeglpbuffer_p.h @@ -63,8 +63,8 @@ public: QEGLPlatformContext::Flags flags = 0); ~QEGLPbuffer(); - QSurfaceFormat format() const Q_DECL_OVERRIDE { return m_format; } - bool isValid() const Q_DECL_OVERRIDE { return m_pbuffer != EGL_NO_SURFACE; } + QSurfaceFormat format() const override { return m_format; } + bool isValid() const override { return m_pbuffer != EGL_NO_SURFACE; } EGLSurface pbuffer() const { return m_pbuffer; } diff --git a/src/platformsupport/eglconvenience/qeglplatformcontext_p.h b/src/platformsupport/eglconvenience/qeglplatformcontext_p.h index 9d41eecd99..d6cbbe4131 100644 --- a/src/platformsupport/eglconvenience/qeglplatformcontext_p.h +++ b/src/platformsupport/eglconvenience/qeglplatformcontext_p.h @@ -72,15 +72,15 @@ public: Flags flags = 0); ~QEGLPlatformContext(); - void initialize() Q_DECL_OVERRIDE; - bool makeCurrent(QPlatformSurface *surface) Q_DECL_OVERRIDE; - void doneCurrent() Q_DECL_OVERRIDE; - void swapBuffers(QPlatformSurface *surface) Q_DECL_OVERRIDE; - QFunctionPointer getProcAddress(const char *procName) Q_DECL_OVERRIDE; + void initialize() override; + bool makeCurrent(QPlatformSurface *surface) override; + void doneCurrent() override; + void swapBuffers(QPlatformSurface *surface) override; + QFunctionPointer getProcAddress(const char *procName) override; - QSurfaceFormat format() const Q_DECL_OVERRIDE; - bool isSharing() const Q_DECL_OVERRIDE { return m_shareContext != EGL_NO_CONTEXT; } - bool isValid() const Q_DECL_OVERRIDE { return m_eglContext != EGL_NO_CONTEXT; } + QSurfaceFormat format() const override; + bool isSharing() const override { return m_shareContext != EGL_NO_CONTEXT; } + bool isValid() const override { return m_eglContext != EGL_NO_CONTEXT; } EGLContext eglContext() const; EGLDisplay eglDisplay() const; diff --git a/src/platformsupport/eventdispatchers/qeventdispatcher_glib_p.h b/src/platformsupport/eventdispatchers/qeventdispatcher_glib_p.h index bed2532856..5930dc68e7 100644 --- a/src/platformsupport/eventdispatchers/qeventdispatcher_glib_p.h +++ b/src/platformsupport/eventdispatchers/qeventdispatcher_glib_p.h @@ -67,7 +67,7 @@ public: explicit QPAEventDispatcherGlib(QObject *parent = 0); ~QPAEventDispatcherGlib(); - bool processEvents(QEventLoop::ProcessEventsFlags flags) Q_DECL_OVERRIDE; + bool processEvents(QEventLoop::ProcessEventsFlags flags) override; QEventLoop::ProcessEventsFlags m_flags; }; diff --git a/src/platformsupport/eventdispatchers/qwindowsguieventdispatcher_p.h b/src/platformsupport/eventdispatchers/qwindowsguieventdispatcher_p.h index 9a23b5c0bd..4ff047a60e 100644 --- a/src/platformsupport/eventdispatchers/qwindowsguieventdispatcher_p.h +++ b/src/platformsupport/eventdispatchers/qwindowsguieventdispatcher_p.h @@ -63,8 +63,8 @@ public: static const char *windowsMessageName(UINT msg); - bool QT_ENSURE_STACK_ALIGNED_FOR_SSE processEvents(QEventLoop::ProcessEventsFlags flags) Q_DECL_OVERRIDE; - void sendPostedEvents() Q_DECL_OVERRIDE; + bool QT_ENSURE_STACK_ALIGNED_FOR_SSE processEvents(QEventLoop::ProcessEventsFlags flags) override; + void sendPostedEvents() override; private: QEventLoop::ProcessEventsFlags m_flags; diff --git a/src/platformsupport/fbconvenience/qfbbackingstore_p.h b/src/platformsupport/fbconvenience/qfbbackingstore_p.h index c8dfe3489c..c4762c9327 100644 --- a/src/platformsupport/fbconvenience/qfbbackingstore_p.h +++ b/src/platformsupport/fbconvenience/qfbbackingstore_p.h @@ -66,10 +66,10 @@ public: QFbBackingStore(QWindow *window); ~QFbBackingStore(); - QPaintDevice *paintDevice() Q_DECL_OVERRIDE { return &mImage; } - void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) Q_DECL_OVERRIDE; + QPaintDevice *paintDevice() override { return &mImage; } + void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; - void resize(const QSize &size, const QRegion ®ion) Q_DECL_OVERRIDE; + void resize(const QSize &size, const QRegion ®ion) override; const QImage image(); QImage toImage() const override; @@ -77,8 +77,8 @@ public: void lock(); void unlock(); - void beginPaint(const QRegion &) Q_DECL_OVERRIDE; - void endPaint() Q_DECL_OVERRIDE; + void beginPaint(const QRegion &) override; + void endPaint() override; protected: friend class QFbWindow; diff --git a/src/platformsupport/fbconvenience/qfbscreen_p.h b/src/platformsupport/fbconvenience/qfbscreen_p.h index 1c27a941cc..eed615de36 100644 --- a/src/platformsupport/fbconvenience/qfbscreen_p.h +++ b/src/platformsupport/fbconvenience/qfbscreen_p.h @@ -78,14 +78,14 @@ public: virtual bool initialize(); - QRect geometry() const Q_DECL_OVERRIDE { return mGeometry; } - int depth() const Q_DECL_OVERRIDE { return mDepth; } - QImage::Format format() const Q_DECL_OVERRIDE { return mFormat; } - QSizeF physicalSize() const Q_DECL_OVERRIDE { return mPhysicalSize; } - QPlatformCursor *cursor() const Q_DECL_OVERRIDE { return mCursor; } + QRect geometry() const override { return mGeometry; } + int depth() const override { return mDepth; } + QImage::Format format() const override { return mFormat; } + QSizeF physicalSize() const override { return mPhysicalSize; } + QPlatformCursor *cursor() const override { return mCursor; } QWindow *topWindow() const; - QWindow *topLevelAt(const QPoint & p) const Q_DECL_OVERRIDE; + QWindow *topLevelAt(const QPoint & p) const override; // compositor api virtual void addWindow(QFbWindow *window); @@ -109,7 +109,7 @@ protected: virtual QRegion doRedraw(); void initializeCompositor(); - bool event(QEvent *event) Q_DECL_OVERRIDE; + bool event(QEvent *event) override; QFbWindow *windowForId(WId wid) const; diff --git a/src/platformsupport/fbconvenience/qfbwindow_p.h b/src/platformsupport/fbconvenience/qfbwindow_p.h index 20bac46c69..76b34ce041 100644 --- a/src/platformsupport/fbconvenience/qfbwindow_p.h +++ b/src/platformsupport/fbconvenience/qfbwindow_p.h @@ -64,17 +64,17 @@ public: QFbWindow(QWindow *window); ~QFbWindow(); - void raise() Q_DECL_OVERRIDE; - void lower() Q_DECL_OVERRIDE; + void raise() override; + void lower() override; - void setGeometry(const QRect &rect) Q_DECL_OVERRIDE; - void setVisible(bool visible) Q_DECL_OVERRIDE; + void setGeometry(const QRect &rect) override; + void setVisible(bool visible) override; - void setWindowState(Qt::WindowStates state) Q_DECL_OVERRIDE; - void setWindowFlags(Qt::WindowFlags type) Q_DECL_OVERRIDE; + void setWindowState(Qt::WindowStates state) override; + void setWindowFlags(Qt::WindowFlags type) override; Qt::WindowFlags windowFlags() const; - WId winId() const Q_DECL_OVERRIDE { return mWindowId; } + WId winId() const override { return mWindowId; } void setBackingStore(QFbBackingStore *store) { mBackingStore = store; } QFbBackingStore *backingStore() const { return mBackingStore; } @@ -83,9 +83,9 @@ public: virtual void repaint(const QRegion&); - void propagateSizeHints() Q_DECL_OVERRIDE { } - bool setKeyboardGrabEnabled(bool) Q_DECL_OVERRIDE { return false; } - bool setMouseGrabEnabled(bool) Q_DECL_OVERRIDE { return false; } + void propagateSizeHints() override { } + bool setKeyboardGrabEnabled(bool) override { return false; } + bool setMouseGrabEnabled(bool) override { return false; } protected: friend class QFbScreen; diff --git a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp index 969a9c17e0..733d6dc531 100644 --- a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp +++ b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp @@ -428,7 +428,7 @@ static void populateFromPattern(FcPattern *pattern) if (res == FcResultMatch) { bool hasLang = false; #if FC_VERSION >= 20297 - FcChar8 *cap = Q_NULLPTR; + FcChar8 *cap = nullptr; FcResult capRes = FcResultNoMatch; #endif for (int j = 1; j < QFontDatabase::WritingSystemsCount; ++j) { @@ -438,7 +438,7 @@ static void populateFromPattern(FcPattern *pattern) if (langRes != FcLangDifferentLang) { #if FC_VERSION >= 20297 if (*capabilityForWritingSystem[j] && requiresOpenType(j)) { - if (cap == Q_NULLPTR) + if (cap == nullptr) capRes = FcPatternGetString(pattern, FC_CAPABILITY, 0, &cap); if (capRes == FcResultMatch && strstr(reinterpret_cast<const char *>(cap), capabilityForWritingSystem[j]) == 0) continue; diff --git a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase_p.h b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase_p.h index 6a3261de30..a7257c2f98 100644 --- a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase_p.h +++ b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase_p.h @@ -61,15 +61,15 @@ class QFontEngineFT; class QFontconfigDatabase : public QFreeTypeFontDatabase { public: - void populateFontDatabase() Q_DECL_OVERRIDE; - void invalidate() Q_DECL_OVERRIDE; - QFontEngineMulti *fontEngineMulti(QFontEngine *fontEngine, QChar::Script script) Q_DECL_OVERRIDE; - QFontEngine *fontEngine(const QFontDef &fontDef, void *handle) Q_DECL_OVERRIDE; - QFontEngine *fontEngine(const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference) Q_DECL_OVERRIDE; - QStringList fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script) const Q_DECL_OVERRIDE; - QStringList addApplicationFont(const QByteArray &fontData, const QString &fileName) Q_DECL_OVERRIDE; - QString resolveFontFamilyAlias(const QString &family) const Q_DECL_OVERRIDE; - QFont defaultFont() const Q_DECL_OVERRIDE; + void populateFontDatabase() override; + void invalidate() override; + QFontEngineMulti *fontEngineMulti(QFontEngine *fontEngine, QChar::Script script) override; + QFontEngine *fontEngine(const QFontDef &fontDef, void *handle) override; + QFontEngine *fontEngine(const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference) override; + QStringList fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script) const override; + QStringList addApplicationFont(const QByteArray &fontData, const QString &fileName) override; + QString resolveFontFamilyAlias(const QString &family) const override; + QFont defaultFont() const override; private: void setupFontEngine(QFontEngineFT *engine, const QFontDef &fontDef) const; diff --git a/src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h b/src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h index 1d2f451722..7f560c2d05 100644 --- a/src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h +++ b/src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h @@ -63,7 +63,7 @@ public: ~QFontEngineMultiFontConfig(); - bool shouldLoadFontEngineForCharacter(int at, uint ucs4) const Q_DECL_OVERRIDE; + bool shouldLoadFontEngineForCharacter(int at, uint ucs4) const override; private: FcPattern* getMatchPatternForFallback(int at) const; diff --git a/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp b/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp index 73def00017..898cabd786 100644 --- a/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp +++ b/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp @@ -1537,7 +1537,7 @@ QFontEngineFT::QGlyphSet *QFontEngineFT::loadGlyphSet(const QTransform &matrix) // FT_Set_Transform only supports scalable fonts if (!FT_IS_SCALABLE(freetype->face)) - return matrix.type() <= QTransform::TxTranslate ? &defaultGlyphSet : Q_NULLPTR; + return matrix.type() <= QTransform::TxTranslate ? &defaultGlyphSet : nullptr; FT_Matrix m = QTransformToFTMatrix(matrix); @@ -1966,7 +1966,7 @@ glyph_metrics_t QFontEngineFT::alphaMapBoundingBox(glyph_t glyph, QFixed subPixe static inline QImage alphaMapFromGlyphData(QFontEngineFT::Glyph *glyph, QFontEngine::GlyphFormat glyphFormat) { - if (glyph == Q_NULLPTR || glyph->height == 0 || glyph->width == 0) + if (glyph == nullptr || glyph->height == 0 || glyph->width == 0) return QImage(); QImage::Format format = QImage::Format_Invalid; @@ -2014,14 +2014,14 @@ QImage *QFontEngineFT::lockedAlphaMapForGlyph(glyph_t glyphIndex, QFixed subPixe currentlyLockedAlphaMap = alphaMapFromGlyphData(glyph, neededFormat); - const bool glyphHasGeometry = glyph != Q_NULLPTR && glyph->height != 0 && glyph->width != 0; + const bool glyphHasGeometry = glyph != nullptr && glyph->height != 0 && glyph->width != 0; if (!cacheEnabled && glyph != &emptyGlyph) { currentlyLockedAlphaMap = currentlyLockedAlphaMap.copy(); delete glyph; } if (!glyphHasGeometry) - return Q_NULLPTR; + return nullptr; if (currentlyLockedAlphaMap.isNull()) return QFontEngine::lockedAlphaMapForGlyph(glyphIndex, subPixelPosition, neededFormat, t, offset); @@ -2119,7 +2119,7 @@ QImage QFontEngineFT::alphaRGBMapForGlyph(glyph_t g, QFixed subPixelPosition, co QImage QFontEngineFT::bitmapForGlyph(glyph_t g, QFixed subPixelPosition, const QTransform &t) { Glyph *glyph = loadGlyphFor(g, subPixelPosition, defaultFormat, t); - if (glyph == Q_NULLPTR) + if (glyph == nullptr) return QImage(); QImage img; diff --git a/src/platformsupport/fontdatabases/freetype/qfontengine_ft_p.h b/src/platformsupport/fontdatabases/freetype/qfontengine_ft_p.h index c063f5df30..f5585da7de 100644 --- a/src/platformsupport/fontdatabases/freetype/qfontengine_ft_p.h +++ b/src/platformsupport/fontdatabases/freetype/qfontengine_ft_p.h @@ -190,68 +190,68 @@ private: mutable int fast_glyph_count; }; - QFontEngine::FaceId faceId() const Q_DECL_OVERRIDE; - QFontEngine::Properties properties() const Q_DECL_OVERRIDE; - QFixed emSquareSize() const Q_DECL_OVERRIDE; - bool supportsSubPixelPositions() const Q_DECL_OVERRIDE + QFontEngine::FaceId faceId() const override; + QFontEngine::Properties properties() const override; + QFixed emSquareSize() const override; + bool supportsSubPixelPositions() const override { return default_hint_style == HintLight || default_hint_style == HintNone; } - bool getSfntTableData(uint tag, uchar *buffer, uint *length) const Q_DECL_OVERRIDE; - int synthesized() const Q_DECL_OVERRIDE; + bool getSfntTableData(uint tag, uchar *buffer, uint *length) const override; + int synthesized() const override; - QFixed ascent() const Q_DECL_OVERRIDE; - QFixed capHeight() const Q_DECL_OVERRIDE; - QFixed descent() const Q_DECL_OVERRIDE; - QFixed leading() const Q_DECL_OVERRIDE; - QFixed xHeight() const Q_DECL_OVERRIDE; - QFixed averageCharWidth() const Q_DECL_OVERRIDE; + QFixed ascent() const override; + QFixed capHeight() const override; + QFixed descent() const override; + QFixed leading() const override; + QFixed xHeight() const override; + QFixed averageCharWidth() const override; - qreal maxCharWidth() const Q_DECL_OVERRIDE; - QFixed lineThickness() const Q_DECL_OVERRIDE; - QFixed underlinePosition() const Q_DECL_OVERRIDE; + qreal maxCharWidth() const override; + QFixed lineThickness() const override; + QFixed underlinePosition() const override; - glyph_t glyphIndex(uint ucs4) const Q_DECL_OVERRIDE; - void doKerning(QGlyphLayout *, ShaperFlags) const Q_DECL_OVERRIDE; + glyph_t glyphIndex(uint ucs4) const override; + void doKerning(QGlyphLayout *, ShaperFlags) const override; - void getUnscaledGlyph(glyph_t glyph, QPainterPath *path, glyph_metrics_t *metrics) Q_DECL_OVERRIDE; + void getUnscaledGlyph(glyph_t glyph, QPainterPath *path, glyph_metrics_t *metrics) override; - bool supportsTransformation(const QTransform &transform) const Q_DECL_OVERRIDE; + bool supportsTransformation(const QTransform &transform) const override; void addGlyphsToPath(glyph_t *glyphs, QFixedPoint *positions, int nglyphs, - QPainterPath *path, QTextItem::RenderFlags flags) Q_DECL_OVERRIDE; + QPainterPath *path, QTextItem::RenderFlags flags) override; void addOutlineToPath(qreal x, qreal y, const QGlyphLayout &glyphs, - QPainterPath *path, QTextItem::RenderFlags flags) Q_DECL_OVERRIDE; + QPainterPath *path, QTextItem::RenderFlags flags) override; - bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, ShaperFlags flags) const Q_DECL_OVERRIDE; + bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, ShaperFlags flags) const override; - glyph_metrics_t boundingBox(const QGlyphLayout &glyphs) Q_DECL_OVERRIDE; - glyph_metrics_t boundingBox(glyph_t glyph) Q_DECL_OVERRIDE; - glyph_metrics_t boundingBox(glyph_t glyph, const QTransform &matrix) Q_DECL_OVERRIDE; + glyph_metrics_t boundingBox(const QGlyphLayout &glyphs) override; + glyph_metrics_t boundingBox(glyph_t glyph) override; + glyph_metrics_t boundingBox(glyph_t glyph, const QTransform &matrix) override; - void recalcAdvances(QGlyphLayout *glyphs, ShaperFlags flags) const Q_DECL_OVERRIDE; - QImage alphaMapForGlyph(glyph_t g) Q_DECL_OVERRIDE { return alphaMapForGlyph(g, 0); } - QImage alphaMapForGlyph(glyph_t, QFixed) Q_DECL_OVERRIDE; - QImage alphaMapForGlyph(glyph_t glyph, QFixed subPixelPosition, const QTransform &t) Q_DECL_OVERRIDE; - QImage alphaRGBMapForGlyph(glyph_t, QFixed subPixelPosition, const QTransform &t) Q_DECL_OVERRIDE; - QImage bitmapForGlyph(glyph_t, QFixed subPixelPosition, const QTransform &t) Q_DECL_OVERRIDE; + void recalcAdvances(QGlyphLayout *glyphs, ShaperFlags flags) const override; + QImage alphaMapForGlyph(glyph_t g) override { return alphaMapForGlyph(g, 0); } + QImage alphaMapForGlyph(glyph_t, QFixed) override; + QImage alphaMapForGlyph(glyph_t glyph, QFixed subPixelPosition, const QTransform &t) override; + QImage alphaRGBMapForGlyph(glyph_t, QFixed subPixelPosition, const QTransform &t) override; + QImage bitmapForGlyph(glyph_t, QFixed subPixelPosition, const QTransform &t) override; glyph_metrics_t alphaMapBoundingBox(glyph_t glyph, QFixed subPixelPosition, const QTransform &matrix, - QFontEngine::GlyphFormat format) Q_DECL_OVERRIDE; + QFontEngine::GlyphFormat format) override; QImage *lockedAlphaMapForGlyph(glyph_t glyph, QFixed subPixelPosition, GlyphFormat neededFormat, const QTransform &t, - QPoint *offset) Q_DECL_OVERRIDE; - bool hasInternalCaching() const Q_DECL_OVERRIDE { return cacheEnabled; } - void unlockAlphaMapForGlyph() Q_DECL_OVERRIDE; - bool expectsGammaCorrectedBlending() const Q_DECL_OVERRIDE; + QPoint *offset) override; + bool hasInternalCaching() const override { return cacheEnabled; } + void unlockAlphaMapForGlyph() override; + bool expectsGammaCorrectedBlending() const override; - void removeGlyphFromCache(glyph_t glyph) Q_DECL_OVERRIDE; - int glyphMargin(QFontEngine::GlyphFormat /* format */) Q_DECL_OVERRIDE { return 0; } + void removeGlyphFromCache(glyph_t glyph) override; + int glyphMargin(QFontEngine::GlyphFormat /* format */) override { return 0; } - int glyphCount() const Q_DECL_OVERRIDE; + int glyphCount() const override; enum Scaling { Scaled, @@ -282,13 +282,13 @@ private: bool init(FaceId faceId, bool antialias, GlyphFormat format, QFreetypeFace *freetypeFace); - int getPointInOutline(glyph_t glyph, int flags, quint32 point, QFixed *xpos, QFixed *ypos, quint32 *nPoints) Q_DECL_OVERRIDE; + int getPointInOutline(glyph_t glyph, int flags, quint32 point, QFixed *xpos, QFixed *ypos, quint32 *nPoints) override; void setQtDefaultHintStyle(QFont::HintingPreference hintingPreference); - void setDefaultHintStyle(HintStyle style) Q_DECL_OVERRIDE; + void setDefaultHintStyle(HintStyle style) override; - QFontEngine *cloneWithSize(qreal pixelSize) const Q_DECL_OVERRIDE; - Qt::HANDLE handle() const Q_DECL_OVERRIDE; + QFontEngine *cloneWithSize(qreal pixelSize) const override; + Qt::HANDLE handle() const override; bool initFromFontEngine(const QFontEngineFT *fontEngine); HintStyle defaultHintStyle() const { return default_hint_style; } diff --git a/src/platformsupport/fontdatabases/freetype/qfreetypefontdatabase_p.h b/src/platformsupport/fontdatabases/freetype/qfreetypefontdatabase_p.h index 6d51361400..0b2956b16e 100644 --- a/src/platformsupport/fontdatabases/freetype/qfreetypefontdatabase_p.h +++ b/src/platformsupport/fontdatabases/freetype/qfreetypefontdatabase_p.h @@ -66,11 +66,11 @@ struct FontFile class QFreeTypeFontDatabase : public QPlatformFontDatabase { public: - void populateFontDatabase() Q_DECL_OVERRIDE; - QFontEngine *fontEngine(const QFontDef &fontDef, void *handle) Q_DECL_OVERRIDE; - QFontEngine *fontEngine(const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference) Q_DECL_OVERRIDE; - QStringList addApplicationFont(const QByteArray &fontData, const QString &fileName) Q_DECL_OVERRIDE; - void releaseHandle(void *handle) Q_DECL_OVERRIDE; + void populateFontDatabase() override; + QFontEngine *fontEngine(const QFontDef &fontDef, void *handle) override; + QFontEngine *fontEngine(const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference) override; + QStringList addApplicationFont(const QByteArray &fontData, const QString &fileName) override; + void releaseHandle(void *handle) override; static QStringList addTTFile(const QByteArray &fontData, const QByteArray &file); }; diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h index 2b4c4e3ceb..76ab31c046 100644 --- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h +++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h @@ -70,18 +70,18 @@ class QCoreTextFontDatabase : public QPlatformFontDatabase public: QCoreTextFontDatabase(); ~QCoreTextFontDatabase(); - void populateFontDatabase() Q_DECL_OVERRIDE; + void populateFontDatabase() override; bool populateFamilyAliases() override; - void populateFamily(const QString &familyName) Q_DECL_OVERRIDE; + void populateFamily(const QString &familyName) override; void invalidate() override; - QStringList fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script) const Q_DECL_OVERRIDE; - QStringList addApplicationFont(const QByteArray &fontData, const QString &fileName) Q_DECL_OVERRIDE; - void releaseHandle(void *handle) Q_DECL_OVERRIDE; - bool isPrivateFontFamily(const QString &family) const Q_DECL_OVERRIDE; - QFont defaultFont() const Q_DECL_OVERRIDE; - bool fontsAlwaysScalable() const Q_DECL_OVERRIDE; - QList<int> standardSizes() const Q_DECL_OVERRIDE; + QStringList fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script) const override; + QStringList addApplicationFont(const QByteArray &fontData, const QString &fileName) override; + void releaseHandle(void *handle) override; + bool isPrivateFontFamily(const QString &family) const override; + QFont defaultFont() const override; + bool fontsAlwaysScalable() const override; + QList<int> standardSizes() const override; // For iOS and OS X platform themes QFont *themeFont(QPlatformTheme::Font) const; diff --git a/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h b/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h index 2986f0aaec..1f7b346909 100644 --- a/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h +++ b/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h @@ -70,53 +70,53 @@ public: QCoreTextFontEngine(CGFontRef font, const QFontDef &def); ~QCoreTextFontEngine(); - glyph_t glyphIndex(uint ucs4) const Q_DECL_OVERRIDE; - bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, ShaperFlags flags) const Q_DECL_OVERRIDE; - void recalcAdvances(QGlyphLayout *, ShaperFlags) const Q_DECL_OVERRIDE; + glyph_t glyphIndex(uint ucs4) const override; + bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, ShaperFlags flags) const override; + void recalcAdvances(QGlyphLayout *, ShaperFlags) const override; - glyph_metrics_t boundingBox(const QGlyphLayout &glyphs) Q_DECL_OVERRIDE; - glyph_metrics_t boundingBox(glyph_t glyph) Q_DECL_OVERRIDE; + glyph_metrics_t boundingBox(const QGlyphLayout &glyphs) override; + glyph_metrics_t boundingBox(glyph_t glyph) override; - QFixed ascent() const Q_DECL_OVERRIDE; - QFixed capHeight() const Q_DECL_OVERRIDE; - QFixed descent() const Q_DECL_OVERRIDE; - QFixed leading() const Q_DECL_OVERRIDE; - QFixed xHeight() const Q_DECL_OVERRIDE; - qreal maxCharWidth() const Q_DECL_OVERRIDE; - QFixed averageCharWidth() const Q_DECL_OVERRIDE; + QFixed ascent() const override; + QFixed capHeight() const override; + QFixed descent() const override; + QFixed leading() const override; + QFixed xHeight() const override; + qreal maxCharWidth() const override; + QFixed averageCharWidth() const override; void addGlyphsToPath(glyph_t *glyphs, QFixedPoint *positions, int numGlyphs, - QPainterPath *path, QTextItem::RenderFlags) Q_DECL_OVERRIDE; + QPainterPath *path, QTextItem::RenderFlags) override; - bool canRender(const QChar *string, int len) const Q_DECL_OVERRIDE; + bool canRender(const QChar *string, int len) const override; - int synthesized() const Q_DECL_OVERRIDE { return synthesisFlags; } - bool supportsSubPixelPositions() const Q_DECL_OVERRIDE { return true; } + int synthesized() const override { return synthesisFlags; } + bool supportsSubPixelPositions() const override { return true; } - QFixed lineThickness() const Q_DECL_OVERRIDE; - QFixed underlinePosition() const Q_DECL_OVERRIDE; + QFixed lineThickness() const override; + QFixed underlinePosition() const override; void draw(CGContextRef ctx, qreal x, qreal y, const QTextItemInt &ti, int paintDeviceHeight); - FaceId faceId() const Q_DECL_OVERRIDE; - bool getSfntTableData(uint /*tag*/, uchar * /*buffer*/, uint * /*length*/) const Q_DECL_OVERRIDE; - void getUnscaledGlyph(glyph_t glyph, QPainterPath *path, glyph_metrics_t *metrics) Q_DECL_OVERRIDE; - QImage alphaMapForGlyph(glyph_t, QFixed subPixelPosition) Q_DECL_OVERRIDE; - QImage alphaMapForGlyph(glyph_t glyph, QFixed subPixelPosition, const QTransform &t) Q_DECL_OVERRIDE; - QImage alphaRGBMapForGlyph(glyph_t, QFixed subPixelPosition, const QTransform &t) Q_DECL_OVERRIDE; - glyph_metrics_t alphaMapBoundingBox(glyph_t glyph, QFixed, const QTransform &matrix, GlyphFormat) Q_DECL_OVERRIDE; - QImage bitmapForGlyph(glyph_t, QFixed subPixelPosition, const QTransform &t) Q_DECL_OVERRIDE; - QFixed emSquareSize() const Q_DECL_OVERRIDE; - void doKerning(QGlyphLayout *g, ShaperFlags flags) const Q_DECL_OVERRIDE; - - bool supportsTransformation(const QTransform &transform) const Q_DECL_OVERRIDE; - bool expectsGammaCorrectedBlending() const Q_DECL_OVERRIDE; - - QFontEngine *cloneWithSize(qreal pixelSize) const Q_DECL_OVERRIDE; - Qt::HANDLE handle() const Q_DECL_OVERRIDE; - int glyphMargin(QFontEngine::GlyphFormat format) Q_DECL_OVERRIDE { Q_UNUSED(format); return 0; } - - QFontEngine::Properties properties() const Q_DECL_OVERRIDE; + FaceId faceId() const override; + bool getSfntTableData(uint /*tag*/, uchar * /*buffer*/, uint * /*length*/) const override; + void getUnscaledGlyph(glyph_t glyph, QPainterPath *path, glyph_metrics_t *metrics) override; + QImage alphaMapForGlyph(glyph_t, QFixed subPixelPosition) override; + QImage alphaMapForGlyph(glyph_t glyph, QFixed subPixelPosition, const QTransform &t) override; + QImage alphaRGBMapForGlyph(glyph_t, QFixed subPixelPosition, const QTransform &t) override; + glyph_metrics_t alphaMapBoundingBox(glyph_t glyph, QFixed, const QTransform &matrix, GlyphFormat) override; + QImage bitmapForGlyph(glyph_t, QFixed subPixelPosition, const QTransform &t) override; + QFixed emSquareSize() const override; + void doKerning(QGlyphLayout *g, ShaperFlags flags) const override; + + bool supportsTransformation(const QTransform &transform) const override; + bool expectsGammaCorrectedBlending() const override; + + QFontEngine *cloneWithSize(qreal pixelSize) const override; + Qt::HANDLE handle() const override; + int glyphMargin(QFontEngine::GlyphFormat format) override { Q_UNUSED(format); return 0; } + + QFontEngine::Properties properties() const override; static bool ct_getSfntTable(void *user_data, uint tag, uchar *buffer, uint *length); static QFont::Weight qtWeightFromCFWeight(float value); diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp index a0adcd6e2e..def67c6199 100644 --- a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp +++ b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp @@ -76,20 +76,18 @@ typedef HRESULT (WINAPI *DWriteCreateFactoryType)(DWRITE_FACTORY_TYPE, const IID static inline DWriteCreateFactoryType resolveDWriteCreateFactory() { - if (QSysInfo::windowsVersion() < QSysInfo::WV_VISTA) - return Q_NULLPTR; QSystemLibrary library(QStringLiteral("dwrite")); QFunctionPointer result = library.resolve("DWriteCreateFactory"); if (Q_UNLIKELY(!result)) { qWarning("Unable to load dwrite.dll"); - return Q_NULLPTR; + return nullptr; } return reinterpret_cast<DWriteCreateFactoryType>(result); } static void createDirectWriteFactory(IDWriteFactory **factory) { - *factory = Q_NULLPTR; + *factory = nullptr; static const DWriteCreateFactoryType dWriteCreateFactory = resolveDWriteCreateFactory(); if (!dWriteCreateFactory) @@ -539,7 +537,7 @@ namespace { class CustomFontFileLoader { public: - CustomFontFileLoader() : m_directWriteFontFileLoader(Q_NULLPTR) + CustomFontFileLoader() : m_directWriteFontFileLoader(nullptr) { createDirectWriteFactory(&m_directWriteFactory); @@ -1128,7 +1126,7 @@ static int QT_WIN_CALLBACK storeFont(const LOGFONT *logFont, const TEXTMETRIC *t // NEWTEXTMETRICEX (passed for TT fonts) is a NEWTEXTMETRIC, which according // to the documentation is identical to a TEXTMETRIC except for the last four // members, which we don't use anyway - const FONTSIGNATURE *signature = Q_NULLPTR; + const FONTSIGNATURE *signature = nullptr; if (type & TRUETYPE_FONTTYPE) signature = &reinterpret_cast<const NEWTEXTMETRICEX *>(textmetric)->ntmFontSig; addFontToDatabase(familyName, styleName, *logFont, textmetric, signature, type); @@ -1719,11 +1717,8 @@ LOGFONT QWindowsFontDatabase::fontDefToLOGFONT(const QFontDef &request, const QS qual = PROOF_QUALITY; if (request.styleStrategy & QFont::PreferAntialias) { - if (QSysInfo::WindowsVersion >= QSysInfo::WV_XP && !(request.styleStrategy & QFont::NoSubpixelAntialias)) { - qual = CLEARTYPE_QUALITY; - } else { - qual = ANTIALIASED_QUALITY; - } + qual = (request.styleStrategy & QFont::NoSubpixelAntialias) == 0 + ? CLEARTYPE_QUALITY : ANTIALIASED_QUALITY; } else if (request.styleStrategy & QFont::NoAntialias) { qual = NONANTIALIASED_QUALITY; } else if ((request.styleStrategy & QFont::NoSubpixelAntialias) && sharedFontData()->clearTypeEnabled) { @@ -1910,7 +1905,7 @@ QFontEngine *QWindowsFontDatabase::createEngine(const QFontDef &request, const Q } else { bool isColorFont = false; #if defined(QT_USE_DIRECTWRITE2) - IDWriteFontFace2 *directWriteFontFace2 = Q_NULLPTR; + IDWriteFontFace2 *directWriteFontFace2 = nullptr; if (SUCCEEDED(directWriteFontFace->QueryInterface(__uuidof(IDWriteFontFace2), reinterpret_cast<void **>(&directWriteFontFace2)))) { if (directWriteFontFace2->IsColorFont()) diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft.cpp b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft.cpp index 3f03b30f10..78477de38a 100644 --- a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft.cpp +++ b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft.cpp @@ -144,7 +144,7 @@ static FontKeys &fontKeys() return result; } -static const FontKey *findFontKey(const QString &name, int *indexIn = Q_NULLPTR) +static const FontKey *findFontKey(const QString &name, int *indexIn = nullptr) { const FontKeys &keys = fontKeys(); for (auto it = keys.constBegin(), cend = keys.constEnd(); it != cend; ++it) { @@ -157,7 +157,7 @@ static const FontKey *findFontKey(const QString &name, int *indexIn = Q_NULLPTR) } if (indexIn) *indexIn = -1; - return Q_NULLPTR; + return nullptr; } static bool addFontToDatabase(QString familyName, @@ -310,7 +310,7 @@ static int QT_WIN_CALLBACK storeFont(const LOGFONT *logFont, const TEXTMETRIC *t // NEWTEXTMETRICEX (passed for TT fonts) is a NEWTEXTMETRIC, which according // to the documentation is identical to a TEXTMETRIC except for the last four // members, which we don't use anyway - const FONTSIGNATURE *signature = Q_NULLPTR; + const FONTSIGNATURE *signature = nullptr; if (type & TRUETYPE_FONTTYPE) signature = &reinterpret_cast<const NEWTEXTMETRICEX *>(textmetric)->ntmFontSig; addFontToDatabase(faceName, styleName, fullName, *logFont, textmetric, signature, type); diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft_p.h b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft_p.h index 2df81274ad..c3d201b3a0 100644 --- a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft_p.h +++ b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft_p.h @@ -60,18 +60,18 @@ QT_BEGIN_NAMESPACE class QWindowsFontDatabaseFT : public QFreeTypeFontDatabase { public: - void populateFontDatabase() Q_DECL_OVERRIDE; - void populateFamily(const QString &familyName) Q_DECL_OVERRIDE; - QFontEngine *fontEngine(const QFontDef &fontDef, void *handle) Q_DECL_OVERRIDE; + void populateFontDatabase() override; + void populateFamily(const QString &familyName) override; + QFontEngine *fontEngine(const QFontDef &fontDef, void *handle) override; QFontEngine *fontEngine(const QByteArray &fontData, qreal pixelSize, - QFont::HintingPreference hintingPreference) Q_DECL_OVERRIDE; + QFont::HintingPreference hintingPreference) override; QStringList fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, - QChar::Script script) const Q_DECL_OVERRIDE; + QChar::Script script) const override; - QString fontDir() const Q_DECL_OVERRIDE; - QFont defaultFont() const Q_DECL_OVERRIDE; + QString fontDir() const override; + QFont defaultFont() const override; }; QT_END_NAMESPACE diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_p.h b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_p.h index 15172c09da..bbdb90f70a 100644 --- a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_p.h +++ b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_p.h @@ -95,18 +95,18 @@ public: QWindowsFontDatabase(); ~QWindowsFontDatabase(); - void populateFontDatabase() Q_DECL_OVERRIDE; - void populateFamily(const QString &familyName) Q_DECL_OVERRIDE; - QFontEngineMulti *fontEngineMulti(QFontEngine *fontEngine, QChar::Script script) Q_DECL_OVERRIDE; - QFontEngine *fontEngine(const QFontDef &fontDef, void *handle) Q_DECL_OVERRIDE; - QFontEngine *fontEngine(const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference) Q_DECL_OVERRIDE; - QStringList fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script) const Q_DECL_OVERRIDE; - QStringList addApplicationFont(const QByteArray &fontData, const QString &fileName) Q_DECL_OVERRIDE; - void releaseHandle(void *handle) Q_DECL_OVERRIDE; - QString fontDir() const Q_DECL_OVERRIDE; - - QFont defaultFont() const Q_DECL_OVERRIDE { return systemDefaultFont(); } - bool fontsAlwaysScalable() const Q_DECL_OVERRIDE; + void populateFontDatabase() override; + void populateFamily(const QString &familyName) override; + QFontEngineMulti *fontEngineMulti(QFontEngine *fontEngine, QChar::Script script) override; + QFontEngine *fontEngine(const QFontDef &fontDef, void *handle) override; + QFontEngine *fontEngine(const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference) override; + QStringList fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script) const override; + QStringList addApplicationFont(const QByteArray &fontData, const QString &fileName) override; + void releaseHandle(void *handle) override; + QString fontDir() const override; + + QFont defaultFont() const override { return systemDefaultFont(); } + bool fontsAlwaysScalable() const override; void derefUniqueFont(const QString &uniqueFont); void refUniqueFont(const QString &uniqueFont); diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontengine_p.h b/src/platformsupport/fontdatabases/windows/qwindowsfontengine_p.h index 76b45d7a7b..2ec391c4da 100644 --- a/src/platformsupport/fontdatabases/windows/qwindowsfontengine_p.h +++ b/src/platformsupport/fontdatabases/windows/qwindowsfontengine_p.h @@ -76,53 +76,53 @@ public: void initFontInfo(const QFontDef &request, int dpi); - QFixed lineThickness() const Q_DECL_OVERRIDE; - Properties properties() const Q_DECL_OVERRIDE; - void getUnscaledGlyph(glyph_t glyph, QPainterPath *path, glyph_metrics_t *metrics) Q_DECL_OVERRIDE; - FaceId faceId() const Q_DECL_OVERRIDE; - bool getSfntTableData(uint tag, uchar *buffer, uint *length) const Q_DECL_OVERRIDE; - int synthesized() const Q_DECL_OVERRIDE; - QFixed emSquareSize() const Q_DECL_OVERRIDE; - - glyph_t glyphIndex(uint ucs4) const Q_DECL_OVERRIDE; - bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, ShaperFlags flags) const Q_DECL_OVERRIDE; - void recalcAdvances(QGlyphLayout *glyphs, ShaperFlags) const Q_DECL_OVERRIDE; - - void addOutlineToPath(qreal x, qreal y, const QGlyphLayout &glyphs, QPainterPath *path, QTextItem::RenderFlags flags) Q_DECL_OVERRIDE; + QFixed lineThickness() const override; + Properties properties() const override; + void getUnscaledGlyph(glyph_t glyph, QPainterPath *path, glyph_metrics_t *metrics) override; + FaceId faceId() const override; + bool getSfntTableData(uint tag, uchar *buffer, uint *length) const override; + int synthesized() const override; + QFixed emSquareSize() const override; + + glyph_t glyphIndex(uint ucs4) const override; + bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, ShaperFlags flags) const override; + void recalcAdvances(QGlyphLayout *glyphs, ShaperFlags) const override; + + void addOutlineToPath(qreal x, qreal y, const QGlyphLayout &glyphs, QPainterPath *path, QTextItem::RenderFlags flags) override; virtual void addGlyphsToPath(glyph_t *glyphs, QFixedPoint *positions, int nglyphs, - QPainterPath *path, QTextItem::RenderFlags flags) Q_DECL_OVERRIDE; + QPainterPath *path, QTextItem::RenderFlags flags) override; HGDIOBJ selectDesignFont() const; - glyph_metrics_t boundingBox(const QGlyphLayout &glyphs) Q_DECL_OVERRIDE; - glyph_metrics_t boundingBox(glyph_t g) Q_DECL_OVERRIDE { return boundingBox(g, QTransform()); } - glyph_metrics_t boundingBox(glyph_t g, const QTransform &t) Q_DECL_OVERRIDE; + glyph_metrics_t boundingBox(const QGlyphLayout &glyphs) override; + glyph_metrics_t boundingBox(glyph_t g) override { return boundingBox(g, QTransform()); } + glyph_metrics_t boundingBox(glyph_t g, const QTransform &t) override; - QFixed ascent() const Q_DECL_OVERRIDE; - QFixed descent() const Q_DECL_OVERRIDE; - QFixed leading() const Q_DECL_OVERRIDE; - QFixed xHeight() const Q_DECL_OVERRIDE; - QFixed capHeight() const Q_DECL_OVERRIDE; - QFixed averageCharWidth() const Q_DECL_OVERRIDE; - qreal maxCharWidth() const Q_DECL_OVERRIDE; - qreal minLeftBearing() const Q_DECL_OVERRIDE; - qreal minRightBearing() const Q_DECL_OVERRIDE; + QFixed ascent() const override; + QFixed descent() const override; + QFixed leading() const override; + QFixed xHeight() const override; + QFixed capHeight() const override; + QFixed averageCharWidth() const override; + qreal maxCharWidth() const override; + qreal minLeftBearing() const override; + qreal minRightBearing() const override; - QImage alphaMapForGlyph(glyph_t t) Q_DECL_OVERRIDE { return alphaMapForGlyph(t, QTransform()); } - QImage alphaMapForGlyph(glyph_t, const QTransform &xform) Q_DECL_OVERRIDE; - QImage alphaRGBMapForGlyph(glyph_t t, QFixed subPixelPosition, const QTransform &xform) Q_DECL_OVERRIDE; - glyph_metrics_t alphaMapBoundingBox(glyph_t glyph, QFixed, const QTransform &matrix, GlyphFormat) Q_DECL_OVERRIDE; + QImage alphaMapForGlyph(glyph_t t) override { return alphaMapForGlyph(t, QTransform()); } + QImage alphaMapForGlyph(glyph_t, const QTransform &xform) override; + QImage alphaRGBMapForGlyph(glyph_t t, QFixed subPixelPosition, const QTransform &xform) override; + glyph_metrics_t alphaMapBoundingBox(glyph_t glyph, QFixed, const QTransform &matrix, GlyphFormat) override; - QFontEngine *cloneWithSize(qreal pixelSize) const Q_DECL_OVERRIDE; - Qt::HANDLE handle() const Q_DECL_OVERRIDE; - bool supportsTransformation(const QTransform &transform) const Q_DECL_OVERRIDE; + QFontEngine *cloneWithSize(qreal pixelSize) const override; + Qt::HANDLE handle() const override; + bool supportsTransformation(const QTransform &transform) const override; #ifndef Q_CC_MINGW - void getGlyphBearings(glyph_t glyph, qreal *leftBearing = 0, qreal *rightBearing = 0) Q_DECL_OVERRIDE; + void getGlyphBearings(glyph_t glyph, qreal *leftBearing = 0, qreal *rightBearing = 0) override; #endif - bool hasUnreliableGlyphOutline() const Q_DECL_OVERRIDE; + bool hasUnreliableGlyphOutline() const override; int getGlyphIndexes(const QChar *ch, int numChars, QGlyphLayout *glyphs) const; void getCMap(); @@ -173,7 +173,7 @@ class QWindowsMultiFontEngine : public QFontEngineMulti public: explicit QWindowsMultiFontEngine(QFontEngine *fe, int script); - QFontEngine *loadEngine(int at) Q_DECL_OVERRIDE; + QFontEngine *loadEngine(int at) override; }; QT_END_NAMESPACE diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp b/src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp index f07e711048..0e017c3b77 100644 --- a/src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp +++ b/src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp @@ -282,7 +282,7 @@ static UUID uuidIdWriteLocalFontFileLoader() QString QWindowsFontEngineDirectWrite::filenameFromFontFile(IDWriteFontFile *fontFile) { - IDWriteFontFileLoader *loader = Q_NULLPTR; + IDWriteFontFileLoader *loader = nullptr; HRESULT hr = fontFile->GetLoader(&loader); if (FAILED(hr)) { @@ -290,11 +290,11 @@ QString QWindowsFontEngineDirectWrite::filenameFromFontFile(IDWriteFontFile *fon return QString(); } - QIdWriteLocalFontFileLoader *localLoader = Q_NULLPTR; + QIdWriteLocalFontFileLoader *localLoader = nullptr; hr = loader->QueryInterface(uuidIdWriteLocalFontFileLoader(), reinterpret_cast<void **>(&localLoader)); - const void *fontFileReferenceKey = Q_NULLPTR; + const void *fontFileReferenceKey = nullptr; UINT32 fontFileReferenceKeySize = 0; if (SUCCEEDED(hr)) { hr = fontFile->GetReferenceKey(&fontFileReferenceKey, @@ -326,10 +326,10 @@ QString QWindowsFontEngineDirectWrite::filenameFromFontFile(IDWriteFontFile *fon ret = QString::fromWCharArray(filePath.data()); } - if (localLoader != Q_NULLPTR) + if (localLoader != nullptr) localLoader->Release(); - if (loader != Q_NULLPTR) + if (loader != nullptr) loader->Release(); return ret; } @@ -349,7 +349,7 @@ void QWindowsFontEngineDirectWrite::collectMetrics() m_lineGap = DESIGN_TO_LOGICAL(metrics.lineGap); m_underlinePosition = DESIGN_TO_LOGICAL(metrics.underlinePosition); - IDWriteFontFile *fontFile = Q_NULLPTR; + IDWriteFontFile *fontFile = nullptr; UINT32 numberOfFiles = 1; if (SUCCEEDED(m_directWriteFontFace->GetFiles(&numberOfFiles, &fontFile))) { m_faceId.filename = QFile::encodeName(filenameFromFontFile(fontFile)); @@ -713,7 +713,7 @@ QImage QWindowsFontEngineDirectWrite::imageForGlyph(glyph_t t, #if defined(QT_USE_DIRECTWRITE2) HRESULT hr = DWRITE_E_NOCOLOR; IDWriteColorGlyphRunEnumerator *enumerator = 0; - IDWriteFactory2 *factory2 = Q_NULLPTR; + IDWriteFactory2 *factory2 = nullptr; if (glyphFormat == QFontEngine::Format_ARGB && SUCCEEDED(m_fontEngineData->directWriteFactory->QueryInterface(__uuidof(IDWriteFactory2), reinterpret_cast<void **>(&factory2)))) { diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite_p.h b/src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite_p.h index db4e79e44f..83fdddfa26 100644 --- a/src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite_p.h +++ b/src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite_p.h @@ -80,41 +80,41 @@ public: void initFontInfo(const QFontDef &request, int dpi); - QFixed lineThickness() const Q_DECL_OVERRIDE; - QFixed underlinePosition() const Q_DECL_OVERRIDE; - bool getSfntTableData(uint tag, uchar *buffer, uint *length) const Q_DECL_OVERRIDE; - QFixed emSquareSize() const Q_DECL_OVERRIDE; + QFixed lineThickness() const override; + QFixed underlinePosition() const override; + bool getSfntTableData(uint tag, uchar *buffer, uint *length) const override; + QFixed emSquareSize() const override; - glyph_t glyphIndex(uint ucs4) const Q_DECL_OVERRIDE; + glyph_t glyphIndex(uint ucs4) const override; bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, - ShaperFlags flags) const Q_DECL_OVERRIDE; - void recalcAdvances(QGlyphLayout *glyphs, ShaperFlags) const Q_DECL_OVERRIDE; + ShaperFlags flags) const override; + void recalcAdvances(QGlyphLayout *glyphs, ShaperFlags) const override; void addGlyphsToPath(glyph_t *glyphs, QFixedPoint *positions, int nglyphs, - QPainterPath *path, QTextItem::RenderFlags flags) Q_DECL_OVERRIDE; + QPainterPath *path, QTextItem::RenderFlags flags) override; - glyph_metrics_t boundingBox(const QGlyphLayout &glyphs) Q_DECL_OVERRIDE; - glyph_metrics_t boundingBox(glyph_t g) Q_DECL_OVERRIDE; + glyph_metrics_t boundingBox(const QGlyphLayout &glyphs) override; + glyph_metrics_t boundingBox(glyph_t g) override; glyph_metrics_t alphaMapBoundingBox(glyph_t glyph, QFixed, - const QTransform &matrix, GlyphFormat) Q_DECL_OVERRIDE; + const QTransform &matrix, GlyphFormat) override; - QFixed ascent() const Q_DECL_OVERRIDE; - QFixed capHeight() const Q_DECL_OVERRIDE; - QFixed descent() const Q_DECL_OVERRIDE; - QFixed leading() const Q_DECL_OVERRIDE; - QFixed xHeight() const Q_DECL_OVERRIDE; - qreal maxCharWidth() const Q_DECL_OVERRIDE; - FaceId faceId() const Q_DECL_OVERRIDE; + QFixed ascent() const override; + QFixed capHeight() const override; + QFixed descent() const override; + QFixed leading() const override; + QFixed xHeight() const override; + qreal maxCharWidth() const override; + FaceId faceId() const override; - bool supportsSubPixelPositions() const Q_DECL_OVERRIDE; + bool supportsSubPixelPositions() const override; - QImage alphaMapForGlyph(glyph_t glyph, QFixed subPixelPosition) Q_DECL_OVERRIDE; - QImage alphaMapForGlyph(glyph_t glyph, QFixed subPixelPosition, const QTransform &t) Q_DECL_OVERRIDE; - QImage alphaRGBMapForGlyph(glyph_t t, QFixed subPixelPosition, const QTransform &xform) Q_DECL_OVERRIDE; - QImage bitmapForGlyph(glyph_t, QFixed subPixelPosition, const QTransform &t) Q_DECL_OVERRIDE; + QImage alphaMapForGlyph(glyph_t glyph, QFixed subPixelPosition) override; + QImage alphaMapForGlyph(glyph_t glyph, QFixed subPixelPosition, const QTransform &t) override; + QImage alphaRGBMapForGlyph(glyph_t t, QFixed subPixelPosition, const QTransform &xform) override; + QImage bitmapForGlyph(glyph_t, QFixed subPixelPosition, const QTransform &t) override; - QFontEngine *cloneWithSize(qreal pixelSize) const Q_DECL_OVERRIDE; - Qt::HANDLE handle() const Q_DECL_OVERRIDE; + QFontEngine *cloneWithSize(qreal pixelSize) const override; + Qt::HANDLE handle() const override; const QSharedPointer<QWindowsFontEngineData> &fontEngineData() const { return m_fontEngineData; } diff --git a/src/platformsupport/fontdatabases/windows/qwindowsnativeimage.cpp b/src/platformsupport/fontdatabases/windows/qwindowsnativeimage.cpp index f8fcff952a..67a6619b91 100644 --- a/src/platformsupport/fontdatabases/windows/qwindowsnativeimage.cpp +++ b/src/platformsupport/fontdatabases/windows/qwindowsnativeimage.cpp @@ -98,7 +98,7 @@ static inline HBITMAP createDIB(HDC hdc, int width, int height, bmi.blueMask = 0; } - uchar *bits = Q_NULLPTR; + uchar *bits = nullptr; HBITMAP bitmap = CreateDIBSection(hdc, reinterpret_cast<BITMAPINFO *>(&bmi), DIB_RGB_COLORS, reinterpret_cast<void **>(&bits), 0, 0); if (Q_UNLIKELY(!bitmap || !bits)) diff --git a/src/platformsupport/graphics/qrasterbackingstore_p.h b/src/platformsupport/graphics/qrasterbackingstore_p.h index 2764fd6432..357e861d1d 100644 --- a/src/platformsupport/graphics/qrasterbackingstore_p.h +++ b/src/platformsupport/graphics/qrasterbackingstore_p.h @@ -62,12 +62,12 @@ public: QRasterBackingStore(QWindow *window); ~QRasterBackingStore(); - void resize(const QSize &size, const QRegion &staticContents) Q_DECL_OVERRIDE; - bool scroll(const QRegion &area, int dx, int dy) Q_DECL_OVERRIDE; - void beginPaint(const QRegion ®ion) Q_DECL_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; - QPaintDevice *paintDevice() Q_DECL_OVERRIDE; - QImage toImage() const Q_DECL_OVERRIDE; + QPaintDevice *paintDevice() override; + QImage toImage() const override; protected: virtual QImage::Format format() const; diff --git a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp index 960f1d2f12..2d6426db7f 100644 --- a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp +++ b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp @@ -71,7 +71,7 @@ void QFdContainer::reset() Q_DECL_NOTHROW } QEvdevKeyboardHandler::QEvdevKeyboardHandler(const QString &device, QFdContainer &fd, bool disableZap, bool enableCompose, const QString &keymapFile) - : m_device(device), m_fd(fd.release()), m_notify(Q_NULLPTR), + : m_device(device), m_fd(fd.release()), m_notify(nullptr), m_modifiers(0), m_composing(0), m_dead_unicode(0xffff), m_no_zap(disableZap), m_do_compose(enableCompose), m_keymap(0), m_keymap_size(0), m_keycompose(0), m_keycompose_size(0) @@ -172,7 +172,7 @@ void QEvdevKeyboardHandler::readKeycode() // by the above error over and over again. if (errno == ENODEV) { delete m_notify; - m_notify = Q_NULLPTR; + m_notify = nullptr; m_fd.reset(); } return; diff --git a/src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp b/src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp index 8614de066f..04372ae4d9 100644 --- a/src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp +++ b/src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp @@ -184,7 +184,7 @@ void QEvdevMouseHandler::sendMouseEvent() m_prevInvalid = false; } - emit handleMouseEvent(x, y, m_abs, m_buttons); + emit handleMouseEvent(x, y, m_abs, m_buttons, m_button, m_eventType); m_prevx = m_x; m_prevy = m_y; @@ -210,7 +210,7 @@ void QEvdevMouseHandler::readMouseData() // by the above error over and over again. if (errno == ENODEV) { delete m_notify; - m_notify = Q_NULLPTR; + m_notify = nullptr; qt_safe_close(m_fd); m_fd = -1; } @@ -286,6 +286,8 @@ void QEvdevMouseHandler::readMouseData() case 0x11f: button = Qt::ExtraButton13; break; } m_buttons.setFlag(button, data->value); + m_button = button; + m_eventType = data->value == 0 ? QEvent::MouseButtonRelease : QEvent::MouseButtonPress; btnChanged = true; } else if (data->type == EV_SYN && data->code == SYN_REPORT) { if (btnChanged) { @@ -293,6 +295,7 @@ void QEvdevMouseHandler::readMouseData() sendMouseEvent(); pendingMouseEvent = false; } else if (posChanged) { + m_eventType = QEvent::MouseMove; posChanged = false; if (m_compression) { pendingMouseEvent = true; diff --git a/src/platformsupport/input/evdevmouse/qevdevmousehandler_p.h b/src/platformsupport/input/evdevmouse/qevdevmousehandler_p.h index 6cad4b9173..c7f2b04eb2 100644 --- a/src/platformsupport/input/evdevmouse/qevdevmousehandler_p.h +++ b/src/platformsupport/input/evdevmouse/qevdevmousehandler_p.h @@ -54,6 +54,7 @@ #include <QObject> #include <QString> #include <QPoint> +#include <QEvent> QT_BEGIN_NAMESPACE @@ -69,7 +70,8 @@ public: void readMouseData(); signals: - void handleMouseEvent(int x, int y, bool abs, Qt::MouseButtons buttons); + void handleMouseEvent(int x, int y, bool abs, Qt::MouseButtons buttons, + Qt::MouseButton button, QEvent::Type type); void handleWheelEvent(QPoint delta); private: @@ -86,6 +88,8 @@ private: bool m_abs; bool m_compression; Qt::MouseButtons m_buttons; + Qt::MouseButton m_button; + QEvent::Type m_eventType; int m_jitterLimitSquared; bool m_prevInvalid; int m_hardwareWidth; diff --git a/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp b/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp index ba94bcd460..5264736dd6 100644 --- a/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp +++ b/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp @@ -131,7 +131,8 @@ void QEvdevMouseManager::clampPosition() m_y = g.bottom() - m_yoffset; } -void QEvdevMouseManager::handleMouseEvent(int x, int y, bool abs, Qt::MouseButtons buttons) +void QEvdevMouseManager::handleMouseEvent(int x, int y, bool abs, Qt::MouseButtons buttons, + Qt::MouseButton button, QEvent::Type type) { // update current absolute coordinates if (!abs) { @@ -147,7 +148,8 @@ void QEvdevMouseManager::handleMouseEvent(int x, int y, bool abs, Qt::MouseButto QPoint pos(m_x + m_xoffset, m_y + m_yoffset); // Cannot track the keyboard modifiers ourselves here. Instead, report the // modifiers from the last key event that has been seen by QGuiApplication. - QWindowSystemInterface::handleMouseEvent(0, pos, pos, buttons, QGuiApplication::keyboardModifiers()); + Qt::KeyboardModifiers mods = QGuiApplication::keyboardModifiers(); + QWindowSystemInterface::handleMouseEvent(0, pos, pos, buttons, button, type, mods); } void QEvdevMouseManager::handleWheelEvent(QPoint delta) diff --git a/src/platformsupport/input/evdevmouse/qevdevmousemanager_p.h b/src/platformsupport/input/evdevmouse/qevdevmousemanager_p.h index 10703655b3..13a8e3dec5 100644 --- a/src/platformsupport/input/evdevmouse/qevdevmousemanager_p.h +++ b/src/platformsupport/input/evdevmouse/qevdevmousemanager_p.h @@ -68,7 +68,8 @@ public: QEvdevMouseManager(const QString &key, const QString &specification, QObject *parent = 0); ~QEvdevMouseManager(); - void handleMouseEvent(int x, int y, bool abs, Qt::MouseButtons buttons); + void handleMouseEvent(int x, int y, bool abs, Qt::MouseButtons buttons, + Qt::MouseButton button, QEvent::Type type); void handleWheelEvent(QPoint delta); void addMouse(const QString &deviceNode = QString()); diff --git a/src/platformsupport/input/evdevtablet/qevdevtablethandler_p.h b/src/platformsupport/input/evdevtablet/qevdevtablethandler_p.h index 8d848d6ebb..66e821117a 100644 --- a/src/platformsupport/input/evdevtablet/qevdevtablethandler_p.h +++ b/src/platformsupport/input/evdevtablet/qevdevtablethandler_p.h @@ -85,7 +85,7 @@ class QEvdevTabletHandlerThread : public QDaemonThread public: explicit QEvdevTabletHandlerThread(const QString &device, const QString &spec, QObject *parent = 0); ~QEvdevTabletHandlerThread(); - void run() Q_DECL_OVERRIDE; + void run() override; QEvdevTabletHandler *handler() { return m_handler; } private: diff --git a/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp b/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp index c7595cf2b3..0ab4c65c45 100644 --- a/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp +++ b/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp @@ -192,9 +192,9 @@ static inline bool testBit(long bit, const long *array) #endif QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &device, const QString &spec, QObject *parent) - : QObject(parent), m_notify(Q_NULLPTR), m_fd(-1), d(Q_NULLPTR), m_device(Q_NULLPTR) + : QObject(parent), m_notify(nullptr), m_fd(-1), d(nullptr), m_device(nullptr) #if QT_CONFIG(mtdev) - , m_mtdev(Q_NULLPTR) + , m_mtdev(nullptr) #endif { setObjectName(QLatin1String("Evdev Touch Handler")); @@ -427,7 +427,7 @@ err: qErrnoWarning(errno, "evdevtouch: Could not read from input device"); if (errno == ENODEV) { // device got disconnected -> stop reading delete m_notify; - m_notify = Q_NULLPTR; + m_notify = nullptr; QT_CLOSE(m_fd); m_fd = -1; @@ -466,7 +466,7 @@ void QEvdevTouchScreenHandler::unregisterTouchDevice() delete m_device; } - m_device = Q_NULLPTR; + m_device = nullptr; } void QEvdevTouchScreenData::addTouchPoint(const Contact &contact, Qt::TouchPointStates *combinedStates) @@ -781,13 +781,13 @@ void QEvdevTouchScreenData::reportPoints() if (m_filtered) emit q->touchPointsUpdated(); else - QWindowSystemInterface::handleTouchEvent(Q_NULLPTR, q->touchDevice(), m_touchPoints); + QWindowSystemInterface::handleTouchEvent(nullptr, q->touchDevice(), m_touchPoints); } QEvdevTouchScreenHandlerThread::QEvdevTouchScreenHandlerThread(const QString &device, const QString &spec, QObject *parent) - : QDaemonThread(parent), m_device(device), m_spec(spec), m_handler(Q_NULLPTR), m_touchDeviceRegistered(false) + : QDaemonThread(parent), m_device(device), m_spec(spec), m_handler(nullptr), m_touchDeviceRegistered(false) , m_touchUpdatePending(false) - , m_filterWindow(Q_NULLPTR) + , m_filterWindow(nullptr) , m_touchRate(-1) { start(); @@ -812,7 +812,7 @@ void QEvdevTouchScreenHandlerThread::run() exec(); delete m_handler; - m_handler = Q_NULLPTR; + m_handler = nullptr; } bool QEvdevTouchScreenHandlerThread::isTouchDeviceRegistered() const @@ -953,7 +953,7 @@ void QEvdevTouchScreenHandlerThread::filterAndSendTouchPoints() m_filteredPoints = filteredPoints; - QWindowSystemInterface::handleTouchEvent(Q_NULLPTR, + QWindowSystemInterface::handleTouchEvent(nullptr, m_handler->touchDevice(), points); } diff --git a/src/platformsupport/input/evdevtouch/qevdevtouchhandler_p.h b/src/platformsupport/input/evdevtouch/qevdevtouchhandler_p.h index a0b689a89e..56308d0352 100644 --- a/src/platformsupport/input/evdevtouch/qevdevtouchhandler_p.h +++ b/src/platformsupport/input/evdevtouch/qevdevtouchhandler_p.h @@ -75,7 +75,7 @@ class QEvdevTouchScreenHandler : public QObject Q_OBJECT public: - explicit QEvdevTouchScreenHandler(const QString &device, const QString &spec = QString(), QObject *parent = Q_NULLPTR); + explicit QEvdevTouchScreenHandler(const QString &device, const QString &spec = QString(), QObject *parent = nullptr); ~QEvdevTouchScreenHandler(); QTouchDevice *touchDevice() const; @@ -107,13 +107,13 @@ class QEvdevTouchScreenHandlerThread : public QDaemonThread { Q_OBJECT public: - explicit QEvdevTouchScreenHandlerThread(const QString &device, const QString &spec, QObject *parent = Q_NULLPTR); + explicit QEvdevTouchScreenHandlerThread(const QString &device, const QString &spec, QObject *parent = nullptr); ~QEvdevTouchScreenHandlerThread(); - void run() Q_DECL_OVERRIDE; + void run() override; bool isTouchDeviceRegistered() const; - bool eventFilter(QObject *object, QEvent *event) Q_DECL_OVERRIDE; + bool eventFilter(QObject *object, QEvent *event) override; void scheduleTouchPointUpdate(); diff --git a/src/platformsupport/input/integrityhid/qintegrityhidmanager.cpp b/src/platformsupport/input/integrityhid/qintegrityhidmanager.cpp index 8089a6e38b..e472693077 100644 --- a/src/platformsupport/input/integrityhid/qintegrityhidmanager.cpp +++ b/src/platformsupport/input/integrityhid/qintegrityhidmanager.cpp @@ -75,8 +75,8 @@ public: { CheckSuccess(gh_hid_close(handle)); }; - void process_event(void) Q_DECL_OVERRIDE; - void async_wait(void) Q_DECL_OVERRIDE; + void process_event(void) override; + void async_wait(void) override; HIDDriver *get_driver(void) { return driver; }; HIDHandle get_handle(void) { return handle; }; private: @@ -94,8 +94,8 @@ public: { qDeleteAll(devices); }; - void process_event(void) Q_DECL_OVERRIDE; - void async_wait(void) Q_DECL_OVERRIDE; + void process_event(void) override; + void async_wait(void) override; void find_devices(void); private: QHash<Value, HIDDeviceHandler *> devices; diff --git a/src/platformsupport/input/libinput/qlibinputhandler.cpp b/src/platformsupport/input/libinput/qlibinputhandler.cpp index 733cf7d409..52eaa18f4b 100644 --- a/src/platformsupport/input/libinput/qlibinputhandler.cpp +++ b/src/platformsupport/input/libinput/qlibinputhandler.cpp @@ -94,7 +94,7 @@ QLibInputHandler::QLibInputHandler(const QString &key, const QString &spec) if (Q_UNLIKELY(!m_udev)) qFatal("Failed to get udev context for libinput"); - m_li = libinput_udev_create_context(&liInterface, Q_NULLPTR, m_udev); + m_li = libinput_udev_create_context(&liInterface, nullptr, m_udev); if (Q_UNLIKELY(!m_li)) qFatal("Failed to get libinput context"); @@ -140,7 +140,7 @@ void QLibInputHandler::onReadyRead() } libinput_event *ev; - while ((ev = libinput_get_event(m_li)) != Q_NULLPTR) { + while ((ev = libinput_get_event(m_li)) != nullptr) { processEvent(ev); libinput_event_destroy(ev); } diff --git a/src/platformsupport/input/libinput/qlibinputkeyboard.cpp b/src/platformsupport/input/libinput/qlibinputkeyboard.cpp index f14a2e8f04..21f7fde7c8 100644 --- a/src/platformsupport/input/libinput/qlibinputkeyboard.cpp +++ b/src/platformsupport/input/libinput/qlibinputkeyboard.cpp @@ -143,7 +143,7 @@ QLibInputKeyboard::QLibInputKeyboard() qWarning("Failed to create xkb context"); return; } - m_keymap = xkb_keymap_new_from_names(m_ctx, Q_NULLPTR, XKB_KEYMAP_COMPILE_NO_FLAGS); + m_keymap = xkb_keymap_new_from_names(m_ctx, nullptr, XKB_KEYMAP_COMPILE_NO_FLAGS); if (!m_keymap) { qWarning("Failed to compile keymap"); return; @@ -211,7 +211,7 @@ void QLibInputKeyboard::processKey(libinput_event_keyboard *e) xkb_state_update_key(m_state, k, pressed ? XKB_KEY_DOWN : XKB_KEY_UP); - QWindowSystemInterface::handleExtendedKeyEvent(Q_NULLPTR, + QWindowSystemInterface::handleExtendedKeyEvent(nullptr, pressed ? QEvent::KeyPress : QEvent::KeyRelease, qtkey, mods, k, sym, mods, text); @@ -237,7 +237,7 @@ void QLibInputKeyboard::processKey(libinput_event_keyboard *e) #ifndef QT_NO_XKBCOMMON_EVDEV void QLibInputKeyboard::handleRepeat() { - QWindowSystemInterface::handleExtendedKeyEvent(Q_NULLPTR, QEvent::KeyPress, + QWindowSystemInterface::handleExtendedKeyEvent(nullptr, QEvent::KeyPress, m_repeatData.qtkey, m_repeatData.mods, m_repeatData.nativeScanCode, m_repeatData.virtualKey, m_repeatData.nativeMods, m_repeatData.unicodeText, true, m_repeatData.repeatCount); diff --git a/src/platformsupport/input/libinput/qlibinputpointer.cpp b/src/platformsupport/input/libinput/qlibinputpointer.cpp index 6879d0cd83..12379a83fa 100644 --- a/src/platformsupport/input/libinput/qlibinputpointer.cpp +++ b/src/platformsupport/input/libinput/qlibinputpointer.cpp @@ -39,6 +39,7 @@ #include "qlibinputpointer_p.h" #include <libinput.h> +#include <QtCore/QEvent> #include <QtGui/QGuiApplication> #include <QtGui/QScreen> #include <qpa/qwindowsysteminterface.h> @@ -78,7 +79,10 @@ void QLibInputPointer::processButton(libinput_event_pointer *e) m_buttons.setFlag(button, pressed); - QWindowSystemInterface::handleMouseEvent(Q_NULLPTR, m_pos, m_pos, m_buttons, QGuiApplication::keyboardModifiers()); + QEvent::Type type = pressed ? QEvent::MouseButtonPress : QEvent::MouseButtonRelease; + Qt::KeyboardModifiers mods = QGuiApplication::keyboardModifiers(); + + QWindowSystemInterface::handleMouseEvent(nullptr, m_pos, m_pos, m_buttons, button, type, mods); } void QLibInputPointer::processMotion(libinput_event_pointer *e) @@ -91,7 +95,10 @@ void QLibInputPointer::processMotion(libinput_event_pointer *e) m_pos.setX(qBound(g.left(), qRound(m_pos.x() + dx), g.right())); m_pos.setY(qBound(g.top(), qRound(m_pos.y() + dy), g.bottom())); - QWindowSystemInterface::handleMouseEvent(Q_NULLPTR, m_pos, m_pos, m_buttons, QGuiApplication::keyboardModifiers()); + Qt::KeyboardModifiers mods = QGuiApplication::keyboardModifiers(); + + QWindowSystemInterface::handleMouseEvent(nullptr, m_pos, m_pos, m_buttons, + Qt::NoButton, QEvent::MouseMove, mods); } void QLibInputPointer::processAxis(libinput_event_pointer *e) diff --git a/src/platformsupport/input/libinput/qlibinputtouch.cpp b/src/platformsupport/input/libinput/qlibinputtouch.cpp index 42925a18e1..a65bc91c39 100644 --- a/src/platformsupport/input/libinput/qlibinputtouch.cpp +++ b/src/platformsupport/input/libinput/qlibinputtouch.cpp @@ -53,7 +53,7 @@ QWindowSystemInterface::TouchPoint *QLibInputTouch::DeviceState::point(int32_t s if (m_points.at(i).id == id) return &m_points[i]; - return Q_NULLPTR; + return nullptr; } QLibInputTouch::DeviceState *QLibInputTouch::deviceState(libinput_event_touch *e) @@ -150,7 +150,7 @@ void QLibInputTouch::processTouchCancel(libinput_event_touch *e) { DeviceState *state = deviceState(e); if (state->m_touchDevice) - QWindowSystemInterface::handleTouchCancelEvent(Q_NULLPTR, state->m_touchDevice, QGuiApplication::keyboardModifiers()); + QWindowSystemInterface::handleTouchCancelEvent(nullptr, state->m_touchDevice, QGuiApplication::keyboardModifiers()); else qWarning("TouchCancel without registered device"); } @@ -165,7 +165,7 @@ void QLibInputTouch::processTouchFrame(libinput_event_touch *e) if (state->m_points.isEmpty()) return; - QWindowSystemInterface::handleTouchEvent(Q_NULLPTR, state->m_touchDevice, state->m_points, + QWindowSystemInterface::handleTouchEvent(nullptr, state->m_touchDevice, state->m_points, QGuiApplication::keyboardModifiers()); for (int i = 0; i < state->m_points.count(); ++i) { diff --git a/src/platformsupport/kmsconvenience/qkmsdevice.cpp b/src/platformsupport/kmsconvenience/qkmsdevice.cpp index a25a1e582f..59db3da776 100644 --- a/src/platformsupport/kmsconvenience/qkmsdevice.cpp +++ b/src/platformsupport/kmsconvenience/qkmsdevice.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2017 The Qt Company Ltd. ** Copyright (C) 2016 Pelagicore AG ** Copyright (C) 2015 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> ** Contact: https://www.qt.io/licensing/ @@ -47,6 +47,8 @@ #include <QtCore/QFile> #include <QtCore/QLoggingCategory> +#include <errno.h> + #define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0]) QT_BEGIN_NAMESPACE @@ -75,7 +77,7 @@ int QKmsDevice::crtcForConnector(drmModeResPtr resources, drmModeConnectorPtr co for (int j = 0; j < resources->count_crtcs; j++) { bool isPossible = possibleCrtcs & (1 << j); - bool isAvailable = !(m_crtc_allocator & 1 << resources->crtcs[j]); + bool isAvailable = !(m_crtc_allocator & (1 << j)); if (isPossible && isAvailable) return j; @@ -162,22 +164,24 @@ static bool parseModeline(const QByteArray &text, drmModeModeInfoPtr mode) QPlatformScreen *QKmsDevice::createScreenForConnector(drmModeResPtr resources, drmModeConnectorPtr connector, - VirtualDesktopInfo *vinfo) + ScreenInfo *vinfo) { + Q_ASSERT(vinfo); const QByteArray connectorName = nameForConnector(connector); const int crtc = crtcForConnector(resources, connector); if (crtc < 0) { qWarning() << "No usable crtc/encoder pair for connector" << connectorName; - return Q_NULLPTR; + return nullptr; } OutputConfiguration configuration; QSize configurationSize; + int configurationRefresh = 0; drmModeModeInfo configurationModeline; auto userConfig = m_screenConfig->outputSettings(); - auto userConnectorConfig = userConfig.value(QString::fromUtf8(connectorName)); + QVariantMap userConnectorConfig = userConfig.value(QString::fromUtf8(connectorName)); // default to the preferred mode unless overridden in the config const QByteArray mode = userConnectorConfig.value(QStringLiteral("mode"), QStringLiteral("preferred")) .toByteArray().toLower(); @@ -187,6 +191,10 @@ QPlatformScreen *QKmsDevice::createScreenForConnector(drmModeResPtr resources, configuration = OutputConfigPreferred; } else if (mode == "current") { configuration = OutputConfigCurrent; + } else if (sscanf(mode.constData(), "%dx%d@%d", &configurationSize.rwidth(), &configurationSize.rheight(), + &configurationRefresh) == 3) + { + configuration = OutputConfigMode; } else if (sscanf(mode.constData(), "%dx%d", &configurationSize.rwidth(), &configurationSize.rheight()) == 2) { configuration = OutputConfigMode; } else if (parseModeline(mode, &configurationModeline)) { @@ -195,31 +203,30 @@ QPlatformScreen *QKmsDevice::createScreenForConnector(drmModeResPtr resources, qWarning("Invalid mode \"%s\" for output %s", mode.constData(), connectorName.constData()); configuration = OutputConfigPreferred; } - if (vinfo) { - *vinfo = VirtualDesktopInfo(); - vinfo->virtualIndex = userConnectorConfig.value(QStringLiteral("virtualIndex"), INT_MAX).toInt(); - if (userConnectorConfig.contains(QStringLiteral("virtualPos"))) { - const QByteArray vpos = userConnectorConfig.value(QStringLiteral("virtualPos")).toByteArray(); - const QByteArrayList vposComp = vpos.split(','); - if (vposComp.count() == 2) - vinfo->virtualPos = QPoint(vposComp[0].trimmed().toInt(), vposComp[1].trimmed().toInt()); - } - if (userConnectorConfig.value(QStringLiteral("primary")).toBool()) - vinfo->isPrimary = true; + + *vinfo = ScreenInfo(); + vinfo->virtualIndex = userConnectorConfig.value(QStringLiteral("virtualIndex"), INT_MAX).toInt(); + if (userConnectorConfig.contains(QStringLiteral("virtualPos"))) { + const QByteArray vpos = userConnectorConfig.value(QStringLiteral("virtualPos")).toByteArray(); + const QByteArrayList vposComp = vpos.split(','); + if (vposComp.count() == 2) + vinfo->virtualPos = QPoint(vposComp[0].trimmed().toInt(), vposComp[1].trimmed().toInt()); } + if (userConnectorConfig.value(QStringLiteral("primary")).toBool()) + vinfo->isPrimary = true; const uint32_t crtc_id = resources->crtcs[crtc]; if (configuration == OutputConfigOff) { qCDebug(qLcKmsDebug) << "Turning off output" << connectorName; - drmModeSetCrtc(m_dri_fd, crtc_id, 0, 0, 0, 0, 0, Q_NULLPTR); - return Q_NULLPTR; + drmModeSetCrtc(m_dri_fd, crtc_id, 0, 0, 0, 0, 0, nullptr); + return nullptr; } // Skip disconnected output if (configuration == OutputConfigPreferred && connector->connection == DRM_MODE_DISCONNECTED) { qCDebug(qLcKmsDebug) << "Skipping disconnected output" << connectorName; - return Q_NULLPTR; + return nullptr; } // Get the current mode on the current crtc @@ -230,7 +237,7 @@ QPlatformScreen *QKmsDevice::createScreenForConnector(drmModeResPtr resources, drmModeFreeEncoder(encoder); if (!crtc) - return Q_NULLPTR; + return nullptr; if (crtc->mode_valid) crtc_mode = crtc->mode; @@ -240,7 +247,8 @@ QPlatformScreen *QKmsDevice::createScreenForConnector(drmModeResPtr resources, QList<drmModeModeInfo> modes; modes.reserve(connector->count_modes); - qCDebug(qLcKmsDebug) << connectorName << "mode count:" << connector->count_modes; + qCDebug(qLcKmsDebug) << connectorName << "mode count:" << connector->count_modes + << "crtc index:" << crtc << "crtc id:" << crtc_id; for (int i = 0; i < connector->count_modes; i++) { const drmModeModeInfo &mode = connector->modes[i]; qCDebug(qLcKmsDebug) << "mode" << i << mode.hdisplay << "x" << mode.vdisplay @@ -256,9 +264,11 @@ QPlatformScreen *QKmsDevice::createScreenForConnector(drmModeResPtr resources, for (int i = modes.size() - 1; i >= 0; i--) { const drmModeModeInfo &m = modes.at(i); - if (configuration == OutputConfigMode && - m.hdisplay == configurationSize.width() && - m.vdisplay == configurationSize.height()) { + if (configuration == OutputConfigMode + && m.hdisplay == configurationSize.width() + && m.vdisplay == configurationSize.height() + && (!configurationRefresh || m.vrefresh == uint32_t(configurationRefresh))) + { configured = i; } @@ -297,7 +307,7 @@ QPlatformScreen *QKmsDevice::createScreenForConnector(drmModeResPtr resources, if (selected_mode < 0) { qWarning() << "No modes available for output" << connectorName; - return Q_NULLPTR; + return nullptr; } else { int width = modes[selected_mode].hdisplay; int height = modes[selected_mode].vdisplay; @@ -324,24 +334,72 @@ QPlatformScreen *QKmsDevice::createScreenForConnector(drmModeResPtr resources, } qCDebug(qLcKmsDebug) << "Physical size is" << physSize << "mm" << "for output" << connectorName; - QKmsOutput output = { - QString::fromUtf8(connectorName), - connector->connector_id, - crtc_id, - physSize, - selected_mode, - selected_mode, - false, - drmModeGetCrtc(m_dri_fd, crtc_id), - modes, - connector->subpixel, - connectorProperty(connector, QByteArrayLiteral("DPMS")), - connectorPropertyBlob(connector, QByteArrayLiteral("EDID")), - false, - 0, - false - }; + const QByteArray formatStr = userConnectorConfig.value(QStringLiteral("format"), QStringLiteral("xrgb8888")) + .toByteArray().toLower(); + uint32_t drmFormat; + if (formatStr == "xrgb8888") { + drmFormat = DRM_FORMAT_XRGB8888; + } else if (formatStr == "xbgr8888") { + drmFormat = DRM_FORMAT_XBGR8888; + } else if (formatStr == "argb8888") { + drmFormat = DRM_FORMAT_ARGB8888; + } else if (formatStr == "abgr8888") { + drmFormat = DRM_FORMAT_ABGR8888; + } else if (formatStr == "rgb565") { + drmFormat = DRM_FORMAT_RGB565; + } else if (formatStr == "bgr565") { + drmFormat = DRM_FORMAT_BGR565; + } else if (formatStr == "xrgb2101010") { + drmFormat = DRM_FORMAT_XRGB2101010; + } else if (formatStr == "xbgr2101010") { + drmFormat = DRM_FORMAT_XBGR2101010; + } else if (formatStr == "argb2101010") { + drmFormat = DRM_FORMAT_ARGB2101010; + } else if (formatStr == "abgr2101010") { + drmFormat = DRM_FORMAT_ABGR2101010; + } else { + qWarning("Invalid pixel format \"%s\" for output %s", formatStr.constData(), connectorName.constData()); + drmFormat = DRM_FORMAT_XRGB8888; + } + + const QString cloneSource = userConnectorConfig.value(QStringLiteral("clones")).toString(); + if (!cloneSource.isEmpty()) + qCDebug(qLcKmsDebug) << "Output" << connectorName << " clones output " << cloneSource; + + QKmsOutput output; + output.name = QString::fromUtf8(connectorName); + output.connector_id = connector->connector_id; + output.crtc_index = crtc; + output.crtc_id = crtc_id; + output.physical_size = physSize; + output.preferred_mode = preferred >= 0 ? preferred : selected_mode; + output.mode = selected_mode; + output.mode_set = false; + output.saved_crtc = drmModeGetCrtc(m_dri_fd, crtc_id); + output.modes = modes; + output.subpixel = connector->subpixel; + output.dpms_prop = connectorProperty(connector, QByteArrayLiteral("DPMS")); + output.edid_blob = connectorPropertyBlob(connector, QByteArrayLiteral("EDID")); + output.wants_forced_plane = false; + output.forced_plane_id = 0; + output.forced_plane_set = false; + output.drm_format = drmFormat; + output.clone_source = cloneSource; + + QString planeListStr; + for (const QKmsPlane &plane : qAsConst(m_planes)) { + if (plane.possibleCrtcs & (1 << output.crtc_index)) { + output.available_planes.append(plane); + planeListStr.append(QString::number(plane.id)); + planeListStr.append(QLatin1Char(' ')); + } + } + qCDebug(qLcKmsDebug, "Output %s can use %d planes: %s", + connectorName.constData(), output.available_planes.count(), qPrintable(planeListStr)); + // This is for the EGLDevice/EGLStream backend. On some of those devices one + // may want to target a pre-configured plane. It is probably useless for + // eglfs_kms and others. Do not confuse with generic plane support (available_planes). bool ok; int idx = qEnvironmentVariableIntValue("QT_QPA_EGLFS_KMS_PLANE_INDEX", &ok); if (ok) { @@ -350,8 +408,8 @@ QPlatformScreen *QKmsDevice::createScreenForConnector(drmModeResPtr resources, if (idx >= 0 && idx < int(planeResources->count_planes)) { drmModePlane *plane = drmModeGetPlane(m_dri_fd, planeResources->planes[idx]); if (plane) { - output.wants_plane = true; - output.plane_id = plane->plane_id; + output.wants_forced_plane = true; + output.forced_plane_id = plane->plane_id; qCDebug(qLcKmsDebug, "Forcing plane index %d, plane id %u (belongs to crtc id %u)", idx, plane->plane_id, plane->crtc_id); drmModeFreePlane(plane); @@ -362,8 +420,9 @@ QPlatformScreen *QKmsDevice::createScreenForConnector(drmModeResPtr resources, } } - m_crtc_allocator |= (1 << output.crtc_id); - m_connector_allocator |= (1 << output.connector_id); + m_crtc_allocator |= (1 << output.crtc_index); + + vinfo->output = output; return createScreen(output); } @@ -381,7 +440,7 @@ drmModePropertyPtr QKmsDevice::connectorProperty(drmModeConnectorPtr connector, drmModeFreeProperty(prop); } - return Q_NULLPTR; + return nullptr; } drmModePropertyBlobPtr QKmsDevice::connectorPropertyBlob(drmModeConnectorPtr connector, const QByteArray &name) @@ -406,7 +465,6 @@ QKmsDevice::QKmsDevice(QKmsScreenConfig *screenConfig, const QString &path) , m_path(path) , m_dri_fd(-1) , m_crtc_allocator(0) - , m_connector_allocator(0) { if (m_path.isEmpty()) { m_path = m_screenConfig->devicePath(); @@ -425,10 +483,10 @@ QKmsDevice::~QKmsDevice() struct OrderedScreen { OrderedScreen() : screen(nullptr) { } - OrderedScreen(QPlatformScreen *screen, const QKmsDevice::VirtualDesktopInfo &vinfo) + OrderedScreen(QPlatformScreen *screen, const QKmsDevice::ScreenInfo &vinfo) : screen(screen), vinfo(vinfo) { } QPlatformScreen *screen; - QKmsDevice::VirtualDesktopInfo vinfo; + QKmsDevice::ScreenInfo vinfo; }; QDebug operator<<(QDebug dbg, const OrderedScreen &s) @@ -449,12 +507,29 @@ static bool orderedScreenLessThan(const OrderedScreen &a, const OrderedScreen &b void QKmsDevice::createScreens() { + // Headless mode using a render node: cannot do any output related DRM + // stuff. Skip it all and register a dummy screen. + if (m_screenConfig->headless()) { + QPlatformScreen *screen = createHeadlessScreen(); + if (screen) { + qCDebug(qLcKmsDebug, "Headless mode enabled"); + registerScreen(screen, true, QPoint(0, 0), QList<QPlatformScreen *>()); + return; + } else { + qWarning("QKmsDevice: Requested headless mode without support in the backend. Request is ignored."); + } + } + + drmSetClientCap(m_dri_fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1); + drmModeResPtr resources = drmModeGetResources(m_dri_fd); if (!resources) { - qWarning("drmModeGetResources failed"); + qErrnoWarning(errno, "drmModeGetResources failed"); return; } + discoverPlanes(); + QVector<OrderedScreen> screens; int wantedConnectorIndex = -1; @@ -475,7 +550,7 @@ void QKmsDevice::createScreens() if (!connector) continue; - VirtualDesktopInfo vinfo; + ScreenInfo vinfo; QPlatformScreen *screen = createScreenForConnector(resources, connector, &vinfo); if (screen) screens.append(OrderedScreen(screen, vinfo)); @@ -490,6 +565,32 @@ void QKmsDevice::createScreens() std::stable_sort(screens.begin(), screens.end(), orderedScreenLessThan); qCDebug(qLcKmsDebug) << "Sorted screen list:" << screens; + // The final list of screens is available, so do the second phase setup. + // Hook up clone sources and targets. + for (const OrderedScreen &orderedScreen : screens) { + QVector<QPlatformScreen *> screensCloningThisScreen; + for (const OrderedScreen &s : screens) { + if (s.vinfo.output.clone_source == orderedScreen.vinfo.output.name) + screensCloningThisScreen.append(s.screen); + } + QPlatformScreen *screenThisScreenClones = nullptr; + if (!orderedScreen.vinfo.output.clone_source.isEmpty()) { + for (const OrderedScreen &s : screens) { + if (s.vinfo.output.name == orderedScreen.vinfo.output.clone_source) { + screenThisScreenClones = s.screen; + break; + } + } + } + if (screenThisScreenClones) + qCDebug(qLcKmsDebug) << orderedScreen.screen->name() << "clones" << screenThisScreenClones; + if (!screensCloningThisScreen.isEmpty()) + qCDebug(qLcKmsDebug) << orderedScreen.screen->name() << "is cloned by" << screensCloningThisScreen; + + registerScreenCloning(orderedScreen.screen, screenThisScreenClones, screensCloningThisScreen); + } + + // Figure out the virtual desktop and register the screens to QPA/QGuiApplication. QPoint pos(0, 0); QList<QPlatformScreen *> siblings; QVector<QPoint> virtualPositions; @@ -531,6 +632,132 @@ void QKmsDevice::createScreens() } } +QPlatformScreen *QKmsDevice::createHeadlessScreen() +{ + // headless mode not supported by default + return nullptr; +} + +// not all subclasses support screen cloning +void QKmsDevice::registerScreenCloning(QPlatformScreen *screen, + QPlatformScreen *screenThisScreenClones, + const QVector<QPlatformScreen *> &screensCloningThisScreen) +{ + Q_UNUSED(screen); + Q_UNUSED(screenThisScreenClones); + Q_UNUSED(screensCloningThisScreen); +} + +// drm_property_type_is is not available in old headers +static inline bool propTypeIs(drmModePropertyPtr prop, uint32_t type) +{ + if (prop->flags & DRM_MODE_PROP_EXTENDED_TYPE) + return (prop->flags & DRM_MODE_PROP_EXTENDED_TYPE) == type; + return prop->flags & type; +} + +void QKmsDevice::enumerateProperties(drmModeObjectPropertiesPtr objProps, PropCallback callback) +{ + for (uint32_t propIdx = 0; propIdx < objProps->count_props; ++propIdx) { + drmModePropertyPtr prop = drmModeGetProperty(m_dri_fd, objProps->props[propIdx]); + if (!prop) + continue; + + const quint64 value = objProps->prop_values[propIdx]; + qCDebug(qLcKmsDebug, " property %d: id = %u name = '%s'", propIdx, prop->prop_id, prop->name); + + if (propTypeIs(prop, DRM_MODE_PROP_SIGNED_RANGE)) { + qCDebug(qLcKmsDebug, " type is SIGNED_RANGE, value is %lld, possible values are:", qint64(value)); + for (int i = 0; i < prop->count_values; ++i) + qCDebug(qLcKmsDebug, " %lld", qint64(prop->values[i])); + } else if (propTypeIs(prop, DRM_MODE_PROP_RANGE)) { + qCDebug(qLcKmsDebug, " type is RANGE, value is %llu, possible values are:", value); + for (int i = 0; i < prop->count_values; ++i) + qCDebug(qLcKmsDebug, " %llu", quint64(prop->values[i])); + } else if (propTypeIs(prop, DRM_MODE_PROP_ENUM)) { + qCDebug(qLcKmsDebug, " type is ENUM, value is %llu, possible values are:", value); + for (int i = 0; i < prop->count_enums; ++i) + qCDebug(qLcKmsDebug, " enum %d: %s - %llu", i, prop->enums[i].name, prop->enums[i].value); + } else if (propTypeIs(prop, DRM_MODE_PROP_BITMASK)) { + qCDebug(qLcKmsDebug, " type is BITMASK, value is %llu, possible bits are:", value); + for (int i = 0; i < prop->count_enums; ++i) + qCDebug(qLcKmsDebug, " bitmask %d: %s - %u", i, prop->enums[i].name, 1 << prop->enums[i].value); + } else if (propTypeIs(prop, DRM_MODE_PROP_BLOB)) { + qCDebug(qLcKmsDebug, " type is BLOB"); + } else if (propTypeIs(prop, DRM_MODE_PROP_OBJECT)) { + qCDebug(qLcKmsDebug, " type is OBJECT"); + } + + callback(prop, value); + + drmModeFreeProperty(prop); + } +} + +void QKmsDevice::discoverPlanes() +{ + m_planes.clear(); + + drmModePlaneResPtr planeResources = drmModeGetPlaneResources(m_dri_fd); + if (!planeResources) + return; + + const int countPlanes = planeResources->count_planes; + qCDebug(qLcKmsDebug, "Found %d planes", countPlanes); + for (int planeIdx = 0; planeIdx < countPlanes; ++planeIdx) { + drmModePlanePtr drmplane = drmModeGetPlane(m_dri_fd, planeResources->planes[planeIdx]); + if (!drmplane) { + qCDebug(qLcKmsDebug, "Failed to query plane %d, ignoring", planeIdx); + continue; + } + + QKmsPlane plane; + plane.id = drmplane->plane_id; + plane.possibleCrtcs = drmplane->possible_crtcs; + + const int countFormats = drmplane->count_formats; + QString formatStr; + for (int i = 0; i < countFormats; ++i) { + uint32_t f = drmplane->formats[i]; + plane.supportedFormats.append(f); + QString s; + s.sprintf("%c%c%c%c ", f, f >> 8, f >> 16, f >> 24); + formatStr += s; + } + + qCDebug(qLcKmsDebug, "plane %d: id = %u countFormats = %d possibleCrtcs = 0x%x supported formats = %s", + planeIdx, plane.id, countFormats, plane.possibleCrtcs, qPrintable(formatStr)); + + drmModeFreePlane(drmplane); + + drmModeObjectPropertiesPtr objProps = drmModeObjectGetProperties(m_dri_fd, plane.id, DRM_MODE_OBJECT_PLANE); + if (!objProps) { + qCDebug(qLcKmsDebug, "Failed to query plane %d object properties, ignoring", planeIdx); + continue; + } + + enumerateProperties(objProps, [&plane](drmModePropertyPtr prop, quint64 value) { + if (!strcmp(prop->name, "type")) { + plane.type = QKmsPlane::Type(value); + } else if (!strcmp(prop->name, "rotation")) { + plane.initialRotation = QKmsPlane::Rotations(int(value)); + plane.availableRotations = 0; + if (propTypeIs(prop, DRM_MODE_PROP_BITMASK)) { + for (int i = 0; i < prop->count_enums; ++i) + plane.availableRotations |= QKmsPlane::Rotation(1 << prop->enums[i].value); + } + plane.rotationPropertyId = prop->prop_id; + } + }); + + m_planes.append(plane); + + drmModeFreeObjectProperties(objProps); + } + + drmModeFreePlaneResources(planeResources); +} + int QKmsDevice::fd() const { return m_dri_fd; @@ -552,7 +779,8 @@ QKmsScreenConfig *QKmsDevice::screenConfig() const } QKmsScreenConfig::QKmsScreenConfig() - : m_hwCursor(true) + : m_headless(false) + , m_hwCursor(true) , m_separateScreens(false) , m_pbuffers(false) , m_virtualDesktopLayout(VirtualDesktopLayoutHorizontal) @@ -587,6 +815,16 @@ void QKmsScreenConfig::loadConfig() const QJsonObject object = doc.object(); + const QString headlessStr = object.value(QLatin1String("headless")).toString(); + const QByteArray headless = headlessStr.toUtf8(); + QSize headlessSize; + if (sscanf(headless.constData(), "%dx%d", &headlessSize.rwidth(), &headlessSize.rheight()) == 2) { + m_headless = true; + m_headlessSize = headlessSize; + } else { + m_headless = false; + } + m_hwCursor = object.value(QLatin1String("hwcursor")).toBool(m_hwCursor); m_pbuffers = object.value(QLatin1String("pbuffers")).toBool(m_pbuffers); m_devicePath = object.value(QLatin1String("device")).toString(); @@ -618,6 +856,7 @@ void QKmsScreenConfig::loadConfig() } qCDebug(qLcKmsDebug) << "Requested configuration (some settings may be ignored):\n" + << "\theadless:" << m_headless << "\n" << "\thwcursor:" << m_hwCursor << "\n" << "\tpbuffers:" << m_pbuffers << "\n" << "\tseparateScreens:" << m_separateScreens << "\n" diff --git a/src/platformsupport/kmsconvenience/qkmsdevice_p.h b/src/platformsupport/kmsconvenience/qkmsdevice_p.h index 964a0b1775..5eecedec39 100644 --- a/src/platformsupport/kmsconvenience/qkmsdevice_p.h +++ b/src/platformsupport/kmsconvenience/qkmsdevice_p.h @@ -59,6 +59,42 @@ #include <xf86drm.h> #include <xf86drmMode.h> +#include <drm_fourcc.h> + +#include <functional> + +// In less fortunate cases one may need to build on a system with dev headers +// from the dark ages. Let's pull a GL and define the missing stuff outselves. + +#ifndef DRM_PLANE_TYPE_OVERLAY +#define DRM_PLANE_TYPE_OVERLAY 0 +#endif +#ifndef DRM_PLANE_TYPE_PRIMARY +#define DRM_PLANE_TYPE_PRIMARY 1 +#endif +#ifndef DRM_PLANE_TYPE_CURSOR +#define DRM_PLANE_TYPE_CURSOR 2 +#endif + +#ifndef DRM_CLIENT_CAP_UNIVERSAL_PLANES +#define DRM_CLIENT_CAP_UNIVERSAL_PLANES 2 +#endif +#ifndef DRM_CLIENT_CAP_ATOMIC +#define DRM_CLIENT_CAP_ATOMIC 3 +#endif + +#ifndef DRM_MODE_PROP_EXTENDED_TYPE +#define DRM_MODE_PROP_EXTENDED_TYPE 0x0000ffc0 +#endif +#ifndef DRM_MODE_PROP_TYPE +#define DRM_MODE_PROP_TYPE(n) ((n) << 6) +#endif +#ifndef DRM_MODE_PROP_OBJECT +#define DRM_MODE_PROP_OBJECT DRM_MODE_PROP_TYPE(1) +#endif +#ifndef DRM_MODE_PROP_SIGNED_RANGE +#define DRM_MODE_PROP_SIGNED_RANGE DRM_MODE_PROP_TYPE(2) +#endif QT_BEGIN_NAMESPACE @@ -76,6 +112,8 @@ public: QString devicePath() const { return m_devicePath; } + bool headless() const { return m_headless; } + QSize headlessSize() const { return m_headlessSize; } bool hwCursor() const { return m_hwCursor; } bool separateScreens() const { return m_separateScreens; } bool supportsPBuffers() const { return m_pbuffers; } @@ -87,6 +125,8 @@ private: void loadConfig(); QString m_devicePath; + bool m_headless; + QSize m_headlessSize; bool m_hwCursor; bool m_separateScreens; bool m_pbuffers; @@ -94,23 +134,63 @@ private: QMap<QString, QVariantMap> m_outputSettings; }; +// NB! QKmsPlane does not store the current state and offers no functions to +// change object properties. Any such functionality belongs to subclasses since +// in some cases atomic operations will be desired where a mere +// drmModeObjectSetProperty would not be acceptable. +struct QKmsPlane +{ + enum Type { + OverlayPlane = DRM_PLANE_TYPE_OVERLAY, + PrimaryPlane = DRM_PLANE_TYPE_PRIMARY, + CursorPlane = DRM_PLANE_TYPE_CURSOR + }; + + enum Rotation { + Rotation0 = 1 << 0, + Rotation90 = 1 << 1, + Rotation180 = 1 << 2, + Rotation270 = 1 << 3, + RotationReflectX = 1 << 4, + RotationReflectY = 1 << 5 + }; + Q_DECLARE_FLAGS(Rotations, Rotation) + + uint32_t id = 0; + Type type = OverlayPlane; + + int possibleCrtcs = 0; + + QVector<uint32_t> supportedFormats; + + Rotations initialRotation = Rotation0; + Rotations availableRotations = Rotation0; + uint32_t rotationPropertyId = 0; +}; + +Q_DECLARE_OPERATORS_FOR_FLAGS(QKmsPlane::Rotations) + struct QKmsOutput { QString name; - uint32_t connector_id; - uint32_t crtc_id; + uint32_t connector_id = 0; + uint32_t crtc_index = 0; + uint32_t crtc_id = 0; QSizeF physical_size; - int preferred_mode; // index of preferred mode in list below - int mode; // index of selected mode in list below - bool mode_set; - drmModeCrtcPtr saved_crtc; + int preferred_mode = -1; // index of preferred mode in list below + int mode = -1; // index of selected mode in list below + bool mode_set = false; + drmModeCrtcPtr saved_crtc = nullptr; QList<drmModeModeInfo> modes; - int subpixel; - drmModePropertyPtr dpms_prop; - drmModePropertyBlobPtr edid_blob; - bool wants_plane; - uint32_t plane_id; - bool plane_set; + int subpixel = DRM_MODE_SUBPIXEL_UNKNOWN; + drmModePropertyPtr dpms_prop = nullptr; + drmModePropertyBlobPtr edid_blob = nullptr; + bool wants_forced_plane = false; + uint32_t forced_plane_id = 0; + bool forced_plane_set = false; + uint32_t drm_format = DRM_FORMAT_XRGB8888; + QString clone_source; + QVector<QKmsPlane> available_planes; void restoreMode(QKmsDevice *device); void cleanup(QKmsDevice *device); @@ -121,11 +201,11 @@ struct QKmsOutput class QKmsDevice { public: - struct VirtualDesktopInfo { - VirtualDesktopInfo() : virtualIndex(0), isPrimary(false) { } - int virtualIndex; + struct ScreenInfo { + int virtualIndex = 0; QPoint virtualPos; - bool isPrimary; + bool isPrimary = false; + QKmsOutput output; }; QKmsDevice(QKmsScreenConfig *screenConfig, const QString &path = QString()); @@ -144,6 +224,10 @@ public: protected: virtual QPlatformScreen *createScreen(const QKmsOutput &output) = 0; + virtual QPlatformScreen *createHeadlessScreen(); + virtual void registerScreenCloning(QPlatformScreen *screen, + QPlatformScreen *screenThisScreenClones, + const QVector<QPlatformScreen *> &screensCloningThisScreen); virtual void registerScreen(QPlatformScreen *screen, bool isPrimary, const QPoint &virtualPos, @@ -153,16 +237,20 @@ protected: int crtcForConnector(drmModeResPtr resources, drmModeConnectorPtr connector); QPlatformScreen *createScreenForConnector(drmModeResPtr resources, drmModeConnectorPtr connector, - VirtualDesktopInfo *vinfo); + ScreenInfo *vinfo); drmModePropertyPtr connectorProperty(drmModeConnectorPtr connector, const QByteArray &name); drmModePropertyBlobPtr connectorPropertyBlob(drmModeConnectorPtr connector, const QByteArray &name); + typedef std::function<void(drmModePropertyPtr, quint64)> PropCallback; + void enumerateProperties(drmModeObjectPropertiesPtr objProps, PropCallback callback); + void discoverPlanes(); QKmsScreenConfig *m_screenConfig; QString m_path; int m_dri_fd; quint32 m_crtc_allocator; - quint32 m_connector_allocator; + + QVector<QKmsPlane> m_planes; private: Q_DISABLE_COPY(QKmsDevice) diff --git a/src/platformsupport/linuxaccessibility/bridge_p.h b/src/platformsupport/linuxaccessibility/bridge_p.h index 1e435ca351..c48bbd3710 100644 --- a/src/platformsupport/linuxaccessibility/bridge_p.h +++ b/src/platformsupport/linuxaccessibility/bridge_p.h @@ -74,7 +74,7 @@ public: virtual ~QSpiAccessibleBridge(); - void notifyAccessibilityUpdate(QAccessibleEvent *event) Q_DECL_OVERRIDE; + void notifyAccessibilityUpdate(QAccessibleEvent *event) override; QDBusConnection dBusConnection() const; public Q_SLOTS: diff --git a/src/platformsupport/platformcompositor/qopenglcompositorbackingstore.cpp b/src/platformsupport/platformcompositor/qopenglcompositorbackingstore.cpp index e938020437..40400e2a19 100644 --- a/src/platformsupport/platformcompositor/qopenglcompositorbackingstore.cpp +++ b/src/platformsupport/platformcompositor/qopenglcompositorbackingstore.cpp @@ -196,7 +196,7 @@ void QOpenGLCompositorBackingStore::flush(QWindow *window, const QRegion ®ion dstCtx->makeCurrent(dstWin); updateTexture(); m_textures->clear(); - m_textures->appendTexture(Q_NULLPTR, m_bsTexture, window->geometry()); + m_textures->appendTexture(nullptr, m_bsTexture, window->geometry()); compositor->update(); } @@ -233,7 +233,7 @@ void QOpenGLCompositorBackingStore::composeAndFlush(QWindow *window, const QRegi textures->clipRect(i), textures->flags(i)); updateTexture(); - m_textures->appendTexture(Q_NULLPTR, m_bsTexture, window->geometry()); + m_textures->appendTexture(nullptr, m_bsTexture, window->geometry()); textures->lock(true); m_lockedWidgetTextures = textures; @@ -280,7 +280,7 @@ void QOpenGLCompositorBackingStore::resize(const QSize &size, const QRegion &sta if (m_bsTexture) { glDeleteTextures(1, &m_bsTexture); m_bsTexture = 0; - m_bsTextureContext = Q_NULLPTR; + m_bsTextureContext = nullptr; } } diff --git a/src/platformsupport/platformcompositor/qopenglcompositorbackingstore_p.h b/src/platformsupport/platformcompositor/qopenglcompositorbackingstore_p.h index da68b90e92..d88738ea8f 100644 --- a/src/platformsupport/platformcompositor/qopenglcompositorbackingstore_p.h +++ b/src/platformsupport/platformcompositor/qopenglcompositorbackingstore_p.h @@ -66,17 +66,17 @@ public: QOpenGLCompositorBackingStore(QWindow *window); ~QOpenGLCompositorBackingStore(); - QPaintDevice *paintDevice() Q_DECL_OVERRIDE; + QPaintDevice *paintDevice() override; - void beginPaint(const QRegion ®ion) Q_DECL_OVERRIDE; + void beginPaint(const QRegion ®ion) override; - void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) Q_DECL_OVERRIDE; - void resize(const QSize &size, const QRegion &staticContents) Q_DECL_OVERRIDE; + void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; + void resize(const QSize &size, const QRegion &staticContents) override; - QImage toImage() const Q_DECL_OVERRIDE; + QImage toImage() const override; void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, - bool translucentBackground) Q_DECL_OVERRIDE; + bool translucentBackground) override; const QPlatformTextureList *textures() const { return m_textures; } diff --git a/src/platformsupport/platformsupport.pro b/src/platformsupport/platformsupport.pro index 5549984d6a..4f2f56f01f 100644 --- a/src/platformsupport/platformsupport.pro +++ b/src/platformsupport/platformsupport.pro @@ -34,6 +34,7 @@ qtConfig(accessibility) { SUBDIRS += linuxaccessibility linuxaccessibility.depends += accessibility } + win32:!winrt: SUBDIRS += windowsuiautomation } darwin { diff --git a/src/platformsupport/services/genericunix/qgenericunixservices.cpp b/src/platformsupport/services/genericunix/qgenericunixservices.cpp index cdb5d33859..cb1e367b9f 100644 --- a/src/platformsupport/services/genericunix/qgenericunixservices.cpp +++ b/src/platformsupport/services/genericunix/qgenericunixservices.cpp @@ -49,6 +49,24 @@ #include <QtCore/QStandardPaths> #include <QtCore/QUrl> +#if QT_CONFIG(dbus) +// These QtCore includes are needed for flatpak support +#include <QtCore/private/qcore_unix_p.h> + +#include <QtCore/QFileInfo> +#include <QtCore/QUrlQuery> + +#include <QtDBus/QDBusConnection> +#include <QtDBus/QDBusMessage> +#include <QtDBus/QDBusPendingCall> +#include <QtDBus/QDBusPendingCallWatcher> +#include <QtDBus/QDBusPendingReply> +#include <QtDBus/QDBusUnixFileDescriptor> + +#include <fcntl.h> + +#endif // QT_CONFIG(dbus) + #include <stdlib.h> QT_BEGIN_NAMESPACE @@ -153,6 +171,83 @@ static inline bool launch(const QString &launcher, const QUrl &url) return ok; } +#if QT_CONFIG(dbus) +static inline bool checkRunningUnderFlatpak() +{ + return !QStandardPaths::locate(QStandardPaths::RuntimeLocation, QLatin1String("flatpak-info")).isEmpty(); +} + +static inline bool flatpakOpenUrl(const QUrl &url) +{ + // DBus signature: + // OpenURI (IN s parent_window, + // IN s uri, + // IN a{sv} options, + // OUT o handle) + // Options: + // writable (b) - Whether to allow the chosen application to write to the file. + // This key only takes effect the uri points to a local file that is exported in the document portal, + // and the chosen application is sandboxed itself. + + QDBusMessage message = QDBusMessage::createMethodCall(QLatin1String("org.freedesktop.portal.Desktop"), + QLatin1String("/org/freedesktop/portal/desktop"), + QLatin1String("org.freedesktop.portal.OpenURI"), + QLatin1String("OpenURI")); + // FIXME parent_window_id and handle writable option + message << QString() << url.toString() << QVariantMap(); + + QDBusPendingReply<QDBusObjectPath> reply = QDBusConnection::sessionBus().call(message); + return !reply.isError(); +} + +static inline bool flatpakSendEmail(const QUrl &url) +{ + // DBus signature: + // ComposeEmail (IN s parent_window, + // IN a{sv} options, + // OUT o handle) + // Options: + // address (s) - The email address to send to. + // subject (s) - The subject for the email. + // body (s) - The body for the email. + // attachment_fds (ah) - File descriptors for files to attach. + + QUrlQuery urlQuery(url); + QVariantMap options; + options.insert(QLatin1String("address"), url.path()); + options.insert(QLatin1String("subject"), urlQuery.queryItemValue(QLatin1String("subject"))); + options.insert(QLatin1String("body"), urlQuery.queryItemValue(QLatin1String("body"))); + + // O_PATH seems to be present since Linux 2.6.39, which is not case of RHEL 6 +#ifdef O_PATH + QList<QDBusUnixFileDescriptor> attachments; + const QStringList attachmentUris = urlQuery.allQueryItemValues(QLatin1String("attachment")); + + for (const QString &attachmentUri : attachmentUris) { + const int fd = qt_safe_open(QFile::encodeName(attachmentUri), O_PATH); + if (fd != -1) { + QDBusUnixFileDescriptor descriptor(fd); + attachments << descriptor; + qt_safe_close(fd); + } + } + + options.insert(QLatin1String("attachment_fds"), QVariant::fromValue(attachments)); +#endif + + QDBusMessage message = QDBusMessage::createMethodCall(QLatin1String("org.freedesktop.portal.Desktop"), + QLatin1String("/org/freedesktop/portal/desktop"), + QLatin1String("org.freedesktop.portal.Email"), + QLatin1String("ComposeEmail")); + + // FIXME parent_window_id + message << QString() << options; + + QDBusPendingReply<QDBusObjectPath> reply = QDBusConnection::sessionBus().call(message); + return !reply.isError(); +} +#endif // QT_CONFIG(dbus) + QByteArray QGenericUnixServices::desktopEnvironment() const { static const QByteArray result = detectDesktopEnvironment(); @@ -161,8 +256,18 @@ QByteArray QGenericUnixServices::desktopEnvironment() const bool QGenericUnixServices::openUrl(const QUrl &url) { - if (url.scheme() == QLatin1String("mailto")) + if (url.scheme() == QLatin1String("mailto")) { +#if QT_CONFIG(dbus) + if (checkRunningUnderFlatpak()) + return flatpakSendEmail(url); +#endif return openDocument(url); + } + +#if QT_CONFIG(dbus) + if (checkRunningUnderFlatpak()) + return flatpakOpenUrl(url); +#endif if (m_webBrowser.isEmpty() && !detectWebBrowser(desktopEnvironment(), true, &m_webBrowser)) { qWarning("Unable to detect a web browser to launch '%s'", qPrintable(url.toString())); diff --git a/src/platformsupport/services/genericunix/qgenericunixservices_p.h b/src/platformsupport/services/genericunix/qgenericunixservices_p.h index 205b2e6160..8ac3de6f03 100644 --- a/src/platformsupport/services/genericunix/qgenericunixservices_p.h +++ b/src/platformsupport/services/genericunix/qgenericunixservices_p.h @@ -61,10 +61,10 @@ class QGenericUnixServices : public QPlatformServices public: QGenericUnixServices() {} - QByteArray desktopEnvironment() const Q_DECL_OVERRIDE; + QByteArray desktopEnvironment() const override; - bool openUrl(const QUrl &url) Q_DECL_OVERRIDE; - bool openDocument(const QUrl &url) Q_DECL_OVERRIDE; + bool openUrl(const QUrl &url) override; + bool openDocument(const QUrl &url) override; private: QString m_webBrowser; diff --git a/src/platformsupport/services/services.pro b/src/platformsupport/services/services.pro index 91957a0a78..2027c7b5be 100644 --- a/src/platformsupport/services/services.pro +++ b/src/platformsupport/services/services.pro @@ -2,6 +2,8 @@ TARGET = QtServiceSupport MODULE = service_support QT = core-private gui-private +qtConfig(dbus): QT += dbus + CONFIG += static internal_module DEFINES += QT_NO_CAST_FROM_ASCII diff --git a/src/platformsupport/themes/genericunix/dbusmenu/qdbusmenuadaptor.cpp b/src/platformsupport/themes/genericunix/dbusmenu/qdbusmenuadaptor.cpp index 354b9c3a2e..eabb4b4122 100644 --- a/src/platformsupport/themes/genericunix/dbusmenu/qdbusmenuadaptor.cpp +++ b/src/platformsupport/themes/genericunix/dbusmenu/qdbusmenuadaptor.cpp @@ -122,7 +122,7 @@ void QDBusMenuAdaptor::Event(int id, const QString &eventId, const QDBusVariant emit item->hovered(); if (eventId == QLatin1String("closed")) { // There is no explicit AboutToHide method, so map closed event to aboutToHide method - const QDBusPlatformMenu *menu = Q_NULLPTR; + const QDBusPlatformMenu *menu = nullptr; if (item) menu = static_cast<const QDBusPlatformMenu *>(item->menu()); else if (id == 0) diff --git a/src/platformsupport/themes/genericunix/dbusmenu/qdbusmenubar_p.h b/src/platformsupport/themes/genericunix/dbusmenu/qdbusmenubar_p.h index 8266a395f5..364e7da4b6 100644 --- a/src/platformsupport/themes/genericunix/dbusmenu/qdbusmenubar_p.h +++ b/src/platformsupport/themes/genericunix/dbusmenu/qdbusmenubar_p.h @@ -67,12 +67,12 @@ public: QDBusMenuBar(); virtual ~QDBusMenuBar(); - void insertMenu(QPlatformMenu *menu, QPlatformMenu *before) Q_DECL_OVERRIDE; - void removeMenu(QPlatformMenu *menu) Q_DECL_OVERRIDE; - void syncMenu(QPlatformMenu *menu) Q_DECL_OVERRIDE; - void handleReparent(QWindow *newParentWindow) Q_DECL_OVERRIDE; - QPlatformMenu *menuForTag(quintptr tag) const Q_DECL_OVERRIDE; - QPlatformMenu *createMenu() const Q_DECL_OVERRIDE; + void insertMenu(QPlatformMenu *menu, QPlatformMenu *before) override; + void removeMenu(QPlatformMenu *menu) override; + void syncMenu(QPlatformMenu *menu) override; + void handleReparent(QWindow *newParentWindow) override; + QPlatformMenu *menuForTag(quintptr tag) const override; + QPlatformMenu *createMenu() const override; private: QDBusPlatformMenu *m_menu; diff --git a/src/platformsupport/themes/genericunix/dbusmenu/qdbusplatformmenu.cpp b/src/platformsupport/themes/genericunix/dbusmenu/qdbusplatformmenu.cpp index 51c690d43a..fc1b37f2f2 100644 --- a/src/platformsupport/themes/genericunix/dbusmenu/qdbusplatformmenu.cpp +++ b/src/platformsupport/themes/genericunix/dbusmenu/qdbusplatformmenu.cpp @@ -68,7 +68,7 @@ QDBusPlatformMenuItem::~QDBusPlatformMenuItem() { menuItemsByID.remove(m_dbusID); if (m_subMenu) - static_cast<QDBusPlatformMenu *>(m_subMenu)->setContainingMenuItem(Q_NULLPTR); + static_cast<QDBusPlatformMenu *>(m_subMenu)->setContainingMenuItem(nullptr); } void QDBusPlatformMenuItem::setText(const QString &text) @@ -88,7 +88,7 @@ void QDBusPlatformMenuItem::setIcon(const QIcon &icon) void QDBusPlatformMenuItem::setMenu(QPlatformMenu *menu) { if (m_subMenu) - static_cast<QDBusPlatformMenu *>(m_subMenu)->setContainingMenuItem(Q_NULLPTR); + static_cast<QDBusPlatformMenu *>(m_subMenu)->setContainingMenuItem(nullptr); m_subMenu = menu; if (menu) static_cast<QDBusPlatformMenu *>(menu)->setContainingMenuItem(this); @@ -147,7 +147,7 @@ QDBusPlatformMenuItem *QDBusPlatformMenuItem::byId(int id) // a default-constructed nullptr value into menuItemsByID if (menuItemsByID.contains(id)) return menuItemsByID[id]; - return Q_NULLPTR; + return nullptr; } QList<const QDBusPlatformMenuItem *> QDBusPlatformMenuItem::byIds(const QList<int> &ids) @@ -165,14 +165,14 @@ QDBusPlatformMenu::QDBusPlatformMenu() : m_isEnabled(true) , m_isVisible(true) , m_revision(1) - , m_containingMenuItem(Q_NULLPTR) + , m_containingMenuItem(nullptr) { } QDBusPlatformMenu::~QDBusPlatformMenu() { if (m_containingMenuItem) - m_containingMenuItem->setMenu(Q_NULLPTR); + m_containingMenuItem->setMenu(nullptr); } void QDBusPlatformMenu::insertMenuItem(QPlatformMenuItem *menuItem, QPlatformMenuItem *before) diff --git a/src/platformsupport/themes/genericunix/dbusmenu/qdbusplatformmenu_p.h b/src/platformsupport/themes/genericunix/dbusmenu/qdbusplatformmenu_p.h index 5458e2fdd5..8a31f82fb0 100644 --- a/src/platformsupport/themes/genericunix/dbusmenu/qdbusplatformmenu_p.h +++ b/src/platformsupport/themes/genericunix/dbusmenu/qdbusplatformmenu_p.h @@ -77,31 +77,31 @@ public: ~QDBusPlatformMenuItem(); const QString text() const { return m_text; } - void setText(const QString &text) Q_DECL_OVERRIDE; + void setText(const QString &text) override; QIcon icon() const { return m_icon; } - void setIcon(const QIcon &icon) Q_DECL_OVERRIDE; + void setIcon(const QIcon &icon) override; const QPlatformMenu *menu() const { return m_subMenu; } - void setMenu(QPlatformMenu *menu) Q_DECL_OVERRIDE; + void setMenu(QPlatformMenu *menu) override; bool isEnabled() const { return m_isEnabled; } - void setEnabled(bool enabled) Q_DECL_OVERRIDE; + void setEnabled(bool enabled) override; bool isVisible() const { return m_isVisible; } - void setVisible(bool isVisible) Q_DECL_OVERRIDE; + void setVisible(bool isVisible) override; bool isSeparator() const { return m_isSeparator; } - void setIsSeparator(bool isSeparator) Q_DECL_OVERRIDE; - void setFont(const QFont &font) Q_DECL_OVERRIDE { Q_UNUSED(font); } - void setRole(MenuRole role) Q_DECL_OVERRIDE; + void setIsSeparator(bool isSeparator) override; + void setFont(const QFont &font) override { Q_UNUSED(font); } + void setRole(MenuRole role) override; bool isCheckable() const { return m_isCheckable; } - void setCheckable(bool checkable) Q_DECL_OVERRIDE; + void setCheckable(bool checkable) override; bool isChecked() const { return m_isChecked; } - void setChecked(bool isChecked) Q_DECL_OVERRIDE; + void setChecked(bool isChecked) override; bool hasExclusiveGroup() const { return m_hasExclusiveGroup; } - void setHasExclusiveGroup(bool hasExclusiveGroup) Q_DECL_OVERRIDE; + void setHasExclusiveGroup(bool hasExclusiveGroup) override; #ifndef QT_NO_SHORTCUT QKeySequence shortcut() const { return m_shortcut; } - void setShortcut(const QKeySequence& shortcut) Q_DECL_OVERRIDE; + void setShortcut(const QKeySequence& shortcut) override; #endif - void setIconSize(int size) Q_DECL_OVERRIDE { Q_UNUSED(size); } - void setNativeContents(WId item) Q_DECL_OVERRIDE { Q_UNUSED(item); } + void setIconSize(int size) override { Q_UNUSED(size); } + void setNativeContents(WId item) override { Q_UNUSED(item); } int dbusID() const { return m_dbusID; } @@ -133,35 +133,35 @@ class QDBusPlatformMenu : public QPlatformMenu public: QDBusPlatformMenu(); ~QDBusPlatformMenu(); - void insertMenuItem(QPlatformMenuItem *menuItem, QPlatformMenuItem *before) Q_DECL_OVERRIDE; - void removeMenuItem(QPlatformMenuItem *menuItem) Q_DECL_OVERRIDE; + void insertMenuItem(QPlatformMenuItem *menuItem, QPlatformMenuItem *before) override; + void removeMenuItem(QPlatformMenuItem *menuItem) override; void syncSubMenu(const QDBusPlatformMenu *menu); - void syncMenuItem(QPlatformMenuItem *menuItem) Q_DECL_OVERRIDE; - void syncSeparatorsCollapsible(bool enable) Q_DECL_OVERRIDE { Q_UNUSED(enable); } + void syncMenuItem(QPlatformMenuItem *menuItem) override; + void syncSeparatorsCollapsible(bool enable) override { Q_UNUSED(enable); } const QString text() const { return m_text; } - void setText(const QString &text) Q_DECL_OVERRIDE; + void setText(const QString &text) override; QIcon icon() const { return m_icon; } - void setIcon(const QIcon &icon) Q_DECL_OVERRIDE; - bool isEnabled() const Q_DECL_OVERRIDE { return m_isEnabled; } - void setEnabled(bool enabled) Q_DECL_OVERRIDE; + void setIcon(const QIcon &icon) override; + bool isEnabled() const override { return m_isEnabled; } + void setEnabled(bool enabled) override; bool isVisible() const { return m_isVisible; } - void setVisible(bool visible) Q_DECL_OVERRIDE; - void setMinimumWidth(int width) Q_DECL_OVERRIDE { Q_UNUSED(width); } - void setFont(const QFont &font) Q_DECL_OVERRIDE { Q_UNUSED(font); } - void setMenuType(MenuType type) Q_DECL_OVERRIDE { Q_UNUSED(type); } + void setVisible(bool visible) override; + void setMinimumWidth(int width) override { Q_UNUSED(width); } + void setFont(const QFont &font) override { Q_UNUSED(font); } + void setMenuType(MenuType type) override { Q_UNUSED(type); } void setContainingMenuItem(QDBusPlatformMenuItem *item); - void showPopup(const QWindow *parentWindow, const QRect &targetRect, const QPlatformMenuItem *item) Q_DECL_OVERRIDE; + void showPopup(const QWindow *parentWindow, const QRect &targetRect, const QPlatformMenuItem *item) override; - void dismiss() Q_DECL_OVERRIDE { } // Closes this and all its related menu popups + void dismiss() override { } // Closes this and all its related menu popups - QPlatformMenuItem *menuItemAt(int position) const Q_DECL_OVERRIDE; - QPlatformMenuItem *menuItemForTag(quintptr tag) const Q_DECL_OVERRIDE; + QPlatformMenuItem *menuItemAt(int position) const override; + QPlatformMenuItem *menuItemForTag(quintptr tag) const override; const QList<QDBusPlatformMenuItem *> items() const; - QPlatformMenuItem *createMenuItem() const Q_DECL_OVERRIDE; - QPlatformMenu *createSubMenu() const Q_DECL_OVERRIDE; + QPlatformMenuItem *createMenuItem() const override; + QPlatformMenu *createSubMenu() const override; uint revision() const { return m_revision; } diff --git a/src/platformsupport/themes/genericunix/dbustray/qdbustrayicon.cpp b/src/platformsupport/themes/genericunix/dbustray/qdbustrayicon.cpp index 9baf94726d..8480c15fb7 100644 --- a/src/platformsupport/themes/genericunix/dbustray/qdbustrayicon.cpp +++ b/src/platformsupport/themes/genericunix/dbustray/qdbustrayicon.cpp @@ -102,17 +102,17 @@ static int instanceCount = 0; */ QDBusTrayIcon::QDBusTrayIcon() - : m_dbusConnection(Q_NULLPTR) + : m_dbusConnection(nullptr) , m_adaptor(new QStatusNotifierItemAdaptor(this)) - , m_menuAdaptor(Q_NULLPTR) - , m_menu(Q_NULLPTR) - , m_notifier(Q_NULLPTR) + , m_menuAdaptor(nullptr) + , m_menu(nullptr) + , m_notifier(nullptr) , m_instanceId(KDEItemFormat.arg(QCoreApplication::applicationPid()).arg(++instanceCount)) , m_category(QStringLiteral("ApplicationStatus")) , m_defaultStatus(QStringLiteral("Active")) // be visible all the time. QSystemTrayIcon has no API to control this. , m_status(m_defaultStatus) - , m_tempIcon(Q_NULLPTR) - , m_tempAttentionIcon(Q_NULLPTR) + , m_tempIcon(nullptr) + , m_tempAttentionIcon(nullptr) , m_registered(false) { qCDebug(qLcTray); @@ -149,9 +149,9 @@ void QDBusTrayIcon::cleanup() if (m_registered) dBusConnection()->unregisterTrayIcon(this); delete m_dbusConnection; - m_dbusConnection = Q_NULLPTR; + m_dbusConnection = nullptr; delete m_notifier; - m_notifier = Q_NULLPTR; + m_notifier = nullptr; m_registered = false; } @@ -203,7 +203,7 @@ QTemporaryFile *QDBusTrayIcon::tempIcon(const QIcon &icon) necessity_checked = true; } if (!necessary) - return Q_NULLPTR; + return nullptr; qreal dpr = qGuiApp->devicePixelRatio(); QTemporaryFile *ret = new QTemporaryFile(TempFileTemplate, this); ret->open(); diff --git a/src/platformsupport/themes/genericunix/dbustray/qdbustrayicon_p.h b/src/platformsupport/themes/genericunix/dbustray/qdbustrayicon_p.h index 4c9bc8f7e3..7034a7edb4 100644 --- a/src/platformsupport/themes/genericunix/dbustray/qdbustrayicon_p.h +++ b/src/platformsupport/themes/genericunix/dbustray/qdbustrayicon_p.h @@ -91,18 +91,18 @@ public: QDBusMenuConnection * dBusConnection(); - void init() Q_DECL_OVERRIDE; - void cleanup() Q_DECL_OVERRIDE; - void updateIcon(const QIcon &icon) Q_DECL_OVERRIDE; - void updateToolTip(const QString &tooltip) Q_DECL_OVERRIDE; - void updateMenu(QPlatformMenu *menu) Q_DECL_OVERRIDE; - QPlatformMenu *createMenu() const Q_DECL_OVERRIDE; + void init() override; + void cleanup() override; + void updateIcon(const QIcon &icon) override; + void updateToolTip(const QString &tooltip) override; + void updateMenu(QPlatformMenu *menu) override; + QPlatformMenu *createMenu() const override; void showMessage(const QString &title, const QString &msg, - const QIcon &icon, MessageIcon iconType, int msecs) Q_DECL_OVERRIDE; + const QIcon &icon, MessageIcon iconType, int msecs) override; - bool isSystemTrayAvailable() const Q_DECL_OVERRIDE; - bool supportsMessages() const Q_DECL_OVERRIDE { return true; } - QRect geometry() const Q_DECL_OVERRIDE { return QRect(); } + bool isSystemTrayAvailable() const override; + bool supportsMessages() const override { return true; } + QRect geometry() const override { return QRect(); } QString category() const { return m_category; } QString status() const { return m_status; } diff --git a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp index be0fac4b55..eeb03eb958 100644 --- a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp +++ b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp @@ -197,7 +197,7 @@ QPlatformSystemTrayIcon *QGenericUnixTheme::createPlatformSystemTrayIcon() const { if (isDBusTrayAvailable()) return new QDBusTrayIcon(); - return Q_NULLPTR; + return nullptr; } #endif @@ -672,7 +672,7 @@ QPlatformSystemTrayIcon *QKdeTheme::createPlatformSystemTrayIcon() const { if (isDBusTrayAvailable()) return new QDBusTrayIcon(); - return Q_NULLPTR; + return nullptr; } #endif @@ -691,7 +691,7 @@ const char *QGnomeTheme::name = "gnome"; class QGnomeThemePrivate : public QPlatformThemePrivate { public: - QGnomeThemePrivate() : systemFont(Q_NULLPTR), fixedFont(Q_NULLPTR) {} + QGnomeThemePrivate() : systemFont(nullptr), fixedFont(nullptr) {} ~QGnomeThemePrivate() { delete systemFont; delete fixedFont; } void configureFonts(const QString >kFontName) const @@ -791,7 +791,7 @@ QPlatformSystemTrayIcon *QGnomeTheme::createPlatformSystemTrayIcon() const { if (isDBusTrayAvailable()) return new QDBusTrayIcon(); - return Q_NULLPTR; + return nullptr; } #endif @@ -829,7 +829,7 @@ QPlatformTheme *QGenericUnixTheme::createUnixTheme(const QString &name) #endif if (name == QLatin1String(QGnomeTheme::name)) return new QGnomeTheme; - return Q_NULLPTR; + return nullptr; } QStringList QGenericUnixTheme::themeNames() diff --git a/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h b/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h index da13390662..186e5a7dff 100644 --- a/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h +++ b/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h @@ -81,15 +81,15 @@ public: static QPlatformTheme *createUnixTheme(const QString &name); static QStringList themeNames(); - const QFont *font(Font type) const Q_DECL_OVERRIDE; - QVariant themeHint(ThemeHint hint) const Q_DECL_OVERRIDE; + const QFont *font(Font type) const override; + QVariant themeHint(ThemeHint hint) const override; static QStringList xdgIconThemePaths(); #ifndef QT_NO_DBUS - QPlatformMenuBar *createPlatformMenuBar() const Q_DECL_OVERRIDE; + QPlatformMenuBar *createPlatformMenuBar() const override; #endif #if !defined(QT_NO_DBUS) && !defined(QT_NO_SYSTEMTRAYICON) - QPlatformSystemTrayIcon *createPlatformSystemTrayIcon() const Q_DECL_OVERRIDE; + QPlatformSystemTrayIcon *createPlatformSystemTrayIcon() const override; #endif static const char *name; @@ -105,19 +105,19 @@ public: QKdeTheme(const QStringList& kdeDirs, int kdeVersion); static QPlatformTheme *createKdeTheme(); - QVariant themeHint(ThemeHint hint) const Q_DECL_OVERRIDE; + QVariant themeHint(ThemeHint hint) const override; QIcon fileIcon(const QFileInfo &fileInfo, QPlatformTheme::IconOptions iconOptions = 0) const override; - const QPalette *palette(Palette type = SystemPalette) const Q_DECL_OVERRIDE; + const QPalette *palette(Palette type = SystemPalette) const override; - const QFont *font(Font type) const Q_DECL_OVERRIDE; + const QFont *font(Font type) const override; #ifndef QT_NO_DBUS - QPlatformMenuBar *createPlatformMenuBar() const Q_DECL_OVERRIDE; + QPlatformMenuBar *createPlatformMenuBar() const override; #endif #if !defined(QT_NO_DBUS) && !defined(QT_NO_SYSTEMTRAYICON) - QPlatformSystemTrayIcon *createPlatformSystemTrayIcon() const Q_DECL_OVERRIDE; + QPlatformSystemTrayIcon *createPlatformSystemTrayIcon() const override; #endif static const char *name; @@ -131,18 +131,18 @@ class QGnomeTheme : public QPlatformTheme Q_DECLARE_PRIVATE(QGnomeTheme) public: QGnomeTheme(); - QVariant themeHint(ThemeHint hint) const Q_DECL_OVERRIDE; + QVariant themeHint(ThemeHint hint) const override; QIcon fileIcon(const QFileInfo &fileInfo, QPlatformTheme::IconOptions = 0) const override; - const QFont *font(Font type) const Q_DECL_OVERRIDE; - QString standardButtonText(int button) const Q_DECL_OVERRIDE; + const QFont *font(Font type) const override; + QString standardButtonText(int button) const override; virtual QString gtkFontName() const; #ifndef QT_NO_DBUS - QPlatformMenuBar *createPlatformMenuBar() const Q_DECL_OVERRIDE; + QPlatformMenuBar *createPlatformMenuBar() const override; #endif #if !defined(QT_NO_DBUS) && !defined(QT_NO_SYSTEMTRAYICON) - QPlatformSystemTrayIcon *createPlatformSystemTrayIcon() const Q_DECL_OVERRIDE; + QPlatformSystemTrayIcon *createPlatformSystemTrayIcon() const override; #endif static const char *name; diff --git a/src/platformsupport/windowsuiautomation/qwindowsuiawrapper.cpp b/src/platformsupport/windowsuiautomation/qwindowsuiawrapper.cpp new file mode 100644 index 0000000000..79541fe636 --- /dev/null +++ b/src/platformsupport/windowsuiautomation/qwindowsuiawrapper.cpp @@ -0,0 +1,117 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <initguid.h> + +#include "qwindowsuiawrapper_p.h" +#include <QtCore/private/qsystemlibrary_p.h> + +QT_BEGIN_NAMESPACE + +// private constructor +QWindowsUiaWrapper::QWindowsUiaWrapper() +{ + QSystemLibrary uiaLib(QStringLiteral("UIAutomationCore")); + if (uiaLib.load()) { + m_pUiaReturnRawElementProvider = reinterpret_cast<PtrUiaReturnRawElementProvider>(uiaLib.resolve("UiaReturnRawElementProvider")); + m_pUiaHostProviderFromHwnd = reinterpret_cast<PtrUiaHostProviderFromHwnd>(uiaLib.resolve("UiaHostProviderFromHwnd")); + m_pUiaRaiseAutomationPropertyChangedEvent = reinterpret_cast<PtrUiaRaiseAutomationPropertyChangedEvent>(uiaLib.resolve("UiaRaiseAutomationPropertyChangedEvent")); + m_pUiaRaiseAutomationEvent = reinterpret_cast<PtrUiaRaiseAutomationEvent>(uiaLib.resolve("UiaRaiseAutomationEvent")); + m_pUiaClientsAreListening = reinterpret_cast<PtrUiaClientsAreListening>(uiaLib.resolve("UiaClientsAreListening")); + } +} + +QWindowsUiaWrapper::~QWindowsUiaWrapper() +{ +} + +// shared instance +QWindowsUiaWrapper *QWindowsUiaWrapper::instance() +{ + static QWindowsUiaWrapper wrapper; + return &wrapper; +} + +// True if all symbols resolved. +BOOL QWindowsUiaWrapper::ready() +{ + return m_pUiaReturnRawElementProvider + && m_pUiaHostProviderFromHwnd + && m_pUiaRaiseAutomationPropertyChangedEvent + && m_pUiaRaiseAutomationEvent + && m_pUiaClientsAreListening; +} + +BOOL QWindowsUiaWrapper::clientsAreListening() +{ + if (!m_pUiaClientsAreListening) + return FALSE; + return m_pUiaClientsAreListening(); +} + +LRESULT QWindowsUiaWrapper::returnRawElementProvider(HWND hwnd, WPARAM wParam, LPARAM lParam, IRawElementProviderSimple *el) +{ + if (!m_pUiaReturnRawElementProvider) + return static_cast<LRESULT>(NULL); + return m_pUiaReturnRawElementProvider(hwnd, wParam, lParam, el); +} + +HRESULT QWindowsUiaWrapper::hostProviderFromHwnd(HWND hwnd, IRawElementProviderSimple **ppProvider) +{ + if (!m_pUiaHostProviderFromHwnd) + return UIA_E_NOTSUPPORTED; + return m_pUiaHostProviderFromHwnd(hwnd, ppProvider); +} + +HRESULT QWindowsUiaWrapper::raiseAutomationPropertyChangedEvent(IRawElementProviderSimple *pProvider, PROPERTYID id, VARIANT oldValue, VARIANT newValue) +{ + if (!m_pUiaRaiseAutomationPropertyChangedEvent) + return UIA_E_NOTSUPPORTED; + return m_pUiaRaiseAutomationPropertyChangedEvent(pProvider, id, oldValue, newValue); +} + +HRESULT QWindowsUiaWrapper::raiseAutomationEvent(IRawElementProviderSimple *pProvider, EVENTID id) +{ + if (!m_pUiaRaiseAutomationEvent) + return UIA_E_NOTSUPPORTED; + return m_pUiaRaiseAutomationEvent(pProvider, id); +} + +QT_END_NAMESPACE + diff --git a/src/platformsupport/windowsuiautomation/qwindowsuiawrapper_p.h b/src/platformsupport/windowsuiautomation/qwindowsuiawrapper_p.h new file mode 100644 index 0000000000..f89640612e --- /dev/null +++ b/src/platformsupport/windowsuiautomation/qwindowsuiawrapper_p.h @@ -0,0 +1,100 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QWINDOWSUIAWRAPPER_H +#define QWINDOWSUIAWRAPPER_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 <QtGui/private/qtguiglobal_p.h> + +#include "uiatypes.h" +#include "uiaattributeids.h" +#include "uiacontroltypeids.h" +#include "uiaerrorids.h" +#include "uiaeventids.h" +#include "uiageneralids.h" +#include "uiapatternids.h" +#include "uiapropertyids.h" +#include "uiaserverinterfaces.h" +#include "uiaclientinterfaces.h" + +QT_REQUIRE_CONFIG(accessibility); + +QT_BEGIN_NAMESPACE + +class QWindowsUiaWrapper +{ + QWindowsUiaWrapper(); + virtual ~QWindowsUiaWrapper(); +public: + static QWindowsUiaWrapper *instance(); + BOOL ready(); + BOOL clientsAreListening(); + LRESULT returnRawElementProvider(HWND hwnd, WPARAM wParam, LPARAM lParam, IRawElementProviderSimple *el); + HRESULT hostProviderFromHwnd(HWND hwnd, IRawElementProviderSimple **ppProvider); + HRESULT raiseAutomationPropertyChangedEvent(IRawElementProviderSimple *pProvider, PROPERTYID id, VARIANT oldValue, VARIANT newValue); + HRESULT raiseAutomationEvent(IRawElementProviderSimple *pProvider, EVENTID id); + +private: + typedef LRESULT (WINAPI *PtrUiaReturnRawElementProvider)(HWND, WPARAM, LPARAM, IRawElementProviderSimple *); + typedef HRESULT (WINAPI *PtrUiaHostProviderFromHwnd)(HWND, IRawElementProviderSimple **); + typedef HRESULT (WINAPI *PtrUiaRaiseAutomationPropertyChangedEvent)(IRawElementProviderSimple *, PROPERTYID, VARIANT, VARIANT); + typedef HRESULT (WINAPI *PtrUiaRaiseAutomationEvent)(IRawElementProviderSimple *, EVENTID); + typedef BOOL (WINAPI *PtrUiaClientsAreListening)(); + PtrUiaReturnRawElementProvider m_pUiaReturnRawElementProvider = nullptr; + PtrUiaHostProviderFromHwnd m_pUiaHostProviderFromHwnd = nullptr; + PtrUiaRaiseAutomationPropertyChangedEvent m_pUiaRaiseAutomationPropertyChangedEvent = nullptr; + PtrUiaRaiseAutomationEvent m_pUiaRaiseAutomationEvent = nullptr; + PtrUiaClientsAreListening m_pUiaClientsAreListening = nullptr; +}; + +QT_END_NAMESPACE + +#endif //QWINDOWSUIAWRAPPER_H + diff --git a/src/platformsupport/windowsuiautomation/uiaattributeids.h b/src/platformsupport/windowsuiautomation/uiaattributeids.h new file mode 100644 index 0000000000..52e7306a67 --- /dev/null +++ b/src/platformsupport/windowsuiautomation/uiaattributeids.h @@ -0,0 +1,88 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef UIAATTRIBUTEIDS_H +#define UIAATTRIBUTEIDS_H + +#define UIA_AnimationStyleAttributeId 40000 +#define UIA_BackgroundColorAttributeId 40001 +#define UIA_BulletStyleAttributeId 40002 +#define UIA_CapStyleAttributeId 40003 +#define UIA_CultureAttributeId 40004 +#define UIA_FontNameAttributeId 40005 +#define UIA_FontSizeAttributeId 40006 +#define UIA_FontWeightAttributeId 40007 +#define UIA_ForegroundColorAttributeId 40008 +#define UIA_HorizontalTextAlignmentAttributeId 40009 +#define UIA_IndentationFirstLineAttributeId 40010 +#define UIA_IndentationLeadingAttributeId 40011 +#define UIA_IndentationTrailingAttributeId 40012 +#define UIA_IsHiddenAttributeId 40013 +#define UIA_IsItalicAttributeId 40014 +#define UIA_IsReadOnlyAttributeId 40015 +#define UIA_IsSubscriptAttributeId 40016 +#define UIA_IsSuperscriptAttributeId 40017 +#define UIA_MarginBottomAttributeId 40018 +#define UIA_MarginLeadingAttributeId 40019 +#define UIA_MarginTopAttributeId 40020 +#define UIA_MarginTrailingAttributeId 40021 +#define UIA_OutlineStylesAttributeId 40022 +#define UIA_OverlineColorAttributeId 40023 +#define UIA_OverlineStyleAttributeId 40024 +#define UIA_StrikethroughColorAttributeId 40025 +#define UIA_StrikethroughStyleAttributeId 40026 +#define UIA_TabsAttributeId 40027 +#define UIA_TextFlowDirectionsAttributeId 40028 +#define UIA_UnderlineColorAttributeId 40029 +#define UIA_UnderlineStyleAttributeId 40030 +#define UIA_AnnotationTypesAttributeId 40031 +#define UIA_AnnotationObjectsAttributeId 40032 +#define UIA_StyleNameAttributeId 40033 +#define UIA_StyleIdAttributeId 40034 +#define UIA_LinkAttributeId 40035 +#define UIA_IsActiveAttributeId 40036 +#define UIA_SelectionActiveEndAttributeId 40037 +#define UIA_CaretPositionAttributeId 40038 +#define UIA_CaretBidiModeAttributeId 40039 +#define UIA_LineSpacingAttributeId 40040 +#define UIA_BeforeParagraphSpacingAttributeId 40041 +#define UIA_AfterParagraphSpacingAttributeId 40042 +#define UIA_SayAsInterpretAsAttributeId 40043 + +#endif diff --git a/src/platformsupport/windowsuiautomation/uiaclientinterfaces.h b/src/platformsupport/windowsuiautomation/uiaclientinterfaces.h new file mode 100644 index 0000000000..b95c05f6a4 --- /dev/null +++ b/src/platformsupport/windowsuiautomation/uiaclientinterfaces.h @@ -0,0 +1,255 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef UIACLIENTINTERFACES_H +#define UIACLIENTINTERFACES_H + +#include <Unknwn.h> + +#ifndef __IUIAutomationElement_INTERFACE_DEFINED__ + +struct IUIAutomationCondition; +struct IUIAutomationCacheRequest; +struct IUIAutomationElementArray; +struct IUIAutomationTreeWalker; +struct IUIAutomationEventHandler; +struct IUIAutomationPropertyChangedEventHandler; +struct IUIAutomationStructureChangedEventHandler; +struct IUIAutomationFocusChangedEventHandler; +struct IUIAutomationProxyFactory; +struct IUIAutomationProxyFactoryEntry; +struct IUIAutomationProxyFactoryMapping; +#ifndef __IAccessible_FWD_DEFINED__ +#define __IAccessible_FWD_DEFINED__ +struct IAccessible; +#endif /* __IAccessible_FWD_DEFINED__ */ + +#define __IUIAutomationElement_INTERFACE_DEFINED__ +DEFINE_GUID(IID_IUIAutomationElement, 0xd22108aa, 0x8ac5, 0x49a5, 0x83,0x7b, 0x37,0xbb,0xb3,0xd7,0x59,0x1e); +MIDL_INTERFACE("d22108aa-8ac5-49a5-837b-37bbb3d7591e") +IUIAutomationElement : public IUnknown +{ +public: + virtual HRESULT STDMETHODCALLTYPE SetFocus() = 0; + virtual HRESULT STDMETHODCALLTYPE GetRuntimeId(__RPC__deref_out_opt SAFEARRAY **runtimeId) = 0; + virtual HRESULT STDMETHODCALLTYPE FindFirst(enum TreeScope scope, __RPC__in_opt IUIAutomationCondition *condition, __RPC__deref_out_opt IUIAutomationElement **found) = 0; + virtual HRESULT STDMETHODCALLTYPE FindAll(enum TreeScope scope, __RPC__in_opt IUIAutomationCondition *condition, __RPC__deref_out_opt IUIAutomationElementArray **found) = 0; + virtual HRESULT STDMETHODCALLTYPE FindFirstBuildCache(enum TreeScope scope, __RPC__in_opt IUIAutomationCondition *condition, __RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__deref_out_opt IUIAutomationElement **found) = 0; + virtual HRESULT STDMETHODCALLTYPE FindAllBuildCache(enum TreeScope scope, __RPC__in_opt IUIAutomationCondition *condition, __RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__deref_out_opt IUIAutomationElementArray **found) = 0; + virtual HRESULT STDMETHODCALLTYPE BuildUpdatedCache(__RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__deref_out_opt IUIAutomationElement **updatedElement) = 0; + virtual HRESULT STDMETHODCALLTYPE GetCurrentPropertyValue(PROPERTYID propertyId, __RPC__out VARIANT *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE GetCurrentPropertyValueEx(PROPERTYID propertyId, BOOL ignoreDefaultValue, __RPC__out VARIANT *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE GetCachedPropertyValue(PROPERTYID propertyId, __RPC__out VARIANT *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE GetCachedPropertyValueEx(PROPERTYID propertyId, BOOL ignoreDefaultValue, __RPC__out VARIANT *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE GetCurrentPatternAs(PATTERNID patternId, __RPC__in REFIID riid, __RPC__deref_out_opt void **patternObject) = 0; + virtual HRESULT STDMETHODCALLTYPE GetCachedPatternAs(PATTERNID patternId, __RPC__in REFIID riid, __RPC__deref_out_opt void **patternObject) = 0; + virtual HRESULT STDMETHODCALLTYPE GetCurrentPattern(PATTERNID patternId, __RPC__deref_out_opt IUnknown **patternObject) = 0; + virtual HRESULT STDMETHODCALLTYPE GetCachedPattern(PATTERNID patternId, __RPC__deref_out_opt IUnknown **patternObject) = 0; + virtual HRESULT STDMETHODCALLTYPE GetCachedParent(__RPC__deref_out_opt IUIAutomationElement **parent) = 0; + virtual HRESULT STDMETHODCALLTYPE GetCachedChildren(__RPC__deref_out_opt IUIAutomationElementArray **children) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CurrentProcessId(__RPC__out int *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CurrentControlType(__RPC__out CONTROLTYPEID *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CurrentLocalizedControlType(__RPC__deref_out_opt BSTR *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CurrentName(__RPC__deref_out_opt BSTR *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CurrentAcceleratorKey(__RPC__deref_out_opt BSTR *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CurrentAccessKey(__RPC__deref_out_opt BSTR *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CurrentHasKeyboardFocus(__RPC__out BOOL *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CurrentIsKeyboardFocusable(__RPC__out BOOL *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CurrentIsEnabled(__RPC__out BOOL *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CurrentAutomationId(__RPC__deref_out_opt BSTR *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CurrentClassName(__RPC__deref_out_opt BSTR *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CurrentHelpText(__RPC__deref_out_opt BSTR *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CurrentCulture(__RPC__out int *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CurrentIsControlElement(__RPC__out BOOL *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CurrentIsContentElement(__RPC__out BOOL *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CurrentIsPassword(__RPC__out BOOL *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CurrentNativeWindowHandle(__RPC__deref_out_opt UIA_HWND *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CurrentItemType(__RPC__deref_out_opt BSTR *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CurrentIsOffscreen(__RPC__out BOOL *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CurrentOrientation(__RPC__out enum OrientationType *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CurrentFrameworkId(__RPC__deref_out_opt BSTR *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CurrentIsRequiredForForm(__RPC__out BOOL *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CurrentItemStatus(__RPC__deref_out_opt BSTR *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CurrentBoundingRectangle(__RPC__out RECT *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CurrentLabeledBy(__RPC__deref_out_opt IUIAutomationElement **retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CurrentAriaRole(__RPC__deref_out_opt BSTR *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CurrentAriaProperties(__RPC__deref_out_opt BSTR *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CurrentIsDataValidForForm(__RPC__out BOOL *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CurrentControllerFor(__RPC__deref_out_opt IUIAutomationElementArray **retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CurrentDescribedBy(__RPC__deref_out_opt IUIAutomationElementArray **retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CurrentFlowsTo(__RPC__deref_out_opt IUIAutomationElementArray **retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CurrentProviderDescription(__RPC__deref_out_opt BSTR *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CachedProcessId(__RPC__out int *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CachedControlType(__RPC__out CONTROLTYPEID *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CachedLocalizedControlType(__RPC__deref_out_opt BSTR *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CachedName(__RPC__deref_out_opt BSTR *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CachedAcceleratorKey(__RPC__deref_out_opt BSTR *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CachedAccessKey(__RPC__deref_out_opt BSTR *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CachedHasKeyboardFocus(__RPC__out BOOL *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CachedIsKeyboardFocusable(__RPC__out BOOL *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CachedIsEnabled(__RPC__out BOOL *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CachedAutomationId(__RPC__deref_out_opt BSTR *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CachedClassName(__RPC__deref_out_opt BSTR *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CachedHelpText(__RPC__deref_out_opt BSTR *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CachedCulture(__RPC__out int *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CachedIsControlElement(__RPC__out BOOL *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CachedIsContentElement(__RPC__out BOOL *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CachedIsPassword(__RPC__out BOOL *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CachedNativeWindowHandle(__RPC__deref_out_opt UIA_HWND *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CachedItemType(__RPC__deref_out_opt BSTR *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CachedIsOffscreen(__RPC__out BOOL *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CachedOrientation(__RPC__out enum OrientationType *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CachedFrameworkId(__RPC__deref_out_opt BSTR *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CachedIsRequiredForForm(__RPC__out BOOL *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CachedItemStatus(__RPC__deref_out_opt BSTR *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CachedBoundingRectangle(__RPC__out RECT *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CachedLabeledBy(__RPC__deref_out_opt IUIAutomationElement **retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CachedAriaRole(__RPC__deref_out_opt BSTR *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CachedAriaProperties(__RPC__deref_out_opt BSTR *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CachedIsDataValidForForm(__RPC__out BOOL *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CachedControllerFor(__RPC__deref_out_opt IUIAutomationElementArray **retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CachedDescribedBy(__RPC__deref_out_opt IUIAutomationElementArray **retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CachedFlowsTo(__RPC__deref_out_opt IUIAutomationElementArray **retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CachedProviderDescription(__RPC__deref_out_opt BSTR *retVal) = 0; + virtual HRESULT STDMETHODCALLTYPE GetClickablePoint(__RPC__out POINT *clickable, __RPC__out BOOL *gotClickable) = 0; +}; +#ifdef __CRT_UUID_DECL +__CRT_UUID_DECL(IUIAutomationElement, 0xd22108aa, 0x8ac5, 0x49a5, 0x83,0x7b, 0x37,0xbb,0xb3,0xd7,0x59,0x1e) +#endif +#endif + + +#ifndef __IUIAutomation_INTERFACE_DEFINED__ +#define __IUIAutomation_INTERFACE_DEFINED__ +DEFINE_GUID(IID_IUIAutomation, 0x30cbe57d, 0xd9d0, 0x452a, 0xab,0x13, 0x7a,0xc5,0xac,0x48,0x25,0xee); +MIDL_INTERFACE("30cbe57d-d9d0-452a-ab13-7ac5ac4825ee") +IUIAutomation : public IUnknown +{ +public: + virtual HRESULT STDMETHODCALLTYPE CompareElements(__RPC__in_opt IUIAutomationElement *el1, __RPC__in_opt IUIAutomationElement *el2, __RPC__out BOOL *areSame) = 0; + virtual HRESULT STDMETHODCALLTYPE CompareRuntimeIds(__RPC__in SAFEARRAY * runtimeId1, __RPC__in SAFEARRAY * runtimeId2, __RPC__out BOOL *areSame) = 0; + virtual HRESULT STDMETHODCALLTYPE GetRootElement(__RPC__deref_out_opt IUIAutomationElement **root) = 0; + virtual HRESULT STDMETHODCALLTYPE ElementFromHandle(__RPC__in UIA_HWND hwnd, __RPC__deref_out_opt IUIAutomationElement **element) = 0; + virtual HRESULT STDMETHODCALLTYPE ElementFromPoint(POINT pt, __RPC__deref_out_opt IUIAutomationElement **element) = 0; + virtual HRESULT STDMETHODCALLTYPE GetFocusedElement(__RPC__deref_out_opt IUIAutomationElement **element) = 0; + virtual HRESULT STDMETHODCALLTYPE GetRootElementBuildCache(__RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__deref_out_opt IUIAutomationElement **root) = 0; + virtual HRESULT STDMETHODCALLTYPE ElementFromHandleBuildCache(__RPC__in UIA_HWND hwnd, __RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__deref_out_opt IUIAutomationElement **element) = 0; + virtual HRESULT STDMETHODCALLTYPE ElementFromPointBuildCache(POINT pt, __RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__deref_out_opt IUIAutomationElement **element) = 0; + virtual HRESULT STDMETHODCALLTYPE GetFocusedElementBuildCache(__RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__deref_out_opt IUIAutomationElement **element) = 0; + virtual HRESULT STDMETHODCALLTYPE CreateTreeWalker(__RPC__in_opt IUIAutomationCondition *pCondition, __RPC__deref_out_opt IUIAutomationTreeWalker **walker) = 0; + virtual HRESULT STDMETHODCALLTYPE get_ControlViewWalker(__RPC__deref_out_opt IUIAutomationTreeWalker **walker) = 0; + virtual HRESULT STDMETHODCALLTYPE get_ContentViewWalker(__RPC__deref_out_opt IUIAutomationTreeWalker **walker) = 0; + virtual HRESULT STDMETHODCALLTYPE get_RawViewWalker(__RPC__deref_out_opt IUIAutomationTreeWalker **walker) = 0; + virtual HRESULT STDMETHODCALLTYPE get_RawViewCondition(__RPC__deref_out_opt IUIAutomationCondition **condition) = 0; + virtual HRESULT STDMETHODCALLTYPE get_ControlViewCondition(__RPC__deref_out_opt IUIAutomationCondition **condition) = 0; + virtual HRESULT STDMETHODCALLTYPE get_ContentViewCondition(__RPC__deref_out_opt IUIAutomationCondition **condition) = 0; + virtual HRESULT STDMETHODCALLTYPE CreateCacheRequest(__RPC__deref_out_opt IUIAutomationCacheRequest **cacheRequest) = 0; + virtual HRESULT STDMETHODCALLTYPE CreateTrueCondition(__RPC__deref_out_opt IUIAutomationCondition **newCondition) = 0; + virtual HRESULT STDMETHODCALLTYPE CreateFalseCondition(__RPC__deref_out_opt IUIAutomationCondition **newCondition) = 0; + virtual HRESULT STDMETHODCALLTYPE CreatePropertyCondition(PROPERTYID propertyId, VARIANT value, __RPC__deref_out_opt IUIAutomationCondition **newCondition) = 0; + virtual HRESULT STDMETHODCALLTYPE CreatePropertyConditionEx(PROPERTYID propertyId, VARIANT value, enum PropertyConditionFlags flags, __RPC__deref_out_opt IUIAutomationCondition **newCondition) = 0; + virtual HRESULT STDMETHODCALLTYPE CreateAndCondition(__RPC__in_opt IUIAutomationCondition *condition1, __RPC__in_opt IUIAutomationCondition *condition2, __RPC__deref_out_opt IUIAutomationCondition **newCondition) = 0; + virtual HRESULT STDMETHODCALLTYPE CreateAndConditionFromArray(__RPC__in_opt SAFEARRAY * conditions, __RPC__deref_out_opt IUIAutomationCondition **newCondition) = 0; + virtual HRESULT STDMETHODCALLTYPE CreateAndConditionFromNativeArray(__RPC__in_ecount_full(conditionCount) IUIAutomationCondition **conditions, int conditionCount, __RPC__deref_out_opt IUIAutomationCondition **newCondition) = 0; + virtual HRESULT STDMETHODCALLTYPE CreateOrCondition(__RPC__in_opt IUIAutomationCondition *condition1, __RPC__in_opt IUIAutomationCondition *condition2, __RPC__deref_out_opt IUIAutomationCondition **newCondition) = 0; + virtual HRESULT STDMETHODCALLTYPE CreateOrConditionFromArray(__RPC__in_opt SAFEARRAY * conditions, __RPC__deref_out_opt IUIAutomationCondition **newCondition) = 0; + virtual HRESULT STDMETHODCALLTYPE CreateOrConditionFromNativeArray(__RPC__in_ecount_full(conditionCount) IUIAutomationCondition **conditions, int conditionCount, __RPC__deref_out_opt IUIAutomationCondition **newCondition) = 0; + virtual HRESULT STDMETHODCALLTYPE CreateNotCondition(__RPC__in_opt IUIAutomationCondition *condition, __RPC__deref_out_opt IUIAutomationCondition **newCondition) = 0; + virtual HRESULT STDMETHODCALLTYPE AddAutomationEventHandler(EVENTID eventId, __RPC__in_opt IUIAutomationElement *element, enum TreeScope scope, __RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__in_opt IUIAutomationEventHandler *handler) = 0; + virtual HRESULT STDMETHODCALLTYPE RemoveAutomationEventHandler(EVENTID eventId, __RPC__in_opt IUIAutomationElement *element, __RPC__in_opt IUIAutomationEventHandler *handler) = 0; + virtual HRESULT STDMETHODCALLTYPE AddPropertyChangedEventHandlerNativeArray(__RPC__in_opt IUIAutomationElement *element, enum TreeScope scope, __RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__in_opt IUIAutomationPropertyChangedEventHandler *handler, __RPC__in_ecount_full(propertyCount) PROPERTYID *propertyArray, int propertyCount) = 0; + virtual HRESULT STDMETHODCALLTYPE AddPropertyChangedEventHandler(__RPC__in_opt IUIAutomationElement *element, enum TreeScope scope, __RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__in_opt IUIAutomationPropertyChangedEventHandler *handler, __RPC__in SAFEARRAY * propertyArray) = 0; + virtual HRESULT STDMETHODCALLTYPE RemovePropertyChangedEventHandler(__RPC__in_opt IUIAutomationElement *element, __RPC__in_opt IUIAutomationPropertyChangedEventHandler *handler) = 0; + virtual HRESULT STDMETHODCALLTYPE AddStructureChangedEventHandler(__RPC__in_opt IUIAutomationElement *element, enum TreeScope scope, __RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__in_opt IUIAutomationStructureChangedEventHandler *handler) = 0; + virtual HRESULT STDMETHODCALLTYPE RemoveStructureChangedEventHandler(__RPC__in_opt IUIAutomationElement *element, __RPC__in_opt IUIAutomationStructureChangedEventHandler *handler) = 0; + virtual HRESULT STDMETHODCALLTYPE AddFocusChangedEventHandler(__RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__in_opt IUIAutomationFocusChangedEventHandler *handler) = 0; + virtual HRESULT STDMETHODCALLTYPE RemoveFocusChangedEventHandler(__RPC__in_opt IUIAutomationFocusChangedEventHandler *handler) = 0; + virtual HRESULT STDMETHODCALLTYPE RemoveAllEventHandlers() = 0; + virtual HRESULT STDMETHODCALLTYPE IntNativeArrayToSafeArray(__RPC__in_ecount_full(arrayCount) int *array, int arrayCount, __RPC__deref_out_opt SAFEARRAY **safeArray) = 0; + virtual HRESULT STDMETHODCALLTYPE IntSafeArrayToNativeArray(__RPC__in SAFEARRAY * intArray, __RPC__deref_out_ecount_full_opt(*arrayCount) int **array, __RPC__out int *arrayCount) = 0; + virtual HRESULT STDMETHODCALLTYPE RectToVariant(RECT rc, __RPC__out VARIANT *var) = 0; + virtual HRESULT STDMETHODCALLTYPE VariantToRect(VARIANT var, __RPC__out RECT *rc) = 0; + virtual HRESULT STDMETHODCALLTYPE SafeArrayToRectNativeArray(__RPC__in SAFEARRAY * rects, __RPC__deref_out_ecount_full_opt(*rectArrayCount) RECT **rectArray, __RPC__out int *rectArrayCount) = 0; + virtual HRESULT STDMETHODCALLTYPE CreateProxyFactoryEntry(__RPC__in_opt IUIAutomationProxyFactory *factory, __RPC__deref_out_opt IUIAutomationProxyFactoryEntry **factoryEntry) = 0; + virtual HRESULT STDMETHODCALLTYPE get_ProxyFactoryMapping(__RPC__deref_out_opt IUIAutomationProxyFactoryMapping **factoryMapping) = 0; + virtual HRESULT STDMETHODCALLTYPE GetPropertyProgrammaticName(PROPERTYID property, __RPC__deref_out_opt BSTR *name) = 0; + virtual HRESULT STDMETHODCALLTYPE GetPatternProgrammaticName(PATTERNID pattern, __RPC__deref_out_opt BSTR *name) = 0; + virtual HRESULT STDMETHODCALLTYPE PollForPotentialSupportedPatterns(__RPC__in_opt IUIAutomationElement *pElement, __RPC__deref_out_opt SAFEARRAY **patternIds, __RPC__deref_out_opt SAFEARRAY **patternNames) = 0; + virtual HRESULT STDMETHODCALLTYPE PollForPotentialSupportedProperties(__RPC__in_opt IUIAutomationElement *pElement, __RPC__deref_out_opt SAFEARRAY **propertyIds, __RPC__deref_out_opt SAFEARRAY **propertyNames) = 0; + virtual HRESULT STDMETHODCALLTYPE CheckNotSupported(VARIANT value, __RPC__out BOOL *isNotSupported) = 0; + virtual HRESULT STDMETHODCALLTYPE get_ReservedNotSupportedValue(__RPC__deref_out_opt IUnknown **notSupportedValue) = 0; + virtual HRESULT STDMETHODCALLTYPE get_ReservedMixedAttributeValue(__RPC__deref_out_opt IUnknown **mixedAttributeValue) = 0; + virtual HRESULT STDMETHODCALLTYPE ElementFromIAccessible(__RPC__in_opt IAccessible *accessible, int childId, __RPC__deref_out_opt IUIAutomationElement **element) = 0; + virtual HRESULT STDMETHODCALLTYPE ElementFromIAccessibleBuildCache(__RPC__in_opt IAccessible *accessible, int childId, __RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__deref_out_opt IUIAutomationElement **element) = 0; +}; +#ifdef __CRT_UUID_DECL +__CRT_UUID_DECL(IUIAutomation, 0x30cbe57d, 0xd9d0, 0x452a, 0xab,0x13, 0x7a,0xc5,0xac,0x48,0x25,0xee) +#endif +#endif + + +#ifndef __IUIAutomationTreeWalker_INTERFACE_DEFINED__ +#define __IUIAutomationTreeWalker_INTERFACE_DEFINED__ +DEFINE_GUID(IID_IUIAutomationTreeWalker, 0x4042c624, 0x389c, 0x4afc, 0xa6,0x30, 0x9d,0xf8,0x54,0xa5,0x41,0xfc); +MIDL_INTERFACE("4042c624-389c-4afc-a630-9df854a541fc") +IUIAutomationTreeWalker : public IUnknown +{ +public: + virtual HRESULT STDMETHODCALLTYPE GetParentElement(__RPC__in_opt IUIAutomationElement *element, __RPC__deref_out_opt IUIAutomationElement **parent) = 0; + virtual HRESULT STDMETHODCALLTYPE GetFirstChildElement(__RPC__in_opt IUIAutomationElement *element, __RPC__deref_out_opt IUIAutomationElement **first) = 0; + virtual HRESULT STDMETHODCALLTYPE GetLastChildElement(__RPC__in_opt IUIAutomationElement *element, __RPC__deref_out_opt IUIAutomationElement **last) = 0; + virtual HRESULT STDMETHODCALLTYPE GetNextSiblingElement(__RPC__in_opt IUIAutomationElement *element, __RPC__deref_out_opt IUIAutomationElement **next) = 0; + virtual HRESULT STDMETHODCALLTYPE GetPreviousSiblingElement(__RPC__in_opt IUIAutomationElement *element, __RPC__deref_out_opt IUIAutomationElement **previous) = 0; + virtual HRESULT STDMETHODCALLTYPE NormalizeElement(__RPC__in_opt IUIAutomationElement *element, __RPC__deref_out_opt IUIAutomationElement **normalized) = 0; + virtual HRESULT STDMETHODCALLTYPE GetParentElementBuildCache(__RPC__in_opt IUIAutomationElement *element, __RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__deref_out_opt IUIAutomationElement **parent) = 0; + virtual HRESULT STDMETHODCALLTYPE GetFirstChildElementBuildCache(__RPC__in_opt IUIAutomationElement *element, __RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__deref_out_opt IUIAutomationElement **first) = 0; + virtual HRESULT STDMETHODCALLTYPE GetLastChildElementBuildCache(__RPC__in_opt IUIAutomationElement *element, __RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__deref_out_opt IUIAutomationElement **last) = 0; + virtual HRESULT STDMETHODCALLTYPE GetNextSiblingElementBuildCache(__RPC__in_opt IUIAutomationElement *element, __RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__deref_out_opt IUIAutomationElement **next) = 0; + virtual HRESULT STDMETHODCALLTYPE GetPreviousSiblingElementBuildCache(__RPC__in_opt IUIAutomationElement *element, __RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__deref_out_opt IUIAutomationElement **previous) = 0; + virtual HRESULT STDMETHODCALLTYPE NormalizeElementBuildCache(__RPC__in_opt IUIAutomationElement *element, __RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__deref_out_opt IUIAutomationElement **normalized) = 0; + virtual HRESULT STDMETHODCALLTYPE get_Condition(__RPC__deref_out_opt IUIAutomationCondition **condition) = 0; +}; +#ifdef __CRT_UUID_DECL +__CRT_UUID_DECL(IUIAutomationTreeWalker, 0x4042c624, 0x389c, 0x4afc, 0xa6,0x30, 0x9d,0xf8,0x54,0xa5,0x41,0xfc) +#endif +#endif + +DEFINE_GUID(CLSID_CUIAutomation, 0xff48dba4, 0x60ef, 0x4201, 0xaa,0x87, 0x54,0x10,0x3e,0xef,0x59,0x4e); + +#endif diff --git a/src/platformsupport/windowsuiautomation/uiacontroltypeids.h b/src/platformsupport/windowsuiautomation/uiacontroltypeids.h new file mode 100644 index 0000000000..d77fc68da9 --- /dev/null +++ b/src/platformsupport/windowsuiautomation/uiacontroltypeids.h @@ -0,0 +1,85 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef UIACONTROLTYPEIDS_H +#define UIACONTROLTYPEIDS_H + +#define UIA_ButtonControlTypeId 50000 +#define UIA_CalendarControlTypeId 50001 +#define UIA_CheckBoxControlTypeId 50002 +#define UIA_ComboBoxControlTypeId 50003 +#define UIA_EditControlTypeId 50004 +#define UIA_HyperlinkControlTypeId 50005 +#define UIA_ImageControlTypeId 50006 +#define UIA_ListItemControlTypeId 50007 +#define UIA_ListControlTypeId 50008 +#define UIA_MenuControlTypeId 50009 +#define UIA_MenuBarControlTypeId 50010 +#define UIA_MenuItemControlTypeId 50011 +#define UIA_ProgressBarControlTypeId 50012 +#define UIA_RadioButtonControlTypeId 50013 +#define UIA_ScrollBarControlTypeId 50014 +#define UIA_SliderControlTypeId 50015 +#define UIA_SpinnerControlTypeId 50016 +#define UIA_StatusBarControlTypeId 50017 +#define UIA_TabControlTypeId 50018 +#define UIA_TabItemControlTypeId 50019 +#define UIA_TextControlTypeId 50020 +#define UIA_ToolBarControlTypeId 50021 +#define UIA_ToolTipControlTypeId 50022 +#define UIA_TreeControlTypeId 50023 +#define UIA_TreeItemControlTypeId 50024 +#define UIA_CustomControlTypeId 50025 +#define UIA_GroupControlTypeId 50026 +#define UIA_ThumbControlTypeId 50027 +#define UIA_DataGridControlTypeId 50028 +#define UIA_DataItemControlTypeId 50029 +#define UIA_DocumentControlTypeId 50030 +#define UIA_SplitButtonControlTypeId 50031 +#define UIA_WindowControlTypeId 50032 +#define UIA_PaneControlTypeId 50033 +#define UIA_HeaderControlTypeId 50034 +#define UIA_HeaderItemControlTypeId 50035 +#define UIA_TableControlTypeId 50036 +#define UIA_TitleBarControlTypeId 50037 +#define UIA_SeparatorControlTypeId 50038 +#define UIA_SemanticZoomControlTypeId 50039 +#define UIA_AppBarControlTypeId 50040 + +#endif diff --git a/src/platformsupport/windowsuiautomation/uiaerrorids.h b/src/platformsupport/windowsuiautomation/uiaerrorids.h new file mode 100644 index 0000000000..c25453007d --- /dev/null +++ b/src/platformsupport/windowsuiautomation/uiaerrorids.h @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef UIAERRORIDS_H +#define UIAERRORIDS_H + +#define UIA_E_ELEMENTNOTENABLED 0x80040200 +#define UIA_E_ELEMENTNOTAVAILABLE 0x80040201 +#define UIA_E_NOCLICKABLEPOINT 0x80040202 +#define UIA_E_PROXYASSEMBLYNOTLOADED 0x80040203 +#define UIA_E_NOTSUPPORTED 0x80040204 +#define UIA_E_INVALIDOPERATION 0x80131509 +#define UIA_E_TIMEOUT 0x80131505 + +#endif diff --git a/src/platformsupport/windowsuiautomation/uiaeventids.h b/src/platformsupport/windowsuiautomation/uiaeventids.h new file mode 100644 index 0000000000..2b414968ed --- /dev/null +++ b/src/platformsupport/windowsuiautomation/uiaeventids.h @@ -0,0 +1,79 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef UIAEVENTIDS_H +#define UIAEVENTIDS_H + +#define UIA_ToolTipOpenedEventId 20000 +#define UIA_ToolTipClosedEventId 20001 +#define UIA_StructureChangedEventId 20002 +#define UIA_MenuOpenedEventId 20003 +#define UIA_AutomationPropertyChangedEventId 20004 +#define UIA_AutomationFocusChangedEventId 20005 +#define UIA_AsyncContentLoadedEventId 20006 +#define UIA_MenuClosedEventId 20007 +#define UIA_LayoutInvalidatedEventId 20008 +#define UIA_Invoke_InvokedEventId 20009 +#define UIA_SelectionItem_ElementAddedToSelectionEventId 20010 +#define UIA_SelectionItem_ElementRemovedFromSelectionEventId 20011 +#define UIA_SelectionItem_ElementSelectedEventId 20012 +#define UIA_Selection_InvalidatedEventId 20013 +#define UIA_Text_TextSelectionChangedEventId 20014 +#define UIA_Text_TextChangedEventId 20015 +#define UIA_Window_WindowOpenedEventId 20016 +#define UIA_Window_WindowClosedEventId 20017 +#define UIA_MenuModeStartEventId 20018 +#define UIA_MenuModeEndEventId 20019 +#define UIA_InputReachedTargetEventId 20020 +#define UIA_InputReachedOtherElementEventId 20021 +#define UIA_InputDiscardedEventId 20022 +#define UIA_SystemAlertEventId 20023 +#define UIA_LiveRegionChangedEventId 20024 +#define UIA_HostedFragmentRootsInvalidatedEventId 20025 +#define UIA_Drag_DragStartEventId 20026 +#define UIA_Drag_DragCancelEventId 20027 +#define UIA_Drag_DragCompleteEventId 20028 +#define UIA_DropTarget_DragEnterEventId 20029 +#define UIA_DropTarget_DragLeaveEventId 20030 +#define UIA_DropTarget_DroppedEventId 20031 +#define UIA_TextEdit_TextChangedEventId 20032 +#define UIA_TextEdit_ConversionTargetChangedEventId 20033 +#define UIA_ChangesEventId 20034 + +#endif diff --git a/src/platformsupport/windowsuiautomation/uiageneralids.h b/src/platformsupport/windowsuiautomation/uiageneralids.h new file mode 100644 index 0000000000..62c795b94a --- /dev/null +++ b/src/platformsupport/windowsuiautomation/uiageneralids.h @@ -0,0 +1,46 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef UIAGENERALIDS_H +#define UIAGENERALIDS_H + +#define UiaAppendRuntimeId 3 +#define UiaRootObjectId -25 + +#endif diff --git a/src/platformsupport/windowsuiautomation/uiapatternids.h b/src/platformsupport/windowsuiautomation/uiapatternids.h new file mode 100644 index 0000000000..114aabcaa5 --- /dev/null +++ b/src/platformsupport/windowsuiautomation/uiapatternids.h @@ -0,0 +1,78 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef UIAPATTERNIDS_H +#define UIAPATTERNIDS_H + +#define UIA_InvokePatternId 10000 +#define UIA_SelectionPatternId 10001 +#define UIA_ValuePatternId 10002 +#define UIA_RangeValuePatternId 10003 +#define UIA_ScrollPatternId 10004 +#define UIA_ExpandCollapsePatternId 10005 +#define UIA_GridPatternId 10006 +#define UIA_GridItemPatternId 10007 +#define UIA_MultipleViewPatternId 10008 +#define UIA_WindowPatternId 10009 +#define UIA_SelectionItemPatternId 10010 +#define UIA_DockPatternId 10011 +#define UIA_TablePatternId 10012 +#define UIA_TableItemPatternId 10013 +#define UIA_TextPatternId 10014 +#define UIA_TogglePatternId 10015 +#define UIA_TransformPatternId 10016 +#define UIA_ScrollItemPatternId 10017 +#define UIA_LegacyIAccessiblePatternId 10018 +#define UIA_ItemContainerPatternId 10019 +#define UIA_VirtualizedItemPatternId 10020 +#define UIA_SynchronizedInputPatternId 10021 +#define UIA_ObjectModelPatternId 10022 +#define UIA_AnnotationPatternId 10023 +#define UIA_TextPattern2Id 10024 +#define UIA_StylesPatternId 10025 +#define UIA_SpreadsheetPatternId 10026 +#define UIA_SpreadsheetItemPatternId 10027 +#define UIA_TransformPattern2Id 10028 +#define UIA_TextChildPatternId 10029 +#define UIA_DragPatternId 10030 +#define UIA_DropTargetPatternId 10031 +#define UIA_TextEditPatternId 10032 +#define UIA_CustomNavigationPatternId 10033 + +#endif diff --git a/src/platformsupport/windowsuiautomation/uiapropertyids.h b/src/platformsupport/windowsuiautomation/uiapropertyids.h new file mode 100644 index 0000000000..5c35c956f8 --- /dev/null +++ b/src/platformsupport/windowsuiautomation/uiapropertyids.h @@ -0,0 +1,212 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef UIAPROPERTYIDS_H +#define UIAPROPERTYIDS_H + +#define UIA_RuntimeIdPropertyId 30000 +#define UIA_BoundingRectanglePropertyId 30001 +#define UIA_ProcessIdPropertyId 30002 +#define UIA_ControlTypePropertyId 30003 +#define UIA_LocalizedControlTypePropertyId 30004 +#define UIA_NamePropertyId 30005 +#define UIA_AcceleratorKeyPropertyId 30006 +#define UIA_AccessKeyPropertyId 30007 +#define UIA_HasKeyboardFocusPropertyId 30008 +#define UIA_IsKeyboardFocusablePropertyId 30009 +#define UIA_IsEnabledPropertyId 30010 +#define UIA_AutomationIdPropertyId 30011 +#define UIA_ClassNamePropertyId 30012 +#define UIA_HelpTextPropertyId 30013 +#define UIA_ClickablePointPropertyId 30014 +#define UIA_CulturePropertyId 30015 +#define UIA_IsControlElementPropertyId 30016 +#define UIA_IsContentElementPropertyId 30017 +#define UIA_LabeledByPropertyId 30018 +#define UIA_IsPasswordPropertyId 30019 +#define UIA_NativeWindowHandlePropertyId 30020 +#define UIA_ItemTypePropertyId 30021 +#define UIA_IsOffscreenPropertyId 30022 +#define UIA_OrientationPropertyId 30023 +#define UIA_FrameworkIdPropertyId 30024 +#define UIA_IsRequiredForFormPropertyId 30025 +#define UIA_ItemStatusPropertyId 30026 +#define UIA_IsDockPatternAvailablePropertyId 30027 +#define UIA_IsExpandCollapsePatternAvailablePropertyId 30028 +#define UIA_IsGridItemPatternAvailablePropertyId 30029 +#define UIA_IsGridPatternAvailablePropertyId 30030 +#define UIA_IsInvokePatternAvailablePropertyId 30031 +#define UIA_IsMultipleViewPatternAvailablePropertyId 30032 +#define UIA_IsRangeValuePatternAvailablePropertyId 30033 +#define UIA_IsScrollPatternAvailablePropertyId 30034 +#define UIA_IsScrollItemPatternAvailablePropertyId 30035 +#define UIA_IsSelectionItemPatternAvailablePropertyId 30036 +#define UIA_IsSelectionPatternAvailablePropertyId 30037 +#define UIA_IsTablePatternAvailablePropertyId 30038 +#define UIA_IsTableItemPatternAvailablePropertyId 30039 +#define UIA_IsTextPatternAvailablePropertyId 30040 +#define UIA_IsTogglePatternAvailablePropertyId 30041 +#define UIA_IsTransformPatternAvailablePropertyId 30042 +#define UIA_IsValuePatternAvailablePropertyId 30043 +#define UIA_IsWindowPatternAvailablePropertyId 30044 +#define UIA_ValueValuePropertyId 30045 +#define UIA_ValueIsReadOnlyPropertyId 30046 +#define UIA_RangeValueValuePropertyId 30047 +#define UIA_RangeValueIsReadOnlyPropertyId 30048 +#define UIA_RangeValueMinimumPropertyId 30049 +#define UIA_RangeValueMaximumPropertyId 30050 +#define UIA_RangeValueLargeChangePropertyId 30051 +#define UIA_RangeValueSmallChangePropertyId 30052 +#define UIA_ScrollHorizontalScrollPercentPropertyId 30053 +#define UIA_ScrollHorizontalViewSizePropertyId 30054 +#define UIA_ScrollVerticalScrollPercentPropertyId 30055 +#define UIA_ScrollVerticalViewSizePropertyId 30056 +#define UIA_ScrollHorizontallyScrollablePropertyId 30057 +#define UIA_ScrollVerticallyScrollablePropertyId 30058 +#define UIA_SelectionSelectionPropertyId 30059 +#define UIA_SelectionCanSelectMultiplePropertyId 30060 +#define UIA_SelectionIsSelectionRequiredPropertyId 30061 +#define UIA_GridRowCountPropertyId 30062 +#define UIA_GridColumnCountPropertyId 30063 +#define UIA_GridItemRowPropertyId 30064 +#define UIA_GridItemColumnPropertyId 30065 +#define UIA_GridItemRowSpanPropertyId 30066 +#define UIA_GridItemColumnSpanPropertyId 30067 +#define UIA_GridItemContainingGridPropertyId 30068 +#define UIA_DockDockPositionPropertyId 30069 +#define UIA_ExpandCollapseExpandCollapseStatePropertyId 30070 +#define UIA_MultipleViewCurrentViewPropertyId 30071 +#define UIA_MultipleViewSupportedViewsPropertyId 30072 +#define UIA_WindowCanMaximizePropertyId 30073 +#define UIA_WindowCanMinimizePropertyId 30074 +#define UIA_WindowWindowVisualStatePropertyId 30075 +#define UIA_WindowWindowInteractionStatePropertyId 30076 +#define UIA_WindowIsModalPropertyId 30077 +#define UIA_WindowIsTopmostPropertyId 30078 +#define UIA_SelectionItemIsSelectedPropertyId 30079 +#define UIA_SelectionItemSelectionContainerPropertyId 30080 +#define UIA_TableRowHeadersPropertyId 30081 +#define UIA_TableColumnHeadersPropertyId 30082 +#define UIA_TableRowOrColumnMajorPropertyId 30083 +#define UIA_TableItemRowHeaderItemsPropertyId 30084 +#define UIA_TableItemColumnHeaderItemsPropertyId 30085 +#define UIA_ToggleToggleStatePropertyId 30086 +#define UIA_TransformCanMovePropertyId 30087 +#define UIA_TransformCanResizePropertyId 30088 +#define UIA_TransformCanRotatePropertyId 30089 +#define UIA_IsLegacyIAccessiblePatternAvailablePropertyId 30090 +#define UIA_LegacyIAccessibleChildIdPropertyId 30091 +#define UIA_LegacyIAccessibleNamePropertyId 30092 +#define UIA_LegacyIAccessibleValuePropertyId 30093 +#define UIA_LegacyIAccessibleDescriptionPropertyId 30094 +#define UIA_LegacyIAccessibleRolePropertyId 30095 +#define UIA_LegacyIAccessibleStatePropertyId 30096 +#define UIA_LegacyIAccessibleHelpPropertyId 30097 +#define UIA_LegacyIAccessibleKeyboardShortcutPropertyId 30098 +#define UIA_LegacyIAccessibleSelectionPropertyId 30099 +#define UIA_LegacyIAccessibleDefaultActionPropertyId 30100 +#define UIA_AriaRolePropertyId 30101 +#define UIA_AriaPropertiesPropertyId 30102 +#define UIA_IsDataValidForFormPropertyId 30103 +#define UIA_ControllerForPropertyId 30104 +#define UIA_DescribedByPropertyId 30105 +#define UIA_FlowsToPropertyId 30106 +#define UIA_ProviderDescriptionPropertyId 30107 +#define UIA_IsItemContainerPatternAvailablePropertyId 30108 +#define UIA_IsVirtualizedItemPatternAvailablePropertyId 30109 +#define UIA_IsSynchronizedInputPatternAvailablePropertyId 30110 +#define UIA_OptimizeForVisualContentPropertyId 30111 +#define UIA_IsObjectModelPatternAvailablePropertyId 30112 +#define UIA_AnnotationAnnotationTypeIdPropertyId 30113 +#define UIA_AnnotationAnnotationTypeNamePropertyId 30114 +#define UIA_AnnotationAuthorPropertyId 30115 +#define UIA_AnnotationDateTimePropertyId 30116 +#define UIA_AnnotationTargetPropertyId 30117 +#define UIA_IsAnnotationPatternAvailablePropertyId 30118 +#define UIA_IsTextPattern2AvailablePropertyId 30119 +#define UIA_StylesStyleIdPropertyId 30120 +#define UIA_StylesStyleNamePropertyId 30121 +#define UIA_StylesFillColorPropertyId 30122 +#define UIA_StylesFillPatternStylePropertyId 30123 +#define UIA_StylesShapePropertyId 30124 +#define UIA_StylesFillPatternColorPropertyId 30125 +#define UIA_StylesExtendedPropertiesPropertyId 30126 +#define UIA_IsStylesPatternAvailablePropertyId 30127 +#define UIA_IsSpreadsheetPatternAvailablePropertyId 30128 +#define UIA_SpreadsheetItemFormulaPropertyId 30129 +#define UIA_SpreadsheetItemAnnotationObjectsPropertyId 30130 +#define UIA_SpreadsheetItemAnnotationTypesPropertyId 30131 +#define UIA_IsSpreadsheetItemPatternAvailablePropertyId 30132 +#define UIA_Transform2CanZoomPropertyId 30133 +#define UIA_IsTransformPattern2AvailablePropertyId 30134 +#define UIA_LiveSettingPropertyId 30135 +#define UIA_IsTextChildPatternAvailablePropertyId 30136 +#define UIA_IsDragPatternAvailablePropertyId 30137 +#define UIA_DragIsGrabbedPropertyId 30138 +#define UIA_DragDropEffectPropertyId 30139 +#define UIA_DragDropEffectsPropertyId 30140 +#define UIA_IsDropTargetPatternAvailablePropertyId 30141 +#define UIA_DropTargetDropTargetEffectPropertyId 30142 +#define UIA_DropTargetDropTargetEffectsPropertyId 30143 +#define UIA_DragGrabbedItemsPropertyId 30144 +#define UIA_Transform2ZoomLevelPropertyId 30145 +#define UIA_Transform2ZoomMinimumPropertyId 30146 +#define UIA_Transform2ZoomMaximumPropertyId 30147 +#define UIA_FlowsFromPropertyId 30148 +#define UIA_IsTextEditPatternAvailablePropertyId 30149 +#define UIA_IsPeripheralPropertyId 30150 +#define UIA_IsCustomNavigationPatternAvailablePropertyId 30151 +#define UIA_PositionInSetPropertyId 30152 +#define UIA_SizeOfSetPropertyId 30153 +#define UIA_LevelPropertyId 30154 +#define UIA_AnnotationTypesPropertyId 30155 +#define UIA_AnnotationObjectsPropertyId 30156 +#define UIA_LandmarkTypePropertyId 30157 +#define UIA_LocalizedLandmarkTypePropertyId 30158 +#define UIA_FullDescriptionPropertyId 30159 +#define UIA_FillColorPropertyId 30160 +#define UIA_OutlineColorPropertyId 30161 +#define UIA_FillTypePropertyId 30162 +#define UIA_VisualEffectsPropertyId 30163 +#define UIA_OutlineThicknessPropertyId 30164 +#define UIA_CenterPointPropertyId 30165 +#define UIA_RotationPropertyId 30166 +#define UIA_SizePropertyId 30167 + +#endif diff --git a/src/platformsupport/windowsuiautomation/uiaserverinterfaces.h b/src/platformsupport/windowsuiautomation/uiaserverinterfaces.h new file mode 100644 index 0000000000..caae84755b --- /dev/null +++ b/src/platformsupport/windowsuiautomation/uiaserverinterfaces.h @@ -0,0 +1,352 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef UIASERVERINTERFACES_H +#define UIASERVERINTERFACES_H + +#include <Unknwn.h> + +#ifndef __IRawElementProviderSimple_INTERFACE_DEFINED__ +#define __IRawElementProviderSimple_INTERFACE_DEFINED__ +DEFINE_GUID(IID_IRawElementProviderSimple, 0xd6dd68d1, 0x86fd, 0x4332, 0x86,0x66, 0x9a,0xbe,0xde,0xa2,0xd2,0x4c); +MIDL_INTERFACE("d6dd68d1-86fd-4332-8666-9abedea2d24c") +IRawElementProviderSimple : public IUnknown +{ +public: + virtual HRESULT STDMETHODCALLTYPE get_ProviderOptions(__RPC__out enum ProviderOptions *pRetVal) = 0; + virtual HRESULT STDMETHODCALLTYPE GetPatternProvider(PATTERNID patternId, __RPC__deref_out_opt IUnknown **pRetVal) = 0; + virtual HRESULT STDMETHODCALLTYPE GetPropertyValue(PROPERTYID propertyId, __RPC__out VARIANT *pRetVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_HostRawElementProvider(__RPC__deref_out_opt IRawElementProviderSimple **pRetVal) = 0; +}; +#ifdef __CRT_UUID_DECL +__CRT_UUID_DECL(IRawElementProviderSimple, 0xd6dd68d1, 0x86fd, 0x4332, 0x86,0x66, 0x9a,0xbe,0xde,0xa2,0xd2,0x4c) +#endif +#endif + + +#ifndef __IRawElementProviderFragmentRoot_FWD_DEFINED__ +#define __IRawElementProviderFragmentRoot_FWD_DEFINED__ +typedef interface IRawElementProviderFragmentRoot IRawElementProviderFragmentRoot; +#endif + + +#ifndef __IRawElementProviderFragment_FWD_DEFINED__ +#define __IRawElementProviderFragment_FWD_DEFINED__ +typedef interface IRawElementProviderFragment IRawElementProviderFragment; +#endif + + +#ifndef __IRawElementProviderFragment_INTERFACE_DEFINED__ +#define __IRawElementProviderFragment_INTERFACE_DEFINED__ +DEFINE_GUID(IID_IRawElementProviderFragment, 0xf7063da8, 0x8359, 0x439c, 0x92,0x97, 0xbb,0xc5,0x29,0x9a,0x7d,0x87); +MIDL_INTERFACE("f7063da8-8359-439c-9297-bbc5299a7d87") +IRawElementProviderFragment : public IUnknown +{ +public: + virtual HRESULT STDMETHODCALLTYPE Navigate(enum NavigateDirection direction, __RPC__deref_out_opt IRawElementProviderFragment **pRetVal) = 0; + virtual HRESULT STDMETHODCALLTYPE GetRuntimeId(__RPC__deref_out_opt SAFEARRAY **pRetVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_BoundingRectangle(__RPC__out struct UiaRect *pRetVal) = 0; + virtual HRESULT STDMETHODCALLTYPE GetEmbeddedFragmentRoots(__RPC__deref_out_opt SAFEARRAY **pRetVal) = 0; + virtual HRESULT STDMETHODCALLTYPE SetFocus() = 0; + virtual HRESULT STDMETHODCALLTYPE get_FragmentRoot(__RPC__deref_out_opt IRawElementProviderFragmentRoot **pRetVal) = 0; +}; +#ifdef __CRT_UUID_DECL +__CRT_UUID_DECL(IRawElementProviderFragment, 0xf7063da8, 0x8359, 0x439c, 0x92,0x97, 0xbb,0xc5,0x29,0x9a,0x7d,0x87) +#endif +#endif + + +#ifndef __IRawElementProviderFragmentRoot_INTERFACE_DEFINED__ +#define __IRawElementProviderFragmentRoot_INTERFACE_DEFINED__ +DEFINE_GUID(IID_IRawElementProviderFragmentRoot, 0x620ce2a5, 0xab8f, 0x40a9, 0x86,0xcb, 0xde,0x3c,0x75,0x59,0x9b,0x58); +MIDL_INTERFACE("620ce2a5-ab8f-40a9-86cb-de3c75599b58") +IRawElementProviderFragmentRoot : public IUnknown +{ +public: + virtual HRESULT STDMETHODCALLTYPE ElementProviderFromPoint(double x, double y, __RPC__deref_out_opt IRawElementProviderFragment **pRetVal) = 0; + virtual HRESULT STDMETHODCALLTYPE GetFocus(__RPC__deref_out_opt IRawElementProviderFragment **pRetVal) = 0; +}; +#ifdef __CRT_UUID_DECL +__CRT_UUID_DECL(IRawElementProviderFragmentRoot, 0x620ce2a5, 0xab8f, 0x40a9, 0x86,0xcb, 0xde,0x3c,0x75,0x59,0x9b,0x58) +#endif +#endif + + +#ifndef __IValueProvider_INTERFACE_DEFINED__ +#define __IValueProvider_INTERFACE_DEFINED__ +DEFINE_GUID(IID_IValueProvider, 0xc7935180, 0x6fb3, 0x4201, 0xb1,0x74, 0x7d,0xf7,0x3a,0xdb,0xf6,0x4a); +MIDL_INTERFACE("c7935180-6fb3-4201-b174-7df73adbf64a") +IValueProvider : public IUnknown +{ +public: + virtual HRESULT STDMETHODCALLTYPE SetValue(__RPC__in LPCWSTR val) = 0; + virtual HRESULT STDMETHODCALLTYPE get_Value(__RPC__deref_out_opt BSTR *pRetVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_IsReadOnly(__RPC__out BOOL *pRetVal) = 0; +}; +#ifdef __CRT_UUID_DECL +__CRT_UUID_DECL(IValueProvider, 0xc7935180, 0x6fb3, 0x4201, 0xb1,0x74, 0x7d,0xf7,0x3a,0xdb,0xf6,0x4a) +#endif +#endif + + +#ifndef __IRangeValueProvider_INTERFACE_DEFINED__ +#define __IRangeValueProvider_INTERFACE_DEFINED__ +DEFINE_GUID(IID_IRangeValueProvider, 0x36dc7aef, 0x33e6, 0x4691, 0xaf,0xe1, 0x2b,0xe7,0x27,0x4b,0x3d,0x33); +MIDL_INTERFACE("36dc7aef-33e6-4691-afe1-2be7274b3d33") +IRangeValueProvider : public IUnknown +{ +public: + virtual HRESULT STDMETHODCALLTYPE SetValue(double val) = 0; + virtual HRESULT STDMETHODCALLTYPE get_Value(__RPC__out double *pRetVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_IsReadOnly(__RPC__out BOOL *pRetVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_Maximum(__RPC__out double *pRetVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_Minimum(__RPC__out double *pRetVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_LargeChange(__RPC__out double *pRetVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_SmallChange(__RPC__out double *pRetVal) = 0; +}; +#ifdef __CRT_UUID_DECL +__CRT_UUID_DECL(IRangeValueProvider, 0x36dc7aef, 0x33e6, 0x4691, 0xaf,0xe1, 0x2b,0xe7,0x27,0x4b,0x3d,0x33) +#endif +#endif + + +#ifndef __ITextRangeProvider_INTERFACE_DEFINED__ +#define __ITextRangeProvider_INTERFACE_DEFINED__ +DEFINE_GUID(IID_ITextRangeProvider, 0x5347ad7b, 0xc355, 0x46f8, 0xaf,0xf5, 0x90,0x90,0x33,0x58,0x2f,0x63); +MIDL_INTERFACE("5347ad7b-c355-46f8-aff5-909033582f63") +ITextRangeProvider : public IUnknown +{ +public: + virtual HRESULT STDMETHODCALLTYPE Clone(__RPC__deref_out_opt ITextRangeProvider **pRetVal) = 0; + virtual HRESULT STDMETHODCALLTYPE Compare(__RPC__in_opt ITextRangeProvider *range, __RPC__out BOOL *pRetVal) = 0; + virtual HRESULT STDMETHODCALLTYPE CompareEndpoints(enum TextPatternRangeEndpoint endpoint, __RPC__in_opt ITextRangeProvider *targetRange, enum TextPatternRangeEndpoint targetEndpoint, __RPC__out int *pRetVal) = 0; + virtual HRESULT STDMETHODCALLTYPE ExpandToEnclosingUnit(enum TextUnit unit) = 0; + virtual HRESULT STDMETHODCALLTYPE FindAttribute(TEXTATTRIBUTEID attributeId, VARIANT val, BOOL backward, __RPC__deref_out_opt ITextRangeProvider **pRetVal) = 0; + virtual HRESULT STDMETHODCALLTYPE FindText(__RPC__in BSTR text, BOOL backward, BOOL ignoreCase, __RPC__deref_out_opt ITextRangeProvider **pRetVal) = 0; + virtual HRESULT STDMETHODCALLTYPE GetAttributeValue(TEXTATTRIBUTEID attributeId, __RPC__out VARIANT *pRetVal) = 0; + virtual HRESULT STDMETHODCALLTYPE GetBoundingRectangles(__RPC__deref_out_opt SAFEARRAY **pRetVal) = 0; + virtual HRESULT STDMETHODCALLTYPE GetEnclosingElement(__RPC__deref_out_opt IRawElementProviderSimple **pRetVal) = 0; + virtual HRESULT STDMETHODCALLTYPE GetText(int maxLength, __RPC__deref_out_opt BSTR *pRetVal) = 0; + virtual HRESULT STDMETHODCALLTYPE Move(enum TextUnit unit, int count, __RPC__out int *pRetVal) = 0; + virtual HRESULT STDMETHODCALLTYPE MoveEndpointByUnit(enum TextPatternRangeEndpoint endpoint, enum TextUnit unit, int count, __RPC__out int *pRetVal) = 0; + virtual HRESULT STDMETHODCALLTYPE MoveEndpointByRange(enum TextPatternRangeEndpoint endpoint, __RPC__in_opt ITextRangeProvider *targetRange, enum TextPatternRangeEndpoint targetEndpoint) = 0; + virtual HRESULT STDMETHODCALLTYPE Select() = 0; + virtual HRESULT STDMETHODCALLTYPE AddToSelection() = 0; + virtual HRESULT STDMETHODCALLTYPE RemoveFromSelection() = 0; + virtual HRESULT STDMETHODCALLTYPE ScrollIntoView(BOOL alignToTop) = 0; + virtual HRESULT STDMETHODCALLTYPE GetChildren(__RPC__deref_out_opt SAFEARRAY **pRetVal) = 0; +}; +#ifdef __CRT_UUID_DECL +__CRT_UUID_DECL(ITextRangeProvider, 0x5347ad7b, 0xc355, 0x46f8, 0xaf,0xf5, 0x90,0x90,0x33,0x58,0x2f,0x63) +#endif +#endif + + +#ifndef __ITextProvider_INTERFACE_DEFINED__ +#define __ITextProvider_INTERFACE_DEFINED__ +DEFINE_GUID(IID_ITextProvider, 0x3589c92c, 0x63f3, 0x4367, 0x99,0xbb, 0xad,0xa6,0x53,0xb7,0x7c,0xf2); +MIDL_INTERFACE("3589c92c-63f3-4367-99bb-ada653b77cf2") +ITextProvider : public IUnknown +{ +public: + virtual HRESULT STDMETHODCALLTYPE GetSelection(__RPC__deref_out_opt SAFEARRAY **pRetVal) = 0; + virtual HRESULT STDMETHODCALLTYPE GetVisibleRanges(__RPC__deref_out_opt SAFEARRAY **pRetVal) = 0; + virtual HRESULT STDMETHODCALLTYPE RangeFromChild(__RPC__in_opt IRawElementProviderSimple *childElement, __RPC__deref_out_opt ITextRangeProvider **pRetVal) = 0; + virtual HRESULT STDMETHODCALLTYPE RangeFromPoint(struct UiaPoint point, __RPC__deref_out_opt ITextRangeProvider **pRetVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_DocumentRange(__RPC__deref_out_opt ITextRangeProvider **pRetVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_SupportedTextSelection(__RPC__out enum SupportedTextSelection *pRetVal) = 0; +}; +#ifdef __CRT_UUID_DECL +__CRT_UUID_DECL(ITextProvider, 0x3589c92c, 0x63f3, 0x4367, 0x99,0xbb, 0xad,0xa6,0x53,0xb7,0x7c,0xf2) +#endif +#endif + + +#ifndef __ITextProvider2_INTERFACE_DEFINED__ +#define __ITextProvider2_INTERFACE_DEFINED__ +DEFINE_GUID(IID_ITextProvider2, 0x0dc5e6ed, 0x3e16, 0x4bf1, 0x8f,0x9a, 0xa9,0x79,0x87,0x8b,0xc1,0x95); +MIDL_INTERFACE("0dc5e6ed-3e16-4bf1-8f9a-a979878bc195") +ITextProvider2 : public ITextProvider +{ +public: + virtual HRESULT STDMETHODCALLTYPE RangeFromAnnotation(__RPC__in_opt IRawElementProviderSimple *annotationElement, __RPC__deref_out_opt ITextRangeProvider **pRetVal) = 0; + virtual HRESULT STDMETHODCALLTYPE GetCaretRange(__RPC__out BOOL *isActive, __RPC__deref_out_opt ITextRangeProvider **pRetVal) = 0; +}; +#ifdef __CRT_UUID_DECL +__CRT_UUID_DECL(ITextProvider2, 0x0dc5e6ed, 0x3e16, 0x4bf1, 0x8f,0x9a, 0xa9,0x79,0x87,0x8b,0xc1,0x95) +#endif +#endif + + +#ifndef __IToggleProvider_INTERFACE_DEFINED__ +#define __IToggleProvider_INTERFACE_DEFINED__ +DEFINE_GUID(IID_IToggleProvider, 0x56d00bd0, 0xc4f4, 0x433c, 0xa8,0x36, 0x1a,0x52,0xa5,0x7e,0x08,0x92); +MIDL_INTERFACE("56d00bd0-c4f4-433c-a836-1a52a57e0892") +IToggleProvider : public IUnknown +{ +public: + virtual HRESULT STDMETHODCALLTYPE Toggle() = 0; + virtual HRESULT STDMETHODCALLTYPE get_ToggleState(__RPC__out enum ToggleState *pRetVal) = 0; +}; +#ifdef __CRT_UUID_DECL +__CRT_UUID_DECL(IToggleProvider, 0x56d00bd0, 0xc4f4, 0x433c, 0xa8,0x36, 0x1a,0x52,0xa5,0x7e,0x08,0x92) +#endif +#endif + + +#ifndef __IInvokeProvider_INTERFACE_DEFINED__ +#define __IInvokeProvider_INTERFACE_DEFINED__ +DEFINE_GUID(IID_IInvokeProvider, 0x54fcb24b, 0xe18e, 0x47a2, 0xb4,0xd3, 0xec,0xcb,0xe7,0x75,0x99,0xa2); +MIDL_INTERFACE("54fcb24b-e18e-47a2-b4d3-eccbe77599a2") +IInvokeProvider : public IUnknown +{ +public: + virtual HRESULT STDMETHODCALLTYPE Invoke() = 0; +}; +#ifdef __CRT_UUID_DECL +__CRT_UUID_DECL(IInvokeProvider, 0x54fcb24b, 0xe18e, 0x47a2, 0xb4,0xd3, 0xec,0xcb,0xe7,0x75,0x99,0xa2) +#endif +#endif + + +#ifndef __ISelectionProvider_INTERFACE_DEFINED__ +#define __ISelectionProvider_INTERFACE_DEFINED__ +DEFINE_GUID(IID_ISelectionProvider, 0xfb8b03af, 0x3bdf, 0x48d4, 0xbd,0x36, 0x1a,0x65,0x79,0x3b,0xe1,0x68); +MIDL_INTERFACE("fb8b03af-3bdf-48d4-bd36-1a65793be168") +ISelectionProvider : public IUnknown +{ +public: + virtual HRESULT STDMETHODCALLTYPE GetSelection(__RPC__deref_out_opt SAFEARRAY **pRetVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CanSelectMultiple(__RPC__out BOOL *pRetVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_IsSelectionRequired(__RPC__out BOOL *pRetVal) = 0; +}; +#ifdef __CRT_UUID_DECL +__CRT_UUID_DECL(ISelectionProvider, 0xfb8b03af, 0x3bdf, 0x48d4, 0xbd,0x36, 0x1a,0x65,0x79,0x3b,0xe1,0x68) +#endif +#endif + + +#ifndef __ISelectionItemProvider_INTERFACE_DEFINED__ +#define __ISelectionItemProvider_INTERFACE_DEFINED__ +DEFINE_GUID(IID_ISelectionItemProvider, 0x2acad808, 0xb2d4, 0x452d, 0xa4,0x07, 0x91,0xff,0x1a,0xd1,0x67,0xb2); +MIDL_INTERFACE("2acad808-b2d4-452d-a407-91ff1ad167b2") +ISelectionItemProvider : public IUnknown +{ +public: + virtual HRESULT STDMETHODCALLTYPE Select() = 0; + virtual HRESULT STDMETHODCALLTYPE AddToSelection() = 0; + virtual HRESULT STDMETHODCALLTYPE RemoveFromSelection() = 0; + virtual HRESULT STDMETHODCALLTYPE get_IsSelected(__RPC__out BOOL *pRetVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_SelectionContainer(__RPC__deref_out_opt IRawElementProviderSimple **pRetVal) = 0; +}; +#ifdef __CRT_UUID_DECL +__CRT_UUID_DECL(ISelectionItemProvider, 0x2acad808, 0xb2d4, 0x452d, 0xa4,0x07, 0x91,0xff,0x1a,0xd1,0x67,0xb2) +#endif +#endif + + +#ifndef __ITableProvider_INTERFACE_DEFINED__ +#define __ITableProvider_INTERFACE_DEFINED__ +DEFINE_GUID(IID_ITableProvider, 0x9c860395, 0x97b3, 0x490a, 0xb5,0x2a, 0x85,0x8c,0xc2,0x2a,0xf1,0x66); +MIDL_INTERFACE("9c860395-97b3-490a-b52a-858cc22af166") +ITableProvider : public IUnknown +{ +public: + virtual HRESULT STDMETHODCALLTYPE GetRowHeaders(__RPC__deref_out_opt SAFEARRAY **pRetVal) = 0; + virtual HRESULT STDMETHODCALLTYPE GetColumnHeaders(__RPC__deref_out_opt SAFEARRAY **pRetVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_RowOrColumnMajor(__RPC__out enum RowOrColumnMajor *pRetVal) = 0; +}; +#ifdef __CRT_UUID_DECL +__CRT_UUID_DECL(ITableProvider, 0x9c860395, 0x97b3, 0x490a, 0xb5,0x2a, 0x85,0x8c,0xc2,0x2a,0xf1,0x66) +#endif +#endif + + +#ifndef __ITableItemProvider_INTERFACE_DEFINED__ +#define __ITableItemProvider_INTERFACE_DEFINED__ +DEFINE_GUID(IID_ITableItemProvider, 0xb9734fa6, 0x771f, 0x4d78, 0x9c,0x90, 0x25,0x17,0x99,0x93,0x49,0xcd); +MIDL_INTERFACE("b9734fa6-771f-4d78-9c90-2517999349cd") +ITableItemProvider : public IUnknown +{ +public: + virtual HRESULT STDMETHODCALLTYPE GetRowHeaderItems(__RPC__deref_out_opt SAFEARRAY **pRetVal) = 0; + virtual HRESULT STDMETHODCALLTYPE GetColumnHeaderItems(__RPC__deref_out_opt SAFEARRAY **pRetVal) = 0; +}; +#ifdef __CRT_UUID_DECL +__CRT_UUID_DECL(ITableItemProvider, 0xb9734fa6, 0x771f, 0x4d78, 0x9c,0x90, 0x25,0x17,0x99,0x93,0x49,0xcd) +#endif +#endif + + +#ifndef __IGridProvider_INTERFACE_DEFINED__ +#define __IGridProvider_INTERFACE_DEFINED__ +DEFINE_GUID(IID_IGridProvider, 0xb17d6187, 0x0907, 0x464b, 0xa1,0x68, 0x0e,0xf1,0x7a,0x15,0x72,0xb1); +MIDL_INTERFACE("b17d6187-0907-464b-a168-0ef17a1572b1") +IGridProvider : public IUnknown +{ +public: + virtual HRESULT STDMETHODCALLTYPE GetItem(int row, int column, __RPC__deref_out_opt IRawElementProviderSimple **pRetVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_RowCount(__RPC__out int *pRetVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_ColumnCount(__RPC__out int *pRetVal) = 0; +}; +#ifdef __CRT_UUID_DECL +__CRT_UUID_DECL(IGridProvider, 0xb17d6187, 0x0907, 0x464b, 0xa1,0x68, 0x0e,0xf1,0x7a,0x15,0x72,0xb1) +#endif +#endif + + +#ifndef __IGridItemProvider_INTERFACE_DEFINED__ +#define __IGridItemProvider_INTERFACE_DEFINED__ +DEFINE_GUID(IID_IGridItemProvider, 0xd02541f1, 0xfb81, 0x4d64, 0xae,0x32, 0xf5,0x20,0xf8,0xa6,0xdb,0xd1); +MIDL_INTERFACE("d02541f1-fb81-4d64-ae32-f520f8a6dbd1") +IGridItemProvider : public IUnknown +{ +public: + virtual HRESULT STDMETHODCALLTYPE get_Row(__RPC__out int *pRetVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_Column(__RPC__out int *pRetVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_RowSpan(__RPC__out int *pRetVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_ColumnSpan(__RPC__out int *pRetVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_ContainingGrid(__RPC__deref_out_opt IRawElementProviderSimple **pRetVal) = 0; +}; +#ifdef __CRT_UUID_DECL +__CRT_UUID_DECL(IGridItemProvider, 0xd02541f1, 0xfb81, 0x4d64, 0xae,0x32, 0xf5,0x20,0xf8,0xa6,0xdb,0xd1) +#endif +#endif + +#endif diff --git a/src/platformsupport/windowsuiautomation/uiatypes.h b/src/platformsupport/windowsuiautomation/uiatypes.h new file mode 100644 index 0000000000..25d8b8cb2b --- /dev/null +++ b/src/platformsupport/windowsuiautomation/uiatypes.h @@ -0,0 +1,145 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef UIATYPES_H +#define UIATYPES_H + +typedef int PROPERTYID; +typedef int PATTERNID; +typedef int EVENTID; +typedef int TEXTATTRIBUTEID; +typedef int CONTROLTYPEID; +typedef int LANDMARKTYPEID; +typedef int METADATAID; + +typedef void *UIA_HWND; + +enum NavigateDirection { + NavigateDirection_Parent = 0, + NavigateDirection_NextSibling = 1, + NavigateDirection_PreviousSibling = 2, + NavigateDirection_FirstChild = 3, + NavigateDirection_LastChild = 4 +}; + +enum ProviderOptions { + ProviderOptions_ClientSideProvider = 0x1, + ProviderOptions_ServerSideProvider = 0x2, + ProviderOptions_NonClientAreaProvider = 0x4, + ProviderOptions_OverrideProvider = 0x8, + ProviderOptions_ProviderOwnsSetFocus = 0x10, + ProviderOptions_UseComThreading = 0x20, + ProviderOptions_RefuseNonClientSupport = 0x40, + ProviderOptions_HasNativeIAccessible = 0x80, + ProviderOptions_UseClientCoordinates = 0x100 +}; + +enum SupportedTextSelection { + SupportedTextSelection_None = 0, + SupportedTextSelection_Single = 1, + SupportedTextSelection_Multiple = 2 +}; + +enum TextUnit { + TextUnit_Character = 0, + TextUnit_Format = 1, + TextUnit_Word = 2, + TextUnit_Line = 3, + TextUnit_Paragraph = 4, + TextUnit_Page = 5, + TextUnit_Document = 6 +}; + +enum TextPatternRangeEndpoint { + TextPatternRangeEndpoint_Start = 0, + TextPatternRangeEndpoint_End = 1 +}; + +enum CaretPosition { + CaretPosition_Unknown = 0, + CaretPosition_EndOfLine = 1, + CaretPosition_BeginningOfLine = 2 +}; + +enum ToggleState { + ToggleState_Off = 0, + ToggleState_On = 1, + ToggleState_Indeterminate = 2 +}; + +enum RowOrColumnMajor { + RowOrColumnMajor_RowMajor = 0, + RowOrColumnMajor_ColumnMajor = 1, + RowOrColumnMajor_Indeterminate = 2 +}; + +enum TreeScope { + TreeScope_None = 0, + TreeScope_Element = 0x1, + TreeScope_Children = 0x2, + TreeScope_Descendants = 0x4, + TreeScope_Parent = 0x8, + TreeScope_Ancestors = 0x10, + TreeScope_Subtree = TreeScope_Element | TreeScope_Children | TreeScope_Descendants +}; + +enum OrientationType { + OrientationType_None = 0, + OrientationType_Horizontal = 1, + OrientationType_Vertical = 2 +}; + +enum PropertyConditionFlags { + PropertyConditionFlags_None = 0, + PropertyConditionFlags_IgnoreCase = 1 +}; + +struct UiaRect { + double left; + double top; + double width; + double height; +}; + +struct UiaPoint { + double x; + double y; +}; + +#endif diff --git a/src/platformsupport/windowsuiautomation/windowsuiautomation.pro b/src/platformsupport/windowsuiautomation/windowsuiautomation.pro new file mode 100644 index 0000000000..28c26477f3 --- /dev/null +++ b/src/platformsupport/windowsuiautomation/windowsuiautomation.pro @@ -0,0 +1,23 @@ +TARGET = QtWindowsUIAutomationSupport +MODULE = windowsuiautomation_support + +QT = core-private gui-private +CONFIG += static internal_module + +HEADERS += \ + qwindowsuiawrapper_p.h \ + uiaattributeids.h \ + uiacontroltypeids.h \ + uiaerrorids.h \ + uiaeventids.h \ + uiageneralids.h \ + uiaserverinterfaces.h \ + uiaclientinterfaces.h \ + uiapatternids.h \ + uiapropertyids.h \ + uiatypes.h + +SOURCES += \ + qwindowsuiawrapper.cpp + +load(qt_module) |