Pepper_47_C_interfaces
ppb_flash.h
Go to the documentation of this file.
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
3  * found in the LICENSE file.
4  */
5 
6 /* From private/ppb_flash.idl modified Thu Oct 20 13:57:04 2016. */
7 
8 #ifndef PPAPI_C_PRIVATE_PPB_FLASH_H_
9 #define PPAPI_C_PRIVATE_PPB_FLASH_H_
10 
12 #include "ppapi/c/pp_bool.h"
13 #include "ppapi/c/pp_instance.h"
14 #include "ppapi/c/pp_macros.h"
15 #include "ppapi/c/pp_module.h"
16 #include "ppapi/c/pp_point.h"
17 #include "ppapi/c/pp_rect.h"
18 #include "ppapi/c/pp_resource.h"
19 #include "ppapi/c/pp_size.h"
20 #include "ppapi/c/pp_stdint.h"
21 #include "ppapi/c/pp_time.h"
22 #include "ppapi/c/pp_var.h"
24 
25 #define PPB_FLASH_INTERFACE_12_4 "PPB_Flash;12.4"
26 #define PPB_FLASH_INTERFACE_12_5 "PPB_Flash;12.5"
27 #define PPB_FLASH_INTERFACE_12_6 "PPB_Flash;12.6"
28 #define PPB_FLASH_INTERFACE_13_0 "PPB_Flash;13.0"
29 #define PPB_FLASH_INTERFACE PPB_FLASH_INTERFACE_13_0
30 
31 /**
32  * @file
33  * This file contains the <code>PPB_Flash</code> interface.
34  */
35 
36 
37 /**
38  * @addtogroup Enums
39  * @{
40  */
41 typedef enum {
42  /**
43  * No restrictions on Flash LSOs.
44  */
46  /**
47  * Don't allow access to Flash LSOs.
48  */
50  /**
51  * Store Flash LSOs in memory only.
52  */
56 
57 typedef enum {
58  /**
59  * Specifies if the system likely supports 3D hardware acceleration.
60  *
61  * The result is a boolean PP_Var, depending on the supported nature of 3D
62  * acceleration. If querying this function returns true, the 3D system will
63  * normally use the native hardware for rendering which will be much faster.
64  *
65  * Having this set to true only means that 3D should be used to draw 2D and
66  * video elements. PP_FLASHSETTING_STAGE3D_ENABLED should be checked to
67  * determine if it's ok to use 3D for arbitrary content.
68  *
69  * In rare cases (depending on the platform) this value will be true but a
70  * created 3D context will use emulation because context initialization
71  * failed.
72  */
74  /**
75  * Specifies if the given instance is in private/incognito/off-the-record mode
76  * (returns true) or "regular" mode (returns false). Returns an undefined
77  * PP_Var on invalid instance.
78  */
80  /**
81  * Specifies if arbitrary 3d commands are supported (returns true), or if 3d
82  * should only be used for drawing 2d and video (returns false).
83  *
84  * This should only be enabled if PP_FLASHSETTING_3DENABLED is true.
85  */
87  /**
88  * Specifies the string for the language code of the UI of the browser.
89  *
90  * For example: "en-US" or "de".
91  *
92  * Returns an undefined PP_Var on invalid instance.
93  */
95  /**
96  * Specifies the number of CPU cores that are present on the system.
97  */
99  /**
100  * Specifies restrictions on how flash should handle LSOs. The result is an
101  * int from <code>PP_FlashLSORestrictions</code>.
102  */
104  /**
105  * Specifies if the driver is reliable enough to use Shader Model 3 commands
106  * with it.
107  *
108  * This should only be enabled if PP_FLASHSETTING_STAGE3DENABLED is true.
109  */
113 
114 /**
115  * This enum provides keys for setting breakpad crash report data.
116  */
117 typedef enum {
118  /**
119  * Specifies the document URL which contains the flash instance.
120  */
122  /**
123  * Specifies the URL of the current swf.
124  */
128 /**
129  * @}
130  */
131 
132 /**
133  * @addtogroup Interfaces
134  * @{
135  */
136 /**
137  * The <code>PPB_Flash</code> interface contains pointers to various functions
138  * that are only needed to support Pepper Flash.
139  */
141  /**
142  * Sets or clears the rendering hint that the given plugin instance is always
143  * on top of page content. Somewhat more optimized painting can be used in
144  * this case.
145  */
146  void (*SetInstanceAlwaysOnTop)(PP_Instance instance, PP_Bool on_top);
147  /**
148  * Draws the given pre-laid-out text. It is almost equivalent to Windows'
149  * ExtTextOut with the addition of the transformation (a 3x3 matrix given the
150  * transform to apply before drawing). It also adds the allow_subpixel_aa
151  * flag which when true, will use subpixel antialiasing if enabled in the
152  * system settings. For this to work properly, the graphics layer that the
153  * text is being drawn into must be opaque.
154  */
156  PP_Instance instance,
157  PP_Resource pp_image_data,
158  const struct PP_BrowserFont_Trusted_Description* font_desc,
159  uint32_t color,
160  const struct PP_Point* position,
161  const struct PP_Rect* clip,
162  const float transformation[3][3],
163  PP_Bool allow_subpixel_aa,
164  uint32_t glyph_count,
165  const uint16_t glyph_indices[],
166  const struct PP_Point glyph_advances[]);
167  /**
168  * Retrieves the proxy that will be used for the given URL. The result will
169  * be a string in PAC format, or an undefined var on error.
170  */
171  struct PP_Var (*GetProxyForURL)(PP_Instance instance, const char* url);
172  /**
173  * Navigate to the URL given by the given URLRequestInfo. (This supports GETs,
174  * POSTs, and javascript: URLs.) May open a new tab if target is not "_self".
175  */
176  int32_t (*Navigate)(PP_Resource request_info,
177  const char* target,
178  PP_Bool from_user_action);
179  /**
180  * Retrieves the local time zone offset from GM time for the given UTC time.
181  */
183  /**
184  * Gets a (string) with "command-line" options for Flash; used to pass
185  * run-time debugging parameters, etc.
186  */
188  /**
189  * Loads the given font in a more privileged process on Windows. Call this if
190  * Windows is giving errors for font calls. See
191  * content/renderer/font_cache_dispatcher_win.cc
192  *
193  * The parameter is a pointer to a LOGFONTW structure.
194  *
195  * On non-Windows platforms, this function does nothing.
196  */
197  void (*PreloadFontWin)(const void* logfontw);
198  /**
199  * Returns whether the given rectangle (in the plugin) is topmost, i.e., above
200  * all other web content.
201  */
202  PP_Bool (*IsRectTopmost)(PP_Instance instance, const struct PP_Rect* rect);
203  /**
204  * Indicates that there's activity and, e.g., the screensaver shouldn't kick
205  * in.
206  */
207  void (*UpdateActivity)(PP_Instance instance);
208  /**
209  * Returns the value associated with the given setting. Invalid enums will
210  * result in an undefined PP_Var return value.
211  */
212  struct PP_Var (*GetSetting)(PP_Instance instance, PP_FlashSetting setting);
213  /**
214  * Allows setting breakpad crash data which will be included in plugin crash
215  * reports. Returns PP_FALSE if crash data could not be set.
216  */
218  PP_FlashCrashKey key,
219  struct PP_Var value);
220  /**
221  * Enumerates video capture devices. |video_capture| is a valid
222  * PPB_VideoCapture_Dev resource. Once the operation has completed
223  * successfully, |devices| will be set up with an array of
224  * PPB_DeviceRef_Dev resources.
225  *
226  * PP_OK is returned on success and different pepper error code on failure.
227  * The ref count of the returned |devices| has already been increased by 1 for
228  * the caller.
229  *
230  * NOTE: This method is a synchronous version of |EnumerateDevices| in
231  * PPB_VideoCapture_Dev.
232  */
234  PP_Resource video_capture,
235  struct PP_ArrayOutput devices);
236 };
237 
238 typedef struct PPB_Flash_13_0 PPB_Flash;
239 
241  void (*SetInstanceAlwaysOnTop)(PP_Instance instance, PP_Bool on_top);
243  PP_Instance instance,
244  PP_Resource pp_image_data,
245  const struct PP_BrowserFont_Trusted_Description* font_desc,
246  uint32_t color,
247  const struct PP_Point* position,
248  const struct PP_Rect* clip,
249  const float transformation[3][3],
250  PP_Bool allow_subpixel_aa,
251  uint32_t glyph_count,
252  const uint16_t glyph_indices[],
253  const struct PP_Point glyph_advances[]);
254  struct PP_Var (*GetProxyForURL)(PP_Instance instance, const char* url);
255  int32_t (*Navigate)(PP_Resource request_info,
256  const char* target,
257  PP_Bool from_user_action);
258  void (*RunMessageLoop)(PP_Instance instance);
259  void (*QuitMessageLoop)(PP_Instance instance);
262  void (*PreloadFontWin)(const void* logfontw);
263  PP_Bool (*IsRectTopmost)(PP_Instance instance, const struct PP_Rect* rect);
264  int32_t (*InvokePrinting)(PP_Instance instance);
265  void (*UpdateActivity)(PP_Instance instance);
266  struct PP_Var (*GetDeviceID)(PP_Instance instance);
267  int32_t (*GetSettingInt)(PP_Instance instance, PP_FlashSetting setting);
268  struct PP_Var (*GetSetting)(PP_Instance instance, PP_FlashSetting setting);
269 };
270 
272  void (*SetInstanceAlwaysOnTop)(PP_Instance instance, PP_Bool on_top);
274  PP_Instance instance,
275  PP_Resource pp_image_data,
276  const struct PP_BrowserFont_Trusted_Description* font_desc,
277  uint32_t color,
278  const struct PP_Point* position,
279  const struct PP_Rect* clip,
280  const float transformation[3][3],
281  PP_Bool allow_subpixel_aa,
282  uint32_t glyph_count,
283  const uint16_t glyph_indices[],
284  const struct PP_Point glyph_advances[]);
285  struct PP_Var (*GetProxyForURL)(PP_Instance instance, const char* url);
286  int32_t (*Navigate)(PP_Resource request_info,
287  const char* target,
288  PP_Bool from_user_action);
289  void (*RunMessageLoop)(PP_Instance instance);
290  void (*QuitMessageLoop)(PP_Instance instance);
293  void (*PreloadFontWin)(const void* logfontw);
294  PP_Bool (*IsRectTopmost)(PP_Instance instance, const struct PP_Rect* rect);
295  int32_t (*InvokePrinting)(PP_Instance instance);
296  void (*UpdateActivity)(PP_Instance instance);
297  struct PP_Var (*GetDeviceID)(PP_Instance instance);
298  int32_t (*GetSettingInt)(PP_Instance instance, PP_FlashSetting setting);
299  struct PP_Var (*GetSetting)(PP_Instance instance, PP_FlashSetting setting);
301  PP_FlashCrashKey key,
302  struct PP_Var value);
303 };
304 
306  void (*SetInstanceAlwaysOnTop)(PP_Instance instance, PP_Bool on_top);
308  PP_Instance instance,
309  PP_Resource pp_image_data,
310  const struct PP_BrowserFont_Trusted_Description* font_desc,
311  uint32_t color,
312  const struct PP_Point* position,
313  const struct PP_Rect* clip,
314  const float transformation[3][3],
315  PP_Bool allow_subpixel_aa,
316  uint32_t glyph_count,
317  const uint16_t glyph_indices[],
318  const struct PP_Point glyph_advances[]);
319  struct PP_Var (*GetProxyForURL)(PP_Instance instance, const char* url);
320  int32_t (*Navigate)(PP_Resource request_info,
321  const char* target,
322  PP_Bool from_user_action);
323  void (*RunMessageLoop)(PP_Instance instance);
324  void (*QuitMessageLoop)(PP_Instance instance);
327  void (*PreloadFontWin)(const void* logfontw);
328  PP_Bool (*IsRectTopmost)(PP_Instance instance, const struct PP_Rect* rect);
329  int32_t (*InvokePrinting)(PP_Instance instance);
330  void (*UpdateActivity)(PP_Instance instance);
331  struct PP_Var (*GetDeviceID)(PP_Instance instance);
332  int32_t (*GetSettingInt)(PP_Instance instance, PP_FlashSetting setting);
333  struct PP_Var (*GetSetting)(PP_Instance instance, PP_FlashSetting setting);
335  PP_FlashCrashKey key,
336  struct PP_Var value);
338  PP_Resource video_capture,
339  struct PP_ArrayOutput devices);
340 };
341 /**
342  * @}
343  */
344 
345 #endif /* PPAPI_C_PRIVATE_PPB_FLASH_H_ */
346 
int32_t(* EnumerateVideoCaptureDevices)(PP_Instance instance, PP_Resource video_capture, struct PP_ArrayOutput devices)
Definition: ppb_flash.h:337
struct PP_Var(* GetSetting)(PP_Instance instance, PP_FlashSetting setting)
Definition: ppb_flash.h:268
struct PP_Var(* GetDeviceID)(PP_Instance instance)
Definition: ppb_flash.h:297
PP_Bool(* DrawGlyphs)(PP_Instance instance, PP_Resource pp_image_data, const struct PP_BrowserFont_Trusted_Description *font_desc, uint32_t color, const struct PP_Point *position, const struct PP_Rect *clip, const float transformation[3][3], PP_Bool allow_subpixel_aa, uint32_t glyph_count, const uint16_t glyph_indices[], const struct PP_Point glyph_advances[])
Definition: ppb_flash.h:155
double PP_Time
Definition: pp_time.h:29
PP_Bool(* DrawGlyphs)(PP_Instance instance, PP_Resource pp_image_data, const struct PP_BrowserFont_Trusted_Description *font_desc, uint32_t color, const struct PP_Point *position, const struct PP_Rect *clip, const float transformation[3][3], PP_Bool allow_subpixel_aa, uint32_t glyph_count, const uint16_t glyph_indices[], const struct PP_Point glyph_advances[])
Definition: ppb_flash.h:273
void(* PreloadFontWin)(const void *logfontw)
Definition: ppb_flash.h:327
struct PP_Var(* GetDeviceID)(PP_Instance instance)
Definition: ppb_flash.h:266
PP_FlashLSORestrictions
Definition: ppb_flash.h:41
void(* UpdateActivity)(PP_Instance instance)
Definition: ppb_flash.h:265
int32_t(* Navigate)(PP_Resource request_info, const char *target, PP_Bool from_user_action)
Definition: ppb_flash.h:286
PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_FlashLSORestrictions, 4)
void(* SetInstanceAlwaysOnTop)(PP_Instance instance, PP_Bool on_top)
Definition: ppb_flash.h:241
PP_Bool(* DrawGlyphs)(PP_Instance instance, PP_Resource pp_image_data, const struct PP_BrowserFont_Trusted_Description *font_desc, uint32_t color, const struct PP_Point *position, const struct PP_Rect *clip, const float transformation[3][3], PP_Bool allow_subpixel_aa, uint32_t glyph_count, const uint16_t glyph_indices[], const struct PP_Point glyph_advances[])
Definition: ppb_flash.h:307
PP_Bool(* IsRectTopmost)(PP_Instance instance, const struct PP_Rect *rect)
Definition: ppb_flash.h:202
int32_t PP_Module
Definition: pp_module.h:32
struct PP_Var(* GetDeviceID)(PP_Instance instance)
Definition: ppb_flash.h:331
void(* UpdateActivity)(PP_Instance instance)
Definition: ppb_flash.h:330
void(* QuitMessageLoop)(PP_Instance instance)
Definition: ppb_flash.h:259
int32_t(* GetSettingInt)(PP_Instance instance, PP_FlashSetting setting)
Definition: ppb_flash.h:332
struct PP_Var(* GetProxyForURL)(PP_Instance instance, const char *url)
Definition: ppb_flash.h:319
void(* RunMessageLoop)(PP_Instance instance)
Definition: ppb_flash.h:258
double(* GetLocalTimeZoneOffset)(PP_Instance instance, PP_Time t)
Definition: ppb_flash.h:182
PP_FlashSetting
Definition: ppb_flash.h:57
struct PP_Var(* GetSetting)(PP_Instance instance, PP_FlashSetting setting)
Definition: ppb_flash.h:299
int32_t PP_Resource
Definition: pp_resource.h:40
double(* GetLocalTimeZoneOffset)(PP_Instance instance, PP_Time t)
Definition: ppb_flash.h:325
void(* PreloadFontWin)(const void *logfontw)
Definition: ppb_flash.h:197
PP_FlashCrashKey
Definition: ppb_flash.h:117
PP_Bool(* IsRectTopmost)(PP_Instance instance, const struct PP_Rect *rect)
Definition: ppb_flash.h:294
int32_t(* GetSettingInt)(PP_Instance instance, PP_FlashSetting setting)
Definition: ppb_flash.h:267
void(* UpdateActivity)(PP_Instance instance)
Definition: ppb_flash.h:296
int32_t(* Navigate)(PP_Resource request_info, const char *target, PP_Bool from_user_action)
Definition: ppb_flash.h:176
int32_t(* GetSettingInt)(PP_Instance instance, PP_FlashSetting setting)
Definition: ppb_flash.h:298
struct PP_Var(* GetProxyForURL)(PP_Instance instance, const char *url)
Definition: ppb_flash.h:171
void(* QuitMessageLoop)(PP_Instance instance)
Definition: ppb_flash.h:290
int32_t(* Navigate)(PP_Resource request_info, const char *target, PP_Bool from_user_action)
Definition: ppb_flash.h:320
void(* PreloadFontWin)(const void *logfontw)
Definition: ppb_flash.h:293
void(* RunMessageLoop)(PP_Instance instance)
Definition: ppb_flash.h:289
union PP_VarValue value
Definition: pp_var.h:180
struct PP_Var(* GetSetting)(PP_Instance instance, PP_FlashSetting setting)
Definition: ppb_flash.h:212
double(* GetLocalTimeZoneOffset)(PP_Instance instance, PP_Time t)
Definition: ppb_flash.h:260
void(* PreloadFontWin)(const void *logfontw)
Definition: ppb_flash.h:262
void(* SetInstanceAlwaysOnTop)(PP_Instance instance, PP_Bool on_top)
Definition: ppb_flash.h:272
PP_Bool(* SetCrashData)(PP_Instance instance, PP_FlashCrashKey key, struct PP_Var value)
Definition: ppb_flash.h:334
Definition: pp_var.h:166
void(* QuitMessageLoop)(PP_Instance instance)
Definition: ppb_flash.h:324
PP_Bool(* IsRectTopmost)(PP_Instance instance, const struct PP_Rect *rect)
Definition: ppb_flash.h:328
int32_t PP_Instance
Definition: pp_instance.h:34
struct PP_Var(* GetSetting)(PP_Instance instance, PP_FlashSetting setting)
Definition: ppb_flash.h:333
void(* SetInstanceAlwaysOnTop)(PP_Instance instance, PP_Bool on_top)
Definition: ppb_flash.h:146
struct PP_Var(* GetCommandLineArgs)(PP_Module module)
Definition: ppb_flash.h:261
struct PP_Var(* GetProxyForURL)(PP_Instance instance, const char *url)
Definition: ppb_flash.h:254
void(* SetInstanceAlwaysOnTop)(PP_Instance instance, PP_Bool on_top)
Definition: ppb_flash.h:306
void(* UpdateActivity)(PP_Instance instance)
Definition: ppb_flash.h:207
PP_Bool(* SetCrashData)(PP_Instance instance, PP_FlashCrashKey key, struct PP_Var value)
Definition: ppb_flash.h:300
int32_t(* InvokePrinting)(PP_Instance instance)
Definition: ppb_flash.h:329
int32_t(* Navigate)(PP_Resource request_info, const char *target, PP_Bool from_user_action)
Definition: ppb_flash.h:255
PP_Bool
Definition: pp_bool.h:30
void(* RunMessageLoop)(PP_Instance instance)
Definition: ppb_flash.h:323
int32_t(* InvokePrinting)(PP_Instance instance)
Definition: ppb_flash.h:264
PP_Bool(* DrawGlyphs)(PP_Instance instance, PP_Resource pp_image_data, const struct PP_BrowserFont_Trusted_Description *font_desc, uint32_t color, const struct PP_Point *position, const struct PP_Rect *clip, const float transformation[3][3], PP_Bool allow_subpixel_aa, uint32_t glyph_count, const uint16_t glyph_indices[], const struct PP_Point glyph_advances[])
Definition: ppb_flash.h:242
struct PP_Var(* GetCommandLineArgs)(PP_Module module)
Definition: ppb_flash.h:187
double(* GetLocalTimeZoneOffset)(PP_Instance instance, PP_Time t)
Definition: ppb_flash.h:291
struct PP_Var(* GetCommandLineArgs)(PP_Module module)
Definition: ppb_flash.h:326
PP_Bool(* SetCrashData)(PP_Instance instance, PP_FlashCrashKey key, struct PP_Var value)
Definition: ppb_flash.h:217
PP_Bool(* IsRectTopmost)(PP_Instance instance, const struct PP_Rect *rect)
Definition: ppb_flash.h:263
int32_t(* InvokePrinting)(PP_Instance instance)
Definition: ppb_flash.h:295
int32_t(* EnumerateVideoCaptureDevices)(PP_Instance instance, PP_Resource video_capture, struct PP_ArrayOutput devices)
Definition: ppb_flash.h:233
struct PP_Var(* GetProxyForURL)(PP_Instance instance, const char *url)
Definition: ppb_flash.h:285
struct PP_Var(* GetCommandLineArgs)(PP_Module module)
Definition: ppb_flash.h:292