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 | - | |||||||||||||
9 | 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 block never executed: &holder.value;return &holder.value; never executed: } } } static QGlobalStatic<QFactoryLoader, Q_QGS_bridgeloader::innerFunction, Q_QGS_bridgeloader::guard> bridgeloader;return &holder.value; | 0 | ||||||||||||
10 | - | |||||||||||||
11 | - | |||||||||||||
12 | - | |||||||||||||
13 | 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 block never 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 | ||||||||||||
14 | QPlatformAccessibility::QPlatformAccessibility() | - | ||||||||||||
15 | : m_active(false) | - | ||||||||||||
16 | { | - | ||||||||||||
17 | } never executed: end of block | 0 | ||||||||||||
18 | - | |||||||||||||
19 | QPlatformAccessibility::~QPlatformAccessibility() | - | ||||||||||||
20 | { | - | ||||||||||||
21 | } | - | ||||||||||||
22 | - | |||||||||||||
23 | void QPlatformAccessibility::notifyAccessibilityUpdate(QAccessibleEvent *event) | - | ||||||||||||
24 | { | - | ||||||||||||
25 | initialize(); | - | ||||||||||||
26 | - | |||||||||||||
27 | if (!bridges()
| 0 | ||||||||||||
28 | return; never executed: return; | 0 | ||||||||||||
29 | - | |||||||||||||
30 | for (int i = 0; i < bridges()->count()
| 0 | ||||||||||||
31 | bridges()->at(i)->notifyAccessibilityUpdate(event); never executed: bridges()->at(i)->notifyAccessibilityUpdate(event); | 0 | ||||||||||||
32 | } never executed: end of block | 0 | ||||||||||||
33 | - | |||||||||||||
34 | void QPlatformAccessibility::setRootObject(QObject *o) | - | ||||||||||||
35 | { | - | ||||||||||||
36 | initialize(); | - | ||||||||||||
37 | if (bridges()->isEmpty()
| 0 | ||||||||||||
38 | return; never executed: return; | 0 | ||||||||||||
39 | - | |||||||||||||
40 | if (!o
| 0 | ||||||||||||
41 | return; never executed: return; | 0 | ||||||||||||
42 | - | |||||||||||||
43 | for (int i = 0; i < bridges()->count()
| 0 | ||||||||||||
44 | QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(o); | - | ||||||||||||
45 | bridges()->at(i)->setRootObject(iface); | - | ||||||||||||
46 | } never executed: end of block | 0 | ||||||||||||
47 | } never executed: end of block | 0 | ||||||||||||
48 | - | |||||||||||||
49 | void QPlatformAccessibility::initialize() | - | ||||||||||||
50 | { | - | ||||||||||||
51 | static bool isInit = false; | - | ||||||||||||
52 | if (isInit
| 0 | ||||||||||||
53 | return; never executed: return; | 0 | ||||||||||||
54 | isInit = true; | - | ||||||||||||
55 | - | |||||||||||||
56 | - | |||||||||||||
57 | typedef QMultiMap<int, QString> PluginKeyMap; | - | ||||||||||||
58 | typedef PluginKeyMap::const_iterator PluginKeyMapConstIterator; | - | ||||||||||||
59 | - | |||||||||||||
60 | const PluginKeyMap keyMap = bridgeloader()->keyMap(); | - | ||||||||||||
61 | QAccessibleBridgePlugin *factory = 0; | - | ||||||||||||
62 | int i = -1; | - | ||||||||||||
63 | const PluginKeyMapConstIterator cend = keyMap.constEnd(); | - | ||||||||||||
64 | for (PluginKeyMapConstIterator it = keyMap.constBegin(); it != cend
| 0 | ||||||||||||
65 | if (it.key() != i
| 0 | ||||||||||||
66 | i = it.key(); | - | ||||||||||||
67 | factory = qobject_cast<QAccessibleBridgePlugin*>(bridgeloader()->instance(i)); | - | ||||||||||||
68 | } never executed: end of block | 0 | ||||||||||||
69 | if (factory
| 0 | ||||||||||||
70 | if (QAccessibleBridge *bridge = factory->create(it.value())
| 0 | ||||||||||||
71 | bridges()->append(bridge); never executed: bridges()->append(bridge); | 0 | ||||||||||||
72 | } never executed: end of block | 0 | ||||||||||||
73 | - | |||||||||||||
74 | } never executed: end of block | 0 | ||||||||||||
75 | - | |||||||||||||
76 | void QPlatformAccessibility::cleanup() | - | ||||||||||||
77 | { | - | ||||||||||||
78 | qDeleteAll(*bridges()); | - | ||||||||||||
79 | } never executed: end of block | 0 | ||||||||||||
80 | - | |||||||||||||
81 | void QPlatformAccessibility::setActive(bool active) | - | ||||||||||||
82 | { | - | ||||||||||||
83 | m_active = active; | - | ||||||||||||
84 | QAccessible::setActive(active); | - | ||||||||||||
85 | } never executed: end of block | 0 | ||||||||||||
86 | - | |||||||||||||
87 | - | |||||||||||||
88 | - | |||||||||||||
89 | - | |||||||||||||
Switch to Source code | Preprocessed file |