[email protected] | 0a424af | 2012-01-10 19:24:28 | [diff] [blame^] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | ceadc39 | 2011-06-15 23:04:24 | [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_THUNK_INSTANCE_API_H_ |
| 6 | #define PPAPI_THUNK_INSTANCE_API_H_ |
| 7 | |
[email protected] | 0a424af | 2012-01-10 19:24:28 | [diff] [blame^] | 8 | #include "ppapi/c/dev/ppb_gamepad_dev.h" |
[email protected] | 0346023 | 2011-10-10 17:23:57 | [diff] [blame] | 9 | #include "ppapi/c/dev/ppb_url_util_dev.h" |
[email protected] | 18d871f | 2011-09-08 16:56:34 | [diff] [blame] | 10 | #include "ppapi/c/pp_completion_callback.h" |
[email protected] | ceadc39 | 2011-06-15 23:04:24 | [diff] [blame] | 11 | #include "ppapi/c/ppb_instance.h" |
| 12 | #include "ppapi/c/pp_bool.h" |
| 13 | #include "ppapi/c/pp_size.h" |
| 14 | #include "ppapi/c/private/ppb_instance_private.h" |
[email protected] | ac4b54d | 2011-10-20 23:09:28 | [diff] [blame] | 15 | #include "ppapi/shared_impl/api_id.h" |
[email protected] | ceadc39 | 2011-06-15 23:04:24 | [diff] [blame] | 16 | |
[email protected] | 0f41c01 | 2011-10-21 19:49:20 | [diff] [blame] | 17 | // Windows headers interfere with this file. |
| 18 | #ifdef PostMessage |
| 19 | #undef PostMessage |
| 20 | #endif |
| 21 | |
[email protected] | ceadc39 | 2011-06-15 23:04:24 | [diff] [blame] | 22 | namespace ppapi { |
[email protected] | e8f07ac | 2012-01-03 17:43:36 | [diff] [blame] | 23 | |
| 24 | struct ViewData; |
| 25 | |
[email protected] | ceadc39 | 2011-06-15 23:04:24 | [diff] [blame] | 26 | namespace thunk { |
| 27 | |
| 28 | class PPB_Instance_FunctionAPI { |
| 29 | public: |
[email protected] | cb4fdad | 2011-06-27 22:25:29 | [diff] [blame] | 30 | virtual ~PPB_Instance_FunctionAPI() {} |
[email protected] | ceadc39 | 2011-06-15 23:04:24 | [diff] [blame] | 31 | |
| 32 | virtual PP_Bool BindGraphics(PP_Instance instance, PP_Resource device) = 0; |
| 33 | virtual PP_Bool IsFullFrame(PP_Instance instance) = 0; |
| 34 | |
[email protected] | e8f07ac | 2012-01-03 17:43:36 | [diff] [blame] | 35 | // Not an exposed PPAPI function, this returns the internal view data struct. |
| 36 | virtual const ViewData* GetViewData(PP_Instance instance) = 0; |
| 37 | |
[email protected] | ceadc39 | 2011-06-15 23:04:24 | [diff] [blame] | 38 | // InstancePrivate. |
| 39 | virtual PP_Var GetWindowObject(PP_Instance instance) = 0; |
| 40 | virtual PP_Var GetOwnerElementObject(PP_Instance instance) = 0; |
| 41 | virtual PP_Var ExecuteScript(PP_Instance instance, |
| 42 | PP_Var script, |
| 43 | PP_Var* exception) = 0; |
| 44 | |
[email protected] | 8d770e49 | 2011-10-11 04:54:31 | [diff] [blame] | 45 | // CharSet. |
| 46 | virtual PP_Var GetDefaultCharSet(PP_Instance instance) = 0; |
| 47 | |
[email protected] | 5c96602 | 2011-09-13 18:09:37 | [diff] [blame] | 48 | // Console. |
| 49 | virtual void Log(PP_Instance instance, |
| 50 | int log_level, |
| 51 | PP_Var value) = 0; |
| 52 | virtual void LogWithSource(PP_Instance instance, |
| 53 | int log_level, |
| 54 | PP_Var source, |
| 55 | PP_Var value) = 0; |
| 56 | |
[email protected] | 59cf702 | 2011-09-14 22:44:19 | [diff] [blame] | 57 | // Find. |
| 58 | virtual void NumberOfFindResultsChanged(PP_Instance instance, |
| 59 | int32_t total, |
| 60 | PP_Bool final_result) = 0; |
| 61 | virtual void SelectedFindResultChanged(PP_Instance instance, |
| 62 | int32_t index) = 0; |
| 63 | |
[email protected] | 557730a | 2011-10-05 18:03:38 | [diff] [blame] | 64 | // Fullscreen. |
[email protected] | 06e0a34 | 2011-09-27 04:24:30 | [diff] [blame] | 65 | virtual PP_Bool SetFullscreen(PP_Instance instance, |
| 66 | PP_Bool fullscreen) = 0; |
| 67 | virtual PP_Bool GetScreenSize(PP_Instance instance, PP_Size* size) = 0; |
| 68 | |
| 69 | // FlashFullscreen. |
[email protected] | dafab75 | 2011-09-20 20:08:40 | [diff] [blame] | 70 | virtual PP_Bool FlashIsFullscreen(PP_Instance instance) = 0; |
| 71 | virtual PP_Bool FlashSetFullscreen(PP_Instance instance, |
| 72 | PP_Bool fullscreen) = 0; |
| 73 | virtual PP_Bool FlashGetScreenSize(PP_Instance instance, PP_Size* size) = 0; |
[email protected] | cb4fdad | 2011-06-27 22:25:29 | [diff] [blame] | 74 | |
[email protected] | 0a424af | 2012-01-10 19:24:28 | [diff] [blame^] | 75 | // Gamepad. |
| 76 | virtual void SampleGamepads(PP_Instance instance, |
| 77 | PP_GamepadsData_Dev* data) = 0; |
| 78 | |
[email protected] | 493d1421 | 2011-07-07 15:38:48 | [diff] [blame] | 79 | // InputEvent. |
| 80 | virtual int32_t RequestInputEvents(PP_Instance instance, |
| 81 | uint32_t event_classes) = 0; |
| 82 | virtual int32_t RequestFilteringInputEvents(PP_Instance instance, |
| 83 | uint32_t event_classes) = 0; |
| 84 | virtual void ClearInputEventRequest(PP_Instance instance, |
| 85 | uint32_t event_classes) = 0; |
| 86 | |
[email protected] | 55a5a52 | 2011-07-06 22:52:40 | [diff] [blame] | 87 | // Messaging. |
| 88 | virtual void PostMessage(PP_Instance instance, PP_Var message) = 0; |
| 89 | |
[email protected] | 18d871f | 2011-09-08 16:56:34 | [diff] [blame] | 90 | // MouseLock. |
| 91 | virtual int32_t LockMouse(PP_Instance instance, |
| 92 | PP_CompletionCallback callback) = 0; |
| 93 | virtual void UnlockMouse(PP_Instance instance) = 0; |
| 94 | |
[email protected] | 1523794 | 2011-07-30 04:24:19 | [diff] [blame] | 95 | // Zoom. |
[email protected] | 55a5a52 | 2011-07-06 22:52:40 | [diff] [blame] | 96 | virtual void ZoomChanged(PP_Instance instance, double factor) = 0; |
| 97 | virtual void ZoomLimitsChanged(PP_Instance instance, |
| 98 | double minimum_factor, |
| 99 | double maximium_factor) = 0; |
| 100 | |
[email protected] | 0346023 | 2011-10-10 17:23:57 | [diff] [blame] | 101 | // URLUtil. |
| 102 | virtual PP_Var ResolveRelativeToDocument( |
| 103 | PP_Instance instance, |
| 104 | PP_Var relative, |
| 105 | PP_URLComponents_Dev* components) = 0; |
| 106 | virtual PP_Bool DocumentCanRequest(PP_Instance instance, PP_Var url) = 0; |
| 107 | virtual PP_Bool DocumentCanAccessDocument(PP_Instance instance, |
| 108 | PP_Instance target) = 0; |
| 109 | virtual PP_Var GetDocumentURL(PP_Instance instance, |
| 110 | PP_URLComponents_Dev* components) = 0; |
| 111 | virtual PP_Var GetPluginInstanceURL(PP_Instance instance, |
| 112 | PP_URLComponents_Dev* components) = 0; |
| 113 | |
[email protected] | ac4b54d | 2011-10-20 23:09:28 | [diff] [blame] | 114 | static const ApiID kApiID = API_ID_PPB_INSTANCE; |
[email protected] | ceadc39 | 2011-06-15 23:04:24 | [diff] [blame] | 115 | }; |
| 116 | |
| 117 | } // namespace thunk |
| 118 | } // namespace ppapi |
| 119 | |
| 120 | #endif // PPAPI_THUNK_INSTANCE_API_H_ |