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