6#include <QtGui/QGuiApplication>
7#include <qpa/qwindowsysteminterface.h>
9#include <QtCore/qhash.h>
10#include <QtCore/qbytearray.h>
11#include <QtCore/QDebug>
12#include <QtCore/QMetaEnum>
13#include <QtCore/QSocketNotifier>
14#include <QtCore/private/qcore_unix_p.h>
16#if defined(QQNXBUTTON_DEBUG)
17#define qButtonDebug qDebug
19#define qButtonDebug QT_NO_QDEBUG_MACRO
24const char *QQnxButtonEventNotifier::ppsPath =
"/pps/system/buttons/status";
25const size_t QQnxButtonEventNotifier::ppsBufferSize = 256;
34 int enumeratorIndex = QQnxButtonEventNotifier::staticMetaObject.indexOfEnumerator(
QByteArrayLiteral(
"ButtonId"));
35 QMetaEnum enumerator = QQnxButtonEventNotifier::staticMetaObject.enumerator(enumeratorIndex);
50 qButtonDebug(
"starting hardware button event processing");
58#if defined (QQNXBUTTON_DEBUG)
59 qWarning(
"QQNX: failed to open buttons pps, errno=%d", errno);
67 qButtonDebug(
"successfully connected to Navigator. fd = %d", m_fd);
70void QQnxButtonEventNotifier::updateButtonStates()
73 char buffer[ppsBufferSize];
80 qWarning(
"QQNX: failed to read hardware buttons pps object, errno=%d", errno);
96 if (!parsePPS(ppsData, &fields))
106 if (m_state[buttonId] !=
newState) {
145void QQnxButtonEventNotifier::close()
147 delete m_readNotifier;
168 for (
int i = 1;
i < lines.
size();
i++) {
176 if (doubleColon == -1) {
const char * constData() const noexcept
Returns a pointer to the const data stored in the byte array.
QList< QByteArray > split(char sep) const
Splits the byte array into subarrays wherever sep occurs, and returns the list of those arrays.
qsizetype indexOf(char c, qsizetype from=0) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
QByteArray left(qsizetype len) const
Returns a byte array that contains the first len bytes of this byte array.
QByteArray mid(qsizetype index, qsizetype len=-1) const
Returns a byte array containing len bytes from this byte array, starting at position pos.
static QByteArray fromRawData(const char *data, qsizetype size)
Constructs a QByteArray that uses the first size bytes of the data array.
Type
This enum type defines the valid event types in Qt.
static QWindow * focusWindow()
Returns the QWindow that receives events tied to focus, such as key events.
T value(const Key &key) const noexcept
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
qsizetype size() const noexcept
const_reference at(qsizetype i) const noexcept
void reserve(qsizetype size)
void append(parameter_type t)
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
static bool handleKeyEvent(QWindow *window, QEvent::Type t, int k, Qt::KeyboardModifiers mods, const QString &text=QString(), bool autorep=false, ushort count=1)
void newState(QList< State > &states, const char *token, const char *lexem, bool pre)
Combined button and popup list for selecting options.
#define QByteArrayLiteral(str)
static int qt_safe_open(const char *pathname, int flags, mode_t mode=0777)
static qint64 qt_safe_read(int fd, void *data, qint64 maxlen)
static int qt_safe_close(int fd)
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent