summaryrefslogtreecommitdiffstats
path: root/ppapi/thunk
diff options
context:
space:
mode:
authorscottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-10 19:24:28 +0000
committerscottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-10 19:24:28 +0000
commit0a424afc9c94380ecd80967be73cfb684b6ae3f4 (patch)
tree8741005d16fd3313f9d9430d30bec6497cd63225 /ppapi/thunk
parent336648ae73fa2d95d5042b00503c406fee1a6d0e (diff)
downloadchromium_src-0a424afc9c94380ecd80967be73cfb684b6ae3f4.zip
chromium_src-0a424afc9c94380ecd80967be73cfb684b6ae3f4.tar.gz
chromium_src-0a424afc9c94380ecd80967be73cfb684b6ae3f4.tar.bz2
Pepper gamepad support
BUG=79098 Review URL: http://codereview.chromium.org/9085027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117077 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/thunk')
-rw-r--r--ppapi/thunk/interfaces_ppb_public_dev.h1
-rw-r--r--ppapi/thunk/ppb_gamepad_thunk.cc34
-rw-r--r--ppapi/thunk/ppb_instance_api.h7
3 files changed, 41 insertions, 1 deletions
diff --git a/ppapi/thunk/interfaces_ppb_public_dev.h b/ppapi/thunk/interfaces_ppb_public_dev.h
index f72fa7c..de3b62b 100644
--- a/ppapi/thunk/interfaces_ppb_public_dev.h
+++ b/ppapi/thunk/interfaces_ppb_public_dev.h
@@ -43,6 +43,7 @@ PROXIED_IFACE(PPB_FileChooser, PPB_FILECHOOSER_DEV_INTERFACE_0_5,
PROXIED_IFACE(PPB_Font, PPB_FONT_DEV_INTERFACE_0_6, PPB_Font_Dev_0_6)
PROXIED_IFACE(PPB_Instance, PPB_CHAR_SET_DEV_INTERFACE_0_4, PPB_CharSet_Dev_0_4)
PROXIED_IFACE(PPB_Instance, PPB_CONSOLE_DEV_INTERFACE_0_1, PPB_Console_Dev_0_1)
+PROXIED_IFACE(PPB_Instance, PPB_GAMEPAD_DEV_INTERFACE_0_1, PPB_Gamepad_Dev_0_1)
PROXIED_IFACE(PPB_Instance, PPB_URLUTIL_DEV_INTERFACE_0_6, PPB_URLUtil_Dev_0_6)
UNPROXIED_IFACE(PPB_Instance, PPB_ZOOM_DEV_INTERFACE_0_2, PPB_Zoom_Dev_0_2)
UNPROXIED_IFACE(PPB_LayerCompositor, PPB_LAYER_COMPOSITOR_DEV_INTERFACE_0_2,
diff --git a/ppapi/thunk/ppb_gamepad_thunk.cc b/ppapi/thunk/ppb_gamepad_thunk.cc
new file mode 100644
index 0000000..9bf2122
--- /dev/null
+++ b/ppapi/thunk/ppb_gamepad_thunk.cc
@@ -0,0 +1,34 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ppapi/c/dev/ppb_gamepad_dev.h"
+#include "ppapi/thunk/thunk.h"
+#include "ppapi/thunk/enter.h"
+#include "ppapi/thunk/ppb_instance_api.h"
+#include "ppapi/thunk/resource_creation_api.h"
+
+namespace ppapi {
+namespace thunk {
+
+namespace {
+
+void SampleGamepads(PP_Instance instance, PP_GamepadsData_Dev* data) {
+ EnterFunction<PPB_Instance_FunctionAPI> enter(instance, true);
+ if (enter.failed())
+ return;
+ enter.functions()->SampleGamepads(instance, data);
+}
+
+const PPB_Gamepad_Dev g_ppb_gamepad_thunk = {
+ &SampleGamepads,
+};
+
+} // namespace
+
+const PPB_Gamepad_Dev* GetPPB_Gamepad_Dev_0_1_Thunk() {
+ return &g_ppb_gamepad_thunk;
+}
+
+} // namespace thunk
+} // namespace ppapi
diff --git a/ppapi/thunk/ppb_instance_api.h b/ppapi/thunk/ppb_instance_api.h
index 8151479..013f61b 100644
--- a/ppapi/thunk/ppb_instance_api.h
+++ b/ppapi/thunk/ppb_instance_api.h
@@ -1,10 +1,11 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef PPAPI_THUNK_INSTANCE_API_H_
#define PPAPI_THUNK_INSTANCE_API_H_
+#include "ppapi/c/dev/ppb_gamepad_dev.h"
#include "ppapi/c/dev/ppb_url_util_dev.h"
#include "ppapi/c/pp_completion_callback.h"
#include "ppapi/c/ppb_instance.h"
@@ -71,6 +72,10 @@ class PPB_Instance_FunctionAPI {
PP_Bool fullscreen) = 0;
virtual PP_Bool FlashGetScreenSize(PP_Instance instance, PP_Size* size) = 0;
+ // Gamepad.
+ virtual void SampleGamepads(PP_Instance instance,
+ PP_GamepadsData_Dev* data) = 0;
+
// InputEvent.
virtual int32_t RequestInputEvents(PP_Instance instance,
uint32_t event_classes) = 0;