Commit graph

9 commits

Author SHA1 Message Date
Martin Gräßlin
2d9ff54e68 [autotest/libinput] Add a basic test for Context
This test mocks part of KWin::Udev, udev and libinput. The test itself
is still rather limited and only verifies whether libinput is valid or
not and that assignSeat works. Most of the interaction is not yet tested,
though to a large degree doesn't make sense and should be rather tested
in the context of LibInput::Connection.
2016-06-02 15:55:34 +02:00
Martin Gräßlin
1e564989c9 [autotest/libinput] Add a mocked test for Libinput::TouchEvent 2016-05-31 10:14:28 +02:00
Martin Gräßlin
8851bb8daa [autotest/libinput] Add a mocked test for Libinput::PointerEvent 2016-05-31 09:23:48 +02:00
Martin Gräßlin
4b3e8425a3 [autotests/libinput] Add include_directories for libinput
Libinput header is needed by the tests.
2016-05-30 18:03:42 +02:00
Martin Gräßlin
ac227e57c7 [autotest/libinput] Add a mocked test for Libinput::KeyEvent
This new test includes everything used in events.cpp to the mocked
functionality of libinput. Only key event is implemented so far, the
referenced pointer and touch functions are mocked with default values.

The test verifies that a KeyEvent gets created and the key press/release
works as expected.
2016-05-30 17:46:53 +02:00
Martin Gräßlin
69cbb40903 Pass LibInput::Device* through the event handlers
Summary:
The signals emitted by LibInput::Connection carry the Device for which
the input event was received. This Device is passed to the input handlers.

Custom event classes are added which extend QMouseEvent, QKeyEvent and
QWheelEvent respectively and expose the Device. The Device is only passed
around as a forward declared pointer, so even if compiled without libinput
support, it should still compile.

Event handlers which need to get access to the Device can now just cast
the event pointer to the custom class and access it. This can be used in
future to handle device specific key codes, etc.

As we don't have a proper event classes for touch events the event
handlers do not yet have access to the Device. Here the internal API
needs to be adjusted in future.

Reviewers: #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D1667
2016-05-30 15:26:37 +02:00
Martin Gräßlin
b72e4ec897 Revert "Fix build."
This reverts commit abe582c27d.

To explain: the test uses a mocked implementation of libinput. Because
of that it must not link against libinput. The whole idea is to not link
libinput.

So I'm reverting the addition of libinput to linkage. I don't know the
build error, if it gets presented to me, I'll fix it properly without
having to add a linkage to libinput.
2016-05-30 15:06:30 +02:00
Christophe Giboudeaux
abe582c27d Fix build. 2016-05-28 17:09:24 +02:00
Martin Gräßlin
eb44bbe460 [autotest] Add a test case for KWin::LibInput::Device
Summary:
The usage of libinput is completely mocked. The test covers all the
constant properties read by Device.

There are some features which are not yet tested:
* alphaNumericKeyboard
* supportedButtons
* enabled

The setters for leftHanded and pointerAcceleration are also covered
including the variants where it can fail.

Reviewers: #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D1648
2016-05-20 15:51:20 +02:00