Skip to content

Commit

Permalink
Add evdev support for FreeBSD
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
gonzoua committed Oct 6, 2016
1 parent 2a43eba commit e6d0d20
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 0 deletions.
4 changes: 4 additions & 0 deletions config.tests/unix/evdev/evdev.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,12 @@
**
****************************************************************************/

#if defined(__FreeBSD__)
#include <dev/evdev/input.h>
#else
#include <linux/input.h>
#include <linux/kd.h>
#endif

enum {
e1 = ABS_PRESSURE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@
#include <QLoggingCategory>
#include <QtCore/private/qcore_unix_p.h>

#ifdef Q_OS_FREEBSD
#include <dev/evdev/input.h>
#else
#include <linux/input.h>
#endif
#include <fcntl.h>

/* android (and perhaps some other linux-derived stuff) don't define everything
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@
//

#include "qnamespace.h"
#ifdef Q_OS_FREEBSD
#include <dev/evdev/input.h>
#else
#include "linux/input.h"
#endif

// no QT_BEGIN_NAMESPACE, since we include it internally...

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@
#include <qpa/qwindowsysteminterface.h>
#include <private/qcore_unix_p.h>

#ifdef Q_OS_FREEBSD
#include <dev/evdev/input.h>
#else
#include <linux/input.h>
#endif

QT_BEGIN_NAMESPACE

Expand Down
4 changes: 4 additions & 0 deletions src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,12 @@

#include <errno.h>

#ifdef Q_OS_FREEBSD
#include <dev/evdev/input.h>
#else
#include <linux/kd.h>
#include <linux/input.h>
#endif

#define TEST_BIT(array, bit) (array[bit/8] & (1<<(bit%8)))

Expand Down
4 changes: 4 additions & 0 deletions src/platformsupport/input/evdevtablet/qevdevtablethandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@
#include <QLoggingCategory>
#include <QtCore/private/qcore_unix_p.h>
#include <qpa/qwindowsysteminterface.h>
#ifdef Q_OS_FREEBSD
#include <dev/evdev/input.h>
#else
#include <linux/input.h>
#endif

QT_BEGIN_NAMESPACE

Expand Down
4 changes: 4 additions & 0 deletions src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@
#include <QtCore/private/qcore_unix_p.h>
#include <QtGui/private/qhighdpiscaling_p.h>
#include <QtGui/private/qguiapplication_p.h>
#ifdef Q_OS_FREEBSD
#include <dev/evdev/input.h>
#else
#include <linux/input.h>
#endif

#if QT_CONFIG(mtdev)
extern "C" {
Expand Down

0 comments on commit e6d0d20

Please sign in to comment.