1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ppapi/c/dev/ppb_cursor_control_dev.h"
6 #include "ppapi/thunk/thunk.h"
7 #include "ppapi/thunk/enter.h"
8 #include "ppapi/thunk/ppb_instance_api.h"
9
10 // This interface is only for temporary backwards compat and currently just
11 // forwards to the stable interfaces that implement these features.
12
13 namespace ppapi {
14 namespace thunk {
15
16 namespace {
17
SetCursor(PP_Instance instance,PP_CursorType_Dev type,PP_Resource custom_image,const PP_Point * hot_spot)18 PP_Bool SetCursor(PP_Instance instance,
19 PP_CursorType_Dev type,
20 PP_Resource custom_image,
21 const PP_Point* hot_spot) {
22 EnterInstance enter(instance);
23 if (enter.failed())
24 return PP_FALSE;
25 return enter.functions()->SetCursor(instance,
26 static_cast<PP_MouseCursor_Type>(type), custom_image, hot_spot);
27 }
28
LockCursor(PP_Instance instance)29 PP_Bool LockCursor(PP_Instance instance) {
30 return PP_FALSE;
31 }
32
UnlockCursor(PP_Instance instance)33 PP_Bool UnlockCursor(PP_Instance instance) {
34 return PP_FALSE;
35 }
36
HasCursorLock(PP_Instance instance)37 PP_Bool HasCursorLock(PP_Instance instance) {
38 return PP_FALSE;
39 }
40
CanLockCursor(PP_Instance instance)41 PP_Bool CanLockCursor(PP_Instance instance) {
42 return PP_FALSE;
43 }
44
45 const PPB_CursorControl_Dev g_ppb_cursor_control_thunk = {
46 &SetCursor,
47 &LockCursor,
48 &UnlockCursor,
49 &HasCursorLock,
50 &CanLockCursor
51 };
52
53 } // namespace
54
GetPPB_CursorControl_Dev_0_4_Thunk()55 const PPB_CursorControl_Dev_0_4* GetPPB_CursorControl_Dev_0_4_Thunk() {
56 return &g_ppb_cursor_control_thunk;
57 }
58
59 } // namespace thunk
60 } // namespace ppapi
61