| Line | Source | Count |
| 1 | | - |
| 2 | | - |
| 3 | | - |
| 4 | | - |
| 5 | | - |
| 6 | | - |
| 7 | | - |
| 8 | namespace { namespace Q_QGS_bridgeloader { typedef QFactoryLoader Type; QBasicAtomicInt guard = { QtGlobalStatic::Uninitialized }; __attribute__((visibility("hidden"))) inline Type *innerFunction() { struct HolderBase { ~HolderBase() noexcept { if (guard.load() == QtGlobalStatic::Initialized) guard.store(QtGlobalStatic::Destroyed); } }; static struct Holder : public HolderBase { Type value; Holder() noexcept(noexcept(Type ("org.qt-project.Qt.QAccessibleBridgeFactoryInterface", QLatin1String("/accessiblebridge")))) : value ("org.qt-project.Qt.QAccessibleBridgeFactoryInterface", QLatin1String("/accessiblebridge")) { guard.store(QtGlobalStatic::Initialized); } } holder; return &holder.value; } } } static QGlobalStatic<QFactoryLoader, Q_QGS_bridgeloader::innerFunction, Q_QGS_bridgeloader::guard> bridgeloader; | - |
| 9 | | - |
| 10 | | - |
| 11 | namespace { namespace Q_QGS_bridges { typedef QVector<QAccessibleBridge *> Type; QBasicAtomicInt guard = { QtGlobalStatic::Uninitialized }; __attribute__((visibility("hidden"))) inline Type *innerFunction() { struct HolderBase { ~HolderBase() noexcept { if (guard.load() == QtGlobalStatic::Initialized) guard.store(QtGlobalStatic::Destroyed); } }; static struct Holder : public HolderBase { Type value; Holder() noexcept(noexcept(Type ())) : value () { guard.store(QtGlobalStatic::Initialized); } } holder; return &holder.value; } } } static QGlobalStatic<QVector<QAccessibleBridge *>, Q_QGS_bridges::innerFunction, Q_QGS_bridges::guard> bridges; | - |
| 12 | QPlatformAccessibility::QPlatformAccessibility() | - |
| 13 | : m_active(false) | - |
| 14 | { | - |
| 15 | } | - |
| 16 | | - |
| 17 | QPlatformAccessibility::~QPlatformAccessibility() | - |
| 18 | { | - |
| 19 | } | - |
| 20 | | - |
| 21 | void QPlatformAccessibility::notifyAccessibilityUpdate(QAccessibleEvent *event) | - |
| 22 | { | - |
| 23 | initialize(); | - |
| 24 | | - |
| 25 | if (!bridges() || bridges()->isEmpty()) | - |
| 26 | return; | - |
| 27 | | - |
| 28 | for (int i = 0; i < bridges()->count(); ++i) | - |
| 29 | bridges()->at(i)->notifyAccessibilityUpdate(event); | - |
| 30 | } | - |
| 31 | | - |
| 32 | void QPlatformAccessibility::setRootObject(QObject *o) | - |
| 33 | { | - |
| 34 | initialize(); | - |
| 35 | if (bridges()->isEmpty()) | - |
| 36 | return; | - |
| 37 | | - |
| 38 | if (!o) | - |
| 39 | return; | - |
| 40 | | - |
| 41 | for (int i = 0; i < bridges()->count(); ++i) { | - |
| 42 | QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(o); | - |
| 43 | bridges()->at(i)->setRootObject(iface); | - |
| 44 | } | - |
| 45 | } | - |
| 46 | | - |
| 47 | void QPlatformAccessibility::initialize() | - |
| 48 | { | - |
| 49 | static bool isInit = false; | - |
| 50 | if (isInit| TRUE | never evaluated | | FALSE | never evaluated |
) | 0 |
| 51 | return; never executed: return; | 0 |
| 52 | isInit = true; | - |
| 53 | | - |
| 54 | typedef QMultiMap<int, QString> PluginKeyMap; | - |
| 55 | typedef PluginKeyMap::const_iterator PluginKeyMapConstIterator; | - |
| 56 | | - |
| 57 | const PluginKeyMap keyMap = bridgeloader()->keyMap(); | - |
| 58 | QAccessibleBridgePlugin *factory = 0; | - |
| 59 | int i = -1; | - |
| 60 | const PluginKeyMapConstIterator cend = keyMap.constEnd(); | - |
| 61 | for (PluginKeyMapConstIterator it = keyMap.constBegin(); it != cend| TRUE | never evaluated | | FALSE | never evaluated |
; ++it) { | 0 |
| 62 | if (it.key() != i| TRUE | never evaluated | | FALSE | never evaluated |
) { | 0 |
| 63 | i = it.key(); | - |
| 64 | factory = qobject_cast<QAccessibleBridgePlugin*>(bridgeloader()->instance(i)); | - |
| 65 | } never executed: end of block | 0 |
| 66 | if (factory| TRUE | never evaluated | | FALSE | never evaluated |
) | 0 |
| 67 | if (QAccessibleBridge *bridge = factory->create(it.value())| TRUE | never evaluated | | FALSE | never evaluated |
) | 0 |
| 68 | bridges()->append(bridge); never executed: bridges()->append(bridge); | 0 |
| 69 | } never executed: end of block | 0 |
| 70 | } never executed: end of block | 0 |
| 71 | | - |
| 72 | void QPlatformAccessibility::cleanup() | - |
| 73 | { | - |
| 74 | qDeleteAll(*bridges()); | - |
| 75 | } | - |
| 76 | | - |
| 77 | void QPlatformAccessibility::setActive(bool active) | - |
| 78 | { | - |
| 79 | m_active = active; | - |
| 80 | QAccessible::setActive(active); | - |
| 81 | } | - |
| 82 | | - |
| 83 | | - |
| 84 | | - |
| 85 | | - |
| | |