OpenCoverage

bridge.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/platformsupport/linuxaccessibility/bridge.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10-
11-
12-
13-
14-
15-
16QSpiAccessibleBridge::QSpiAccessibleBridge()-
17 : cache(0), dec(0), dbusAdaptor(0)-
18{-
19 dbusConnection = new DBusConnection();-
20 connect(dbusConnection, qFlagLocation("2""enabledChanged(bool)" "\0" __FILE__ ":" "67"), this, qFlagLocation("1""enabledChanged(bool)" "\0" __FILE__ ":" "67"));-
21}
executed 180 times by 128 tests: end of block
Executed by:
  • tst_Gestures
  • tst_ModelTest
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • ...
180
22-
23void QSpiAccessibleBridge::enabledChanged(bool enabled)-
24{-
25 setActive(enabled);-
26 updateStatus();-
27}
never executed: end of block
0
28-
29QSpiAccessibleBridge::~QSpiAccessibleBridge()-
30{-
31 delete dbusConnection;-
32}
executed 178 times by 129 tests: end of block
Executed by:
  • tst_QApplication
  • tst_QGuiApplication
  • tst_gestures - unknown status
  • tst_languagechange - unknown status
  • tst_modeltest - unknown status
  • tst_qabstractbutton - unknown status
  • tst_qabstractitemview - unknown status
  • tst_qabstractscrollarea - unknown status
  • tst_qabstractslider - unknown status
  • tst_qabstractspinbox - unknown status
  • tst_qaccessibility - unknown status
  • tst_qaction - unknown status
  • tst_qactiongroup - unknown status
  • tst_qapplication - unknown status
  • tst_qbackingstore - unknown status
  • tst_qboxlayout - unknown status
  • tst_qbuttongroup - unknown status
  • tst_qcalendarwidget - unknown status
  • tst_qcheckbox - unknown status
  • tst_qcolordialog - unknown status
  • tst_qcolumnview - unknown status
  • tst_qcombobox - unknown status
  • tst_qcommandlinkbutton - unknown status
  • tst_qcompleter - unknown status
  • tst_qdatawidgetmapper - unknown status
  • ...
