Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/platformsupport/linuxaccessibility/application.cpp |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||||||||||||||
2 | - | |||||||||||||||||||||||||
3 | - | |||||||||||||||||||||||||
4 | - | |||||||||||||||||||||||||
5 | - | |||||||||||||||||||||||||
6 | - | |||||||||||||||||||||||||
7 | - | |||||||||||||||||||||||||
8 | QSpiApplicationAdaptor::QSpiApplicationAdaptor(const QDBusConnection &connection, QObject *parent) | - | ||||||||||||||||||||||||
9 | : QObject(parent), dbusConnection(connection), inCapsLock(false) | - | ||||||||||||||||||||||||
10 | { | - | ||||||||||||||||||||||||
11 | } never executed: end of block | 0 | ||||||||||||||||||||||||
12 | - | |||||||||||||||||||||||||
13 | enum QSpiKeyEventType { | - | ||||||||||||||||||||||||
14 | QSPI_KEY_EVENT_PRESS, | - | ||||||||||||||||||||||||
15 | QSPI_KEY_EVENT_RELEASE, | - | ||||||||||||||||||||||||
16 | QSPI_KEY_EVENT_LAST_DEFINED | - | ||||||||||||||||||||||||
17 | }; | - | ||||||||||||||||||||||||
18 | - | |||||||||||||||||||||||||
19 | void QSpiApplicationAdaptor::sendEvents(bool active) | - | ||||||||||||||||||||||||
20 | { | - | ||||||||||||||||||||||||
21 | if (active
| 0 | ||||||||||||||||||||||||
22 | QCoreApplication::instance()->installEventFilter(this); | - | ||||||||||||||||||||||||
23 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
24 | QCoreApplication::instance()->removeEventFilter(this); | - | ||||||||||||||||||||||||
25 | } never executed: end of block | 0 | ||||||||||||||||||||||||
26 | } | - | ||||||||||||||||||||||||
27 | - | |||||||||||||||||||||||||
28 | - | |||||||||||||||||||||||||
29 | bool QSpiApplicationAdaptor::eventFilter(QObject *target, QEvent *event) | - | ||||||||||||||||||||||||
30 | { | - | ||||||||||||||||||||||||
31 | if (!event->spontaneous()
| 0 | ||||||||||||||||||||||||
32 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
33 | - | |||||||||||||||||||||||||
34 | switch (event->type()) { | - | ||||||||||||||||||||||||
35 | case never executed: QEvent::WindowActivate:case QEvent::WindowActivate: never executed: case QEvent::WindowActivate: | 0 | ||||||||||||||||||||||||
36 | windowActivated(target, true); | - | ||||||||||||||||||||||||
37 | break; never executed: break; | 0 | ||||||||||||||||||||||||
38 | case never executed: QEvent::WindowDeactivate:case QEvent::WindowDeactivate: never executed: case QEvent::WindowDeactivate: | 0 | ||||||||||||||||||||||||
39 | windowActivated(target, false); | - | ||||||||||||||||||||||||
40 | break; never executed: break; | 0 | ||||||||||||||||||||||||
41 | case never executed: QEvent::KeyPress:case QEvent::KeyPress: never executed: case QEvent::KeyPress: | 0 | ||||||||||||||||||||||||
42 | case never executed: QEvent::KeyRelease:case QEvent::KeyRelease: never executed: {case QEvent::KeyRelease: | 0 | ||||||||||||||||||||||||
43 | QKeyEvent *keyEvent = static_cast <QKeyEvent *>(event); | - | ||||||||||||||||||||||||
44 | QSpiDeviceEvent de; | - | ||||||||||||||||||||||||
45 | - | |||||||||||||||||||||||||
46 | if (event->type() == QEvent::KeyPress
| 0 | ||||||||||||||||||||||||
47 | de.type = QSPI_KEY_EVENT_PRESS; never executed: de.type = QSPI_KEY_EVENT_PRESS; | 0 | ||||||||||||||||||||||||
48 | else | - | ||||||||||||||||||||||||
49 | de.type = QSPI_KEY_EVENT_RELEASE; never executed: de.type = QSPI_KEY_EVENT_RELEASE; | 0 | ||||||||||||||||||||||||
50 | - | |||||||||||||||||||||||||
51 | de.id = keyEvent->nativeVirtualKey(); | - | ||||||||||||||||||||||||
52 | de.hardwareCode = keyEvent->nativeScanCode(); | - | ||||||||||||||||||||||||
53 | - | |||||||||||||||||||||||||
54 | de.timestamp = QDateTime::currentMSecsSinceEpoch(); | - | ||||||||||||||||||||||||
55 | - | |||||||||||||||||||||||||
56 | if (keyEvent->key() == Qt::Key_Tab
| 0 | ||||||||||||||||||||||||
57 | de.text = ([]() -> QString { enum { Size = sizeof(u"" "Tab")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Tab" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }());return qstring_literal_temp; never executed: de.text = ([]() -> QString { enum { Size = sizeof(u"" "Tab")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Tab" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | 0 | ||||||||||||||||||||||||
58 | else if (keyEvent->key() == Qt::Key_Backtab
| 0 | ||||||||||||||||||||||||
59 | de.text = ([]() -> QString { enum { Size = sizeof(u"" "Backtab")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Backtab" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }());return qstring_literal_temp; never executed: de.text = ([]() -> QString { enum { Size = sizeof(u"" "Backtab")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Backtab" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | 0 | ||||||||||||||||||||||||
60 | else if (keyEvent->key() == Qt::Key_Control
| 0 | ||||||||||||||||||||||||
61 | de.text = ([]() -> QString { enum { Size = sizeof(u"" "Control_L")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Control_L" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }());return qstring_literal_temp; never executed: de.text = ([]() -> QString { enum { Size = sizeof(u"" "Control_L")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Control_L" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | 0 | ||||||||||||||||||||||||
62 | else if (keyEvent->key() == Qt::Key_Left
| 0 | ||||||||||||||||||||||||
63 | de.text = (
never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }()) : ([]() -> QString { enum { Size = sizeof(u"" "Left")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Left" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn qstring_literal_temp; never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }());return qstring_literal_temp; never executed: de.text = (keyEvent->modifiers() & Qt::KeypadModifier) ? ([]() -> QString { enum { Size = sizeof(u"" "KP_Left")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "KP_Left" }; QStringData... static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Left" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | 0 | ||||||||||||||||||||||||
64 | else if (keyEvent->key() == Qt::Key_Right
| 0 | ||||||||||||||||||||||||
65 | de.text = (
never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }()) : ([]() -> QString { enum { Size = sizeof(u"" "Right")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Right" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn qstring_literal_temp; never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }());return qstring_literal_temp; never executed: de.text = (keyEvent->modifiers() & Qt::KeypadModifier) ? ([]() -> QString { enum { Size = sizeof(u"" "KP_Right")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "KP_Right" }; QStringDa...static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Right" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | 0 | ||||||||||||||||||||||||
66 | else if (keyEvent->key() == Qt::Key_Up
| 0 | ||||||||||||||||||||||||
67 | de.text = (
never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }()) : ([]() -> QString { enum { Size = sizeof(u"" "Up")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Up" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn qstring_literal_temp; never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }());return qstring_literal_temp; never executed: de.text = (keyEvent->modifiers() & Qt::KeypadModifier) ? ([]() -> QString { enum { Size = sizeof(u"" "KP_Up")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "KP_Up" }; QStringDataPtr ...}; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Up" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | 0 | ||||||||||||||||||||||||
68 | else if (keyEvent->key() == Qt::Key_Down
| 0 | ||||||||||||||||||||||||
69 | de.text = (
never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }()) : ([]() -> QString { enum { Size = sizeof(u"" "Down")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Down" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn qstring_literal_temp; never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }());return qstring_literal_temp; never executed: de.text = (keyEvent->modifiers() & Qt::KeypadModifier) ? ([]() -> QString { enum { Size = sizeof(u"" "KP_Down")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "KP_Down" }; QStringData... static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Down" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | 0 | ||||||||||||||||||||||||
70 | else if (keyEvent->key() == Qt::Key_Enter
| 0 | ||||||||||||||||||||||||
71 | de.text = ([]() -> QString { enum { Size = sizeof(u"" "Return")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Return" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }());return qstring_literal_temp; never executed: de.text = ([]() -> QString { enum { Size = sizeof(u"" "Return")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Return" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | 0 | ||||||||||||||||||||||||
72 | else if (keyEvent->key() == Qt::Key_Backspace
| 0 | ||||||||||||||||||||||||
73 | de.text = ([]() -> QString { enum { Size = sizeof(u"" "BackSpace")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "BackSpace" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }());return qstring_literal_temp; never executed: de.text = ([]() -> QString { enum { Size = sizeof(u"" "BackSpace")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "BackSpace" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | 0 | ||||||||||||||||||||||||
74 | else if (keyEvent->key() == Qt::Key_Delete
| 0 | ||||||||||||||||||||||||
75 | de.text = ([]() -> QString { enum { Size = sizeof(u"" "Delete")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Delete" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }());return qstring_literal_temp; never executed: de.text = ([]() -> QString { enum { Size = sizeof(u"" "Delete")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Delete" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | 0 | ||||||||||||||||||||||||
76 | else if (keyEvent->key() == Qt::Key_PageUp
| 0 | ||||||||||||||||||||||||
77 | de.text = (
never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }()) : ([]() -> QString { enum { Size = sizeof(u"" "Page_Up")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Page_Up" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn qstring_literal_temp; never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }());return qstring_literal_temp; never executed: de.text = (keyEvent->modifiers() & Qt::KeypadModifier) ? ([]() -> QString { enum { Size = sizeof(u"" "KP_Page_Up")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "KP_Page_Up" }; QStri...atic const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Page_Up" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | 0 | ||||||||||||||||||||||||
78 | else if (keyEvent->key() == Qt::Key_PageDown
| 0 | ||||||||||||||||||||||||
79 | de.text = (
never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }()) : ([]() -> QString { enum { Size = sizeof(u"" "Page_Down")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Page_Down" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn qstring_literal_temp; never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }());return qstring_literal_temp; never executed: de.text = (keyEvent->modifiers() & Qt::KeypadModifier) ? ([]() -> QString { enum { Size = sizeof(u"" "KP_Page_Up")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "KP_Page_Up" }; QStri...ic const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Page_Down" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | 0 | ||||||||||||||||||||||||
80 | else if (keyEvent->key() == Qt::Key_Home
| 0 | ||||||||||||||||||||||||
81 | de.text = (
never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }()) : ([]() -> QString { enum { Size = sizeof(u"" "Home")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Home" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn qstring_literal_temp; never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }());return qstring_literal_temp; never executed: de.text = (keyEvent->modifiers() & Qt::KeypadModifier) ? ([]() -> QString { enum { Size = sizeof(u"" "KP_Home")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "KP_Home" }; QStringData... static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Home" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | 0 | ||||||||||||||||||||||||
82 | else if (keyEvent->key() == Qt::Key_End
| 0 | ||||||||||||||||||||||||
83 | de.text = (
never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }()) : ([]() -> QString { enum { Size = sizeof(u"" "End")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "End" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn qstring_literal_temp; never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }());return qstring_literal_temp; never executed: de.text = (keyEvent->modifiers() & Qt::KeypadModifier) ? ([]() -> QString { enum { Size = sizeof(u"" "KP_End")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "KP_End" }; QStringDataPt...; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "End" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | 0 | ||||||||||||||||||||||||
84 | else if (keyEvent->key() == Qt::Key_Clear
| 0 | ||||||||||||||||||||||||
85 | de.text = ([]() -> QString { enum { Size = sizeof(u"" "KP_Begin")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "KP_Begin" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }());return qstring_literal_temp; never executed: de.text = ([]() -> QString { enum { Size = sizeof(u"" "KP_Begin")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "KP_Begin" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | 0 | ||||||||||||||||||||||||
86 | else if (keyEvent->key() == Qt::Key_Escape
| 0 | ||||||||||||||||||||||||
87 | de.text = ([]() -> QString { enum { Size = sizeof(u"" "Escape")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Escape" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }());return qstring_literal_temp; never executed: de.text = ([]() -> QString { enum { Size = sizeof(u"" "Escape")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Escape" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | 0 | ||||||||||||||||||||||||
88 | else if (keyEvent->key() == Qt::Key_Space
| 0 | ||||||||||||||||||||||||
89 | de.text = ([]() -> QString { enum { Size = sizeof(u"" "space")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "space" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }());return qstring_literal_temp; never executed: de.text = ([]() -> QString { enum { Size = sizeof(u"" "space")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "space" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | 0 | ||||||||||||||||||||||||
90 | else if (keyEvent->key() == Qt::Key_CapsLock
| 0 | ||||||||||||||||||||||||
91 | de.text = ([]() -> QString { enum { Size = sizeof(u"" "Caps_Lock")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Caps_Lock" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }());return qstring_literal_temp; | 0 | ||||||||||||||||||||||||
92 | if (event->type() == QEvent::KeyPress
| 0 | ||||||||||||||||||||||||
93 | inCapsLock = true; never executed: inCapsLock = true; | 0 | ||||||||||||||||||||||||
94 | else | - | ||||||||||||||||||||||||
95 | inCapsLock = false; never executed: inCapsLock = false; | 0 | ||||||||||||||||||||||||
96 | } else if (keyEvent->key() == Qt::Key_NumLock
| 0 | ||||||||||||||||||||||||
97 | de.text = ([]() -> QString { enum { Size = sizeof(u"" "Num_Lock")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Num_Lock" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }());return qstring_literal_temp; never executed: de.text = ([]() -> QString { enum { Size = sizeof(u"" "Num_Lock")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Num_Lock" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | 0 | ||||||||||||||||||||||||
98 | else if (keyEvent->key() == Qt::Key_Insert
| 0 | ||||||||||||||||||||||||
99 | de.text = ([]() -> QString { enum { Size = sizeof(u"" "Insert")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Insert" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }());return qstring_literal_temp; never executed: de.text = ([]() -> QString { enum { Size = sizeof(u"" "Insert")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Insert" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | 0 | ||||||||||||||||||||||||
100 | else | - | ||||||||||||||||||||||||
101 | de.text = keyEvent->text(); never executed: de.text = keyEvent->text(); | 0 | ||||||||||||||||||||||||
102 | - | |||||||||||||||||||||||||
103 | - | |||||||||||||||||||||||||
104 | - | |||||||||||||||||||||||||
105 | de.isText = !de.text.isEmpty(); | - | ||||||||||||||||||||||||
106 | - | |||||||||||||||||||||||||
107 | de.modifiers = 0; | - | ||||||||||||||||||||||||
108 | if (!inCapsLock
| 0 | ||||||||||||||||||||||||
109 | de.modifiers |= 1 << ATSPI_MODIFIER_SHIFT; never executed: de.modifiers |= 1 << ATSPI_MODIFIER_SHIFT; | 0 | ||||||||||||||||||||||||
110 | if (inCapsLock
| 0 | ||||||||||||||||||||||||
111 | de.modifiers |= 1 << ATSPI_MODIFIER_SHIFTLOCK; never executed: de.modifiers |= 1 << ATSPI_MODIFIER_SHIFTLOCK; | 0 | ||||||||||||||||||||||||
112 | if ((
| 0 | ||||||||||||||||||||||||
113 | de.modifiers |= 1 << ATSPI_MODIFIER_CONTROL; never executed: de.modifiers |= 1 << ATSPI_MODIFIER_CONTROL; | 0 | ||||||||||||||||||||||||
114 | if ((
| 0 | ||||||||||||||||||||||||
115 | de.modifiers |= 1 << ATSPI_MODIFIER_ALT; never executed: de.modifiers |= 1 << ATSPI_MODIFIER_ALT; | 0 | ||||||||||||||||||||||||
116 | if ((
| 0 | ||||||||||||||||||||||||
117 | de.modifiers |= 1 << ATSPI_MODIFIER_META; never executed: de.modifiers |= 1 << ATSPI_MODIFIER_META; | 0 | ||||||||||||||||||||||||
118 | QDBusMessage m = QDBusMessage::createMethodCall(([]() -> QString { enum { Size = sizeof(u"" "org.a11y.atspi.Registry")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "org.a11y.atspi.Registry" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }()),return qstring_literal_temp; | 0 | ||||||||||||||||||||||||
119 | ([]() -> QString { enum { Size = sizeof(u"" "/org/a11y/atspi/registry/deviceeventcontroller")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "/org/a11y/atspi/registry/deviceeventcontroller" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }()),return qstring_literal_temp; | 0 | ||||||||||||||||||||||||
120 | ([]() -> QString { enum { Size = sizeof(u"" "org.a11y.atspi.DeviceEventController")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "org.a11y.atspi.DeviceEventController" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }()), ([]() -> QString { enum { Size = sizeof(u"" "NotifyListenersSync")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "NotifyListenersSync" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn qstring_literal_temp; never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }()));return qstring_literal_temp; | 0 | ||||||||||||||||||||||||
121 | m.setArguments(QVariantList() << QVariant::fromValue(de)); | - | ||||||||||||||||||||||||
122 | - | |||||||||||||||||||||||||
123 | - | |||||||||||||||||||||||||
124 | int timeout = 100; | - | ||||||||||||||||||||||||
125 | bool sent = dbusConnection.callWithCallback(m, this, qFlagLocation("1""notifyKeyboardListenerCallback(QDBusMessage)" "\0" __FILE__ ":" "190"), | - | ||||||||||||||||||||||||
126 | qFlagLocation("1""notifyKeyboardListenerError(QDBusError,QDBusMessage)" "\0" __FILE__ ":" "191"), timeout); | - | ||||||||||||||||||||||||
127 | if (sent
| 0 | ||||||||||||||||||||||||
128 | - | |||||||||||||||||||||||||
129 | keyEvents.enqueue(QPair<QPointer<QObject>, QKeyEvent*> (QPointer<QObject>(target), copyKeyEvent(keyEvent))); | - | ||||||||||||||||||||||||
130 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||
131 | } | - | ||||||||||||||||||||||||
132 | } | - | ||||||||||||||||||||||||
133 | default never executed: :default: never executed: default: code before this statement never executed: default: | 0 | ||||||||||||||||||||||||
134 | break; never executed: break; | 0 | ||||||||||||||||||||||||
135 | } | - | ||||||||||||||||||||||||
136 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
137 | } | - | ||||||||||||||||||||||||
138 | - | |||||||||||||||||||||||||
139 | QKeyEvent* QSpiApplicationAdaptor::copyKeyEvent(QKeyEvent* old) | - | ||||||||||||||||||||||||
140 | { | - | ||||||||||||||||||||||||
141 | return never executed: new QKeyEvent(old->type(), old->key(), old->modifiers(),return new QKeyEvent(old->type(), old->key(), old->modifiers(), old->nativeScanCode(), old->nativeVirtualKey(), old->nativeModifiers(), old->text(), old->isAutoRepeat(), old->count()); never executed: return new QKeyEvent(old->type(), old->key(), old->modifiers(), old->nativeScanCode(), old->nativeVirtualKey(), old->nativeModifiers(), old->text(), old->isAutoRepeat(), old->count()); | 0 | ||||||||||||||||||||||||
142 | old->nativeScanCode(), old->nativeVirtualKey(), old->nativeModifiers(), never executed: return new QKeyEvent(old->type(), old->key(), old->modifiers(), old->nativeScanCode(), old->nativeVirtualKey(), old->nativeModifiers(), old->text(), old->isAutoRepeat(), old->count()); | 0 | ||||||||||||||||||||||||
143 | old->text(), old->isAutoRepeat(), old->count()); never executed: return new QKeyEvent(old->type(), old->key(), old->modifiers(), old->nativeScanCode(), old->nativeVirtualKey(), old->nativeModifiers(), old->text(), old->isAutoRepeat(), old->count()); | 0 | ||||||||||||||||||||||||
144 | } | - | ||||||||||||||||||||||||
145 | - | |||||||||||||||||||||||||
146 | void QSpiApplicationAdaptor::notifyKeyboardListenerCallback(const QDBusMessage& message) | - | ||||||||||||||||||||||||
147 | { | - | ||||||||||||||||||||||||
148 | if (!keyEvents.length()
| 0 | ||||||||||||||||||||||||
149 | QMessageLogger(__FILE__, 214, __PRETTY_FUNCTION__).warning("QSpiApplication::notifyKeyboardListenerCallback with no queued key called"); | - | ||||||||||||||||||||||||
150 | return; never executed: return; | 0 | ||||||||||||||||||||||||
151 | } | - | ||||||||||||||||||||||||
152 | ((!(message.arguments().length() == 1)) ? qt_assert("message.arguments().length() == 1",__FILE__,217) : qt_noop()); | - | ||||||||||||||||||||||||
153 | if (message.arguments().at(0).toBool() == true
| 0 | ||||||||||||||||||||||||
154 | QPair<QPointer<QObject>, QKeyEvent*> event = keyEvents.dequeue(); | - | ||||||||||||||||||||||||
155 | delete event.second; | - | ||||||||||||||||||||||||
156 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
157 | QPair<QPointer<QObject>, QKeyEvent*> event = keyEvents.dequeue(); | - | ||||||||||||||||||||||||
158 | if (event.first
| 0 | ||||||||||||||||||||||||
159 | QCoreApplication::postEvent(event.first.data(), event.second); never executed: QCoreApplication::postEvent(event.first.data(), event.second); | 0 | ||||||||||||||||||||||||
160 | } never executed: end of block | 0 | ||||||||||||||||||||||||
161 | } | - | ||||||||||||||||||||||||
162 | - | |||||||||||||||||||||||||
163 | void QSpiApplicationAdaptor::notifyKeyboardListenerError(const QDBusError& error, const QDBusMessage& ) | - | ||||||||||||||||||||||||
164 | { | - | ||||||||||||||||||||||||
165 | QMessageLogger(__FILE__, 230, __PRETTY_FUNCTION__).warning() << "QSpiApplication::keyEventError " << error.name() << error.message(); | - | ||||||||||||||||||||||||
166 | while (!keyEvents.isEmpty()
| 0 | ||||||||||||||||||||||||
167 | QPair<QPointer<QObject>, QKeyEvent*> event = keyEvents.dequeue(); | - | ||||||||||||||||||||||||
168 | if (event.first
| 0 | ||||||||||||||||||||||||
169 | QCoreApplication::postEvent(event.first.data(), event.second); never executed: QCoreApplication::postEvent(event.first.data(), event.second); | 0 | ||||||||||||||||||||||||
170 | } never executed: end of block | 0 | ||||||||||||||||||||||||
171 | } never executed: end of block | 0 | ||||||||||||||||||||||||
172 | - | |||||||||||||||||||||||||
173 | - | |||||||||||||||||||||||||
Switch to Source code | Preprocessed file |