blob: d0ec32b2342ab476d40060234cf3198f21d95aec [file] [log] [blame]
[email protected]f24448db2011-01-27 20:40:391// Copyright (c) 2011 The Chromium Authors. All rights reserved.
[email protected]4c2e9352010-11-05 22:13:022// 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]ceadc392011-06-15 23:04:2412#include "ppapi/shared_impl/function_group_base.h"
[email protected]be0a84b2011-08-13 04:18:4413#include "ppapi/shared_impl/host_resource.h"
[email protected]493d14212011-07-07 15:38:4814#include "ppapi/shared_impl/instance_impl.h"
[email protected]ceadc392011-06-15 23:04:2415#include "ppapi/thunk/ppb_instance_api.h"
[email protected]4c2e9352010-11-05 22:13:0216
[email protected]4d2efd22011-08-18 21:58:0217namespace ppapi {
[email protected]4c2e9352010-11-05 22:13:0218namespace proxy {
19
20class SerializedVarReceiveInput;
21class SerializedVarOutParam;
22class SerializedVarReturnValue;
23
[email protected]ceadc392011-06-15 23:04:2424class PPB_Instance_Proxy : public InterfaceProxy,
[email protected]493d14212011-07-07 15:38:4825 public ppapi::InstanceImpl,
[email protected]ceadc392011-06-15 23:04:2426 public ppapi::FunctionGroupBase,
27 public ppapi::thunk::PPB_Instance_FunctionAPI {
[email protected]4c2e9352010-11-05 22:13:0228 public:
29 PPB_Instance_Proxy(Dispatcher* dispatcher, const void* target_interface);
30 virtual ~PPB_Instance_Proxy();
31
[email protected]ceadc392011-06-15 23:04:2432 static const Info* GetInfo0_5();
[email protected]7d0284e02011-07-13 03:48:2433 static const Info* GetInfo1_0();
[email protected]7f801d82011-07-08 23:30:1134 static const Info* GetInfoMessaging();
[email protected]18d871f2011-09-08 16:56:3435 static const Info* GetInfoMouseLock();
[email protected]ceadc392011-06-15 23:04:2436 static const Info* GetInfoPrivate();
37 static const Info* GetInfoFullscreen();
[email protected]4c2e9352010-11-05 22:13:0238
39 // InterfaceProxy implementation.
[email protected]a95986a82010-12-24 06:19:2840 virtual bool OnMessageReceived(const IPC::Message& msg);
[email protected]4c2e9352010-11-05 22:13:0241
[email protected]ceadc392011-06-15 23:04:2442 // 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]493d14212011-07-07 15:38:4858 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]55a5a522011-07-06 22:52:4064 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]15237942011-07-30 04:24:1968 virtual void SubscribeToPolicyUpdates(PP_Instance instance) OVERRIDE;
[email protected]55a5a522011-07-06 22:52:4069 virtual void PostMessage(PP_Instance instance, PP_Var message) OVERRIDE;
[email protected]18d871f2011-09-08 16:56:3470 virtual int32_t LockMouse(PP_Instance instance,
71 PP_CompletionCallback callback) OVERRIDE;
72 virtual void UnlockMouse(PP_Instance instance) OVERRIDE;
[email protected]ceadc392011-06-15 23:04:2473
[email protected]4c2e9352010-11-05 22:13:0274 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]be0a84b2011-08-13 04:18:4481 const ppapi::HostResource& device,
[email protected]19d2b012010-11-08 16:32:1882 PP_Bool* result);
83 void OnMsgIsFullFrame(PP_Instance instance, PP_Bool* result);
[email protected]4c2e9352010-11-05 22:13:0284 void OnMsgExecuteScript(PP_Instance instance,
85 SerializedVarReceiveInput script,
86 SerializedVarOutParam out_exception,
87 SerializedVarReturnValue result);
[email protected]ceadc392011-06-15 23:04:2488 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]493d14212011-07-07 15:38:4894 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]55a5a522011-07-06 22:52:4099 void OnMsgPostMessage(PP_Instance instance,
100 SerializedVarReceiveInput message);
[email protected]18d871f2011-09-08 16:56:34101 void OnMsgLockMouse(PP_Instance instance,
102 uint32_t serialized_callback);
103 void OnMsgUnlockMouse(PP_Instance instance);
[email protected]4c2e9352010-11-05 22:13:02104};
105
106} // namespace proxy
[email protected]4d2efd22011-08-18 21:58:02107} // namespace ppapi
[email protected]4c2e9352010-11-05 22:13:02108
109#endif // PPAPI_PROXY_PPB_INSTANCE_PROXY_H_