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:
parent
2a43eba414
commit
e6d0d202f3
@ -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,
|
||||||
|
@ -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
|
||||||
|
@ -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...
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
@ -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)))
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
@ -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" {
|
||||||
|
Loading…
Reference in New Issue
Block a user