Title: [104146] trunk/Source/WebCore
Revision
104146
Author
aba...@webkit.org
Date
2012-01-05 05:27:40 -0800 (Thu, 05 Jan 2012)

Log Message

Move Gamepad declarations from Navigator.idl into Modules/gamepad
https://bugs.webkit.org/show_bug.cgi?id=75559

Reviewed by Eric Seidel.

This patch moves the gamepad-related declarations in Navigator.idl into
Modules/gamepad.  The next step is to move the state into
Modules/gamepad as well.

* Modules/gamepad/NavigatorGamepad.cpp: Added.
(WebCore::NavigatorGamepad::NavigatorGamepad):
(WebCore::NavigatorGamepad::~NavigatorGamepad):
(WebCore::NavigatorGamepad::webkitGamepads):
* Modules/gamepad/NavigatorGamepad.h: Added.
* Modules/gamepad/NavigatorGamepad.idl: Added.
* WebCore.gypi:
* page/Navigator.cpp:
(WebCore::Navigator::gamepads):
* page/Navigator.h:
* page/Navigator.idl:

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (104145 => 104146)


--- trunk/Source/WebCore/ChangeLog	2012-01-05 13:04:35 UTC (rev 104145)
+++ trunk/Source/WebCore/ChangeLog	2012-01-05 13:27:40 UTC (rev 104146)
@@ -1,3 +1,26 @@
+2012-01-05  Adam Barth  <aba...@webkit.org>
+
+        Move Gamepad declarations from Navigator.idl into Modules/gamepad
+        https://bugs.webkit.org/show_bug.cgi?id=75559
+
+        Reviewed by Eric Seidel.
+
+        This patch moves the gamepad-related declarations in Navigator.idl into
+        Modules/gamepad.  The next step is to move the state into
+        Modules/gamepad as well.
+
+        * Modules/gamepad/NavigatorGamepad.cpp: Added.
+        (WebCore::NavigatorGamepad::NavigatorGamepad):
+        (WebCore::NavigatorGamepad::~NavigatorGamepad):
+        (WebCore::NavigatorGamepad::webkitGamepads):
+        * Modules/gamepad/NavigatorGamepad.h: Added.
+        * Modules/gamepad/NavigatorGamepad.idl: Added.
+        * WebCore.gypi:
+        * page/Navigator.cpp:
+        (WebCore::Navigator::gamepads):
+        * page/Navigator.h:
+        * page/Navigator.idl:
+
 2012-01-05  Alexis Menard  <alexis.men...@openbossa.org>
 
         getComputedStyle for border-image is not implemented.

Added: trunk/Source/WebCore/Modules/gamepad/NavigatorGamepad.cpp (0 => 104146)


