Line | Source Code | Coverage |
---|
1 | | - |
2 | | - |
3 | | - |
4 | | - |
5 | static QFactoryLoader *loader() { static QGlobalStatic<QFactoryLoader > thisGlobalStatic = { { (0) }, false }; if (!thisGlobalStatic.pointer.load() && !thisGlobalStatic.destroyed) { QFactoryLoader *x = new QFactoryLoader ("org.qt-project.Qt.QAccessibleFactoryInterface", QLatin1String("/accessible")); if (!thisGlobalStatic.pointer.testAndSetOrdered(0, x)) delete x; else static QGlobalStaticDeleter<QFactoryLoader > cleanup(thisGlobalStatic); } return thisGlobalStatic.pointer.load(); } never executed: delete x; executed: return thisGlobalStatic.pointer.load(); Execution Count:278 partially evaluated: !thisGlobalStatic.pointer.testAndSetOrdered(0, x) no Evaluation Count:0 | yes Evaluation Count:1 |
evaluated: !thisGlobalStatic.pointer.load() yes Evaluation Count:1 | yes Evaluation Count:277 |
partially evaluated: !thisGlobalStatic.destroyed yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-278 |
6 | | - |
7 | | - |
8 | | - |
9 | | - |
10 | static QList<QAccessible::InterfaceFactory> *qAccessibleFactories() { static QGlobalStatic<QList<QAccessible::InterfaceFactory> > thisGlobalStatic = { { (0) }, false }; if (!thisGlobalStatic.pointer.load() && !thisGlobalStatic.destroyed) { QList<QAccessible::InterfaceFactory> *x = new QList<QAccessible::InterfaceFactory>; if (!thisGlobalStatic.pointer.testAndSetOrdered(0, x)) delete x; else static QGlobalStaticDeleter<QList<QAccessible::InterfaceFactory> > cleanup(thisGlobalStatic); } return thisGlobalStatic.pointer.load(); } partially evaluated: !thisGlobalStatic.pointer.testAndSetOrdered(0, x) no Evaluation Count:0 | yes Evaluation Count:1 |
evaluated: !thisGlobalStatic.pointer.load() yes Evaluation Count:1 | yes Evaluation Count:562 |
partially evaluated: !thisGlobalStatic.destroyed yes Evaluation Count:1 | no Evaluation Count:0 |
never executed: delete x; executed: return thisGlobalStatic.pointer.load(); Execution Count:563 | 0-563 |
11 | | - |
12 | QAccessible::UpdateHandler QAccessible::updateHandler = 0; | - |
13 | QAccessible::RootObjectHandler QAccessible::rootObjectHandler = 0; | - |
14 | | - |
15 | static bool accessibility_active = false; | - |
16 | static bool cleanupAdded = false; | - |
17 | | - |
18 | | - |
19 | static QPlatformAccessibility *platformAccessibility() | - |
20 | { | - |
21 | QPlatformIntegration *pfIntegration = QGuiApplicationPrivate::platformIntegration(); | - |
22 | return pfIntegration ? pfIntegration->accessibility() : 0; executed: return pfIntegration ? pfIntegration->accessibility() : 0; Execution Count:43 | 43 |
23 | } | - |
24 | | - |
25 | | - |
26 | | - |
27 | | - |
28 | | - |
29 | void QAccessible::cleanup() | - |
30 | { | - |
31 | | - |
32 | if (QPlatformAccessibility *pfAccessibility = platformAccessibility()) never evaluated: QPlatformAccessibility *pfAccessibility = platformAccessibility() | 0 |
33 | pfAccessibility->cleanup(); never executed: pfAccessibility->cleanup(); | 0 |
34 | | - |
35 | } | 0 |
36 | | - |
37 | static void qAccessibleCleanup() | - |
38 | { | - |
39 | qAccessibleFactories()->clear(); | - |
40 | } executed: } Execution Count:1 | 1 |
41 | void QAccessible::installFactory(InterfaceFactory factory) | - |
42 | { | - |
43 | if (!factory) partially evaluated: !factory no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
44 | return; | 0 |
45 | | - |
46 | if (!cleanupAdded) { partially evaluated: !cleanupAdded yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
47 | qAddPostRoutine(qAccessibleCleanup); | - |
48 | cleanupAdded = true; | - |
49 | } executed: } Execution Count:1 | 1 |
50 | if (qAccessibleFactories()->contains(factory)) partially evaluated: qAccessibleFactories()->contains(factory) no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
51 | return; | 0 |
52 | qAccessibleFactories()->append(factory); | - |
53 | } executed: } Execution Count:1 | 1 |
54 | | - |
55 | | - |
56 | | - |
57 | | - |
58 | void QAccessible::removeFactory(InterfaceFactory factory) | - |
59 | { | - |
60 | qAccessibleFactories()->removeAll(factory); | - |
61 | } | 0 |
62 | QAccessible::UpdateHandler QAccessible::installUpdateHandler(UpdateHandler handler) | - |
63 | { | - |
64 | UpdateHandler old = updateHandler; | - |
65 | updateHandler = handler; | - |
66 | return old; executed: return old; Execution Count:2 | 2 |
67 | } | - |
68 | | - |
69 | | - |
70 | | - |
71 | | - |
72 | | - |
73 | QAccessible::RootObjectHandler QAccessible::installRootObjectHandler(RootObjectHandler handler) | - |
74 | { | - |
75 | RootObjectHandler old = rootObjectHandler; | - |
76 | rootObjectHandler = handler; | - |
77 | return old; executed: return old; Execution Count:2 | 2 |
78 | } | - |
79 | QAccessibleInterface *QAccessible::queryAccessibleInterface(QObject *object) | - |
80 | { | - |
81 | accessibility_active = true; | - |
82 | if (!object) partially evaluated: !object no Evaluation Count:0 | yes Evaluation Count:223 |
| 0-223 |
83 | return 0; never executed: return 0; | 0 |
84 | | - |
85 | const QMetaObject *mo = object->metaObject(); | - |
86 | while (mo) { evaluated: mo yes Evaluation Count:280 | yes Evaluation Count:2 |
| 2-280 |
87 | const QString cn = QLatin1String(mo->className()); | - |
88 | for (int i = qAccessibleFactories()->count(); i > 0; --i) { evaluated: i > 0 yes Evaluation Count:280 | yes Evaluation Count:278 |
| 278-280 |
89 | InterfaceFactory factory = qAccessibleFactories()->at(i - 1); | - |
90 | if (QAccessibleInterface *iface = factory(cn, object)) evaluated: QAccessibleInterface *iface = factory(cn, object) yes Evaluation Count:2 | yes Evaluation Count:278 |
| 2-278 |
91 | return iface; executed: return iface; Execution Count:2 | 2 |
92 | } executed: } Execution Count:278 | 278 |
93 | | - |
94 | | - |
95 | if (QAccessibleInterface * iface = qLoadPlugin1<QAccessibleInterface, QAccessiblePlugin>(loader(), cn, object)) evaluated: QAccessibleInterface * iface = qLoadPlugin1<QAccessibleInterface, QAccessiblePlugin>(loader(), cn, object) yes Evaluation Count:219 | yes Evaluation Count:59 |
| 59-219 |
96 | return iface; executed: return iface; Execution Count:219 | 219 |
97 | | - |
98 | | - |
99 | mo = mo->superClass(); | - |
100 | } executed: } Execution Count:59 | 59 |
101 | | - |
102 | | - |
103 | if (object == (static_cast<QGuiApplication *>(QCoreApplication::instance()))) partially evaluated: object == (static_cast<QGuiApplication *>(QCoreApplication::instance())) yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-2 |
104 | return new QAccessibleApplication; executed: return new QAccessibleApplication; Execution Count:2 | 2 |
105 | | - |
106 | | - |
107 | return 0; never executed: return 0; | 0 |
108 | } | - |
109 | bool QAccessible::isActive() | - |
110 | { | - |
111 | return accessibility_active; executed: return accessibility_active; Execution Count:360373 | 360373 |
112 | } | - |
113 | void QAccessible::setRootObject(QObject *object) | - |
114 | { | - |
115 | if (rootObjectHandler) { partially evaluated: rootObjectHandler no Evaluation Count:0 | yes Evaluation Count:43 |
| 0-43 |
116 | rootObjectHandler(object); | - |
117 | return; | 0 |
118 | } | - |
119 | | - |
120 | | - |
121 | if (QPlatformAccessibility *pfAccessibility = platformAccessibility()) partially evaluated: QPlatformAccessibility *pfAccessibility = platformAccessibility() yes Evaluation Count:43 | no Evaluation Count:0 |
| 0-43 |
122 | pfAccessibility->setRootObject(object); executed: pfAccessibility->setRootObject(object); Execution Count:43 | 43 |
123 | | - |
124 | } executed: } Execution Count:43 | 43 |
125 | void QAccessible::updateAccessibility(QAccessibleEvent *event) | - |
126 | { | - |
127 | if (updateHandler) { evaluated: updateHandler yes Evaluation Count:857 | yes Evaluation Count:85163 |
| 857-85163 |
128 | updateHandler(event); | - |
129 | return; executed: return; Execution Count:857 | 857 |
130 | } | - |
131 | | - |
132 | if (!isActive()) partially evaluated: !isActive() yes Evaluation Count:85163 | no Evaluation Count:0 |
| 0-85163 |
133 | return; executed: return; Execution Count:85163 | 85163 |
134 | | - |
135 | | - |
136 | if (QPlatformAccessibility *pfAccessibility = platformAccessibility()) never evaluated: QPlatformAccessibility *pfAccessibility = platformAccessibility() | 0 |
137 | pfAccessibility->notifyAccessibilityUpdate(event); never executed: pfAccessibility->notifyAccessibilityUpdate(event); | 0 |
138 | | - |
139 | } | 0 |
140 | QVector<QPair<QAccessibleInterface*, QAccessible::Relation> > | - |
141 | QAccessibleInterface::relations(QAccessible::Relation ) const | - |
142 | { | - |
143 | return QVector<QPair<QAccessibleInterface*, QAccessible::Relation> >(); never executed: return QVector<QPair<QAccessibleInterface*, QAccessible::Relation> >(); | 0 |
144 | } | - |
145 | | - |
146 | | - |
147 | | - |
148 | | - |
149 | | - |
150 | | - |
151 | QAccessibleInterface *QAccessibleInterface::focusChild() const | - |
152 | { | - |
153 | return 0; never executed: return 0; | 0 |
154 | } | - |
155 | QColor QAccessibleInterface::foregroundColor() const | - |
156 | { | - |
157 | return QColor(); never executed: return QColor(); | 0 |
158 | } | - |
159 | | - |
160 | | - |
161 | | - |
162 | | - |
163 | | - |
164 | | - |
165 | QColor QAccessibleInterface::backgroundColor() const | - |
166 | { | - |
167 | return QColor(); never executed: return QColor(); | 0 |
168 | } | - |
169 | QAccessibleInterface *QAccessibleEvent::accessibleInterface() const | - |
170 | { | - |
171 | QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(m_object); | - |
172 | if (!iface) { | 0 |
173 | QMessageLogger("accessible/qaccessible.cpp", 1333, __PRETTY_FUNCTION__).warning() << "Cannot create accessible interface for object: " << m_object; | - |
174 | return 0; never executed: return 0; | 0 |
175 | } | - |
176 | | - |
177 | if (m_child >= 0) { never evaluated: m_child >= 0 | 0 |
178 | QAccessibleInterface *child = iface->child(m_child); | - |
179 | if (child) { | 0 |
180 | delete iface; | - |
181 | iface = child; | - |
182 | } else { | 0 |
183 | QMessageLogger("accessible/qaccessible.cpp", 1343, __PRETTY_FUNCTION__).warning() << "Cannot creat accessible child interface for object: " << m_object << " index: " << m_child; | - |
184 | } | 0 |
185 | } | - |
186 | return iface; never executed: return iface; | 0 |
187 | } | - |
188 | QWindow *QAccessibleInterface::window() const | - |
189 | { | - |
190 | return 0; never executed: return 0; | 0 |
191 | } | - |
192 | void QAccessibleInterface::virtual_hook(int , void * ) | - |
193 | { | - |
194 | } | - |
195 | const char *qAccessibleRoleString(QAccessible::Role role) | - |
196 | { | - |
197 | if (role >=0x40) never evaluated: role >=0x40 | 0 |
198 | role = QAccessible::UserRole; never executed: role = QAccessible::UserRole; | 0 |
199 | static int roleEnum = QAccessible::staticMetaObject.indexOfEnumerator("Role"); | - |
200 | return QAccessible::staticMetaObject.enumerator(roleEnum).valueToKey(role); never executed: return QAccessible::staticMetaObject.enumerator(roleEnum).valueToKey(role); | 0 |
201 | } | - |
202 | | - |
203 | | - |
204 | const char *qAccessibleEventString(QAccessible::Event event) | - |
205 | { | - |
206 | static int eventEnum = QAccessible::staticMetaObject.indexOfEnumerator("Event"); | - |
207 | return QAccessible::staticMetaObject.enumerator(eventEnum).valueToKey(event); executed: return QAccessible::staticMetaObject.enumerator(eventEnum).valueToKey(event); Execution Count:2 | 2 |
208 | } | - |
209 | | - |
210 | | - |
211 | bool operator==(const QAccessible::State &first, const QAccessible::State &second) | - |
212 | { | - |
213 | return memcmp(&first, &second, sizeof(QAccessible::State)) == 0; executed: return memcmp(&first, &second, sizeof(QAccessible::State)) == 0; Execution Count:16 | 16 |
214 | } | - |
215 | | - |
216 | | - |
217 | __attribute__((visibility("default"))) QDebug operator<<(QDebug d, const QAccessibleInterface *iface) | - |
218 | { | - |
219 | if (!iface) { | 0 |
220 | d << "QAccessibleInterface(null)"; | - |
221 | return d; never executed: return d; | 0 |
222 | } | - |
223 | d.nospace(); | - |
224 | d << "QAccessibleInterface(" << hex << (void *) iface << dec; | - |
225 | if (iface->isValid()) { never evaluated: iface->isValid() | 0 |
226 | d << " name=" << iface->text(QAccessible::Name) << " "; | - |
227 | d << "role=" << qAccessibleRoleString(iface->role()) << " "; | - |
228 | if (iface->childCount()) never evaluated: iface->childCount() | 0 |
229 | d << "childc=" << iface->childCount() << " "; never executed: d << "childc=" << iface->childCount() << " "; | 0 |
230 | if (iface->object()) { never evaluated: iface->object() | 0 |
231 | d << "obj=" << iface->object(); | - |
232 | } | 0 |
233 | QStringList stateStrings; | - |
234 | QAccessible::State st = iface->state(); | - |
235 | if (st.focusable) never evaluated: st.focusable | 0 |
236 | stateStrings << QLatin1String("focusable"); never executed: stateStrings << QLatin1String("focusable"); | 0 |
237 | if (st.focused) never evaluated: st.focused | 0 |
238 | stateStrings << QLatin1String("focused"); never executed: stateStrings << QLatin1String("focused"); | 0 |
239 | if (st.selected) never evaluated: st.selected | 0 |
240 | stateStrings << QLatin1String("selected"); never executed: stateStrings << QLatin1String("selected"); | 0 |
241 | if (st.invisible) never evaluated: st.invisible | 0 |
242 | stateStrings << QLatin1String("invisible"); never executed: stateStrings << QLatin1String("invisible"); | 0 |
243 | | - |
244 | if (!stateStrings.isEmpty()) never evaluated: !stateStrings.isEmpty() | 0 |
245 | d << stateStrings.join(QLatin1Char('|')); never executed: d << stateStrings.join(QLatin1Char('|')); | 0 |
246 | | - |
247 | if (!st.invisible) never evaluated: !st.invisible | 0 |
248 | d << "rect=" << iface->rect(); never executed: d << "rect=" << iface->rect(); | 0 |
249 | | - |
250 | } else { | 0 |
251 | d << " invalid"; | - |
252 | } | 0 |
253 | d << ")"; | - |
254 | return d.space(); never executed: return d.space(); | 0 |
255 | } | - |
256 | | - |
257 | | - |
258 | QDebug operator<<(QDebug d, const QAccessibleEvent &ev) | - |
259 | { | - |
260 | if (!&ev) { | 0 |
261 | d << "QAccessibleEvent(null)"; | - |
262 | return d; never executed: return d; | 0 |
263 | } | - |
264 | d.nospace() << "QAccessibleEvent(object=" << hex << ev.object(); | - |
265 | d.nospace() << dec; | - |
266 | d.nospace() << "child=" << ev.child(); | - |
267 | d << " event=" << qAccessibleEventString(ev.type()); | - |
268 | if (ev.type() == QAccessible::StateChanged) { never evaluated: ev.type() == QAccessible::StateChanged | 0 |
269 | QAccessible::State changed = static_cast<const QAccessibleStateChangeEvent*>(&ev)->changedStates(); | - |
270 | d << "State changed:"; | - |
271 | if (changed.disabled) d << "disabled"; never evaluated: changed.disabled never executed: d << "disabled"; | 0 |
272 | if (changed.selected) d << "selected"; never evaluated: changed.selected never executed: d << "selected"; | 0 |
273 | if (changed.focusable) d << "focusable"; never evaluated: changed.focusable never executed: d << "focusable"; | 0 |
274 | if (changed.focused) d << "focused"; never evaluated: changed.focused never executed: d << "focused"; | 0 |
275 | if (changed.pressed) d << "pressed"; never evaluated: changed.pressed never executed: d << "pressed"; | 0 |
276 | if (changed.checkable) d << "checkable"; never evaluated: changed.checkable never executed: d << "checkable"; | 0 |
277 | if (changed.checked) d << "checked"; never evaluated: changed.checked never executed: d << "checked"; | 0 |
278 | if (changed.checkStateMixed) d << "checkStateMixed"; never evaluated: changed.checkStateMixed never executed: d << "checkStateMixed"; | 0 |
279 | if (changed.readOnly) d << "readOnly"; never evaluated: changed.readOnly never executed: d << "readOnly"; | 0 |
280 | if (changed.hotTracked) d << "hotTracked"; never evaluated: changed.hotTracked never executed: d << "hotTracked"; | 0 |
281 | if (changed.defaultButton) d << "defaultButton"; never evaluated: changed.defaultButton never executed: d << "defaultButton"; | 0 |
282 | if (changed.expanded) d << "expanded"; never evaluated: changed.expanded never executed: d << "expanded"; | 0 |
283 | if (changed.collapsed) d << "collapsed"; never evaluated: changed.collapsed never executed: d << "collapsed"; | 0 |
284 | if (changed.busy) d << "busy"; never evaluated: changed.busy never executed: d << "busy"; | 0 |
285 | if (changed.expandable) d << "expandable"; never evaluated: changed.expandable never executed: d << "expandable"; | 0 |
286 | if (changed.marqueed) d << "marqueed"; never evaluated: changed.marqueed never executed: d << "marqueed"; | 0 |
287 | if (changed.animated) d << "animated"; never evaluated: changed.animated never executed: d << "animated"; | 0 |
288 | if (changed.invisible) d << "invisible"; never evaluated: changed.invisible never executed: d << "invisible"; | 0 |
289 | if (changed.offscreen) d << "offscreen"; never evaluated: changed.offscreen never executed: d << "offscreen"; | 0 |
290 | if (changed.sizeable) d << "sizeable"; never evaluated: changed.sizeable never executed: d << "sizeable"; | 0 |
291 | if (changed.movable) d << "movable"; never evaluated: changed.movable never executed: d << "movable"; | 0 |
292 | if (changed.selfVoicing) d << "selfVoicing"; never evaluated: changed.selfVoicing never executed: d << "selfVoicing"; | 0 |
293 | if (changed.selectable) d << "selectable"; never evaluated: changed.selectable never executed: d << "selectable"; | 0 |
294 | if (changed.linked) d << "linked"; never evaluated: changed.linked never executed: d << "linked"; | 0 |
295 | if (changed.traversed) d << "traversed"; never evaluated: changed.traversed never executed: d << "traversed"; | 0 |
296 | if (changed.multiSelectable) d << "multiSelectable"; never evaluated: changed.multiSelectable never executed: d << "multiSelectable"; | 0 |
297 | if (changed.extSelectable) d << "extSelectable"; never evaluated: changed.extSelectable never executed: d << "extSelectable"; | 0 |
298 | if (changed.passwordEdit) d << "passwordEdit"; never evaluated: changed.passwordEdit never executed: d << "passwordEdit"; | 0 |
299 | if (changed.hasPopup) d << "hasPopup"; never evaluated: changed.hasPopup never executed: d << "hasPopup"; | 0 |
300 | if (changed.modal) d << "modal"; never evaluated: changed.modal never executed: d << "modal"; | 0 |
301 | | - |
302 | | - |
303 | | - |
304 | if (changed.active) d << "active"; never evaluated: changed.active never executed: d << "active"; | 0 |
305 | if (changed.invalid) d << "invalid"; never evaluated: changed.invalid never executed: d << "invalid"; | 0 |
306 | if (changed.editable) d << "editable"; never evaluated: changed.editable never executed: d << "editable"; | 0 |
307 | if (changed.multiLine) d << "multiLine"; never evaluated: changed.multiLine never executed: d << "multiLine"; | 0 |
308 | if (changed.selectableText) d << "selectableText"; never evaluated: changed.selectableText never executed: d << "selectableText"; | 0 |
309 | if (changed.supportsAutoCompletion) d << "supportsAutoCompletion"; never evaluated: changed.supportsAutoCompletion never executed: d << "supportsAutoCompletion"; | 0 |
310 | | - |
311 | } | 0 |
312 | d.nospace() << ")"; | - |
313 | return d.space(); never executed: return d.space(); | 0 |
314 | } | - |
315 | | - |
316 | | - |
317 | | - |
318 | | - |
319 | | - |
| | |