OpenCoverage

atspiadaptor.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/platformsupport/linuxaccessibility/atspiadaptor.cpp
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2016 The Qt Company Ltd.-
4** Contact: https://www.qt.io/licensing/-
5**-
6** This file is part of the QtGui module of the Qt Toolkit.-
7**-
8** $QT_BEGIN_LICENSE:LGPL$-
9** Commercial License Usage-
10** Licensees holding valid commercial Qt licenses may use this file in-
11** accordance with the commercial license agreement provided with the-
12** Software or, alternatively, in accordance with the terms contained in-
13** a written agreement between you and The Qt Company. For licensing terms-
14** and conditions see https://www.qt.io/terms-conditions. For further-
15** information use the contact form at https://www.qt.io/contact-us.-
16**-
17** GNU Lesser General Public License Usage-
18** Alternatively, this file may be used under the terms of the GNU Lesser-
19** General Public License version 3 as published by the Free Software-
20** Foundation and appearing in the file LICENSE.LGPL3 included in the-
21** packaging of this file. Please review the following information to-
22** ensure the GNU Lesser General Public License version 3 requirements-
23** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.-
24**-
25** GNU General Public License Usage-
26** Alternatively, this file may be used under the terms of the GNU-
27** General Public License version 2.0 or (at your option) the GNU General-
28** Public license version 3 or any later version approved by the KDE Free-
29** Qt Foundation. The licenses are as published by the Free Software-
30** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3-
31** included in the packaging of this file. Please review the following-
32** information to ensure the GNU General Public License requirements will-
33** be met: https://www.gnu.org/licenses/gpl-2.0.html and-
34** https://www.gnu.org/licenses/gpl-3.0.html.-
35**-
36** $QT_END_LICENSE$-
37**-
38****************************************************************************/-
39-
40#include "atspiadaptor_p.h"-
41-
42#include <QtGui/qwindow.h>-
43#include <QtGui/qguiapplication.h>-
44#include <qdbusmessage.h>-
45#include <qdbusreply.h>-
46#include <qclipboard.h>-
47-
48#include <qdebug.h>-
49-
50#ifndef QT_NO_ACCESSIBILITY-
51#include "socket_interface.h"-
52#include "constant_mappings_p.h"-
53#include "../accessibility/qaccessiblebridgeutils_p.h"-
54-
55#include "application_p.h"-
56/*!-
57 \class AtSpiAdaptor-
58 \internal-
59-
60 \brief AtSpiAdaptor is the main class to forward between QAccessibleInterface and AT-SPI DBus-
61-
62 AtSpiAdaptor implements the functions specified in all at-spi interfaces.-
63 It sends notifications coming from Qt via dbus and listens to incoming dbus requests.-
64*/-
65-
66QT_BEGIN_NAMESPACE-
67-
68static bool isDebugging = false;-
69#define qAtspiDebug if (!::isDebugging); else qDebug-
70-
71AtSpiAdaptor::AtSpiAdaptor(DBusConnection *connection, QObject *parent)-
72 : QDBusVirtualObject(parent), m_dbus(connection)-
73 , sendFocus(0)-
74 , sendObject(0)-
75 , sendObject_active_descendant_changed(0)-
76 , sendObject_attributes_changed(0)-
77 , sendObject_bounds_changed(0)-
78 , sendObject_children_changed(0)-
79// , sendObject_children_changed_add(0)-
80// , sendObject_children_changed_remove(0)-
81 , sendObject_column_deleted(0)-
82 , sendObject_column_inserted(0)-
83 , sendObject_column_reordered(0)-
84 , sendObject_link_selected(0)-
85 , sendObject_model_changed(0)-
86 , sendObject_property_change(0)-
87 , sendObject_property_change_accessible_description(0)-
88 , sendObject_property_change_accessible_name(0)-
89 , sendObject_property_change_accessible_parent(0)-
90 , sendObject_property_change_accessible_role(0)-
91 , sendObject_property_change_accessible_table_caption(0)-
92 , sendObject_property_change_accessible_table_column_description(0)-
93 , sendObject_property_change_accessible_table_column_header(0)-
94 , sendObject_property_change_accessible_table_row_description(0)-
95 , sendObject_property_change_accessible_table_row_header(0)-
96 , sendObject_property_change_accessible_table_summary(0)-
97 , sendObject_property_change_accessible_value(0)-
98 , sendObject_row_deleted(0)-
99 , sendObject_row_inserted(0)-
100 , sendObject_row_reordered(0)-
101 , sendObject_selection_changed(0)-
102 , sendObject_state_changed(0)-
103 , sendObject_text_attributes_changed(0)-
104 , sendObject_text_bounds_changed(0)-
105 , sendObject_text_caret_moved(0)-
106 , sendObject_text_changed(0)-
107// , sendObject_text_changed_delete(0)-
108// , sendObject_text_changed_insert(0)-
109 , sendObject_text_selection_changed(0)-
110 , sendObject_value_changed(0)-
111 , sendObject_visible_data_changed(0)-
112 , sendWindow(0)-
113 , sendWindow_activate(0)-
114 , sendWindow_close(0)-
115 , sendWindow_create(0)-
116 , sendWindow_deactivate(0)-
117// , sendWindow_desktop_create(0)-
118// , sendWindow_desktop_destroy(0)-
119 , sendWindow_lower(0)-
120 , sendWindow_maximize(0)-
121 , sendWindow_minimize(0)-
122 , sendWindow_move(0)-
123 , sendWindow_raise(0)-
124 , sendWindow_reparent(0)-
125 , sendWindow_resize(0)-
126 , sendWindow_restore(0)-
127 , sendWindow_restyle(0)-
128 , sendWindow_shade(0)-
129 , sendWindow_unshade(0)-
130{-
131 ::isDebugging = qEnvironmentVariableIsSet("QT_DEBUG_ACCESSIBILITY");-
132-
133 m_applicationAdaptor = new QSpiApplicationAdaptor(m_dbus->connection(), this);-
134 connect(m_applicationAdaptor, SIGNAL(windowActivated(QObject*,bool)), this, SLOT(windowActivated(QObject*,bool)));-
135-
136 updateEventListeners();-
137 bool success = m_dbus->connection().connect(QLatin1String("org.a11y.atspi.Registry"), QLatin1String("/org/a11y/atspi/registry"),-
138 QLatin1String("org.a11y.atspi.Registry"), QLatin1String("EventListenerRegistered"), this,-
139 SLOT(eventListenerRegistered(QString,QString)));-
140 success = success && m_dbus->connection().connect(QLatin1String("org.a11y.atspi.Registry"), QLatin1String("/org/a11y/atspi/registry"),
successDescription
TRUEnever evaluated
FALSEnever evaluated
m_dbus->connec...__ ":" "142"))Description
TRUEnever evaluated
FALSEnever evaluated
0
141 QLatin1String("org.a11y.atspi.Registry"), QLatin1String("EventListenerDeregistered"), this,
m_dbus->connec...__ ":" "142"))Description
TRUEnever evaluated
FALSEnever evaluated
0
142 SLOT(eventListenerDeregistered(QString,QString)));
m_dbus->connec...__ ":" "142"))Description
TRUEnever evaluated
FALSEnever evaluated
0
143#ifdef QT_ATSPI_DEBUG-
144 qAtspiDebug() << "Registered event listener change listener: " << success;-
145#endif-
146}
never executed: end of block
0
147-
148AtSpiAdaptor::~AtSpiAdaptor()-
149{-
150}-
151-
152/*!-
153 Provide DBus introspection.-
154 */-
155QString AtSpiAdaptor::introspect(const QString &path) const-
156{-
157 static const QLatin1String accessibleIntrospection(-
158 " <interface name=\"org.a11y.atspi.Accessible\">\n"-
159 " <property access=\"read\" type=\"s\" name=\"Name\"/>\n"-
160 " <property access=\"read\" type=\"s\" name=\"Description\"/>\n"-
161 " <property access=\"read\" type=\"(so)\" name=\"Parent\">\n"-
162 " <annotation value=\"QSpiObjectReference\" name=\"org.qtproject.QtDBus.QtTypeName\"/>\n"-
163 " </property>\n"-
164 " <property access=\"read\" type=\"i\" name=\"ChildCount\"/>\n"-
165 " <method name=\"GetChildAtIndex\">\n"-
166 " <arg direction=\"in\" type=\"i\" name=\"index\"/>\n"-
167 " <arg direction=\"out\" type=\"(so)\"/>\n"-
168 " <annotation value=\"QSpiObjectReference\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n"-
169 " </method>\n"-
170 " <method name=\"GetChildren\">\n"-
171 " <arg direction=\"out\" type=\"a(so)\"/>\n"-
172 " <annotation value=\"QSpiObjectReferenceArray\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n"-
173 " </method>\n"-
174 " <method name=\"GetIndexInParent\">\n"-
175 " <arg direction=\"out\" type=\"i\"/>\n"-
176 " </method>\n"-
177 " <method name=\"GetRelationSet\">\n"-
178 " <arg direction=\"out\" type=\"a(ua(so))\"/>\n"-
179 " <annotation value=\"QSpiRelationArray\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n"-
180 " </method>\n"-
181 " <method name=\"GetRole\">\n"-
182 " <arg direction=\"out\" type=\"u\"/>\n"-
183 " </method>\n"-
184 " <method name=\"GetRoleName\">\n"-
185 " <arg direction=\"out\" type=\"s\"/>\n"-
186 " </method>\n"-
187 " <method name=\"GetLocalizedRoleName\">\n"-
188 " <arg direction=\"out\" type=\"s\"/>\n"-
189 " </method>\n"-
190 " <method name=\"GetState\">\n"-
191 " <arg direction=\"out\" type=\"au\"/>\n"-
192 " <annotation value=\"QSpiUIntList\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n"-
193 " </method>\n"-
194 " <method name=\"GetAttributes\">\n"-
195 " <arg direction=\"out\" type=\"a{ss}\"/>\n"-
196 " <annotation value=\"QSpiAttributeSet\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n"-
197 " </method>\n"-
198 " <method name=\"GetApplication\">\n"-
199 " <arg direction=\"out\" type=\"(so)\"/>\n"-
200 " <annotation value=\"QSpiObjectReference\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n"-
201 " </method>\n"-
202 " </interface>\n"-
203 );-
204-
205 static const QLatin1String actionIntrospection(-
206 " <interface name=\"org.a11y.atspi.Action\">\n"-
207 " <property access=\"read\" type=\"i\" name=\"NActions\"/>\n"-
208 " <method name=\"GetDescription\">\n"-
209 " <arg direction=\"in\" type=\"i\" name=\"index\"/>\n"-
210 " <arg direction=\"out\" type=\"s\"/>\n"-
211 " </method>\n"-
212 " <method name=\"GetName\">\n"-
213 " <arg direction=\"in\" type=\"i\" name=\"index\"/>\n"-
214 " <arg direction=\"out\" type=\"s\"/>\n"-
215 " </method>\n"-
216 " <method name=\"GetKeyBinding\">\n"-
217 " <arg direction=\"in\" type=\"i\" name=\"index\"/>\n"-
218 " <arg direction=\"out\" type=\"s\"/>\n"-
219 " </method>\n"-
220 " <method name=\"GetActions\">\n"-
221 " <arg direction=\"out\" type=\"a(sss)\" name=\"index\"/>\n"-
222 " <annotation value=\"QSpiActionArray\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n"-
223 " </method>\n"-
224 " <method name=\"DoAction\">\n"-
225 " <arg direction=\"in\" type=\"i\" name=\"index\"/>\n"-
226 " <arg direction=\"out\" type=\"b\"/>\n"-
227 " </method>\n"-
228 " </interface>\n"-
229 );-
230-
231 static const QLatin1String applicationIntrospection(-
232 " <interface name=\"org.a11y.atspi.Application\">\n"-
233 " <property access=\"read\" type=\"s\" name=\"ToolkitName\"/>\n"-
234 " <property access=\"read\" type=\"s\" name=\"Version\"/>\n"-
235 " <property access=\"readwrite\" type=\"i\" name=\"Id\"/>\n"-
236 " <method name=\"GetLocale\">\n"-
237 " <arg direction=\"in\" type=\"u\" name=\"lctype\"/>\n"-
238 " <arg direction=\"out\" type=\"s\"/>\n"-
239 " </method>\n"-
240 " <method name=\"GetApplicationBusAddress\">\n"-
241 " <arg direction=\"out\" type=\"s\" name=\"address\"/>\n"-
242 " </method>\n"-
243 " </interface>\n"-
244 );-
245-
246 static const QLatin1String componentIntrospection(-
247 " <interface name=\"org.a11y.atspi.Component\">\n"-
248 " <method name=\"Contains\">\n"-
249 " <arg direction=\"in\" type=\"i\" name=\"x\"/>\n"-
250 " <arg direction=\"in\" type=\"i\" name=\"y\"/>\n"-
251 " <arg direction=\"in\" type=\"u\" name=\"coord_type\"/>\n"-
252 " <arg direction=\"out\" type=\"b\"/>\n"-
253 " </method>\n"-
254 " <method name=\"GetAccessibleAtPoint\">\n"-
255 " <arg direction=\"in\" type=\"i\" name=\"x\"/>\n"-
256 " <arg direction=\"in\" type=\"i\" name=\"y\"/>\n"-
257 " <arg direction=\"in\" type=\"u\" name=\"coord_type\"/>\n"-
258 " <arg direction=\"out\" type=\"(so)\"/>\n"-
259 " <annotation value=\"QSpiObjectReference\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n"-
260 " </method>\n"-
261 " <method name=\"GetExtents\">\n"-
262 " <arg direction=\"in\" type=\"u\" name=\"coord_type\"/>\n"-
263 " <arg direction=\"out\" type=\"(iiii)\"/>\n"-
264 " <annotation value=\"QSpiRect\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n"-
265 " </method>\n"-
266 " <method name=\"GetPosition\">\n"-
267 " <arg direction=\"in\" type=\"u\" name=\"coord_type\"/>\n"-
268 " <arg direction=\"out\" type=\"i\" name=\"x\"/>\n"-
269 " <arg direction=\"out\" type=\"i\" name=\"y\"/>\n"-
270 " </method>\n"-
271 " <method name=\"GetSize\">\n"-
272 " <arg direction=\"out\" type=\"i\" name=\"width\"/>\n"-
273 " <arg direction=\"out\" type=\"i\" name=\"height\"/>\n"-
274 " </method>\n"-
275 " <method name=\"GetLayer\">\n"-
276 " <arg direction=\"out\" type=\"u\"/>\n"-
277 " </method>\n"-
278 " <method name=\"GetMDIZOrder\">\n"-
279 " <arg direction=\"out\" type=\"n\"/>\n"-
280 " </method>\n"-
281 " <method name=\"GrabFocus\">\n"-
282 " <arg direction=\"out\" type=\"b\"/>\n"-
283 " </method>\n"-
284 " <method name=\"GetAlpha\">\n"-
285 " <arg direction=\"out\" type=\"d\"/>\n"-
286 " </method>\n"-
287 " <method name=\"SetExtents\">\n"-
288 " <arg direction=\"in\" type=\"i\" name=\"x\"/>\n"-
289 " <arg direction=\"in\" type=\"i\" name=\"y\"/>\n"-
290 " <arg direction=\"in\" type=\"i\" name=\"width\"/>\n"-
291 " <arg direction=\"in\" type=\"i\" name=\"height\"/>\n"-
292 " <arg direction=\"in\" type=\"u\" name=\"coord_type\"/>\n"-
293 " <arg direction=\"out\" type=\"b\"/>\n"-
294 " </method>\n"-
295 " <method name=\"SetPosition\">\n"-
296 " <arg direction=\"in\" type=\"i\" name=\"x\"/>\n"-
297 " <arg direction=\"in\" type=\"i\" name=\"y\"/>\n"-
298 " <arg direction=\"in\" type=\"u\" name=\"coord_type\"/>\n"-
299 " <arg direction=\"out\" type=\"b\"/>\n"-
300 " </method>\n"-
301 " <method name=\"SetSize\">\n"-
302 " <arg direction=\"in\" type=\"i\" name=\"width\"/>\n"-
303 " <arg direction=\"in\" type=\"i\" name=\"height\"/>\n"-
304 " <arg direction=\"out\" type=\"b\"/>\n"-
305 " </method>\n"-
306 " </interface>\n"-
307 );-
308-
309 static const QLatin1String editableTextIntrospection(-
310 " <interface name=\"org.a11y.atspi.EditableText\">\n"-
311 " <method name=\"SetTextContents\">\n"-
312 " <arg direction=\"in\" type=\"s\" name=\"newContents\"/>\n"-
313 " <arg direction=\"out\" type=\"b\"/>\n"-
314 " </method>\n"-
315 " <method name=\"InsertText\">\n"-
316 " <arg direction=\"in\" type=\"i\" name=\"position\"/>\n"-
317 " <arg direction=\"in\" type=\"s\" name=\"text\"/>\n"-
318 " <arg direction=\"in\" type=\"i\" name=\"length\"/>\n"-
319 " <arg direction=\"out\" type=\"b\"/>\n"-
320 " </method>\n"-
321 " <method name=\"CopyText\">\n"-
322 " <arg direction=\"in\" type=\"i\" name=\"startPos\"/>\n"-
323 " <arg direction=\"in\" type=\"i\" name=\"endPos\"/>\n"-
324 " </method>\n"-
325 " <method name=\"CutText\">\n"-
326 " <arg direction=\"in\" type=\"i\" name=\"startPos\"/>\n"-
327 " <arg direction=\"in\" type=\"i\" name=\"endPos\"/>\n"-
328 " <arg direction=\"out\" type=\"b\"/>\n"-
329 " </method>\n"-
330 " <method name=\"DeleteText\">\n"-
331 " <arg direction=\"in\" type=\"i\" name=\"startPos\"/>\n"-
332 " <arg direction=\"in\" type=\"i\" name=\"endPos\"/>\n"-
333 " <arg direction=\"out\" type=\"b\"/>\n"-
334 " </method>\n"-
335 " <method name=\"PasteText\">\n"-
336 " <arg direction=\"in\" type=\"i\" name=\"position\"/>\n"-
337 " <arg direction=\"out\" type=\"b\"/>\n"-
338 " </method>\n"-
339 " </interface>\n"-
340 );-
341-
342 static const QLatin1String tableIntrospection(-
343 " <interface name=\"org.a11y.atspi.Table\">\n"-
344 " <property access=\"read\" type=\"i\" name=\"NRows\"/>\n"-
345 " <property access=\"read\" type=\"i\" name=\"NColumns\"/>\n"-
346 " <property access=\"read\" type=\"(so)\" name=\"Caption\">\n"-
347 " <annotation value=\"QSpiObjectReference\" name=\"org.qtproject.QtDBus.QtTypeName\"/>\n"-
348 " </property>\n"-
349 " <property access=\"read\" type=\"(so)\" name=\"Summary\">\n"-
350 " <annotation value=\"QSpiObjectReference\" name=\"org.qtproject.QtDBus.QtTypeName\"/>\n"-
351 " </property>\n"-
352 " <property access=\"read\" type=\"i\" name=\"NSelectedRows\"/>\n"-
353 " <property access=\"read\" type=\"i\" name=\"NSelectedColumns\"/>\n"-
354 " <method name=\"GetAccessibleAt\">\n"-
355 " <arg direction=\"in\" type=\"i\" name=\"row\"/>\n"-
356 " <arg direction=\"in\" type=\"i\" name=\"column\"/>\n"-
357 " <arg direction=\"out\" type=\"(so)\"/>\n"-
358 " <annotation value=\"QSpiObjectReference\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n"-
359 " </method>\n"-
360 " <method name=\"GetIndexAt\">\n"-
361 " <arg direction=\"in\" type=\"i\" name=\"row\"/>\n"-
362 " <arg direction=\"in\" type=\"i\" name=\"column\"/>\n"-
363 " <arg direction=\"out\" type=\"i\"/>\n"-
364 " </method>\n"-
365 " <method name=\"GetRowAtIndex\">\n"-
366 " <arg direction=\"in\" type=\"i\" name=\"index\"/>\n"-
367 " <arg direction=\"out\" type=\"i\"/>\n"-
368 " </method>\n"-
369 " <method name=\"GetColumnAtIndex\">\n"-
370 " <arg direction=\"in\" type=\"i\" name=\"index\"/>\n"-
371 " <arg direction=\"out\" type=\"i\"/>\n"-
372 " </method>\n"-
373 " <method name=\"GetRowDescription\">\n"-
374 " <arg direction=\"in\" type=\"i\" name=\"row\"/>\n"-
375 " <arg direction=\"out\" type=\"s\"/>\n"-
376 " </method>\n"-
377 " <method name=\"GetColumnDescription\">\n"-
378 " <arg direction=\"in\" type=\"i\" name=\"column\"/>\n"-
379 " <arg direction=\"out\" type=\"s\"/>\n"-
380 " </method>\n"-
381 " <method name=\"GetRowExtentAt\">\n"-
382 " <arg direction=\"in\" type=\"i\" name=\"row\"/>\n"-
383 " <arg direction=\"in\" type=\"i\" name=\"column\"/>\n"-
384 " <arg direction=\"out\" type=\"i\"/>\n"-
385 " </method>\n"-
386 " <method name=\"GetColumnExtentAt\">\n"-
387 " <arg direction=\"in\" type=\"i\" name=\"row\"/>\n"-
388 " <arg direction=\"in\" type=\"i\" name=\"column\"/>\n"-
389 " <arg direction=\"out\" type=\"i\"/>\n"-
390 " </method>\n"-
391 " <method name=\"GetRowHeader\">\n"-
392 " <arg direction=\"in\" type=\"i\" name=\"row\"/>\n"-
393 " <arg direction=\"out\" type=\"(so)\"/>\n"-
394 " <annotation value=\"QSpiObjectReference\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n"-
395 " </method>\n"-
396 " <method name=\"GetColumnHeader\">\n"-
397 " <arg direction=\"in\" type=\"i\" name=\"column\"/>\n"-
398 " <arg direction=\"out\" type=\"(so)\"/>\n"-
399 " <annotation value=\"QSpiObjectReference\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n"-
400 " </method>\n"-
401 " <method name=\"GetSelectedRows\">\n"-
402 " <arg direction=\"out\" type=\"ai\"/>\n"-
403 " <annotation value=\"QSpiIntList\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n"-
404 " </method>\n"-
405 " <method name=\"GetSelectedColumns\">\n"-
406 " <arg direction=\"out\" type=\"ai\"/>\n"-
407 " <annotation value=\"QSpiIntList\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n"-
408 " </method>\n"-
409 " <method name=\"IsRowSelected\">\n"-
410 " <arg direction=\"in\" type=\"i\" name=\"row\"/>\n"-
411 " <arg direction=\"out\" type=\"b\"/>\n"-
412 " </method>\n"-
413 " <method name=\"IsColumnSelected\">\n"-
414 " <arg direction=\"in\" type=\"i\" name=\"column\"/>\n"-
415 " <arg direction=\"out\" type=\"b\"/>\n"-
416 " </method>\n"-
417 " <method name=\"IsSelected\">\n"-
418 " <arg direction=\"in\" type=\"i\" name=\"row\"/>\n"-
419 " <arg direction=\"in\" type=\"i\" name=\"column\"/>\n"-
420 " <arg direction=\"out\" type=\"b\"/>\n"-
421 " </method>\n"-
422 " <method name=\"AddRowSelection\">\n"-
423 " <arg direction=\"in\" type=\"i\" name=\"row\"/>\n"-
424 " <arg direction=\"out\" type=\"b\"/>\n"-
425 " </method>\n"-
426 " <method name=\"AddColumnSelection\">\n"-
427 " <arg direction=\"in\" type=\"i\" name=\"column\"/>\n"-
428 " <arg direction=\"out\" type=\"b\"/>\n"-
429 " </method>\n"-
430 " <method name=\"RemoveRowSelection\">\n"-
431 " <arg direction=\"in\" type=\"i\" name=\"row\"/>\n"-
432 " <arg direction=\"out\" type=\"b\"/>\n"-
433 " </method>\n"-
434 " <method name=\"RemoveColumnSelection\">\n"-
435 " <arg direction=\"in\" type=\"i\" name=\"column\"/>\n"-
436 " <arg direction=\"out\" type=\"b\"/>\n"-
437 " </method>\n"-
438 " <method name=\"GetRowColumnExtentsAtIndex\">\n"-
439 " <arg direction=\"in\" type=\"i\" name=\"index\"/>\n"-
440 " <arg direction=\"out\" type=\"b\"/>\n"-
441 " <arg direction=\"out\" type=\"i\" name=\"row\"/>\n"-
442 " <arg direction=\"out\" type=\"i\" name=\"col\"/>\n"-
443 " <arg direction=\"out\" type=\"i\" name=\"row_extents\"/>\n"-
444 " <arg direction=\"out\" type=\"i\" name=\"col_extents\"/>\n"-
445 " <arg direction=\"out\" type=\"b\" name=\"is_selected\"/>\n"-
446 " </method>\n"-
447 " </interface>\n"-
448 );-
449-
450 static const QLatin1String textIntrospection(-
451 " <interface name=\"org.a11y.atspi.Text\">\n"-
452 " <property access=\"read\" type=\"i\" name=\"CharacterCount\"/>\n"-
453 " <property access=\"read\" type=\"i\" name=\"CaretOffset\"/>\n"-
454 " <method name=\"GetText\">\n"-
455 " <arg direction=\"in\" type=\"i\" name=\"startOffset\"/>\n"-
456 " <arg direction=\"in\" type=\"i\" name=\"endOffset\"/>\n"-
457 " <arg direction=\"out\" type=\"s\"/>\n"-
458 " </method>\n"-
459 " <method name=\"SetCaretOffset\">\n"-
460 " <arg direction=\"in\" type=\"i\" name=\"offset\"/>\n"-
461 " <arg direction=\"out\" type=\"b\"/>\n"-
462 " </method>\n"-
463 " <method name=\"GetTextBeforeOffset\">\n"-
464 " <arg direction=\"in\" type=\"i\" name=\"offset\"/>\n"-
465 " <arg direction=\"in\" type=\"u\" name=\"type\"/>\n"-
466 " <arg direction=\"out\" type=\"s\"/>\n"-
467 " <arg direction=\"out\" type=\"i\" name=\"startOffset\"/>\n"-
468 " <arg direction=\"out\" type=\"i\" name=\"endOffset\"/>\n"-
469 " </method>\n"-
470 " <method name=\"GetTextAtOffset\">\n"-
471 " <arg direction=\"in\" type=\"i\" name=\"offset\"/>\n"-
472 " <arg direction=\"in\" type=\"u\" name=\"type\"/>\n"-
473 " <arg direction=\"out\" type=\"s\"/>\n"-
474 " <arg direction=\"out\" type=\"i\" name=\"startOffset\"/>\n"-
475 " <arg direction=\"out\" type=\"i\" name=\"endOffset\"/>\n"-
476 " </method>\n"-
477 " <method name=\"GetTextAfterOffset\">\n"-
478 " <arg direction=\"in\" type=\"i\" name=\"offset\"/>\n"-
479 " <arg direction=\"in\" type=\"u\" name=\"type\"/>\n"-
480 " <arg direction=\"out\" type=\"s\"/>\n"-
481 " <arg direction=\"out\" type=\"i\" name=\"startOffset\"/>\n"-
482 " <arg direction=\"out\" type=\"i\" name=\"endOffset\"/>\n"-
483 " </method>\n"-
484 " <method name=\"GetCharacterAtOffset\">\n"-
485 " <arg direction=\"in\" type=\"i\" name=\"offset\"/>\n"-
486 " <arg direction=\"out\" type=\"i\"/>\n"-
487 " </method>\n"-
488 " <method name=\"GetAttributeValue\">\n"-
489 " <arg direction=\"in\" type=\"i\" name=\"offset\"/>\n"-
490 " <arg direction=\"in\" type=\"s\" name=\"attributeName\"/>\n"-
491 " <arg direction=\"out\" type=\"s\"/>\n"-
492 " <arg direction=\"out\" type=\"i\" name=\"startOffset\"/>\n"-
493 " <arg direction=\"out\" type=\"i\" name=\"endOffset\"/>\n"-
494 " <arg direction=\"out\" type=\"b\" name=\"defined\"/>\n"-
495 " </method>\n"-
496 " <method name=\"GetAttributes\">\n"-
497 " <arg direction=\"in\" type=\"i\" name=\"offset\"/>\n"-
498 " <arg direction=\"out\" type=\"a{ss}\"/>\n"-
499 " <arg direction=\"out\" type=\"i\" name=\"startOffset\"/>\n"-
500 " <arg direction=\"out\" type=\"i\" name=\"endOffset\"/>\n"-
501 " <annotation value=\"QSpiAttributeSet\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n"-
502 " </method>\n"-
503 " <method name=\"GetDefaultAttributes\">\n"-
504 " <arg direction=\"out\" type=\"a{ss}\"/>\n"-
505 " <annotation value=\"QSpiAttributeSet\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n"-
506 " </method>\n"-
507 " <method name=\"GetCharacterExtents\">\n"-
508 " <arg direction=\"in\" type=\"i\" name=\"offset\"/>\n"-
509 " <arg direction=\"out\" type=\"i\" name=\"x\"/>\n"-
510 " <arg direction=\"out\" type=\"i\" name=\"y\"/>\n"-
511 " <arg direction=\"out\" type=\"i\" name=\"width\"/>\n"-
512 " <arg direction=\"out\" type=\"i\" name=\"height\"/>\n"-
513 " <arg direction=\"in\" type=\"u\" name=\"coordType\"/>\n"-
514 " </method>\n"-
515 " <method name=\"GetOffsetAtPoint\">\n"-
516 " <arg direction=\"in\" type=\"i\" name=\"x\"/>\n"-
517 " <arg direction=\"in\" type=\"i\" name=\"y\"/>\n"-
518 " <arg direction=\"in\" type=\"u\" name=\"coordType\"/>\n"-
519 " <arg direction=\"out\" type=\"i\"/>\n"-
520 " </method>\n"-
521 " <method name=\"GetNSelections\">\n"-
522 " <arg direction=\"out\" type=\"i\"/>\n"-
523 " <method name=\"GetSelection\">\n"-
524 " <arg direction=\"in\" type=\"i\" name=\"selectionNum\"/>\n"-
525 " <arg direction=\"out\" type=\"i\" name=\"startOffset\"/>\n"-
526 " <arg direction=\"out\" type=\"i\" name=\"endOffset\"/>\n"-
527 " </method>\n"-
528 " <method name=\"AddSelection\">\n"-
529 " <arg direction=\"in\" type=\"i\" name=\"startOffset\"/>\n"-
530 " <arg direction=\"in\" type=\"i\" name=\"endOffset\"/>\n"-
531 " <arg direction=\"out\" type=\"b\"/>\n"-
532 " </method>\n"-
533 " <method name=\"RemoveSelection\">\n"-
534 " <arg direction=\"in\" type=\"i\" name=\"selectionNum\"/>\n"-
535 " <arg direction=\"out\" type=\"b\"/>\n"-
536 " </method>\n"-
537 " <method name=\"SetSelection\">\n"-
538 " <arg direction=\"in\" type=\"i\" name=\"selectionNum\"/>\n"-
539 " <arg direction=\"in\" type=\"i\" name=\"startOffset\"/>\n"-
540 " <arg direction=\"in\" type=\"i\" name=\"endOffset\"/>\n"-
541 " <arg direction=\"out\" type=\"b\"/>\n"-
542 " </method>\n"-
543 " <method name=\"GetRangeExtents\">\n"-
544 " <arg direction=\"in\" type=\"i\" name=\"startOffset\"/>\n"-
545 " <arg direction=\"in\" type=\"i\" name=\"endOffset\"/>\n"-
546 " <arg direction=\"out\" type=\"i\" name=\"x\"/>\n"-
547 " <arg direction=\"out\" type=\"i\" name=\"y\"/>\n"-
548 " <arg direction=\"out\" type=\"i\" name=\"width\"/>\n"-
549 " <arg direction=\"out\" type=\"i\" name=\"height\"/>\n"-
550 " <arg direction=\"in\" type=\"u\" name=\"coordType\"/>\n"-
551 " </method>\n"-
552 " <method name=\"GetBoundedRanges\">\n"-
553 " <arg direction=\"in\" type=\"i\" name=\"x\"/>\n"-
554 " <arg direction=\"in\" type=\"i\" name=\"y\"/>\n"-
555 " <arg direction=\"in\" type=\"i\" name=\"width\"/>\n"-
556 " <arg direction=\"in\" type=\"i\" name=\"height\"/>\n"-
557 " <arg direction=\"in\" type=\"u\" name=\"coordType\"/>\n"-
558 " <arg direction=\"in\" type=\"u\" name=\"xClipType\"/>\n"-
559 " <arg direction=\"in\" type=\"u\" name=\"yClipType\"/>\n"-
560 " <arg direction=\"out\" type=\"a(iisv)\"/>\n"-
561 " <annotation value=\"QSpiRangeList\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n"-
562 " </method>\n"-
563 " <method name=\"GetAttributeRun\">\n"-
564 " <arg direction=\"in\" type=\"i\" name=\"offset\"/>\n"-
565 " <arg direction=\"in\" type=\"b\" name=\"includeDefaults\"/>\n"-
566 " <arg direction=\"out\" type=\"a{ss}\"/>\n"-
567 " <arg direction=\"out\" type=\"i\" name=\"startOffset\"/>\n"-
568 " <arg direction=\"out\" type=\"i\" name=\"endOffset\"/>\n"-
569 " <annotation value=\"QSpiAttributeSet\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n"-
570 " </method>\n"-
571 " <method name=\"GetDefaultAttributeSet\">\n"-
572 " <arg direction=\"out\" type=\"a{ss}\"/>\n"-
573 " <annotation value=\"QSpiAttributeSet\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n"-
574 " </method>\n"-
575 " </interface>\n"-
576 );-
577-
578 static const QLatin1String valueIntrospection(-
579 " <interface name=\"org.a11y.atspi.Value\">\n"-
580 " <property access=\"read\" type=\"d\" name=\"MinimumValue\"/>\n"-
581 " <property access=\"read\" type=\"d\" name=\"MaximumValue\"/>\n"-
582 " <property access=\"read\" type=\"d\" name=\"MinimumIncrement\"/>\n"-
583 " <property access=\"readwrite\" type=\"d\" name=\"CurrentValue\"/>\n"-
584 " <method name=\"SetCurrentValue\">\n"-
585 " <arg direction=\"in\" type=\"d\" name=\"value\"/>\n"-
586 " </method>\n"-
587 " </interface>\n"-
588 );-
589-
590 QAccessibleInterface * interface = interfaceFromPath(path);-
591 if (!interface) {
!interfaceDescription
TRUEnever evaluated
FALSEnever evaluated
0
592 qAtspiDebug() << "WARNING Qt AtSpiAdaptor: Could not find accessible on path: " << path;
never executed: ;
never executed: QMessageLogger(__FILE__, 592, __PRETTY_FUNCTION__).debug() << "WARNING Qt AtSpiAdaptor: Could not find accessible on path: " << path;
!::isDebuggingDescription
TRUEnever evaluated
FALSEnever evaluated
0
593 return QString();
never executed: return QString();
0
594 }-
595-
596 QStringList interfaces = accessibleInterfaces(interface);-
597-
598 QString xml;-
599 xml.append(accessibleIntrospection);-
600-
601 if (interfaces.contains(QLatin1String(ATSPI_DBUS_INTERFACE_COMPONENT)))
interfaces.con...i.Component"))Description
TRUEnever evaluated
FALSEnever evaluated
0
602 xml.append(componentIntrospection);
never executed: xml.append(componentIntrospection);
0
603 if (interfaces.contains(QLatin1String(ATSPI_DBUS_INTERFACE_TEXT)))
interfaces.con....atspi.Text"))Description
TRUEnever evaluated
FALSEnever evaluated
0
604 xml.append(textIntrospection);
never executed: xml.append(textIntrospection);
0
605 if (interfaces.contains(QLatin1String(ATSPI_DBUS_INTERFACE_EDITABLE_TEXT)))
interfaces.con...ditableText"))Description
TRUEnever evaluated
FALSEnever evaluated
0
606 xml.append(editableTextIntrospection);
never executed: xml.append(editableTextIntrospection);
0
607 if (interfaces.contains(QLatin1String(ATSPI_DBUS_INTERFACE_ACTION)))
interfaces.con...tspi.Action"))Description
TRUEnever evaluated
FALSEnever evaluated
0
608 xml.append(actionIntrospection);
never executed: xml.append(actionIntrospection);
0
609 if (interfaces.contains(QLatin1String(ATSPI_DBUS_INTERFACE_TABLE)))
interfaces.con...atspi.Table"))Description
TRUEnever evaluated
FALSEnever evaluated
0
610 xml.append(tableIntrospection);
never executed: xml.append(tableIntrospection);
0
611 if (interfaces.contains(QLatin1String(ATSPI_DBUS_INTERFACE_VALUE)))
interfaces.con...atspi.Value"))Description
TRUEnever evaluated
FALSEnever evaluated
0
612 xml.append(valueIntrospection);
never executed: xml.append(valueIntrospection);
0
613 if (path == QLatin1String(QSPI_OBJECT_PATH_ROOT))
path == QLatin...ible/" "root")Description
TRUEnever evaluated
FALSEnever evaluated
0
614 xml.append(applicationIntrospection);
never executed: xml.append(applicationIntrospection);
0
615-
616 return xml;
never executed: return xml;
0
617}-
618-
619void AtSpiAdaptor::setBitFlag(const QString &flag)-
620{-
621 Q_ASSERT(flag.size());-
622-
623 // assume we don't get nonsense - look at first letter only-
624 switch (flag.at(0).toLower().toLatin1()) {-
625 case 'o': {
never executed: case 'o':
0
626 if (flag.size() <= 8) { // Object::
flag.size() <= 8Description
TRUEnever evaluated
FALSEnever evaluated
0
627 sendObject = 1;-
628 } else { // Object:Foo:Bar
never executed: end of block
0
629 QString right = flag.mid(7);-
630 if (false) {
dead code: { }
-
631 } else if (right.startsWith(QLatin1String("ActiveDescendantChanged"))) {
right.startsWi...dantChanged"))Description
TRUEnever evaluated
FALSEnever evaluated
dead code: { }
-
632 sendObject_active_descendant_changed = 1;-
633 } else if (right.startsWith(QLatin1String("AttributesChanged"))) {
never executed: end of block
right.startsWi...utesChanged"))Description
TRUEnever evaluated
FALSEnever evaluated
0
634 sendObject_attributes_changed = 1;-
635 } else if (right.startsWith(QLatin1String("BoundsChanged"))) {
never executed: end of block
right.startsWi...undsChanged"))Description
TRUEnever evaluated
FALSEnever evaluated
0
636 sendObject_bounds_changed = 1;-
637 } else if (right.startsWith(QLatin1String("ChildrenChanged"))) {
never executed: end of block
right.startsWi...drenChanged"))Description
TRUEnever evaluated
FALSEnever evaluated
0
638 sendObject_children_changed = 1;-
639 } else if (right.startsWith(QLatin1String("ColumnDeleted"))) {
never executed: end of block
right.startsWi...lumnDeleted"))Description
TRUEnever evaluated
FALSEnever evaluated
0
640 sendObject_column_deleted = 1;-
641 } else if (right.startsWith(QLatin1String("ColumnInserted"))) {
never executed: end of block
right.startsWi...umnInserted"))Description
TRUEnever evaluated
FALSEnever evaluated
0
642 sendObject_column_inserted = 1;-
643 } else if (right.startsWith(QLatin1String("ColumnReordered"))) {
never executed: end of block
right.startsWi...mnReordered"))Description
TRUEnever evaluated
FALSEnever evaluated
0
644 sendObject_column_reordered = 1;-
645 } else if (right.startsWith(QLatin1String("LinkSelected"))) {
never executed: end of block
right.startsWi...inkSelected"))Description
TRUEnever evaluated
FALSEnever evaluated
0
646 sendObject_link_selected = 1;-
647 } else if (right.startsWith(QLatin1String("ModelChanged"))) {
never executed: end of block
right.startsWi...odelChanged"))Description
TRUEnever evaluated
FALSEnever evaluated
0
648 sendObject_model_changed = 1;-
649 } else if (right.startsWith(QLatin1String("PropertyChange"))) {
never executed: end of block
right.startsWi...pertyChange"))Description
TRUEnever evaluated
FALSEnever evaluated
0
650 if (right == QLatin1String("PropertyChange:AccessibleDescription")) {
right == QLati...eDescription")Description
TRUEnever evaluated
FALSEnever evaluated
0
651 sendObject_property_change_accessible_description = 1;-
652 } else if (right == QLatin1String("PropertyChange:AccessibleName")) {
never executed: end of block
right == QLati...cessibleName")Description
TRUEnever evaluated
FALSEnever evaluated
0
653 sendObject_property_change_accessible_name = 1;-
654 } else if (right == QLatin1String("PropertyChange:AccessibleParent")) {
never executed: end of block
right == QLati...ssibleParent")Description
TRUEnever evaluated
FALSEnever evaluated
0
655 sendObject_property_change_accessible_parent = 1;-
656 } else if (right == QLatin1String("PropertyChange:AccessibleRole")) {
never executed: end of block
right == QLati...cessibleRole")Description
TRUEnever evaluated
FALSEnever evaluated
0
657 sendObject_property_change_accessible_role = 1;-
658 } else if (right == QLatin1String("PropertyChange:TableCaption")) {
never executed: end of block
right == QLati...TableCaption")Description
TRUEnever evaluated
FALSEnever evaluated
0
659 sendObject_property_change_accessible_table_caption = 1;-
660 } else if (right == QLatin1String("PropertyChange:TableColumnDescription")) {
never executed: end of block
right == QLati...nDescription")Description
TRUEnever evaluated
FALSEnever evaluated
0
661 sendObject_property_change_accessible_table_column_description = 1;-
662 } else if (right == QLatin1String("PropertyChange:TableColumnHeader")) {
never executed: end of block
right == QLati...ColumnHeader")Description
TRUEnever evaluated
FALSEnever evaluated
0
663 sendObject_property_change_accessible_table_column_header = 1;-
664 } else if (right == QLatin1String("PropertyChange:TableRowDescription")) {
never executed: end of block
right == QLati...wDescription")Description
TRUEnever evaluated
FALSEnever evaluated
0
665 sendObject_property_change_accessible_table_row_description = 1;-
666 } else if (right == QLatin1String("PropertyChange:TableRowHeader")) {
never executed: end of block
right == QLati...bleRowHeader")Description
TRUEnever evaluated
FALSEnever evaluated
0
667 sendObject_property_change_accessible_table_row_header = 1;-
668 } else if (right == QLatin1String("PropertyChange:TableSummary")) {
never executed: end of block
right == QLati...TableSummary")Description
TRUEnever evaluated
FALSEnever evaluated
0
669 sendObject_property_change_accessible_table_summary = 1;-
670 } else if (right == QLatin1String("PropertyChange:AccessibleValue")) {
never executed: end of block
right == QLati...essibleValue")Description
TRUEnever evaluated
FALSEnever evaluated
0
671 sendObject_property_change_accessible_value = 1;-
672 } else {
never executed: end of block
0
673 sendObject_property_change = 1;-
674 }
never executed: end of block
0
675 } else if (right.startsWith(QLatin1String("RowDeleted"))) {
right.startsWi..."RowDeleted"))Description
TRUEnever evaluated
FALSEnever evaluated
0
676 sendObject_row_deleted = 1;-
677 } else if (right.startsWith(QLatin1String("RowInserted"))) {
never executed: end of block
right.startsWi...RowInserted"))Description
TRUEnever evaluated
FALSEnever evaluated
0
678 sendObject_row_inserted = 1;-
679 } else if (right.startsWith(QLatin1String("RowReordered"))) {
never executed: end of block
right.startsWi...owReordered"))Description
TRUEnever evaluated
FALSEnever evaluated
0
680 sendObject_row_reordered = 1;-
681 } else if (right.startsWith(QLatin1String("SelectionChanged"))) {
never executed: end of block
right.startsWi...tionChanged"))Description
TRUEnever evaluated
FALSEnever evaluated
0
682 sendObject_selection_changed = 1;-
683 } else if (right.startsWith(QLatin1String("StateChanged"))) {
never executed: end of block
right.startsWi...tateChanged"))Description
TRUEnever evaluated
FALSEnever evaluated
0
684 sendObject_state_changed = 1;-
685 } else if (right.startsWith(QLatin1String("TextAttributesChanged"))) {
never executed: end of block
right.startsWi...utesChanged"))Description
TRUEnever evaluated
FALSEnever evaluated
0
686 sendObject_text_attributes_changed = 1;-
687 } else if (right.startsWith(QLatin1String("TextBoundsChanged"))) {
never executed: end of block
right.startsWi...undsChanged"))Description
TRUEnever evaluated
FALSEnever evaluated
0
688 sendObject_text_bounds_changed = 1;-
689 } else if (right.startsWith(QLatin1String("TextCaretMoved"))) {
never executed: end of block
right.startsWi...tCaretMoved"))Description
TRUEnever evaluated
FALSEnever evaluated
0
690 sendObject_text_caret_moved = 1;-
691 } else if (right.startsWith(QLatin1String("TextChanged"))) {
never executed: end of block
right.startsWi...TextChanged"))Description
TRUEnever evaluated
FALSEnever evaluated
0
692 sendObject_text_changed = 1;-
693 } else if (right.startsWith(QLatin1String("TextSelectionChanged"))) {
never executed: end of block
right.startsWi...tionChanged"))Description
TRUEnever evaluated
FALSEnever evaluated
0
694 sendObject_text_selection_changed = 1;-
695 } else if (right.startsWith(QLatin1String("ValueChanged"))) {
never executed: end of block
right.startsWi...alueChanged"))Description
TRUEnever evaluated
FALSEnever evaluated
0
696 sendObject_value_changed = 1;-
697 } else if (right.startsWith(QLatin1String("VisibleDataChanged"))
never executed: end of block
right.startsWi...DataChanged"))Description
TRUEnever evaluated
FALSEnever evaluated
0
698 || right.startsWith(QLatin1String("VisibledataChanged"))) { // typo in libatspi
right.startsWi...dataChanged"))Description
TRUEnever evaluated
FALSEnever evaluated
0
699 sendObject_visible_data_changed = 1;-
700 } else {
never executed: end of block
0
701 qAtspiDebug() << "WARNING: subscription string not handled:" << flag;
never executed: ;
never executed: QMessageLogger(__FILE__, 701, __PRETTY_FUNCTION__).debug() << "WARNING: subscription string not handled:" << flag;
!::isDebuggingDescription
TRUEnever evaluated
FALSEnever evaluated
0
702 }-
703 }-
704 break;
never executed: break;
0
705 }-
706 case 'w': { // window
never executed: case 'w':
0
707 if (flag.size() <= 8) {
flag.size() <= 8Description
TRUEnever evaluated
FALSEnever evaluated
0
708 sendWindow = 1;-
709 } else { // object:Foo:Bar
never executed: end of block
0
710 QString right = flag.mid(7);-
711 if (false) {
dead code: { }
-
712 } else if (right.startsWith(QLatin1String("Activate"))) {
right.startsWi...g("Activate"))Description
TRUEnever evaluated
FALSEnever evaluated
dead code: { }
-
713 sendWindow_activate = 1;-
714 } else if (right.startsWith(QLatin1String("Close"))) {
never executed: end of block
right.startsWi...ring("Close"))Description
TRUEnever evaluated
FALSEnever evaluated
0
715 sendWindow_close= 1;-
716 } else if (right.startsWith(QLatin1String("Create"))) {
never executed: end of block
right.startsWi...ing("Create"))Description
TRUEnever evaluated
FALSEnever evaluated
0
717 sendWindow_create = 1;-
718 } else if (right.startsWith(QLatin1String("Deactivate"))) {
never executed: end of block
right.startsWi..."Deactivate"))Description
TRUEnever evaluated
FALSEnever evaluated
0
719 sendWindow_deactivate = 1;-
720 } else if (right.startsWith(QLatin1String("Lower"))) {
never executed: end of block
right.startsWi...ring("Lower"))Description
TRUEnever evaluated
FALSEnever evaluated
0
721 sendWindow_lower = 1;-
722 } else if (right.startsWith(QLatin1String("Maximize"))) {
never executed: end of block
right.startsWi...g("Maximize"))Description
TRUEnever evaluated
FALSEnever evaluated
0
723 sendWindow_maximize = 1;-
724 } else if (right.startsWith(QLatin1String("Minimize"))) {
never executed: end of block
right.startsWi...g("Minimize"))Description
TRUEnever evaluated
FALSEnever evaluated
0
725 sendWindow_minimize = 1;-
726 } else if (right.startsWith(QLatin1String("Move"))) {
never executed: end of block
right.startsWi...tring("Move"))Description
TRUEnever evaluated
FALSEnever evaluated
0
727 sendWindow_move = 1;-
728 } else if (right.startsWith(QLatin1String("Raise"))) {
never executed: end of block
right.startsWi...ring("Raise"))Description
TRUEnever evaluated
FALSEnever evaluated
0
729 sendWindow_raise = 1;-
730 } else if (right.startsWith(QLatin1String("Reparent"))) {
never executed: end of block
right.startsWi...g("Reparent"))Description
TRUEnever evaluated
FALSEnever evaluated
0
731 sendWindow_reparent = 1;-
732 } else if (right.startsWith(QLatin1String("Resize"))) {
never executed: end of block
right.startsWi...ing("Resize"))Description
TRUEnever evaluated
FALSEnever evaluated
0
733 sendWindow_resize = 1;-
734 } else if (right.startsWith(QLatin1String("Restore"))) {
never executed: end of block
right.startsWi...ng("Restore"))Description
TRUEnever evaluated
FALSEnever evaluated
0
735 sendWindow_restore = 1;-
736 } else if (right.startsWith(QLatin1String("Restyle"))) {
never executed: end of block
right.startsWi...ng("Restyle"))Description
TRUEnever evaluated
FALSEnever evaluated
0
737 sendWindow_restyle = 1;-
738 } else if (right.startsWith(QLatin1String("Shade"))) {
never executed: end of block
right.startsWi...ring("Shade"))Description
TRUEnever evaluated
FALSEnever evaluated
0
739 sendWindow_shade = 1;-
740 } else if (right.startsWith(QLatin1String("Unshade"))) {
never executed: end of block
right.startsWi...ng("Unshade"))Description
TRUEnever evaluated
FALSEnever evaluated
0
741 sendWindow_unshade = 1;-
742 } else if (right.startsWith(QLatin1String("DesktopCreate"))) {
never executed: end of block
right.startsWi...sktopCreate"))Description
TRUEnever evaluated
FALSEnever evaluated
0
743 // ignore this one-
744 } else if (right.startsWith(QLatin1String("DesktopDestroy"))) {
never executed: end of block
right.startsWi...ktopDestroy"))Description
TRUEnever evaluated
FALSEnever evaluated
0
745 // ignore this one-
746 } else {
never executed: end of block
0
747 qAtspiDebug() << "WARNING: subscription string not handled:" << flag;
never executed: ;
never executed: QMessageLogger(__FILE__, 747, __PRETTY_FUNCTION__).debug() << "WARNING: subscription string not handled:" << flag;
!::isDebuggingDescription
TRUEnever evaluated
FALSEnever evaluated
0
748 }-
749 }-
750 break;
never executed: break;
0
751 }-
752 case 'f': {
never executed: case 'f':
0
753 sendFocus = 1;-
754 break;
never executed: break;
0
755 }-
756 case 'd': { // document is not implemented
never executed: case 'd':
0
757 break;
never executed: break;
0
758 }-
759 case 't': { // terminal is not implemented
never executed: case 't':
0
760 break;
never executed: break;
0
761 }-
762 case 'm': { // mouse* is handled in a different way by the gnome atspi stack
never executed: case 'm':
0
763 break;
never executed: break;
0
764 }-
765 default:
never executed: default:
0
766 qAtspiDebug() << "WARNING: subscription string not handled:" << flag;
never executed: ;
never executed: QMessageLogger(__FILE__, 766, __PRETTY_FUNCTION__).debug() << "WARNING: subscription string not handled:" << flag;
!::isDebuggingDescription
TRUEnever evaluated
FALSEnever evaluated
0
767 }-
768}-
769-
770/*!-
771 Checks via dbus which events should be sent.-
772 */-
773void AtSpiAdaptor::updateEventListeners()-
774{-
775 QDBusMessage m = QDBusMessage::createMethodCall(QLatin1String("org.a11y.atspi.Registry"),-
776 QLatin1String("/org/a11y/atspi/registry"),-
777 QLatin1String("org.a11y.atspi.Registry"), QLatin1String("GetRegisteredEvents"));-
778 QDBusReply<QSpiEventListenerArray> listenersReply = m_dbus->connection().call(m);-
779 if (listenersReply.isValid()) {
listenersReply.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
0
780 const QSpiEventListenerArray evList = listenersReply.value();-
781 Q_FOREACH (const QSpiEventListener &ev, evList) {-
782 setBitFlag(ev.eventName);-
783 }
never executed: end of block
0
784 m_applicationAdaptor->sendEvents(!evList.isEmpty());-
785 } else {
never executed: end of block
0
786 qAtspiDebug("Could not query active accessibility event listeners.");
never executed: ;
never executed: QMessageLogger(__FILE__, 786, __PRETTY_FUNCTION__).debug("Could not query active accessibility event listeners.");
!::isDebuggingDescription
TRUEnever evaluated
FALSEnever evaluated
0
787 }-
788}-
789-
790void AtSpiAdaptor::eventListenerDeregistered(const QString &/*bus*/, const QString &/*path*/)-
791{-
792// qAtspiDebug() << "AtSpiAdaptor::eventListenerDeregistered: " << bus << path;-
793 updateEventListeners();-
794}
never executed: end of block
0
795-
796void AtSpiAdaptor::eventListenerRegistered(const QString &/*bus*/, const QString &/*path*/)-
797{-
798// qAtspiDebug() << "AtSpiAdaptor::eventListenerRegistered: " << bus << path;-
799 updateEventListeners();-
800}
never executed: end of block
0
801-
802/*!-
803 This slot needs to get called when a \a window has be activated or deactivated (become focused).-
804 When \a active is true, the window just received focus, otherwise it lost the focus.-
805 */-
806void AtSpiAdaptor::windowActivated(QObject* window, bool active)-
807{-
808 if (!(sendWindow || sendWindow_activate))
sendWindowDescription
TRUEnever evaluated
FALSEnever evaluated
sendWindow_activateDescription
TRUEnever evaluated
FALSEnever evaluated
0
809 return;
never executed: return;
0
810-
811 QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(window);-
812 Q_ASSERT(iface);-
813 Q_ASSERT(!active || iface->isValid());-
814-
815 QString windowTitle;-
816 // in dtor it may be invalid-
817 if (iface->isValid())
iface->isValid()Description
TRUEnever evaluated
FALSEnever evaluated
0
818 windowTitle = iface->text(QAccessible::Name);
never executed: windowTitle = iface->text(QAccessible::Name);
0
819-
820 QDBusVariant data;-
821 data.setVariant(windowTitle);-
822-
823 QVariantList args = packDBusSignalArguments(QString(), 0, 0, QVariant::fromValue(data));-
824-
825 QString status = active ? QLatin1String("Activate") : QLatin1String("Deactivate");
activeDescription
TRUEnever evaluated
FALSEnever evaluated
0
826 QString path = pathForObject(window);-
827 sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_WINDOW), status, args);-
828-
829 QVariantList stateArgs = packDBusSignalArguments(QLatin1String("active"), active ? 1 : 0, 0, variantForPath(path));-
830 sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT),-
831 QLatin1String("StateChanged"), stateArgs);-
832}
never executed: end of block
0
833-
834QVariantList AtSpiAdaptor::packDBusSignalArguments(const QString &type, int data1, int data2, const QVariant &variantData) const-
835{-
836 QVariantList arguments;-
837 arguments << type << data1 << data2 << variantData-
838 << QVariant::fromValue(QSpiObjectReference(m_dbus->connection(), QDBusObjectPath(QSPI_OBJECT_PATH_ROOT)));-
839 return arguments;
never executed: return arguments;
0
840}-
841-
842QVariant AtSpiAdaptor::variantForPath(const QString &path) const-
843{-
844 QDBusVariant data;-
845 data.setVariant(QVariant::fromValue(QSpiObjectReference(m_dbus->connection(), QDBusObjectPath(path))));-
846 return QVariant::fromValue(data);
never executed: return QVariant::fromValue(data);
0
847}-
848-
849bool AtSpiAdaptor::sendDBusSignal(const QString &path, const QString &interface, const QString &signalName, const QVariantList &arguments) const-
850{-
851 QDBusMessage message = QDBusMessage::createSignal(path, interface, signalName);-
852 message.setArguments(arguments);-
853 return m_dbus->connection().send(message);
never executed: return m_dbus->connection().send(message);
0
854}-
855-
856QAccessibleInterface *AtSpiAdaptor::interfaceFromPath(const QString& dbusPath) const-
857{-
858 if (dbusPath == QLatin1String(QSPI_OBJECT_PATH_ROOT))
dbusPath == QL...ible/" "root")Description
TRUEnever evaluated
FALSEnever evaluated
0
859 return QAccessible::queryAccessibleInterface(qApp);
never executed: return QAccessible::queryAccessibleInterface((static_cast<QGuiApplication *>(QCoreApplication::instance())));
0
860-
861 QStringList parts = dbusPath.split(QLatin1Char('/'));-
862 if (parts.size() != 6) {
parts.size() != 6Description
TRUEnever evaluated
FALSEnever evaluated
0
863 qAtspiDebug() << "invalid path: " << dbusPath;
never executed: ;
never executed: QMessageLogger(__FILE__, 863, __PRETTY_FUNCTION__).debug() << "invalid path: " << dbusPath;
!::isDebuggingDescription
TRUEnever evaluated
FALSEnever evaluated
0
864 return 0;
never executed: return 0;
0
865 }-
866-
867 QString objectString = parts.at(5);-
868 QAccessible::Id id = objectString.toUInt();-
869-
870 // The id is always in the range [INT_MAX+1, UINT_MAX]-
871 if ((int)id >= 0)
(int)id >= 0Description
TRUEnever evaluated
FALSEnever evaluated
0
872 qWarning() << "No accessible object found for id: " << id;
never executed: QMessageLogger(__FILE__, 872, __PRETTY_FUNCTION__).warning() << "No accessible object found for id: " << id;
0
873-
874 return QAccessible::accessibleInterface(id);
never executed: return QAccessible::accessibleInterface(id);
0
875}-
876-
877void AtSpiAdaptor::notifyStateChange(QAccessibleInterface *interface, const QString &state, int value)-
878{-
879 QString path = pathForInterface(interface);-
880 QVariantList stateArgs = packDBusSignalArguments(state, value, 0, variantForPath(path));-
881 sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT),-
882 QLatin1String("StateChanged"), stateArgs);-
883}
never executed: end of block
0
884-
885-
886/*!-
887 This function gets called when Qt notifies about accessibility updates.-
888*/-
889void AtSpiAdaptor::notify(QAccessibleEvent *event)-
890{-
891 switch (event->type()) {-
892 case QAccessible::ObjectCreated:
never executed: case QAccessible::ObjectCreated:
0
893 if (sendObject || sendObject_children_changed)
sendObjectDescription
TRUEnever evaluated
FALSEnever evaluated
sendObject_children_changedDescription
TRUEnever evaluated
FALSEnever evaluated
0
894 notifyAboutCreation(event->accessibleInterface());
never executed: notifyAboutCreation(event->accessibleInterface());
0
895 break;
never executed: break;
0
896 case QAccessible::ObjectShow: {
never executed: case QAccessible::ObjectShow:
0
897 if (sendObject || sendObject_state_changed) {
sendObjectDescription
TRUEnever evaluated
FALSEnever evaluated
sendObject_state_changedDescription
TRUEnever evaluated
FALSEnever evaluated
0
898 notifyStateChange(event->accessibleInterface(), QLatin1String("showing"), 1);-
899 }
never executed: end of block
0
900 break;
never executed: break;
0
901 }-
902 case QAccessible::ObjectHide: {
never executed: case QAccessible::ObjectHide:
0
903 if (sendObject || sendObject_state_changed) {
sendObjectDescription
TRUEnever evaluated
FALSEnever evaluated
sendObject_state_changedDescription
TRUEnever evaluated
FALSEnever evaluated
0
904 notifyStateChange(event->accessibleInterface(), QLatin1String("showing"), 0);-
905 }
never executed: end of block
0
906 break;
never executed: break;
0
907 }-
908 case QAccessible::ObjectDestroyed: {
never executed: case QAccessible::ObjectDestroyed:
0
909 if (sendObject || sendObject_state_changed)
sendObjectDescription
TRUEnever evaluated
FALSEnever evaluated
sendObject_state_changedDescription
TRUEnever evaluated
FALSEnever evaluated
0
910 notifyAboutDestruction(event->accessibleInterface());
never executed: notifyAboutDestruction(event->accessibleInterface());
0
911 break;
never executed: break;
0
912 }-
913 case QAccessible::ObjectReorder: {
never executed: case QAccessible::ObjectReorder:
0
914 if (sendObject || sendObject_children_changed)
sendObjectDescription
TRUEnever evaluated
FALSEnever evaluated
sendObject_children_changedDescription
TRUEnever evaluated
FALSEnever evaluated
0
915 childrenChanged(event->accessibleInterface());
never executed: childrenChanged(event->accessibleInterface());
0
916 break;
never executed: break;
0
917 }-
918 case QAccessible::NameChanged: {
never executed: case QAccessible::NameChanged:
0
919 if (sendObject || sendObject_property_change || sendObject_property_change_accessible_name) {
sendObjectDescription
TRUEnever evaluated
FALSEnever evaluated
sendObject_property_changeDescription
TRUEnever evaluated
FALSEnever evaluated
sendObject_pro...ccessible_nameDescription
TRUEnever evaluated
FALSEnever evaluated
0
920 QString path = pathForInterface(event->accessibleInterface());-
921 QVariantList args = packDBusSignalArguments(QLatin1String("accessible-name"), 0, 0, variantForPath(path));-
922 sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT),-
923 QLatin1String("PropertyChange"), args);-
924 }
never executed: end of block
0
925 break;
never executed: break;
0
926 }-
927 case QAccessible::DescriptionChanged: {
never executed: case QAccessible::DescriptionChanged:
0
928 if (sendObject || sendObject_property_change || sendObject_property_change_accessible_description) {
sendObjectDescription
TRUEnever evaluated
FALSEnever evaluated
sendObject_property_changeDescription
TRUEnever evaluated
FALSEnever evaluated
sendObject_pro...le_descriptionDescription
TRUEnever evaluated
FALSEnever evaluated
0
929 QString path = pathForInterface(event->accessibleInterface());-
930 QVariantList args = packDBusSignalArguments(QLatin1String("accessible-description"), 0, 0, variantForPath(path));-
931 sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT),-
932 QLatin1String("PropertyChange"), args);-
933 }
never executed: end of block
0
934 break;
never executed: break;
0
935 }-
936 case QAccessible::Focus: {
never executed: case QAccessible::Focus:
0
937 if (sendFocus || sendObject || sendObject_state_changed)
sendFocusDescription
TRUEnever evaluated
FALSEnever evaluated
sendObjectDescription
TRUEnever evaluated
FALSEnever evaluated
sendObject_state_changedDescription
TRUEnever evaluated
FALSEnever evaluated
0
938 sendFocusChanged(event->accessibleInterface());
never executed: sendFocusChanged(event->accessibleInterface());
0
939 break;
never executed: break;
0
940 }-
941 case QAccessible::TextInserted:
never executed: case QAccessible::TextInserted:
0
942 case QAccessible::TextRemoved:
never executed: case QAccessible::TextRemoved:
0
943 case QAccessible::TextUpdated: {
never executed: case QAccessible::TextUpdated:
0
944 if (sendObject || sendObject_text_changed) {
sendObjectDescription
TRUEnever evaluated
FALSEnever evaluated
sendObject_text_changedDescription
TRUEnever evaluated
FALSEnever evaluated
0
945 QAccessibleInterface * iface = event->accessibleInterface();-
946 if (!iface || !iface->textInterface()) {
!ifaceDescription
TRUEnever evaluated
FALSEnever evaluated
!iface->textInterface()Description
TRUEnever evaluated
FALSEnever evaluated
0
947 qAtspiDebug("Received text event for invalid interface.");
never executed: ;
never executed: QMessageLogger(__FILE__, 947, __PRETTY_FUNCTION__).debug("Received text event for invalid interface.");
!::isDebuggingDescription
TRUEnever evaluated
FALSEnever evaluated
0
948 return;
never executed: return;
0
949 }-
950 QString path = pathForInterface(iface);-
951-
952 int changePosition = 0;-
953 int cursorPosition = 0;-
954 QString textRemoved;-
955 QString textInserted;-
956-
957 if (event->type() == QAccessible::TextInserted) {
event->type() ...::TextInsertedDescription
TRUEnever evaluated
FALSEnever evaluated
0
958 QAccessibleTextInsertEvent *textEvent = static_cast<QAccessibleTextInsertEvent*>(event);-
959 textInserted = textEvent->textInserted();-
960 changePosition = textEvent->changePosition();-
961 cursorPosition = textEvent->cursorPosition();-
962 } else if (event->type() == QAccessible::TextRemoved) {
never executed: end of block
event->type() ...e::TextRemovedDescription
TRUEnever evaluated
FALSEnever evaluated
0
963 QAccessibleTextRemoveEvent *textEvent = static_cast<QAccessibleTextRemoveEvent*>(event);-
964 textRemoved = textEvent->textRemoved();-
965 changePosition = textEvent->changePosition();-
966 cursorPosition = textEvent->cursorPosition();-
967 } else if (event->type() == QAccessible::TextInserted) {
never executed: end of block
event->type() ...::TextInsertedDescription
TRUEnever evaluated
FALSEnever evaluated
0
968 QAccessibleTextUpdateEvent *textEvent = static_cast<QAccessibleTextUpdateEvent*>(event);-
969 textInserted = textEvent->textInserted();-
970 textRemoved = textEvent->textRemoved();-
971 changePosition = textEvent->changePosition();-
972 cursorPosition = textEvent->cursorPosition();-
973 }
never executed: end of block
0
974-
975 QDBusVariant data;-
976-
977 if (!textRemoved.isEmpty()) {
!textRemoved.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
0
978 data.setVariant(QVariant::fromValue(textRemoved));-
979 QVariantList args = packDBusSignalArguments(QLatin1String("delete"), changePosition, textRemoved.length(), QVariant::fromValue(data));-
980 sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT),-
981 QLatin1String("TextChanged"), args);-
982 }
never executed: end of block
0
983-
984 if (!textInserted.isEmpty()) {
!textInserted.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
0
985 data.setVariant(QVariant::fromValue(textInserted));-
986 QVariantList args = packDBusSignalArguments(QLatin1String("insert"), changePosition, textInserted.length(), QVariant::fromValue(data));-
987 sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT),-
988 QLatin1String("TextChanged"), args);-
989 }
never executed: end of block
0
990-
991 // send a cursor update-
992 Q_UNUSED(cursorPosition)-
993// QDBusVariant cursorData;-
994// cursorData.setVariant(QVariant::fromValue(cursorPosition));-
995// QVariantList args = packDBusSignalArguments(QString(), cursorPosition, 0, QVariant::fromValue(cursorData));-
996// sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT),-
997// QLatin1String("TextCaretMoved"), args);-
998 }
never executed: end of block
0
999 break;
never executed: break;
0
1000 }-
1001 case QAccessible::TextCaretMoved: {
never executed: case QAccessible::TextCaretMoved:
0
1002 if (sendObject || sendObject_text_caret_moved) {
sendObjectDescription
TRUEnever evaluated
FALSEnever evaluated
sendObject_text_caret_movedDescription
TRUEnever evaluated
FALSEnever evaluated
0
1003 QAccessibleInterface * iface = event->accessibleInterface();-
1004 if (!iface || !iface->textInterface()) {
!ifaceDescription
TRUEnever evaluated
FALSEnever evaluated
!iface->textInterface()Description
TRUEnever evaluated
FALSEnever evaluated
0
1005 qWarning() << "Sending TextCaretMoved from object that does not implement text interface: " << iface;-
1006 return;
never executed: return;
0
1007 }-
1008-
1009 QString path = pathForInterface(iface);-
1010 QDBusVariant cursorData;-
1011 int pos = iface->textInterface()->cursorPosition();-
1012 cursorData.setVariant(QVariant::fromValue(pos));-
1013 QVariantList args = packDBusSignalArguments(QString(), pos, 0, QVariant::fromValue(cursorData));-
1014 sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT),-
1015 QLatin1String("TextCaretMoved"), args);-
1016 }
never executed: end of block
0
1017 break;
never executed: break;
0
1018 }-
1019 case QAccessible::TextSelectionChanged: {
never executed: case QAccessible::TextSelectionChanged:
0
1020 if (sendObject || sendObject_text_selection_changed) {
sendObjectDescription
TRUEnever evaluated
FALSEnever evaluated
sendObject_tex...ection_changedDescription
TRUEnever evaluated
FALSEnever evaluated
0
1021 QAccessibleInterface * iface = event->accessibleInterface();-
1022 QString path = pathForInterface(iface);-
1023 QVariantList args = packDBusSignalArguments(QString(), 0, 0, QVariant::fromValue(QDBusVariant(QVariant(QString()))));-
1024 sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT),-
1025 QLatin1String("TextSelectionChanged"), args);-
1026 }
never executed: end of block
0
1027 break;
never executed: break;
0
1028 }-
1029 case QAccessible::ValueChanged: {
never executed: case QAccessible::ValueChanged:
0
1030 if (sendObject || sendObject_value_changed || sendObject_property_change_accessible_value) {
sendObjectDescription
TRUEnever evaluated
FALSEnever evaluated
sendObject_value_changedDescription
TRUEnever evaluated
FALSEnever evaluated
sendObject_pro...cessible_valueDescription
TRUEnever evaluated
FALSEnever evaluated
0
1031 QAccessibleInterface * iface = event->accessibleInterface();-
1032 if (!iface) {
!ifaceDescription
TRUEnever evaluated
FALSEnever evaluated
0
1033 qWarning("ValueChanged event from invalid accessible.");-
1034 return;
never executed: return;
0
1035 }-
1036 if (iface->valueInterface()) {
iface->valueInterface()Description
TRUEnever evaluated
FALSEnever evaluated
0
1037 QString path = pathForInterface(iface);-
1038 QVariantList args = packDBusSignalArguments(QLatin1String("accessible-value"), 0, 0, variantForPath(path));-
1039 sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT),-
1040 QLatin1String("PropertyChange"), args);-
1041 } else if (iface->role() == QAccessible::ComboBox) {
never executed: end of block
iface->role() ...ible::ComboBoxDescription
TRUEnever evaluated
FALSEnever evaluated
0
1042 // Combo Box with AT-SPI likes to be special-
1043 // It requires a name-change to update caches and then selection-changed-
1044 QString path = pathForInterface(iface);-
1045 QVariantList args1 = packDBusSignalArguments(QLatin1String("accessible-name"), 0, 0, variantForPath(path));-
1046 sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT),-
1047 QLatin1String("PropertyChange"), args1);-
1048 QVariantList args2 = packDBusSignalArguments(QString(), 0, 0, QVariant::fromValue(QDBusVariant(QVariant(0))));-
1049 sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT),-
1050 QLatin1String("SelectionChanged"), args2);-
1051 } else {
never executed: end of block
0
1052 qWarning() << "ValueChanged event and no ValueInterface or ComboBox: " << iface;-
1053 }
never executed: end of block
0
1054 }-
1055 break;
never executed: break;
0
1056 }-
1057 case QAccessible::SelectionAdd:
never executed: case QAccessible::SelectionAdd:
0
1058 case QAccessible::SelectionRemove:
never executed: case QAccessible::SelectionRemove:
0
1059 case QAccessible::Selection: {
never executed: case QAccessible::Selection:
0
1060 QAccessibleInterface * iface = event->accessibleInterface();-
1061 if (!iface) {
!ifaceDescription
TRUEnever evaluated
FALSEnever evaluated
0
1062 qWarning("Selection event from invalid accessible.");-
1063 return;
never executed: return;
0
1064 }-
1065 QString path = pathForInterface(iface);-
1066 int selected = iface->state().selected ? 1 : 0;
iface->state().selectedDescription
TRUEnever evaluated
FALSEnever evaluated
0
1067 QVariantList stateArgs = packDBusSignalArguments(QLatin1String("selected"), selected, 0, variantForPath(path));-
1068 sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT),-
1069 QLatin1String("StateChanged"), stateArgs);-
1070 break;
never executed: break;
0
1071 }-
1072-
1073 case QAccessible::StateChanged: {
never executed: case QAccessible::StateChanged:
0
1074 if (sendObject || sendObject_state_changed || sendWindow || sendWindow_activate) {
sendObjectDescription
TRUEnever evaluated
FALSEnever evaluated
sendObject_state_changedDescription
TRUEnever evaluated
FALSEnever evaluated
sendWindowDescription
TRUEnever evaluated
FALSEnever evaluated
sendWindow_activateDescription
TRUEnever evaluated
FALSEnever evaluated
0
1075 QAccessible::State stateChange = static_cast<QAccessibleStateChangeEvent*>(event)->changedStates();-
1076 if (stateChange.checked) {
stateChange.checkedDescription
TRUEnever evaluated
FALSEnever evaluated
0
1077 QAccessibleInterface * iface = event->accessibleInterface();-
1078 if (!iface) {
!ifaceDescription
TRUEnever evaluated
FALSEnever evaluated
0
1079 qWarning("StateChanged event from invalid accessible.");-
1080 return;
never executed: return;
0
1081 }-
1082 int checked = iface->state().checked;-
1083 notifyStateChange(iface, QLatin1String("checked"), checked);-
1084 } else if (stateChange.active) {
never executed: end of block
stateChange.activeDescription
TRUEnever evaluated
FALSEnever evaluated
0
1085 QAccessibleInterface * iface = event->accessibleInterface();-
1086 if (!iface || !(iface->role() == QAccessible::Window && (sendWindow || sendWindow_activate)))
!ifaceDescription
TRUEnever evaluated
FALSEnever evaluated
iface->role() ...ssible::WindowDescription
TRUEnever evaluated
FALSEnever evaluated
sendWindowDescription
TRUEnever evaluated
FALSEnever evaluated
sendWindow_activateDescription
TRUEnever evaluated
FALSEnever evaluated
0
1087 return;
never executed: return;
0
1088 int isActive = iface->state().active;-
1089 QString windowTitle = iface->text(QAccessible::Name);-
1090 QDBusVariant data;-
1091 data.setVariant(windowTitle);-
1092 QVariantList args = packDBusSignalArguments(QString(), 0, 0, QVariant::fromValue(data));-
1093 QString status = isActive ? QLatin1String("Activate") : QLatin1String("Deactivate");
isActiveDescription
TRUEnever evaluated
FALSEnever evaluated
0
1094 QString path = pathForInterface(iface);-
1095 sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_WINDOW), status, args);-
1096 notifyStateChange(iface, QLatin1String("active"), isActive);-
1097 } else if (stateChange.disabled) {
never executed: end of block
stateChange.disabledDescription
TRUEnever evaluated
FALSEnever evaluated
0
1098 QAccessibleInterface *iface = event->accessibleInterface();-
1099 QAccessible::State state = iface->state();-
1100 bool enabled = !state.disabled;-
1101-
1102 notifyStateChange(iface, QLatin1String("enabled"), enabled);-
1103 notifyStateChange(iface, QLatin1String("sensitive"), enabled);-
1104 }
never executed: end of block
0
1105 }
never executed: end of block
0
1106 break;
never executed: break;
0
1107 }-
1108 // For now we ignore these events-
1109 case QAccessible::TableModelChanged:
never executed: case QAccessible::TableModelChanged:
0
1110 // For tables, setting manages_descendants should-
1111 // indicate to the client that it cannot cache these-
1112 // interfaces.-
1113 case QAccessible::ParentChanged:
never executed: case QAccessible::ParentChanged:
0
1114 case QAccessible::DialogStart:
never executed: case QAccessible::DialogStart:
0
1115 case QAccessible::DialogEnd:
never executed: case QAccessible::DialogEnd:
0
1116 case QAccessible::PopupMenuStart:
never executed: case QAccessible::PopupMenuStart:
0
1117 case QAccessible::PopupMenuEnd:
never executed: case QAccessible::PopupMenuEnd:
0
1118 case QAccessible::SoundPlayed:
never executed: case QAccessible::SoundPlayed:
0
1119 case QAccessible::Alert:
never executed: case QAccessible::Alert:
0
1120 case QAccessible::ForegroundChanged:
never executed: case QAccessible::ForegroundChanged:
0
1121 case QAccessible::MenuStart:
never executed: case QAccessible::MenuStart:
0
1122 case QAccessible::MenuEnd:
never executed: case QAccessible::MenuEnd:
0
1123 case QAccessible::ContextHelpStart:
never executed: case QAccessible::ContextHelpStart:
0
1124 case QAccessible::ContextHelpEnd:
never executed: case QAccessible::ContextHelpEnd:
0
1125 case QAccessible::DragDropStart:
never executed: case QAccessible::DragDropStart:
0
1126 case QAccessible::DragDropEnd:
never executed: case QAccessible::DragDropEnd:
0
1127 case QAccessible::ScrollingStart:
never executed: case QAccessible::ScrollingStart:
0
1128 case QAccessible::ScrollingEnd:
never executed: case QAccessible::ScrollingEnd:
0
1129 case QAccessible::MenuCommand:
never executed: case QAccessible::MenuCommand:
0
1130 case QAccessible::ActionChanged:
never executed: case QAccessible::ActionChanged:
0
1131 case QAccessible::ActiveDescendantChanged:
never executed: case QAccessible::ActiveDescendantChanged:
0
1132 case QAccessible::AttributeChanged:
never executed: case QAccessible::AttributeChanged:
0
1133 case QAccessible::DocumentContentChanged:
never executed: case QAccessible::DocumentContentChanged:
0
1134 case QAccessible::DocumentLoadComplete:
never executed: case QAccessible::DocumentLoadComplete:
0
1135 case QAccessible::DocumentLoadStopped:
never executed: case QAccessible::DocumentLoadStopped:
0
1136 case QAccessible::DocumentReload:
never executed: case QAccessible::DocumentReload:
0
1137 case QAccessible::HyperlinkEndIndexChanged:
never executed: case QAccessible::HyperlinkEndIndexChanged:
0
1138 case QAccessible::HyperlinkNumberOfAnchorsChanged:
never executed: case QAccessible::HyperlinkNumberOfAnchorsChanged:
0
1139 case QAccessible::HyperlinkSelectedLinkChanged:
never executed: case QAccessible::HyperlinkSelectedLinkChanged:
0
1140 case QAccessible::HypertextLinkActivated:
never executed: case QAccessible::HypertextLinkActivated:
0
1141 case QAccessible::HypertextLinkSelected:
never executed: case QAccessible::HypertextLinkSelected:
0
1142 case QAccessible::HyperlinkStartIndexChanged:
never executed: case QAccessible::HyperlinkStartIndexChanged:
0
1143 case QAccessible::HypertextChanged:
never executed: case QAccessible::HypertextChanged:
0
1144 case QAccessible::HypertextNLinksChanged:
never executed: case QAccessible::HypertextNLinksChanged:
0
1145 case QAccessible::ObjectAttributeChanged:
never executed: case QAccessible::ObjectAttributeChanged:
0
1146 case QAccessible::PageChanged:
never executed: case QAccessible::PageChanged:
0
1147 case QAccessible::SectionChanged:
never executed: case QAccessible::SectionChanged:
0
1148 case QAccessible::TableCaptionChanged:
never executed: case QAccessible::TableCaptionChanged:
0
1149 case QAccessible::TableColumnDescriptionChanged:
never executed: case QAccessible::TableColumnDescriptionChanged:
0
1150 case QAccessible::TableColumnHeaderChanged:
never executed: case QAccessible::TableColumnHeaderChanged:
0
1151 case QAccessible::TableRowDescriptionChanged:
never executed: case QAccessible::TableRowDescriptionChanged:
0
1152 case QAccessible::TableRowHeaderChanged:
never executed: case QAccessible::TableRowHeaderChanged:
0
1153 case QAccessible::TableSummaryChanged:
never executed: case QAccessible::TableSummaryChanged:
0
1154 case QAccessible::TextAttributeChanged:
never executed: case QAccessible::TextAttributeChanged:
0
1155 case QAccessible::TextColumnChanged:
never executed: case QAccessible::TextColumnChanged:
0
1156 case QAccessible::VisibleDataChanged:
never executed: case QAccessible::VisibleDataChanged:
0
1157 case QAccessible::SelectionWithin:
never executed: case QAccessible::SelectionWithin:
0
1158 case QAccessible::LocationChanged:
never executed: case QAccessible::LocationChanged:
0
1159 case QAccessible::HelpChanged:
never executed: case QAccessible::HelpChanged:
0
1160 case QAccessible::DefaultActionChanged:
never executed: case QAccessible::DefaultActionChanged:
0
1161 case QAccessible::AcceleratorChanged:
never executed: case QAccessible::AcceleratorChanged:
0
1162 case QAccessible::InvalidEvent:
never executed: case QAccessible::InvalidEvent:
0
1163 break;
never executed: break;
0
1164 }-
1165}
never executed: end of block
0
1166-
1167void AtSpiAdaptor::sendFocusChanged(QAccessibleInterface *interface) const-
1168{-
1169 static QString lastFocusPath;-
1170 // "remove" old focus-
1171 if (!lastFocusPath.isEmpty()) {
!lastFocusPath.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
0
1172 QVariantList stateArgs = packDBusSignalArguments(QLatin1String("focused"), 0, 0, variantForPath(lastFocusPath));-
1173 sendDBusSignal(lastFocusPath, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT),-
1174 QLatin1String("StateChanged"), stateArgs);-
1175 }
never executed: end of block
0
1176 // send new focus-
1177 {-
1178 QString path = pathForInterface(interface);-
1179-
1180 QVariantList stateArgs = packDBusSignalArguments(QLatin1String("focused"), 1, 0, variantForPath(path));-
1181 sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT),-
1182 QLatin1String("StateChanged"), stateArgs);-
1183-
1184 QVariantList focusArgs = packDBusSignalArguments(QString(), 0, 0, variantForPath(path));-
1185 sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_FOCUS),-
1186 QLatin1String("Focus"), focusArgs);-
1187 lastFocusPath = path;-
1188 }-
1189}
never executed: end of block
0
1190-
1191void AtSpiAdaptor::childrenChanged(QAccessibleInterface *interface) const-
1192{-
1193 QString parentPath = pathForInterface(interface);-
1194 int childCount = interface->childCount();-
1195 for (int i = 0; i < interface->childCount(); ++i) {
i < interface->childCount()Description
TRUEnever evaluated
FALSEnever evaluated
0
1196 QString childPath = pathForInterface(interface->child(i));-
1197 QVariantList args = packDBusSignalArguments(QLatin1String("add"), childCount, 0, childPath);-
1198 sendDBusSignal(parentPath, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT), QLatin1String("ChildrenChanged"), args);-
1199 }
never executed: end of block
0
1200}
never executed: end of block
0
1201-
1202void AtSpiAdaptor::notifyAboutCreation(QAccessibleInterface *interface) const-
1203{-
1204// // say hello to d-bus-
1205// cache->emitAddAccessible(accessible->getCacheItem());-
1206-
1207 // notify about the new child of our parent-
1208 QAccessibleInterface * parent = interface->parent();-
1209 if (!parent) {
!parentDescription
TRUEnever evaluated
FALSEnever evaluated
0
1210 qAtspiDebug() << "AtSpiAdaptor::notifyAboutCreation: Could not find parent for " << interface->object();
never executed: ;
never executed: QMessageLogger(__FILE__, 1210, __PRETTY_FUNCTION__).debug() << "AtSpiAdaptor::notifyAboutCreation: Could not find parent for " << interface->object();
!::isDebuggingDescription
TRUEnever evaluated
FALSEnever evaluated
0
1211 return;
never executed: return;
0
1212 }-
1213 QString path = pathForInterface(interface);-
1214 int childCount = parent->childCount();-
1215 QString parentPath = pathForInterface(parent);-
1216 QVariantList args = packDBusSignalArguments(QLatin1String("add"), childCount, 0, variantForPath(path));-
1217 sendDBusSignal(parentPath, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT), QLatin1String("ChildrenChanged"), args);-
1218}
never executed: end of block
0
1219-
1220void AtSpiAdaptor::notifyAboutDestruction(QAccessibleInterface *interface) const-
1221{-
1222 if (!interface || !interface->isValid())
!interfaceDescription
TRUEnever evaluated
FALSEnever evaluated
!interface->isValid()Description
TRUEnever evaluated
FALSEnever evaluated
0
1223 return;
never executed: return;
0
1224-
1225 QAccessibleInterface * parent = interface->parent();-
1226 if (!parent) {
!parentDescription
TRUEnever evaluated
FALSEnever evaluated
0
1227 qAtspiDebug() << "AtSpiAdaptor::notifyAboutDestruction: Could not find parent for " << interface->object();
never executed: ;
never executed: QMessageLogger(__FILE__, 1227, __PRETTY_FUNCTION__).debug() << "AtSpiAdaptor::notifyAboutDestruction: Could not find parent for " << interface->object();
!::isDebuggingDescription
TRUEnever evaluated
FALSEnever evaluated
0
1228 return;
never executed: return;
0
1229 }-
1230 QString path = pathForInterface(interface);-
1231-
1232 // this is in the destructor. we have no clue which child we used to be.-
1233 // FIXME-
1234 int childIndex = -1;-
1235 // if (child) {-
1236 // childIndex = child;-
1237 // } else {-
1238 // childIndex = parent->indexOfChild(interface);-
1239 // }-
1240-
1241 QString parentPath = pathForInterface(parent);-
1242 QVariantList args = packDBusSignalArguments(QLatin1String("remove"), childIndex, 0, variantForPath(path));-
1243 sendDBusSignal(parentPath, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT), QLatin1String("ChildrenChanged"), args);-
1244}
never executed: end of block
0
1245-
1246/*!-
1247 Handle incoming DBus message.-
1248 This function dispatches the dbus message to the right interface handler.-
1249 */-
1250bool AtSpiAdaptor::handleMessage(const QDBusMessage &message, const QDBusConnection &connection)-
1251{-
1252 // get accessible interface-
1253 QAccessibleInterface * accessible = interfaceFromPath(message.path());-
1254 if (!accessible) {
!accessibleDescription
TRUEnever evaluated
FALSEnever evaluated
0
1255 qAtspiDebug() << "WARNING Qt AtSpiAdaptor: Could not find accessible on path: " << message.path();
never executed: ;
never executed: QMessageLogger(__FILE__, 1255, __PRETTY_FUNCTION__).debug() << "WARNING Qt AtSpiAdaptor: Could not find accessible on path: " << message.path();
!::isDebuggingDescription
TRUEnever evaluated
FALSEnever evaluated
0
1256 return false;
never executed: return false;
0
1257 }-
1258 if (!accessible->isValid()) {
!accessible->isValid()Description
TRUEnever evaluated
FALSEnever evaluated
0
1259 qWarning() << "WARNING Qt AtSpiAdaptor: Accessible invalid: " << accessible << message.path();-
1260 return false;
never executed: return false;
0
1261 }-
1262-
1263 QString interface = message.interface();-
1264 QString function = message.member();-
1265-
1266 // qAtspiDebug() << "AtSpiAdaptor::handleMessage: " << interface << function;-
1267-
1268 if (function == QLatin1String("Introspect")) {
function == QL...("Introspect")Description
TRUEnever evaluated
FALSEnever evaluated
0
1269 //introspect(message.path());-
1270 return false;
never executed: return false;
0
1271 }-
1272-
1273 // handle properties like regular functions-
1274 if (interface == QLatin1String("org.freedesktop.DBus.Properties")) {
interface == Q...s.Properties")Description
TRUEnever evaluated
FALSEnever evaluated
0
1275 interface = message.arguments().at(0).toString();-
1276 // Get/Set + Name-
1277 function = message.member() + message.arguments().at(1).toString();-
1278 }
never executed: end of block
0
1279-
1280 // switch interface to call-
1281 if (interface == QLatin1String(ATSPI_DBUS_INTERFACE_ACCESSIBLE))
interface == Q...i.Accessible")Description
TRUEnever evaluated
FALSEnever evaluated
0
1282 return accessibleInterface(accessible, function, message, connection);
never executed: return accessibleInterface(accessible, function, message, connection);
0
1283 if (interface == QLatin1String(ATSPI_DBUS_INTERFACE_APPLICATION))
interface == Q....Application")Description
TRUEnever evaluated
FALSEnever evaluated
0
1284 return applicationInterface(accessible, function, message, connection);
never executed: return applicationInterface(accessible, function, message, connection);
0
1285 if (interface == QLatin1String(ATSPI_DBUS_INTERFACE_COMPONENT))
interface == Q...pi.Component")Description
TRUEnever evaluated
FALSEnever evaluated
0
1286 return componentInterface(accessible, function, message, connection);
never executed: return componentInterface(accessible, function, message, connection);
0
1287 if (interface == QLatin1String(ATSPI_DBUS_INTERFACE_ACTION))
interface == Q...atspi.Action")Description
TRUEnever evaluated
FALSEnever evaluated
0
1288 return actionInterface(accessible, function, message, connection);
never executed: return actionInterface(accessible, function, message, connection);
0
1289 if (interface == QLatin1String(ATSPI_DBUS_INTERFACE_TEXT))
interface == Q...y.atspi.Text")Description
TRUEnever evaluated
FALSEnever evaluated
0
1290 return textInterface(accessible, function, message, connection);
never executed: return textInterface(accessible, function, message, connection);
0
1291 if (interface == QLatin1String(ATSPI_DBUS_INTERFACE_EDITABLE_TEXT))
interface == Q...EditableText")Description
TRUEnever evaluated
FALSEnever evaluated
0
1292 return editableTextInterface(accessible, function, message, connection);
never executed: return editableTextInterface(accessible, function, message, connection);
0
1293 if (interface == QLatin1String(ATSPI_DBUS_INTERFACE_VALUE))
interface == Q....atspi.Value")Description
TRUEnever evaluated
FALSEnever evaluated
0
1294 return valueInterface(accessible, function, message, connection);
never executed: return valueInterface(accessible, function, message, connection);
0
1295 if (interface == QLatin1String(ATSPI_DBUS_INTERFACE_TABLE))
interface == Q....atspi.Table")Description
TRUEnever evaluated
FALSEnever evaluated
0
1296 return tableInterface(accessible, function, message, connection);
never executed: return tableInterface(accessible, function, message, connection);
0
1297-
1298 qAtspiDebug() << "AtSpiAdaptor::handleMessage with unknown interface: " << message.path() << interface << function;
never executed: ;
never executed: QMessageLogger(__FILE__, 1298, __PRETTY_FUNCTION__).debug() << "AtSpiAdaptor::handleMessage with unknown interface: " << message.path() << interface << function;
!::isDebuggingDescription
TRUEnever evaluated
FALSEnever evaluated
0
1299 return false;
never executed: return false;
0
1300}-
1301-
1302// Application-
1303bool AtSpiAdaptor::applicationInterface(QAccessibleInterface *interface, const QString &function, const QDBusMessage &message, const QDBusConnection &connection)-
1304{-
1305 if (message.path() != QLatin1String(ATSPI_DBUS_PATH_ROOT)) {
message.path()...essible/root")Description
TRUEnever evaluated
FALSEnever evaluated
0
1306 qAtspiDebug() << "WARNING Qt AtSpiAdaptor: Could not find application interface for: " << message.path() << interface;
never executed: ;
never executed: QMessageLogger(__FILE__, 1306, __PRETTY_FUNCTION__).debug() << "WARNING Qt AtSpiAdaptor: Could not find application interface for: " << message.path() << interface;
!::isDebuggingDescription
TRUEnever evaluated
FALSEnever evaluated
0
1307 return false;
never executed: return false;
0
1308 }-
1309-
1310 if (function == QLatin1String("SetId")) {
function == QL...tring("SetId")Description
TRUEnever evaluated
FALSEnever evaluated
0
1311 Q_ASSERT(message.signature() == QLatin1String("ssv"));-
1312 QVariant value = qvariant_cast<QDBusVariant>(message.arguments().at(2)).variant();-
1313-
1314 m_applicationId = value.toInt();-
1315 return true;
never executed: return true;
0
1316 }-
1317 if (function == QLatin1String("GetId")) {
function == QL...tring("GetId")Description
TRUEnever evaluated
FALSEnever evaluated
0
1318 Q_ASSERT(message.signature() == QLatin1String("ss"));-
1319 QDBusMessage reply = message.createReply(QVariant::fromValue(QDBusVariant(m_applicationId)));-
1320 return connection.send(reply);
never executed: return connection.send(reply);
0
1321 }-
1322 if (function == QLatin1String("GetToolkitName")) {
function == QL...tToolkitName")Description
TRUEnever evaluated
FALSEnever evaluated
0
1323 Q_ASSERT(message.signature() == QLatin1String("ss"));-
1324 QDBusMessage reply = message.createReply(QVariant::fromValue(QDBusVariant(QLatin1String("Qt"))));-
1325 return connection.send(reply);
never executed: return connection.send(reply);
0
1326 }-
1327 if (function == QLatin1String("GetVersion")) {
function == QL...("GetVersion")Description
TRUEnever evaluated
FALSEnever evaluated
0
1328 Q_ASSERT(message.signature() == QLatin1String("ss"));-
1329 QDBusMessage reply = message.createReply(QVariant::fromValue(QDBusVariant(QLatin1String(qVersion()))));-
1330 return connection.send(reply);
never executed: return connection.send(reply);
0
1331 }-
1332 if (function == QLatin1String("GetLocale")) {
function == QL...g("GetLocale")Description
TRUEnever evaluated
FALSEnever evaluated
0
1333 Q_ASSERT(message.signature() == QLatin1String("u"));-
1334 QDBusMessage reply = message.createReply(QVariant::fromValue(QLocale().name()));-
1335 return connection.send(reply);
never executed: return connection.send(reply);
0
1336 }-
1337 qAtspiDebug() << "AtSpiAdaptor::applicationInterface " << message.path() << interface << function;
never executed: ;
never executed: QMessageLogger(__FILE__, 1337, __PRETTY_FUNCTION__).debug() << "AtSpiAdaptor::applicationInterface " << message.path() << interface << function;
!::isDebuggingDescription
TRUEnever evaluated
FALSEnever evaluated
0
1338 return false;
never executed: return false;
0
1339}-
1340-
1341/*!-
1342 Register this application as accessible on the accessibility DBus.-
1343 */-
1344void AtSpiAdaptor::registerApplication()-
1345{-
1346 OrgA11yAtspiSocketInterface *registry;-
1347 registry = new OrgA11yAtspiSocketInterface(QLatin1String(QSPI_REGISTRY_NAME),-
1348 QLatin1String(QSPI_OBJECT_PATH_ROOT), m_dbus->connection());-
1349-
1350 QDBusPendingReply<QSpiObjectReference> reply;-
1351 QSpiObjectReference ref = QSpiObjectReference(m_dbus->connection(), QDBusObjectPath(QSPI_OBJECT_PATH_ROOT));-
1352 reply = registry->Embed(ref);-
1353 reply.waitForFinished(); // TODO: make this async-
1354 if (reply.isValid ()) {
reply.isValid ()Description
TRUEnever evaluated
FALSEnever evaluated
0
1355 const QSpiObjectReference &socket = reply.value();-
1356 accessibilityRegistry = QSpiObjectReference(socket);-
1357 } else {
never executed: end of block
0
1358 qAtspiDebug() << "Error in contacting registry: "
never executed: ;
never executed: QMessageLogger(__FILE__, 1358, __PRETTY_FUNCTION__).debug() << "Error in contacting registry: " << reply.error().name() << reply.error().message();
!::isDebuggingDescription
TRUEnever evaluated
FALSEnever evaluated
0
1359 << reply.error().name()
never executed: QMessageLogger(__FILE__, 1358, __PRETTY_FUNCTION__).debug() << "Error in contacting registry: " << reply.error().name() << reply.error().message();
0
1360 << reply.error().message();
never executed: QMessageLogger(__FILE__, 1358, __PRETTY_FUNCTION__).debug() << "Error in contacting registry: " << reply.error().name() << reply.error().message();
0
1361 }-
1362 delete registry;-
1363}
never executed: end of block
0
1364-
1365// Accessible-
1366bool AtSpiAdaptor::accessibleInterface(QAccessibleInterface *interface, const QString &function, const QDBusMessage &message, const QDBusConnection &connection)-
1367{-
1368 if (function == QLatin1String("GetRole")) {
function == QL...ing("GetRole")Description
TRUEnever evaluated
FALSEnever evaluated
0
1369 sendReply(connection, message, (uint) getRole(interface));-
1370 } else if (function == QLatin1String("GetName")) {
never executed: end of block
function == QL...ing("GetName")Description
TRUEnever evaluated
FALSEnever evaluated
0
1371 sendReply(connection, message, QVariant::fromValue(QDBusVariant(interface->text(QAccessible::Name))));-
1372 } else if (function == QLatin1String("GetRoleName")) {
never executed: end of block
function == QL..."GetRoleName")Description
TRUEnever evaluated
FALSEnever evaluated
0
1373 sendReply(connection, message, qSpiRoleMapping[interface->role()].name());-
1374 } else if (function == QLatin1String("GetLocalizedRoleName")) {
never executed: end of block
function == QL...izedRoleName")Description
TRUEnever evaluated
FALSEnever evaluated
0
1375 sendReply(connection, message, QVariant::fromValue(qSpiRoleMapping[interface->role()].localizedName()));-
1376 } else if (function == QLatin1String("GetChildCount")) {
never executed: end of block
function == QL...etChildCount")Description
TRUEnever evaluated
FALSEnever evaluated
0
1377 sendReply(connection, message, QVariant::fromValue(QDBusVariant(interface->childCount())));-
1378 } else if (function == QLatin1String("GetIndexInParent")) {
never executed: end of block
function == QL...ndexInParent")Description
TRUEnever evaluated
FALSEnever evaluated
0
1379 int childIndex = -1;-
1380 QAccessibleInterface * parent = interface->parent();-
1381 if (parent) {
parentDescription
TRUEnever evaluated
FALSEnever evaluated
0
1382 childIndex = parent->indexOfChild(interface);-
1383 if (childIndex < 0) {
childIndex < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1384 qAtspiDebug() << "GetIndexInParent get invalid index: " << childIndex << interface;
never executed: ;
never executed: QMessageLogger(__FILE__, 1384, __PRETTY_FUNCTION__).debug() << "GetIndexInParent get invalid index: " << childIndex << interface;
!::isDebuggingDescription
TRUEnever evaluated
FALSEnever evaluated
0
1385 }-
1386 }
never executed: end of block
0
1387 sendReply(connection, message, childIndex);-
1388 } else if (function == QLatin1String("GetParent")) {
never executed: end of block
function == QL...g("GetParent")Description
TRUEnever evaluated
FALSEnever evaluated
0
1389 QString path;-
1390 QAccessibleInterface * parent = interface->parent();-
1391 if (!parent) {
!parentDescription
TRUEnever evaluated
FALSEnever evaluated
0
1392 path = QLatin1String(ATSPI_DBUS_PATH_NULL);-
1393 } else if (parent->role() == QAccessible::Application) {
never executed: end of block
parent->role()...e::ApplicationDescription
TRUEnever evaluated
FALSEnever evaluated
0
1394 path = QLatin1String(ATSPI_DBUS_PATH_ROOT);-
1395 } else {
never executed: end of block
0
1396 path = pathForInterface(parent);-
1397 }
never executed: end of block
0
1398 // Parent is a property, so it needs to be wrapped inside an extra variant.-
1399 sendReply(connection, message, QVariant::fromValue(-
1400 QDBusVariant(QVariant::fromValue(QSpiObjectReference(connection, QDBusObjectPath(path))))));-
1401 } else if (function == QLatin1String("GetChildAtIndex")) {
never executed: end of block
function == QL...ChildAtIndex")Description
TRUEnever evaluated
FALSEnever evaluated
0
1402 int index = message.arguments().first().toInt();-
1403 if (index < 0) {
index < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1404 sendReply(connection, message, QVariant::fromValue(-
1405 QSpiObjectReference(connection, QDBusObjectPath(ATSPI_DBUS_PATH_NULL))));-
1406 } else {
never executed: end of block
0
1407 QAccessibleInterface * childInterface = interface->child(index);-
1408 sendReply(connection, message, QVariant::fromValue(-
1409 QSpiObjectReference(connection, QDBusObjectPath(pathForInterface(childInterface)))));-
1410 }
never executed: end of block
0
1411 } else if (function == QLatin1String("GetInterfaces")) {
function == QL...etInterfaces")Description
TRUEnever evaluated
FALSEnever evaluated
0
1412 sendReply(connection, message, accessibleInterfaces(interface));-
1413 } else if (function == QLatin1String("GetDescription")) {
never executed: end of block
function == QL...tDescription")Description
TRUEnever evaluated
FALSEnever evaluated
0
1414 sendReply(connection, message, QVariant::fromValue(QDBusVariant(interface->text(QAccessible::Description))));-
1415 } else if (function == QLatin1String("GetState")) {
never executed: end of block
function == QL...ng("GetState")Description
TRUEnever evaluated
FALSEnever evaluated
0
1416 quint64 spiState = spiStatesFromQState(interface->state());-
1417 if (interface->tableInterface()) {
interface->tableInterface()Description
TRUEnever evaluated
FALSEnever evaluated
0
1418 setSpiStateBit(&spiState, ATSPI_STATE_MANAGES_DESCENDANTS);-
1419 }
never executed: end of block
0
1420 QAccessible::Role role = interface->role();-
1421 if (role == QAccessible::TreeItem ||
role == QAccessible::TreeItemDescription
TRUEnever evaluated
FALSEnever evaluated
0
1422 role == QAccessible::ListItem) {
role == QAccessible::ListItemDescription
TRUEnever evaluated
FALSEnever evaluated
0
1423 /* Transient means libatspi2 will not cache items.-
1424 This is important because when adding/removing an item-
1425 the cache becomes outdated and we don't change the paths of-
1426 items in lists/trees/tables. */-
1427 setSpiStateBit(&spiState, ATSPI_STATE_TRANSIENT);-
1428 }
never executed: end of block
0
1429 sendReply(connection, message,-
1430 QVariant::fromValue(spiStateSetFromSpiStates(spiState)));-
1431 } else if (function == QLatin1String("GetAttributes")) {
never executed: end of block
function == QL...etAttributes")Description
TRUEnever evaluated
FALSEnever evaluated
0
1432 sendReply(connection, message, QVariant::fromValue(QSpiAttributeSet()));-
1433 } else if (function == QLatin1String("GetRelationSet")) {
never executed: end of block
function == QL...tRelationSet")Description
TRUEnever evaluated
FALSEnever evaluated
0
1434 sendReply(connection, message, QVariant::fromValue(relationSet(interface, connection)));-
1435 } else if (function == QLatin1String("GetApplication")) {
never executed: end of block
function == QL...tApplication")Description
TRUEnever evaluated
FALSEnever evaluated
0
1436 sendReply(connection, message, QVariant::fromValue(-
1437 QSpiObjectReference(connection, QDBusObjectPath(QSPI_OBJECT_PATH_ROOT))));-
1438 } else if (function == QLatin1String("GetChildren")) {
never executed: end of block
function == QL..."GetChildren")Description
TRUEnever evaluated
FALSEnever evaluated
0
1439 QSpiObjectReferenceArray children;-
1440 const int numChildren = interface->childCount();-
1441 children.reserve(numChildren);-
1442 for (int i = 0; i < numChildren; ++i) {
i < numChildrenDescription
TRUEnever evaluated
FALSEnever evaluated
0
1443 QString childPath = pathForInterface(interface->child(i));-
1444 QSpiObjectReference ref(connection, QDBusObjectPath(childPath));-
1445 children << ref;-
1446 }
never executed: end of block
0
1447 connection.send(message.createReply(QVariant::fromValue(children)));-
1448 } else {
never executed: end of block
0
1449 qAtspiDebug() << "WARNING: AtSpiAdaptor::accessibleInterface does not implement " << function << message.path();
never executed: ;
never executed: QMessageLogger(__FILE__, 1449, __PRETTY_FUNCTION__).debug() << "WARNING: AtSpiAdaptor::accessibleInterface does not implement " << function << message.path();
!::isDebuggingDescription
TRUEnever evaluated
FALSEnever evaluated
0
1450 return false;
never executed: return false;
0
1451 }-
1452 return true;
never executed: return true;
0
1453}-
1454-
1455AtspiRole AtSpiAdaptor::getRole(QAccessibleInterface *interface) const-
1456{-
1457 if ((interface->role() == QAccessible::EditableText) && interface->state().passwordEdit)
(interface->ro...:EditableText)Description
TRUEnever evaluated
FALSEnever evaluated
interface->sta...).passwordEditDescription
TRUEnever evaluated
FALSEnever evaluated
0
1458 return ATSPI_ROLE_PASSWORD_TEXT;
never executed: return ATSPI_ROLE_PASSWORD_TEXT;
0
1459 return qSpiRoleMapping[interface->role()].spiRole();
never executed: return qSpiRoleMapping[interface->role()].spiRole();
0
1460}-
1461-
1462//#define ACCESSIBLE_CREATION_DEBUG-
1463-
1464QStringList AtSpiAdaptor::accessibleInterfaces(QAccessibleInterface *interface) const-
1465{-
1466 QStringList ifaces;-
1467#ifdef ACCESSIBLE_CREATION_DEBUG-
1468 qAtspiDebug() << "AtSpiAdaptor::accessibleInterfaces create: " << interface->object();-
1469#endif-
1470 ifaces << QLatin1String(ATSPI_DBUS_INTERFACE_ACCESSIBLE);-
1471-
1472 if ( (!interface->rect().isEmpty()) ||
(!interface->rect().isEmpty())Description
TRUEnever evaluated
FALSEnever evaluated
0
1473 (interface->object() && interface->object()->isWidgetType()) ||
interface->object()Description
TRUEnever evaluated
FALSEnever evaluated
interface->obj...isWidgetType()Description
TRUEnever evaluated
FALSEnever evaluated
0
1474 (interface->role() == QAccessible::ListItem) ||
(interface->ro...ble::ListItem)Description
TRUEnever evaluated
FALSEnever evaluated
0
1475 (interface->role() == QAccessible::Cell) ||
(interface->ro...essible::Cell)Description
TRUEnever evaluated
FALSEnever evaluated
0
1476 (interface->role() == QAccessible::TreeItem) ||
(interface->ro...ble::TreeItem)Description
TRUEnever evaluated
FALSEnever evaluated
0
1477 (interface->role() == QAccessible::Row) ||
(interface->ro...cessible::Row)Description
TRUEnever evaluated
FALSEnever evaluated
0
1478 (interface->object() && interface->object()->inherits("QSGItem"))
interface->object()Description
TRUEnever evaluated
FALSEnever evaluated
interface->obj...its("QSGItem")Description
TRUEnever evaluated
FALSEnever evaluated
0
1479 ) {-
1480 ifaces << QLatin1String(ATSPI_DBUS_INTERFACE_COMPONENT);-
1481 }
never executed: end of block
0
1482#ifdef ACCESSIBLE_CREATION_DEBUG-
1483 else {-
1484 qAtspiDebug(" IS NOT a component");-
1485 }-
1486#endif-
1487 if (interface->role() == QAccessible::Application)
interface->rol...e::ApplicationDescription
TRUEnever evaluated
FALSEnever evaluated
0
1488 ifaces << QLatin1String(ATSPI_DBUS_INTERFACE_APPLICATION);
never executed: ifaces << QLatin1String("org.a11y.atspi.Application");
0
1489-
1490 if (interface->actionInterface() || interface->valueInterface())
interface->actionInterface()Description
TRUEnever evaluated
FALSEnever evaluated
interface->valueInterface()Description
TRUEnever evaluated
FALSEnever evaluated
0
1491 ifaces << QLatin1String(ATSPI_DBUS_INTERFACE_ACTION);
never executed: ifaces << QLatin1String("org.a11y.atspi.Action");
0
1492-
1493 if (interface->textInterface())
interface->textInterface()Description
TRUEnever evaluated
FALSEnever evaluated
0
1494 ifaces << QLatin1String(ATSPI_DBUS_INTERFACE_TEXT);
never executed: ifaces << QLatin1String("org.a11y.atspi.Text");
0
1495-
1496 if (interface->editableTextInterface())
interface->edi...extInterface()Description
TRUEnever evaluated
FALSEnever evaluated
0
1497 ifaces << QLatin1String(ATSPI_DBUS_INTERFACE_EDITABLE_TEXT);
never executed: ifaces << QLatin1String("org.a11y.atspi.EditableText");
0
1498-
1499 if (interface->valueInterface())
interface->valueInterface()Description
TRUEnever evaluated
FALSEnever evaluated
0
1500 ifaces << QLatin1String(ATSPI_DBUS_INTERFACE_VALUE);
never executed: ifaces << QLatin1String("org.a11y.atspi.Value");
0
1501-
1502 if (interface->tableInterface())
interface->tableInterface()Description
TRUEnever evaluated
FALSEnever evaluated
0
1503 ifaces << QLatin1String(ATSPI_DBUS_INTERFACE_TABLE);
never executed: ifaces << QLatin1String("org.a11y.atspi.Table");
0
1504-
1505 return ifaces;
never executed: return ifaces;
0
1506}-
1507-
1508QSpiRelationArray AtSpiAdaptor::relationSet(QAccessibleInterface *interface, const QDBusConnection &connection) const-
1509{-
1510 typedef QPair<QAccessibleInterface*, QAccessible::Relation> RelationPair;-
1511 QVector<RelationPair> relationInterfaces;-
1512 relationInterfaces = interface->relations();-
1513-
1514 QSpiRelationArray relations;-
1515 Q_FOREACH (const RelationPair &pair, relationInterfaces) {-
1516// FIXME: this loop seems a bit strange... "related" always have one item when we check.-
1517//And why is it a list, when it always have one item? And it seems to assume that the QAccessible::Relation enum maps directly to AtSpi-
1518 QSpiObjectReferenceArray related;-
1519-
1520 QDBusObjectPath path = QDBusObjectPath(pathForInterface(pair.first));-
1521 related.append(QSpiObjectReference(connection, path));-
1522-
1523 if (!related.isEmpty())
!related.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
0
1524 relations.append(QSpiRelationArrayEntry(qAccessibleRelationToAtSpiRelation(pair.second), related));
never executed: relations.append(QSpiRelationArrayEntry(qAccessibleRelationToAtSpiRelation(pair.second), related));
0
1525 }
never executed: end of block
0
1526 return relations;
never executed: return relations;
0
1527}-
1528-
1529void AtSpiAdaptor::sendReply(const QDBusConnection &connection, const QDBusMessage &message, const QVariant &argument) const-
1530{-
1531 QDBusMessage reply = message.createReply(argument);-
1532 connection.send(reply);-
1533}
never executed: end of block
0
1534-
1535-
1536QString AtSpiAdaptor::pathForObject(QObject *object) const-
1537{-
1538 Q_ASSERT(object);-
1539-
1540 if (inheritsQAction(object)) {
inheritsQAction(object)Description
TRUEnever evaluated
FALSEnever evaluated
0
1541 qAtspiDebug("AtSpiAdaptor::pathForObject: warning: creating path with QAction as object.");
never executed: ;
never executed: QMessageLogger(__FILE__, 1541, __PRETTY_FUNCTION__).debug("AtSpiAdaptor::pathForObject: warning: creating path with QAction as object.");
!::isDebuggingDescription
TRUEnever evaluated
FALSEnever evaluated
0
1542 }-
1543-
1544 QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(object);-
1545 return pathForInterface(iface);
never executed: return pathForInterface(iface);
0
1546}-
1547-
1548QString AtSpiAdaptor::pathForInterface(QAccessibleInterface *interface) const-
1549{-
1550 if (!interface || !interface->isValid())
!interfaceDescription
TRUEnever evaluated
FALSEnever evaluated
!interface->isValid()Description
TRUEnever evaluated
FALSEnever evaluated
0
1551 return QLatin1String(ATSPI_DBUS_PATH_NULL);
never executed: return QLatin1String("/org/a11y/atspi/null");
0
1552 if (interface->role() == QAccessible::Application)
interface->rol...e::ApplicationDescription
TRUEnever evaluated
FALSEnever evaluated
0
1553 return QLatin1String(QSPI_OBJECT_PATH_ROOT);
never executed: return QLatin1String("/org/a11y/atspi/accessible/" "root");
0
1554-
1555 QAccessible::Id id = QAccessible::uniqueId(interface);-
1556 Q_ASSERT((int)id < 0);-
1557 return QLatin1String(QSPI_OBJECT_PATH_PREFIX) + QString::number(id);
never executed: return QLatin1String("/org/a11y/atspi/accessible/") + QString::number(id);
0
1558}-
1559-
1560bool AtSpiAdaptor::inheritsQAction(QObject *object)-
1561{-
1562 const QMetaObject *mo = object->metaObject();-
1563 while (mo) {
moDescription
TRUEnever evaluated
FALSEnever evaluated
0
1564 const QLatin1String cn(mo->className());-
1565 if (cn == QLatin1String("QAction"))
cn == QLatin1String("QAction")Description
TRUEnever evaluated
FALSEnever evaluated
0
1566 return true;
never executed: return true;
0
1567 mo = mo->superClass();-
1568 }
never executed: end of block
0
1569 return false;
never executed: return false;
0
1570}-
1571-
1572// Component-
1573static QAccessibleInterface * getWindow(QAccessibleInterface * interface)-
1574{-
1575 if (interface->role() == QAccessible::Window)
interface->rol...ssible::WindowDescription
TRUEnever evaluated
FALSEnever evaluated
0
1576 return interface;
never executed: return interface;
0
1577-
1578 QAccessibleInterface * parent = interface->parent();-
1579 while (parent && parent->role() != QAccessible::Window)
parentDescription
TRUEnever evaluated
FALSEnever evaluated
parent->role()...ssible::WindowDescription
TRUEnever evaluated
FALSEnever evaluated
0
1580 parent = parent->parent();
never executed: parent = parent->parent();
0
1581-
1582 return parent;
never executed: return parent;
0
1583}-
1584-
1585static QRect getRelativeRect(QAccessibleInterface *interface)-
1586{-
1587 QAccessibleInterface * window;-
1588 QRect wr, cr;-
1589-
1590 cr = interface->rect();-
1591-
1592 window = getWindow(interface);-
1593 if (window) {
windowDescription
TRUEnever evaluated
FALSEnever evaluated
0
1594 wr = window->rect();-
1595-
1596 cr.setX(cr.x() - wr.x());-
1597 cr.setY(cr.x() - wr.y());-
1598 }
never executed: end of block
0
1599 return cr;
never executed: return cr;
0
1600}-
1601-
1602bool AtSpiAdaptor::componentInterface(QAccessibleInterface *interface, const QString &function, const QDBusMessage &message, const QDBusConnection &connection)-
1603{-
1604 if (function == QLatin1String("Contains")) {
function == QL...ng("Contains")Description
TRUEnever evaluated
FALSEnever evaluated
0
1605 bool ret = false;-
1606 int x = message.arguments().at(0).toInt();-
1607 int y = message.arguments().at(1).toInt();-
1608 uint coordType = message.arguments().at(2).toUInt();-
1609 if (coordType == ATSPI_COORD_TYPE_SCREEN)
coordType == A...RD_TYPE_SCREENDescription
TRUEnever evaluated
FALSEnever evaluated
0
1610 ret = interface->rect().contains(x, y);
never executed: ret = interface->rect().contains(x, y);
0
1611 else-
1612 ret = getRelativeRect(interface).contains(x, y);
never executed: ret = getRelativeRect(interface).contains(x, y);
0
1613 sendReply(connection, message, ret);-
1614 } else if (function == QLatin1String("GetAccessibleAtPoint")) {
never executed: end of block
function == QL...sibleAtPoint")Description
TRUEnever evaluated
FALSEnever evaluated
0
1615 int x = message.arguments().at(0).toInt();-
1616 int y = message.arguments().at(1).toInt();-
1617 uint coordType = message.arguments().at(2).toUInt();-
1618 Q_UNUSED (coordType) // FIXME-
1619-
1620 QAccessibleInterface * childInterface(interface->childAt(x, y));-
1621 QAccessibleInterface * iface = 0;-
1622 while (childInterface) {
childInterfaceDescription
TRUEnever evaluated
FALSEnever evaluated
0
1623 iface = childInterface;-
1624 childInterface = iface->childAt(x, y);-
1625 }
never executed: end of block
0
1626 if (iface) {
ifaceDescription
TRUEnever evaluated
FALSEnever evaluated
0
1627 QString path = pathForInterface(iface);-
1628 sendReply(connection, message, QVariant::fromValue(-
1629 QSpiObjectReference(connection, QDBusObjectPath(path))));-
1630 } else {
never executed: end of block
0
1631 sendReply(connection, message, QVariant::fromValue(-
1632 QSpiObjectReference(connection, QDBusObjectPath(ATSPI_DBUS_PATH_NULL))));-
1633 }
never executed: end of block
0
1634 } else if (function == QLatin1String("GetAlpha")) {
function == QL...ng("GetAlpha")Description
TRUEnever evaluated
FALSEnever evaluated
0
1635 sendReply(connection, message, (double) 1.0);-
1636 } else if (function == QLatin1String("GetExtents")) {
never executed: end of block
function == QL...("GetExtents")Description
TRUEnever evaluated
FALSEnever evaluated
0
1637 uint coordType = message.arguments().at(0).toUInt();-
1638 sendReply(connection, message, QVariant::fromValue(getExtents(interface, coordType)));-
1639 } else if (function == QLatin1String("GetLayer")) {
never executed: end of block
function == QL...ng("GetLayer")Description
TRUEnever evaluated
FALSEnever evaluated
0
1640 sendReply(connection, message, QVariant::fromValue((uint)1));-
1641 } else if (function == QLatin1String("GetMDIZOrder")) {
never executed: end of block
function == QL...GetMDIZOrder")Description
TRUEnever evaluated
FALSEnever evaluated
0
1642 sendReply(connection, message, QVariant::fromValue((short)0));-
1643 } else if (function == QLatin1String("GetPosition")) {
never executed: end of block
function == QL..."GetPosition")Description
TRUEnever evaluated
FALSEnever evaluated
0
1644 uint coordType = message.arguments().at(0).toUInt();-
1645 QRect rect;-
1646 if (coordType == ATSPI_COORD_TYPE_SCREEN)
coordType == A...RD_TYPE_SCREENDescription
TRUEnever evaluated
FALSEnever evaluated
0
1647 rect = interface->rect();
never executed: rect = interface->rect();
0
1648 else-
1649 rect = getRelativeRect(interface);
never executed: rect = getRelativeRect(interface);
0
1650 QVariantList pos;-
1651 pos << rect.x() << rect.y();-
1652 connection.send(message.createReply(pos));-
1653 } else if (function == QLatin1String("GetSize")) {
never executed: end of block
function == QL...ing("GetSize")Description
TRUEnever evaluated
FALSEnever evaluated
0
1654 QRect rect = interface->rect();-
1655 QVariantList size;-
1656 size << rect.width() << rect.height();-
1657 connection.send(message.createReply(size));-
1658 } else if (function == QLatin1String("GrabFocus")) {
never executed: end of block
function == QL...g("GrabFocus")Description
TRUEnever evaluated
FALSEnever evaluated
0
1659 QAccessibleActionInterface *actionIface = interface->actionInterface();-
1660 if (actionIface && actionIface->actionNames().contains(QAccessibleActionInterface::setFocusAction())) {
actionIfaceDescription
TRUEnever evaluated
FALSEnever evaluated
actionIface->a...FocusAction())Description
TRUEnever evaluated
FALSEnever evaluated
0
1661 actionIface->doAction(QAccessibleActionInterface::setFocusAction());-
1662 sendReply(connection, message, true);-
1663 } else {
never executed: end of block
0
1664 sendReply(connection, message, false);-
1665 }
never executed: end of block
0
1666 } else if (function == QLatin1String("SetExtents")) {
function == QL...("SetExtents")Description
TRUEnever evaluated
FALSEnever evaluated
0
1667// int x = message.arguments().at(0).toInt();-
1668// int y = message.arguments().at(1).toInt();-
1669// int width = message.arguments().at(2).toInt();-
1670// int height = message.arguments().at(3).toInt();-
1671// uint coordinateType = message.arguments().at(4).toUInt();-
1672 qAtspiDebug("SetExtents is not implemented.");
never executed: ;
never executed: QMessageLogger(__FILE__, 1672, __PRETTY_FUNCTION__).debug("SetExtents is not implemented.");
!::isDebuggingDescription
TRUEnever evaluated
FALSEnever evaluated
0
1673 sendReply(connection, message, false);-
1674 } else if (function == QLatin1String("SetPosition")) {
never executed: end of block
function == QL..."SetPosition")Description
TRUEnever evaluated
FALSEnever evaluated
0
1675// int x = message.arguments().at(0).toInt();-
1676// int y = message.arguments().at(1).toInt();-
1677// uint coordinateType = message.arguments().at(2).toUInt();-
1678 qAtspiDebug("SetPosition is not implemented.");
never executed: ;
never executed: QMessageLogger(__FILE__, 1678, __PRETTY_FUNCTION__).debug("SetPosition is not implemented.");
!::isDebuggingDescription
TRUEnever evaluated
FALSEnever evaluated
0
1679 sendReply(connection, message, false);-
1680 } else if (function == QLatin1String("SetSize")) {
never executed: end of block
function == QL...ing("SetSize")Description
TRUEnever evaluated
FALSEnever evaluated
0
1681// int width = message.arguments().at(0).toInt();-
1682// int height = message.arguments().at(1).toInt();-
1683 qAtspiDebug("SetSize is not implemented.");
never executed: ;
never executed: QMessageLogger(__FILE__, 1683, __PRETTY_FUNCTION__).debug("SetSize is not implemented.");
!::isDebuggingDescription
TRUEnever evaluated
FALSEnever evaluated
0
1684 sendReply(connection, message, false);-
1685 } else {
never executed: end of block
0
1686 qAtspiDebug() << "WARNING: AtSpiAdaptor::componentInterface does not implement " << function << message.path();
never executed: ;
never executed: QMessageLogger(__FILE__, 1686, __PRETTY_FUNCTION__).debug() << "WARNING: AtSpiAdaptor::componentInterface does not implement " << function << message.path();
!::isDebuggingDescription
TRUEnever evaluated
FALSEnever evaluated
0
1687 return false;
never executed: return false;
0
1688 }-
1689 return true;
never executed: return true;
0
1690}-
1691-
1692QRect AtSpiAdaptor::getExtents(QAccessibleInterface *interface, uint coordType)-
1693{-
1694 return (coordType == ATSPI_COORD_TYPE_SCREEN) ? interface->rect() : getRelativeRect(interface);
never executed: return (coordType == ATSPI_COORD_TYPE_SCREEN) ? interface->rect() : getRelativeRect(interface);
0
1695}-
1696-
1697// Action interface-
1698bool AtSpiAdaptor::actionInterface(QAccessibleInterface *interface, const QString &function, const QDBusMessage &message, const QDBusConnection &connection)-
1699{-
1700 if (function == QLatin1String("GetNActions")) {
function == QL..."GetNActions")Description
TRUEnever evaluated
FALSEnever evaluated
0
1701 int count = QAccessibleBridgeUtils::effectiveActionNames(interface).count();-
1702 sendReply(connection, message, QVariant::fromValue(QDBusVariant(QVariant::fromValue(count))));-
1703 } else if (function == QLatin1String("DoAction")) {
never executed: end of block
function == QL...ng("DoAction")Description
TRUEnever evaluated
FALSEnever evaluated
0
1704 int index = message.arguments().at(0).toInt();-
1705 const QStringList actionNames = QAccessibleBridgeUtils::effectiveActionNames(interface);-
1706 if (index < 0 || index >= actionNames.count())
index < 0Description
TRUEnever evaluated
FALSEnever evaluated
index >= actionNames.count()Description
TRUEnever evaluated
FALSEnever evaluated
0
1707 return false;
never executed: return false;
0
1708 const QString actionName = actionNames.at(index);-
1709 bool success = QAccessibleBridgeUtils::performEffectiveAction(interface, actionName);-
1710 sendReply(connection, message, success);-
1711 } else if (function == QLatin1String("GetActions")) {
never executed: end of block
function == QL...("GetActions")Description
TRUEnever evaluated
FALSEnever evaluated
0
1712 sendReply(connection, message, QVariant::fromValue(getActions(interface)));-
1713 } else if (function == QLatin1String("GetName")) {
never executed: end of block
function == QL...ing("GetName")Description
TRUEnever evaluated
FALSEnever evaluated
0
1714 int index = message.arguments().at(0).toInt();-
1715 const QStringList actionNames = QAccessibleBridgeUtils::effectiveActionNames(interface);-
1716 if (index < 0 || index >= actionNames.count())
index < 0Description
TRUEnever evaluated
FALSEnever evaluated
index >= actionNames.count()Description
TRUEnever evaluated
FALSEnever evaluated
0
1717 return false;
never executed: return false;
0
1718 sendReply(connection, message, actionNames.at(index));-
1719 } else if (function == QLatin1String("GetDescription")) {
never executed: end of block
function == QL...tDescription")Description
TRUEnever evaluated
FALSEnever evaluated
0
1720 int index = message.arguments().at(0).toInt();-
1721 const QStringList actionNames = QAccessibleBridgeUtils::effectiveActionNames(interface);-
1722 if (index < 0 || index >= actionNames.count())
index < 0Description
TRUEnever evaluated
FALSEnever evaluated
index >= actionNames.count()Description
TRUEnever evaluated
FALSEnever evaluated
0
1723 return false;
never executed: return false;
0
1724 QString description;-
1725 if (QAccessibleActionInterface *actionIface = interface->actionInterface())
QAccessibleAct...ionInterface()Description
TRUEnever evaluated
FALSEnever evaluated
0
1726 description = actionIface->localizedActionDescription(actionNames.at(index));
never executed: description = actionIface->localizedActionDescription(actionNames.at(index));
0
1727 else-
1728 description = qAccessibleLocalizedActionDescription(actionNames.at(index));
never executed: description = qAccessibleLocalizedActionDescription(actionNames.at(index));
0
1729 sendReply(connection, message, description);-
1730 } else if (function == QLatin1String("GetKeyBinding")) {
never executed: end of block
function == QL...etKeyBinding")Description
TRUEnever evaluated
FALSEnever evaluated
0
1731 int index = message.arguments().at(0).toInt();-
1732 const QStringList actionNames = QAccessibleBridgeUtils::effectiveActionNames(interface);-
1733 if (index < 0 || index >= actionNames.count())
index < 0Description
TRUEnever evaluated
FALSEnever evaluated
index >= actionNames.count()Description
TRUEnever evaluated
FALSEnever evaluated
0
1734 return false;
never executed: return false;
0
1735 QStringList keyBindings;-
1736 if (QAccessibleActionInterface *actionIface = interface->actionInterface())
QAccessibleAct...ionInterface()Description
TRUEnever evaluated
FALSEnever evaluated
0
1737 keyBindings = actionIface->keyBindingsForAction(actionNames.at(index));
never executed: keyBindings = actionIface->keyBindingsForAction(actionNames.at(index));
0
1738 if (keyBindings.isEmpty()) {
keyBindings.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
0
1739 QString acc = interface->text(QAccessible::Accelerator);-
1740 if (!acc.isEmpty())
!acc.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
0
1741 keyBindings.append(acc);
never executed: keyBindings.append(acc);
0
1742 }
never executed: end of block
0
1743 if (keyBindings.length() > 0)
keyBindings.length() > 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1744 sendReply(connection, message, keyBindings.join(QLatin1Char(';')));
never executed: sendReply(connection, message, keyBindings.join(QLatin1Char(';')));
0
1745 else-
1746 sendReply(connection, message, QString());
never executed: sendReply(connection, message, QString());
0
1747 } else {-
1748 qAtspiDebug() << "WARNING: AtSpiAdaptor::actionInterface does not implement " << function << message.path();
never executed: ;
never executed: QMessageLogger(__FILE__, 1748, __PRETTY_FUNCTION__).debug() << "WARNING: AtSpiAdaptor::actionInterface does not implement " << function << message.path();
!::isDebuggingDescription
TRUEnever evaluated
FALSEnever evaluated
0
1749 return false;
never executed: return false;
0
1750 }-
1751 return true;
never executed: return true;
0
1752}-
1753-
1754QSpiActionArray AtSpiAdaptor::getActions(QAccessibleInterface *interface) const-
1755{-
1756 QAccessibleActionInterface *actionInterface = interface->actionInterface();-
1757 QSpiActionArray actions;-
1758 const QStringList actionNames = QAccessibleBridgeUtils::effectiveActionNames(interface);-
1759 actions.reserve(actionNames.size());-
1760 Q_FOREACH (const QString &actionName, actionNames) {-
1761 QSpiAction action;-
1762 QStringList keyBindings;-
1763-
1764 action.name = actionName;-
1765 if (actionInterface) {
actionInterfaceDescription
TRUEnever evaluated
FALSEnever evaluated
0
1766 action.description = actionInterface->localizedActionDescription(actionName);-
1767 keyBindings = actionInterface->keyBindingsForAction(actionName);-
1768 } else {
never executed: end of block
0
1769 action.description = qAccessibleLocalizedActionDescription(actionName);-
1770 }
never executed: end of block
0
1771-
1772 if (keyBindings.length() > 0)
keyBindings.length() > 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1773 action.keyBinding = keyBindings[0];
never executed: action.keyBinding = keyBindings[0];
0
1774 else-
1775 action.keyBinding = QString();
never executed: action.keyBinding = QString();
0
1776-
1777 actions << action;-
1778 }
never executed: end of block
0
1779 return actions;
never executed: return actions;
0
1780}-
1781-
1782// Text interface-
1783bool AtSpiAdaptor::textInterface(QAccessibleInterface *interface, const QString &function, const QDBusMessage &message, const QDBusConnection &connection)-
1784{-
1785 if (!interface->textInterface())
!interface->textInterface()Description
TRUEnever evaluated
FALSEnever evaluated
0
1786 return false;
never executed: return false;
0
1787-
1788 // properties-
1789 if (function == QLatin1String("GetCaretOffset")) {
function == QL...tCaretOffset")Description
TRUEnever evaluated
FALSEnever evaluated
0
1790 sendReply(connection, message, QVariant::fromValue(QDBusVariant(QVariant::fromValue(interface->textInterface()->cursorPosition()))));-
1791 } else if (function == QLatin1String("GetCharacterCount")) {
never executed: end of block
function == QL...aracterCount")Description
TRUEnever evaluated
FALSEnever evaluated
0
1792 sendReply(connection, message, QVariant::fromValue(QDBusVariant(QVariant::fromValue(interface->textInterface()->characterCount()))));-
1793-
1794 // functions-
1795 } else if (function == QLatin1String("AddSelection")) {
never executed: end of block
function == QL...AddSelection")Description
TRUEnever evaluated
FALSEnever evaluated
0
1796 int startOffset = message.arguments().at(0).toInt();-
1797 int endOffset = message.arguments().at(1).toInt();-
1798 int lastSelection = interface->textInterface()->selectionCount();-
1799 interface->textInterface()->setSelection(lastSelection, startOffset, endOffset);-
1800 sendReply(connection, message, (interface->textInterface()->selectionCount() > lastSelection));-
1801 } else if (function == QLatin1String("GetAttributeRun")) {
never executed: end of block
function == QL...AttributeRun")Description
TRUEnever evaluated
FALSEnever evaluated
0
1802 int offset = message.arguments().at(0).toInt();-
1803 bool includeDefaults = message.arguments().at(1).toBool();-
1804 Q_UNUSED(includeDefaults)-
1805 connection.send(message.createReply(getAttributes(interface, offset, includeDefaults)));-
1806 } else if (function == QLatin1String("GetAttributeValue")) {
never executed: end of block
function == QL...tributeValue")Description
TRUEnever evaluated
FALSEnever evaluated
0
1807 int offset = message.arguments().at(0).toInt();-
1808 QString attributeName = message.arguments().at(1).toString();-
1809 connection.send(message.createReply(getAttributeValue(interface, offset, attributeName)));-
1810 } else if (function == QLatin1String("GetAttributes")) {
never executed: end of block
function == QL...etAttributes")Description
TRUEnever evaluated
FALSEnever evaluated
0
1811 int offset = message.arguments().at(0).toInt();-
1812 connection.send(message.createReply(getAttributes(interface, offset, true)));-
1813 } else if (function == QLatin1String("GetBoundedRanges")) {
never executed: end of block
function == QL...oundedRanges")Description
TRUEnever evaluated
FALSEnever evaluated
0
1814 int x = message.arguments().at(0).toInt();-
1815 int y = message.arguments().at(1).toInt();-
1816 int width = message.arguments().at(2).toInt();-
1817 int height = message.arguments().at(3).toInt();-
1818 uint coordType = message.arguments().at(4).toUInt();-
1819 uint xClipType = message.arguments().at(5).toUInt();-
1820 uint yClipType = message.arguments().at(6).toUInt();-
1821 Q_UNUSED(x) Q_UNUSED (y) Q_UNUSED(width)-
1822 Q_UNUSED(height) Q_UNUSED(coordType)-
1823 Q_UNUSED(xClipType) Q_UNUSED(yClipType)-
1824 qAtspiDebug("Not implemented: QSpiAdaptor::GetBoundedRanges");
never executed: ;
never executed: QMessageLogger(__FILE__, 1824, __PRETTY_FUNCTION__).debug("Not implemented: QSpiAdaptor::GetBoundedRanges");
!::isDebuggingDescription
TRUEnever evaluated
FALSEnever evaluated
0
1825 sendReply(connection, message, QVariant::fromValue(QSpiTextRangeList()));-
1826 } else if (function == QLatin1String("GetCharacterAtOffset")) {
never executed: end of block
function == QL...cterAtOffset")Description
TRUEnever evaluated
FALSEnever evaluated
0
1827 int offset = message.arguments().at(0).toInt();-
1828 int start;-
1829 int end;-
1830 QString result = interface->textInterface()->textAtOffset(offset, QAccessible::CharBoundary, &start, &end);-
1831 sendReply(connection, message, (int) *(qPrintable (result)));-
1832 } else if (function == QLatin1String("GetCharacterExtents")) {
never executed: end of block
function == QL...acterExtents")Description
TRUEnever evaluated
FALSEnever evaluated
0
1833 int offset = message.arguments().at(0).toInt();-
1834 int coordType = message.arguments().at(1).toUInt();-
1835 connection.send(message.createReply(getCharacterExtents(interface, offset, coordType)));-
1836 } else if (function == QLatin1String("GetDefaultAttributeSet") || function == QLatin1String("GetDefaultAttributes")) {
never executed: end of block
function == QL...AttributeSet")Description
TRUEnever evaluated
FALSEnever evaluated
function == QL...ltAttributes")Description
TRUEnever evaluated
FALSEnever evaluated
0
1837 // GetDefaultAttributes is deprecated in favour of GetDefaultAttributeSet.-
1838 // Empty set seems reasonable. There is no default attribute set.-
1839 sendReply(connection, message, QVariant::fromValue(QSpiAttributeSet()));-
1840 } else if (function == QLatin1String("GetNSelections")) {
never executed: end of block
function == QL...tNSelections")Description
TRUEnever evaluated
FALSEnever evaluated
0
1841 sendReply(connection, message, interface->textInterface()->selectionCount());-
1842 } else if (function == QLatin1String("GetOffsetAtPoint")) {
never executed: end of block
function == QL...ffsetAtPoint")Description
TRUEnever evaluated
FALSEnever evaluated
0
1843 qAtspiDebug() << message.signature();
never executed: ;
never executed: QMessageLogger(__FILE__, 1843, __PRETTY_FUNCTION__).debug() << message.signature();
!::isDebuggingDescription
TRUEnever evaluated
FALSEnever evaluated
0
1844 Q_ASSERT(!message.signature().isEmpty());-
1845 QPoint point(message.arguments().at(0).toInt(), message.arguments().at(1).toInt());-
1846 uint coordType = message.arguments().at(2).toUInt();-
1847 if (coordType == ATSPI_COORD_TYPE_WINDOW) {
coordType == A...RD_TYPE_WINDOWDescription
TRUEnever evaluated
FALSEnever evaluated
0
1848 QWindow *win = interface->window();-
1849 point -= QPoint(win->x(), win->y());-
1850 }
never executed: end of block
0
1851 int offset = interface->textInterface()->offsetAtPoint(point);-
1852 sendReply(connection, message, offset);-
1853 } else if (function == QLatin1String("GetRangeExtents")) {
never executed: end of block
function == QL...RangeExtents")Description
TRUEnever evaluated
FALSEnever evaluated
0
1854 int startOffset = message.arguments().at(0).toInt();-
1855 int endOffset = message.arguments().at(1).toInt();-
1856 uint coordType = message.arguments().at(2).toUInt();-
1857 connection.send(message.createReply(getRangeExtents(interface, startOffset, endOffset, coordType)));-
1858 } else if (function == QLatin1String("GetSelection")) {
never executed: end of block
function == QL...GetSelection")Description
TRUEnever evaluated
FALSEnever evaluated
0
1859 int selectionNum = message.arguments().at(0).toInt();-
1860 int start, end;-
1861 interface->textInterface