qplatformaccessibility.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/gui/accessible/qplatformaccessibility.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8namespace { 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.load() =...c::InitializedDescription
TRUEnever evaluated
FALSEnever evaluated
) guard.store(QtGlobalStatic::Destroyed);
never executed: guard.store(QtGlobalStatic::Destroyed);
}
never executed: end of block
}; 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
never executed: return &holder.value;
&holder.value;
never executed: return &holder.value;
} } } static QGlobalStatic<QFactoryLoader, Q_QGS_bridgeloader::innerFunction, Q_QGS_bridgeloader::guard> bridgeloader;
0
9-
10-
11namespace { 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.load() =...c::InitializedDescription
TRUEnever evaluated
FALSEnever evaluated
) guard.store(QtGlobalStatic::Destroyed);
never executed: guard.store(QtGlobalStatic::Destroyed);
}
never executed: end of block
}; static struct Holder : public HolderBase { Type value; Holder() noexcept(noexcept(Type ())) : value () { guard.store(QtGlobalStatic::Initialized); } } holder; return
never executed: return &holder.value;
&holder.value;
never executed: return &holder.value;
} } } static QGlobalStatic<QVector<QAccessibleBridge *>, Q_QGS_bridges::innerFunction, Q_QGS_bridges::guard> bridges;
0
12QPlatformAccessibility::QPlatformAccessibility()-
13 : m_active(false)-
14{-
15}
never executed: end of block
0
16-
17QPlatformAccessibility::~QPlatformAccessibility()-
18{-
19}-
20-
21void QPlatformAccessibility::notifyAccessibilityUpdate(QAccessibleEvent *event)-
22{-
23 initialize();-
24-
25 if (!bridges()
!bridges()Description
TRUEnever evaluated
FALSEnever evaluated
|| bridges()->isEmpty()
bridges()->isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
26 return;
never executed: return;
0
27-
28 for (int i = 0; i < bridges()->count()
i < bridges()->count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
29 bridges()->at(i)->notifyAccessibilityUpdate(event);
never executed: bridges()->at(i)->notifyAccessibilityUpdate(event);
0
30}
never executed: end of block
0
31-
32void QPlatformAccessibility::setRootObject(QObject *o)-
33{-
34 initialize();-
35 if (bridges()->isEmpty()
bridges()->isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
36 return;
never executed: return;
0
37-
38 if (!o
!oDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
39 return;
never executed: return;
0
40-
41 for (int i = 0; i < bridges()->count()
i < bridges()->count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
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-
47void QPlatformAccessibility::initialize()-
48{-
49 static bool isInit = false;-
50 if (isInit
isInitDescription
TRUEnever evaluated
FALSEnever 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
it != cendDescription
TRUEnever evaluated
FALSEnever evaluated
; ++it) {
0
62 if (it.key() != i
it.key() != iDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
63 i = it.key();-
64 factory = qobject_cast<QAccessibleBridgePlugin*>(bridgeloader()->instance(i));-
65 }
never executed: end of block
0
66 if (factory
factoryDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
67 if (QAccessibleBridge *bridge = factory->create(it.value())
QAccessibleBri...te(it.value())Description
TRUEnever evaluated
FALSEnever 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-
72void QPlatformAccessibility::cleanup()-
73{-
74 qDeleteAll(*bridges());-
75}
never executed: end of block
0
76-
77void 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 codePreprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9