Changeset 121332 in webkit
- Timestamp:
- Jun 27, 2012 2:19:15 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r121228 r121332 1 2012-06-27 Zan Dobersek <zandobersek@gmail.com> 2 3 [Gtk] Add support for the Gamepad API 4 https://bugs.webkit.org/show_bug.cgi?id=87503 5 6 Reviewed by Carlos Garcia Campos. 7 8 Only enable the Gamepad feature on Linux as support 9 for other operating systems is not present. 10 11 Check for the GIO Unix and GUdev dependencies when the 12 Gamepad feature is enabled. 13 14 * configure.ac: 15 1 16 2012-06-25 Simon Hausmann <simon.hausmann@nokia.com> 2 17 -
trunk/Source/WebCore/ChangeLog
r121330 r121332 1 2012-06-27 Zan Dobersek <zandobersek@gmail.com> 2 3 [Gtk] Add support for the Gamepad API 4 https://bugs.webkit.org/show_bug.cgi?id=87503 5 6 Reviewed by Carlos Garcia Campos. 7 8 Add support for the Gamepad feature on the GTK port. 9 10 The support is available only on Linux, with each gamepad device being presented 11 through a GamepadDeviceLinux object. The implementation of this class relies on 12 the Linux kernel joystick API. 13 14 Gamepad devices are recognized through the GamepadsGtk class, of which implementation 15 is based on GUdev. This way devices are properly registered on connection as objects of 16 the GamepadDeviceGtk class which inherits GamepadDeviceLinux. GamepadDeviceGtk reads the 17 joystick data through GIO pollable streams and updates the device state accordingly. The 18 GamepadsGtk object is then polled for gamepads data through the sampleGamepads method. 19 20 No new tests - tests already exist but require additional testing infrastructure. 21 22 * GNUmakefile.am: 23 * GNUmakefile.list.am: 24 * bindings/gobject/GNUmakefile.am: 25 * bindings/js/JSDOMBinding.h: Add the jsArray method that operates on a Vector of floats. 26 (WebCore): 27 (WebCore::jsArray): 28 * platform/gtk/GamepadsGtk.cpp: Added. 29 (WebCore): 30 (GamepadDeviceGtk): 31 (WebCore::GamepadDeviceGtk::create): 32 (WebCore::GamepadDeviceGtk::GamepadDeviceGtk): 33 (WebCore::GamepadDeviceGtk::~GamepadDeviceGtk): 34 (WebCore::GamepadDeviceGtk::readCallback): 35 (GamepadsGtk): 36 (WebCore::GamepadsGtk::GamepadsGtk): 37 (WebCore::GamepadsGtk::~GamepadsGtk): 38 (WebCore::GamepadsGtk::registerDevice): 39 (WebCore::GamepadsGtk::unregisterDevice): 40 (WebCore::GamepadsGtk::updateGamepadList): 41 (WebCore::GamepadsGtk::onUEventCallback): 42 (WebCore::GamepadsGtk::isGamepadDevice): 43 (WebCore::sampleGamepads): 44 * platform/linux/GamepadDeviceLinux.cpp: Added. 45 (WebCore): 46 (WebCore::GamepadDeviceLinux::GamepadDeviceLinux): 47 (WebCore::GamepadDeviceLinux::~GamepadDeviceLinux): 48 (WebCore::GamepadDeviceLinux::updateForEvent): 49 (WebCore::GamepadDeviceLinux::normalizeAxisValue): 50 (WebCore::GamepadDeviceLinux::normalizeButtonValue): 51 * platform/linux/GamepadDeviceLinux.h: Added. 52 (WebCore): 53 (GamepadDeviceLinux): 54 (WebCore::GamepadDeviceLinux::connected): 55 (WebCore::GamepadDeviceLinux::id): 56 (WebCore::GamepadDeviceLinux::timestamp): 57 (WebCore::GamepadDeviceLinux::axesCount): 58 (WebCore::GamepadDeviceLinux::axesData): 59 (WebCore::GamepadDeviceLinux::buttonsCount): 60 (WebCore::GamepadDeviceLinux::buttonsData): 61 1 62 2012-06-27 Kentaro Hara <haraken@chromium.org> 2 63 -
trunk/Source/WebCore/GNUmakefile.am
r120957 r121332 13 13 -I$(srcdir)/Source/WebCore \ 14 14 -I$(srcdir)/Source/WebCore/Modules/filesystem \ 15 -I$(srcdir)/Source/WebCore/Modules/gamepad \ 15 16 -I$(srcdir)/Source/WebCore/Modules/geolocation \ 16 17 -I$(srcdir)/Source/WebCore/Modules/indexeddb \ … … 68 69 -I$(srcdir)/Source/WebCore/platform/image-decoders/png \ 69 70 -I$(srcdir)/Source/WebCore/platform/leveldb \ 71 -I$(srcdir)/Source/WebCore/platform/linux \ 70 72 -I$(srcdir)/Source/WebCore/platform/mediastream \ 71 73 -I$(srcdir)/Source/WebCore/platform/mediastream/gstreamer \ … … 867 869 IDL_PATH := \ 868 870 $(WebCore)/Modules/filesystem \ 871 $(WebCore)/Modules/gamepad \ 869 872 $(WebCore)/Modules/geolocation \ 870 873 $(WebCore)/Modules/indexeddb \ … … 962 965 $(COVERAGE_CFLAGS) \ 963 966 $(ENCHANT_CFLAGS) \ 967 $(GAMEPAD_CFLAGS) \ 964 968 $(GEOCLUE_CFLAGS) \ 965 969 $(GLIB_CFLAGS) \ … … 1033 1037 EXTRA_DIST += \ 1034 1038 $(shell ls $(srcdir)/Source/WebCore/Modules/filesystem/*.idl) \ 1039 $(shell ls $(srcdir)/Source/WebCore/Modules/gamepad/*.idl) \ 1035 1040 $(shell ls $(srcdir)/Source/WebCore/Modules/geolocation/*.idl) \ 1036 1041 $(shell ls $(srcdir)/Source/WebCore/Modules/indexeddb/*.idl) \ -
trunk/Source/WebCore/GNUmakefile.list.am
r121164 r121332 193 193 DerivedSources/WebCore/JSFloat64Array.cpp \ 194 194 DerivedSources/WebCore/JSFloat64Array.h \ 195 DerivedSources/WebCore/JSGamepad.cpp \ 196 DerivedSources/WebCore/JSGamepad.h \ 197 DerivedSources/WebCore/JSGamepadList.cpp \ 198 DerivedSources/WebCore/JSGamepadList.h \ 195 199 DerivedSources/WebCore/JSGeolocation.cpp \ 196 200 DerivedSources/WebCore/JSGeolocation.h \ … … 678 682 679 683 dom_binding_idls += \ 684 $(WebCore)/Modules/gamepad/Gamepad.idl \ 685 $(WebCore)/Modules/gamepad/GamepadList.idl \ 686 $(WebCore)/Modules/gamepad/NavigatorGamepad.idl \ 680 687 $(WebCore)/Modules/geolocation/Geolocation.idl \ 681 688 $(WebCore)/Modules/geolocation/Geoposition.idl \ … … 1054 1061 Source/WebCore/Modules/filesystem/WorkerContextFileSystem.cpp \ 1055 1062 Source/WebCore/Modules/filesystem/WorkerContextFileSystem.h \ 1063 Source/WebCore/Modules/gamepad/Gamepad.cpp \ 1064 Source/WebCore/Modules/gamepad/Gamepad.h \ 1065 Source/WebCore/Modules/gamepad/GamepadList.cpp \ 1066 Source/WebCore/Modules/gamepad/GamepadList.h \ 1067 Source/WebCore/Modules/gamepad/NavigatorGamepad.cpp \ 1068 Source/WebCore/Modules/gamepad/NavigatorGamepad.h \ 1056 1069 Source/WebCore/Modules/geolocation/Geolocation.cpp \ 1057 1070 Source/WebCore/Modules/geolocation/Geolocation.h \ … … 3161 3174 Source/WebCore/platform/FloatConversion.h \ 3162 3175 Source/WebCore/platform/FractionalLayoutUnit.h \ 3176 Source/WebCore/platform/Gamepads.h \ 3163 3177 Source/WebCore/platform/HashTools.h \ 3164 3178 Source/WebCore/platform/HistogramSupport.cpp \ … … 3409 3423 Source/WebCore/platform/gtk/ErrorsGtk.cpp \ 3410 3424 Source/WebCore/platform/gtk/ErrorsGtk.h \ 3425 Source/WebCore/platform/gtk/GamepadsGtk.cpp \ 3411 3426 Source/WebCore/platform/gtk/KURLGtk.cpp \ 3412 3427 Source/WebCore/platform/gtk/LanguageGtk.cpp \ … … 3469 3484 Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp \ 3470 3485 Source/WebCore/platform/image-decoders/png/PNGImageDecoder.h \ 3486 Source/WebCore/platform/linux/GamepadDeviceLinux.cpp \ 3487 Source/WebCore/platform/linux/GamepadDeviceLinux.h \ 3471 3488 Source/WebCore/platform/mediastream/DeprecatedPeerConnectionHandler.h \ 3472 3489 Source/WebCore/platform/mediastream/DeprecatedPeerConnectionHandlerClient.h \ -
trunk/Source/WebCore/bindings/gobject/GNUmakefile.am
r117368 r121332 67 67 DerivedSources/webkit/WebKitDOMFileListPrivate.h \ 68 68 DerivedSources/webkit/WebKitDOMFilePrivate.h \ 69 DerivedSources/webkit/WebKitDOMGamepad.cpp \ 70 DerivedSources/webkit/WebKitDOMGamepadList.cpp \ 71 DerivedSources/webkit/WebKitDOMGamepadListPrivate.h \ 72 DerivedSources/webkit/WebKitDOMGamepadPrivate.h \ 69 73 DerivedSources/webkit/WebKitDOMGeolocation.cpp \ 70 74 DerivedSources/webkit/WebKitDOMGeolocationPrivate.h \ … … 296 300 DerivedSources/webkit/WebKitDOMFile.h \ 297 301 DerivedSources/webkit/WebKitDOMFileList.h \ 302 DerivedSources/webkit/WebKitDOMGamepad.h \ 303 DerivedSources/webkit/WebKitDOMGamepadList.h \ 298 304 DerivedSources/webkit/WebKitDOMGeolocation.h \ 299 305 DerivedSources/webkit/WebKitDOMHTMLAnchorElement.h \ … … 429 435 endif 430 436 431 432 437 if ENABLE_WEB_TIMING 433 438 webkitgtk_built_h_api += \ -
trunk/Source/WebCore/bindings/js/JSDOMBinding.h
r120304 r121332 308 308 } 309 309 310 template<> 311 inline JSC::JSValue jsArray(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, const Vector<float>& iterator) 312 { 313 JSC::MarkedArgumentBuffer array; 314 Vector<float>::const_iterator end = iterator.end(); 315 316 for (Vector<float>::const_iterator it = iterator.begin(); it != end; ++it) 317 array.append(JSC::jsNumber(*it)); 318 319 return JSC::constructArray(exec, globalObject, array); 320 } 321 310 322 template <class T> 311 323 Vector<T> toNativeArray(JSC::ExecState* exec, JSC::JSValue value) -
trunk/Source/WebKit/gtk/ChangeLog
r121152 r121332 1 2012-06-27 Zan Dobersek <zandobersek@gmail.com> 2 3 [Gtk] Add support for the Gamepad API 4 https://bugs.webkit.org/show_bug.cgi?id=87503 5 6 Reviewed by Carlos Garcia Campos. 7 8 Add the Gamepad feature dependencies libraries to the LIBADD 9 list for the libwebkitgtk library. 10 11 * GNUmakefile.am: 12 1 13 2012-06-25 Carlos Garcia Campos <cgarcia@igalia.com> 2 14 -
trunk/Source/WebKit/gtk/GNUmakefile.am
r120918 r121332 88 88 $(FREETYPE_LIBS) \ 89 89 $(GAIL_LIBS) \ 90 $(GAMEPAD_LIBS) \ 90 91 $(GEOCLUE_LIBS) \ 91 92 $(GLIB_LIBS) \ -
trunk/Source/WebKit2/ChangeLog
r121323 r121332 1 2012-06-27 Zan Dobersek <zandobersek@gmail.com> 2 3 [Gtk] Add support for the Gamepad API 4 https://bugs.webkit.org/show_bug.cgi?id=87503 5 6 Reviewed by Carlos Garcia Campos. 7 8 Add the Gamepad feature dependencies libraries to the LIBADD 9 list for the libwebkitgtk2 library. 10 11 * GNUmakefile.am: 12 1 13 2012-06-26 Simon Hausmann <simon.hausmann@nokia.com> 2 14 -
trunk/Source/WebKit2/GNUmakefile.am
r119837 r121332 161 161 $(ENCHANT_LIBS) \ 162 162 $(GAIL_LIBS) \ 163 $(GAMEPAD_LIBS) \ 163 164 $(GEOCLUE_LIBS) \ 164 165 $(GLIB_LIBS) \ -
trunk/Tools/ChangeLog
r121331 r121332 1 2012-06-27 Zan Dobersek <zandobersek@gmail.com> 2 3 [Gtk] Add support for the Gamepad API 4 https://bugs.webkit.org/show_bug.cgi?id=87503 5 6 Reviewed by Carlos Garcia Campos. 7 8 Enable the gamepad support for the GTK port. 9 10 * Scripts/webkitperl/FeatureList.pm: 11 1 12 2012-06-27 Ryosuke Niwa <rniwa@webkit.org> 2 13 -
trunk/Tools/Scripts/webkitperl/FeatureList.pm
r121135 r121332 215 215 216 216 { option => "gamepad", desc => "Toggle Gamepad support", 217 define => "ENABLE_GAMEPAD", default => 0, value => \$gamepadSupport },217 define => "ENABLE_GAMEPAD", default => isGtk(), value => \$gamepadSupport }, 218 218 219 219 { option => "geolocation", desc => "Toggle Geolocation support", -
trunk/configure.ac
r121152 r121332 654 654 AC_MSG_RESULT([$enable_gamepad]) 655 655 656 if test "$enable_gamepad" = "yes" && test "$os_linux" = no; then 657 AC_MSG_WARN([Gamepad support is only available on Linux. Disabling Gamepad support.]) 658 enable_gamepad=no; 659 fi 660 656 661 # check whether to build with data transfer items support 657 662 AC_MSG_CHECKING([whether to enable HTML5 data transfer items support]) … … 1275 1280 AC_SUBST([ATSPI2_CFLAGS]) 1276 1281 AC_SUBST([ATSPI2_LIBS]) 1282 fi 1283 1284 if test "$enable_gamepad" = "yes"; then 1285 PKG_CHECK_MODULES([GAMEPAD], [gio-unix-2.0 gudev-1.0]) 1286 1287 AC_SUBST(GAMEPAD_CFLAGS) 1288 AC_SUBST(GAMEPAD_LIBS) 1277 1289 fi 1278 1290
Note: See TracChangeset
for help on using the changeset viewer.