| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/gui/accessible/qplatformaccessibility.cpp |
| Switch to Source code | Preprocessed file |
| 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
never executed: }guard.store(QtGlobalStatic::Destroyed);never executed: }; 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; returnend of blocknever executed: &holder.value;return &holder.value;never executed: } } } static QGlobalStatic<QFactoryLoader, Q_QGS_bridgeloader::innerFunction, Q_QGS_bridgeloader::guard> bridgeloader;return &holder.value; | 0 | ||||||||||||
| 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
never executed: }guard.store(QtGlobalStatic::Destroyed);never executed: }; static struct Holder : public HolderBase { Type value; Holder() noexcept(noexcept(Type ())) : value () { guard.store(QtGlobalStatic::Initialized); } } holder; returnend of blocknever executed: &holder.value;return &holder.value;never executed: } } } static QGlobalStatic<QVector<QAccessibleBridge *>, Q_QGS_bridges::innerFunction, Q_QGS_bridges::guard> bridges;return &holder.value; | 0 | ||||||||||||
| 12 | QPlatformAccessibility::QPlatformAccessibility() | - | ||||||||||||
| 13 | : m_active(false) | - | ||||||||||||
| 14 | { | - | ||||||||||||
| 15 | } never executed: end of block | 0 | ||||||||||||
| 16 | - | |||||||||||||
| 17 | QPlatformAccessibility::~QPlatformAccessibility() | - | ||||||||||||
| 18 | { | - | ||||||||||||
| 19 | } | - | ||||||||||||
| 20 | - | |||||||||||||
| 21 | void QPlatformAccessibility::notifyAccessibilityUpdate(QAccessibleEvent *event) | - | ||||||||||||
| 22 | { | - | ||||||||||||
| 23 | initialize(); | - | ||||||||||||
| 24 | - | |||||||||||||
| 25 | if (!bridges()
| 0 | ||||||||||||
| 26 | return; never executed: return; | 0 | ||||||||||||
| 27 | - | |||||||||||||
| 28 | for (int i = 0; i < bridges()->count()
| 0 | ||||||||||||
| 29 | bridges()->at(i)->notifyAccessibilityUpdate(event); never executed: bridges()->at(i)->notifyAccessibilityUpdate(event); | 0 | ||||||||||||
| 30 | } never executed: end of block | 0 | ||||||||||||
| 31 | - | |||||||||||||
| 32 | void QPlatformAccessibility::setRootObject(QObject *o) | - | ||||||||||||
| 33 | { | - | ||||||||||||
| 34 | initialize(); | - | ||||||||||||
| 35 | if (bridges()->isEmpty()
| 0 | ||||||||||||
| 36 | return; never executed: return; | 0 | ||||||||||||
| 37 | - | |||||||||||||
| 38 | if (!o
| 0 | ||||||||||||
| 39 | return; never executed: return; | 0 | ||||||||||||
| 40 | - | |||||||||||||
| 41 | for (int i = 0; i < bridges()->count()
| 0 | ||||||||||||
| 42 | QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(o); | - | ||||||||||||
| 43 | bridges()->at(i)->setRootObject(iface); | - | ||||||||||||
| 44 | } never executed: end of block | 0 | ||||||||||||
| 45 | } never executed: end of block | 0 | ||||||||||||
| 46 | - | |||||||||||||
| 47 | void QPlatformAccessibility::initialize() | - | ||||||||||||
| 48 | { | - | ||||||||||||
| 49 | static bool isInit = false; | - | ||||||||||||
| 50 | if (isInit
| 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
| 0 | ||||||||||||
| 62 | if (it.key() != i
| 0 | ||||||||||||
| 63 | i = it.key(); | - | ||||||||||||
| 64 | factory = qobject_cast<QAccessibleBridgePlugin*>(bridgeloader()->instance(i)); | - | ||||||||||||
| 65 | } never executed: end of block | 0 | ||||||||||||
| 66 | if (factory
| 0 | ||||||||||||
| 67 | if (QAccessibleBridge *bridge = factory->create(it.value())
| 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 | } never executed: end of block | 0 | ||||||||||||
| 76 | - | |||||||||||||
| 77 | void QPlatformAccessibility::setActive(bool active) | - | ||||||||||||
| 78 | { | - | ||||||||||||
| 79 | m_active = active; | - | ||||||||||||
| 80 | QAccessible::setActive(active); | - | ||||||||||||
| 81 | } never executed: end of block | 0 | ||||||||||||
| 82 | - | |||||||||||||
| 83 | - | |||||||||||||
| 84 | - | |||||||||||||
| 85 | - | |||||||||||||
| Switch to Source code | Preprocessed file |