| 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_C_PRIVATE_PPB_FLASH_H_ | 5 #ifndef PPAPI_C_PRIVATE_PPB_FLASH_H_ |
| 6 #define PPAPI_C_PRIVATE_PPB_FLASH_H_ | 6 #define PPAPI_C_PRIVATE_PPB_FLASH_H_ |
| 7 | 7 |
| 8 #ifdef _WIN32 | |
| 9 #include <windows.h> | |
| 10 #endif | |
| 11 | |
| 12 #include "ppapi/c/pp_bool.h" | 8 #include "ppapi/c/pp_bool.h" |
| 13 #include "ppapi/c/pp_instance.h" | 9 #include "ppapi/c/pp_instance.h" |
| 14 #include "ppapi/c/pp_point.h" | 10 #include "ppapi/c/pp_point.h" |
| 15 #include "ppapi/c/pp_rect.h" | 11 #include "ppapi/c/pp_rect.h" |
| 16 #include "ppapi/c/pp_resource.h" | 12 #include "ppapi/c/pp_resource.h" |
| 17 #include "ppapi/c/pp_var.h" | 13 #include "ppapi/c/pp_var.h" |
| 18 | 14 |
| 19 #define PPB_FLASH_INTERFACE "PPB_Flash;6" | 15 #define PPB_FLASH_INTERFACE "PPB_Flash;7" |
| 20 | |
| 21 #ifdef _WIN32 | |
| 22 typedef HANDLE PP_FileHandle; | |
| 23 static const PP_FileHandle PP_kInvalidFileHandle = NULL; | |
| 24 #else | |
| 25 typedef int PP_FileHandle; | |
| 26 static const PP_FileHandle PP_kInvalidFileHandle = -1; | |
| 27 #endif | |
| 28 | |
| 29 struct PP_CompletionCallback; | |
| 30 struct PP_FontDescription_Dev; | |
| 31 struct PP_FileInfo_Dev; | |
| 32 | |
| 33 struct PP_DirEntry_Dev { | |
| 34 const char* name; | |
| 35 PP_Bool is_dir; | |
| 36 }; | |
| 37 | |
| 38 struct PP_DirContents_Dev { | |
| 39 int32_t count; | |
| 40 struct PP_DirEntry_Dev* entries; | |
| 41 }; | |
| 42 | 16 |
| 43 struct PPB_Flash { | 17 struct PPB_Flash { |
| 44 // Sets or clears the rendering hint that the given plugin instance is always | 18 // Sets or clears the rendering hint that the given plugin instance is always |
| 45 // on top of page content. Somewhat more optimized painting can be used in | 19 // on top of page content. Somewhat more optimized painting can be used in |
| 46 // this case. | 20 // this case. |
| 47 void (*SetInstanceAlwaysOnTop)(PP_Instance instance, PP_Bool on_top); | 21 void (*SetInstanceAlwaysOnTop)(PP_Instance instance, PP_Bool on_top); |
| 48 | 22 |
| 49 PP_Bool (*DrawGlyphs)(PP_Instance instance, | 23 PP_Bool (*DrawGlyphs)(PP_Instance instance, |
| 50 PP_Resource pp_image_data, | 24 PP_Resource pp_image_data, |
| 51 const struct PP_FontDescription_Dev* font_desc, | 25 const struct PP_FontDescription_Dev* font_desc, |
| 52 uint32_t color, | 26 uint32_t color, |
| 53 struct PP_Point position, | 27 struct PP_Point position, |
| 54 struct PP_Rect clip, | 28 struct PP_Rect clip, |
| 55 const float transformation[3][3], | 29 const float transformation[3][3], |
| 56 uint32_t glyph_count, | 30 uint32_t glyph_count, |
| 57 const uint16_t glyph_indices[], | 31 const uint16_t glyph_indices[], |
| 58 const struct PP_Point glyph_advances[]); | 32 const struct PP_Point glyph_advances[]); |
| 59 | 33 |
| 60 // Retrieves the proxy that will be used for the given URL. The result will | 34 // Retrieves the proxy that will be used for the given URL. The result will |
| 61 // be a string in PAC format, or an undefined var on error. | 35 // be a string in PAC format, or an undefined var on error. |
| 62 struct PP_Var (*GetProxyForURL)(PP_Instance instance, const char* url); | 36 struct PP_Var (*GetProxyForURL)(PP_Instance instance, const char* url); |
| 63 | 37 |
| 64 // Opens a module-local file, returning a file descriptor (posix) or a HANDLE | |
| 65 // (win32) into file. Module-local file paths (here and below) are | |
| 66 // '/'-separated UTF-8 strings, relative to a module-specific root. The return | |
| 67 // value is the ppapi error, PP_OK if success, one of the PP_ERROR_* in case | |
| 68 // of failure. | |
| 69 int32_t (*OpenModuleLocalFile)(PP_Instance instance, | |
| 70 const char* path, | |
| 71 int32_t mode, | |
| 72 PP_FileHandle* file); | |
| 73 | |
| 74 // Renames a module-local file. The return value is the ppapi error, PP_OK if | |
| 75 // success, one of the PP_ERROR_* in case of failure. | |
| 76 int32_t (*RenameModuleLocalFile)(PP_Instance instance, | |
| 77 const char* path_from, | |
| 78 const char* path_to); | |
| 79 | |
| 80 // Deletes a module-local file or directory. If recursive is set and the path | |
| 81 // points to a directory, deletes all the contents of the directory. The | |
| 82 // return value is the ppapi error, PP_OK if success, one of the PP_ERROR_* in | |
| 83 // case of failure. | |
| 84 int32_t (*DeleteModuleLocalFileOrDir)(PP_Instance instance, | |
| 85 const char* path, | |
| 86 PP_Bool recursive); | |
| 87 | |
| 88 // Creates a module-local directory. The return value is the ppapi error, | |
| 89 // PP_OK if success, one of the PP_ERROR_* in case of failure. | |
| 90 int32_t (*CreateModuleLocalDir)(PP_Instance instance, const char* path); | |
| 91 | |
| 92 // Queries information about a module-local file. The return value is the | |
| 93 // ppapi error, PP_OK if success, one of the PP_ERROR_* in case of failure. | |
| 94 int32_t (*QueryModuleLocalFile)(PP_Instance instance, | |
| 95 const char* path, | |
| 96 struct PP_FileInfo_Dev* info); | |
| 97 | |
| 98 // Gets the list of files contained in a module-local directory. The return | |
| 99 // value is the ppapi error, PP_OK if success, one of the PP_ERROR_* in case | |
| 100 // of failure. If non-NULL, the returned contents should be freed with | |
| 101 // FreeModuleLocalDirContents. | |
| 102 int32_t (*GetModuleLocalDirContents)(PP_Instance instance, | |
| 103 const char* path, | |
| 104 struct PP_DirContents_Dev** contents); | |
| 105 | |
| 106 // Frees the data allocated by GetModuleLocalDirContents. | |
| 107 void (*FreeModuleLocalDirContents)(PP_Instance instance, | |
| 108 struct PP_DirContents_Dev* contents); | |
| 109 | |
| 110 // Navigate to URL. May open a new tab if target is not "_self". Return true | 38 // Navigate to URL. May open a new tab if target is not "_self". Return true |
| 111 // if success. This differs from javascript:window.open() in that it bypasses | 39 // if success. This differs from javascript:window.open() in that it bypasses |
| 112 // the popup blocker, even when this is not called from an event handler. | 40 // the popup blocker, even when this is not called from an event handler. |
| 113 PP_Bool (*NavigateToURL)(PP_Instance instance, | 41 PP_Bool (*NavigateToURL)(PP_Instance instance, |
| 114 const char* url, | 42 const char* url, |
| 115 const char* target); | 43 const char* target); |
| 116 | 44 |
| 117 // Runs a nested message loop. The plugin will be reentered from this call. | 45 // Runs a nested message loop. The plugin will be reentered from this call. |
| 118 // This function is used in places where Flash would normally enter a nested | 46 // This function is used in places where Flash would normally enter a nested |
| 119 // message loop (e.g., when displaying context menus), but Pepper provides | 47 // message loop (e.g., when displaying context menus), but Pepper provides |
| 120 // only an asynchronous call. After performing that asynchronous call, call | 48 // only an asynchronous call. After performing that asynchronous call, call |
| 121 // |RunMessageLoop()|. In the callback, call |QuitMessageLoop()|. | 49 // |RunMessageLoop()|. In the callback, call |QuitMessageLoop()|. |
| 122 void (*RunMessageLoop)(PP_Instance instance); | 50 void (*RunMessageLoop)(PP_Instance instance); |
| 123 | 51 |
| 124 // Posts a quit message for the outermost nested message loop. Use this to | 52 // Posts a quit message for the outermost nested message loop. Use this to |
| 125 // exit and return back to the caller after you call RunMessageLoop. | 53 // exit and return back to the caller after you call RunMessageLoop. |
| 126 void (*QuitMessageLoop)(PP_Instance instance); | 54 void (*QuitMessageLoop)(PP_Instance instance); |
| 127 }; | 55 }; |
| 128 | 56 |
| 129 #endif // PPAPI_C_PRIVATE_PPB_FLASH_H_ | 57 #endif // PPAPI_C_PRIVATE_PPB_FLASH_H_ |
| OLD | NEW |