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
13namespace ppapi {
14namespace thunk {
15
16namespace {
17
18PP_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
29PP_Bool LockCursor(PP_Instance instance) {
30  return PP_FALSE;
31}
32
33PP_Bool UnlockCursor(PP_Instance instance) {
34  return PP_FALSE;
35}
36
37PP_Bool HasCursorLock(PP_Instance instance) {
38  return PP_FALSE;
39}
40
41PP_Bool CanLockCursor(PP_Instance instance) {
42  return PP_FALSE;
43}
44
45const PPB_CursorControl_Dev g_ppb_cursor_control_thunk = {
46  &SetCursor,
47  &LockCursor,
48  &UnlockCursor,
49  &HasCursorLock,
50  &CanLockCursor
51};
52
53}  // namespace
54
55const 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