[Qt] Add support for the Gamepad API
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Aug 2012 19:03:58 +0000 (19:03 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Aug 2012 19:03:58 +0000 (19:03 +0000)
commitcff5c6de480c7dc14497f9d9bf8eb697b3621030
tree444b2ba9c3917d49673679972329e52bbab43df2
parent2353c19da41ecf5103d83393b21cd203d9e582c9
[Qt] Add support for the Gamepad API
https://bugs.webkit.org/show_bug.cgi?id=90637

Patch by Marcelo Lira <marcelo.lira@openbossa.org> on 2012-08-07
Reviewed by Alexis Menard.

Source/WebCore:

Adds support for Gamepad API on the Qt port.

The implementation of this class relies on the Linux
kernel joystick API.

Gamepad devices are recognized through the GamepadsQt
class, which uses the udev library to watch for connection,
disconnection and other gamepad related events.

Tests for this feature already exist.

* DerivedSources.pri:
* Target.pri:
* WebCore.pri:
* platform/qt/GamepadsQt.cpp: Added.
(WebCore):
(GamepadDeviceLinuxQt):
(WebCore::GamepadDeviceLinuxQt::create):
(WebCore::GamepadDeviceLinuxQt::GamepadDeviceLinuxQt):
(WebCore::GamepadDeviceLinuxQt::~GamepadDeviceLinuxQt):
(WebCore::GamepadDeviceLinuxQt::readCallback):
(GamepadsQt):
(WebCore::GamepadsQt::GamepadsQt):
(WebCore::GamepadsQt::~GamepadsQt):
(WebCore::GamepadsQt::isGamepadDevice):
(WebCore::GamepadsQt::onGamePadChange):
(WebCore::GamepadsQt::registerDevice):
(WebCore::GamepadsQt::unregisterDevice):
(WebCore::GamepadsQt::updateGamepadList):
(WebCore::sampleGamepads):

Tools:

If the libudev library is present, the GAMEPAD flag is
turned on by default for the Qt port.

* Scripts/webkitperl/FeatureList.pm:
* qmake/mkspecs/features/features.prf:

LayoutTests:

This does not unskip the gamepad tests for the Qt port, since the flag is
optional the test would not pass without it. The user may unskip it manually.

On the other hand, the gamepad-polling-access.html test is still expected
to fail because it requires additional test infrastructure.
See https://bugs.webkit.org/show_bug.cgi?id=92873

* platform/qt/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@124904 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/platform/qt/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.pri
Source/WebCore/Target.pri
Source/WebCore/WebCore.pri
Source/WebCore/platform/qt/GamepadsQt.cpp [new file with mode: 0644]
Tools/ChangeLog
Tools/Scripts/webkitperl/FeatureList.pm
Tools/qmake/mkspecs/features/features.prf