--- trunk/Source/WebCore/Modules/gamepad/NavigatorGamepad.cpp	                        (rev 0)
+++ trunk/Source/WebCore/Modules/gamepad/NavigatorGamepad.cpp	2012-01-05 13:27:40 UTC (rev 104146)
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2011, Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ */
+
+#include "config.h"
+#include "NavigatorGamepad.h"
+
+#if ENABLE(GAMEPAD)
+
+#include "Navigator.h"
+
+namespace WebCore {
+
+NavigatorGamepad::NavigatorGamepad()
+{
+}
+
+NavigatorGamepad::~NavigatorGamepad()
+{
+}
+
+GamepadList* NavigatorGamepad::webkitGamepads(Navigator* navigator)
+{
+    // FIXME: We shouldn't need to direct this call to Navigator.
+    return navigator->gamepads();
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(GAMEPAD)

Added: trunk/Source/WebCore/Modules/gamepad/NavigatorGamepad.h (0 => 104146)


--- trunk/Source/WebCore/Modules/gamepad/NavigatorGamepad.h	                        (rev 0)
+++ trunk/Source/WebCore/Modules/gamepad/NavigatorGamepad.h	2012-01-05 13:27:40 UTC (rev 104146)
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2011, Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ */
+
+#ifndef NavigatorGamepad_h
+#define NavigatorGamepad_h
+
+#if ENABLE(GAMEPAD)
+
+namespace WebCore {
+
+class GamepadList;
+class Navigator;
+
+class NavigatorGamepad {
+public:
+    static GamepadList* webkitGamepads(Navigator*);
+
+private:
+    NavigatorGamepad();
+    ~NavigatorGamepad();
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(GAMEPAD)
+
+#endif // NavigatorGamepad_h

Added: trunk/Source/WebCore/Modules/gamepad/NavigatorGamepad.idl (0 => 104146)


--- trunk/Source/WebCore/Modules/gamepad/NavigatorGamepad.idl	                        (rev 0)
+++ trunk/Source/WebCore/Modules/gamepad/NavigatorGamepad.idl	2012-01-05 13:27:40 UTC (rev 104146)
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+module window {
+
+    interface [
+        Conditional=GAMEPAD,
+        Supplemental=Navigator
+    ] NavigatorGamepad {
+        readonly attribute [EnabledAtRuntime] GamepadList webkitGamepads;
+    };
+
+}

Modified: trunk/Source/WebCore/WebCore.gypi (104145 => 104146)


--- trunk/Source/WebCore/WebCore.gypi	2012-01-05 13:04:35 UTC (rev 104145)
+++ trunk/Source/WebCore/WebCore.gypi	2012-01-05 13:27:40 UTC (rev 104146)
@@ -1147,6 +1147,7 @@
         'webcore_bindings_idl_files': [
             'Modules/gamepad/Gamepad.idl',
             'Modules/gamepad/GamepadList.idl',
+            'Modules/gamepad/NavigatorGamepad.idl',
             'css/CSSCharsetRule.idl',
             'css/CSSFontFaceRule.idl',
             'css/CSSImportRule.idl',
@@ -1691,6 +1692,8 @@
             'Modules/gamepad/Gamepad.h',
             'Modules/gamepad/GamepadList.cpp',
             'Modules/gamepad/GamepadList.h',
+            'Modules/gamepad/NavigatorGamepad.cpp',
+            'Modules/gamepad/NavigatorGamepad.h',
             'accessibility/AXObjectCache.cpp',
             'accessibility/AccessibilityARIAGrid.cpp',
             'accessibility/AccessibilityARIAGrid.h',

Modified: trunk/Source/WebCore/page/Navigator.cpp (104145 => 104146)


--- trunk/Source/WebCore/page/Navigator.cpp	2012-01-05 13:04:35 UTC (rev 104145)
+++ trunk/Source/WebCore/page/Navigator.cpp	2012-01-05 13:27:40 UTC (rev 104146)
@@ -310,7 +310,7 @@
 #endif
 
 #if ENABLE(GAMEPAD)
-GamepadList* Navigator::webkitGamepads()
+GamepadList* Navigator::gamepads()
 {
     if (!m_gamepads)
         m_gamepads = GamepadList::create();

Modified: trunk/Source/WebCore/page/Navigator.h (104145 => 104146)


--- trunk/Source/WebCore/page/Navigator.h	2012-01-05 13:04:35 UTC (rev 104145)
+++ trunk/Source/WebCore/page/Navigator.h	2012-01-05 13:27:40 UTC (rev 104146)
@@ -76,7 +76,8 @@
 #endif
 
 #if ENABLE(GAMEPAD)
-    GamepadList* webkitGamepads();
+    // FIXME: This method should be in WebCore/Modules/gamepad.
+    GamepadList* gamepads();
 #endif
 
 private:
@@ -86,6 +87,7 @@
     mutable RefPtr<DOMMimeTypeArray> m_mimeTypes;
     mutable RefPtr<Geolocation> m_geolocation;
 #if ENABLE(GAMEPAD)
+    // FIXME: This state should be in WebCore/Modules/gamepad.
     mutable RefPtr<GamepadList> m_gamepads;
 #endif
 #if ENABLE(POINTER_LOCK)

Modified: trunk/Source/WebCore/page/Navigator.idl (104145 => 104146)


--- trunk/Source/WebCore/page/Navigator.idl	2012-01-05 13:04:35 UTC (rev 104145)
+++ trunk/Source/WebCore/page/Navigator.idl	2012-01-05 13:27:40 UTC (rev 104146)
@@ -61,10 +61,6 @@
                                                            in [Callback=FunctionOnly, Optional] NavigatorUserMediaErrorCallback errorCallback)
             raises(DOMException);
 #endif
-
-#if defined(ENABLE_GAMEPAD) && ENABLE_GAMEPAD
-        readonly attribute [EnabledAtRuntime] GamepadList webkitGamepads;
-#endif
     };
 
 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to