diff options
author | Morten Johan Sørvig <morten.sorvig@qt.io> | 2018-03-08 17:05:14 +0100 |
---|---|---|
committer | Morten Johan Sørvig <morten.sorvig@qt.io> | 2018-03-08 18:14:46 +0100 |
commit | 5a7c33dece358090bc8fd3b84567d8bcb0e3b630 (patch) | |
tree | f73931fd2416debfecced1676761aabe48d2f319 /src/platformsupport | |
parent | c9908423d33828b15e5ea97bb1ee8deb08f15673 (diff) | |
parent | e5a6e9bb80fb2427228f70488b8839b4aa0b4261 (diff) |
Merge remote-tracking branch 'gerrit/5.11' into HEAD
Change-Id: Id3a0e9482b35b5e4c79018e0c547d3c4ff48d9a5
Diffstat (limited to 'src/platformsupport')
47 files changed, 2113 insertions, 144 deletions
diff --git a/src/platformsupport/edid/qedidparser_p.h b/src/platformsupport/edid/qedidparser_p.h index c5888dc5d7..c436155258 100644 --- a/src/platformsupport/edid/qedidparser_p.h +++ b/src/platformsupport/edid/qedidparser_p.h @@ -47,10 +47,12 @@ // 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 +// 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. // +// We mean it. +// QT_BEGIN_NAMESPACE diff --git a/src/platformsupport/edid/qedidvendortable_p.h b/src/platformsupport/edid/qedidvendortable_p.h index 948a9cecfc..6ec399df05 100644 --- a/src/platformsupport/edid/qedidvendortable_p.h +++ b/src/platformsupport/edid/qedidvendortable_p.h @@ -51,10 +51,12 @@ // 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 +// 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. // +// We mean it. +// QT_BEGIN_NAMESPACE diff --git a/src/platformsupport/eglconvenience/qeglpbuffer.cpp b/src/platformsupport/eglconvenience/qeglpbuffer.cpp index 67d7204734..15fc089778 100644 --- a/src/platformsupport/eglconvenience/qeglpbuffer.cpp +++ b/src/platformsupport/eglconvenience/qeglpbuffer.cpp @@ -62,7 +62,7 @@ QEGLPbuffer::QEGLPbuffer(EGLDisplay display, const QSurfaceFormat &format, QOffs , m_display(display) , m_pbuffer(EGL_NO_SURFACE) { - bool hasSurfaceless = !flags.testFlag(QEGLPlatformContext::NoSurfaceless) + m_hasSurfaceless = !flags.testFlag(QEGLPlatformContext::NoSurfaceless) && q_hasEglExtension(display, "EGL_KHR_surfaceless_context"); // Disable surfaceless contexts on Mesa for now. As of 10.6.0 and Intel at least, some @@ -72,9 +72,9 @@ QEGLPbuffer::QEGLPbuffer(EGLDisplay display, const QSurfaceFormat &format, QOffs // read/draw surface in the Intel backend. const char *vendor = eglQueryString(display, EGL_VENDOR); // hard to check for GL_ strings here, so blacklist all Mesa if (vendor && strstr(vendor, "Mesa")) - hasSurfaceless = false; + m_hasSurfaceless = false; - if (hasSurfaceless) + if (m_hasSurfaceless) return; EGLConfig config = q_configFromGLFormat(m_display, m_format, false, EGL_PBUFFER_BIT); @@ -100,4 +100,9 @@ QEGLPbuffer::~QEGLPbuffer() eglDestroySurface(m_display, m_pbuffer); } +bool QEGLPbuffer::isValid() const +{ + return m_pbuffer != EGL_NO_SURFACE || m_hasSurfaceless; +} + QT_END_NAMESPACE diff --git a/src/platformsupport/eglconvenience/qeglpbuffer_p.h b/src/platformsupport/eglconvenience/qeglpbuffer_p.h index eed8cd9dca..0285e067a6 100644 --- a/src/platformsupport/eglconvenience/qeglpbuffer_p.h +++ b/src/platformsupport/eglconvenience/qeglpbuffer_p.h @@ -64,7 +64,7 @@ public: ~QEGLPbuffer(); QSurfaceFormat format() const override { return m_format; } - bool isValid() const override { return m_pbuffer != EGL_NO_SURFACE; } + bool isValid() const override; EGLSurface pbuffer() const { return m_pbuffer; } @@ -72,6 +72,7 @@ private: QSurfaceFormat m_format; EGLDisplay m_display; EGLSurface m_pbuffer; + bool m_hasSurfaceless; }; QT_END_NAMESPACE diff --git a/src/platformsupport/eglconvenience/qeglplatformcontext.cpp b/src/platformsupport/eglconvenience/qeglplatformcontext.cpp index 9ca969aa68..6ed55d7337 100644 --- a/src/platformsupport/eglconvenience/qeglplatformcontext.cpp +++ b/src/platformsupport/eglconvenience/qeglplatformcontext.cpp @@ -45,7 +45,7 @@ #include <QtPlatformHeaders/QEGLNativeContext> #include <QDebug> -#ifdef Q_OS_ANDROID +#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) #include <QtCore/private/qjnihelpers_p.h> #endif #ifndef Q_OS_WIN @@ -338,7 +338,7 @@ void QEGLPlatformContext::updateFormatFromGL() QByteArray version = QByteArray(reinterpret_cast<const char *>(s)); int major, minor; if (QPlatformOpenGLContext::parseOpenGLVersion(version, major, minor)) { -#ifdef Q_OS_ANDROID +#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) // Some Android 4.2.2 devices report OpenGL ES 3.0 without the functions being available. static int apiLevel = QtAndroidPrivate::androidSdkVersion(); if (apiLevel <= 17 && major >= 3) { diff --git a/src/platformsupport/fbconvenience/qfbbackingstore.cpp b/src/platformsupport/fbconvenience/qfbbackingstore.cpp index 2cad3441e4..e2d94406a4 100644 --- a/src/platformsupport/fbconvenience/qfbbackingstore.cpp +++ b/src/platformsupport/fbconvenience/qfbbackingstore.cpp @@ -104,9 +104,8 @@ void QFbBackingStore::beginPaint(const QRegion ®ion) if (mImage.hasAlphaChannel()) { QPainter p(&mImage); p.setCompositionMode(QPainter::CompositionMode_Source); - const QVector<QRect> rects = region.rects(); - for (QVector<QRect>::const_iterator it = rects.begin(); it != rects.end(); ++it) - p.fillRect(*it, Qt::transparent); + for (const QRect &r : region) + p.fillRect(r, Qt::transparent); } } diff --git a/src/platformsupport/fbconvenience/qfbscreen.cpp b/src/platformsupport/fbconvenience/qfbscreen.cpp index 2b4498157c..c42fd879f8 100644 --- a/src/platformsupport/fbconvenience/qfbscreen.cpp +++ b/src/platformsupport/fbconvenience/qfbscreen.cpp @@ -210,10 +210,9 @@ QRegion QFbScreen::doRedraw() if (!mPainter) mPainter = new QPainter(&mScreenImage); - const QVector<QRect> rects = mRepaintRegion.rects(); const QRect screenRect = mGeometry.translated(-screenOffset); - for (int rectIndex = 0; rectIndex < mRepaintRegion.rectCount(); rectIndex++) { - const QRect rect = rects[rectIndex].intersected(screenRect); + for (QRect rect : mRepaintRegion) { + rect = rect.intersected(screenRect); if (rect.isEmpty()) continue; diff --git a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp index 733d6dc531..aa8f9a892a 100644 --- a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp +++ b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp @@ -250,7 +250,17 @@ static const char specialLanguages[][6] = { "", // Hatran "", // Multani "", // OldHungarian - "" // SignWriting + "", // SignWriting + "", // Adlam + "", // Bhaiksuki + "", // Marchen + "", // Newa + "", // Osage + "", // Tangut + "", // MasaramGondi + "", // Nushu + "", // Soyombo + "" // ZanabazarSquare }; Q_STATIC_ASSERT(sizeof specialLanguages / sizeof *specialLanguages == QChar::ScriptCount); @@ -905,7 +915,7 @@ void QFontconfigDatabase::setupFontEngine(QFontEngineFT *engine, const QFontDef if (services) { const QList<QByteArray> desktopEnv = services->desktopEnvironment().split(':'); - useXftConf = desktopEnv.contains("GNOME") || desktopEnv.contains("UNITY"); + useXftConf = desktopEnv.contains("GNOME") || desktopEnv.contains("UNITY") || desktopEnv.contains("XFCE"); } if (useXftConf && !forcedAntialiasSetting) { diff --git a/src/platformsupport/fontdatabases/fontdatabases.pro b/src/platformsupport/fontdatabases/fontdatabases.pro index d2726d08a0..f2bac9ab94 100644 --- a/src/platformsupport/fontdatabases/fontdatabases.pro +++ b/src/platformsupport/fontdatabases/fontdatabases.pro @@ -9,25 +9,25 @@ PRECOMPILED_HEADER = ../../corelib/global/qt_pch.h darwin { include($$PWD/mac/coretext.pri) -} else { - qtConfig(freetype) { - include($$PWD/freetype/freetype.pri) - } +} - unix { - include($$PWD/genericunix/genericunix.pri) - qtConfig(fontconfig) { - include($$PWD/fontconfig/fontconfig.pri) - } - } +qtConfig(freetype) { + include($$PWD/freetype/freetype.pri) +} - win32:!winrt { - include($$PWD/windows/windows.pri) +unix { + include($$PWD/genericunix/genericunix.pri) + qtConfig(fontconfig) { + include($$PWD/fontconfig/fontconfig.pri) } +} - winrt { - include($$PWD/winrt/winrt.pri) - } +win32:!winrt { + include($$PWD/windows/windows.pri) +} + +winrt { + include($$PWD/winrt/winrt.pri) } load(qt_module) diff --git a/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp b/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp index 4ac5289f10..add442ebc5 100644 --- a/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp +++ b/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp @@ -998,9 +998,7 @@ int QFontEngineFT::loadFlags(QGlyphSet *set, GlyphFormat format, int flags, static inline bool areMetricsTooLarge(const QFontEngineFT::GlyphInfo &info) { // false if exceeds QFontEngineFT::Glyph metrics - return (short)(info.linearAdvance) != info.linearAdvance - || (uchar)(info.width) != info.width - || (uchar)(info.height) != info.height; + return info.width > 0xFF || info.height > 0xFF; } static inline void transformBoundingBox(int *left, int *top, int *right, int *bottom, FT_Matrix *matrix) @@ -1776,15 +1774,28 @@ QFixed QFontEngineFT::scaledBitmapMetrics(QFixed m) const return m * scalableBitmapScaleFactor; } -glyph_metrics_t QFontEngineFT::scaledBitmapMetrics(const glyph_metrics_t &m) const +glyph_metrics_t QFontEngineFT::scaledBitmapMetrics(const glyph_metrics_t &m, const QTransform &t) const { + QTransform trans; + trans.setMatrix(t.m11(), t.m12(), t.m13(), + t.m21(), t.m22(), t.m23(), + 0, 0, t.m33()); + const qreal scaleFactor = scalableBitmapScaleFactor.toReal(); + trans.scale(scaleFactor, scaleFactor); + + QRectF rect(m.x.toReal(), m.y.toReal(), m.width.toReal(), m.height.toReal()); + QPointF offset(m.xoff.toReal(), m.yoff.toReal()); + + rect = trans.mapRect(rect); + offset = trans.map(offset); + glyph_metrics_t metrics; - metrics.x = scaledBitmapMetrics(m.x); - metrics.y = scaledBitmapMetrics(m.y); - metrics.width = scaledBitmapMetrics(m.width); - metrics.height = scaledBitmapMetrics(m.height); - metrics.xoff = scaledBitmapMetrics(m.xoff); - metrics.yoff = scaledBitmapMetrics(m.yoff); + metrics.x = QFixed::fromReal(rect.x()); + metrics.y = QFixed::fromReal(rect.y()); + metrics.width = QFixed::fromReal(rect.width()); + metrics.height = QFixed::fromReal(rect.height()); + metrics.xoff = QFixed::fromReal(offset.x()); + metrics.yoff = QFixed::fromReal(offset.y()); return metrics; } @@ -1878,7 +1889,7 @@ glyph_metrics_t QFontEngineFT::boundingBox(const QGlyphLayout &glyphs) unlockFace(); if (isScalableBitmap()) - overall = scaledBitmapMetrics(overall); + overall = scaledBitmapMetrics(overall, QTransform()); return overall; } @@ -1917,7 +1928,7 @@ glyph_metrics_t QFontEngineFT::boundingBox(glyph_t glyph) unlockFace(); if (isScalableBitmap()) - overall = scaledBitmapMetrics(overall); + overall = scaledBitmapMetrics(overall, QTransform()); return overall; } @@ -1955,7 +1966,7 @@ glyph_metrics_t QFontEngineFT::alphaMapBoundingBox(glyph_t glyph, QFixed subPixe } if (isScalableBitmap()) - overall = scaledBitmapMetrics(overall); + overall = scaledBitmapMetrics(overall, matrix); return overall; } diff --git a/src/platformsupport/fontdatabases/freetype/qfontengine_ft_p.h b/src/platformsupport/fontdatabases/freetype/qfontengine_ft_p.h index 7efd175402..d498b0ac8b 100644 --- a/src/platformsupport/fontdatabases/freetype/qfontengine_ft_p.h +++ b/src/platformsupport/fontdatabases/freetype/qfontengine_ft_p.h @@ -133,7 +133,7 @@ public: /* we don't cache glyphs that are too large anyway, so we can make this struct rather small */ struct Glyph { ~Glyph(); - short linearAdvance; + int linearAdvance : 22; unsigned char width; unsigned char height; short x; @@ -321,7 +321,7 @@ private: int loadFlags(QGlyphSet *set, GlyphFormat format, int flags, bool &hsubpixel, int &vfactor) const; bool shouldUseDesignMetrics(ShaperFlags flags) const; QFixed scaledBitmapMetrics(QFixed m) const; - glyph_metrics_t scaledBitmapMetrics(const glyph_metrics_t &m) const; + glyph_metrics_t scaledBitmapMetrics(const glyph_metrics_t &m, const QTransform &matrix) const; GlyphFormat defaultFormat; FT_Matrix matrix; diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm index 7694bfd6bb..5eb5cd8a30 100644 --- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm +++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm @@ -416,7 +416,19 @@ extern CGAffineTransform qt_transform_from_fontdef(const QFontDef &fontDef); template <> QFontEngine *QCoreTextFontDatabaseEngineFactory<QCoreTextFontEngine>::fontEngine(const QFontDef &fontDef, void *usrPtr) { - CTFontDescriptorRef descriptor = static_cast<CTFontDescriptorRef>(usrPtr); + QCFType<CTFontDescriptorRef> descriptor = QCFType<CTFontDescriptorRef>::constructFromGet( + static_cast<CTFontDescriptorRef>(usrPtr)); + + // CoreText will sometimes invalidate information in font descriptors that refer + // to system fonts in certain function calls or application states. While the descriptor + // looks the same from the outside, some internal plumbing is different, causing the results + // of creating CTFonts from those descriptors unreliable. The work-around for this + // is to copy the attributes of those descriptors each time we make a new CTFont + // from them instead of referring to the original, as that may trigger the CoreText bug. + if (m_systemFontDescriptors.contains(descriptor)) { + QCFType<CFDictionaryRef> attributes = CTFontDescriptorCopyAttributes(descriptor); + descriptor = CTFontDescriptorCreateWithAttributes(attributes); + } // Since we do not pass in the destination DPI to CoreText when making // the font, we need to pass in a point size which is scaled to include @@ -427,14 +439,10 @@ QFontEngine *QCoreTextFontDatabaseEngineFactory<QCoreTextFontEngine>::fontEngine qreal scaledPointSize = fontDef.pixelSize; CGAffineTransform matrix = qt_transform_from_fontdef(fontDef); - CTFontRef font = CTFontCreateWithFontDescriptor(descriptor, scaledPointSize, &matrix); - if (font) { - QFontEngine *engine = new QCoreTextFontEngine(font, fontDef); - CFRelease(font); - return engine; - } + if (QCFType<CTFontRef> font = CTFontCreateWithFontDescriptor(descriptor, scaledPointSize, &matrix)) + return new QCoreTextFontEngine(font, fontDef); - return NULL; + return nullptr; } #ifndef QT_NO_FREETYPE @@ -499,6 +507,23 @@ static QString familyNameFromPostScriptName(NSString *psName) } #endif +static void addExtraFallbacks(QStringList *fallbackList) +{ +#if defined(Q_OS_MACOS) + // Since we are only returning a list of default fonts for the current language, we do not + // cover all unicode completely. This was especially an issue for some of the common script + // symbols such as mathematical symbols, currency or geometric shapes. To minimize the risk + // of missing glyphs, we add Arial Unicode MS as a final fail safe, since this covers most + // of Unicode 2.1. + if (!fallbackList->contains(QStringLiteral("Arial Unicode MS"))) + fallbackList->append(QStringLiteral("Arial Unicode MS")); + // Since some symbols (specifically Braille) are not in Arial Unicode MS, we + // add Apple Symbols to cover those too. + if (!fallbackList->contains(QStringLiteral("Apple Symbols"))) + fallbackList->append(QStringLiteral("Apple Symbols")); +#endif +} + QStringList QCoreTextFontDatabase::fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script) const { Q_UNUSED(style); @@ -526,15 +551,9 @@ QStringList QCoreTextFontDatabase::fallbacksForFamily(const QString &family, QFo fallbackList.append(QString::fromCFString(fallbackFamilyName)); } -#if defined(Q_OS_OSX) - // Since we are only returning a list of default fonts for the current language, we do not - // cover all unicode completely. This was especially an issue for some of the common script - // symbols such as mathematical symbols, currency or geometric shapes. To minimize the risk - // of missing glyphs, we add Arial Unicode MS as a final fail safe, since this covers most - // of Unicode 2.1. - if (!fallbackList.contains(QStringLiteral("Arial Unicode MS"))) - fallbackList.append(QStringLiteral("Arial Unicode MS")); -#endif + addExtraFallbacks(&fallbackList); + extern QStringList qt_sort_families_by_writing_system(QChar::Script, const QStringList &); + fallbackList = qt_sort_families_by_writing_system(script, fallbackList); return fallbackList; } @@ -573,14 +592,7 @@ QStringList QCoreTextFontDatabase::fallbacksForFamily(const QString &family, QFo fallbackList.append(QLatin1String("Apple Color Emoji")); - // Since we are only returning a list of default fonts for the current language, we do not - // cover all unicode completely. This was especially an issue for some of the common script - // symbols such as mathematical symbols, currency or geometric shapes. To minimize the risk - // of missing glyphs, we add Arial Unicode MS as a final fail safe, since this covers most - // of Unicode 2.1. - if (!fallbackList.contains(QStringLiteral("Arial Unicode MS"))) - fallbackList.append(QStringLiteral("Arial Unicode MS")); - + addExtraFallbacks(&fallbackList); fallbackLists[styleLookupKey.arg(fallbackStyleHint)] = fallbackList; } #else @@ -666,7 +678,7 @@ static CTFontUIFontType fontTypeFromTheme(QPlatformTheme::Font f) return kCTFontUIFontSystem; case QPlatformTheme::TipLabelFont: - return kCTFontToolTipFontType; + return kCTFontUIFontToolTip; case QPlatformTheme::StatusBarFont: return kCTFontUIFontSystem; @@ -675,9 +687,11 @@ static CTFontUIFontType fontTypeFromTheme(QPlatformTheme::Font f) return kCTFontUIFontWindowTitle; case QPlatformTheme::MdiSubWindowTitleFont: - case QPlatformTheme::DockWidgetTitleFont: return kCTFontUIFontSystem; + case QPlatformTheme::DockWidgetTitleFont: + return kCTFontUIFontSmallSystem; + case QPlatformTheme::PushButtonFont: return kCTFontUIFontPushButton; diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h index 76ab31c046..05f6ed641c 100644 --- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h +++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h @@ -87,12 +87,14 @@ public: QFont *themeFont(QPlatformTheme::Font) const; const QHash<QPlatformTheme::Font, QFont *> &themeFonts() const; +protected: + mutable QSet<CTFontDescriptorRef> m_systemFontDescriptors; + private: void populateFromDescriptor(CTFontDescriptorRef font, const QString &familyName = QString()); mutable QString defaultFontName; - mutable QSet<CTFontDescriptorRef> m_systemFontDescriptors; mutable QHash<QPlatformTheme::Font, QFont *> m_themeFonts; bool m_hasPopulatedAliases; }; diff --git a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm index 66baf162d9..25ff69d877 100644 --- a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm +++ b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm @@ -47,28 +47,18 @@ #include <cmath> -#if defined(Q_OS_OSX) && !QT_OSX_DEPLOYMENT_TARGET_BELOW(__MAC_10_11) +#if defined(Q_OS_MACOS) #import <AppKit/AppKit.h> #endif -#if defined(QT_PLATFORM_UIKIT) && !QT_IOS_DEPLOYMENT_TARGET_BELOW(__IPHONE_8_2) +#if defined(QT_PLATFORM_UIKIT) #import <UIKit/UIKit.h> #endif // These are available cross platform, exported as kCTFontWeightXXX from CoreText.framework, // but they are not documented and are not in public headers so are private API and exposed // only through the NSFontWeightXXX and UIFontWeightXXX aliases in AppKit and UIKit (rdar://26109857) -#if QT_MAC_DEPLOYMENT_TARGET_BELOW(__MAC_10_11, __IPHONE_8_2) -#define kCTFontWeightUltraLight -0.8 -#define kCTFontWeightThin -0.6 -#define kCTFontWeightLight -0.4 -#define kCTFontWeightRegular 0 -#define kCTFontWeightMedium 0.23 -#define kCTFontWeightSemibold 0.3 -#define kCTFontWeightBold 0.4 -#define kCTFontWeightHeavy 0.56 -#define kCTFontWeightBlack 0.62 -#elif defined(Q_OS_OSX) +#if defined(Q_OS_MACOS) #define kCTFontWeightUltraLight NSFontWeightUltraLight #define kCTFontWeightThin NSFontWeightThin #define kCTFontWeightLight NSFontWeightLight @@ -192,6 +182,14 @@ public: : QCoreTextFontEngine(font, def) , m_fontData(fontData) {} + QFontEngine *cloneWithSize(qreal pixelSize) const + { + QFontDef newFontDef = fontDef; + newFontDef.pixelSize = pixelSize; + newFontDef.pointSize = pixelSize * 72.0 / qt_defaultDpi(); + + return new QCoreTextRawFontEngine(cgFont, newFontDef, m_fontData); + } QByteArray m_fontData; }; @@ -665,11 +663,7 @@ QImage QCoreTextFontEngine::imageForGlyph(glyph_t glyph, QFixed subPixelPosition if (!im.width() || !im.height()) return im; -#ifdef Q_OS_OSX - CGColorSpaceRef colorspace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB); -#else - CGColorSpaceRef colorspace = CGColorSpaceCreateDeviceRGB(); -#endif + CGColorSpaceRef colorspace = CGColorSpaceCreateWithName(kCGColorSpaceSRGB); uint cgflags = isColorGlyph ? kCGImageAlphaPremultipliedFirst : kCGImageAlphaNoneSkipFirst; #ifdef kCGBitmapByteOrder32Host //only needed because CGImage.h added symbols in the minor version cgflags |= kCGBitmapByteOrder32Host; diff --git a/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h b/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h index 1f7b346909..b77aaa27c1 100644 --- a/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h +++ b/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h @@ -125,7 +125,7 @@ public: static QFontEngine::GlyphFormat defaultGlyphFormat; static QCoreTextFontEngine *create(const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference); -private: +protected: void init(); QImage imageForGlyph(glyph_t glyph, QFixed subPixelPosition, bool colorful, const QTransform &m); CTFontRef ctfont; diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp index 5198ffb9f8..aab1ab9889 100644 --- a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp +++ b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp @@ -76,8 +76,6 @@ typedef HRESULT (WINAPI *DWriteCreateFactoryType)(DWRITE_FACTORY_TYPE, const IID static inline DWriteCreateFactoryType resolveDWriteCreateFactory() { - if (QSysInfo::windowsVersion() < QSysInfo::WV_VISTA) - return nullptr; QSystemLibrary library(QStringLiteral("dwrite")); QFunctionPointer result = library.resolve("DWriteCreateFactory"); if (Q_UNLIKELY(!result)) { @@ -874,8 +872,8 @@ FontNames qt_getCanonicalFontNames(const uchar *table, quint32 bytes) if ((platform_id == PlatformId_Microsoft && (encoding_id == 0 || encoding_id == 1)) - && (language_id & 0x3ff) == MS_LangIdEnglish - && *idType < Microsoft) { + && ((language_id & 0x3ff) == MS_LangIdEnglish + || *idType < Microsoft)) { *id = i; *idType = Microsoft; } @@ -1174,6 +1172,46 @@ static int QT_WIN_CALLBACK populateFontFamilies(const LOGFONT *logFont, const TE return 1; // continue } +void QWindowsFontDatabase::addDefaultEUDCFont() +{ + QString path; + { + HKEY key; + if (RegOpenKeyEx(HKEY_CURRENT_USER, + L"EUDC\\1252", + 0, + KEY_READ, + &key) != ERROR_SUCCESS) { + return; + } + + WCHAR value[MAX_PATH]; + DWORD bufferSize = sizeof(value); + ZeroMemory(value, bufferSize); + + if (RegQueryValueEx(key, + L"SystemDefaultEUDCFont", + nullptr, + nullptr, + reinterpret_cast<LPBYTE>(value), + &bufferSize) == ERROR_SUCCESS) { + path = QString::fromWCharArray(value); + } + + RegCloseKey(key); + } + + if (!path.isEmpty()) { + QFile file(path); + if (!file.open(QIODevice::ReadOnly)) { + qCWarning(lcQpaFonts) << "Unable to open default EUDC font:" << path; + return; + } + + m_eudcFonts = addApplicationFont(file.readAll(), path); + } +} + void QWindowsFontDatabase::populateFontDatabase() { removeApplicationFonts(); @@ -1188,6 +1226,7 @@ void QWindowsFontDatabase::populateFontDatabase() QString systemDefaultFamily = QWindowsFontDatabase::systemDefaultFont().family(); if (QPlatformFontDatabase::resolveFontFamilyAlias(systemDefaultFamily) == systemDefaultFamily) QPlatformFontDatabase::registerFontFamily(systemDefaultFamily); + addDefaultEUDCFont(); } typedef QSharedPointer<QWindowsFontEngineData> QWindowsFontEngineDataPtr; @@ -1585,6 +1624,7 @@ void QWindowsFontDatabase::removeApplicationFonts() } } m_applicationFonts.clear(); + m_eudcFonts.clear(); } void QWindowsFontDatabase::releaseHandle(void *handle) @@ -1719,11 +1759,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) { @@ -1849,6 +1886,7 @@ QStringList QWindowsFontDatabase::fallbacksForFamily(const QString &family, QFon { QStringList result; result.append(QWindowsFontDatabase::familyForStyleHint(styleHint)); + result.append(m_eudcFonts); result.append(QWindowsFontDatabase::extraTryFontsForFamily(family)); result.append(QPlatformFontDatabase::fallbacksForFamily(family, style, styleHint, script)); @@ -1980,12 +2018,6 @@ QFont QWindowsFontDatabase::systemDefaultFont() // long deprecated; the message font of the NONCLIENTMETRICS structure obtained by // SystemParametersInfo(SPI_GETNONCLIENTMETRICS) should be used instead (see // QWindowsTheme::refreshFonts(), typically "Segoe UI, 9pt"), which is larger. - // In single monitor setups, the point sizes revolve around 8 (depending on UI - // scale factor, but not proportional to it). However, in multi monitor setups, - // where the DPI of the primary monitor are smaller than those of the secondary, - // large bogus values are returned. Limit to 8.25 in that case. - if (GetSystemMetrics(SM_CMONITORS) > 1 && systemFont.pointSizeF() > 8.25) - systemFont.setPointSizeF(8.25); #endif // Qt 5 qCDebug(lcQpaFonts) << __FUNCTION__ << systemFont; return systemFont; @@ -2044,4 +2076,9 @@ QString QWindowsFontDatabase::readRegistryString(HKEY parentHandle, const wchar_ return result; } +bool QWindowsFontDatabase::isPrivateFontFamily(const QString &family) const +{ + return m_eudcFonts.contains(family) || QPlatformFontDatabase::isPrivateFontFamily(family); +} + QT_END_NAMESPACE diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_p.h b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_p.h index bbdb90f70a..30f5beefdf 100644 --- a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_p.h +++ b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_p.h @@ -109,6 +109,7 @@ public: bool fontsAlwaysScalable() const override; void derefUniqueFont(const QString &uniqueFont); void refUniqueFont(const QString &uniqueFont); + bool isPrivateFontFamily(const QString &family) const override; static QFont systemDefaultFont(); @@ -134,6 +135,7 @@ public: private: void removeApplicationFonts(); + void addDefaultEUDCFont(); struct WinApplicationFont { HANDLE handle; @@ -150,6 +152,7 @@ private: QMap<QString, UniqueFontData> m_uniqueFontData; static unsigned m_fontOptions; + QStringList m_eudcFonts; }; #ifndef QT_NO_DEBUG_STREAM diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontengine.cpp b/src/platformsupport/fontdatabases/windows/qwindowsfontengine.cpp index a337332b53..584e4db05d 100644 --- a/src/platformsupport/fontdatabases/windows/qwindowsfontengine.cpp +++ b/src/platformsupport/fontdatabases/windows/qwindowsfontengine.cpp @@ -1267,31 +1267,36 @@ QFontEngine *QWindowsMultiFontEngine::loadEngine(int at) lf.lfFaceName[nameSubstituteLength] = 0; } - IDWriteFont *directWriteFont = 0; - HRESULT hr = data->directWriteGdiInterop->CreateFontFromLOGFONT(&lf, &directWriteFont); - if (FAILED(hr)) { - qWarning("%s: %s", __FUNCTION__, - qPrintable(msgDirectWriteFunctionFailed(hr, "CreateFontFromLOGFONT", fam, nameSubstitute))); + HFONT hfont = CreateFontIndirect(&lf); + if (hfont == nullptr) { + qErrnoWarning("%s: CreateFontIndirect failed", __FUNCTION__); } else { - Q_ASSERT(directWriteFont); - IDWriteFontFace *directWriteFontFace = NULL; - HRESULT hr = directWriteFont->CreateFontFace(&directWriteFontFace); + HGDIOBJ oldFont = SelectObject(data->hdc, hfont); + + IDWriteFontFace *directWriteFontFace = nullptr; + QWindowsFontEngineDirectWrite *fedw = nullptr; + HRESULT hr = data->directWriteGdiInterop->CreateFontFaceFromHdc(data->hdc, &directWriteFontFace); if (SUCCEEDED(hr)) { Q_ASSERT(directWriteFontFace); - QWindowsFontEngineDirectWrite *fedw = new QWindowsFontEngineDirectWrite(directWriteFontFace, - fontEngine->fontDef.pixelSize, - data); + fedw = new QWindowsFontEngineDirectWrite(directWriteFontFace, + fontEngine->fontDef.pixelSize, + data); fedw->fontDef.weight = fontEngine->fontDef.weight; if (fontEngine->fontDef.style > QFont::StyleNormal) fedw->fontDef.style = fontEngine->fontDef.style; fedw->fontDef.family = fam; fedw->fontDef.hintingPreference = fontEngine->fontDef.hintingPreference; fedw->fontDef.stretch = fontEngine->fontDef.stretch; - return fedw; } else { qWarning("%s: %s", __FUNCTION__, qPrintable(msgDirectWriteFunctionFailed(hr, "CreateFontFace", fam, nameSubstitute))); } + + SelectObject(data->hdc, oldFont); + DeleteObject(hfont); + + if (fedw != nullptr) + return fedw; } } #endif diff --git a/src/platformsupport/fontdatabases/windows/qwindowsnativeimage.cpp b/src/platformsupport/fontdatabases/windows/qwindowsnativeimage.cpp index 67a6619b91..b1133dca22 100644 --- a/src/platformsupport/fontdatabases/windows/qwindowsnativeimage.cpp +++ b/src/platformsupport/fontdatabases/windows/qwindowsnativeimage.cpp @@ -101,8 +101,10 @@ static inline HBITMAP createDIB(HDC hdc, int width, int height, 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)) - qFatal("%s: CreateDIBSection failed.", __FUNCTION__); + if (Q_UNLIKELY(!bitmap || !bits)) { + qFatal("%s: CreateDIBSection failed (%dx%d, format: %d)", __FUNCTION__, + width, height, int(format)); + } *bitsIn = bits; return bitmap; diff --git a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp index 2d6426db7f..47a65eded8 100644 --- a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp +++ b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp @@ -49,6 +49,9 @@ #include <qpa/qwindowsysteminterface.h> #include <private/qcore_unix_p.h> +#include <QtGui/private/qguiapplication_p.h> +#include <QtGui/private/qinputdevicemanager_p.h> + #ifdef Q_OS_FREEBSD #include <dev/evdev/input.h> #else @@ -222,6 +225,8 @@ void QEvdevKeyboardHandler::readKeycode() void QEvdevKeyboardHandler::processKeyEvent(int nativecode, int unicode, int qtcode, Qt::KeyboardModifiers modifiers, bool isPress, bool autoRepeat) { + QGuiApplicationPrivate::inputDeviceManager()->setKeyboardModifiers(modifiers, qtcode); + QWindowSystemInterface::handleExtendedKeyEvent(0, (isPress ? QEvent::KeyPress : QEvent::KeyRelease), qtcode, modifiers, nativecode + 8, 0, int(modifiers), (unicode != 0xffff ) ? QString(unicode) : QString(), autoRepeat); @@ -403,6 +408,8 @@ QEvdevKeyboardHandler::KeycodeAction QEvdevKeyboardHandler::processKeycode(quint Qt::KeyboardModifiers qtmods = Qt::KeyboardModifiers(qtcode & modmask); qtcode &= ~modmask; + // qtmods here is the modifier state before the event, i.e. not + // including the current key in case it is a modifier. qCDebug(qLcEvdevKeyMap, "Processing: uni=%04x, qt=%08x, qtmod=%08x", unicode, qtcode, int(qtmods)); // If NumLockOff and keypad key pressed remap event sent diff --git a/src/platformsupport/input/evdevtablet/qevdevtablethandler.cpp b/src/platformsupport/input/evdevtablet/qevdevtablethandler.cpp index dbab2f6a24..b6051aaf3c 100644 --- a/src/platformsupport/input/evdevtablet/qevdevtablethandler.cpp +++ b/src/platformsupport/input/evdevtablet/qevdevtablethandler.cpp @@ -82,7 +82,7 @@ QEvdevTabletData::QEvdevTabletData(QEvdevTabletHandler *q_ptr) { memset(&minValues, 0, sizeof(minValues)); memset(&maxValues, 0, sizeof(maxValues)); - memset(&state, 0, sizeof(state)); + memset(static_cast<void *>(&state), 0, sizeof(state)); } void QEvdevTabletData::processInputEvent(input_event *ev) diff --git a/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp b/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp index 0ab4c65c45..7b7649bc5c 100644 --- a/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp +++ b/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp @@ -148,7 +148,7 @@ public: mutable QPointer<QScreen> m_screen; // Touch filtering and prediction are part of the same thing. The default - // prediction is 0ms, but sensible results can be acheived by setting it + // prediction is 0ms, but sensible results can be achieved by setting it // to, for instance, 16ms. // For filtering to work well, the QPA plugin should provide a dead-steady // implementation of QPlatformWindow::requestUpdate(). diff --git a/src/platformsupport/input/libinput/qlibinputkeyboard.cpp b/src/platformsupport/input/libinput/qlibinputkeyboard.cpp index 21f7fde7c8..ec01f95947 100644 --- a/src/platformsupport/input/libinput/qlibinputkeyboard.cpp +++ b/src/platformsupport/input/libinput/qlibinputkeyboard.cpp @@ -40,6 +40,8 @@ #include "qlibinputkeyboard_p.h" #include <QtCore/QTextCodec> #include <QtCore/QLoggingCategory> +#include <QtGui/private/qguiapplication_p.h> +#include <QtGui/private/qinputdevicemanager_p.h> #include <qpa/qwindowsysteminterface.h> #include <libinput.h> #ifndef QT_NO_XKBCOMMON_EVDEV @@ -196,6 +198,8 @@ void QLibInputKeyboard::processKey(libinput_event_keyboard *e) const xkb_keysym_t sym = xkb_state_key_get_one_sym(m_state, k); + // mods here is the modifier state before the event, i.e. not + // including the current key in case it is a modifier. Qt::KeyboardModifiers mods = Qt::NoModifier; const int qtkey = keysymToQtKey(sym, &mods, text); @@ -211,6 +215,7 @@ void QLibInputKeyboard::processKey(libinput_event_keyboard *e) xkb_state_update_key(m_state, k, pressed ? XKB_KEY_DOWN : XKB_KEY_UP); + QGuiApplicationPrivate::inputDeviceManager()->setKeyboardModifiers(mods, qtkey); QWindowSystemInterface::handleExtendedKeyEvent(nullptr, pressed ? QEvent::KeyPress : QEvent::KeyRelease, qtkey, mods, k, sym, mods, text); @@ -281,7 +286,7 @@ int QLibInputKeyboard::keysymToQtKey(xkb_keysym_t keysym, Qt::KeyboardModifiers *modifiers |= Qt::KeypadModifier; } else if (text.length() == 1 && text.unicode()->unicode() > 0x1f && text.unicode()->unicode() != 0x7f - && !(keysym >= XKB_KEY_dead_grave && keysym <= XKB_KEY_dead_currency)) { + && !(keysym >= XKB_KEY_dead_grave && keysym <= XKB_KEY_dead_longsolidusoverlay)) { code = text.unicode()->toUpper().unicode(); } else { // any other keys diff --git a/src/platformsupport/input/libinput/qlibinputpointer.cpp b/src/platformsupport/input/libinput/qlibinputpointer.cpp index 12379a83fa..cb08ab53b2 100644 --- a/src/platformsupport/input/libinput/qlibinputpointer.cpp +++ b/src/platformsupport/input/libinput/qlibinputpointer.cpp @@ -42,6 +42,8 @@ #include <QtCore/QEvent> #include <QtGui/QGuiApplication> #include <QtGui/QScreen> +#include <QtGui/private/qguiapplication_p.h> +#include <QtGui/private/qinputdevicemanager_p.h> #include <qpa/qwindowsysteminterface.h> #include <private/qhighdpiscaling_p.h> @@ -80,7 +82,7 @@ void QLibInputPointer::processButton(libinput_event_pointer *e) m_buttons.setFlag(button, pressed); QEvent::Type type = pressed ? QEvent::MouseButtonPress : QEvent::MouseButtonRelease; - Qt::KeyboardModifiers mods = QGuiApplication::keyboardModifiers(); + Qt::KeyboardModifiers mods = QGuiApplicationPrivate::inputDeviceManager()->keyboardModifiers(); QWindowSystemInterface::handleMouseEvent(nullptr, m_pos, m_pos, m_buttons, button, type, mods); } @@ -95,7 +97,7 @@ 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())); - Qt::KeyboardModifiers mods = QGuiApplication::keyboardModifiers(); + Qt::KeyboardModifiers mods = QGuiApplicationPrivate::inputDeviceManager()->keyboardModifiers(); QWindowSystemInterface::handleMouseEvent(nullptr, m_pos, m_pos, m_buttons, Qt::NoButton, QEvent::MouseMove, mods); diff --git a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp index a936ec7aad..580cf0e31d 100644 --- a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp +++ b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp @@ -1601,7 +1601,13 @@ bool AtSpiAdaptor::componentInterface(QAccessibleInterface *interface, const QSt int x = message.arguments().at(0).toInt(); int y = message.arguments().at(1).toInt(); uint coordType = message.arguments().at(2).toUInt(); - Q_UNUSED (coordType) // FIXME + if (coordType == ATSPI_COORD_TYPE_WINDOW) { + QWindow * window = interface->window(); + if (window) { + x += window->position().x(); + y += window->position().y(); + } + } QAccessibleInterface * childInterface(interface->childAt(x, y)); QAccessibleInterface * iface = 0; diff --git a/src/platformsupport/platformsupport.pro b/src/platformsupport/platformsupport.pro index 5549984d6a..7dbb6f6cae 100644 --- a/src/platformsupport/platformsupport.pro +++ b/src/platformsupport/platformsupport.pro @@ -16,7 +16,7 @@ qtConfig(evdev)|qtConfig(tslib)|qtConfig(libinput)|qtConfig(integrityhid) { input.depends += devicediscovery } -unix:!darwin: \ +if(unix:!darwin)|qtConfig(xcb): \ SUBDIRS += services qtConfig(opengl): \ @@ -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/services.pro b/src/platformsupport/services/services.pro index 91957a0a78..7ff5e8e179 100644 --- a/src/platformsupport/services/services.pro +++ b/src/platformsupport/services/services.pro @@ -2,12 +2,13 @@ TARGET = QtServiceSupport MODULE = service_support QT = core-private gui-private +qtConfig(dbus): QT += dbus + CONFIG += static internal_module DEFINES += QT_NO_CAST_FROM_ASCII PRECOMPILED_HEADER = ../../corelib/global/qt_pch.h -unix:!darwin: \ - include($$PWD/genericunix/genericunix.pri) +include($$PWD/genericunix/genericunix.pri) load(qt_module) diff --git a/src/platformsupport/themes/genericunix/dbustray/qdbustrayicon.cpp b/src/platformsupport/themes/genericunix/dbustray/qdbustrayicon.cpp index 8480c15fb7..2153924ec8 100644 --- a/src/platformsupport/themes/genericunix/dbustray/qdbustrayicon.cpp +++ b/src/platformsupport/themes/genericunix/dbustray/qdbustrayicon.cpp @@ -126,6 +126,7 @@ QDBusTrayIcon::QDBusTrayIcon() connect(this, SIGNAL(tooltipChanged()), m_adaptor, SIGNAL(NewToolTip())); connect(this, SIGNAL(iconChanged()), m_adaptor, SIGNAL(NewIcon())); connect(this, SIGNAL(attention()), m_adaptor, SIGNAL(NewAttentionIcon())); + connect(this, SIGNAL(menuChanged()), m_adaptor, SIGNAL(NewMenu())); connect(this, SIGNAL(attention()), m_adaptor, SIGNAL(NewTitle())); connect(&m_attentionTimer, SIGNAL(timeout()), this, SLOT(attentionTimerExpired())); m_attentionTimer.setSingleShot(true); @@ -268,6 +269,7 @@ void QDBusTrayIcon::updateMenu(QPlatformMenu * menu) connect(m_menu, SIGNAL(updated(uint,int)), m_menuAdaptor, SIGNAL(LayoutUpdated(uint,int))); dBusConnection()->registerTrayIconMenu(this); + emit menuChanged(); } } diff --git a/src/platformsupport/themes/genericunix/dbustray/qstatusnotifieritemadaptor_p.h b/src/platformsupport/themes/genericunix/dbustray/qstatusnotifieritemadaptor_p.h index 3f8fca7ac0..f2bb156b1d 100644 --- a/src/platformsupport/themes/genericunix/dbustray/qstatusnotifieritemadaptor_p.h +++ b/src/platformsupport/themes/genericunix/dbustray/qstatusnotifieritemadaptor_p.h @@ -129,6 +129,7 @@ class QStatusNotifierItemAdaptor: public QDBusAbstractAdaptor " <signal name=\"NewIcon\"/>\n" " <signal name=\"NewAttentionIcon\"/>\n" " <signal name=\"NewOverlayIcon\"/>\n" +" <signal name=\"NewMenu\"/>\n" " <signal name=\"NewToolTip\"/>\n" " <signal name=\"NewStatus\">\n" " <arg type=\"s\" name=\"status\"/>\n" @@ -191,6 +192,7 @@ Q_SIGNALS: // SIGNALS void NewAttentionIcon(); void NewIcon(); void NewOverlayIcon(); + void NewMenu(); void NewStatus(const QString &status); void NewTitle(); void NewToolTip(); diff --git a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp index eeb03eb958..63a860f251 100644 --- a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp +++ b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp @@ -112,9 +112,11 @@ static bool isDBusTrayAvailable() { #ifndef QT_NO_DBUS static bool checkDBusGlobalMenuAvailable() { - QDBusConnection connection = QDBusConnection::sessionBus(); - QString registrarService = QStringLiteral("com.canonical.AppMenu.Registrar"); - return connection.interface()->isServiceRegistered(registrarService); + const QDBusConnection connection = QDBusConnection::sessionBus(); + static const QString registrarService = QStringLiteral("com.canonical.AppMenu.Registrar"); + if (const auto iface = connection.interface()) + return iface->isServiceRegistered(registrarService); + return false; } static bool isDBusGlobalMenuAvailable() @@ -176,6 +178,12 @@ QStringList QGenericUnixTheme::xdgIconThemePaths() paths.append(xdgIconsDir.absoluteFilePath()); } + return paths; +} + +QStringList QGenericUnixTheme::iconFallbackPaths() +{ + QStringList paths; const QFileInfo pixmapsIconsDir(QStringLiteral("/usr/share/pixmaps")); if (pixmapsIconsDir.isDir()) paths.append(pixmapsIconsDir.absoluteFilePath()); @@ -208,6 +216,8 @@ QVariant QGenericUnixTheme::themeHint(ThemeHint hint) const return QVariant(QString(QStringLiteral("hicolor"))); case QPlatformTheme::IconThemeSearchPaths: return xdgIconThemePaths(); + case QPlatformTheme::IconFallbackSearchPaths: + return iconFallbackPaths(); case QPlatformTheme::DialogButtonBoxButtonsHaveIcons: return QVariant(true); case QPlatformTheme::StyleNames: { diff --git a/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h b/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h index 186e5a7dff..865a624694 100644 --- a/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h +++ b/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h @@ -85,6 +85,7 @@ public: QVariant themeHint(ThemeHint hint) const override; static QStringList xdgIconThemePaths(); + static QStringList iconFallbackPaths(); #ifndef QT_NO_DBUS QPlatformMenuBar *createPlatformMenuBar() const override; #endif diff --git a/src/platformsupport/themes/themes.pro b/src/platformsupport/themes/themes.pro index aeed4d2f47..44f94fafc8 100644 --- a/src/platformsupport/themes/themes.pro +++ b/src/platformsupport/themes/themes.pro @@ -6,7 +6,7 @@ CONFIG += static internal_module DEFINES += QT_NO_CAST_FROM_ASCII -unix:!darwin: \ +if(unix:!darwin)|qtConfig(xcb): \ include($$PWD/genericunix/genericunix.pri) HEADERS += \ diff --git a/src/platformsupport/vkconvenience/qbasicvulkanplatforminstance.cpp b/src/platformsupport/vkconvenience/qbasicvulkanplatforminstance.cpp index 1a2a07260a..382d142334 100644 --- a/src/platformsupport/vkconvenience/qbasicvulkanplatforminstance.cpp +++ b/src/platformsupport/vkconvenience/qbasicvulkanplatforminstance.cpp @@ -45,7 +45,7 @@ QT_BEGIN_NAMESPACE -Q_LOGGING_CATEGORY(lcVk, "qt.vulkan") +Q_LOGGING_CATEGORY(lcPlatVk, "qt.vulkan") /*! \class QBasicPlatformVulkanInstance @@ -87,7 +87,7 @@ void QBasicPlatformVulkanInstance::init(QLibrary *lib) if (m_vkGetInstanceProcAddr) return; - qCDebug(lcVk, "Vulkan init (%s)", qPrintable(lib->fileName())); + qCDebug(lcPlatVk, "Vulkan init (%s)", qPrintable(lib->fileName())); // While not strictly required with every implementation, try to follow the spec // and do not rely on core functions being exported. @@ -137,7 +137,7 @@ void QBasicPlatformVulkanInstance::init(QLibrary *lib) m_supportedLayers.append(layer); } } - qCDebug(lcVk) << "Supported Vulkan instance layers:" << m_supportedLayers; + qCDebug(lcPlatVk) << "Supported Vulkan instance layers:" << m_supportedLayers; uint32_t extCount = 0; m_vkEnumerateInstanceExtensionProperties(nullptr, &extCount, nullptr); @@ -152,7 +152,7 @@ void QBasicPlatformVulkanInstance::init(QLibrary *lib) m_supportedExtensions.append(ext); } } - qDebug(lcVk) << "Supported Vulkan instance extensions:" << m_supportedExtensions; + qDebug(lcPlatVk) << "Supported Vulkan instance extensions:" << m_supportedExtensions; } QVulkanInfoVector<QVulkanLayer> QBasicPlatformVulkanInstance::supportedLayers() const @@ -206,13 +206,13 @@ void QBasicPlatformVulkanInstance::initInstance(QVulkanInstance *instance, const if (!m_supportedLayers.contains(layerName)) m_enabledLayers.removeAt(i--); } - qDebug(lcVk) << "Enabling Vulkan instance layers:" << m_enabledLayers; + qDebug(lcPlatVk) << "Enabling Vulkan instance layers:" << m_enabledLayers; for (int i = 0; i < m_enabledExtensions.count(); ++i) { const QByteArray &extName(m_enabledExtensions[i]); if (!m_supportedExtensions.contains(extName)) m_enabledExtensions.removeAt(i--); } - qDebug(lcVk) << "Enabling Vulkan instance extensions:" << m_enabledExtensions; + qDebug(lcPlatVk) << "Enabling Vulkan instance extensions:" << m_enabledExtensions; VkInstanceCreateInfo instInfo; memset(&instInfo, 0, sizeof(instInfo)); 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..3ebc3008d3 --- /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_p.h" +#include "uiaattributeids_p.h" +#include "uiacontroltypeids_p.h" +#include "uiaerrorids_p.h" +#include "uiaeventids_p.h" +#include "uiageneralids_p.h" +#include "uiapatternids_p.h" +#include "uiapropertyids_p.h" +#include "uiaserverinterfaces_p.h" +#include "uiaclientinterfaces_p.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_p.h b/src/platformsupport/windowsuiautomation/uiaattributeids_p.h new file mode 100644 index 0000000000..795cb9e551 --- /dev/null +++ b/src/platformsupport/windowsuiautomation/uiaattributeids_p.h @@ -0,0 +1,99 @@ +/**************************************************************************** +** +** 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 + +// +// 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. +// +// We mean it. +// + +#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_p.h b/src/platformsupport/windowsuiautomation/uiaclientinterfaces_p.h new file mode 100644 index 0000000000..a4f3e15baa --- /dev/null +++ b/src/platformsupport/windowsuiautomation/uiaclientinterfaces_p.h @@ -0,0 +1,266 @@ +/**************************************************************************** +** +** 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 + +// +// 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. +// +// We mean it. +// + +#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_p.h b/src/platformsupport/windowsuiautomation/uiacontroltypeids_p.h new file mode 100644 index 0000000000..b5c5a0a4ff --- /dev/null +++ b/src/platformsupport/windowsuiautomation/uiacontroltypeids_p.h @@ -0,0 +1,96 @@ +/**************************************************************************** +** +** 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 + +// +// 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. +// +// We mean it. +// + +#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_p.h b/src/platformsupport/windowsuiautomation/uiaerrorids_p.h new file mode 100644 index 0000000000..8c2a24dbc7 --- /dev/null +++ b/src/platformsupport/windowsuiautomation/uiaerrorids_p.h @@ -0,0 +1,62 @@ +/**************************************************************************** +** +** 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 + +// +// 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. +// +// We mean it. +// + +#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_p.h b/src/platformsupport/windowsuiautomation/uiaeventids_p.h new file mode 100644 index 0000000000..ed6c36834e --- /dev/null +++ b/src/platformsupport/windowsuiautomation/uiaeventids_p.h @@ -0,0 +1,90 @@ +/**************************************************************************** +** +** 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 + +// +// 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. +// +// We mean it. +// + +#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_p.h b/src/platformsupport/windowsuiautomation/uiageneralids_p.h new file mode 100644 index 0000000000..220554f885 --- /dev/null +++ b/src/platformsupport/windowsuiautomation/uiageneralids_p.h @@ -0,0 +1,57 @@ +/**************************************************************************** +** +** 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 + +// +// 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. +// +// We mean it. +// + +#define UiaAppendRuntimeId 3 +#define UiaRootObjectId -25 + +#endif diff --git a/src/platformsupport/windowsuiautomation/uiapatternids_p.h b/src/platformsupport/windowsuiautomation/uiapatternids_p.h new file mode 100644 index 0000000000..d3f4c9bd7a --- /dev/null +++ b/src/platformsupport/windowsuiautomation/uiapatternids_p.h @@ -0,0 +1,89 @@ +/**************************************************************************** +** +** 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 + +// +// 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. +// +// We mean it. +// + +#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_p.h b/src/platformsupport/windowsuiautomation/uiapropertyids_p.h new file mode 100644 index 0000000000..74e84147f6 --- /dev/null +++ b/src/platformsupport/windowsuiautomation/uiapropertyids_p.h @@ -0,0 +1,223 @@ +/**************************************************************************** +** +** 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 + +// +// 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. +// +// We mean it. +// + +#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_p.h b/src/platformsupport/windowsuiautomation/uiaserverinterfaces_p.h new file mode 100644 index 0000000000..64c54c694a --- /dev/null +++ b/src/platformsupport/windowsuiautomation/uiaserverinterfaces_p.h @@ -0,0 +1,363 @@ +/**************************************************************************** +** +** 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 + +// +// 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. +// +// We mean it. +// + +#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_p.h b/src/platformsupport/windowsuiautomation/uiatypes_p.h new file mode 100644 index 0000000000..ea58417943 --- /dev/null +++ b/src/platformsupport/windowsuiautomation/uiatypes_p.h @@ -0,0 +1,156 @@ +/**************************************************************************** +** +** 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 + +// +// 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. +// +// We mean it. +// + +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..97cdb60ef9 --- /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_p.h \ + uiacontroltypeids_p.h \ + uiaerrorids_p.h \ + uiaeventids_p.h \ + uiageneralids_p.h \ + uiaserverinterfaces_p.h \ + uiaclientinterfaces_p.h \ + uiapatternids_p.h \ + uiapropertyids_p.h \ + uiatypes_p.h + +SOURCES += \ + qwindowsuiawrapper.cpp + +load(qt_module) |