150 lines
6.1 KiB
Diff
150 lines
6.1 KiB
Diff
qt5_qpa.patch
|
|
|
|
From: Christian Prochaska <christian.prochaska@genode-labs.com>
|
|
|
|
|
|
---
|
|
.../fontdatabases/basic/qbasicfontdatabase.cpp | 9 +++++++++
|
|
.../evdevkeyboard/qevdevkeyboard_defaultmap_p.h | 4 ++++
|
|
.../input/evdevkeyboard/qevdevkeyboardhandler.cpp | 17 +++++++++++++++++
|
|
.../input/evdevkeyboard/qevdevkeyboardhandler_p.h | 2 ++
|
|
4 files changed, 32 insertions(+)
|
|
|
|
diff --git a/qtbase/src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp b/qtbase/src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp
|
|
index 4b9d469..ebf447a 100644
|
|
--- a/qtbase/src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp
|
|
+++ b/qtbase/src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp
|
|
@@ -79,7 +79,16 @@ void QBasicFontDatabase::populateFontDatabase()
|
|
|
|
foreach (const QFileInfo &fi, dir.entryInfoList(nameFilters, QDir::Files)) {
|
|
const QByteArray file = QFile::encodeName(fi.absoluteFilePath());
|
|
+#ifdef Q_OS_GENODE
|
|
+ QByteArray data;
|
|
+ QFile f(file);
|
|
+ if (!f.open(QIODevice::ReadOnly))
|
|
+ continue;
|
|
+ data = f.readAll();
|
|
+ QBasicFontDatabase::addTTFile(data, file);
|
|
+#else
|
|
QBasicFontDatabase::addTTFile(QByteArray(), file);
|
|
+#endif
|
|
}
|
|
}
|
|
|
|
diff --git a/qtbase/src/platformsupport/input/evdevkeyboard/qevdevkeyboard_defaultmap_p.h b/qtbase/src/platformsupport/input/evdevkeyboard/qevdevkeyboard_defaultmap_p.h
|
|
index bc04852..8394318 100644
|
|
--- a/qtbase/src/platformsupport/input/evdevkeyboard/qevdevkeyboard_defaultmap_p.h
|
|
+++ b/qtbase/src/platformsupport/input/evdevkeyboard/qevdevkeyboard_defaultmap_p.h
|
|
@@ -52,7 +52,9 @@
|
|
//
|
|
|
|
#include "qnamespace.h"
|
|
+#ifndef Q_OS_GENODE
|
|
#include "linux/input.h"
|
|
+#endif /* Q_OS_GENODE */
|
|
|
|
// no QT_BEGIN_NAMESPACE, since we include it internally...
|
|
|
|
@@ -644,6 +646,7 @@ const QEvdevKeyboardMap::Mapping QEvdevKeyboardHandler::s_keymap_default[] = {
|
|
{ 111, 0xffff, 0x01000000, 0x06, 0x08, 0x0200 },
|
|
{ 111, 0xffff, 0x01000000, 0x0c, 0x08, 0x0200 },
|
|
|
|
+#ifndef Q_OS_GENODE
|
|
// 113 -> 248
|
|
{ KEY_MUTE, 0xffff, Qt::Key_VolumeMute, 0x00, 0x00, 0x0000 },
|
|
{ KEY_VOLUMEDOWN, 0xffff, Qt::Key_VolumeDown, 0x00, 0x00, 0x0000 },
|
|
@@ -672,6 +675,7 @@ const QEvdevKeyboardMap::Mapping QEvdevKeyboardHandler::s_keymap_default[] = {
|
|
{ KEY_BLUE, 0xffff, Qt::Key_Blue, 0x00, 0x00, 0x0000 },
|
|
{ KEY_CHANNELUP, 0xffff, Qt::Key_ChannelUp, 0x00, 0x00, 0x0000 },
|
|
{ KEY_CHANNELDOWN, 0xffff, Qt::Key_ChannelDown, 0x00, 0x00, 0x0000 },
|
|
+#endif /* Q_OS_GENODE */
|
|
};
|
|
|
|
const QEvdevKeyboardMap::Composing QEvdevKeyboardHandler::s_keycompose_default[] = {
|
|
diff --git a/qtbase/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp b/qtbase/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp
|
|
index 0eb6fc0..cf19fec 100644
|
|
--- a/qtbase/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp
|
|
+++ b/qtbase/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp
|
|
@@ -49,7 +49,9 @@
|
|
#include <qpa/qwindowsysteminterface.h>
|
|
#include <private/qcore_unix_p.h>
|
|
|
|
+#ifndef Q_OS_GENODE
|
|
#include <linux/input.h>
|
|
+#endif /* Q_OS_GENODE */
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
@@ -81,9 +83,11 @@ QEvdevKeyboardHandler::QEvdevKeyboardHandler(const QString &device, QFdContainer
|
|
if (keymapFile.isEmpty() || !loadKeymap(keymapFile))
|
|
unloadKeymap();
|
|
|
|
+#ifndef Q_OS_GENODE
|
|
// socket notifier for events on the keyboard device
|
|
m_notify = new QSocketNotifier(m_fd.get(), QSocketNotifier::Read, this);
|
|
connect(m_notify, SIGNAL(activated(int)), this, SLOT(readKeycode()));
|
|
+#endif /* Q_OS_GENODE */
|
|
}
|
|
|
|
QEvdevKeyboardHandler::~QEvdevKeyboardHandler()
|
|
@@ -91,6 +95,7 @@ QEvdevKeyboardHandler::~QEvdevKeyboardHandler()
|
|
unloadKeymap();
|
|
}
|
|
|
|
+#ifndef Q_OS_GENODE
|
|
QEvdevKeyboardHandler *QEvdevKeyboardHandler::create(const QString &device,
|
|
const QString &specification,
|
|
const QString &defaultKeymapFile)
|
|
@@ -214,10 +219,20 @@ void QEvdevKeyboardHandler::readKeycode()
|
|
}
|
|
}
|
|
}
|
|
+#endif /* Q_OS_GENODE */
|
|
|
|
void QEvdevKeyboardHandler::processKeyEvent(int nativecode, int unicode, int qtcode,
|
|
Qt::KeyboardModifiers modifiers, bool isPress, bool autoRepeat)
|
|
{
|
|
+#ifdef Q_OS_GENODE
|
|
+ /* characters are handled separately by the QPA plugin */
|
|
+ unicode = 0xffff;
|
|
+
|
|
+ /* Ctrl-A .. Ctrl-Z is handled separately by the QPA plugin */
|
|
+ if ((modifiers & Qt::ControlModifier) &&
|
|
+ ((qtcode >= Qt::Key_A) && (qtcode <= Qt::Key_Z)))
|
|
+ return;
|
|
+#endif
|
|
QWindowSystemInterface::handleExtendedKeyEvent(0, (isPress ? QEvent::KeyPress : QEvent::KeyRelease),
|
|
qtcode, modifiers, nativecode + 8, 0, int(modifiers),
|
|
(unicode != 0xffff ) ? QString(unicode) : QString(), autoRepeat);
|
|
@@ -477,6 +492,7 @@ void QEvdevKeyboardHandler::unloadKeymap()
|
|
m_composing = 0;
|
|
m_dead_unicode = 0xffff;
|
|
|
|
+#ifndef Q_OS_GENODE
|
|
//Set locks according to keyboard leds
|
|
quint16 ledbits[1];
|
|
memset(ledbits, 0, sizeof(ledbits));
|
|
@@ -497,6 +513,7 @@ void QEvdevKeyboardHandler::unloadKeymap()
|
|
m_locks[2] = 1;
|
|
qCDebug(qLcEvdevKey, "numlock=%d , capslock=%d, scrolllock=%d", m_locks[1], m_locks[0], m_locks[2]);
|
|
}
|
|
+#endif /* Q_OS_GENODE */
|
|
}
|
|
|
|
bool QEvdevKeyboardHandler::loadKeymap(const QString &file)
|
|
diff --git a/qtbase/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler_p.h b/qtbase/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler_p.h
|
|
index 1ec4915..fed7024 100644
|
|
--- a/qtbase/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler_p.h
|
|
+++ b/qtbase/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler_p.h
|
|
@@ -190,8 +190,10 @@ public:
|
|
bool loadKeymap(const QString &file);
|
|
void unloadKeymap();
|
|
|
|
+#ifndef Q_OS_GENODE
|
|
private slots:
|
|
void readKeycode();
|
|
+#endif /* Q_OS_GENODE */
|
|
KeycodeAction processKeycode(quint16 keycode, bool pressed, bool autorepeat);
|
|
|
|
private:
|