Move evdev to platformsupport

Also wraps various string literals with QLatin1String.

Change-Id: Ia0681bfae00006d9e9ad51f05d0e0d0f45cf2cec
Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com>
Reviewed-by: Donald Carr <donald.carr@nokia.com>
This commit is contained in:
Girish Ramakrishnan 2012-05-30 21:38:22 -07:00 committed by Qt by Nokia
parent 32fa7a5410
commit 3aac6768f8
22 changed files with 82 additions and 67 deletions

View File

@ -0,0 +1,12 @@
HEADERS += \
$$PWD/qevdevkeyboard_defaultmap_p.h \
$$PWD/qevdevkeyboardhandler_p.h \
$$PWD/qevdevkeyboardmanager_p.h
SOURCES += \
$$PWD/qevdevkeyboardhandler.cpp \
$$PWD/qevdevkeyboardmanager.cpp
contains(QT_CONFIG, libudev) {
LIBS += $$QMAKE_LIBS_LIBUDEV
}

View File

@ -39,8 +39,8 @@
**
****************************************************************************/
#ifndef QEVDEVKEYBOARDHANDLER_DEFAULTMAP_H
#define QEVDEVKEYBOARDHANDLER_DEFAULTMAP_H
#ifndef QEVDEVKEYBOARDHANDLER_DEFAULTMAP_P_H
#define QEVDEVKEYBOARDHANDLER_DEFAULTMAP_P_H
// no QT_BEGIN_NAMESPACE, since we include it internally...
@ -784,4 +784,4 @@ const QEvdevKeyboardMap::Composing QEvdevKeyboardHandler::s_keycompose_default[]
{ 0x0049, 0x004a, 0x0178 },
};
#endif // QEVDEVKEYBOARDHANDLER_DEFAULTMAP_H
#endif // QEVDEVKEYBOARDHANDLER_DEFAULTMAP_P_H

View File

@ -39,7 +39,7 @@
**
****************************************************************************/
#include "qevdevkeyboardhandler.h"
#include "qevdevkeyboardhandler_p.h"
#include <qplatformdefs.h>
@ -60,7 +60,7 @@
QT_BEGIN_NAMESPACE
// simple builtin US keymap
#include "qevdevkeyboard_defaultmap.h"
#include "qevdevkeyboard_defaultmap_p.h"
QEvdevKeyboardHandler::QEvdevKeyboardHandler(const QString &device, int fd, bool disableZap, bool enableCompose, const QString &keymapFile)
: m_device(device), m_fd(fd),

View File

@ -39,8 +39,8 @@
**
****************************************************************************/
#ifndef QEVDEVKEYBOARDHANDLER_H
#define QEVDEVKEYBOARDHANDLER_H
#ifndef QEVDEVKEYBOARDHANDLER_P_H
#define QEVDEVKEYBOARDHANDLER_P_H
#include <qobject.h>
#include <QTimer>
@ -199,4 +199,4 @@ QT_END_NAMESPACE
QT_END_HEADER
#endif // QEVDEVKEYBOARDHANDLER_H
#endif // QEVDEVKEYBOARDHANDLER_P_H

View File

@ -39,7 +39,7 @@
**
****************************************************************************/
#include "qevdevkeyboardmanager.h"
#include "qevdevkeyboardmanager_p.h"
#include <QStringList>
#include <QCoreApplication>

View File

@ -39,10 +39,10 @@
**
****************************************************************************/
#ifndef QEVDEVKEYBOARDMANAGER_H
#define QEVDEVKEYBOARDMANAGER_H
#ifndef QEVDEVKEYBOARDMANAGER_P_H
#define QEVDEVKEYBOARDMANAGER_P_H
#include "qevdevkeyboardhandler.h"
#include "qevdevkeyboardhandler_p.h"
#include <QtPlatformSupport/private/qdevicediscovery_p.h>
@ -75,4 +75,4 @@ QT_END_HEADER
QT_END_NAMESPACE
#endif // QEVDEVKEYBOARDMANAGER_H
#endif // QEVDEVKEYBOARDMANAGER_P_H

