| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/platformsupport/linuxaccessibility/atspiadaptor.cpp |
| Source code | Switch to Preprocessed file |
| Line | Source | Count | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 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 | - | |||||||||||||||||||||||||
| 66 | QT_BEGIN_NAMESPACE | - | ||||||||||||||||||||||||
| 67 | - | |||||||||||||||||||||||||
| 68 | static bool isDebugging = false; | - | ||||||||||||||||||||||||
| 69 | #define qAtspiDebug if (!::isDebugging); else qDebug | - | ||||||||||||||||||||||||
| 70 | - | |||||||||||||||||||||||||
| 71 | AtSpiAdaptor::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"),
| 0 | ||||||||||||||||||||||||
| 141 | QLatin1String("org.a11y.atspi.Registry"), QLatin1String("EventListenerDeregistered"), this,
| 0 | ||||||||||||||||||||||||
| 142 | SLOT(eventListenerDeregistered(QString,QString)));
| 0 | ||||||||||||||||||||||||
| 143 | #ifdef QT_ATSPI_DEBUG | - | ||||||||||||||||||||||||
| 144 | qAtspiDebug() << "Registered event listener change listener: " << success; | - | ||||||||||||||||||||||||
| 145 | #endif | - | ||||||||||||||||||||||||
| 146 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 147 | - | |||||||||||||||||||||||||
| 148 | AtSpiAdaptor::~AtSpiAdaptor() | - | ||||||||||||||||||||||||
| 149 | { | - | ||||||||||||||||||||||||
| 150 | } | - | ||||||||||||||||||||||||
| 151 | - | |||||||||||||||||||||||||
| 152 | /*! | - | ||||||||||||||||||||||||
| 153 | Provide DBus introspection. | - | ||||||||||||||||||||||||
| 154 | */ | - | ||||||||||||||||||||||||
| 155 | QString 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) {
| 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;
| 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)))
| 0 | ||||||||||||||||||||||||
| 602 | xml.append(componentIntrospection); never executed: xml.append(componentIntrospection); | 0 | ||||||||||||||||||||||||
| 603 | if (interfaces.contains(QLatin1String(ATSPI_DBUS_INTERFACE_TEXT)))
| 0 | ||||||||||||||||||||||||
| 604 | xml.append(textIntrospection); never executed: xml.append(textIntrospection); | 0 | ||||||||||||||||||||||||
| 605 | if (interfaces.contains(QLatin1String(ATSPI_DBUS_INTERFACE_EDITABLE_TEXT)))
| 0 | ||||||||||||||||||||||||
| 606 | xml.append(editableTextIntrospection); never executed: xml.append(editableTextIntrospection); | 0 | ||||||||||||||||||||||||
| 607 | if (interfaces.contains(QLatin1String(ATSPI_DBUS_INTERFACE_ACTION)))
| 0 | ||||||||||||||||||||||||
| 608 | xml.append(actionIntrospection); never executed: xml.append(actionIntrospection); | 0 | ||||||||||||||||||||||||
| 609 | if (interfaces.contains(QLatin1String(ATSPI_DBUS_INTERFACE_TABLE)))
| 0 | ||||||||||||||||||||||||
| 610 | xml.append(tableIntrospection); never executed: xml.append(tableIntrospection); | 0 | ||||||||||||||||||||||||
| 611 | if (interfaces.contains(QLatin1String(ATSPI_DBUS_INTERFACE_VALUE)))
| 0 | ||||||||||||||||||||||||
| 612 | xml.append(valueIntrospection); never executed: xml.append(valueIntrospection); | 0 | ||||||||||||||||||||||||
| 613 | if (path == QLatin1String(QSPI_OBJECT_PATH_ROOT))
| 0 | ||||||||||||||||||||||||
| 614 | xml.append(applicationIntrospection); never executed: xml.append(applicationIntrospection); | 0 | ||||||||||||||||||||||||
| 615 | - | |||||||||||||||||||||||||
| 616 | return xml; never executed: return xml; | 0 | ||||||||||||||||||||||||
| 617 | } | - | ||||||||||||||||||||||||
| 618 | - | |||||||||||||||||||||||||
| 619 | void 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::
| 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"))) {
dead code: { } | - | ||||||||||||||||||||||||
| 632 | sendObject_active_descendant_changed = 1; | - | ||||||||||||||||||||||||
| 633 | } else if (right.startsWith(QLatin1String("AttributesChanged"))) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 634 | sendObject_attributes_changed = 1; | - | ||||||||||||||||||||||||
| 635 | } else if (right.startsWith(QLatin1String("BoundsChanged"))) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 636 | sendObject_bounds_changed = 1; | - | ||||||||||||||||||||||||
| 637 | } else if (right.startsWith(QLatin1String("ChildrenChanged"))) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 638 | sendObject_children_changed = 1; | - | ||||||||||||||||||||||||
| 639 | } else if (right.startsWith(QLatin1String("ColumnDeleted"))) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 640 | sendObject_column_deleted = 1; | - | ||||||||||||||||||||||||
| 641 | } else if (right.startsWith(QLatin1String("ColumnInserted"))) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 642 | sendObject_column_inserted = 1; | - | ||||||||||||||||||||||||
| 643 | } else if (right.startsWith(QLatin1String("ColumnReordered"))) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 644 | sendObject_column_reordered = 1; | - | ||||||||||||||||||||||||
| 645 | } else if (right.startsWith(QLatin1String("LinkSelected"))) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 646 | sendObject_link_selected = 1; | - | ||||||||||||||||||||||||
| 647 | } else if (right.startsWith(QLatin1String("ModelChanged"))) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 648 | sendObject_model_changed = 1; | - | ||||||||||||||||||||||||
| 649 | } else if (right.startsWith(QLatin1String("PropertyChange"))) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 650 | if (right == QLatin1String("PropertyChange:AccessibleDescription")) {
| 0 | ||||||||||||||||||||||||
| 651 | sendObject_property_change_accessible_description = 1; | - | ||||||||||||||||||||||||
| 652 | } else if (right == QLatin1String("PropertyChange:AccessibleName")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 653 | sendObject_property_change_accessible_name = 1; | - | ||||||||||||||||||||||||
| 654 | } else if (right == QLatin1String("PropertyChange:AccessibleParent")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 655 | sendObject_property_change_accessible_parent = 1; | - | ||||||||||||||||||||||||
| 656 | } else if (right == QLatin1String("PropertyChange:AccessibleRole")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 657 | sendObject_property_change_accessible_role = 1; | - | ||||||||||||||||||||||||
| 658 | } else if (right == QLatin1String("PropertyChange:TableCaption")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 659 | sendObject_property_change_accessible_table_caption = 1; | - | ||||||||||||||||||||||||
| 660 | } else if (right == QLatin1String("PropertyChange:TableColumnDescription")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 661 | sendObject_property_change_accessible_table_column_description = 1; | - | ||||||||||||||||||||||||
| 662 | } else if (right == QLatin1String("PropertyChange:TableColumnHeader")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 663 | sendObject_property_change_accessible_table_column_header = 1; | - | ||||||||||||||||||||||||
| 664 | } else if (right == QLatin1String("PropertyChange:TableRowDescription")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 665 | sendObject_property_change_accessible_table_row_description = 1; | - | ||||||||||||||||||||||||
| 666 | } else if (right == QLatin1String("PropertyChange:TableRowHeader")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 667 | sendObject_property_change_accessible_table_row_header = 1; | - | ||||||||||||||||||||||||
| 668 | } else if (right == QLatin1String("PropertyChange:TableSummary")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 669 | sendObject_property_change_accessible_table_summary = 1; | - | ||||||||||||||||||||||||
| 670 | } else if (right == QLatin1String("PropertyChange:AccessibleValue")) { never executed: end of block
| 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"))) {
| 0 | ||||||||||||||||||||||||
| 676 | sendObject_row_deleted = 1; | - | ||||||||||||||||||||||||
| 677 | } else if (right.startsWith(QLatin1String("RowInserted"))) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 678 | sendObject_row_inserted = 1; | - | ||||||||||||||||||||||||
| 679 | } else if (right.startsWith(QLatin1String("RowReordered"))) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 680 | sendObject_row_reordered = 1; | - | ||||||||||||||||||||||||
| 681 | } else if (right.startsWith(QLatin1String("SelectionChanged"))) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 682 | sendObject_selection_changed = 1; | - | ||||||||||||||||||||||||
| 683 | } else if (right.startsWith(QLatin1String("StateChanged"))) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 684 | sendObject_state_changed = 1; | - | ||||||||||||||||||||||||
| 685 | } else if (right.startsWith(QLatin1String("TextAttributesChanged"))) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 686 | sendObject_text_attributes_changed = 1; | - | ||||||||||||||||||||||||
| 687 | } else if (right.startsWith(QLatin1String("TextBoundsChanged"))) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 688 | sendObject_text_bounds_changed = 1; | - | ||||||||||||||||||||||||
| 689 | } else if (right.startsWith(QLatin1String("TextCaretMoved"))) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 690 | sendObject_text_caret_moved = 1; | - | ||||||||||||||||||||||||
| 691 | } else if (right.startsWith(QLatin1String("TextChanged"))) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 692 | sendObject_text_changed = 1; | - | ||||||||||||||||||||||||
| 693 | } else if (right.startsWith(QLatin1String("TextSelectionChanged"))) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 694 | sendObject_text_selection_changed = 1; | - | ||||||||||||||||||||||||
| 695 | } else if (right.startsWith(QLatin1String("ValueChanged"))) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 696 | sendObject_value_changed = 1; | - | ||||||||||||||||||||||||
| 697 | } else if (right.startsWith(QLatin1String("VisibleDataChanged")) never executed: end of block
| 0 | ||||||||||||||||||||||||
| 698 | || right.startsWith(QLatin1String("VisibledataChanged"))) { // typo in libatspi
| 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;
| 0 | ||||||||||||||||||||||||
| 702 | } | - | ||||||||||||||||||||||||
| 703 | } | - | ||||||||||||||||||||||||
| 704 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 705 | } | - | ||||||||||||||||||||||||
| 706 | case 'w': { // window never executed: case 'w': | 0 | ||||||||||||||||||||||||
| 707 | if (flag.size() <= 8) {
| 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"))) {
dead code: { } | - | ||||||||||||||||||||||||
| 713 | sendWindow_activate = 1; | - | ||||||||||||||||||||||||
| 714 | } else if (right.startsWith(QLatin1String("Close"))) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 715 | sendWindow_close= 1; | - | ||||||||||||||||||||||||
| 716 | } else if (right.startsWith(QLatin1String("Create"))) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 717 | sendWindow_create = 1; | - | ||||||||||||||||||||||||
| 718 | } else if (right.startsWith(QLatin1String("Deactivate"))) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 719 | sendWindow_deactivate = 1; | - | ||||||||||||||||||||||||
| 720 | } else if (right.startsWith(QLatin1String("Lower"))) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 721 | sendWindow_lower = 1; | - | ||||||||||||||||||||||||
| 722 | } else if (right.startsWith(QLatin1String("Maximize"))) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 723 | sendWindow_maximize = 1; | - | ||||||||||||||||||||||||
| 724 | } else if (right.startsWith(QLatin1String("Minimize"))) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 725 | sendWindow_minimize = 1; | - | ||||||||||||||||||||||||
| 726 | } else if (right.startsWith(QLatin1String("Move"))) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 727 | sendWindow_move = 1; | - | ||||||||||||||||||||||||
| 728 | } else if (right.startsWith(QLatin1String("Raise"))) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 729 | sendWindow_raise = 1; | - | ||||||||||||||||||||||||
| 730 | } else if (right.startsWith(QLatin1String("Reparent"))) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 731 | sendWindow_reparent = 1; | - | ||||||||||||||||||||||||
| 732 | } else if (right.startsWith(QLatin1String("Resize"))) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 733 | sendWindow_resize = 1; | - | ||||||||||||||||||||||||
| 734 | } else if (right.startsWith(QLatin1String("Restore"))) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 735 | sendWindow_restore = 1; | - | ||||||||||||||||||||||||
| 736 | } else if (right.startsWith(QLatin1String("Restyle"))) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 737 | sendWindow_restyle = 1; | - | ||||||||||||||||||||||||
| 738 | } else if (right.startsWith(QLatin1String("Shade"))) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 739 | sendWindow_shade = 1; | - | ||||||||||||||||||||||||
| 740 | } else if (right.startsWith(QLatin1String("Unshade"))) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 741 | sendWindow_unshade = 1; | - | ||||||||||||||||||||||||
| 742 | } else if (right.startsWith(QLatin1String("DesktopCreate"))) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 743 | // ignore this one | - | ||||||||||||||||||||||||
| 744 | } else if (right.startsWith(QLatin1String("DesktopDestroy"))) { never executed: end of block
| 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;
| 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;
| 0 | ||||||||||||||||||||||||
| 767 | } | - | ||||||||||||||||||||||||
| 768 | } | - | ||||||||||||||||||||||||
| 769 | - | |||||||||||||||||||||||||
| 770 | /*! | - | ||||||||||||||||||||||||
| 771 | Checks via dbus which events should be sent. | - | ||||||||||||||||||||||||
| 772 | */ | - | ||||||||||||||||||||||||
| 773 | void 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()) {
| 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.");
| 0 | ||||||||||||||||||||||||
| 787 | } | - | ||||||||||||||||||||||||
| 788 | } | - | ||||||||||||||||||||||||
| 789 | - | |||||||||||||||||||||||||
| 790 | void 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 | - | |||||||||||||||||||||||||
| 796 | void 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 | */ | - | ||||||||||||||||||||||||
| 806 | void AtSpiAdaptor::windowActivated(QObject* window, bool active) | - | ||||||||||||||||||||||||
| 807 | { | - | ||||||||||||||||||||||||
| 808 | if (!(sendWindow || sendWindow_activate))
| 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())
| 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");
| 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 | - | |||||||||||||||||||||||||
| 834 | QVariantList 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 | - | |||||||||||||||||||||||||
| 842 | QVariant 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 | - | |||||||||||||||||||||||||
| 849 | bool 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 | - | |||||||||||||||||||||||||
| 856 | QAccessibleInterface *AtSpiAdaptor::interfaceFromPath(const QString& dbusPath) const | - | ||||||||||||||||||||||||
| 857 | { | - | ||||||||||||||||||||||||
| 858 | if (dbusPath == QLatin1String(QSPI_OBJECT_PATH_ROOT))
| 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) {
| 0 | ||||||||||||||||||||||||
| 863 | qAtspiDebug() << "invalid path: " << dbusPath; never executed: ;never executed: QMessageLogger(__FILE__, 863, __PRETTY_FUNCTION__).debug() << "invalid path: " << dbusPath;
| 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)
| 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 | - | |||||||||||||||||||||||||
| 877 | void 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 | */ | - | ||||||||||||||||||||||||
| 889 | void 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)
| 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) {
| 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) {
| 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)
| 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)
| 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) {
| 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) {
| 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)
| 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) {
| 0 | ||||||||||||||||||||||||
| 945 | QAccessibleInterface * iface = event->accessibleInterface(); | - | ||||||||||||||||||||||||
| 946 | if (!iface || !iface->textInterface()) {
| 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.");
| 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) {
| 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
| 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
| 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()) {
| 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()) {
| 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) {
| 0 | ||||||||||||||||||||||||
| 1003 | QAccessibleInterface * iface = event->accessibleInterface(); | - | ||||||||||||||||||||||||
| 1004 | if (!iface || !iface->textInterface()) {
| 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) {
| 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) {
| 0 | ||||||||||||||||||||||||
| 1031 | QAccessibleInterface * iface = event->accessibleInterface(); | - | ||||||||||||||||||||||||
| 1032 | if (!iface) {
| 0 | ||||||||||||||||||||||||
| 1033 | qWarning("ValueChanged event from invalid accessible."); | - | ||||||||||||||||||||||||
| 1034 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 1035 | } | - | ||||||||||||||||||||||||
| 1036 | if (iface->valueInterface()) {
| 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
| 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) {
| 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;
| 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) {
| 0 | ||||||||||||||||||||||||
| 1075 | QAccessible::State stateChange = static_cast<QAccessibleStateChangeEvent*>(event)->changedStates(); | - | ||||||||||||||||||||||||
| 1076 | if (stateChange.checked) {
| 0 | ||||||||||||||||||||||||
| 1077 | QAccessibleInterface * iface = event->accessibleInterface(); | - | ||||||||||||||||||||||||
| 1078 | if (!iface) {
| 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
| 0 | ||||||||||||||||||||||||
| 1085 | QAccessibleInterface * iface = event->accessibleInterface(); | - | ||||||||||||||||||||||||
| 1086 | if (!iface || !(iface->role() == QAccessible::Window && (sendWindow || sendWindow_activate)))
| 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");
| 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
| 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 | - | |||||||||||||||||||||||||
| 1167 | void AtSpiAdaptor::sendFocusChanged(QAccessibleInterface *interface) const | - | ||||||||||||||||||||||||
| 1168 | { | - | ||||||||||||||||||||||||
| 1169 | static QString lastFocusPath; | - | ||||||||||||||||||||||||
| 1170 | // "remove" old focus | - | ||||||||||||||||||||||||
| 1171 | if (!lastFocusPath.isEmpty()) {
| 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 | - | |||||||||||||||||||||||||
| 1191 | void 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) {
| 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 | - | |||||||||||||||||||||||||
| 1202 | void 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) {
| 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();
| 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 | - | |||||||||||||||||||||||||
| 1220 | void AtSpiAdaptor::notifyAboutDestruction(QAccessibleInterface *interface) const | - | ||||||||||||||||||||||||
| 1221 | { | - | ||||||||||||||||||||||||
| 1222 | if (!interface || !interface->isValid())
| 0 | ||||||||||||||||||||||||
| 1223 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 1224 | - | |||||||||||||||||||||||||
| 1225 | QAccessibleInterface * parent = interface->parent(); | - | ||||||||||||||||||||||||
| 1226 | if (!parent) {
| 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();
| 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 | */ | - | ||||||||||||||||||||||||
| 1250 | bool AtSpiAdaptor::handleMessage(const QDBusMessage &message, const QDBusConnection &connection) | - | ||||||||||||||||||||||||
| 1251 | { | - | ||||||||||||||||||||||||
| 1252 | // get accessible interface | - | ||||||||||||||||||||||||
| 1253 | QAccessibleInterface * accessible = interfaceFromPath(message.path()); | - | ||||||||||||||||||||||||
| 1254 | if (!accessible) {
| 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();
| 0 | ||||||||||||||||||||||||
| 1256 | return false; never executed: return false; | 0 | ||||||||||||||||||||||||
| 1257 | } | - | ||||||||||||||||||||||||
| 1258 | if (!accessible->isValid()) {
| 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")) {
| 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")) {
| 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))
| 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))
| 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))
| 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))
| 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))
| 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))
| 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))
| 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))
| 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;
| 0 | ||||||||||||||||||||||||
| 1299 | return false; never executed: return false; | 0 | ||||||||||||||||||||||||
| 1300 | } | - | ||||||||||||||||||||||||
| 1301 | - | |||||||||||||||||||||||||
| 1302 | // Application | - | ||||||||||||||||||||||||
| 1303 | bool AtSpiAdaptor::applicationInterface(QAccessibleInterface *interface, const QString &function, const QDBusMessage &message, const QDBusConnection &connection) | - | ||||||||||||||||||||||||
| 1304 | { | - | ||||||||||||||||||||||||
| 1305 | if (message.path() != QLatin1String(ATSPI_DBUS_PATH_ROOT)) {
| 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;
| 0 | ||||||||||||||||||||||||
| 1307 | return false; never executed: return false; | 0 | ||||||||||||||||||||||||
| 1308 | } | - | ||||||||||||||||||||||||
| 1309 | - | |||||||||||||||||||||||||
| 1310 | if (function == QLatin1String("SetId")) {
| 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")) {
| 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")) {
| 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")) {
| 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")) {
| 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;
| 0 | ||||||||||||||||||||||||
| 1338 | return false; never executed: return false; | 0 | ||||||||||||||||||||||||
| 1339 | } | - | ||||||||||||||||||||||||
| 1340 | - | |||||||||||||||||||||||||
| 1341 | /*! | - | ||||||||||||||||||||||||
| 1342 | Register this application as accessible on the accessibility DBus. | - | ||||||||||||||||||||||||
| 1343 | */ | - | ||||||||||||||||||||||||
| 1344 | void 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 ()) {
| 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();
| 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 | - | ||||||||||||||||||||||||
| 1366 | bool AtSpiAdaptor::accessibleInterface(QAccessibleInterface *interface, const QString &function, const QDBusMessage &message, const QDBusConnection &connection) | - | ||||||||||||||||||||||||
| 1367 | { | - | ||||||||||||||||||||||||
| 1368 | if (function == QLatin1String("GetRole")) {
| 0 | ||||||||||||||||||||||||
| 1369 | sendReply(connection, message, (uint) getRole(interface)); | - | ||||||||||||||||||||||||
| 1370 | } else if (function == QLatin1String("GetName")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 1371 | sendReply(connection, message, QVariant::fromValue(QDBusVariant(interface->text(QAccessible::Name)))); | - | ||||||||||||||||||||||||
| 1372 | } else if (function == QLatin1String("GetRoleName")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 1373 | sendReply(connection, message, qSpiRoleMapping[interface->role()].name()); | - | ||||||||||||||||||||||||
| 1374 | } else if (function == QLatin1String("GetLocalizedRoleName")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 1375 | sendReply(connection, message, QVariant::fromValue(qSpiRoleMapping[interface->role()].localizedName())); | - | ||||||||||||||||||||||||
| 1376 | } else if (function == QLatin1String("GetChildCount")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 1377 | sendReply(connection, message, QVariant::fromValue(QDBusVariant(interface->childCount()))); | - | ||||||||||||||||||||||||
| 1378 | } else if (function == QLatin1String("GetIndexInParent")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 1379 | int childIndex = -1; | - | ||||||||||||||||||||||||
| 1380 | QAccessibleInterface * parent = interface->parent(); | - | ||||||||||||||||||||||||
| 1381 | if (parent) {
| 0 | ||||||||||||||||||||||||
| 1382 | childIndex = parent->indexOfChild(interface); | - | ||||||||||||||||||||||||
| 1383 | if (childIndex < 0) {
| 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;
| 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
| 0 | ||||||||||||||||||||||||
| 1389 | QString path; | - | ||||||||||||||||||||||||
| 1390 | QAccessibleInterface * parent = interface->parent(); | - | ||||||||||||||||||||||||
| 1391 | if (!parent) {
| 0 | ||||||||||||||||||||||||
| 1392 | path = QLatin1String(ATSPI_DBUS_PATH_NULL); | - | ||||||||||||||||||||||||
| 1393 | } else if (parent->role() == QAccessible::Application) { never executed: end of block
| 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
| 0 | ||||||||||||||||||||||||
| 1402 | int index = message.arguments().first().toInt(); | - | ||||||||||||||||||||||||
| 1403 | if (index < 0) {
| 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")) {
| 0 | ||||||||||||||||||||||||
| 1412 | sendReply(connection, message, accessibleInterfaces(interface)); | - | ||||||||||||||||||||||||
| 1413 | } else if (function == QLatin1String("GetDescription")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 1414 | sendReply(connection, message, QVariant::fromValue(QDBusVariant(interface->text(QAccessible::Description)))); | - | ||||||||||||||||||||||||
| 1415 | } else if (function == QLatin1String("GetState")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 1416 | quint64 spiState = spiStatesFromQState(interface->state()); | - | ||||||||||||||||||||||||
| 1417 | if (interface->tableInterface()) {
| 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 ||
| 0 | ||||||||||||||||||||||||
| 1422 | role == QAccessible::ListItem) {
| 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
| 0 | ||||||||||||||||||||||||
| 1432 | sendReply(connection, message, QVariant::fromValue(QSpiAttributeSet())); | - | ||||||||||||||||||||||||
| 1433 | } else if (function == QLatin1String("GetRelationSet")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 1434 | sendReply(connection, message, QVariant::fromValue(relationSet(interface, connection))); | - | ||||||||||||||||||||||||
| 1435 | } else if (function == QLatin1String("GetApplication")) { never executed: end of block
| 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
| 0 | ||||||||||||||||||||||||
| 1439 | QSpiObjectReferenceArray children; | - | ||||||||||||||||||||||||
| 1440 | const int numChildren = interface->childCount(); | - | ||||||||||||||||||||||||
| 1441 | children.reserve(numChildren); | - | ||||||||||||||||||||||||
| 1442 | for (int i = 0; i < numChildren; ++i) {
| 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();
| 0 | ||||||||||||||||||||||||
| 1450 | return false; never executed: return false; | 0 | ||||||||||||||||||||||||
| 1451 | } | - | ||||||||||||||||||||||||
| 1452 | return true; never executed: return true; | 0 | ||||||||||||||||||||||||
| 1453 | } | - | ||||||||||||||||||||||||
| 1454 | - | |||||||||||||||||||||||||
| 1455 | AtspiRole AtSpiAdaptor::getRole(QAccessibleInterface *interface) const | - | ||||||||||||||||||||||||
| 1456 | { | - | ||||||||||||||||||||||||
| 1457 | if ((interface->role() == QAccessible::EditableText) && interface->state().passwordEdit)
| 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 | - | |||||||||||||||||||||||||
| 1464 | QStringList 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()) ||
| 0 | ||||||||||||||||||||||||
| 1473 | (interface->object() && interface->object()->isWidgetType()) ||
| 0 | ||||||||||||||||||||||||
| 1474 | (interface->role() == QAccessible::ListItem) ||
| 0 | ||||||||||||||||||||||||
| 1475 | (interface->role() == QAccessible::Cell) ||
| 0 | ||||||||||||||||||||||||
| 1476 | (interface->role() == QAccessible::TreeItem) ||
| 0 | ||||||||||||||||||||||||
| 1477 | (interface->role() == QAccessible::Row) ||
| 0 | ||||||||||||||||||||||||
| 1478 | (interface->object() && interface->object()->inherits("QSGItem"))
| 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)
| 0 | ||||||||||||||||||||||||
| 1488 | ifaces << QLatin1String(ATSPI_DBUS_INTERFACE_APPLICATION); never executed: ifaces << QLatin1String("org.a11y.atspi.Application"); | 0 | ||||||||||||||||||||||||
| 1489 | - | |||||||||||||||||||||||||
| 1490 | if (interface->actionInterface() || interface->valueInterface())
| 0 | ||||||||||||||||||||||||
| 1491 | ifaces << QLatin1String(ATSPI_DBUS_INTERFACE_ACTION); never executed: ifaces << QLatin1String("org.a11y.atspi.Action"); | 0 | ||||||||||||||||||||||||
| 1492 | - | |||||||||||||||||||||||||
| 1493 | if (interface->textInterface())
| 0 | ||||||||||||||||||||||||
| 1494 | ifaces << QLatin1String(ATSPI_DBUS_INTERFACE_TEXT); never executed: ifaces << QLatin1String("org.a11y.atspi.Text"); | 0 | ||||||||||||||||||||||||
| 1495 | - | |||||||||||||||||||||||||
| 1496 | if (interface->editableTextInterface())
| 0 | ||||||||||||||||||||||||
| 1497 | ifaces << QLatin1String(ATSPI_DBUS_INTERFACE_EDITABLE_TEXT); never executed: ifaces << QLatin1String("org.a11y.atspi.EditableText"); | 0 | ||||||||||||||||||||||||
| 1498 | - | |||||||||||||||||||||||||
| 1499 | if (interface->valueInterface())
| 0 | ||||||||||||||||||||||||
| 1500 | ifaces << QLatin1String(ATSPI_DBUS_INTERFACE_VALUE); never executed: ifaces << QLatin1String("org.a11y.atspi.Value"); | 0 | ||||||||||||||||||||||||
| 1501 | - | |||||||||||||||||||||||||
| 1502 | if (interface->tableInterface())
| 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 | - | |||||||||||||||||||||||||
| 1508 | QSpiRelationArray 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())
| 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 | - | |||||||||||||||||||||||||
| 1529 | void 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 | - | |||||||||||||||||||||||||
| 1536 | QString AtSpiAdaptor::pathForObject(QObject *object) const | - | ||||||||||||||||||||||||
| 1537 | { | - | ||||||||||||||||||||||||
| 1538 | Q_ASSERT(object); | - | ||||||||||||||||||||||||
| 1539 | - | |||||||||||||||||||||||||
| 1540 | if (inheritsQAction(object)) {
| 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.");
| 0 | ||||||||||||||||||||||||
| 1542 | } | - | ||||||||||||||||||||||||
| 1543 | - | |||||||||||||||||||||||||
| 1544 | QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(object); | - | ||||||||||||||||||||||||
| 1545 | return pathForInterface(iface); never executed: return pathForInterface(iface); | 0 | ||||||||||||||||||||||||
| 1546 | } | - | ||||||||||||||||||||||||
| 1547 | - | |||||||||||||||||||||||||
| 1548 | QString AtSpiAdaptor::pathForInterface(QAccessibleInterface *interface) const | - | ||||||||||||||||||||||||
| 1549 | { | - | ||||||||||||||||||||||||
| 1550 | if (!interface || !interface->isValid())
| 0 | ||||||||||||||||||||||||
| 1551 | return QLatin1String(ATSPI_DBUS_PATH_NULL); never executed: return QLatin1String("/org/a11y/atspi/null"); | 0 | ||||||||||||||||||||||||
| 1552 | if (interface->role() == QAccessible::Application)
| 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 | - | |||||||||||||||||||||||||
| 1560 | bool AtSpiAdaptor::inheritsQAction(QObject *object) | - | ||||||||||||||||||||||||
| 1561 | { | - | ||||||||||||||||||||||||
| 1562 | const QMetaObject *mo = object->metaObject(); | - | ||||||||||||||||||||||||
| 1563 | while (mo) {
| 0 | ||||||||||||||||||||||||
| 1564 | const QLatin1String cn(mo->className()); | - | ||||||||||||||||||||||||
| 1565 | if (cn == QLatin1String("QAction"))
| 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 | - | ||||||||||||||||||||||||
| 1573 | static QAccessibleInterface * getWindow(QAccessibleInterface * interface) | - | ||||||||||||||||||||||||
| 1574 | { | - | ||||||||||||||||||||||||
| 1575 | if (interface->role() == QAccessible::Window)
| 0 | ||||||||||||||||||||||||
| 1576 | return interface; never executed: return interface; | 0 | ||||||||||||||||||||||||
| 1577 | - | |||||||||||||||||||||||||
| 1578 | QAccessibleInterface * parent = interface->parent(); | - | ||||||||||||||||||||||||
| 1579 | while (parent && parent->role() != QAccessible::Window)
| 0 | ||||||||||||||||||||||||
| 1580 | parent = parent->parent(); never executed: parent = parent->parent(); | 0 | ||||||||||||||||||||||||
| 1581 | - | |||||||||||||||||||||||||
| 1582 | return parent; never executed: return parent; | 0 | ||||||||||||||||||||||||
| 1583 | } | - | ||||||||||||||||||||||||
| 1584 | - | |||||||||||||||||||||||||
| 1585 | static 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) {
| 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 | - | |||||||||||||||||||||||||
| 1602 | bool AtSpiAdaptor::componentInterface(QAccessibleInterface *interface, const QString &function, const QDBusMessage &message, const QDBusConnection &connection) | - | ||||||||||||||||||||||||
| 1603 | { | - | ||||||||||||||||||||||||
| 1604 | if (function == QLatin1String("Contains")) {
| 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)
| 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
| 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) {
| 0 | ||||||||||||||||||||||||
| 1623 | iface = childInterface; | - | ||||||||||||||||||||||||
| 1624 | childInterface = iface->childAt(x, y); | - | ||||||||||||||||||||||||
| 1625 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1626 | if (iface) {
| 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")) {
| 0 | ||||||||||||||||||||||||
| 1635 | sendReply(connection, message, (double) 1.0); | - | ||||||||||||||||||||||||
| 1636 | } else if (function == QLatin1String("GetExtents")) { never executed: end of block
| 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
| 0 | ||||||||||||||||||||||||
| 1640 | sendReply(connection, message, QVariant::fromValue((uint)1)); | - | ||||||||||||||||||||||||
| 1641 | } else if (function == QLatin1String("GetMDIZOrder")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 1642 | sendReply(connection, message, QVariant::fromValue((short)0)); | - | ||||||||||||||||||||||||
| 1643 | } else if (function == QLatin1String("GetPosition")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 1644 | uint coordType = message.arguments().at(0).toUInt(); | - | ||||||||||||||||||||||||
| 1645 | QRect rect; | - | ||||||||||||||||||||||||
| 1646 | if (coordType == ATSPI_COORD_TYPE_SCREEN)
| 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
| 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
| 0 | ||||||||||||||||||||||||
| 1659 | QAccessibleActionInterface *actionIface = interface->actionInterface(); | - | ||||||||||||||||||||||||
| 1660 | if (actionIface && actionIface->actionNames().contains(QAccessibleActionInterface::setFocusAction())) {
| 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")) {
| 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.");
| 0 | ||||||||||||||||||||||||
| 1673 | sendReply(connection, message, false); | - | ||||||||||||||||||||||||
| 1674 | } else if (function == QLatin1String("SetPosition")) { never executed: end of block
| 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.");
| 0 | ||||||||||||||||||||||||
| 1679 | sendReply(connection, message, false); | - | ||||||||||||||||||||||||
| 1680 | } else if (function == QLatin1String("SetSize")) { never executed: end of block
| 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.");
| 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();
| 0 | ||||||||||||||||||||||||
| 1687 | return false; never executed: return false; | 0 | ||||||||||||||||||||||||
| 1688 | } | - | ||||||||||||||||||||||||
| 1689 | return true; never executed: return true; | 0 | ||||||||||||||||||||||||
| 1690 | } | - | ||||||||||||||||||||||||
| 1691 | - | |||||||||||||||||||||||||
| 1692 | QRect 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 | - | ||||||||||||||||||||||||
| 1698 | bool AtSpiAdaptor::actionInterface(QAccessibleInterface *interface, const QString &function, const QDBusMessage &message, const QDBusConnection &connection) | - | ||||||||||||||||||||||||
| 1699 | { | - | ||||||||||||||||||||||||
| 1700 | if (function == QLatin1String("GetNActions")) {
| 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
| 0 | ||||||||||||||||||||||||
| 1704 | int index = message.arguments().at(0).toInt(); | - | ||||||||||||||||||||||||
| 1705 | const QStringList actionNames = QAccessibleBridgeUtils::effectiveActionNames(interface); | - | ||||||||||||||||||||||||
| 1706 | if (index < 0 || index >= actionNames.count())
| 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
| 0 | ||||||||||||||||||||||||
| 1712 | sendReply(connection, message, QVariant::fromValue(getActions(interface))); | - | ||||||||||||||||||||||||
| 1713 | } else if (function == QLatin1String("GetName")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 1714 | int index = message.arguments().at(0).toInt(); | - | ||||||||||||||||||||||||
| 1715 | const QStringList actionNames = QAccessibleBridgeUtils::effectiveActionNames(interface); | - | ||||||||||||||||||||||||
| 1716 | if (index < 0 || index >= actionNames.count())
| 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
| 0 | ||||||||||||||||||||||||
| 1720 | int index = message.arguments().at(0).toInt(); | - | ||||||||||||||||||||||||
| 1721 | const QStringList actionNames = QAccessibleBridgeUtils::effectiveActionNames(interface); | - | ||||||||||||||||||||||||
| 1722 | if (index < 0 || index >= actionNames.count())
| 0 | ||||||||||||||||||||||||
| 1723 | return false; never executed: return false; | 0 | ||||||||||||||||||||||||
| 1724 | QString description; | - | ||||||||||||||||||||||||
| 1725 | if (QAccessibleActionInterface *actionIface = interface->actionInterface())
| 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
| 0 | ||||||||||||||||||||||||
| 1731 | int index = message.arguments().at(0).toInt(); | - | ||||||||||||||||||||||||
| 1732 | const QStringList actionNames = QAccessibleBridgeUtils::effectiveActionNames(interface); | - | ||||||||||||||||||||||||
| 1733 | if (index < 0 || index >= actionNames.count())
| 0 | ||||||||||||||||||||||||
| 1734 | return false; never executed: return false; | 0 | ||||||||||||||||||||||||
| 1735 | QStringList keyBindings; | - | ||||||||||||||||||||||||
| 1736 | if (QAccessibleActionInterface *actionIface = interface->actionInterface())
| 0 | ||||||||||||||||||||||||
| 1737 | keyBindings = actionIface->keyBindingsForAction(actionNames.at(index)); never executed: keyBindings = actionIface->keyBindingsForAction(actionNames.at(index)); | 0 | ||||||||||||||||||||||||
| 1738 | if (keyBindings.isEmpty()) {
| 0 | ||||||||||||||||||||||||
| 1739 | QString acc = interface->text(QAccessible::Accelerator); | - | ||||||||||||||||||||||||
| 1740 | if (!acc.isEmpty())
| 0 | ||||||||||||||||||||||||
| 1741 | keyBindings.append(acc); never executed: keyBindings.append(acc); | 0 | ||||||||||||||||||||||||
| 1742 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1743 | if (keyBindings.length() > 0)
| 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();
| 0 | ||||||||||||||||||||||||
| 1749 | return false; never executed: return false; | 0 | ||||||||||||||||||||||||
| 1750 | } | - | ||||||||||||||||||||||||
| 1751 | return true; never executed: return true; | 0 | ||||||||||||||||||||||||
| 1752 | } | - | ||||||||||||||||||||||||
| 1753 | - | |||||||||||||||||||||||||
| 1754 | QSpiActionArray 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) {
| 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)
| 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 | - | ||||||||||||||||||||||||
| 1783 | bool AtSpiAdaptor::textInterface(QAccessibleInterface *interface, const QString &function, const QDBusMessage &message, const QDBusConnection &connection) | - | ||||||||||||||||||||||||
| 1784 | { | - | ||||||||||||||||||||||||
| 1785 | if (!interface->textInterface())
| 0 | ||||||||||||||||||||||||
| 1786 | return false; never executed: return false; | 0 | ||||||||||||||||||||||||
| 1787 | - | |||||||||||||||||||||||||
| 1788 | // properties | - | ||||||||||||||||||||||||
| 1789 | if (function == QLatin1String("GetCaretOffset")) {
| 0 | ||||||||||||||||||||||||
| 1790 | sendReply(connection, message, QVariant::fromValue(QDBusVariant(QVariant::fromValue(interface->textInterface()->cursorPosition())))); | - | ||||||||||||||||||||||||
| 1791 | } else if (function == QLatin1String("GetCharacterCount")) { never executed: end of block
| 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
| 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
| 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
| 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
| 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
| 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");
| 0 | ||||||||||||||||||||||||
| 1825 | sendReply(connection, message, QVariant::fromValue(QSpiTextRangeList())); | - | ||||||||||||||||||||||||
| 1826 | } else if (function == QLatin1String("GetCharacterAtOffset")) { never executed: end of block
| 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
| 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
| 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
| 0 | ||||||||||||||||||||||||
| 1841 | sendReply(connection, message, interface->textInterface()->selectionCount()); | - | ||||||||||||||||||||||||
| 1842 | } else if (function == QLatin1String("GetOffsetAtPoint")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 1843 | qAtspiDebug() << message.signature(); never executed: ;never executed: QMessageLogger(__FILE__, 1843, __PRETTY_FUNCTION__).debug() << message.signature();
| 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) {
| 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
| 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
| 0 | ||||||||||||||||||||||||
| 1859 | int selectionNum = message.arguments().at(0).toInt(); | - | ||||||||||||||||||||||||
| 1860 | int start, end; | - | ||||||||||||||||||||||||
| 1861 | interface->textInterface()->selection(selectionNum, &start, &end); | - | ||||||||||||||||||||||||
| 1862 | if (start < 0)
| 0 | ||||||||||||||||||||||||
| 1863 | start = end = interface->textInterface()->cursorPosition(); never executed: start = end = interface->textInterface()->cursorPosition(); | 0 | ||||||||||||||||||||||||
| 1864 | QVariantList sel; | - | ||||||||||||||||||||||||
| 1865 | sel << start << end; | - | ||||||||||||||||||||||||
| 1866 | connection.send(message.createReply(sel)); | - | ||||||||||||||||||||||||
| 1867 | } else if (function == QLatin1String("GetText")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 1868 | int startOffset = message.arguments().at(0).toInt(); | - | ||||||||||||||||||||||||
| 1869 | int endOffset = message.arguments().at(1).toInt(); | - | ||||||||||||||||||||||||
| 1870 | if (endOffset == -1) // AT-SPI uses -1 to signal all characters
| 0 | ||||||||||||||||||||||||
| 1871 | endOffset = interface->textInterface()->characterCount(); never executed: endOffset = interface->textInterface()->characterCount(); | 0 | ||||||||||||||||||||||||
| 1872 | sendReply(connection, message, interface->textInterface()->text(startOffset, endOffset)); | - | ||||||||||||||||||||||||
| 1873 | } else if (function == QLatin1String("GetTextAfterOffset")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 1874 | int offset = message.arguments().at(0).toInt(); | - | ||||||||||||||||||||||||
| 1875 | int type = message.arguments().at(1).toUInt(); | - | ||||||||||||||||||||||||
| 1876 | int startOffset, endOffset; | - | ||||||||||||||||||||||||
| 1877 | QString text = interface->textInterface()->textAfterOffset(offset, qAccessibleBoundaryType(type), &startOffset, &endOffset); | - | ||||||||||||||||||||||||
| 1878 | QVariantList ret; | - | ||||||||||||||||||||||||
| 1879 | ret << text << startOffset << endOffset; | - | ||||||||||||||||||||||||
| 1880 | connection.send(message.createReply(ret)); | - | ||||||||||||||||||||||||
| 1881 | } else if (function == QLatin1String("GetTextAtOffset")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 1882 | int offset = message.arguments().at(0).toInt(); | - | ||||||||||||||||||||||||
| 1883 | int type = message.arguments().at(1).toUInt(); | - | ||||||||||||||||||||||||
| 1884 | int startOffset, endOffset; | - | ||||||||||||||||||||||||
| 1885 | QString text = interface->textInterface()->textAtOffset(offset, qAccessibleBoundaryType(type), &startOffset, &endOffset); | - | ||||||||||||||||||||||||
| 1886 | QVariantList ret; | - | ||||||||||||||||||||||||
| 1887 | ret << text << startOffset << endOffset; | - | ||||||||||||||||||||||||
| 1888 | connection.send(message.createReply(ret)); | - | ||||||||||||||||||||||||
| 1889 | } else if (function == QLatin1String("GetTextBeforeOffset")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 1890 | int offset = message.arguments().at(0).toInt(); | - | ||||||||||||||||||||||||
| 1891 | int type = message.arguments().at(1).toUInt(); | - | ||||||||||||||||||||||||
| 1892 | int startOffset, endOffset; | - | ||||||||||||||||||||||||
| 1893 | QString text = interface->textInterface()->textBeforeOffset(offset, qAccessibleBoundaryType(type), &startOffset, &endOffset); | - | ||||||||||||||||||||||||
| 1894 | QVariantList ret; | - | ||||||||||||||||||||||||
| 1895 | ret << text << startOffset << endOffset; | - | ||||||||||||||||||||||||
| 1896 | connection.send(message.createReply(ret)); | - | ||||||||||||||||||||||||
| 1897 | } else if (function == QLatin1String("RemoveSelection")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 1898 | int selectionNum = message.arguments().at(0).toInt(); | - | ||||||||||||||||||||||||
| 1899 | interface->textInterface()->removeSelection(selectionNum); | - | ||||||||||||||||||||||||
| 1900 | sendReply(connection, message, true); | - | ||||||||||||||||||||||||
| 1901 | } else if (function == QLatin1String("SetCaretOffset")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 1902 | int offset = message.arguments().at(0).toInt(); | - | ||||||||||||||||||||||||
| 1903 | interface->textInterface()->setCursorPosition(offset); | - | ||||||||||||||||||||||||
| 1904 | sendReply(connection, message, true); | - | ||||||||||||||||||||||||
| 1905 | } else if (function == QLatin1String("SetSelection")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 1906 | int selectionNum = message.arguments().at(0).toInt(); | - | ||||||||||||||||||||||||
| 1907 | int startOffset = message.arguments().at(1).toInt(); | - | ||||||||||||||||||||||||
| 1908 | int endOffset = message.arguments().at(2).toInt(); | - | ||||||||||||||||||||||||
| 1909 | interface->textInterface()->setSelection(selectionNum, startOffset, endOffset); | - | ||||||||||||||||||||||||
| 1910 | sendReply(connection, message, true); | - | ||||||||||||||||||||||||
| 1911 | } else { never executed: end of block | 0 | ||||||||||||||||||||||||
| 1912 | qAtspiDebug() << "WARNING: AtSpiAdaptor::textInterface does not implement " << function << message.path(); never executed: ;never executed: QMessageLogger(__FILE__, 1912, __PRETTY_FUNCTION__).debug() << "WARNING: AtSpiAdaptor::textInterface does not implement " << function << message.path();
| 0 | ||||||||||||||||||||||||
| 1913 | return false; never executed: return false; | 0 | ||||||||||||||||||||||||
| 1914 | } | - | ||||||||||||||||||||||||
| 1915 | return true; never executed: return true; | 0 | ||||||||||||||||||||||||
| 1916 | } | - | ||||||||||||||||||||||||
| 1917 | - | |||||||||||||||||||||||||
| 1918 | QAccessible::TextBoundaryType AtSpiAdaptor::qAccessibleBoundaryType(int atspiTextBoundaryType) const | - | ||||||||||||||||||||||||
| 1919 | { | - | ||||||||||||||||||||||||
| 1920 | switch (atspiTextBoundaryType) { | - | ||||||||||||||||||||||||
| 1921 | case ATSPI_TEXT_BOUNDARY_CHAR: never executed: case ATSPI_TEXT_BOUNDARY_CHAR: | 0 | ||||||||||||||||||||||||
| 1922 | return QAccessible::CharBoundary; never executed: return QAccessible::CharBoundary; | 0 | ||||||||||||||||||||||||
| 1923 | case ATSPI_TEXT_BOUNDARY_WORD_START: never executed: case ATSPI_TEXT_BOUNDARY_WORD_START: | 0 | ||||||||||||||||||||||||
| 1924 | case ATSPI_TEXT_BOUNDARY_WORD_END: never executed: case ATSPI_TEXT_BOUNDARY_WORD_END: | 0 | ||||||||||||||||||||||||
| 1925 | return QAccessible::WordBoundary; never executed: return QAccessible::WordBoundary; | 0 | ||||||||||||||||||||||||
| 1926 | case ATSPI_TEXT_BOUNDARY_SENTENCE_START: never executed: case ATSPI_TEXT_BOUNDARY_SENTENCE_START: | 0 | ||||||||||||||||||||||||
| 1927 | case ATSPI_TEXT_BOUNDARY_SENTENCE_END: never executed: case ATSPI_TEXT_BOUNDARY_SENTENCE_END: | 0 | ||||||||||||||||||||||||
| 1928 | return QAccessible::SentenceBoundary; never executed: return QAccessible::SentenceBoundary; | 0 | ||||||||||||||||||||||||
| 1929 | case ATSPI_TEXT_BOUNDARY_LINE_START: never executed: case ATSPI_TEXT_BOUNDARY_LINE_START: | 0 | ||||||||||||||||||||||||
| 1930 | case ATSPI_TEXT_BOUNDARY_LINE_END: never executed: case ATSPI_TEXT_BOUNDARY_LINE_END: | 0 | ||||||||||||||||||||||||
| 1931 | return QAccessible::LineBoundary; never executed: return QAccessible::LineBoundary; | 0 | ||||||||||||||||||||||||
| 1932 | } | - | ||||||||||||||||||||||||
| 1933 | Q_ASSERT_X(0, "", "Requested invalid boundary type."); | - | ||||||||||||||||||||||||
| 1934 | return QAccessible::CharBoundary; never executed: return QAccessible::CharBoundary; | 0 | ||||||||||||||||||||||||
| 1935 | } | - | ||||||||||||||||||||||||
| 1936 | - | |||||||||||||||||||||||||
| 1937 | namespace | - | ||||||||||||||||||||||||
| 1938 | { | - | ||||||||||||||||||||||||
| 1939 | struct AtSpiAttribute { | - | ||||||||||||||||||||||||
| 1940 | QString name; | - | ||||||||||||||||||||||||
| 1941 | QString value; | - | ||||||||||||||||||||||||
| 1942 | AtSpiAttribute(const QString &aName, const QString &aValue) : name(aName), value(aValue) {} never executed: end of block | 0 | ||||||||||||||||||||||||
| 1943 | bool isNull() const { return name.isNull() || value.isNull(); } never executed: return name.isNull() || value.isNull(); | 0 | ||||||||||||||||||||||||
| 1944 | }; | - | ||||||||||||||||||||||||
| 1945 | - | |||||||||||||||||||||||||
| 1946 | QString atspiColor(const QString &ia2Color) | - | ||||||||||||||||||||||||
| 1947 | { | - | ||||||||||||||||||||||||
| 1948 | // "rgb(%u,%u,%u)" -> "%u,%u,%u" | - | ||||||||||||||||||||||||
| 1949 | return ia2Color.mid(4, ia2Color.length() - (4+1)); never executed: return ia2Color.mid(4, ia2Color.length() - (4+1)); | 0 | ||||||||||||||||||||||||
| 1950 | } | - | ||||||||||||||||||||||||
| 1951 | - | |||||||||||||||||||||||||
| 1952 | QString atspiSize(const QString &ia2Size) | - | ||||||||||||||||||||||||
| 1953 | { | - | ||||||||||||||||||||||||
| 1954 | // "%fpt" -> "%f" | - | ||||||||||||||||||||||||
| 1955 | return ia2Size.left(ia2Size.length() - 2); never executed: return ia2Size.left(ia2Size.length() - 2); | 0 | ||||||||||||||||||||||||
| 1956 | } | - | ||||||||||||||||||||||||
| 1957 | - | |||||||||||||||||||||||||
| 1958 | AtSpiAttribute atspiTextAttribute(const QString &ia2Name, const QString &ia2Value) | - | ||||||||||||||||||||||||
| 1959 | { | - | ||||||||||||||||||||||||
| 1960 | QString name = ia2Name; | - | ||||||||||||||||||||||||
| 1961 | QString value = ia2Value; | - | ||||||||||||||||||||||||
| 1962 | - | |||||||||||||||||||||||||
| 1963 | // IAccessible2: http://www.linuxfoundation.org/collaborate/workgroups/accessibility/iaccessible2/textattributes | - | ||||||||||||||||||||||||
| 1964 | // ATK attribute names: https://git.gnome.org/browse/orca/tree/src/orca/text_attribute_names.py | - | ||||||||||||||||||||||||
| 1965 | // ATK attribute values: https://developer.gnome.org/atk/unstable/AtkText.html#AtkTextAttribute | - | ||||||||||||||||||||||||
| 1966 | - | |||||||||||||||||||||||||
| 1967 | // https://bugzilla.gnome.org/show_bug.cgi?id=744553 "ATK docs provide no guidance for allowed values of some text attributes" | - | ||||||||||||||||||||||||
| 1968 | // specifically for "weight", "invalid", "language" and value range for colors | - | ||||||||||||||||||||||||
| 1969 | - | |||||||||||||||||||||||||
| 1970 | if (ia2Name == QLatin1String("background-color")) {
| 0 | ||||||||||||||||||||||||
| 1971 | name = QStringLiteral("bg-color"); never executed: return qstring_literal_temp; | 0 | ||||||||||||||||||||||||
| 1972 | value = atspiColor(value); | - | ||||||||||||||||||||||||
| 1973 | } else if (ia2Name == QLatin1String("font-family")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 1974 | name = QStringLiteral("family-name"); never executed: return qstring_literal_temp; | 0 | ||||||||||||||||||||||||
| 1975 | } else if (ia2Name == QLatin1String("color")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 1976 | name = QStringLiteral("fg-color"); never executed: return qstring_literal_temp; | 0 | ||||||||||||||||||||||||
| 1977 | value = atspiColor(value); | - | ||||||||||||||||||||||||
| 1978 | } else if (ia2Name == QLatin1String("text-align")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 1979 | name = QStringLiteral("justification"); never executed: return qstring_literal_temp; | 0 | ||||||||||||||||||||||||
| 1980 | if (value == QLatin1String("justify")) {
| 0 | ||||||||||||||||||||||||
| 1981 | value = QStringLiteral("fill"); never executed: return qstring_literal_temp; | 0 | ||||||||||||||||||||||||
| 1982 | } else { never executed: end of block | 0 | ||||||||||||||||||||||||
| 1983 | if (value != QLatin1String("left") &&
| 0 | ||||||||||||||||||||||||
| 1984 | value != QLatin1String("right") &&
| 0 | ||||||||||||||||||||||||
| 1985 | value != QLatin1String("center")
| 0 | ||||||||||||||||||||||||
| 1986 | ) { | - | ||||||||||||||||||||||||
| 1987 | value = QString(); | - | ||||||||||||||||||||||||
| 1988 | qAtspiDebug() << "Unknown text-align attribute value \"" << value << "\" cannot be translated to AT-SPI."; never executed: ;never executed: QMessageLogger(__FILE__, 1988, __PRETTY_FUNCTION__).debug() << "Unknown text-align attribute value \"" << value << "\" cannot be translated to AT-SPI.";
| 0 | ||||||||||||||||||||||||
| 1989 | } | - | ||||||||||||||||||||||||
| 1990 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1991 | } else if (ia2Name == QLatin1String("font-size")) {
| 0 | ||||||||||||||||||||||||
| 1992 | name = QStringLiteral("size"); never executed: return qstring_literal_temp; | 0 | ||||||||||||||||||||||||
| 1993 | value = atspiSize(value); | - | ||||||||||||||||||||||||
| 1994 | } else if (ia2Name == QLatin1String("font-style")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 1995 | name = QStringLiteral("style"); never executed: return qstring_literal_temp; | 0 | ||||||||||||||||||||||||
| 1996 | if (value != QLatin1String("normal") &&
| 0 | ||||||||||||||||||||||||
| 1997 | value != QLatin1String("italic") &&
| 0 | ||||||||||||||||||||||||
| 1998 | value != QLatin1String("oblique")
| 0 | ||||||||||||||||||||||||
| 1999 | ) { | - | ||||||||||||||||||||||||
| 2000 | value = QString(); | - | ||||||||||||||||||||||||
| 2001 | qAtspiDebug() << "Unknown font-style attribute value \"" << value << "\" cannot be translated to AT-SPI."; never executed: ;never executed: QMessageLogger(__FILE__, 2001, __PRETTY_FUNCTION__).debug() << "Unknown font-style attribute value \"" << value << "\" cannot be translated to AT-SPI.";
| 0 | ||||||||||||||||||||||||
| 2002 | } | - | ||||||||||||||||||||||||
| 2003 | } else if (ia2Name == QLatin1String("text-underline-type")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 2004 | name = QStringLiteral("underline"); never executed: return qstring_literal_temp; | 0 | ||||||||||||||||||||||||
| 2005 | if (value != QLatin1String("none") &&
| 0 | ||||||||||||||||||||||||
| 2006 | value != QLatin1String("single") &&
| 0 | ||||||||||||||||||||||||
| 2007 | value != QLatin1String("double")
| 0 | ||||||||||||||||||||||||
| 2008 | ) { | - | ||||||||||||||||||||||||
| 2009 | value = QString(); | - | ||||||||||||||||||||||||
| 2010 | qAtspiDebug() << "Unknown text-underline-type attribute value \"" << value << "\" cannot be translated to AT-SPI."; never executed: ;never executed: QMessageLogger(__FILE__, 2010, __PRETTY_FUNCTION__).debug() << "Unknown text-underline-type attribute value \"" << value << "\" cannot be translated to AT-SPI.";
| 0 | ||||||||||||||||||||||||
| 2011 | } | - | ||||||||||||||||||||||||
| 2012 | } else if (ia2Name == QLatin1String("font-weight")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 2013 | name = QStringLiteral("weight"); never executed: return qstring_literal_temp; | 0 | ||||||||||||||||||||||||
| 2014 | if (value == QLatin1String("normal"))
| 0 | ||||||||||||||||||||||||
| 2015 | // Orca seems to accept all IAccessible2 values except for "normal" | - | ||||||||||||||||||||||||
| 2016 | // (on which it produces traceback and fails to read any following text attributes), | - | ||||||||||||||||||||||||
| 2017 | // but that is the default value, so omit it anyway | - | ||||||||||||||||||||||||
| 2018 | value = QString(); never executed: value = QString(); | 0 | ||||||||||||||||||||||||
| 2019 | } else if (ia2Name == QLatin1String("text-position")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 2020 | name = QStringLiteral("vertical-align"); never executed: return qstring_literal_temp; | 0 | ||||||||||||||||||||||||
| 2021 | if (value != QLatin1String("baseline") &&
| 0 | ||||||||||||||||||||||||
| 2022 | value != QLatin1String("super") &&
| 0 | ||||||||||||||||||||||||
| 2023 | value != QLatin1String("sub")
| 0 | ||||||||||||||||||||||||
| 2024 | ) { | - | ||||||||||||||||||||||||
| 2025 | value = QString(); | - | ||||||||||||||||||||||||
| 2026 | qAtspiDebug() << "Unknown text-position attribute value \"" << value << "\" cannot be translated to AT-SPI."; never executed: ;never executed: QMessageLogger(__FILE__, 2026, __PRETTY_FUNCTION__).debug() << "Unknown text-position attribute value \"" << value << "\" cannot be translated to AT-SPI.";
| 0 | ||||||||||||||||||||||||
| 2027 | } | - | ||||||||||||||||||||||||
| 2028 | } else if (ia2Name == QLatin1String("writing-mode")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 2029 | name = QStringLiteral("direction"); never executed: return qstring_literal_temp; | 0 | ||||||||||||||||||||||||
| 2030 | if (value == QLatin1String("lr"))
| 0 | ||||||||||||||||||||||||
| 2031 | value = QStringLiteral("ltr"); never executed: value = ([]() -> QString { enum { Size = sizeof(u"" "ltr")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "ltr" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }());never executed: return qstring_literal_temp; | 0 | ||||||||||||||||||||||||
| 2032 | else if (value == QLatin1String("rl"))
| 0 | ||||||||||||||||||||||||
| 2033 | value = QStringLiteral("rtl"); never executed: value = ([]() -> QString { enum { Size = sizeof(u"" "rtl")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "rtl" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }());never executed: return qstring_literal_temp; | 0 | ||||||||||||||||||||||||
| 2034 | else if (value == QLatin1String("tb")) {
| 0 | ||||||||||||||||||||||||
| 2035 | // IAccessible2 docs refer to XSL, which specifies "tb" is shorthand for "tb-rl"; so at least give a hint about the horizontal direction (ATK does not support vertical direction in this attribute (yet)) | - | ||||||||||||||||||||||||
| 2036 | value = QStringLiteral("rtl"); never executed: return qstring_literal_temp; | 0 | ||||||||||||||||||||||||
| 2037 | qAtspiDebug() << "writing-mode attribute value \"tb\" translated only w.r.t. horizontal direction; vertical direction ignored"; never executed: ;never executed: QMessageLogger(__FILE__, 2037, __PRETTY_FUNCTION__).debug() << "writing-mode attribute value \"tb\" translated only w.r.t. horizontal direction; vertical direction ignored";
| 0 | ||||||||||||||||||||||||
| 2038 | } else { | - | ||||||||||||||||||||||||
| 2039 | value = QString(); | - | ||||||||||||||||||||||||
| 2040 | qAtspiDebug() << "Unknown writing-mode attribute value \"" << value << "\" cannot be translated to AT-SPI."; never executed: ;never executed: QMessageLogger(__FILE__, 2040, __PRETTY_FUNCTION__).debug() << "Unknown writing-mode attribute value \"" << value << "\" cannot be translated to AT-SPI.";
| 0 | ||||||||||||||||||||||||
| 2041 | } | - | ||||||||||||||||||||||||
| 2042 | } else if (ia2Name == QLatin1String("language")) {
| 0 | ||||||||||||||||||||||||
| 2043 | // OK - ATK has no docs on the format of the value, IAccessible2 has reasonable format - leave it at that now | - | ||||||||||||||||||||||||
| 2044 | } else if (ia2Name == QLatin1String("invalid")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 2045 | // OK - ATK docs are vague but suggest they support the same range of values as IAccessible2 | - | ||||||||||||||||||||||||
| 2046 | } else { never executed: end of block | 0 | ||||||||||||||||||||||||
| 2047 | // attribute we know nothing about | - | ||||||||||||||||||||||||
| 2048 | name = QString(); | - | ||||||||||||||||||||||||
| 2049 | value = QString(); | - | ||||||||||||||||||||||||
| 2050 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2051 | return AtSpiAttribute(name, value); never executed: return AtSpiAttribute(name, value); | 0 | ||||||||||||||||||||||||
| 2052 | } | - | ||||||||||||||||||||||||
| 2053 | } | - | ||||||||||||||||||||||||
| 2054 | - | |||||||||||||||||||||||||
| 2055 | // FIXME all attribute methods below should share code | - | ||||||||||||||||||||||||
| 2056 | QVariantList AtSpiAdaptor::getAttributes(QAccessibleInterface *interface, int offset, bool includeDefaults) const | - | ||||||||||||||||||||||||
| 2057 | { | - | ||||||||||||||||||||||||
| 2058 | Q_UNUSED(includeDefaults); | - | ||||||||||||||||||||||||
| 2059 | - | |||||||||||||||||||||||||
| 2060 | QSpiAttributeSet set; | - | ||||||||||||||||||||||||
| 2061 | int startOffset; | - | ||||||||||||||||||||||||
| 2062 | int endOffset; | - | ||||||||||||||||||||||||
| 2063 | - | |||||||||||||||||||||||||
| 2064 | QString joined = interface->textInterface()->attributes(offset, &startOffset, &endOffset); | - | ||||||||||||||||||||||||
| 2065 | QStringList attributes = joined.split (QLatin1Char(';'), QString::SkipEmptyParts, Qt::CaseSensitive); | - | ||||||||||||||||||||||||
| 2066 | foreach (const QString &attr, attributes) { | - | ||||||||||||||||||||||||
| 2067 | QStringList items; | - | ||||||||||||||||||||||||
| 2068 | items = attr.split(QLatin1Char(':'), QString::SkipEmptyParts, Qt::CaseSensitive); | - | ||||||||||||||||||||||||
| 2069 | AtSpiAttribute attribute = atspiTextAttribute(items[0], items[1]); | - | ||||||||||||||||||||||||
| 2070 | if (!attribute.isNull())
| 0 | ||||||||||||||||||||||||
| 2071 | set[attribute.name] = attribute.value; never executed: set[attribute.name] = attribute.value; | 0 | ||||||||||||||||||||||||
| 2072 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2073 | - | |||||||||||||||||||||||||
| 2074 | QVariantList list; | - | ||||||||||||||||||||||||
| 2075 | list << QVariant::fromValue(set) << startOffset << endOffset; | - | ||||||||||||||||||||||||
| 2076 | - | |||||||||||||||||||||||||
| 2077 | return list; never executed: return list; | 0 | ||||||||||||||||||||||||
| 2078 | } | - | ||||||||||||||||||||||||
| 2079 | - | |||||||||||||||||||||||||
| 2080 | QVariantList AtSpiAdaptor::getAttributeValue(QAccessibleInterface *interface, int offset, const QString &attributeName) const | - | ||||||||||||||||||||||||
| 2081 | { | - | ||||||||||||||||||||||||
| 2082 | QString mapped; | - | ||||||||||||||||||||||||
| 2083 | QString joined; | - | ||||||||||||||||||||||||
| 2084 | QStringList attributes; | - | ||||||||||||||||||||||||
| 2085 | QSpiAttributeSet map; | - | ||||||||||||||||||||||||
| 2086 | int startOffset; | - | ||||||||||||||||||||||||
| 2087 | int endOffset; | - | ||||||||||||||||||||||||
| 2088 | - | |||||||||||||||||||||||||
| 2089 | joined = interface->textInterface()->attributes(offset, &startOffset, &endOffset); | - | ||||||||||||||||||||||||
| 2090 | attributes = joined.split (QLatin1Char(';'), QString::SkipEmptyParts, Qt::CaseSensitive); | - | ||||||||||||||||||||||||
| 2091 | foreach (const QString& attr, attributes) { | - | ||||||||||||||||||||||||
| 2092 | QStringList items; | - | ||||||||||||||||||||||||
| 2093 | items = attr.split(QLatin1Char(':'), QString::SkipEmptyParts, Qt::CaseSensitive); | - | ||||||||||||||||||||||||
| 2094 | AtSpiAttribute attribute = atspiTextAttribute(items[0], items[1]); | - | ||||||||||||||||||||||||
| 2095 | if (!attribute.isNull())
| 0 | ||||||||||||||||||||||||
| 2096 | map[attribute.name] = attribute.value; never executed: map[attribute.name] = attribute.value; | 0 | ||||||||||||||||||||||||
| 2097 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2098 | mapped = map[attributeName]; | - | ||||||||||||||||||||||||
| 2099 | const bool defined = !mapped.isEmpty(); | - | ||||||||||||||||||||||||
| 2100 | QVariantList list; | - | ||||||||||||||||||||||||
| 2101 | list << mapped << startOffset << endOffset << defined; | - | ||||||||||||||||||||||||
| 2102 | return list; never executed: return list; | 0 | ||||||||||||||||||||||||
| 2103 | } | - | ||||||||||||||||||||||||
| 2104 | - | |||||||||||||||||||||||||
| 2105 | QList<QVariant> AtSpiAdaptor::getCharacterExtents(QAccessibleInterface *interface, int offset, uint coordType) const | - | ||||||||||||||||||||||||
| 2106 | { | - | ||||||||||||||||||||||||
| 2107 | QRect rect = interface->textInterface()->characterRect(offset); | - | ||||||||||||||||||||||||
| 2108 | - | |||||||||||||||||||||||||
| 2109 | if (coordType == ATSPI_COORD_TYPE_WINDOW)
| 0 | ||||||||||||||||||||||||
| 2110 | rect = translateRectToWindowCoordinates(interface, rect); never executed: rect = translateRectToWindowCoordinates(interface, rect); | 0 | ||||||||||||||||||||||||
| 2111 | - | |||||||||||||||||||||||||
| 2112 | return QList<QVariant>() << rect.x() << rect.y() << rect.width() << rect.height(); never executed: return QList<QVariant>() << rect.x() << rect.y() << rect.width() << rect.height(); | 0 | ||||||||||||||||||||||||
| 2113 | } | - | ||||||||||||||||||||||||
| 2114 | - | |||||||||||||||||||||||||
| 2115 | QList<QVariant> AtSpiAdaptor::getRangeExtents(QAccessibleInterface *interface, | - | ||||||||||||||||||||||||
| 2116 | int startOffset, int endOffset, uint coordType) const | - | ||||||||||||||||||||||||
| 2117 | { | - | ||||||||||||||||||||||||
| 2118 | if (endOffset == -1)
| 0 | ||||||||||||||||||||||||
| 2119 | endOffset = interface->textInterface()->characterCount(); never executed: endOffset = interface->textInterface()->characterCount(); | 0 | ||||||||||||||||||||||||
| 2120 | - | |||||||||||||||||||||||||
| 2121 | QAccessibleTextInterface *textInterface = interface->textInterface(); | - | ||||||||||||||||||||||||
| 2122 | if (endOffset <= startOffset || !textInterface)
| 0 | ||||||||||||||||||||||||
| 2123 | return QList<QVariant>() << -1 << -1 << 0 << 0; never executed: return QList<QVariant>() << -1 << -1 << 0 << 0; | 0 | ||||||||||||||||||||||||
| 2124 | - | |||||||||||||||||||||||||
| 2125 | QRect rect = textInterface->characterRect(startOffset); | - | ||||||||||||||||||||||||
| 2126 | for (int i=startOffset + 1; i <= endOffset; i++)
| 0 | ||||||||||||||||||||||||
| 2127 | rect = rect | textInterface->characterRect(i); never executed: rect = rect | textInterface->characterRect(i); | 0 | ||||||||||||||||||||||||
| 2128 | - | |||||||||||||||||||||||||
| 2129 | // relative to window | - | ||||||||||||||||||||||||
| 2130 | if (coordType == ATSPI_COORD_TYPE_WINDOW)
| 0 | ||||||||||||||||||||||||
| 2131 | rect = translateRectToWindowCoordinates(interface, rect); never executed: rect = translateRectToWindowCoordinates(interface, rect); | 0 | ||||||||||||||||||||||||
| 2132 | - | |||||||||||||||||||||||||
| 2133 | return QList<QVariant>() << rect.x() << rect.y() << rect.width() << rect.height(); never executed: return QList<QVariant>() << rect.x() << rect.y() << rect.width() << rect.height(); | 0 | ||||||||||||||||||||||||
| 2134 | } | - | ||||||||||||||||||||||||
| 2135 | - | |||||||||||||||||||||||||
| 2136 | QRect AtSpiAdaptor::translateRectToWindowCoordinates(QAccessibleInterface *interface, const QRect &rect) | - | ||||||||||||||||||||||||
| 2137 | { | - | ||||||||||||||||||||||||
| 2138 | QAccessibleInterface * window = getWindow(interface); | - | ||||||||||||||||||||||||
| 2139 | if (window)
| 0 | ||||||||||||||||||||||||
| 2140 | return rect.translated(-window->rect().x(), -window->rect().y()); never executed: return rect.translated(-window->rect().x(), -window->rect().y()); | 0 | ||||||||||||||||||||||||
| 2141 | - | |||||||||||||||||||||||||
| 2142 | return rect; never executed: return rect; | 0 | ||||||||||||||||||||||||
| 2143 | } | - | ||||||||||||||||||||||||
| 2144 | - | |||||||||||||||||||||||||
| 2145 | - | |||||||||||||||||||||||||
| 2146 | // Editable Text interface | - | ||||||||||||||||||||||||
| 2147 | static QString textForRange(QAccessibleInterface *accessible, int startOffset, int endOffset) | - | ||||||||||||||||||||||||
| 2148 | { | - | ||||||||||||||||||||||||
| 2149 | if (QAccessibleTextInterface *textIface = accessible->textInterface()) {
| 0 | ||||||||||||||||||||||||
| 2150 | if (endOffset == -1)
| 0 | ||||||||||||||||||||||||
| 2151 | endOffset = textIface->characterCount(); never executed: endOffset = textIface->characterCount(); | 0 | ||||||||||||||||||||||||
| 2152 | return textIface->text(startOffset, endOffset); never executed: return textIface->text(startOffset, endOffset); | 0 | ||||||||||||||||||||||||
| 2153 | } | - | ||||||||||||||||||||||||
| 2154 | QString txt = accessible->text(QAccessible::Value); | - | ||||||||||||||||||||||||
| 2155 | if (endOffset == -1)
| 0 | ||||||||||||||||||||||||
| 2156 | endOffset = txt.length(); never executed: endOffset = txt.length(); | 0 | ||||||||||||||||||||||||
| 2157 | return txt.mid(startOffset, endOffset - startOffset); never executed: return txt.mid(startOffset, endOffset - startOffset); | 0 | ||||||||||||||||||||||||
| 2158 | } | - | ||||||||||||||||||||||||
| 2159 | - | |||||||||||||||||||||||||
| 2160 | static void replaceTextFallback(QAccessibleInterface *accessible, long startOffset, long endOffset, const QString &txt) | - | ||||||||||||||||||||||||
| 2161 | { | - | ||||||||||||||||||||||||
| 2162 | QString t = textForRange(accessible, 0, -1); | - | ||||||||||||||||||||||||
| 2163 | if (endOffset == -1)
| 0 | ||||||||||||||||||||||||
| 2164 | endOffset = t.length(); never executed: endOffset = t.length(); | 0 | ||||||||||||||||||||||||
| 2165 | if (endOffset - startOffset == 0)
| 0 | ||||||||||||||||||||||||
| 2166 | t.insert(startOffset, txt); never executed: t.insert(startOffset, txt); | 0 | ||||||||||||||||||||||||
| 2167 | else | - | ||||||||||||||||||||||||
| 2168 | t.replace(startOffset, endOffset - startOffset, txt); never executed: t.replace(startOffset, endOffset - startOffset, txt); | 0 | ||||||||||||||||||||||||
| 2169 | accessible->setText(QAccessible::Value, t); | - | ||||||||||||||||||||||||
| 2170 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2171 | - | |||||||||||||||||||||||||
| 2172 | bool AtSpiAdaptor::editableTextInterface(QAccessibleInterface *interface, const QString &function, const QDBusMessage &message, const QDBusConnection &connection) | - | ||||||||||||||||||||||||
| 2173 | { | - | ||||||||||||||||||||||||
| 2174 | if (function == QLatin1String("CopyText")) {
| 0 | ||||||||||||||||||||||||
| 2175 | #ifndef QT_NO_CLIPBOARD | - | ||||||||||||||||||||||||
| 2176 | int startOffset = message.arguments().at(0).toInt(); | - | ||||||||||||||||||||||||
| 2177 | int endOffset = message.arguments().at(1).toInt(); | - | ||||||||||||||||||||||||
| 2178 | const QString t = textForRange(interface, startOffset, endOffset); | - | ||||||||||||||||||||||||
| 2179 | QGuiApplication::clipboard()->setText(t); | - | ||||||||||||||||||||||||
| 2180 | #endif | - | ||||||||||||||||||||||||
| 2181 | connection.send(message.createReply(true)); | - | ||||||||||||||||||||||||
| 2182 | } else if (function == QLatin1String("CutText")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 2183 | #ifndef QT_NO_CLIPBOARD | - | ||||||||||||||||||||||||
| 2184 | int startOffset = message.arguments().at(0).toInt(); | - | ||||||||||||||||||||||||
| 2185 | int endOffset = message.arguments().at(1).toInt(); | - | ||||||||||||||||||||||||
| 2186 | const QString t = textForRange(interface, startOffset, endOffset); | - | ||||||||||||||||||||||||
| 2187 | if (QAccessibleEditableTextInterface *editableTextIface = interface->editableTextInterface())
| 0 | ||||||||||||||||||||||||
| 2188 | editableTextIface->deleteText(startOffset, endOffset); never executed: editableTextIface->deleteText(startOffset, endOffset); | 0 | ||||||||||||||||||||||||
| 2189 | else | - | ||||||||||||||||||||||||
| 2190 | replaceTextFallback(interface, startOffset, endOffset, QString()); never executed: replaceTextFallback(interface, startOffset, endOffset, QString()); | 0 | ||||||||||||||||||||||||
| 2191 | QGuiApplication::clipboard()->setText(t); | - | ||||||||||||||||||||||||
| 2192 | #endif | - | ||||||||||||||||||||||||
| 2193 | connection.send(message.createReply(true)); | - | ||||||||||||||||||||||||
| 2194 | } else if (function == QLatin1String("DeleteText")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 2195 | int startOffset = message.arguments().at(0).toInt(); | - | ||||||||||||||||||||||||
| 2196 | int endOffset = message.arguments().at(1).toInt(); | - | ||||||||||||||||||||||||
| 2197 | if (QAccessibleEditableTextInterface *editableTextIface = interface->editableTextInterface())
| 0 | ||||||||||||||||||||||||
| 2198 | editableTextIface->deleteText(startOffset, endOffset); never executed: editableTextIface->deleteText(startOffset, endOffset); | 0 | ||||||||||||||||||||||||
| 2199 | else | - | ||||||||||||||||||||||||
| 2200 | replaceTextFallback(interface, startOffset, endOffset, QString()); never executed: replaceTextFallback(interface, startOffset, endOffset, QString()); | 0 | ||||||||||||||||||||||||
| 2201 | connection.send(message.createReply(true)); | - | ||||||||||||||||||||||||
| 2202 | } else if (function == QLatin1String("InsertText")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 2203 | int position = message.arguments().at(0).toInt(); | - | ||||||||||||||||||||||||
| 2204 | QString text = message.arguments().at(1).toString(); | - | ||||||||||||||||||||||||
| 2205 | int length = message.arguments().at(2).toInt(); | - | ||||||||||||||||||||||||
| 2206 | text.resize(length); | - | ||||||||||||||||||||||||
| 2207 | if (QAccessibleEditableTextInterface *editableTextIface = interface->editableTextInterface())
| 0 | ||||||||||||||||||||||||
| 2208 | editableTextIface->insertText(position, text); never executed: editableTextIface->insertText(position, text); | 0 | ||||||||||||||||||||||||
| 2209 | else | - | ||||||||||||||||||||||||
| 2210 | replaceTextFallback(interface, position, position, text); never executed: replaceTextFallback(interface, position, position, text); | 0 | ||||||||||||||||||||||||
| 2211 | connection.send(message.createReply(true)); | - | ||||||||||||||||||||||||
| 2212 | } else if (function == QLatin1String("PasteText")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 2213 | #ifndef QT_NO_CLIPBOARD | - | ||||||||||||||||||||||||
| 2214 | int position = message.arguments().at(0).toInt(); | - | ||||||||||||||||||||||||
| 2215 | const QString txt = QGuiApplication::clipboard()->text(); | - | ||||||||||||||||||||||||
| 2216 | if (QAccessibleEditableTextInterface *editableTextIface = interface->editableTextInterface())
| 0 | ||||||||||||||||||||||||
| 2217 | editableTextIface->insertText(position, txt); never executed: editableTextIface->insertText(position, txt); | 0 | ||||||||||||||||||||||||
| 2218 | else | - | ||||||||||||||||||||||||
| 2219 | replaceTextFallback(interface, position, position, txt); never executed: replaceTextFallback(interface, position, position, txt); | 0 | ||||||||||||||||||||||||
| 2220 | #endif | - | ||||||||||||||||||||||||
| 2221 | connection.send(message.createReply(true)); | - | ||||||||||||||||||||||||
| 2222 | } else if (function == QLatin1String("SetTextContents")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 2223 | QString newContents = message.arguments().at(0).toString(); | - | ||||||||||||||||||||||||
| 2224 | if (QAccessibleEditableTextInterface *editableTextIface = interface->editableTextInterface())
| 0 | ||||||||||||||||||||||||
| 2225 | editableTextIface->replaceText(0, interface->textInterface()->characterCount(), newContents); never executed: editableTextIface->replaceText(0, interface->textInterface()->characterCount(), newContents); | 0 | ||||||||||||||||||||||||
| 2226 | else | - | ||||||||||||||||||||||||
| 2227 | replaceTextFallback(interface, 0, -1, newContents); never executed: replaceTextFallback(interface, 0, -1, newContents); | 0 | ||||||||||||||||||||||||
| 2228 | connection.send(message.createReply(true)); | - | ||||||||||||||||||||||||
| 2229 | } else if (function == QLatin1String("")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 2230 | connection.send(message.createReply()); | - | ||||||||||||||||||||||||
| 2231 | } else { never executed: end of block | 0 | ||||||||||||||||||||||||
| 2232 | qAtspiDebug() << "WARNING: AtSpiAdaptor::editableTextInterface does not implement " << function << message.path(); never executed: ;never executed: QMessageLogger(__FILE__, 2232, __PRETTY_FUNCTION__).debug() << "WARNING: AtSpiAdaptor::editableTextInterface does not implement " << function << message.path();
| 0 | ||||||||||||||||||||||||
| 2233 | return false; never executed: return false; | 0 | ||||||||||||||||||||||||
| 2234 | } | - | ||||||||||||||||||||||||
| 2235 | return true; never executed: return true; | 0 | ||||||||||||||||||||||||
| 2236 | } | - | ||||||||||||||||||||||||
| 2237 | - | |||||||||||||||||||||||||
| 2238 | // Value interface | - | ||||||||||||||||||||||||
| 2239 | bool AtSpiAdaptor::valueInterface(QAccessibleInterface *interface, const QString &function, const QDBusMessage &message, const QDBusConnection &connection) | - | ||||||||||||||||||||||||
| 2240 | { | - | ||||||||||||||||||||||||
| 2241 | QAccessibleValueInterface *valueIface = interface->valueInterface(); | - | ||||||||||||||||||||||||
| 2242 | if (!valueIface)
| 0 | ||||||||||||||||||||||||
| 2243 | return false; never executed: return false; | 0 | ||||||||||||||||||||||||
| 2244 | - | |||||||||||||||||||||||||
| 2245 | if (function == QLatin1String("SetCurrentValue")) {
| 0 | ||||||||||||||||||||||||
| 2246 | QDBusVariant v = message.arguments().at(2).value<QDBusVariant>(); | - | ||||||||||||||||||||||||
| 2247 | double value = v.variant().toDouble(); | - | ||||||||||||||||||||||||
| 2248 | //Temporary fix | - | ||||||||||||||||||||||||
| 2249 | //See https://bugzilla.gnome.org/show_bug.cgi?id=652596 | - | ||||||||||||||||||||||||
| 2250 | valueIface->setCurrentValue(value); | - | ||||||||||||||||||||||||
| 2251 | connection.send(message.createReply()); // FIXME is the reply needed? | - | ||||||||||||||||||||||||
| 2252 | } else { never executed: end of block | 0 | ||||||||||||||||||||||||
| 2253 | QVariant value; | - | ||||||||||||||||||||||||
| 2254 | if (function == QLatin1String("GetCurrentValue"))
| 0 | ||||||||||||||||||||||||
| 2255 | value = valueIface->currentValue(); never executed: value = valueIface->currentValue(); | 0 | ||||||||||||||||||||||||
| 2256 | else if (function == QLatin1String("GetMaximumValue"))
| 0 | ||||||||||||||||||||||||
| 2257 | value = valueIface->maximumValue(); never executed: value = valueIface->maximumValue(); | 0 | ||||||||||||||||||||||||
| 2258 | else if (function == QLatin1String("GetMinimumIncrement"))
| 0 | ||||||||||||||||||||||||
| 2259 | value = valueIface->minimumStepSize(); never executed: value = valueIface->minimumStepSize(); | 0 | ||||||||||||||||||||||||
| 2260 | else if (function == QLatin1String("GetMinimumValue"))
| 0 | ||||||||||||||||||||||||
| 2261 | value = valueIface->minimumValue(); never executed: value = valueIface->minimumValue(); | 0 | ||||||||||||||||||||||||
| 2262 | else { | - | ||||||||||||||||||||||||
| 2263 | qAtspiDebug() << "WARNING: AtSpiAdaptor::valueInterface does not implement " << function << message.path(); never executed: ;never executed: QMessageLogger(__FILE__, 2263, __PRETTY_FUNCTION__).debug() << "WARNING: AtSpiAdaptor::valueInterface does not implement " << function << message.path();
| 0 | ||||||||||||||||||||||||
| 2264 | return false; never executed: return false; | 0 | ||||||||||||||||||||||||
| 2265 | } | - | ||||||||||||||||||||||||
| 2266 | if (!value.canConvert(QVariant::Double)) {
| 0 | ||||||||||||||||||||||||
| 2267 | qAtspiDebug() << "AtSpiAdaptor::valueInterface: Could not convert to double: " << function; never executed: ;never executed: QMessageLogger(__FILE__, 2267, __PRETTY_FUNCTION__).debug() << "AtSpiAdaptor::valueInterface: Could not convert to double: " << function;
| 0 | ||||||||||||||||||||||||
| 2268 | } | - | ||||||||||||||||||||||||
| 2269 | - | |||||||||||||||||||||||||
| 2270 | // explicitly convert to dbus-variant containing one double since atspi expects that | - | ||||||||||||||||||||||||
| 2271 | // everything else might fail to convert back on the other end | - | ||||||||||||||||||||||||
| 2272 | connection.send(message.createReply( | - | ||||||||||||||||||||||||
| 2273 | QVariant::fromValue(QDBusVariant(QVariant::fromValue(value.toDouble()))))); | - | ||||||||||||||||||||||||
| 2274 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2275 | return true; never executed: return true; | 0 | ||||||||||||||||||||||||
| 2276 | } | - | ||||||||||||||||||||||||
| 2277 | - | |||||||||||||||||||||||||
| 2278 | // Table interface | - | ||||||||||||||||||||||||
| 2279 | bool AtSpiAdaptor::tableInterface(QAccessibleInterface *interface, const QString &function, const QDBusMessage &message, const QDBusConnection &connection) | - | ||||||||||||||||||||||||
| 2280 | { | - | ||||||||||||||||||||||||
| 2281 | if (!(interface->tableInterface() || interface->tableCellInterface())) {
| 0 | ||||||||||||||||||||||||
| 2282 | qAtspiDebug() << "WARNING Qt AtSpiAdaptor: Could not find table interface for: " << message.path() << interface; never executed: ;never executed: QMessageLogger(__FILE__, 2282, __PRETTY_FUNCTION__).debug() << "WARNING Qt AtSpiAdaptor: Could not find table interface for: " << message.path() << interface;
| 0 | ||||||||||||||||||||||||
| 2283 | return false; never executed: return false; | 0 | ||||||||||||||||||||||||
| 2284 | } | - | ||||||||||||||||||||||||
| 2285 | - | |||||||||||||||||||||||||
| 2286 | if (0) { dead code: { } | - | ||||||||||||||||||||||||
| 2287 | // properties dead code: { } | - | ||||||||||||||||||||||||
| 2288 | } else if (function == QLatin1String("GetCaption")) {
dead code: { } | - | ||||||||||||||||||||||||
| 2289 | QAccessibleInterface * captionInterface= interface->tableInterface()->caption(); | - | ||||||||||||||||||||||||
| 2290 | if (captionInterface) {
| 0 | ||||||||||||||||||||||||
| 2291 | QSpiObjectReference ref = QSpiObjectReference(connection, QDBusObjectPath(pathForInterface(captionInterface))); | - | ||||||||||||||||||||||||
| 2292 | sendReply(connection, message, QVariant::fromValue(ref)); | - | ||||||||||||||||||||||||
| 2293 | } else { never executed: end of block | 0 | ||||||||||||||||||||||||
| 2294 | sendReply(connection, message, QVariant::fromValue( | - | ||||||||||||||||||||||||
| 2295 | QSpiObjectReference(connection, QDBusObjectPath(ATSPI_DBUS_PATH_NULL)))); | - | ||||||||||||||||||||||||
| 2296 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2297 | } else if (function == QLatin1String("GetNColumns")) {
| 0 | ||||||||||||||||||||||||
| 2298 | connection.send(message.createReply(QVariant::fromValue(QDBusVariant( | - | ||||||||||||||||||||||||
| 2299 | QVariant::fromValue(interface->tableInterface()->columnCount()))))); | - | ||||||||||||||||||||||||
| 2300 | } else if (function == QLatin1String("GetNRows")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 2301 | connection.send(message.createReply(QVariant::fromValue(QDBusVariant( | - | ||||||||||||||||||||||||
| 2302 | QVariant::fromValue(interface->tableInterface()->rowCount()))))); | - | ||||||||||||||||||||||||
| 2303 | } else if (function == QLatin1String("GetNSelectedColumns")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 2304 | connection.send(message.createReply(QVariant::fromValue(QDBusVariant( | - | ||||||||||||||||||||||||
| 2305 | QVariant::fromValue(interface->tableInterface()->selectedColumnCount()))))); | - | ||||||||||||||||||||||||
| 2306 | } else if (function == QLatin1String("GetNSelectedRows")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 2307 | connection.send(message.createReply(QVariant::fromValue(QDBusVariant( | - | ||||||||||||||||||||||||
| 2308 | QVariant::fromValue(interface->tableInterface()->selectedRowCount()))))); | - | ||||||||||||||||||||||||
| 2309 | } else if (function == QLatin1String("GetSummary")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 2310 | QAccessibleInterface * summary = interface->tableInterface() ? interface->tableInterface()->summary() : 0;
| 0 | ||||||||||||||||||||||||
| 2311 | QSpiObjectReference ref(connection, QDBusObjectPath(pathForInterface(summary))); | - | ||||||||||||||||||||||||
| 2312 | connection.send(message.createReply(QVariant::fromValue(QDBusVariant(QVariant::fromValue(ref))))); | - | ||||||||||||||||||||||||
| 2313 | } else if (function == QLatin1String("GetAccessibleAt")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 2314 | int row = message.arguments().at(0).toInt(); | - | ||||||||||||||||||||||||
| 2315 | int column = message.arguments().at(1).toInt(); | - | ||||||||||||||||||||||||
| 2316 | if ((row < 0) ||
| 0 | ||||||||||||||||||||||||
| 2317 | (column < 0) ||
| 0 | ||||||||||||||||||||||||
| 2318 | (row >= interface->tableInterface()->rowCount()) ||
| 0 | ||||||||||||||||||||||||
| 2319 | (column >= interface->tableInterface()->columnCount())) {
| 0 | ||||||||||||||||||||||||
| 2320 | qAtspiDebug() << "WARNING: invalid index for tableInterface GetAccessibleAt (" << row << ", " << column << ')'; never executed: ;never executed: QMessageLogger(__FILE__, 2320, __PRETTY_FUNCTION__).debug() << "WARNING: invalid index for tableInterface GetAccessibleAt (" << row << ", " << column << ')';
| 0 | ||||||||||||||||||||||||
| 2321 | return false; never executed: return false; | 0 | ||||||||||||||||||||||||
| 2322 | } | - | ||||||||||||||||||||||||
| 2323 | - | |||||||||||||||||||||||||
| 2324 | QSpiObjectReference ref; | - | ||||||||||||||||||||||||
| 2325 | QAccessibleInterface * cell(interface->tableInterface()->cellAt(row, column)); | - | ||||||||||||||||||||||||
| 2326 | if (cell) {
| 0 | ||||||||||||||||||||||||
| 2327 | ref = QSpiObjectReference(connection, QDBusObjectPath(pathForInterface(cell))); | - | ||||||||||||||||||||||||
| 2328 | } else { never executed: end of block | 0 | ||||||||||||||||||||||||
| 2329 | qAtspiDebug() << "WARNING: no cell interface returned for " << interface->object() << row << column; never executed: ;never executed: QMessageLogger(__FILE__, 2329, __PRETTY_FUNCTION__).debug() << "WARNING: no cell interface returned for " << interface->object() << row << column;
| 0 | ||||||||||||||||||||||||
| 2330 | ref = QSpiObjectReference(); | - | ||||||||||||||||||||||||
| 2331 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2332 | connection.send(message.createReply(QVariant::fromValue(ref))); | - | ||||||||||||||||||||||||
| 2333 | - | |||||||||||||||||||||||||
| 2334 | } else if (function == QLatin1String("GetIndexAt")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 2335 | int row = message.arguments().at(0).toInt(); | - | ||||||||||||||||||||||||
| 2336 | int column = message.arguments().at(1).toInt(); | - | ||||||||||||||||||||||||
| 2337 | QAccessibleInterface *cell = interface->tableInterface()->cellAt(row, column); | - | ||||||||||||||||||||||||
| 2338 | if (!cell) {
| 0 | ||||||||||||||||||||||||
| 2339 | qAtspiDebug() << "WARNING: AtSpiAdaptor::GetIndexAt(" << row << ',' << column << ") did not find a cell. " << interface; never executed: ;never executed: QMessageLogger(__FILE__, 2339, __PRETTY_FUNCTION__).debug() << "WARNING: AtSpiAdaptor::GetIndexAt(" << row << ',' << column << ") did not find a cell. " << interface;
| 0 | ||||||||||||||||||||||||
| 2340 | return false; never executed: return false; | 0 | ||||||||||||||||||||||||
| 2341 | } | - | ||||||||||||||||||||||||
| 2342 | int index = interface->indexOfChild(cell); | - | ||||||||||||||||||||||||
| 2343 | qAtspiDebug() << "QSpiAdaptor::GetIndexAt row:" << row << " col:" << column << " logical index:" << index; never executed: ;never executed: QMessageLogger(__FILE__, 2343, __PRETTY_FUNCTION__).debug() << "QSpiAdaptor::GetIndexAt row:" << row << " col:" << column << " logical index:" << index;
| 0 | ||||||||||||||||||||||||
| 2344 | Q_ASSERT(index > 0); | - | ||||||||||||||||||||||||
| 2345 | connection.send(message.createReply(index)); | - | ||||||||||||||||||||||||
| 2346 | } else if ((function == QLatin1String("GetColumnAtIndex")) || (function == QLatin1String("GetRowAtIndex"))) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 2347 | int index = message.arguments().at(0).toInt(); | - | ||||||||||||||||||||||||
| 2348 | int ret = -1; | - | ||||||||||||||||||||||||
| 2349 | if (index >= 0) {
| 0 | ||||||||||||||||||||||||
| 2350 | QAccessibleInterface * cell = interface->child(index); | - | ||||||||||||||||||||||||
| 2351 | if (cell) {
| 0 | ||||||||||||||||||||||||
| 2352 | if (function == QLatin1String("GetColumnAtIndex")) {
| 0 | ||||||||||||||||||||||||
| 2353 | if (cell->role() == QAccessible::ColumnHeader) {
| 0 | ||||||||||||||||||||||||
| 2354 | ret = index; | - | ||||||||||||||||||||||||
| 2355 | } else if (cell->role() == QAccessible::RowHeader) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 2356 | ret = -1; | - | ||||||||||||||||||||||||
| 2357 | } else { never executed: end of block | 0 | ||||||||||||||||||||||||
| 2358 | if (!cell->tableCellInterface()) {
| 0 | ||||||||||||||||||||||||
| 2359 | qAtspiDebug() << "WARNING: AtSpiAdaptor::" << function << " No table cell interface: " << cell; never executed: ;never executed: QMessageLogger(__FILE__, 2359, __PRETTY_FUNCTION__).debug() << "WARNING: AtSpiAdaptor::" << function << " No table cell interface: " << cell;
| 0 | ||||||||||||||||||||||||
| 2360 | return false; never executed: return false; | 0 | ||||||||||||||||||||||||
| 2361 | } | - | ||||||||||||||||||||||||
| 2362 | ret = cell->tableCellInterface()->columnIndex(); | - | ||||||||||||||||||||||||
| 2363 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2364 | } else { | - | ||||||||||||||||||||||||
| 2365 | if (cell->role() == QAccessible::ColumnHeader) {
| 0 | ||||||||||||||||||||||||
| 2366 | ret = -1; | - | ||||||||||||||||||||||||
| 2367 | } else if (cell->role() == QAccessible::RowHeader) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 2368 | ret = index % interface->tableInterface()->columnCount(); | - | ||||||||||||||||||||||||
| 2369 | } else { never executed: end of block | 0 | ||||||||||||||||||||||||
| 2370 | if (!cell->tableCellInterface()) {
| 0 | ||||||||||||||||||||||||
| 2371 | qAtspiDebug() << "WARNING: AtSpiAdaptor::" << function << " No table cell interface: " << cell; never executed: ;never executed: QMessageLogger(__FILE__, 2371, __PRETTY_FUNCTION__).debug() << "WARNING: AtSpiAdaptor::" << function << " No table cell interface: " << cell;
| 0 | ||||||||||||||||||||||||
| 2372 | return false; never executed: return false; | 0 | ||||||||||||||||||||||||
| 2373 | } | - | ||||||||||||||||||||||||
| 2374 | ret = cell->tableCellInterface()->rowIndex(); | - | ||||||||||||||||||||||||
| 2375 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2376 | } | - | ||||||||||||||||||||||||
| 2377 | } else { | - | ||||||||||||||||||||||||
| 2378 | qAtspiDebug() << "WARNING: AtSpiAdaptor::" << function << " No cell at index: " << index << interface; never executed: ;never executed: QMessageLogger(__FILE__, 2378, __PRETTY_FUNCTION__).debug() << "WARNING: AtSpiAdaptor::" << function << " No cell at index: " << index << interface;
| 0 | ||||||||||||||||||||||||
| 2379 | return false; never executed: return false; | 0 | ||||||||||||||||||||||||
| 2380 | } | - | ||||||||||||||||||||||||
| 2381 | } | - | ||||||||||||||||||||||||
| 2382 | connection.send(message.createReply(ret)); | - | ||||||||||||||||||||||||
| 2383 | - | |||||||||||||||||||||||||
| 2384 | } else if (function == QLatin1String("GetColumnDescription")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 2385 | int column = message.arguments().at(0).toInt(); | - | ||||||||||||||||||||||||
| 2386 | connection.send(message.createReply(interface->tableInterface()->columnDescription(column))); | - | ||||||||||||||||||||||||
| 2387 | } else if (function == QLatin1String("GetRowDescription")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 2388 | int row = message.arguments().at(0).toInt(); | - | ||||||||||||||||||||||||
| 2389 | connection.send(message.createReply(interface->tableInterface()->rowDescription(row))); | - | ||||||||||||||||||||||||
| 2390 | - | |||||||||||||||||||||||||
| 2391 | - | |||||||||||||||||||||||||
| 2392 | - | |||||||||||||||||||||||||
| 2393 | } else if (function == QLatin1String("GetRowColumnExtentsAtIndex")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 2394 | int index = message.arguments().at(0).toInt(); | - | ||||||||||||||||||||||||
| 2395 | bool success = false; | - | ||||||||||||||||||||||||
| 2396 | - | |||||||||||||||||||||||||
| 2397 | int row = -1; | - | ||||||||||||||||||||||||
| 2398 | int col = -1; | - | ||||||||||||||||||||||||
| 2399 | int rowExtents = -1; | - | ||||||||||||||||||||||||
| 2400 | int colExtents = -1; | - | ||||||||||||||||||||||||
| 2401 | bool isSelected = false; | - | ||||||||||||||||||||||||
| 2402 | - | |||||||||||||||||||||||||
| 2403 | int cols = interface->tableInterface()->columnCount(); | - | ||||||||||||||||||||||||
| 2404 | if (cols > 0) {
| 0 | ||||||||||||||||||||||||
| 2405 | row = index / cols; | - | ||||||||||||||||||||||||
| 2406 | col = index % cols; | - | ||||||||||||||||||||||||
| 2407 | QAccessibleTableCellInterface *cell = interface->tableInterface()->cellAt(row, col)->tableCellInterface(); | - | ||||||||||||||||||||||||
| 2408 | if (cell) {
| 0 | ||||||||||||||||||||||||
| 2409 | row = cell->rowIndex(); | - | ||||||||||||||||||||||||
| 2410 | col = cell->columnIndex(); | - | ||||||||||||||||||||||||
| 2411 | rowExtents = cell->rowExtent(); | - | ||||||||||||||||||||||||
| 2412 | colExtents = cell->columnExtent(); | - | ||||||||||||||||||||||||
| 2413 | isSelected = cell->isSelected(); | - | ||||||||||||||||||||||||
| 2414 | success = true; | - | ||||||||||||||||||||||||
| 2415 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2416 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2417 | QVariantList list; | - | ||||||||||||||||||||||||
| 2418 | list << success << row << col << rowExtents << colExtents << isSelected; | - | ||||||||||||||||||||||||
| 2419 | connection.send(message.createReply(list)); | - | ||||||||||||||||||||||||
| 2420 | - | |||||||||||||||||||||||||
| 2421 | } else if (function == QLatin1String("GetColumnExtentAt")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 2422 | int row = message.arguments().at(0).toInt(); | - | ||||||||||||||||||||||||
| 2423 | int column = message.arguments().at(1).toInt(); | - | ||||||||||||||||||||||||
| 2424 | connection.send(message.createReply(interface->tableInterface()->cellAt(row, column)->tableCellInterface()->columnExtent())); | - | ||||||||||||||||||||||||
| 2425 | - | |||||||||||||||||||||||||
| 2426 | } else if (function == QLatin1String("GetRowExtentAt")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 2427 | int row = message.arguments().at(0).toInt(); | - | ||||||||||||||||||||||||
| 2428 | int column = message.arguments().at(1).toInt(); | - | ||||||||||||||||||||||||
| 2429 | connection.send(message.createReply(interface->tableInterface()->cellAt(row, column)->tableCellInterface()->rowExtent())); | - | ||||||||||||||||||||||||
| 2430 | - | |||||||||||||||||||||||||
| 2431 | } else if (function == QLatin1String("GetColumnHeader")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 2432 | int column = message.arguments().at(0).toInt(); | - | ||||||||||||||||||||||||
| 2433 | QSpiObjectReference ref; | - | ||||||||||||||||||||||||
| 2434 | - | |||||||||||||||||||||||||
| 2435 | QAccessibleInterface * cell(interface->tableInterface()->cellAt(0, column)); | - | ||||||||||||||||||||||||
| 2436 | if (cell && cell->tableCellInterface()) {
| 0 | ||||||||||||||||||||||||
| 2437 | QList<QAccessibleInterface*> header = cell->tableCellInterface()->columnHeaderCells(); | - | ||||||||||||||||||||||||
| 2438 | if (header.size() > 0) {
| 0 | ||||||||||||||||||||||||
| 2439 | ref = QSpiObjectReference(connection, QDBusObjectPath(pathForInterface(header.takeAt(0)))); | - | ||||||||||||||||||||||||
| 2440 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2441 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2442 | connection.send(message.createReply(QVariant::fromValue(ref))); | - | ||||||||||||||||||||||||
| 2443 | - | |||||||||||||||||||||||||
| 2444 | } else if (function == QLatin1String("GetRowHeader")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 2445 | int row = message.arguments().at(0).toInt(); | - | ||||||||||||||||||||||||
| 2446 | QSpiObjectReference ref; | - | ||||||||||||||||||||||||
| 2447 | QAccessibleTableCellInterface *cell = interface->tableInterface()->cellAt(row, 0)->tableCellInterface(); | - | ||||||||||||||||||||||||
| 2448 | if (cell) {
| 0 | ||||||||||||||||||||||||
| 2449 | QList<QAccessibleInterface*> header = cell->rowHeaderCells(); | - | ||||||||||||||||||||||||
| 2450 | if (header.size() > 0) {
| 0 | ||||||||||||||||||||||||
| 2451 | ref = QSpiObjectReference(connection, QDBusObjectPath(pathForInterface(header.takeAt(0)))); | - | ||||||||||||||||||||||||
| 2452 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2453 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2454 | connection.send(message.createReply(QVariant::fromValue(ref))); | - | ||||||||||||||||||||||||
| 2455 | - | |||||||||||||||||||||||||
| 2456 | } else if (function == QLatin1String("GetSelectedColumns")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 2457 | connection.send(message.createReply(QVariant::fromValue(interface->tableInterface()->selectedColumns()))); | - | ||||||||||||||||||||||||
| 2458 | } else if (function == QLatin1String("GetSelectedRows")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 2459 | connection.send(message.createReply(QVariant::fromValue(interface->tableInterface()->selectedRows()))); | - | ||||||||||||||||||||||||
| 2460 | } else if (function == QLatin1String("IsColumnSelected")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 2461 | int column = message.arguments().at(0).toInt(); | - | ||||||||||||||||||||||||
| 2462 | connection.send(message.createReply(interface->tableInterface()->isColumnSelected(column))); | - | ||||||||||||||||||||||||
| 2463 | } else if (function == QLatin1String("IsRowSelected")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 2464 | int row = message.arguments().at(0).toInt(); | - | ||||||||||||||||||||||||
| 2465 | connection.send(message.createReply(interface->tableInterface()->isRowSelected(row))); | - | ||||||||||||||||||||||||
| 2466 | } else if (function == QLatin1String("IsSelected")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 2467 | int row = message.arguments().at(0).toInt(); | - | ||||||||||||||||||||||||
| 2468 | int column = message.arguments().at(1).toInt(); | - | ||||||||||||||||||||||||
| 2469 | QAccessibleTableCellInterface* cell = interface->tableInterface()->cellAt(row, column)->tableCellInterface(); | - | ||||||||||||||||||||||||
| 2470 | connection.send(message.createReply(cell->isSelected())); | - | ||||||||||||||||||||||||
| 2471 | } else if (function == QLatin1String("AddColumnSelection")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 2472 | int column = message.arguments().at(0).toInt(); | - | ||||||||||||||||||||||||
| 2473 | connection.send(message.createReply(interface->tableInterface()->selectColumn(column))); | - | ||||||||||||||||||||||||
| 2474 | } else if (function == QLatin1String("AddRowSelection")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 2475 | int row = message.arguments().at(0).toInt(); | - | ||||||||||||||||||||||||
| 2476 | connection.send(message.createReply(interface->tableInterface()->selectRow(row))); | - | ||||||||||||||||||||||||
| 2477 | } else if (function == QLatin1String("RemoveColumnSelection")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 2478 | int column = message.arguments().at(0).toInt(); | - | ||||||||||||||||||||||||
| 2479 | connection.send(message.createReply(interface->tableInterface()->unselectColumn(column))); | - | ||||||||||||||||||||||||
| 2480 | } else if (function == QLatin1String("RemoveRowSelection")) { never executed: end of block
| 0 | ||||||||||||||||||||||||
| 2481 | int row = message.arguments().at(0).toInt(); | - | ||||||||||||||||||||||||
| 2482 | connection.send(message.createReply(interface->tableInterface()->unselectRow(row))); | - | ||||||||||||||||||||||||
| 2483 | } else { never executed: end of block | 0 | ||||||||||||||||||||||||
| 2484 | qAtspiDebug() << "WARNING: AtSpiAdaptor::tableInterface does not implement " << function << message.path(); never executed: ;never executed: QMessageLogger(__FILE__, 2484, __PRETTY_FUNCTION__).debug() << "WARNING: AtSpiAdaptor::tableInterface does not implement " << function << message.path();
| 0 | ||||||||||||||||||||||||
| 2485 | return false; never executed: return false; | 0 | ||||||||||||||||||||||||
| 2486 | } | - | ||||||||||||||||||||||||
| 2487 | return true; never executed: return true; | 0 | ||||||||||||||||||||||||
| 2488 | } | - | ||||||||||||||||||||||||
| 2489 | - | |||||||||||||||||||||||||
| 2490 | QT_END_NAMESPACE | - | ||||||||||||||||||||||||
| 2491 | #endif //QT_NO_ACCESSIBILITY | - | ||||||||||||||||||||||||
| Source code | Switch to Preprocessed file |