OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef PPAPI_PPB_CURSOR_CONTROL_PROXY_H_ | 5 #ifndef PPAPI_PPB_CURSOR_CONTROL_PROXY_H_ |
6 #define PPAPI_PPB_CURSOR_CONTROL_PROXY_H_ | 6 #define PPAPI_PPB_CURSOR_CONTROL_PROXY_H_ |
7 | 7 |
8 #include "ppapi/c/pp_completion_callback.h" | 8 #include "ppapi/c/pp_completion_callback.h" |
9 #include "ppapi/c/pp_bool.h" | 9 #include "ppapi/c/pp_bool.h" |
10 #include "ppapi/c/pp_instance.h" | 10 #include "ppapi/c/pp_instance.h" |
11 #include "ppapi/c/pp_point.h" | 11 #include "ppapi/c/pp_point.h" |
12 #include "ppapi/c/pp_resource.h" | 12 #include "ppapi/c/pp_resource.h" |
13 #include "ppapi/proxy/interface_proxy.h" | 13 #include "ppapi/proxy/interface_proxy.h" |
14 #include "ppapi/shared_impl/function_group_base.h" | 14 #include "ppapi/shared_impl/function_group_base.h" |
15 #include "ppapi/shared_impl/host_resource.h" | 15 #include "ppapi/shared_impl/host_resource.h" |
16 #include "ppapi/thunk/ppb_cursor_control_api.h" | 16 #include "ppapi/thunk/ppb_cursor_control_api.h" |
17 | 17 |
18 struct PPB_CursorControl_Dev; | 18 struct PPB_CursorControl_Dev; |
19 | 19 |
20 namespace ppapi { | 20 namespace ppapi { |
21 namespace proxy { | 21 namespace proxy { |
22 | 22 |
23 class PPB_CursorControl_Proxy | 23 class PPB_CursorControl_Proxy |
24 : public ppapi::FunctionGroupBase, | 24 : public InterfaceProxy, |
25 public ppapi::thunk::PPB_CursorControl_FunctionAPI, | 25 public ppapi::thunk::PPB_CursorControl_FunctionAPI { |
26 public InterfaceProxy { | |
27 public: | 26 public: |
28 PPB_CursorControl_Proxy(Dispatcher* dispatcher, const void* target_interface); | 27 PPB_CursorControl_Proxy(Dispatcher* dispatcher); |
29 virtual ~PPB_CursorControl_Proxy(); | 28 virtual ~PPB_CursorControl_Proxy(); |
30 | 29 |
31 static const Info* GetInfo(); | |
32 | |
33 // FunctionGroupBase overrides. | 30 // FunctionGroupBase overrides. |
34 ppapi::thunk::PPB_CursorControl_FunctionAPI* AsPPB_CursorControl_FunctionAPI() | 31 ppapi::thunk::PPB_CursorControl_FunctionAPI* AsPPB_CursorControl_FunctionAPI() |
35 OVERRIDE; | 32 OVERRIDE; |
36 | 33 |
37 // PPB_CursorControl_FunctionAPI implementation. | 34 // PPB_CursorControl_FunctionAPI implementation. |
38 virtual PP_Bool SetCursor(PP_Instance instance, | 35 virtual PP_Bool SetCursor(PP_Instance instance, |
39 PP_CursorType_Dev type, | 36 PP_CursorType_Dev type, |
40 PP_Resource custom_image_id, | 37 PP_Resource custom_image_id, |
41 const PP_Point* hot_spot) OVERRIDE; | 38 const PP_Point* hot_spot) OVERRIDE; |
42 virtual PP_Bool LockCursor(PP_Instance instance) OVERRIDE; | 39 virtual PP_Bool LockCursor(PP_Instance instance) OVERRIDE; |
43 virtual PP_Bool UnlockCursor(PP_Instance instance) OVERRIDE; | 40 virtual PP_Bool UnlockCursor(PP_Instance instance) OVERRIDE; |
44 virtual PP_Bool HasCursorLock(PP_Instance instance) OVERRIDE; | 41 virtual PP_Bool HasCursorLock(PP_Instance instance) OVERRIDE; |
45 virtual PP_Bool CanLockCursor(PP_Instance instance) OVERRIDE; | 42 virtual PP_Bool CanLockCursor(PP_Instance instance) OVERRIDE; |
46 | 43 |
47 // InterfaceProxy implementation. | 44 // InterfaceProxy implementation. |
48 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; | 45 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
49 | 46 |
| 47 static const InterfaceID kInterfaceID = INTERFACE_ID_PPB_CURSORCONTROL; |
| 48 |
50 private: | 49 private: |
51 // Message handlers. | 50 // Message handlers. |
52 void OnMsgSetCursor(PP_Instance instance, | 51 void OnMsgSetCursor(PP_Instance instance, |
53 int32_t type, | 52 int32_t type, |
54 const ppapi::HostResource& custom_image, | 53 const ppapi::HostResource& custom_image, |
55 const PP_Point& hot_spot, | 54 const PP_Point& hot_spot, |
56 PP_Bool* result); | 55 PP_Bool* result); |
57 void OnMsgLockCursor(PP_Instance instance, | 56 void OnMsgLockCursor(PP_Instance instance, |
58 PP_Bool* result); | 57 PP_Bool* result); |
59 void OnMsgUnlockCursor(PP_Instance instance, | 58 void OnMsgUnlockCursor(PP_Instance instance, |
60 PP_Bool* result); | 59 PP_Bool* result); |
61 void OnMsgHasCursorLock(PP_Instance instance, | 60 void OnMsgHasCursorLock(PP_Instance instance, |
62 PP_Bool* result); | 61 PP_Bool* result); |
63 void OnMsgCanLockCursor(PP_Instance instance, | 62 void OnMsgCanLockCursor(PP_Instance instance, |
64 PP_Bool* result); | 63 PP_Bool* result); |
65 }; | 64 }; |
66 | 65 |
67 } // namespace proxy | 66 } // namespace proxy |
68 } // namespace ppapi | 67 } // namespace ppapi |
69 | 68 |
70 #endif // PPAPI_PPB_CURSOR_CONTROL_PROXY_H_ | 69 #endif // PPAPI_PPB_CURSOR_CONTROL_PROXY_H_ |
OLD | NEW |