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_SHARED_IMPL_PPP_INSTANCE_COMBINED_H_ | 5 #ifndef PPAPI_SHARED_IMPL_PPP_INSTANCE_COMBINED_H_ |
6 #define PPAPI_SHARED_IMPL_PPP_INSTANCE_COMBINED_H_ | 6 #define PPAPI_SHARED_IMPL_PPP_INSTANCE_COMBINED_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "ppapi/c/ppp_instance.h" | 9 #include "ppapi/c/ppp_instance.h" |
10 | 10 |
| 11 // TODO(dmichael): This is here only for temporary backwards compatibility so |
| 12 // that NaCl and other plugins aren't broken while the change propagates. This |
| 13 // needs to be deleted in 14, because we don't intend to support PPP_Instance. |
| 14 // HandleInputEvent. |
| 15 // --- Begin backwards compatibility code. |
| 16 union PP_InputEventData { |
| 17 struct PP_InputEvent_Key key; |
| 18 struct PP_InputEvent_Character character; |
| 19 struct PP_InputEvent_Mouse mouse; |
| 20 struct PP_InputEvent_Wheel wheel; |
| 21 char padding[64]; |
| 22 }; |
| 23 struct PP_InputEvent { |
| 24 PP_InputEvent_Type type; |
| 25 int32_t padding; |
| 26 PP_TimeTicks time_stamp; |
| 27 union PP_InputEventData u; |
| 28 }; |
| 29 PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_InputEvent, 80); |
| 30 |
| 31 #define PPP_INSTANCE_INTERFACE_0_5 "PPP_Instance;0.5" |
| 32 |
| 33 struct PPP_Instance_0_5 { |
| 34 PP_Bool (*DidCreate)(PP_Instance instance, |
| 35 uint32_t argc, |
| 36 const char* argn[], |
| 37 const char* argv[]); |
| 38 void (*DidDestroy)(PP_Instance instance); |
| 39 void (*DidChangeView)(PP_Instance instance, |
| 40 const struct PP_Rect* position, |
| 41 const struct PP_Rect* clip); |
| 42 void (*DidChangeFocus)(PP_Instance instance, PP_Bool has_focus); |
| 43 PP_Bool (*HandleInputEvent)(PP_Instance instance, |
| 44 const struct PP_InputEvent* event); |
| 45 PP_Bool (*HandleDocumentLoad)(PP_Instance instance, PP_Resource url_loader); |
| 46 }; |
| 47 // --- End backwards compatibility code. |
11 namespace ppapi { | 48 namespace ppapi { |
12 | 49 |
13 struct PPP_Instance_Combined : public PPP_Instance_0_5 { | 50 struct PPP_Instance_Combined : public PPP_Instance_1_0 { |
14 public: | 51 public: |
| 52 explicit PPP_Instance_Combined(const PPP_Instance_1_0& instance_if); |
15 explicit PPP_Instance_Combined(const PPP_Instance_0_5& instance_if); | 53 explicit PPP_Instance_Combined(const PPP_Instance_0_5& instance_if); |
| 54 PP_Bool (*HandleInputEvent_0_5)(PP_Instance instance, |
| 55 const struct PP_InputEvent* event); |
16 | 56 |
17 DISALLOW_COPY_AND_ASSIGN(PPP_Instance_Combined); | 57 DISALLOW_COPY_AND_ASSIGN(PPP_Instance_Combined); |
18 }; | 58 }; |
19 | 59 |
20 } // namespace ppapi | 60 } // namespace ppapi |
21 | 61 |
22 #endif // PPAPI_SHARED_IMPL_PPP_INSTANCE_COMBINED_H_ | 62 #endif // PPAPI_SHARED_IMPL_PPP_INSTANCE_COMBINED_H_ |
23 | 63 |
OLD | NEW |