Add evdev support for FreeBSD

FreeBSD 12 has evdev implementation dropin-compatible with Linux's
/dev/input. Add #ifdef wrappers around platform-specific headers.

Change-Id: Ia50c3f2d2e9f0f3689a92e327305d5e7547e9407
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
This commit is contained in:
Oleksandr Tymoshenko 2016-10-04 14:33:05 -07:00
parent 2a43eba414
commit e6d0d202f3
7 changed files with 28 additions and 0 deletions

View File

@ -37,8 +37,12 @@
** **
****************************************************************************/ ****************************************************************************/
#if defined(__FreeBSD__)
#include <dev/evdev/input.h>
#else
#include <linux/input.h> #include <linux/input.h>
#include <linux/kd.h> #include <linux/kd.h>
#endif
enum { enum {
e1 = ABS_PRESSURE, e1 = ABS_PRESSURE,

View File

@ -47,7 +47,11 @@
#include <QLoggingCategory> #include <QLoggingCategory>
#include <QtCore/private/qcore_unix_p.h> #include <QtCore/private/qcore_unix_p.h>
#ifdef Q_OS_FREEBSD
#include <dev/evdev/input.h>
#else
#include <linux/input.h> #include <linux/input.h>
#endif
#include <fcntl.h> #include <fcntl.h>
/* android (and perhaps some other linux-derived stuff) don't define everything /* android (and perhaps some other linux-derived stuff) don't define everything

View File

@ -52,7 +52,11 @@
// //
#include "qnamespace.h" #include "qnamespace.h"
#ifdef Q_OS_FREEBSD
#include <dev/evdev/input.h>
#else
#include "linux/input.h" #include "linux/input.h"
#endif
// no QT_BEGIN_NAMESPACE, since we include it internally... // no QT_BEGIN_NAMESPACE, since we include it internally...

View File

@ -49,7 +49,11 @@
#include <qpa/qwindowsysteminterface.h> #include <qpa/qwindowsysteminterface.h>
#include <private/qcore_unix_p.h> #include <private/qcore_unix_p.h>
#ifdef Q_OS_FREEBSD
#include <dev/evdev/input.h>
#else
#include <linux/input.h> #include <linux/input.h>
#endif
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE

View File

@ -53,8 +53,12 @@
#include <errno.h> #include <errno.h>
#ifdef Q_OS_FREEBSD
#include <dev/evdev/input.h>
#else
#include <linux/kd.h> #include <linux/kd.h>
#include <linux/input.h> #include <linux/input.h>
#endif
#define TEST_BIT(array, bit) (array[bit/8] & (1<<(bit%8))) #define TEST_BIT(array, bit) (array[bit/8] & (1<<(bit%8)))

View File

@ -45,7 +45,11 @@
#include <QLoggingCategory> #include <QLoggingCategory>
#include <QtCore/private/qcore_unix_p.h> #include <QtCore/private/qcore_unix_p.h>
#include <qpa/qwindowsysteminterface.h> #include <qpa/qwindowsysteminterface.h>
#ifdef Q_OS_FREEBSD
#include <dev/evdev/input.h>
#else
#include <linux/input.h> #include <linux/input.h>
#endif
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE

View File

@ -48,7 +48,11 @@
#include <QtCore/private/qcore_unix_p.h> #include <QtCore/private/qcore_unix_p.h>
#include <QtGui/private/qhighdpiscaling_p.h> #include <QtGui/private/qhighdpiscaling_p.h>
#include <QtGui/private/qguiapplication_p.h> #include <QtGui/private/qguiapplication_p.h>
#ifdef Q_OS_FREEBSD
#include <dev/evdev/input.h>
#else
#include <linux/input.h> #include <linux/input.h>
#endif
#if QT_CONFIG(mtdev) #if QT_CONFIG(mtdev)
extern "C" { extern "C" {