178
33-
34QDBusConnection QSpiAccessibleBridge::dBusConnection() const-
35{-
36 return
never executed: return dbusConnection->connection();
dbusConnection->connection();
never executed: return dbusConnection->connection();
0
37}-
38-
39void QSpiAccessibleBridge::updateStatus()-
40{-
41-
42 if (!dbusAdaptor
!dbusAdaptorDescription
TRUEnever evaluated
FALSEnever evaluated
&& isActive()
isActive()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
43 qSpiInitializeStructTypes();-
44 initializeConstantMappings();-
45-
46 cache = new QSpiDBusCache(dbusConnection->connection(), this);-
47 dec = new DeviceEventControllerAdaptor(this);-
48-
49 dbusConnection->connection().registerObject(QLatin1String("/org/a11y/atspi/registry/deviceeventcontroller"), this, QDBusConnection::ExportAdaptors);-
50-
51 dbusAdaptor = new AtSpiAdaptor(dbusConnection, this);-
52 dbusConnection->connection().registerVirtualObject(QLatin1String("/org/a11y/atspi/accessible"), dbusAdaptor, QDBusConnection::SubPath);-
53 dbusAdaptor->registerApplication();-
54 }
never executed: end of block
0
55}
never executed: end of block
0
56-
57void QSpiAccessibleBridge::notifyAccessibilityUpdate(QAccessibleEvent *event)-
58{-
59 if (!dbusAdaptor
!dbusAdaptorDescription
TRUEevaluated 114763 times by 125 tests
Evaluated by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • ...
FALSEnever evaluated
)
0-114763
60 return;
executed 114763 times by 125 tests: return;
Executed by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • ...
114763
61 if (isActive()
isActive()Description
TRUEnever evaluated
FALSEnever evaluated
&& event->accessibleInterface()
event->accessibleInterface()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
62 dbusAdaptor->notify(event);
never executed: dbusAdaptor->notify(event);
0
63}
never executed: end of block
0
64-
65struct RoleMapping {-
66 QAccessible::Role role;-
67 AtspiRole spiRole;-
68 const char *name;-
69};-
70-
71static RoleMapping map[] = {-
72-
73 { QAccessible::NoRole, ATSPI_ROLE_INVALID, "invalid role" },-
74-
75 { QAccessible::TitleBar, ATSPI_ROLE_TEXT, "title bar" },-
76-
77 { QAccessible::MenuBar, ATSPI_ROLE_MENU_BAR, "menu bar" },-
78-
79 { QAccessible::ScrollBar, ATSPI_ROLE_SCROLL_BAR, "scroll bar" },-
80-
81 { QAccessible::Grip, ATSPI_ROLE_UNKNOWN, "grip" },-
82-
83 { QAccessible::Sound, ATSPI_ROLE_UNKNOWN, "sound" },-
84-
85 { QAccessible::Cursor, ATSPI_ROLE_UNKNOWN, "cursor" },-
86-
87 { QAccessible::Caret, ATSPI_ROLE_UNKNOWN, "text caret" },-
88-
89 { QAccessible::AlertMessage, ATSPI_ROLE_ALERT, "alert message" },-
90-
91 { QAccessible::Window, ATSPI_ROLE_FRAME, "frame" },-
92-
93 { QAccessible::Client, ATSPI_ROLE_FILLER, "filler" },-
94-
95 { QAccessible::PopupMenu, ATSPI_ROLE_POPUP_MENU, "popup menu" },-
96-
97 { QAccessible::MenuItem, ATSPI_ROLE_MENU_ITEM, "menu item" },-
98-
99 { QAccessible::ToolTip, ATSPI_ROLE_TOOL_TIP, "tool tip" },-
100-
101 { QAccessible::Application, ATSPI_ROLE_APPLICATION, "application" },-
102-
103 { QAccessible::Document, ATSPI_ROLE_DOCUMENT_FRAME, "document" },-
104-
105 { QAccessible::Pane, ATSPI_ROLE_PANEL, "panel" },-
106-
107 { QAccessible::Chart, ATSPI_ROLE_CHART, "chart" },-
108-
109 { QAccessible::Dialog, ATSPI_ROLE_DIALOG, "dialog" },-
110-
111 { QAccessible::Border, ATSPI_ROLE_FRAME, "frame" },-
112-
113 { QAccessible::Grouping, ATSPI_ROLE_PANEL, "panel" },-
114-
115 { QAccessible::Separator, ATSPI_ROLE_SEPARATOR, "separator" },-
116-
117 { QAccessible::ToolBar, ATSPI_ROLE_TOOL_BAR, "tool bar" },-
118-
119 { QAccessible::StatusBar, ATSPI_ROLE_STATUS_BAR, "status bar" },-
120-
121 { QAccessible::Table, ATSPI_ROLE_TABLE, "table" },-
122-
123 { QAccessible::ColumnHeader, ATSPI_ROLE_TABLE_COLUMN_HEADER, "column header" },-
124-
125 { QAccessible::RowHeader, ATSPI_ROLE_TABLE_ROW_HEADER, "row header" },-
126-
127 { QAccessible::Column, ATSPI_ROLE_TABLE_CELL, "column" },-
128-
129 { QAccessible::Row, ATSPI_ROLE_TABLE_ROW, "row" },-
130-
131 { QAccessible::Cell, ATSPI_ROLE_TABLE_CELL, "cell" },-
132-
133 { QAccessible::Link, ATSPI_ROLE_LINK, "link" },-
134-
135 { QAccessible::HelpBalloon, ATSPI_ROLE_DIALOG, "help balloon" },-
136-
137 { QAccessible::Assistant, ATSPI_ROLE_DIALOG, "assistant" },-
138-
139 { QAccessible::List, ATSPI_ROLE_LIST, "list" },-
140-
141 { QAccessible::ListItem, ATSPI_ROLE_LIST_ITEM, "list item" },-
142-
143 { QAccessible::Tree, ATSPI_ROLE_TREE, "tree" },-
144-
145 { QAccessible::TreeItem, ATSPI_ROLE_TABLE_CELL, "tree item" },-
146-
147 { QAccessible::PageTab, ATSPI_ROLE_PAGE_TAB, "page tab" },-
148-
149 { QAccessible::PropertyPage, ATSPI_ROLE_PAGE_TAB, "property page" },-
150-
151 { QAccessible::Indicator, ATSPI_ROLE_UNKNOWN, "indicator" },-
152-
153 { QAccessible::Graphic, ATSPI_ROLE_IMAGE, "graphic" },-
154-
155 { QAccessible::StaticText, ATSPI_ROLE_LABEL, "label" },-
156-
157 { QAccessible::EditableText, ATSPI_ROLE_TEXT, "text" },-
158-
159 { QAccessible::PushButton, ATSPI_ROLE_PUSH_BUTTON, "push button" },-
160-
161 { QAccessible::CheckBox, ATSPI_ROLE_CHECK_BOX, "check box" },-
162-
163 { QAccessible::RadioButton, ATSPI_ROLE_RADIO_BUTTON, "radio button" },-
164-
165 { QAccessible::ComboBox, ATSPI_ROLE_COMBO_BOX, "combo box" },-
166-
167 { QAccessible::ProgressBar, ATSPI_ROLE_PROGRESS_BAR, "progress bar" },-
168-
169 { QAccessible::Dial, ATSPI_ROLE_DIAL, "dial" },-
170-
171 { QAccessible::HotkeyField, ATSPI_ROLE_TEXT, "hotkey field" },-
172-
173 { QAccessible::Slider, ATSPI_ROLE_SLIDER, "slider" },-
174-
175 { QAccessible::SpinBox, ATSPI_ROLE_SPIN_BUTTON, "spin box" },-
176-
177 { QAccessible::Canvas, ATSPI_ROLE_CANVAS, "canvas" },-
178-
179 { QAccessible::Animation, ATSPI_ROLE_ANIMATION, "animation" },-
180-
181 { QAccessible::Equation, ATSPI_ROLE_TEXT, "equation" },-
182-
183 { QAccessible::ButtonDropDown, ATSPI_ROLE_PUSH_BUTTON, "button with drop down" },-
184-
185 { QAccessible::ButtonMenu, ATSPI_ROLE_PUSH_BUTTON, "button menu" },-
186-
187 { QAccessible::ButtonDropGrid, ATSPI_ROLE_PUSH_BUTTON, "button with drop down grid" },-
188-
189 { QAccessible::Whitespace, ATSPI_ROLE_FILLER, "space" },-
190-
191 { QAccessible::PageTabList, ATSPI_ROLE_PAGE_TAB_LIST, "page tab list" },-
192-
193 { QAccessible::Clock, ATSPI_ROLE_UNKNOWN, "clock" },-
194-
195 { QAccessible::Splitter, ATSPI_ROLE_SPLIT_PANE, "splitter" },-
196-
197 { QAccessible::LayeredPane, ATSPI_ROLE_LAYERED_PANE, "layered pane" },-
198-
199 { QAccessible::WebDocument, ATSPI_ROLE_DOCUMENT_WEB, "web document" },-
200-
201 { QAccessible::Paragraph, ATSPI_ROLE_PARAGRAPH, "paragraph" },-
202-
203 { QAccessible::Section, ATSPI_ROLE_SECTION, "section" },-
204-
205 { QAccessible::ColorChooser, ATSPI_ROLE_COLOR_CHOOSER, "color chooser" },-
206-
207 { QAccessible::Footer, ATSPI_ROLE_FOOTER, "footer" },-
208-
209 { QAccessible::Form, ATSPI_ROLE_FORM, "form" },-
210-
211 { QAccessible::Heading, ATSPI_ROLE_HEADING, "heading" },-
212-
213 { QAccessible::Note, ATSPI_ROLE_COMMENT, "note" },-
214-
215 { QAccessible::ComplementaryContent, ATSPI_ROLE_SECTION, "complementary content" },-
216-
217 { QAccessible::UserRole, ATSPI_ROLE_UNKNOWN, "unknown" }-
218};-
219-
220void QSpiAccessibleBridge::initializeConstantMappings()-
221{-
222 for (uint i = 0; i < sizeof(map) / sizeof(RoleMapping)
i < sizeof(map...f(RoleMapping)Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
223 qSpiRoleMapping.insert(map[i].role, RoleNames(map[i].spiRole, QLatin1String(map[i].name), tr(map[i].name)));
never executed: qSpiRoleMapping.insert(map[i].role, RoleNames(map[i].spiRole, QLatin1String(map[i].name), tr(map[i].name)));
0
224}
never executed: end of block
0
225-
226-
Switch to Source codePreprocessed file

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