OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef PPAPI_NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PPP_INSTANCE_COMBINED_H_ |
| 6 #define PPAPI_NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PPP_INSTANCE_COMBINED_H_ |
| 7 |
| 8 #include "ppapi/c/ppp_instance.h" |
| 9 |
| 10 namespace ppapi_proxy { |
| 11 |
| 12 // This exposes the 1.1 interface and forwards it to the 1.0 interface is |
| 13 // necessary. |
| 14 struct PPP_Instance_Combined { |
| 15 public: |
| 16 // You must call one of the Init functions after the constructor. |
| 17 PPP_Instance_Combined(); |
| 18 |
| 19 void Init1_0(const PPP_Instance_1_0* instance_if); |
| 20 void Init1_1(const PPP_Instance_1_1* instance_if); |
| 21 |
| 22 bool initialized() const { return initialized_; } |
| 23 |
| 24 PP_Bool DidCreate(PP_Instance instance, |
| 25 uint32_t argc, |
| 26 const char* argn[], |
| 27 const char* argv[]); |
| 28 void DidDestroy(PP_Instance instance); |
| 29 |
| 30 // This version of DidChangeView encapsulates all arguments for both 1.0 |
| 31 // and 1.1 versions of this function. Conversion from 1.1 -> 1.0 is easy, |
| 32 // but this class doesn't have the necessary context (resource interfaces) |
| 33 // to do the conversion, so the caller must do it. |
| 34 void DidChangeView(PP_Instance instance, |
| 35 PP_Resource view_resource, |
| 36 const struct PP_Rect* position, |
| 37 const struct PP_Rect* clip); |
| 38 |
| 39 void DidChangeFocus(PP_Instance instance, PP_Bool has_focus); |
| 40 PP_Bool HandleDocumentLoad(PP_Instance instance, PP_Resource url_loader); |
| 41 |
| 42 private: |
| 43 bool initialized_; |
| 44 |
| 45 // For version 1.0, DidChangeView will be NULL, and DidChangeView_1_0 will |
| 46 // be set below. |
| 47 PPP_Instance_1_1 instance_1_1_; |
| 48 |
| 49 // Non-NULL when Instance 1.0 is used. |
| 50 void (*did_change_view_1_0_)(PP_Instance instance, |
| 51 const struct PP_Rect* position, |
| 52 const struct PP_Rect* clip); |
| 53 }; |
| 54 |
| 55 } // namespace ppapi_proxy |
| 56 |
| 57 #endif // PPAPI_NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PPP_INSTANCE_COMBINED_H_ |
| 58 |
OLD | NEW |