Fix compilation of the Windows accessibility code for MinGW.
Temporarily disable the code for MinGW. Change-Id: I435305167e06af05b9a78901e6e3a35347c5c3f5 Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
This commit is contained in:
parent
259332e655
commit
087d6c21b8
@ -1,15 +1,19 @@
|
||||
|
||||
SOURCES += \
|
||||
$$PWD/qwindowsmsaaaccessible.cpp \
|
||||
$$PWD/qwindowsaccessibility.cpp \
|
||||
$$PWD/iaccessible2.cpp \
|
||||
$$PWD/comutils.cpp
|
||||
$$PWD/qwindowsaccessibility.cpp
|
||||
|
||||
HEADERS += \
|
||||
$$PWD/qwindowsmsaaaccessible.h \
|
||||
$$PWD/qwindowsaccessibility.h \
|
||||
$$PWD/iaccessible2.h \
|
||||
$$PWD/comutils.h
|
||||
$$PWD/qwindowsaccessibility.h
|
||||
|
||||
!*g++* {
|
||||
SOURCES += \
|
||||
$$PWD/qwindowsmsaaaccessible.cpp \
|
||||
$$PWD/iaccessible2.cpp \
|
||||
$$PWD/comutils.cpp
|
||||
|
||||
include(../../../../3rdparty/iaccessible2/iaccessible2.pri)
|
||||
HEADERS += \
|
||||
$$PWD/qwindowsmsaaaccessible.h \
|
||||
$$PWD/iaccessible2.h \
|
||||
$$PWD/comutils.h
|
||||
|
||||
include(../../../../3rdparty/iaccessible2/iaccessible2.pri)
|
||||
} # !g++
|
||||
|
@ -66,6 +66,10 @@
|
||||
#include "AccessibleRole.h"
|
||||
#include "AccessibleStates.h"
|
||||
|
||||
#ifdef Q_CC_MINGW
|
||||
# include <servprov.h>
|
||||
#endif
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class QWindowsIA2Accessible : public QWindowsMsaaAccessible,
|
||||
|
@ -54,13 +54,13 @@
|
||||
#include <QtGui/qplatformnativeinterface_qpa.h>
|
||||
#include <QtGui/qwindow.h>
|
||||
#include <QtGui/qguiapplication.h>
|
||||
#include <QtWidgets/qapplication.h>
|
||||
#include <QtWidgets/qgraphicsitem.h>
|
||||
#include <QtWidgets/qgraphicsview.h>
|
||||
#include <QtWidgets/qmessagebox.h>
|
||||
|
||||
#include "qwindowsaccessibility.h"
|
||||
#include "iaccessible2.h"
|
||||
|
||||
#ifndef Q_CC_MINGW
|
||||
# include "iaccessible2.h"
|
||||
#endif // !Q_CC_MINGW
|
||||
|
||||
#include "comutils.h"
|
||||
|
||||
#include <oleacc.h>
|
||||
@ -185,7 +185,7 @@ void QWindowsAccessibility::notifyAccessibilityUpdate(const QAccessibleEvent &ev
|
||||
// An event has to be associated with a window,
|
||||
// so find the first parent that is a widget and that has a WId
|
||||
QAccessibleInterface *iface = event.accessibleInterface();
|
||||
QWindow *window = iface ? window_helper(iface) : 0;
|
||||
QWindow *window = iface ? QWindowsAccessibility::windowHelper(iface) : 0;
|
||||
delete iface;
|
||||
|
||||
if (!window) {
|
||||
@ -211,6 +211,20 @@ void QWindowsAccessibility::notifyAccessibilityUpdate(const QAccessibleEvent &ev
|
||||
#endif // Q_OS_WINCE
|
||||
}
|
||||
|
||||
QWindow *QWindowsAccessibility::windowHelper(const QAccessibleInterface *iface)
|
||||
{
|
||||
QWindow *window = iface->window();
|
||||
if (!window) {
|
||||
QAccessibleInterface *acc = iface->parent();
|
||||
while (acc && !window) {
|
||||
window = acc->window();
|
||||
QAccessibleInterface *par = acc->parent();
|
||||
delete acc;
|
||||
acc = par;
|
||||
}
|
||||
}
|
||||
return window;
|
||||
}
|
||||
|
||||
/*!
|
||||
\internal
|
||||
@ -218,12 +232,16 @@ void QWindowsAccessibility::notifyAccessibilityUpdate(const QAccessibleEvent &ev
|
||||
*/
|
||||
IAccessible *QWindowsAccessibility::wrap(QAccessibleInterface *acc)
|
||||
{
|
||||
#ifdef Q_CC_MINGW
|
||||
return 0;
|
||||
#else
|
||||
if (!acc)
|
||||
return 0;
|
||||
QWindowsIA2Accessible *wacc = new QWindowsIA2Accessible(acc);
|
||||
IAccessible *iacc = 0;
|
||||
wacc->QueryInterface(IID_IAccessible, (void**)&iacc);
|
||||
return iacc;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*!
|
||||
@ -260,7 +278,7 @@ bool QWindowsAccessibility::handleAccessibleObjectFromWindowRequest(HWND hwnd, W
|
||||
#if 1
|
||||
// Ignoring all requests while starting up
|
||||
// ### Maybe QPA takes care of this???
|
||||
if (QApplication::startingUp() || QApplication::closingDown())
|
||||
if (QCoreApplication::startingUp() || QCoreApplication::closingDown())
|
||||
return false;
|
||||
#endif
|
||||
|
||||
|
@ -63,6 +63,7 @@ public:
|
||||
virtual void cleanup();
|
||||
*/
|
||||
static IAccessible *wrap(QAccessibleInterface *acc);
|
||||
static QWindow *windowHelper(const QAccessibleInterface *iface);
|
||||
|
||||
static QPair<QObject*, int> getCachedObject(int entryId);
|
||||
};
|
||||
|
@ -1180,21 +1180,6 @@ HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::get_accSelection(VARIANT *pvar
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
QWindow *window_helper(const QAccessibleInterface *iface)
|
||||
{
|
||||
QWindow *window = iface->window();
|
||||
if (!window) {
|
||||
QAccessibleInterface *acc = iface->parent();
|
||||
while (acc && !window) {
|
||||
window = acc->window();
|
||||
QAccessibleInterface *par = acc->parent();
|
||||
delete acc;
|
||||
acc = par;
|
||||
}
|
||||
}
|
||||
return window;
|
||||
}
|
||||
|
||||
/**************************************************************\
|
||||
* IOleWindow *
|
||||
**************************************************************/
|
||||
@ -1207,7 +1192,7 @@ HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::GetWindow(HWND *phwnd)
|
||||
if (!accessible->isValid())
|
||||
return E_UNEXPECTED;
|
||||
|
||||
QWindow *window = window_helper(accessible);
|
||||
QWindow *window = QWindowsAccessibility::windowHelper(accessible);
|
||||
if (!window)
|
||||
return E_FAIL;
|
||||
|
||||
|
@ -44,6 +44,7 @@
|
||||
#include <QtCore/QtConfig>
|
||||
#ifndef QT_NO_ACCESSIBILITY
|
||||
|
||||
#include "../qtwindows_additional.h"
|
||||
#include <oleacc.h>
|
||||
#include "Accessible2.h"
|
||||
#include <QtCore/qsharedpointer.h>
|
||||
@ -55,7 +56,7 @@ QT_BEGIN_NAMESPACE
|
||||
bool debug_accessibility();
|
||||
# define accessibleDebug !debug_accessibility() ? (void)0 : qDebug
|
||||
#else
|
||||
# define accessibleDebug()
|
||||
# define accessibleDebug
|
||||
#endif
|
||||
|
||||
#define DEBUG_SHOW_ATCLIENT_COMMANDS
|
||||
|
@ -71,6 +71,16 @@
|
||||
#define IFACEMETHODIMP STDMETHODIMP
|
||||
#define IFACEMETHODIMP_(type) STDMETHODIMP_(type)
|
||||
|
||||
// For accessibility:
|
||||
#ifdef __cplusplus
|
||||
#define EXTERN_C extern "C"
|
||||
#else
|
||||
#define EXTERN_C extern
|
||||
#endif
|
||||
|
||||
#define CHILDID_SELF 0
|
||||
#define WM_GETOBJECT 0x003D
|
||||
|
||||
#if !defined(__MINGW64_VERSION_MAJOR)
|
||||
|
||||
#define STATE_SYSTEM_HASPOPUP 0x40000000
|
||||
|
Loading…
Reference in New Issue
Block a user