| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_THUNK_RESOURCE_CREATION_API_H_ | 5 #ifndef PPAPI_THUNK_RESOURCE_CREATION_API_H_ |
| 6 #define PPAPI_THUNK_RESOURCE_CREATION_API_H_ | 6 #define PPAPI_THUNK_RESOURCE_CREATION_API_H_ |
| 7 | 7 |
| 8 #include "ppapi/c/dev/pp_video_dev.h" | 8 #include "ppapi/c/dev/pp_video_dev.h" |
| 9 #include "ppapi/c/dev/ppb_file_chooser_dev.h" | 9 #include "ppapi/c/dev/ppb_file_chooser_dev.h" |
| 10 #include "ppapi/c/dev/ppb_truetype_font_dev.h" | 10 #include "ppapi/c/dev/ppb_truetype_font_dev.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 // A functional API for creating resource types. Separating out the creation | 42 // A functional API for creating resource types. Separating out the creation |
| 43 // functions here allows us to implement most resources as a pure "resource | 43 // functions here allows us to implement most resources as a pure "resource |
| 44 // API", meaning all calls are routed on a per-resource-object basis. The | 44 // API", meaning all calls are routed on a per-resource-object basis. The |
| 45 // creation functions are not per-object (since there's no object during | 45 // creation functions are not per-object (since there's no object during |
| 46 // creation) so need functional routing based on the instance ID. | 46 // creation) so need functional routing based on the instance ID. |
| 47 class ResourceCreationAPI { | 47 class ResourceCreationAPI { |
| 48 public: | 48 public: |
| 49 virtual ~ResourceCreationAPI() {} | 49 virtual ~ResourceCreationAPI() {} |
| 50 | 50 |
| 51 virtual PP_Resource CreateFileIO(PP_Instance instance) = 0; | 51 virtual PP_Resource CreateFileIO(PP_Instance instance) = 0; |
| 52 virtual PP_Resource CreateFileRef( | 52 virtual PP_Resource CreateFileRef(PP_Instance instance, |
| 53 PP_Instance instance, | 53 const FileRefCreateInfo& serialized) = 0; |
| 54 const FileRefCreateInfo& serialized) = 0; | |
| 55 virtual PP_Resource CreateFileSystem(PP_Instance instance, | 54 virtual PP_Resource CreateFileSystem(PP_Instance instance, |
| 56 PP_FileSystemType type) = 0; | 55 PP_FileSystemType type) = 0; |
| 57 virtual PP_Resource CreateIMEInputEvent(PP_Instance instance, | 56 virtual PP_Resource CreateIMEInputEvent(PP_Instance instance, |
| 58 PP_InputEvent_Type type, | 57 PP_InputEvent_Type type, |
| 59 PP_TimeTicks time_stamp, | 58 PP_TimeTicks time_stamp, |
| 60 struct PP_Var text, | 59 struct PP_Var text, |
| 61 uint32_t segment_number, | 60 uint32_t segment_number, |
| 62 const uint32_t* segment_offsets, | 61 const uint32_t* segment_offsets, |
| 63 int32_t target_segment, | 62 int32_t target_segment, |
| 64 uint32_t selection_start, | 63 uint32_t selection_start, |
| 65 uint32_t selection_end) = 0; | 64 uint32_t selection_end) = 0; |
| 66 virtual PP_Resource CreateKeyboardInputEvent_1_0( | 65 virtual PP_Resource CreateKeyboardInputEvent_1_0( |
| 67 PP_Instance instance, | 66 PP_Instance instance, |
| 68 PP_InputEvent_Type type, | 67 PP_InputEvent_Type type, |
| 69 PP_TimeTicks time_stamp, | 68 PP_TimeTicks time_stamp, |
| 70 uint32_t modifiers, | 69 uint32_t modifiers, |
| 71 uint32_t key_code, | 70 uint32_t key_code, |
| 72 struct PP_Var character_text) = 0; | 71 struct PP_Var character_text) = 0; |
| 73 virtual PP_Resource CreateKeyboardInputEvent_1_2( | 72 virtual PP_Resource CreateKeyboardInputEvent_1_2(PP_Instance instance, |
| 74 PP_Instance instance, | 73 PP_InputEvent_Type type, |
| 75 PP_InputEvent_Type type, | 74 PP_TimeTicks time_stamp, |
| 76 PP_TimeTicks time_stamp, | 75 uint32_t modifiers, |
| 77 uint32_t modifiers, | 76 uint32_t key_code, |
| 78 uint32_t key_code, | 77 struct PP_Var character_text, |
| 79 struct PP_Var character_text, | 78 struct PP_Var code) = 0; |
| 80 struct PP_Var code) = 0; | |
| 81 virtual PP_Resource CreateMouseInputEvent( | 79 virtual PP_Resource CreateMouseInputEvent( |
| 82 PP_Instance instance, | 80 PP_Instance instance, |
| 83 PP_InputEvent_Type type, | 81 PP_InputEvent_Type type, |
| 84 PP_TimeTicks time_stamp, | 82 PP_TimeTicks time_stamp, |
| 85 uint32_t modifiers, | 83 uint32_t modifiers, |
| 86 PP_InputEvent_MouseButton mouse_button, | 84 PP_InputEvent_MouseButton mouse_button, |
| 87 const PP_Point* mouse_position, | 85 const PP_Point* mouse_position, |
| 88 int32_t click_count, | 86 int32_t click_count, |
| 89 const PP_Point* mouse_movement) = 0; | 87 const PP_Point* mouse_movement) = 0; |
| 90 virtual PP_Resource CreateTouchInputEvent( | 88 virtual PP_Resource CreateTouchInputEvent(PP_Instance instance, |
| 91 PP_Instance instance, | 89 PP_InputEvent_Type type, |
| 92 PP_InputEvent_Type type, | 90 PP_TimeTicks time_stamp, |
| 93 PP_TimeTicks time_stamp, | 91 uint32_t modifiers) = 0; |
| 94 uint32_t modifiers) = 0; | |
| 95 virtual PP_Resource CreateTrueTypeFont( | 92 virtual PP_Resource CreateTrueTypeFont( |
| 96 PP_Instance instance, | 93 PP_Instance instance, |
| 97 const PP_TrueTypeFontDesc_Dev* desc) = 0; | 94 const PP_TrueTypeFontDesc_Dev* desc) = 0; |
| 98 virtual PP_Resource CreateURLLoader(PP_Instance instance) = 0; | 95 virtual PP_Resource CreateURLLoader(PP_Instance instance) = 0; |
| 99 virtual PP_Resource CreateURLRequestInfo( | 96 virtual PP_Resource CreateURLRequestInfo(PP_Instance instance) = 0; |
| 100 PP_Instance instance) = 0; | |
| 101 | 97 |
| 102 virtual PP_Resource CreateWheelInputEvent( | 98 virtual PP_Resource CreateWheelInputEvent(PP_Instance instance, |
| 103 PP_Instance instance, | 99 PP_TimeTicks time_stamp, |
| 104 PP_TimeTicks time_stamp, | 100 uint32_t modifiers, |
| 105 uint32_t modifiers, | 101 const PP_FloatPoint* wheel_delta, |
| 106 const PP_FloatPoint* wheel_delta, | 102 const PP_FloatPoint* wheel_ticks, |
| 107 const PP_FloatPoint* wheel_ticks, | 103 PP_Bool scroll_by_page) = 0; |
| 108 PP_Bool scroll_by_page) = 0; | |
| 109 | 104 |
| 110 virtual PP_Resource CreateAudio1_0(PP_Instance instance, | 105 virtual PP_Resource CreateAudio1_0(PP_Instance instance, |
| 111 PP_Resource config_id, | 106 PP_Resource config_id, |
| 112 PPB_Audio_Callback_1_0 audio_callback, | 107 PPB_Audio_Callback_1_0 audio_callback, |
| 113 void* user_data) = 0; | 108 void* user_data) = 0; |
| 114 virtual PP_Resource CreateAudio(PP_Instance instance, | 109 virtual PP_Resource CreateAudio(PP_Instance instance, |
| 115 PP_Resource config_id, | 110 PP_Resource config_id, |
| 116 PPB_Audio_Callback audio_callback, | 111 PPB_Audio_Callback audio_callback, |
| 117 void* user_data) = 0; | 112 void* user_data) = 0; |
| 118 virtual PP_Resource CreateAudioTrusted(PP_Instance instance) = 0; | 113 virtual PP_Resource CreateAudioTrusted(PP_Instance instance) = 0; |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 PP_PrivateFontCharset charset) = 0; | 172 PP_PrivateFontCharset charset) = 0; |
| 178 virtual PP_Resource CreateFlashMenu(PP_Instance instance, | 173 virtual PP_Resource CreateFlashMenu(PP_Instance instance, |
| 179 const PP_Flash_Menu* menu_data) = 0; | 174 const PP_Flash_Menu* menu_data) = 0; |
| 180 virtual PP_Resource CreateFlashMessageLoop(PP_Instance instance) = 0; | 175 virtual PP_Resource CreateFlashMessageLoop(PP_Instance instance) = 0; |
| 181 virtual PP_Resource CreatePlatformVerificationPrivate( | 176 virtual PP_Resource CreatePlatformVerificationPrivate( |
| 182 PP_Instance instance) = 0; | 177 PP_Instance instance) = 0; |
| 183 virtual PP_Resource CreateScrollbar(PP_Instance instance, | 178 virtual PP_Resource CreateScrollbar(PP_Instance instance, |
| 184 PP_Bool vertical) = 0; | 179 PP_Bool vertical) = 0; |
| 185 virtual PP_Resource CreateTalk(PP_Instance instance) = 0; | 180 virtual PP_Resource CreateTalk(PP_Instance instance) = 0; |
| 186 virtual PP_Resource CreateVideoCapture(PP_Instance instance) = 0; | 181 virtual PP_Resource CreateVideoCapture(PP_Instance instance) = 0; |
| 187 virtual PP_Resource CreateVideoDecoder( | 182 virtual PP_Resource CreateVideoDecoder(PP_Instance instance, |
| 188 PP_Instance instance, | 183 PP_Resource context3d_id, |
| 189 PP_Resource context3d_id, | 184 PP_VideoDecoder_Profile profile) = 0; |
| 190 PP_VideoDecoder_Profile profile) = 0; | |
| 191 #endif // !defined(OS_NACL) | 185 #endif // !defined(OS_NACL) |
| 192 | 186 |
| 193 static const ApiID kApiID = API_ID_RESOURCE_CREATION; | 187 static const ApiID kApiID = API_ID_RESOURCE_CREATION; |
| 194 }; | 188 }; |
| 195 | 189 |
| 196 } // namespace thunk | 190 } // namespace thunk |
| 197 } // namespace ppapi | 191 } // namespace ppapi |
| 198 | 192 |
| 199 #endif // PPAPI_THUNK_RESOURCE_CREATION_API_H_ | 193 #endif // PPAPI_THUNK_RESOURCE_CREATION_API_H_ |
| OLD | NEW |