8#include <QtCore/QByteArray>
9#include <QtCore/QDebug>
10#include <QtCore/QList>
11#include <QtCore/QSocketNotifier>
12#include <QtCore/private/qcore_unix_p.h>
20#if defined(QQNXNAVIGATOREVENTNOTIFIER_DEBUG)
21#define qNavigatorEventNotifierDebug qDebug
23#define qNavigatorEventNotifierDebug QT_NO_QDEBUG_MACRO
28const char *QQnxNavigatorEventNotifier::navigatorControlPath =
"/pps/services/navigator/control";
29const size_t QQnxNavigatorEventNotifier::ppsBufferSize = 4096;
35 m_eventHandler(eventHandler)
41 delete m_readNotifier;
56 m_fd =
open(navigatorControlPath, O_RDWR);
78 for (
int i = 1;
i < lines.
size(); ++
i) {
84 int firstColon = attr.
indexOf(
':');
85 if (firstColon == -1) {
90 int secondColon = attr.
indexOf(
':', firstColon + 1);
91 if (secondColon == -1) {
105 else if (
key ==
"dat")
107 else if (
key ==
"id")
110 qFatal(
"QQNX: unrecognized pps attribute, attr=%s",
key.constData());
122 ppsData +=
"\ndat::";
133 qFatal(
"QQNX: failed to write navigator pps, errno=%d", errno);
141 if (msg ==
"orientationCheck") {
145 replyPPS(msg,
id, response ?
"true" :
"false");
146 }
else if (msg ==
"orientation") {
148 replyPPS(msg,
id,
"");
149 }
else if (msg ==
"SWIPE_DOWN") {
151 }
else if (msg ==
"exit") {
153 }
else if (msg ==
"windowActive") {
155 }
else if (msg ==
"windowInactive") {
160void QQnxNavigatorEventNotifier::readData()
165 char buffer[ppsBufferSize];
171 qFatal(
"QQNX: failed to read navigator pps, errno=%d", errno);
184 parsePPS(ppsData, msg, dat,
id);
185 handleMessage(msg, dat,
id);
qsizetype size() const noexcept
Returns the number of bytes in this byte array.
const char * constData() const noexcept
Returns a pointer to the const data stored in the byte array.
int toInt(bool *ok=nullptr, int base=10) const
Returns the byte array converted to an int using base base, which is ten by default.
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...
bool isEmpty() const noexcept
Returns true if the byte array has size 0; otherwise returns false.
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.
qsizetype size() const noexcept
bool empty() const noexcept
const_reference at(qsizetype i) const noexcept
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
void handleWindowGroupActivated(const QByteArray &id)
void handleWindowGroupDeactivated(const QByteArray &id)
void handleOrientationChange(int angle)
bool handleOrientationCheck(int angle)
~QQnxNavigatorEventNotifier()
QQnxNavigatorEventNotifier(QQnxNavigatorEventHandler *eventHandler, QObject *parent=nullptr)
Combined button and popup list for selecting options.
static qint64 qt_safe_read(int fd, void *data, qint64 maxlen)
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
#define qNavigatorEventNotifierDebug
file open(QIODevice::ReadOnly)
gzip write("uncompressed data")
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent