[email protected] | f24448db | 2011-01-27 20:40:39 | [diff] [blame] | 1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
[email protected] | 4c2e935 | 2010-11-05 22:13:02 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef PPAPI_PROXY_PPB_INSTANCE_PROXY_H_ |
| 6 | #define PPAPI_PROXY_PPB_INSTANCE_PROXY_H_ |
| 7 | |
| 8 | #include "ppapi/c/pp_instance.h" |
| 9 | #include "ppapi/c/pp_resource.h" |
| 10 | #include "ppapi/c/pp_var.h" |
| 11 | #include "ppapi/proxy/interface_proxy.h" |
[email protected] | ceadc39 | 2011-06-15 23:04:24 | [diff] [blame] | 12 | #include "ppapi/shared_impl/function_group_base.h" |
[email protected] | be0a84b | 2011-08-13 04:18:44 | [diff] [blame] | 13 | #include "ppapi/shared_impl/host_resource.h" |
[email protected] | 493d1421 | 2011-07-07 15:38:48 | [diff] [blame] | 14 | #include "ppapi/shared_impl/instance_impl.h" |
[email protected] | ceadc39 | 2011-06-15 23:04:24 | [diff] [blame] | 15 | #include "ppapi/thunk/ppb_instance_api.h" |
[email protected] | 4c2e935 | 2010-11-05 22:13:02 | [diff] [blame] | 16 | |
[email protected] | 4d2efd2 | 2011-08-18 21:58:02 | [diff] [blame] | 17 | namespace ppapi { |
[email protected] | 4c2e935 | 2010-11-05 22:13:02 | [diff] [blame] | 18 | namespace proxy { |
| 19 | |
| 20 | class SerializedVarReceiveInput; |
| 21 | class SerializedVarOutParam; |
| 22 | class SerializedVarReturnValue; |
| 23 | |
[email protected] | ceadc39 | 2011-06-15 23:04:24 | [diff] [blame] | 24 | class PPB_Instance_Proxy : public InterfaceProxy, |
[email protected] | 493d1421 | 2011-07-07 15:38:48 | [diff] [blame] | 25 | public ppapi::InstanceImpl, |
[email protected] | ceadc39 | 2011-06-15 23:04:24 | [diff] [blame] | 26 | public ppapi::FunctionGroupBase, |
| 27 | public ppapi::thunk::PPB_Instance_FunctionAPI { |
[email protected] | 4c2e935 | 2010-11-05 22:13:02 | [diff] [blame] | 28 | public: |
| 29 | PPB_Instance_Proxy(Dispatcher* dispatcher, const void* target_interface); |
| 30 | virtual ~PPB_Instance_Proxy(); |
| 31 | |
[email protected] | ceadc39 | 2011-06-15 23:04:24 | [diff] [blame] | 32 | static const Info* GetInfo0_5(); |
[email protected] | 7d0284e0 | 2011-07-13 03:48:24 | [diff] [blame] | 33 | static const Info* GetInfo1_0(); |
[email protected] | 7f801d8 | 2011-07-08 23:30:11 | [diff] [blame] | 34 | static const Info* GetInfoMessaging(); |
[email protected] | 18d871f | 2011-09-08 16:56:34 | [diff] [blame^] | 35 | static const Info* GetInfoMouseLock(); |
[email protected] | ceadc39 | 2011-06-15 23:04:24 | [diff] [blame] | 36 | static const Info* GetInfoPrivate(); |
| 37 | static const Info* GetInfoFullscreen(); |
[email protected] | 4c2e935 | 2010-11-05 22:13:02 | [diff] [blame] | 38 | |
| 39 | // InterfaceProxy implementation. |
[email protected] | a95986a8 | 2010-12-24 06:19:28 | [diff] [blame] | 40 | virtual bool OnMessageReceived(const IPC::Message& msg); |
[email protected] | 4c2e935 | 2010-11-05 22:13:02 | [diff] [blame] | 41 | |
[email protected] | ceadc39 | 2011-06-15 23:04:24 | [diff] [blame] | 42 | // FunctionGroupBase overrides. |
| 43 | ppapi::thunk::PPB_Instance_FunctionAPI* AsPPB_Instance_FunctionAPI() OVERRIDE; |
| 44 | |
| 45 | // PPB_Instance_FunctionAPI implementation. |
| 46 | virtual PP_Bool BindGraphics(PP_Instance instance, |
| 47 | PP_Resource device) OVERRIDE; |
| 48 | virtual PP_Bool IsFullFrame(PP_Instance instance) OVERRIDE; |
| 49 | virtual PP_Var GetWindowObject(PP_Instance instance) OVERRIDE; |
| 50 | virtual PP_Var GetOwnerElementObject(PP_Instance instance) OVERRIDE; |
| 51 | virtual PP_Var ExecuteScript(PP_Instance instance, |
| 52 | PP_Var script, |
| 53 | PP_Var* exception) OVERRIDE; |
| 54 | virtual PP_Bool IsFullscreen(PP_Instance instance) OVERRIDE; |
| 55 | virtual PP_Bool SetFullscreen(PP_Instance instance, |
| 56 | PP_Bool fullscreen) OVERRIDE; |
| 57 | virtual PP_Bool GetScreenSize(PP_Instance instance, PP_Size* size) OVERRIDE; |
[email protected] | 493d1421 | 2011-07-07 15:38:48 | [diff] [blame] | 58 | virtual int32_t RequestInputEvents(PP_Instance instance, |
| 59 | uint32_t event_classes) OVERRIDE; |
| 60 | virtual int32_t RequestFilteringInputEvents(PP_Instance instance, |
| 61 | uint32_t event_classes) OVERRIDE; |
| 62 | virtual void ClearInputEventRequest(PP_Instance instance, |
| 63 | uint32_t event_classes) OVERRIDE; |
[email protected] | 55a5a52 | 2011-07-06 22:52:40 | [diff] [blame] | 64 | virtual void ZoomChanged(PP_Instance instance, double factor) OVERRIDE; |
| 65 | virtual void ZoomLimitsChanged(PP_Instance instance, |
| 66 | double minimum_factor, |
| 67 | double maximium_factor) OVERRIDE; |
[email protected] | 1523794 | 2011-07-30 04:24:19 | [diff] [blame] | 68 | virtual void SubscribeToPolicyUpdates(PP_Instance instance) OVERRIDE; |
[email protected] | 55a5a52 | 2011-07-06 22:52:40 | [diff] [blame] | 69 | virtual void PostMessage(PP_Instance instance, PP_Var message) OVERRIDE; |
[email protected] | 18d871f | 2011-09-08 16:56:34 | [diff] [blame^] | 70 | virtual int32_t LockMouse(PP_Instance instance, |
| 71 | PP_CompletionCallback callback) OVERRIDE; |
| 72 | virtual void UnlockMouse(PP_Instance instance) OVERRIDE; |
[email protected] | ceadc39 | 2011-06-15 23:04:24 | [diff] [blame] | 73 | |
[email protected] | 4c2e935 | 2010-11-05 22:13:02 | [diff] [blame] | 74 | private: |
| 75 | // Message handlers. |
| 76 | void OnMsgGetWindowObject(PP_Instance instance, |
| 77 | SerializedVarReturnValue result); |
| 78 | void OnMsgGetOwnerElementObject(PP_Instance instance, |
| 79 | SerializedVarReturnValue result); |
| 80 | void OnMsgBindGraphics(PP_Instance instance, |
[email protected] | be0a84b | 2011-08-13 04:18:44 | [diff] [blame] | 81 | const ppapi::HostResource& device, |
[email protected] | 19d2b01 | 2010-11-08 16:32:18 | [diff] [blame] | 82 | PP_Bool* result); |
| 83 | void OnMsgIsFullFrame(PP_Instance instance, PP_Bool* result); |
[email protected] | 4c2e935 | 2010-11-05 22:13:02 | [diff] [blame] | 84 | void OnMsgExecuteScript(PP_Instance instance, |
| 85 | SerializedVarReceiveInput script, |
| 86 | SerializedVarOutParam out_exception, |
| 87 | SerializedVarReturnValue result); |
[email protected] | ceadc39 | 2011-06-15 23:04:24 | [diff] [blame] | 88 | void OnMsgSetFullscreen(PP_Instance instance, |
| 89 | PP_Bool fullscreen, |
| 90 | PP_Bool* result); |
| 91 | void OnMsgGetScreenSize(PP_Instance instance, |
| 92 | PP_Bool* result, |
| 93 | PP_Size* size); |
[email protected] | 493d1421 | 2011-07-07 15:38:48 | [diff] [blame] | 94 | void OnMsgRequestInputEvents(PP_Instance instance, |
| 95 | bool is_filtering, |
| 96 | uint32_t event_classes); |
| 97 | void OnMsgClearInputEvents(PP_Instance instance, |
| 98 | uint32_t event_classes); |
[email protected] | 55a5a52 | 2011-07-06 22:52:40 | [diff] [blame] | 99 | void OnMsgPostMessage(PP_Instance instance, |
| 100 | SerializedVarReceiveInput message); |
[email protected] | 18d871f | 2011-09-08 16:56:34 | [diff] [blame^] | 101 | void OnMsgLockMouse(PP_Instance instance, |
| 102 | uint32_t serialized_callback); |
| 103 | void OnMsgUnlockMouse(PP_Instance instance); |
[email protected] | 4c2e935 | 2010-11-05 22:13:02 | [diff] [blame] | 104 | }; |
| 105 | |
| 106 | } // namespace proxy |
[email protected] | 4d2efd2 | 2011-08-18 21:58:02 | [diff] [blame] | 107 | } // namespace ppapi |
[email protected] | 4c2e935 | 2010-11-05 22:13:02 | [diff] [blame] | 108 | |
| 109 | #endif // PPAPI_PROXY_PPB_INSTANCE_PROXY_H_ |