qaccessible.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/gui/accessible/qaccessible.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5QAccessibleInterface::~QAccessibleInterface()-
6{-
7}-
8namespace { namespace Q_QGS_loader { 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.QAccessibleFactoryInterface", QLatin1String("/accessible")))) : value ("org.qt-project.Qt.QAccessibleFactoryInterface", QLatin1String("/accessible")) { guard.store(QtGlobalStatic::Initialized); } } holder; return
never executed: return &holder.value;
&holder.value;
never executed: return &holder.value;
} } } static QGlobalStatic<QFactoryLoader, Q_QGS_loader::innerFunction, Q_QGS_loader::guard> loader;
0
9-
10typedef QHash<QString, QAccessiblePlugin*> QAccessiblePluginsHash;-
11namespace { namespace Q_QGS_qAccessiblePlugins { typedef QAccessiblePluginsHash 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<QAccessiblePluginsHash, Q_QGS_qAccessiblePlugins::innerFunction, Q_QGS_qAccessiblePlugins::guard> qAccessiblePlugins;
0
12-
13-
14namespace { namespace Q_QGS_qAccessibleFactories { typedef QList<QAccessible::InterfaceFactory> 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<QList<QAccessible::InterfaceFactory>, Q_QGS_qAccessibleFactories::innerFunction, Q_QGS_qAccessibleFactories::guard> qAccessibleFactories;
0
15namespace { namespace Q_QGS_qAccessibleActivationObservers { typedef QList<QAccessible::ActivationObserver *> 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<QList<QAccessible::ActivationObserver *>, Q_QGS_qAccessibleActivationObservers::innerFunction, Q_QGS_qAccessibleActivationObservers::guard> qAccessibleActivationObservers;
0
16-
17QAccessible::UpdateHandler QAccessible::updateHandler = 0;-
18QAccessible::RootObjectHandler QAccessible::rootObjectHandler = 0;-
19-
20static bool cleanupAdded = false;-
21-
22static QPlatformAccessibility *platformAccessibility()-
23{-
24 QPlatformIntegration *pfIntegration = QGuiApplicationPrivate::platformIntegration();-
25 return
never executed: return pfIntegration ? pfIntegration->accessibility() : 0;
pfIntegration ? pfIntegration->accessibility() : 0;
never executed: return pfIntegration ? pfIntegration->accessibility() : 0;
0
26}-
27void QAccessible::cleanup()-
28{-
29 if (QPlatformAccessibility *pfAccessibility = platformAccessibility()
QPlatformAcces...ccessibility()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
30 pfAccessibility->cleanup();
never executed: pfAccessibility->cleanup();
0
31}
never executed: end of block
0
32-
33static void qAccessibleCleanup()-
34{-
35 qAccessibleActivationObservers()->clear();-
36 qAccessibleFactories()->clear();-
37}
never executed: end of block
0
38void QAccessible::installFactory(InterfaceFactory factory)-
39{-
40 if (!factory
!factoryDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
41 return;
never executed: return;
0
42-
43 if (!cleanupAdded
!cleanupAddedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
44 qAddPostRoutine(qAccessibleCleanup);-
45 cleanupAdded = true;-
46 }
never executed: end of block
0
47 if (qAccessibleFactories()->contains(factory)
qAccessibleFac...tains(factory)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
48 return;
never executed: return;
0
49 qAccessibleFactories()->append(factory);-
50}
never executed: end of block
0
51-
52-
53-
54-
55void QAccessible::removeFactory(InterfaceFactory factory)-
56{-
57 qAccessibleFactories()->removeAll(factory);-
58}
never executed: end of block
0
59QAccessible::UpdateHandler QAccessible::installUpdateHandler(UpdateHandler handler)-
60{-
61 UpdateHandler old = updateHandler;-
62 updateHandler = handler;-
63 return
never executed: return old;
old;
never executed: return old;
0
64}-
65-
66-
67-
68-
69-
70-
71-
72QAccessible::RootObjectHandler QAccessible::installRootObjectHandler(RootObjectHandler handler)-
73{-
74 RootObjectHandler old = rootObjectHandler;-
75 rootObjectHandler = handler;-
76 return
never executed: return old;
old;
never executed: return old;
0
77}-
78QAccessible::ActivationObserver::~ActivationObserver()-
79{-
80-
81}-
82-
83-
84-
85-
86-
87-
88void QAccessible::installActivationObserver(QAccessible::ActivationObserver *observer)-
89{-
90 if (!observer
!observerDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
91 return;
never executed: return;
0
92-
93 if (!cleanupAdded
!cleanupAddedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
94 qAddPostRoutine(qAccessibleCleanup);-
95 cleanupAdded = true;-
96 }
never executed: end of block
0
97 if (qAccessibleActivationObservers()->contains(observer)
qAccessibleAct...ains(observer)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
98 return;
never executed: return;
0
99 qAccessibleActivationObservers()->append(observer);-
100}
never executed: end of block
0
101-
102-
103-
104-
105-
106-
107-
108void QAccessible::removeActivationObserver(ActivationObserver *observer)-
109{-
110 qAccessibleActivationObservers()->removeAll(observer);-
111}
never executed: end of block
0
112QAccessibleInterface *QAccessible::queryAccessibleInterface(QObject *object)-
113{-
114 if (!object
!objectDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
115 return
never executed: return 0;
0;
never executed: return 0;
0
116-
117 if (Id id = QAccessibleCache::instance()->objectToId.value(object)
Id id = QAcces....value(object)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
118 return
never executed: return QAccessibleCache::instance()->interfaceForId(id);
QAccessibleCache::instance()->interfaceForId(id);
never executed: return QAccessibleCache::instance()->interfaceForId(id);
0
119-
120-
121-
122 const QMetaObject *mo = object->metaObject();-
123 while (mo
moDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
124 const QString cn = QLatin1String(mo->className());-
125-
126-
127 for (int i = qAccessibleFactories()->count(); i > 0
i > 0Description
TRUEnever evaluated
FALSEnever evaluated
; --i) {
0
128 InterfaceFactory factory = qAccessibleFactories()->at(i - 1);-
129 if (QAccessibleInterface *iface = factory(cn, object)
QAccessibleInt...ry(cn, object)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
130 QAccessibleCache::instance()->insert(object, iface);-
131 ((!(QAccessibleCache::instance()->objectToId.contains(object))) ? qt_assert("QAccessibleCache::instance()->objectToId.contains(object)",__FILE__,688) : qt_noop());-
132 return
never executed: return iface;
iface;
never executed: return iface;
0
133 }-
134 }
never executed: end of block
0
135-
136-
137 if (!qAccessiblePlugins()->contains(cn)
!qAccessiblePl...->contains(cn)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
138 QAccessiblePlugin *factory = 0;-
139 const int index = loader()->indexOf(cn);-
140 if (index != -1
index != -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
141 factory = qobject_cast<QAccessiblePlugin *>(loader()->instance(index));
never executed: factory = qobject_cast<QAccessiblePlugin *>(loader()->instance(index));
0
142 qAccessiblePlugins()->insert(cn, factory);-
143 }
never executed: end of block
0
144-
145-
146 ((!(qAccessiblePlugins()->contains(cn))) ? qt_assert("qAccessiblePlugins()->contains(cn)",__FILE__,703) : qt_noop());-
147 QAccessiblePlugin *factory = qAccessiblePlugins()->value(cn);-
148 if (factory
factoryDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
149 QAccessibleInterface *result = factory->create(cn, object);-
150 if (result
resultDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
151 QAccessibleCache::instance()->insert(object, result);-
152 ((!(QAccessibleCache::instance()->objectToId.contains(object))) ? qt_assert("QAccessibleCache::instance()->objectToId.contains(object)",__FILE__,709) : qt_noop());-
153 }
never executed: end of block
0
154 return
never executed: return result;
result;
never executed: return result;
0
155 }-
156 mo = mo->superClass();-
157 }
never executed: end of block
0
158-
159 if (object == (static_cast<QGuiApplication *>(QCoreApplication::instance()))
object == (sta...::instance()))Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
160 QAccessibleInterface *appInterface = new QAccessibleApplication;-
161 QAccessibleCache::instance()->insert(object, appInterface);-
162 ((!(QAccessibleCache::instance()->objectToId.contains((static_cast<QGuiApplication *>(QCoreApplication::instance()))))) ? qt_assert("QAccessibleCache::instance()->objectToId.contains(qApp)",__FILE__,719) : qt_noop());-
163 return
never executed: return appInterface;
appInterface;
never executed: return appInterface;
0
164 }-
165-
166 return
never executed: return 0;
0;
never executed: return 0;
0
167}-
168QAccessible::Id QAccessible::registerAccessibleInterface(QAccessibleInterface *iface)-
169{-
170 ((!(iface)) ? qt_assert("iface",__FILE__,742) : qt_noop());-
171 return
never executed: return QAccessibleCache::instance()->insert(iface->object(), iface);
QAccessibleCache::instance()->insert(iface->object(), iface);
never executed: return QAccessibleCache::instance()->insert(iface->object(), iface);
0
172}-
173-
174-
175-
176-
177-
178-
179void QAccessible::deleteAccessibleInterface(Id id)-
180{-
181 QAccessibleCache::instance()->deleteInterface(id);-
182}
never executed: end of block
0
183-
184-
185-
186-
187QAccessible::Id QAccessible::uniqueId(QAccessibleInterface *iface)-
188{-
189 Id id = QAccessibleCache::instance()->idForInterface(iface);-
190 if (!id
!idDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
191 id = registerAccessibleInterface(iface);
never executed: id = registerAccessibleInterface(iface);
0
192 return
never executed: return id;
id;
never executed: return id;
0
193}-
194-
195-
196-
197-
198-
199-
200QAccessibleInterface *QAccessible::accessibleInterface(Id id)-
201{-
202 return
never executed: return QAccessibleCache::instance()->interfaceForId(id);
QAccessibleCache::instance()->interfaceForId(id);
never executed: return QAccessibleCache::instance()->interfaceForId(id);
0
203}-
204bool QAccessible::isActive()-
205{-
206 if (QPlatformAccessibility *pfAccessibility = platformAccessibility()
QPlatformAcces...ccessibility()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
207 return
never executed: return pfAccessibility->isActive();
pfAccessibility->isActive();
never executed: return pfAccessibility->isActive();
0
208 return
never executed: return false;
false;
never executed: return false;
0
209}-
210-
211-
212-
213-
214void QAccessible::setActive(bool active)-
215{-
216 for (int i = 0; i < qAccessibleActivationObservers()->count()
i < qAccessibl...ers()->count()Description
TRUEnever evaluated
FALSEnever evaluated
;++i)
0
217 qAccessibleActivationObservers()->at(i)->accessibilityActiveChanged(active);
never executed: qAccessibleActivationObservers()->at(i)->accessibilityActiveChanged(active);
0
218}
never executed: end of block
0
219void QAccessible::setRootObject(QObject *object)-
220{-
221 if (rootObjectHandler
rootObjectHandlerDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
222 rootObjectHandler(object);-
223 return;
never executed: return;
0
224 }-
225-
226 if (QPlatformAccessibility *pfAccessibility = platformAccessibility()
QPlatformAcces...ccessibility()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
227 pfAccessibility->setRootObject(object);
never executed: pfAccessibility->setRootObject(object);
0
228}
never executed: end of block
0
229void QAccessible::updateAccessibility(QAccessibleEvent *event)-
230{-
231-
232-
233-
234-
235-
236-
237 QAccessibleInterface *iface = event->accessibleInterface();-
238 if (isActive()
isActive()Description
TRUEnever evaluated
FALSEnever evaluated
&& iface
ifaceDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
239 if (event->type() == QAccessible::TableModelChanged
event->type() ...leModelChangedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
240 if (iface->tableInterface()
iface->tableInterface()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
241 iface->tableInterface()->modelChange(static_cast<QAccessibleTableModelChangeEvent*>(event));
never executed: iface->tableInterface()->modelChange(static_cast<QAccessibleTableModelChangeEvent*>(event));
0
242 }
never executed: end of block
0
243-
244 if (updateHandler
updateHandlerDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
245 updateHandler(event);-
246 return;
never executed: return;
0
247 }-
248 }
never executed: end of block
0
249-
250 if (QPlatformAccessibility *pfAccessibility = platformAccessibility()
QPlatformAcces...ccessibility()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
251 pfAccessibility->notifyAccessibilityUpdate(event);
never executed: pfAccessibility->notifyAccessibilityUpdate(event);
0
252}
never executed: end of block
0
253QPair< int, int > QAccessible::qAccessibleTextBoundaryHelper(const QTextCursor &offsetCursor, TextBoundaryType boundaryType)-
254{-
255 ((!(!offsetCursor.isNull())) ? qt_assert("!offsetCursor.isNull()",__FILE__,893) : qt_noop());-
256-
257 QTextCursor endCursor = offsetCursor;-
258 endCursor.movePosition(QTextCursor::End);-
259 int characterCount = endCursor.position();-
260-
261 QPair<int, int> result;-
262 QTextCursor cursor = offsetCursor;-
263 switch (boundaryType) {-
264 case
never executed: case CharBoundary:
CharBoundary:
never executed: case CharBoundary:
0
265 result.first = cursor.position();-
266 cursor.movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor);-
267 result.second = cursor.position();-
268 break;
never executed: break;
0
269 case
never executed: case WordBoundary:
WordBoundary:
never executed: case WordBoundary:
0
270 cursor.movePosition(QTextCursor::StartOfWord, QTextCursor::MoveAnchor);-
271 result.first = cursor.position();-
272 cursor.movePosition(QTextCursor::EndOfWord, QTextCursor::KeepAnchor);-
273 result.second = cursor.position();-
274 break;
never executed: break;
0
275 case
never executed: case SentenceBoundary:
SentenceBoundary:
never executed: case SentenceBoundary:
{
0
276-
277-
278-
279 cursor.movePosition(QTextCursor::StartOfBlock, QTextCursor::MoveAnchor);-
280 result.first = cursor.position();-
281 cursor.movePosition(QTextCursor::EndOfBlock, QTextCursor::KeepAnchor);-
282 result.second = cursor.position();-
283 QString blockText = cursor.selectedText();-
284 const int offsetWithinBlockText = offsetCursor.position() - result.first;-
285 QTextBoundaryFinder sentenceFinder(QTextBoundaryFinder::Sentence, blockText);-
286 sentenceFinder.setPosition(offsetWithinBlockText);-
287 int prevBoundary = offsetWithinBlockText;-
288 int nextBoundary = offsetWithinBlockText;-
289 if (!(sentenceFinder.boundaryReasons() & QTextBoundaryFinder::StartOfItem)
!(sentenceFind...::StartOfItem)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
290 prevBoundary = sentenceFinder.toPreviousBoundary();
never executed: prevBoundary = sentenceFinder.toPreviousBoundary();
0
291 nextBoundary = sentenceFinder.toNextBoundary();-
292 if (nextBoundary != -1
nextBoundary != -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
293 result.second = result.first + nextBoundary;
never executed: result.second = result.first + nextBoundary;
0
294 if (prevBoundary != -1
prevBoundary != -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
295 result.first += prevBoundary;
never executed: result.first += prevBoundary;
0
296 break;
never executed: break;
}
0
297 case
never executed: case LineBoundary:
LineBoundary:
never executed: case LineBoundary:
0
298 cursor.movePosition(QTextCursor::StartOfLine, QTextCursor::MoveAnchor);-
299 result.first = cursor.position();-
300 cursor.movePosition(QTextCursor::EndOfLine, QTextCursor::KeepAnchor);-
301 result.second = cursor.position();-
302 break;
never executed: break;
0
303 case
never executed: case ParagraphBoundary:
ParagraphBoundary:
never executed: case ParagraphBoundary:
0
304 cursor.movePosition(QTextCursor::StartOfBlock, QTextCursor::MoveAnchor);-
305 result.first = cursor.position();-
306 cursor.movePosition(QTextCursor::EndOfBlock, QTextCursor::KeepAnchor);-
307 result.second = cursor.position();-
308 break;
never executed: break;
0
309 case
never executed: case NoBoundary:
NoBoundary:
never executed: case NoBoundary:
0
310 result.first = 0;-
311 result.second = characterCount;-
312 break;
never executed: break;
0
313 }-
314 return
never executed: return result;
result;
never executed: return result;
0
315}-
316QVector<QPair<QAccessibleInterface*, QAccessible::Relation> >-
317QAccessibleInterface::relations(QAccessible::Relation ) const-
318{-
319 return
never executed: return QVector<QPair<QAccessibleInterface*, QAccessible::Relation> >();
QVector<QPair<QAccessibleInterface*, QAccessible::Relation> >();
never executed: return QVector<QPair<QAccessibleInterface*, QAccessible::Relation> >();
0
320}-
321-
322-
323-
324-
325-
326-
327QAccessibleInterface *QAccessibleInterface::focusChild() const-
328{-
329 return
never executed: return 0;
0;
never executed: return 0;
0
330}-
331QColor QAccessibleInterface::foregroundColor() const-
332{-
333 return
never executed: return QColor();
QColor();
never executed: return QColor();
0
334}-
335-
336-
337-
338-
339-
340-
341QColor QAccessibleInterface::backgroundColor() const-
342{-
343 return
never executed: return QColor();
QColor();
never executed: return QColor();
0
344}-
345QAccessibleEvent::~QAccessibleEvent()-
346{-
347-
348}-
349QAccessible::Id QAccessibleEvent::uniqueId() const-
350{-
351 if (!m_object
!m_objectDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
352 return
never executed: return m_uniqueId;
m_uniqueId;
never executed: return m_uniqueId;
0
353 QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(m_object);-
354 if (!iface
!ifaceDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
355 return
never executed: return 0;
0;
never executed: return 0;
0
356 if (m_child != -1
m_child != -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
357 iface = iface->child(m_child);
never executed: iface = iface->child(m_child);
0
358 return
never executed: return QAccessible::uniqueId(iface);
QAccessible::uniqueId(iface);
never executed: return QAccessible::uniqueId(iface);
0
359}-
360QAccessibleValueChangeEvent::~QAccessibleValueChangeEvent()-
361{-
362-
363}-
364QAccessibleStateChangeEvent::~QAccessibleStateChangeEvent()-
365{-
366-
367}-
368QAccessibleTableModelChangeEvent::~QAccessibleTableModelChangeEvent()-
369{-
370-
371}-
372QAccessibleTextCursorEvent::~QAccessibleTextCursorEvent()-
373{-
374-
375}-
376QAccessibleTextInsertEvent::~QAccessibleTextInsertEvent()-
377{-
378-
379}-
380QAccessibleTextRemoveEvent::~QAccessibleTextRemoveEvent()-
381{-
382-
383}-
384QAccessibleTextUpdateEvent::~QAccessibleTextUpdateEvent()-
385{-
386-
387}-
388QAccessibleTextSelectionEvent::~QAccessibleTextSelectionEvent()-
389{-
390-
391}-
392-
393-
394-
395-
396-
397-
398-
399QAccessibleInterface *QAccessibleEvent::accessibleInterface() const-
400{-
401 if (m_object == 0
m_object == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
402 return
never executed: return QAccessible::accessibleInterface(m_uniqueId);
QAccessible::accessibleInterface(m_uniqueId);
never executed: return QAccessible::accessibleInterface(m_uniqueId);
0
403-
404 QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(m_object);-
405 if (!iface
!ifaceDescription
TRUEnever evaluated
FALSEnever evaluated
|| !iface->isValid()
!iface->isValid()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
406 return
never executed: return 0;
0;
never executed: return 0;
0
407-
408 if (m_child >= 0
m_child >= 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
409 QAccessibleInterface *child = iface->child(m_child);-
410 if (child
childDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
411 iface = child;-
412 }
never executed: end of block
else {
0
413 QMessageLogger(__FILE__, 1772, __PRETTY_FUNCTION__).warning() << "Cannot creat accessible child interface for object: " << m_object << " index: " << m_child;-
414 }
never executed: end of block
0
415 }-
416 return
never executed: return iface;
iface;
never executed: return iface;
0
417}-
418QWindow *QAccessibleInterface::window() const-
419{-
420 return
never executed: return 0;
0;
never executed: return 0;
0
421}-
422void QAccessibleInterface::virtual_hook(int , void * )-
423{-
424}-
425const char *qAccessibleRoleString(QAccessible::Role role)-
426{-
427 if (role >= QAccessible::UserRole
role >= QAccessible::UserRoleDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
428 role = QAccessible::UserRole;
never executed: role = QAccessible::UserRole;
0
429 static int roleEnum = QAccessible::staticMetaObject.indexOfEnumerator("Role");-
430 return
never executed: return QAccessible::staticMetaObject.enumerator(roleEnum).valueToKey(role);
QAccessible::staticMetaObject.enumerator(roleEnum).valueToKey(role);
never executed: return QAccessible::staticMetaObject.enumerator(roleEnum).valueToKey(role);
0
431}-
432-
433-
434const char *qAccessibleEventString(QAccessible::Event event)-
435{-
436 static int eventEnum = QAccessible::staticMetaObject.indexOfEnumerator("Event");-
437 return
never executed: return QAccessible::staticMetaObject.enumerator(eventEnum).valueToKey(event);
QAccessible::staticMetaObject.enumerator(eventEnum).valueToKey(event);
never executed: return QAccessible::staticMetaObject.enumerator(eventEnum).valueToKey(event);
0
438}-
439-
440-
441bool operator==(const QAccessible::State &first, const QAccessible::State &second)-
442{-
443 return
never executed: return memcmp(&first, &second, sizeof(QAccessible::State)) == 0;
memcmp(&first, &second, sizeof(QAccessible::State)) == 0;
never executed: return memcmp(&first, &second, sizeof(QAccessible::State)) == 0;
0
444}-
445-
446-
447-
448__attribute__((visibility("default"))) QDebug operator<<(QDebug d, const QAccessibleInterface *iface)-
449{-
450 QDebugStateSaver saver(d);-
451 if (!iface
!ifaceDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
452 d << "QAccessibleInterface(null)";-
453 return
never executed: return d;
d;
never executed: return d;
0
454 }-
455 d.nospace();-
456 d << "QAccessibleInterface(" << hex << (const void *) iface << dec;-
457 if (iface->isValid()
iface->isValid()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
458 d << " name=" << iface->text(QAccessible::Name) << ' ';-
459 d << "role=" << qAccessibleRoleString(iface->role()) << ' ';-
460 if (iface->childCount()
iface->childCount()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
461 d << "childc=" << iface->childCount() << ' ';
never executed: d << "childc=" << iface->childCount() << ' ';
0
462 if (iface->object()
iface->object()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
463 d << "obj=" << iface->object();-
464 }
never executed: end of block
0
465 QStringList stateStrings;-
466 QAccessible::State st = iface->state();-
467 if (st.focusable
st.focusableDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
468 stateStrings << QLatin1String("focusable");
never executed: stateStrings << QLatin1String("focusable");
0
469 if (st.focused
st.focusedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
470 stateStrings << QLatin1String("focused");
never executed: stateStrings << QLatin1String("focused");
0
471 if (st.selected
st.selectedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
472 stateStrings << QLatin1String("selected");
never executed: stateStrings << QLatin1String("selected");
0
473 if (st.invisible
st.invisibleDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
474 stateStrings << QLatin1String("invisible");
never executed: stateStrings << QLatin1String("invisible");
0
475-
476 if (!stateStrings.isEmpty()
!stateStrings.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
477 d << stateStrings.join(QLatin1Char('|'));
never executed: d << stateStrings.join(QLatin1Char('|'));
0
478-
479 if (!st.invisible
!st.invisibleDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
480 d << "rect=" << iface->rect();
never executed: d << "rect=" << iface->rect();
0
481-
482 }
never executed: end of block
else {
0
483 d << " invalid";-
484 }
never executed: end of block
0
485 d << ')';-
486 return
never executed: return d;
d;
never executed: return d;
0
487}-
488-
489-
490QDebug operator<<(QDebug d, const QAccessibleEvent &ev)-
491{-
492 QDebugStateSaver saver(d);-
493 d.nospace() << "QAccessibleEvent(";-
494 if (ev.object()
ev.object()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
495 d.nospace() << "object=" << hex << ev.object() << dec;-
496 d.nospace() << "child=" << ev.child();-
497 }
never executed: end of block
else {
0
498 d.nospace() << "no object, uniqueId=" << ev.uniqueId();-
499 }
never executed: end of block
0
500 d << " event=" << qAccessibleEventString(ev.type());-
501 if (ev.type() == QAccessible::StateChanged
ev.type() == Q...::StateChangedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
502 QAccessible::State changed = static_cast<const QAccessibleStateChangeEvent*>(&ev)->changedStates();-
503 d << "State changed:";-
504 if (changed.disabled
changed.disabledDescription
TRUEnever evaluated
FALSEnever evaluated
) d << "disabled";
never executed: d << "disabled";
0
505 if (changed.selected
changed.selectedDescription
TRUEnever evaluated
FALSEnever evaluated
) d << "selected";
never executed: d << "selected";
0
506 if (changed.focusable
changed.focusableDescription
TRUEnever evaluated
FALSEnever evaluated
) d << "focusable";
never executed: d << "focusable";
0
507 if (changed.focused
changed.focusedDescription
TRUEnever evaluated
FALSEnever evaluated
) d << "focused";
never executed: d << "focused";
0
508 if (changed.pressed
changed.pressedDescription
TRUEnever evaluated
FALSEnever evaluated
) d << "pressed";
never executed: d << "pressed";
0
509 if (changed.checkable
changed.checkableDescription
TRUEnever evaluated
FALSEnever evaluated
) d << "checkable";
never executed: d << "checkable";
0
510 if (changed.checked
changed.checkedDescription
TRUEnever evaluated
FALSEnever evaluated
) d << "checked";
never executed: d << "checked";
0
511 if (changed.checkStateMixed
changed.checkStateMixedDescription
TRUEnever evaluated
FALSEnever evaluated
) d << "checkStateMixed";
never executed: d << "checkStateMixed";
0
512 if (changed.readOnly
changed.readOnlyDescription
TRUEnever evaluated
FALSEnever evaluated
) d << "readOnly";
never executed: d << "readOnly";
0
513 if (changed.hotTracked
changed.hotTrackedDescription
TRUEnever evaluated
FALSEnever evaluated
) d << "hotTracked";
never executed: d << "hotTracked";
0
514 if (changed.defaultButton
changed.defaultButtonDescription
TRUEnever evaluated
FALSEnever evaluated
) d << "defaultButton";
never executed: d << "defaultButton";
0
515 if (changed.expanded
changed.expandedDescription
TRUEnever evaluated
FALSEnever evaluated
) d << "expanded";
never executed: d << "expanded";
0
516 if (changed.collapsed
changed.collapsedDescription
TRUEnever evaluated
FALSEnever evaluated
) d << "collapsed";
never executed: d << "collapsed";
0
517 if (changed.busy
changed.busyDescription
TRUEnever evaluated
FALSEnever evaluated
) d << "busy";
never executed: d << "busy";
0
518 if (changed.expandable
changed.expandableDescription
TRUEnever evaluated
FALSEnever evaluated
) d << "expandable";
never executed: d << "expandable";
0
519 if (changed.marqueed
changed.marqueedDescription
TRUEnever evaluated
FALSEnever evaluated
) d << "marqueed";
never executed: d << "marqueed";
0
520 if (changed.animated
changed.animatedDescription
TRUEnever evaluated
FALSEnever evaluated
) d << "animated";
never executed: d << "animated";
0
521 if (changed.invisible
changed.invisibleDescription
TRUEnever evaluated
FALSEnever evaluated
) d << "invisible";
never executed: d << "invisible";
0
522 if (changed.offscreen
changed.offscreenDescription
TRUEnever evaluated
FALSEnever evaluated
) d << "offscreen";
never executed: d << "offscreen";
0
523 if (changed.sizeable
changed.sizeableDescription
TRUEnever evaluated
FALSEnever evaluated
) d << "sizeable";
never executed: d << "sizeable";
0
524 if (changed.movable
changed.movableDescription
TRUEnever evaluated
FALSEnever evaluated
) d << "movable";
never executed: d << "movable";
0
525 if (changed.selfVoicing
changed.selfVoicingDescription
TRUEnever evaluated
FALSEnever evaluated
) d << "selfVoicing";
never executed: d << "selfVoicing";
0
526 if (changed.selectable
changed.selectableDescription
TRUEnever evaluated
FALSEnever evaluated
) d << "selectable";
never executed: d << "selectable";
0
527 if (changed.linked
changed.linkedDescription
TRUEnever evaluated
FALSEnever evaluated
) d << "linked";
never executed: d << "linked";
0
528 if (changed.traversed
changed.traversedDescription
TRUEnever evaluated
FALSEnever evaluated
) d << "traversed";
never executed: d << "traversed";
0
529 if (changed.multiSelectable
changed.multiSelectableDescription
TRUEnever evaluated
FALSEnever evaluated
) d << "multiSelectable";
never executed: d << "multiSelectable";
0
530 if (changed.extSelectable
changed.extSelectableDescription
TRUEnever evaluated
FALSEnever evaluated
) d << "extSelectable";
never executed: d << "extSelectable";
0
531 if (changed.passwordEdit
changed.passwordEditDescription
TRUEnever evaluated
FALSEnever evaluated
) d << "passwordEdit";
never executed: d << "passwordEdit";
0
532 if (changed.hasPopup
changed.hasPopupDescription
TRUEnever evaluated
FALSEnever evaluated
) d << "hasPopup";
never executed: d << "hasPopup";
0
533 if (changed.modal
changed.modalDescription
TRUEnever evaluated
FALSEnever evaluated
) d << "modal";
never executed: d << "modal";
0
534-
535-
536-
537 if (changed.active
changed.activeDescription
TRUEnever evaluated
FALSEnever evaluated
) d << "active";
never executed: d << "active";
0
538 if (changed.invalid
changed.invalidDescription
TRUEnever evaluated
FALSEnever evaluated
) d << "invalid";
never executed: d << "invalid";
0
539 if (changed.editable
changed.editableDescription
TRUEnever evaluated
FALSEnever evaluated
) d << "editable";
never executed: d << "editable";
0
540 if (changed.multiLine
changed.multiLineDescription
TRUEnever evaluated
FALSEnever evaluated
) d << "multiLine";
never executed: d << "multiLine";
0
541 if (changed.selectableText
changed.selectableTextDescription
TRUEnever evaluated
FALSEnever evaluated
) d << "selectableText";
never executed: d << "selectableText";
0
542 if (changed.supportsAutoCompletion
changed.supportsAutoCompletionDescription
TRUEnever evaluated
FALSEnever evaluated
) d << "supportsAutoCompletion";
never executed: d << "supportsAutoCompletion";
0
543-
544 }
never executed: end of block
0
545 d << ')';-
546 return
never executed: return d;
d;
never executed: return d;
0
547}-
548QAccessibleTextInterface::~QAccessibleTextInterface()-
549{-
550-
551}-
552static QString textLineBoundary(int beforeAtAfter, const QString &text, int offset, int *startOffset, int *endOffset)-
553{-
554 ((!(beforeAtAfter >= -1 && beforeAtAfter <= 1)) ? qt_assert("beforeAtAfter >= -1 && beforeAtAfter <= 1",__FILE__,2059) : qt_noop());-
555 ((!(*startOffset == -1 && *endOffset == -1)) ? qt_assert("*startOffset == -1 && *endOffset == -1",__FILE__,2060) : qt_noop());-
556 int length = text.length();-
557 ((!(offset >= 0 && offset <= length)) ? qt_assert("offset >= 0 && offset <= length",__FILE__,2062) : qt_noop());-
558-
559-
560 if (beforeAtAfter == 1
beforeAtAfter == 1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
561 offset = text.indexOf(QChar::LineFeed, qMin(offset, length - 1));-
562 if (offset < 0
offset < 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
563 return
never executed: return QString();
QString();
never executed: return QString();
0
564 ++offset;-
565 }
never executed: end of block
else if (beforeAtAfter == -1
beforeAtAfter == -1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
566 offset = text.lastIndexOf(QChar::LineFeed, qMax(offset - 1, 0));-
567 if (offset < 0
offset < 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
568 return
never executed: return QString();
QString();
never executed: return QString();
0
569 }
never executed: end of block
0
570-
571 if (offset > 0
offset > 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
572 *
never executed: *startOffset = text.lastIndexOf(QChar::LineFeed, offset - 1);
startOffset = text.lastIndexOf(QChar::LineFeed, offset - 1);
never executed: *startOffset = text.lastIndexOf(QChar::LineFeed, offset - 1);
0
573 ++*startOffset;-
574-
575 *endOffset = text.indexOf(QChar::LineFeed, qMin(offset, length - 1)) + 1;-
576 if (*
*endOffset <= 0Description
TRUEnever evaluated
FALSEnever evaluated
endOffset <= 0
*endOffset <= 0Description
TRUEnever evaluated
FALSEnever evaluated
|| *
*endOffset > lengthDescription
TRUEnever evaluated
FALSEnever evaluated
endOffset > length
*endOffset > lengthDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
577 *
never executed: *endOffset = length;
endOffset = length;
never executed: *endOffset = length;
0
578-
579 return
never executed: return text.mid(*startOffset, *endOffset - *startOffset);
text.mid(*startOffset, *endOffset - *startOffset);
never executed: return text.mid(*startOffset, *endOffset - *startOffset);
0
580}-
581QString QAccessibleTextInterface::textBeforeOffset(int offset, QAccessible::TextBoundaryType boundaryType,-
582 int *startOffset, int *endOffset) const-
583{-
584 const QString txt = text(0, characterCount());-
585-
586 if (offset == -1
offset == -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
587 offset = txt.length();
never executed: offset = txt.length();
0
588-
589 *startOffset = *endOffset = -1;-
590 if (txt.isEmpty()
txt.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
|| offset <= 0
offset <= 0Description
TRUEnever evaluated
FALSEnever evaluated
|| offset > txt.length()
offset > txt.length()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
591 return
never executed: return QString();
QString();
never executed: return QString();
0
592-
593-
594 QTextBoundaryFinder::BoundaryType type = QTextBoundaryFinder::Grapheme;-
595 switch (boundaryType) {-
596 case
never executed: case QAccessible::CharBoundary:
QAccessible::CharBoundary:
never executed: case QAccessible::CharBoundary:
0
597 type = QTextBoundaryFinder::Grapheme;-
598 break;
never executed: break;
0
599 case
never executed: case QAccessible::WordBoundary:
QAccessible::WordBoundary:
never executed: case QAccessible::WordBoundary:
0
600 type = QTextBoundaryFinder::Word;-
601 break;
never executed: break;
0
602 case
never executed: case QAccessible::SentenceBoundary:
QAccessible::SentenceBoundary:
never executed: case QAccessible::SentenceBoundary:
0
603 type = QTextBoundaryFinder::Sentence;-
604 break;
never executed: break;
0
605 case
never executed: case QAccessible::LineBoundary:
QAccessible::LineBoundary:
never executed: case QAccessible::LineBoundary:
0
606 case
never executed: case QAccessible::ParagraphBoundary:
QAccessible::ParagraphBoundary:
never executed: case QAccessible::ParagraphBoundary:
0
607-
608 return
never executed: return textLineBoundary(-1, txt, offset, startOffset, endOffset);
textLineBoundary(-1, txt, offset, startOffset, endOffset);
never executed: return textLineBoundary(-1, txt, offset, startOffset, endOffset);
0
609 case
never executed: case QAccessible::NoBoundary:
QAccessible::NoBoundary:
never executed: case QAccessible::NoBoundary:
0
610-
611 return
never executed: return QString();
QString();
never executed: return QString();
0
612 default
never executed: default:
:
never executed: default:
0
613 do { ((!(false)) ? qt_assert_x("Q_UNREACHABLE()", "Q_UNREACHABLE was reached",__FILE__,2136) : qt_noop()); __builtin_unreachable(); } while (0);-
614 }
never executed: end of block
0
615-
616-
617-
618 QTextBoundaryFinder boundary(type, txt);-
619 boundary.setPosition(offset);-
620-
621 do {-
622 if ((
(boundary.boun...r::EndOfItem))Description
TRUEnever evaluated
FALSEnever evaluated
boundary.boundaryReasons() & (QTextBoundaryFinder::StartOfItem | QTextBoundaryFinder::EndOfItem))
(boundary.boun...r::EndOfItem))Description
TRUEnever evaluated
FALSEnever evaluated
)
0
623 break;
never executed: break;
0
624 }
never executed: end of block
while (boundary.toPreviousBoundary() > 0
boundary.toPre...Boundary() > 0Description
TRUEnever evaluated
FALSEnever evaluated
);
0
625 ((!(boundary.position() >= 0)) ? qt_assert("boundary.position() >= 0",__FILE__,2148) : qt_noop());-
626 *endOffset = boundary.position();-
627-
628 while (boundary.toPreviousBoundary() > 0
boundary.toPre...Boundary() > 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
629 if ((
(boundary.boun...r::EndOfItem))Description
TRUEnever evaluated
FALSEnever evaluated
boundary.boundaryReasons() & (QTextBoundaryFinder::StartOfItem | QTextBoundaryFinder::EndOfItem))
(boundary.boun...r::EndOfItem))Description
TRUEnever evaluated
FALSEnever evaluated
)
0
630 break;
never executed: break;
0
631 }
never executed: end of block
0
632 ((!(boundary.position() >= 0)) ? qt_assert("boundary.position() >= 0",__FILE__,2155) : qt_noop());-
633 *startOffset = boundary.position();-
634-
635 return
never executed: return txt.mid(*startOffset, *endOffset - *startOffset);
txt.mid(*startOffset, *endOffset - *startOffset);
never executed: return txt.mid(*startOffset, *endOffset - *startOffset);
0
636}-
637QString QAccessibleTextInterface::textAfterOffset(int offset, QAccessible::TextBoundaryType boundaryType,-
638 int *startOffset, int *endOffset) const-
639{-
640 const QString txt = text(0, characterCount());-
641-
642 if (offset == -1
offset == -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
643 offset = txt.length();
never executed: offset = txt.length();
0
644-
645 *startOffset = *endOffset = -1;-
646 if (txt.isEmpty()
txt.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
|| offset < 0
offset < 0Description
TRUEnever evaluated
FALSEnever evaluated
|| offset >= txt.length()
offset >= txt.length()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
647 return
never executed: return QString();
QString();
never executed: return QString();
0
648-
649-
650 QTextBoundaryFinder::BoundaryType type = QTextBoundaryFinder::Grapheme;-
651 switch (boundaryType) {-
652 case
never executed: case QAccessible::CharBoundary:
QAccessible::CharBoundary:
never executed: case QAccessible::CharBoundary:
0
653 type = QTextBoundaryFinder::Grapheme;-
654 break;
never executed: break;
0
655 case
never executed: case QAccessible::WordBoundary:
QAccessible::WordBoundary:
never executed: case QAccessible::WordBoundary:
0
656 type = QTextBoundaryFinder::Word;-
657 break;
never executed: break;
0
658 case
never executed: case QAccessible::SentenceBoundary:
QAccessible::SentenceBoundary:
never executed: case QAccessible::SentenceBoundary:
0
659 type = QTextBoundaryFinder::Sentence;-
660 break;
never executed: break;
0
661 case
never executed: case QAccessible::LineBoundary:
QAccessible::LineBoundary:
never executed: case QAccessible::LineBoundary:
0
662 case
never executed: case QAccessible::ParagraphBoundary:
QAccessible::ParagraphBoundary:
never executed: case QAccessible::ParagraphBoundary:
0
663-
664 return
never executed: return textLineBoundary(1, txt, offset, startOffset, endOffset);
textLineBoundary(1, txt, offset, startOffset, endOffset);
never executed: return textLineBoundary(1, txt, offset, startOffset, endOffset);
0
665 case
never executed: case QAccessible::NoBoundary:
QAccessible::NoBoundary:
never executed: case QAccessible::NoBoundary:
0
666-
667 return
never executed: return QString();
QString();
never executed: return QString();
0
668 default
never executed: default:
:
never executed: default:
0
669 do { ((!(false)) ? qt_assert_x("Q_UNREACHABLE()", "Q_UNREACHABLE was reached",__FILE__,2210) : qt_noop()); __builtin_unreachable(); } while (0);-
670 }
never executed: end of block
0
671-
672-
673-
674 QTextBoundaryFinder boundary(type, txt);-
675 boundary.setPosition(offset);-
676-
677 while (true) {-
678 int toNext = boundary.toNextBoundary();-
679 if ((
(boundary.boun...r::EndOfItem))Description
TRUEnever evaluated
FALSEnever evaluated
boundary.boundaryReasons() & (QTextBoundaryFinder::StartOfItem | QTextBoundaryFinder::EndOfItem))
(boundary.boun...r::EndOfItem))Description
TRUEnever evaluated
FALSEnever evaluated
)
0
680 break;
never executed: break;
0
681 if (toNext < 0
toNext < 0Description
TRUEnever evaluated
FALSEnever evaluated
|| toNext >= txt.length()
toNext >= txt.length()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
682 break;
never executed: break;
0
683 }
never executed: end of block
0
684 ((!(boundary.position() <= txt.length())) ? qt_assert("boundary.position() <= txt.length()",__FILE__,2225) : qt_noop());-
685 *startOffset = boundary.position();-
686-
687 while (true) {-
688 int toNext = boundary.toNextBoundary();-
689 if ((
(boundary.boun...r::EndOfItem))Description
TRUEnever evaluated
FALSEnever evaluated
boundary.boundaryReasons() & (QTextBoundaryFinder::StartOfItem | QTextBoundaryFinder::EndOfItem))
(boundary.boun...r::EndOfItem))Description
TRUEnever evaluated
FALSEnever evaluated
)
0
690 break;
never executed: break;
0
691 if (toNext < 0
toNext < 0Description
TRUEnever evaluated
FALSEnever evaluated
|| toNext >= txt.length()
toNext >= txt.length()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
692 break;
never executed: break;
0
693 }
never executed: end of block
0
694 ((!(boundary.position() <= txt.length())) ? qt_assert("boundary.position() <= txt.length()",__FILE__,2235) : qt_noop());-
695 *endOffset = boundary.position();-
696-
697 if ((*
(*startOffset == -1)Description
TRUEnever evaluated
FALSEnever evaluated
startOffset == -1)
(*startOffset == -1)Description
TRUEnever evaluated
FALSEnever evaluated
|| (*
(*endOffset == -1)Description
TRUEnever evaluated
FALSEnever evaluated
endOffset == -1)
(*endOffset == -1)Description
TRUEnever evaluated
FALSEnever evaluated
|| (*
(*startOffset == *endOffset)Description
TRUEnever evaluated
FALSEnever evaluated
startOffset == *endOffset)
(*startOffset == *endOffset)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
698 *endOffset = -1;-
699 *startOffset = -1;-
700 }
never executed: end of block
0
701-
702 return
never executed: return txt.mid(*startOffset, *endOffset - *startOffset);
txt.mid(*startOffset, *endOffset - *startOffset);
never executed: return txt.mid(*startOffset, *endOffset - *startOffset);
0
703}-
704QString QAccessibleTextInterface::textAtOffset(int offset, QAccessible::TextBoundaryType boundaryType,-
705 int *startOffset, int *endOffset) const-
706{-
707 const QString txt = text(0, characterCount());-
708-
709 if (offset == -1
offset == -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
710 offset = txt.length();
never executed: offset = txt.length();
0
711-
712 *startOffset = *endOffset = -1;-
713 if (txt.isEmpty()
txt.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
|| offset < 0
offset < 0Description
TRUEnever evaluated
FALSEnever evaluated
|| offset > txt.length()
offset > txt.length()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
714 return
never executed: return QString();
QString();
never executed: return QString();
0
715-
716 if (offset == txt.length()
offset == txt.length()Description
TRUEnever evaluated
FALSEnever evaluated
&& boundaryType == QAccessible::CharBoundary
boundaryType =...::CharBoundaryDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
717 return
never executed: return QString();
QString();
never executed: return QString();
0
718-
719-
720 QTextBoundaryFinder::BoundaryType type = QTextBoundaryFinder::Grapheme;-
721 switch (boundaryType) {-
722 case
never executed: case QAccessible::CharBoundary:
QAccessible::CharBoundary:
never executed: case QAccessible::CharBoundary:
0
723 type = QTextBoundaryFinder::Grapheme;-
724 break;
never executed: break;
0
725 case
never executed: case QAccessible::WordBoundary:
QAccessible::WordBoundary:
never executed: case QAccessible::WordBoundary:
0
726 type = QTextBoundaryFinder::Word;-
727 break;
never executed: break;
0
728 case
never executed: case QAccessible::SentenceBoundary:
QAccessible::SentenceBoundary:
never executed: case QAccessible::SentenceBoundary:
0
729 type = QTextBoundaryFinder::Sentence;-
730 break;
never executed: break;
0
731 case
never executed: case QAccessible::LineBoundary:
QAccessible::LineBoundary:
never executed: case QAccessible::LineBoundary:
0
732 case
never executed: case QAccessible::ParagraphBoundary:
QAccessible::ParagraphBoundary:
never executed: case QAccessible::ParagraphBoundary:
0
733-
734 return
never executed: return textLineBoundary(0, txt, offset, startOffset, endOffset);
textLineBoundary(0, txt, offset, startOffset, endOffset);
never executed: return textLineBoundary(0, txt, offset, startOffset, endOffset);
0
735 case
never executed: case QAccessible::NoBoundary:
QAccessible::NoBoundary:
never executed: case QAccessible::NoBoundary:
0
736 *startOffset = 0;-
737 *endOffset = txt.length();-
738 return
never executed: return txt;
txt;
never executed: return txt;
0
739 default
never executed: default:
:
never executed: default:
0
740 do { ((!(false)) ? qt_assert_x("Q_UNREACHABLE()", "Q_UNREACHABLE was reached",__FILE__,2299) : qt_noop()); __builtin_unreachable(); } while (0);-
741 }
never executed: end of block
0
742-
743-
744-
745 QTextBoundaryFinder boundary(type, txt);-
746 boundary.setPosition(offset);-
747-
748 do {-
749 if ((
(boundary.boun...r::EndOfItem))Description
TRUEnever evaluated
FALSEnever evaluated
boundary.boundaryReasons() & (QTextBoundaryFinder::StartOfItem | QTextBoundaryFinder::EndOfItem))
(boundary.boun...r::EndOfItem))Description
TRUEnever evaluated
FALSEnever evaluated
)
0
750 break;
never executed: break;
0
751 }
never executed: end of block
while (boundary.toPreviousBoundary() > 0
boundary.toPre...Boundary() > 0Description
TRUEnever evaluated
FALSEnever evaluated
);
0
752 ((!(boundary.position() >= 0)) ? qt_assert("boundary.position() >= 0",__FILE__,2311) : qt_noop());-
753 *startOffset = boundary.position();-
754-
755 while (boundary.toNextBoundary() < txt.length()
boundary.toNex...< txt.length()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
756 if ((
(boundary.boun...r::EndOfItem))Description
TRUEnever evaluated
FALSEnever evaluated
boundary.boundaryReasons() & (QTextBoundaryFinder::StartOfItem | QTextBoundaryFinder::EndOfItem))
(boundary.boun...r::EndOfItem))Description
TRUEnever evaluated
FALSEnever evaluated
)
0
757 break;
never executed: break;
0
758 }
never executed: end of block
0
759 ((!(boundary.position() <= txt.length())) ? qt_assert("boundary.position() <= txt.length()",__FILE__,2318) : qt_noop());-
760 *endOffset = boundary.position();-
761-
762 return
never executed: return txt.mid(*startOffset, *endOffset - *startOffset);
txt.mid(*startOffset, *endOffset - *startOffset);
never executed: return txt.mid(*startOffset, *endOffset - *startOffset);
0
763}-
764QAccessibleEditableTextInterface::~QAccessibleEditableTextInterface()-
765{-
766-
767}-
768QAccessibleValueInterface::~QAccessibleValueInterface()-
769{-
770-
771}-
772QAccessibleImageInterface::~QAccessibleImageInterface()-
773{-
774-
775}-
776QAccessibleTableCellInterface::~QAccessibleTableCellInterface()-
777{-
778-
779}-
780QAccessibleTableInterface::~QAccessibleTableInterface()-
781{-
782-
783}-
784QAccessibleActionInterface::~QAccessibleActionInterface()-
785{-
786-
787}-
788struct QAccessibleActionStrings-
789{-
790 QAccessibleActionStrings() :-
791 pressAction(([]() -> QString { enum { Size = sizeof(u"" "Press")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Press" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }())),-
792 increaseAction(([]() -> QString { enum { Size = sizeof(u"" "Increase")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Increase" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }())),-
793 decreaseAction(([]() -> QString { enum { Size = sizeof(u"" "Decrease")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Decrease" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }())),-
794 showMenuAction(([]() -> QString { enum { Size = sizeof(u"" "ShowMenu")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "ShowMenu" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }())),-
795 setFocusAction(([]() -> QString { enum { Size = sizeof(u"" "SetFocus")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "SetFocus" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }())),-
796 toggleAction(([]() -> QString { enum { Size = sizeof(u"" "Toggle")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Toggle" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }())),-
797 scrollLeftAction(([]() -> QString { enum { Size = sizeof(u"" "Scroll Left")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Scroll Left" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }())),-
798 scrollRightAction(([]() -> QString { enum { Size = sizeof(u"" "Scroll Right")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Scroll Right" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }())),-
799 scrollUpAction(([]() -> QString { enum { Size = sizeof(u"" "Scroll Up")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Scroll Up" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }())),-
800 scrollDownAction(([]() -> QString { enum { Size = sizeof(u"" "Scroll Down")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Scroll Down" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }())),-
801 previousPageAction(([]() -> QString { enum { Size = sizeof(u"" "Previous Page")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Previous Page" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }())),-
802 nextPageAction(([]() -> QString { enum { Size = sizeof(u"" "Next Page")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Next Page" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()))-
803 {}
never executed: end of block
0
804-
805 const QString pressAction;-
806 const QString increaseAction;-
807 const QString decreaseAction;-
808 const QString showMenuAction;-
809 const QString setFocusAction;-
810 const QString toggleAction;-
811 const QString scrollLeftAction;-
812 const QString scrollRightAction;-
813 const QString scrollUpAction;-
814 const QString scrollDownAction;-
815 const QString previousPageAction;-
816 const QString nextPageAction;-
817-
818 QString localizedDescription(const QString &actionName)-
819 {-
820 if (actionName == pressAction
actionName == pressActionDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
821 return
never executed: return QAccessibleActionInterface::tr("Triggers the action");
QAccessibleActionInterface::tr("Triggers the action");
never executed: return QAccessibleActionInterface::tr("Triggers the action");
0
822 else if (actionName == increaseAction
actionName == increaseActionDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
823 return
never executed: return QAccessibleActionInterface::tr("Increase the value");
QAccessibleActionInterface::tr("Increase the value");
never executed: return QAccessibleActionInterface::tr("Increase the value");
0
824 else if (actionName == decreaseAction
actionName == decreaseActionDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
825 return
never executed: return QAccessibleActionInterface::tr("Decrease the value");
QAccessibleActionInterface::tr("Decrease the value");
never executed: return QAccessibleActionInterface::tr("Decrease the value");
0
826 else if (actionName == showMenuAction
actionName == showMenuActionDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
827 return
never executed: return QAccessibleActionInterface::tr("Shows the menu");
QAccessibleActionInterface::tr("Shows the menu");
never executed: return QAccessibleActionInterface::tr("Shows the menu");
0
828 else if (actionName == setFocusAction
actionName == setFocusActionDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
829 return
never executed: return QAccessibleActionInterface::tr("Sets the focus");
QAccessibleActionInterface::tr("Sets the focus");
never executed: return QAccessibleActionInterface::tr("Sets the focus");
0
830 else if (actionName == toggleAction
actionName == toggleActionDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
831 return
never executed: return QAccessibleActionInterface::tr("Toggles the state");
QAccessibleActionInterface::tr("Toggles the state");
never executed: return QAccessibleActionInterface::tr("Toggles the state");
0
832 else if (actionName == scrollLeftAction
actionName == scrollLeftActionDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
833 return
never executed: return QAccessibleActionInterface::tr("Scrolls to the left");
QAccessibleActionInterface::tr("Scrolls to the left");
never executed: return QAccessibleActionInterface::tr("Scrolls to the left");
0
834 else if (actionName == scrollRightAction
actionName == ...ollRightActionDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
835 return
never executed: return QAccessibleActionInterface::tr("Scrolls to the right");
QAccessibleActionInterface::tr("Scrolls to the right");
never executed: return QAccessibleActionInterface::tr("Scrolls to the right");
0
836 else if (actionName == scrollUpAction
actionName == scrollUpActionDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
837 return
never executed: return QAccessibleActionInterface::tr("Scrolls up");
QAccessibleActionInterface::tr("Scrolls up");
never executed: return QAccessibleActionInterface::tr("Scrolls up");
0
838 else if (actionName == scrollDownAction
actionName == scrollDownActionDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
839 return
never executed: return QAccessibleActionInterface::tr("Scrolls down");
QAccessibleActionInterface::tr("Scrolls down");
never executed: return QAccessibleActionInterface::tr("Scrolls down");
0
840 else if (actionName == previousPageAction
actionName == ...iousPageActionDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
841 return
never executed: return QAccessibleActionInterface::tr("Goes back a page");
QAccessibleActionInterface::tr("Goes back a page");
never executed: return QAccessibleActionInterface::tr("Goes back a page");
0
842 else if (actionName == nextPageAction
actionName == nextPageActionDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
843 return
never executed: return QAccessibleActionInterface::tr("Goes to the next page");
QAccessibleActionInterface::tr("Goes to the next page");
never executed: return QAccessibleActionInterface::tr("Goes to the next page");
0
844-
845-
846 return
never executed: return QString();
QString();
never executed: return QString();
0
847 }-
848};-
849-
850namespace { namespace Q_QGS_accessibleActionStrings { typedef QAccessibleActionStrings 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<QAccessibleActionStrings, Q_QGS_accessibleActionStrings::innerFunction, Q_QGS_accessibleActionStrings::guard> accessibleActionStrings;
0
851-
852QString QAccessibleActionInterface::localizedActionName(const QString &actionName) const-
853{-
854 return
never executed: return QAccessibleActionInterface::tr(QString(actionName).toLocal8Bit().constData());
QAccessibleActionInterface::tr(QString(actionName).toLocal8Bit().constData());
never executed: return QAccessibleActionInterface::tr(QString(actionName).toLocal8Bit().constData());
0
855}-
856-
857QString QAccessibleActionInterface::localizedActionDescription(const QString &actionName) const-
858{-
859 return
never executed: return accessibleActionStrings()->localizedDescription(actionName);
accessibleActionStrings()->localizedDescription(actionName);
never executed: return accessibleActionStrings()->localizedDescription(actionName);
0
860}-
861-
862-
863-
864-
865-
866const QString &QAccessibleActionInterface::pressAction()-
867{-
868 return
never executed: return accessibleActionStrings()->pressAction;
accessibleActionStrings()->pressAction;
never executed: return accessibleActionStrings()->pressAction;
0
869}-
870-
871-
872-
873-
874-
875const QString &QAccessibleActionInterface::increaseAction()-
876{-
877 return
never executed: return accessibleActionStrings()->increaseAction;
accessibleActionStrings()->increaseAction;
never executed: return accessibleActionStrings()->increaseAction;
0
878}-
879-
880-
881-
882-
883-
884const QString &QAccessibleActionInterface::decreaseAction()-
885{-
886 return
never executed: return accessibleActionStrings()->decreaseAction;
accessibleActionStrings()->decreaseAction;
never executed: return accessibleActionStrings()->decreaseAction;
0
887}-
888-
889-
890-
891-
892-
893const QString &QAccessibleActionInterface::showMenuAction()-
894{-
895 return
never executed: return accessibleActionStrings()->showMenuAction;
accessibleActionStrings()->showMenuAction;
never executed: return accessibleActionStrings()->showMenuAction;
0
896}-
897-
898-
899-
900-
901-
902const QString &QAccessibleActionInterface::setFocusAction()-
903{-
904 return
never executed: return accessibleActionStrings()->setFocusAction;
accessibleActionStrings()->setFocusAction;
never executed: return accessibleActionStrings()->setFocusAction;
0
905}-
906-
907-
908-
909-
910-
911const QString &QAccessibleActionInterface::toggleAction()-
912{-
913 return
never executed: return accessibleActionStrings()->toggleAction;
accessibleActionStrings()->toggleAction;
never executed: return accessibleActionStrings()->toggleAction;
0
914}-
915-
916-
917-
918-
919-
920QString QAccessibleActionInterface::scrollLeftAction()-
921{-
922 return
never executed: return accessibleActionStrings()->scrollLeftAction;
accessibleActionStrings()->scrollLeftAction;
never executed: return accessibleActionStrings()->scrollLeftAction;
0
923}-
924-
925-
926-
927-
928-
929QString QAccessibleActionInterface::scrollRightAction()-
930{-
931 return
never executed: return accessibleActionStrings()->scrollRightAction;
accessibleActionStrings()->scrollRightAction;
never executed: return accessibleActionStrings()->scrollRightAction;
0
932}-
933-
934-
935-
936-
937-
938QString QAccessibleActionInterface::scrollUpAction()-
939{-
940 return
never executed: return accessibleActionStrings()->scrollUpAction;
accessibleActionStrings()->scrollUpAction;
never executed: return accessibleActionStrings()->scrollUpAction;
0
941}-
942-
943-
944-
945-
946-
947QString QAccessibleActionInterface::scrollDownAction()-
948{-
949 return
never executed: return accessibleActionStrings()->scrollDownAction;
accessibleActionStrings()->scrollDownAction;
never executed: return accessibleActionStrings()->scrollDownAction;
0
950}-
951-
952-
953-
954-
955-
956QString QAccessibleActionInterface::previousPageAction()-
957{-
958 return
never executed: return accessibleActionStrings()->previousPageAction;
accessibleActionStrings()->previousPageAction;
never executed: return accessibleActionStrings()->previousPageAction;
0
959}-
960-
961-
962-
963-
964-
965QString QAccessibleActionInterface::nextPageAction()-
966{-
967 return
never executed: return accessibleActionStrings()->nextPageAction;
accessibleActionStrings()->nextPageAction;
never executed: return accessibleActionStrings()->nextPageAction;
0
968}-
969-
970-
971QString qAccessibleLocalizedActionDescription(const QString &actionName)-
972{-
973 return
never executed: return accessibleActionStrings()->localizedDescription(actionName);
accessibleActionStrings()->localizedDescription(actionName);
never executed: return accessibleActionStrings()->localizedDescription(actionName);
0
974}-
975-
976-
977-
978-
Switch to Source codePreprocessed file

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