View File

@ -0,0 +1,12 @@
HEADERS += \
$$PWD/qevdevmousehandler_p.h \
$$PWD/qevdevmousemanager_p.h
SOURCES += \
$$PWD/qevdevmousehandler.cpp \
$$PWD/qevdevmousemanager.cpp
contains(QT_CONFIG, libudev) {
LIBS += $$QMAKE_LIBS_LIBUDEV
}

View File

@ -39,7 +39,7 @@
**
****************************************************************************/
#include "qevdevmousehandler.h"
#include "qevdevmousehandler_p.h"
#include <QSocketNotifier>
#include <QStringList>
@ -73,9 +73,9 @@ QEvdevMouseHandler *QEvdevMouseHandler::create(const QString &device, const QStr
QStringList args = specification.split(QLatin1Char(':'));
foreach (const QString &arg, args) {
if (arg == "nocompress")
if (arg == QLatin1String("nocompress"))
compression = false;
else if (arg.startsWith("dejitter="))
else if (arg.startsWith(QLatin1String("dejitter=")))
jitterLimit = arg.mid(9).toInt();
}

View File

@ -39,8 +39,8 @@
**
****************************************************************************/
#ifndef QEVDEVMOUSEHANDLER_H
#define QEVDEVMOUSEHANDLER_H
#ifndef QEVDEVMOUSEHANDLER_P_H
#define QEVDEVMOUSEHANDLER_P_H
#include <QObject>
#include <QString>
@ -83,4 +83,4 @@ QT_END_NAMESPACE
QT_END_HEADER
#endif // QEVDEVMOUSEHANDLER_H
#endif // QEVDEVMOUSEHANDLER_P_H

View File

@ -39,7 +39,7 @@
**
****************************************************************************/
#include "qevdevmousemanager.h"
#include "qevdevmousemanager_p.h"
#include <QStringList>
#include <QGuiApplication>
@ -63,19 +63,19 @@ QEvdevMouseManager::QEvdevMouseManager(const QString &key, const QString &specif
QStringList devices;
foreach (const QString &arg, args) {
if (arg.startsWith("/dev/")) {
if (arg.startsWith(QLatin1String("/dev/"))) {
// if device is specified try to use it
devices.append(arg);
args.removeAll(arg);
} else if (arg.startsWith("xoffset=")) {
} else if (arg.startsWith(QLatin1String("xoffset="))) {
m_xoffset = arg.mid(8).toInt();
} else if (arg.startsWith("yoffset=")) {
} else if (arg.startsWith(QLatin1String("yoffset="))) {
m_yoffset = arg.mid(8).toInt();
}
}
// build new specification without /dev/ elements
m_spec = args.join(":");
m_spec = args.join(QLatin1String(":"));
// add all mice for devices specified in the argument list
foreach (const QString &device, devices)

View File

@ -39,10 +39,10 @@
**
****************************************************************************/
#ifndef QEVDEVMOUSEMANAGER_H
#define QEVDEVMOUSEMANAGER_H
#ifndef QEVDEVMOUSEMANAGER_P_H
#define QEVDEVMOUSEMANAGER_P_H
#include "qevdevmousehandler.h"
#include "qevdevmousehandler_p.h"
#include <QtPlatformSupport/private/qdevicediscovery_p.h>
@ -82,4 +82,4 @@ QT_END_HEADER
QT_END_NAMESPACE
#endif // QEVDEVMOUSEMANAGER_H
#endif // QEVDEVMOUSEMANAGER_P_H

View File

@ -0,0 +1,13 @@
HEADERS += \
$$PWD/qevdevtouch_p.h
SOURCES += \
$$PWD/qevdevtouch.cpp
contains(QT_CONFIG, libudev) {
LIBS += $$QMAKE_LIBS_LIBUDEV
}
# DEFINES += USE_MTDEV
contains(DEFINES, USE_MTDEV): LIBS += -lmtdev

View File

@ -39,7 +39,7 @@
**
****************************************************************************/
#include "qevdevtouch.h"
#include "qevdevtouch_p.h"
#include <QStringList>
#include <QHash>
#include <QSocketNotifier>

View File

@ -39,8 +39,8 @@
**
****************************************************************************/
#ifndef QEVDEVTOUCH_H
#define QEVDEVTOUCH_H
#ifndef QEVDEVTOUCH_P_H
#define QEVDEVTOUCH_P_H
#include <QObject>
#include <QString>
@ -95,4 +95,4 @@ QT_END_NAMESPACE
QT_END_HEADER
#endif // QEVDEVTOUCH_H
#endif // QEVDEVTOUCH_P_H

View File

@ -0,0 +1,6 @@
contains(QT_CONFIG, evdev) {
include($$PWD/evdevmouse/evdevmouse.pri)
include($$PWD/evdevkeyboard/evdevkeyboard.pri)
include($$PWD/evdevtouch/evdevtouch.pri)
}

View File

@ -31,6 +31,7 @@ include(eventdispatchers/eventdispatchers.pri)
include(fb_base/fb_base.pri)
include(fontdatabases/fontdatabases.pri)
include(glxconvenience/glxconvenience.pri)
include(input/input.pri)
include(inputcontext/inputcontext.pri)
include(devicediscovery/devicediscovery.pri)
include(services/services.pri)

View File

@ -5,20 +5,10 @@ DESTDIR = $$QT.gui.plugins/generic
target.path = $$[QT_INSTALL_PLUGINS]/generic
INSTALLS += target
HEADERS = \
qevdevkeyboard_defaultmap.h \
qevdevkeyboardhandler.h \
qevdevkeyboardmanager.h
QT += core-private platformsupport-private
SOURCES = main.cpp \
qevdevkeyboardhandler.cpp \
qevdevkeyboardmanager.cpp
SOURCES = main.cpp
OTHER_FILES += \
evdevkeyboard.json
contains(QT_CONFIG, libudev) {
LIBS += $$QMAKE_LIBS_LIBUDEV
}

View File

@ -40,7 +40,7 @@
****************************************************************************/
#include <qgenericplugin_qpa.h>
#include "qevdevkeyboardmanager.h"
#include <QtPlatformSupport/private/qevdevkeyboardmanager_p.h>
QT_BEGIN_NAMESPACE

View File

@ -5,18 +5,10 @@ DESTDIR = $$QT.gui.plugins/generic
target.path = $$[QT_INSTALL_PLUGINS]/generic
INSTALLS += target
HEADERS = qevdevmousehandler.h \
qevdevmousemanager.h
QT += core-private platformsupport-private
SOURCES = main.cpp \
qevdevmousehandler.cpp \
qevdevmousemanager.cpp
SOURCES = main.cpp
OTHER_FILES += \
evdevmouse.json
contains(QT_CONFIG, libudev) {
LIBS += $$QMAKE_LIBS_LIBUDEV
}

View File

@ -40,7 +40,7 @@
****************************************************************************/
#include <qgenericplugin_qpa.h>
#include "qevdevmousemanager.h"
#include <QtPlatformSupport/private/qevdevmousemanager_p.h>
QT_BEGIN_NAMESPACE

View File

@ -5,21 +5,10 @@ DESTDIR = $$QT.gui.plugins/generic
target.path = $$[QT_INSTALL_PLUGINS]/generic
INSTALLS += target
HEADERS = \
qevdevtouch.h
SOURCES = main.cpp \
qevdevtouch.cpp
SOURCES = main.cpp
QT += core-private platformsupport-private
OTHER_FILES += \
evdevtouch.json
contains(QT_CONFIG, libudev) {
LIBS += $$QMAKE_LIBS_LIBUDEV
}
# DEFINES += USE_MTDEV
contains(DEFINES, USE_MTDEV): LIBS += -lmtdev

View File

@ -40,7 +40,7 @@
****************************************************************************/
#include <qgenericplugin_qpa.h>
#include "qevdevtouch.h"
#include <QtPlatformSupport/private/qevdevtouch_p.h>
QT_BEGIN_NAMESPACE