OLD | NEW |
| (Empty) |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | |
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 WEBKIT_PLUGINS_PEPPER_PPB_FLASH_H_ | |
6 #define WEBKIT_PLUGINS_PEPPER_PPB_FLASH_H_ | |
7 | |
8 #ifdef _WIN32 | |
9 #include <windows.h> | |
10 #endif | |
11 | |
12 #include "ppapi/c/pp_errors.h" | |
13 #include "ppapi/c/pp_instance.h" | |
14 #include "ppapi/c/pp_module.h" | |
15 #include "ppapi/c/pp_point.h" | |
16 #include "ppapi/c/pp_rect.h" | |
17 #include "ppapi/c/pp_resource.h" | |
18 #include "ppapi/c/pp_var.h" | |
19 | |
20 #define PPB_FLASH_INTERFACE "PPB_Flash;1" | |
21 | |
22 #ifdef _WIN32 | |
23 typedef HANDLE PP_FileHandle; | |
24 static const PP_FileHandle PP_kInvalidFileHandle = NULL; | |
25 #else | |
26 typedef int PP_FileHandle; | |
27 static const PP_FileHandle PP_kInvalidFileHandle = -1; | |
28 #endif | |
29 | |
30 struct PP_FontDescription_Dev; | |
31 struct PP_FileInfo_Dev; | |
32 | |
33 struct PP_DirEntry_Dev { | |
34 const char* name; | |
35 bool is_dir; | |
36 }; | |
37 | |
38 struct PP_DirContents_Dev { | |
39 int32_t count; | |
40 PP_DirEntry_Dev* entries; | |
41 }; | |
42 | |
43 struct PPB_Flash { | |
44 // 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 | |
46 // this case. | |
47 void (*SetInstanceAlwaysOnTop)(PP_Instance instance, bool on_top); | |
48 | |
49 bool (*DrawGlyphs)(PP_Resource pp_image_data, | |
50 const PP_FontDescription_Dev* font_desc, | |
51 uint32_t color, | |
52 PP_Point position, | |
53 PP_Rect clip, | |
54 const float transformation[3][3], | |
55 uint32_t glyph_count, | |
56 const uint16_t glyph_indices[], | |
57 const PP_Point glyph_advances[]); | |
58 | |
59 // Retrieves the proxy that will be used for the given URL. The result will | |
60 // be a string in PAC format, or an undefined var on error. | |
61 PP_Var (*GetProxyForURL)(PP_Module module, const char* url); | |
62 | |
63 // Opens a module-local file, returning a file descriptor (posix) or a HANDLE | |
64 // (win32) into file. Module-local file paths (here and below) are | |
65 // '/'-separated UTF-8 strings, relative to a module-specific root. The return | |
66 // value is the ppapi error, PP_OK if success, one of the PP_ERROR_* in case | |
67 // of failure. | |
68 int32_t (*OpenModuleLocalFile)(PP_Module module, | |
69 const char* path, | |
70 int32_t mode, | |
71 PP_FileHandle* file); | |
72 | |
73 // Renames a module-local file. The return value is the ppapi error, PP_OK if | |
74 // success, one of the PP_ERROR_* in case of failure. | |
75 int32_t (*RenameModuleLocalFile)(PP_Module module, | |
76 const char* path_from, | |
77 const char* path_to); | |
78 | |
79 // Deletes a module-local file or directory. If recursive is set and the path | |
80 // points to a directory, deletes all the contents of the directory. The | |
81 // return value is the ppapi error, PP_OK if success, one of the PP_ERROR_* in | |
82 // case of failure. | |
83 int32_t (*DeleteModuleLocalFileOrDir)(PP_Module module, | |
84 const char* path, | |
85 bool recursive); | |
86 | |
87 // Creates a module-local directory. The return value is the ppapi error, | |
88 // PP_OK if success, one of the PP_ERROR_* in case of failure. | |
89 int32_t (*CreateModuleLocalDir)(PP_Module module, const char* path); | |
90 | |
91 // Queries information about a module-local file. The return value is the | |
92 // ppapi error, PP_OK if success, one of the PP_ERROR_* in case of failure. | |
93 int32_t (*QueryModuleLocalFile)(PP_Module module, | |
94 const char* path, | |
95 PP_FileInfo_Dev* info); | |
96 | |
97 // Gets the list of files contained in a module-local directory. The return | |
98 // value is the ppapi error, PP_OK if success, one of the PP_ERROR_* in case | |
99 // of failure. If non-NULL, the returned contents should be freed with | |
100 // FreeModuleLocalDirContents. | |
101 int32_t (*GetModuleLocalDirContents)(PP_Module module, | |
102 const char* path, | |
103 PP_DirContents_Dev** contents); | |
104 | |
105 // Frees the data allocated by GetModuleLocalDirContents. | |
106 void (*FreeModuleLocalDirContents)(PP_Module module, | |
107 PP_DirContents_Dev* contents); | |
108 | |
109 // Navigate to URL. May open a new tab if target is not "_self". Return true | |
110 // if success. This differs from javascript:window.open() in that it bypasses | |
111 // the popup blocker, even when this is not called from an event handler. | |
112 bool (*NavigateToURL)(PP_Instance instance, | |
113 const char* url, | |
114 const char* target); | |
115 }; | |
116 | |
117 #endif // WEBKIT_GLUE_PLUGINS_PPB_FLASH_H_ | |
OLD | NEW |