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.
6 /* From private/ppb_flash.idl modified Thu Mar 28 10:30:53 2013. */
8 #ifndef PPAPI_C_PRIVATE_PPB_FLASH_H_
9 #define PPAPI_C_PRIVATE_PPB_FLASH_H_
11 #include "ppapi/c/pp_array_output.h"
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"
23 #include "ppapi/c/trusted/ppb_browser_font_trusted.h"
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
33 * This file contains the <code>PPB_Flash</code> interface.
43 * No restrictions on Flash LSOs.
45 PP_FLASHLSORESTRICTIONS_NONE
= 1,
47 * Don't allow access to Flash LSOs.
49 PP_FLASHLSORESTRICTIONS_BLOCK
= 2,
51 * Store Flash LSOs in memory only.
53 PP_FLASHLSORESTRICTIONS_IN_MEMORY
= 3
54 } PP_FlashLSORestrictions
;
55 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_FlashLSORestrictions
, 4);
59 * Specifies if the system likely supports 3D hardware acceleration.
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.
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.
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
73 PP_FLASHSETTING_3DENABLED
= 1,
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.
79 PP_FLASHSETTING_INCOGNITO
= 2,
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).
84 * This should only be enabled if PP_FLASHSETTING_3DENABLED is true.
86 PP_FLASHSETTING_STAGE3DENABLED
= 3,
88 * Specifies the string for the language code of the UI of the browser.
90 * For example: "en-US" or "de".
92 * Returns an undefined PP_Var on invalid instance.
94 PP_FLASHSETTING_LANGUAGE
= 4,
96 * Specifies the number of CPU cores that are present on the system.
98 PP_FLASHSETTING_NUMCORES
= 5,
100 * Specifies restrictions on how flash should handle LSOs. The result is an
101 * int from <code>PP_FlashLSORestrictions</code>.
103 PP_FLASHSETTING_LSORESTRICTIONS
= 6,
105 * Specifies if the driver is reliable enough to use Shader Model 3 commands
108 * This should only be enabled if PP_FLASHSETTING_STAGE3DENABLED is true.
110 PP_FLASHSETTING_STAGE3DBASELINEENABLED
= 7
112 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_FlashSetting
, 4);
115 * This enum provides keys for setting breakpad crash report data.
119 * Specifies the document URL which contains the flash instance.
121 PP_FLASHCRASHKEY_URL
= 1
123 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_FlashCrashKey
, 4);
129 * @addtogroup Interfaces
133 * The <code>PPB_Flash</code> interface contains pointers to various functions
134 * that are only needed to support Pepper Flash.
136 struct PPB_Flash_13_0
{
138 * Sets or clears the rendering hint that the given plugin instance is always
139 * on top of page content. Somewhat more optimized painting can be used in
142 void (*SetInstanceAlwaysOnTop
)(PP_Instance instance
, PP_Bool on_top
);
144 * Draws the given pre-laid-out text. It is almost equivalent to Windows'
145 * ExtTextOut with the addition of the transformation (a 3x3 matrix given the
146 * transform to apply before drawing). It also adds the allow_subpixel_aa
147 * flag which when true, will use subpixel antialiasing if enabled in the
148 * system settings. For this to work properly, the graphics layer that the
149 * text is being drawn into must be opaque.
151 PP_Bool (*DrawGlyphs
)(
152 PP_Instance instance
,
153 PP_Resource pp_image_data
,
154 const struct PP_BrowserFont_Trusted_Description
* font_desc
,
156 const struct PP_Point
* position
,
157 const struct PP_Rect
* clip
,
158 const float transformation
[3][3],
159 PP_Bool allow_subpixel_aa
,
160 uint32_t glyph_count
,
161 const uint16_t glyph_indices
[],
162 const struct PP_Point glyph_advances
[]);
164 * Retrieves the proxy that will be used for the given URL. The result will
165 * be a string in PAC format, or an undefined var on error.
167 struct PP_Var (*GetProxyForURL
)(PP_Instance instance
, const char* url
);
169 * Navigate to the URL given by the given URLRequestInfo. (This supports GETs,
170 * POSTs, and javascript: URLs.) May open a new tab if target is not "_self".
172 int32_t (*Navigate
)(PP_Resource request_info
,
174 PP_Bool from_user_action
);
176 * Retrieves the local time zone offset from GM time for the given UTC time.
178 double (*GetLocalTimeZoneOffset
)(PP_Instance instance
, PP_Time t
);
180 * Gets a (string) with "command-line" options for Flash; used to pass
181 * run-time debugging parameters, etc.
183 struct PP_Var (*GetCommandLineArgs
)(PP_Module module
);
185 * Loads the given font in a more privileged process on Windows. Call this if
186 * Windows is giving errors for font calls. See
187 * content/renderer/font_cache_dispatcher_win.cc
189 * The parameter is a pointer to a LOGFONTW structure.
191 * On non-Windows platforms, this function does nothing.
193 void (*PreloadFontWin
)(const void* logfontw
);
195 * Returns whether the given rectangle (in the plugin) is topmost, i.e., above
196 * all other web content.
198 PP_Bool (*IsRectTopmost
)(PP_Instance instance
, const struct PP_Rect
* rect
);
200 * Indicates that there's activity and, e.g., the screensaver shouldn't kick
203 void (*UpdateActivity
)(PP_Instance instance
);
205 * Returns the value associated with the given setting. Invalid enums will
206 * result in an undefined PP_Var return value.
208 struct PP_Var (*GetSetting
)(PP_Instance instance
, PP_FlashSetting setting
);
210 * Allows setting breakpad crash data which will be included in plugin crash
211 * reports. Returns PP_FALSE if crash data could not be set.
213 PP_Bool (*SetCrashData
)(PP_Instance instance
,
214 PP_FlashCrashKey key
,
215 struct PP_Var value
);
217 * Enumerates video capture devices. |video_capture| is a valid
218 * PPB_VideoCapture_Dev resource. Once the operation has completed
219 * successfully, |devices| will be set up with an array of
220 * PPB_DeviceRef_Dev resources.
222 * PP_OK is returned on success and different pepper error code on failure.
223 * The ref count of the returned |devices| has already been increased by 1 for
226 * NOTE: This method is a synchronous version of |EnumerateDevices| in
227 * PPB_VideoCapture_Dev.
229 int32_t (*EnumerateVideoCaptureDevices
)(PP_Instance instance
,
230 PP_Resource video_capture
,
231 struct PP_ArrayOutput devices
);
234 typedef struct PPB_Flash_13_0 PPB_Flash
;
236 struct PPB_Flash_12_4
{
237 void (*SetInstanceAlwaysOnTop
)(PP_Instance instance
, PP_Bool on_top
);
238 PP_Bool (*DrawGlyphs
)(
239 PP_Instance instance
,
240 PP_Resource pp_image_data
,
241 const struct PP_BrowserFont_Trusted_Description
* font_desc
,
243 const struct PP_Point
* position
,
244 const struct PP_Rect
* clip
,
245 const float transformation
[3][3],
246 PP_Bool allow_subpixel_aa
,
247 uint32_t glyph_count
,
248 const uint16_t glyph_indices
[],
249 const struct PP_Point glyph_advances
[]);
250 struct PP_Var (*GetProxyForURL
)(PP_Instance instance
, const char* url
);
251 int32_t (*Navigate
)(PP_Resource request_info
,
253 PP_Bool from_user_action
);
254 void (*RunMessageLoop
)(PP_Instance instance
);
255 void (*QuitMessageLoop
)(PP_Instance instance
);
256 double (*GetLocalTimeZoneOffset
)(PP_Instance instance
, PP_Time t
);
257 struct PP_Var (*GetCommandLineArgs
)(PP_Module module
);
258 void (*PreloadFontWin
)(const void* logfontw
);
259 PP_Bool (*IsRectTopmost
)(PP_Instance instance
, const struct PP_Rect
* rect
);
260 int32_t (*InvokePrinting
)(PP_Instance instance
);
261 void (*UpdateActivity
)(PP_Instance instance
);
262 struct PP_Var (*GetDeviceID
)(PP_Instance instance
);
263 int32_t (*GetSettingInt
)(PP_Instance instance
, PP_FlashSetting setting
);
264 struct PP_Var (*GetSetting
)(PP_Instance instance
, PP_FlashSetting setting
);
267 struct PPB_Flash_12_5
{
268 void (*SetInstanceAlwaysOnTop
)(PP_Instance instance
, PP_Bool on_top
);
269 PP_Bool (*DrawGlyphs
)(
270 PP_Instance instance
,
271 PP_Resource pp_image_data
,
272 const struct PP_BrowserFont_Trusted_Description
* font_desc
,
274 const struct PP_Point
* position
,
275 const struct PP_Rect
* clip
,
276 const float transformation
[3][3],
277 PP_Bool allow_subpixel_aa
,
278 uint32_t glyph_count
,
279 const uint16_t glyph_indices
[],
280 const struct PP_Point glyph_advances
[]);
281 struct PP_Var (*GetProxyForURL
)(PP_Instance instance
, const char* url
);
282 int32_t (*Navigate
)(PP_Resource request_info
,
284 PP_Bool from_user_action
);
285 void (*RunMessageLoop
)(PP_Instance instance
);
286 void (*QuitMessageLoop
)(PP_Instance instance
);
287 double (*GetLocalTimeZoneOffset
)(PP_Instance instance
, PP_Time t
);
288 struct PP_Var (*GetCommandLineArgs
)(PP_Module module
);
289 void (*PreloadFontWin
)(const void* logfontw
);
290 PP_Bool (*IsRectTopmost
)(PP_Instance instance
, const struct PP_Rect
* rect
);
291 int32_t (*InvokePrinting
)(PP_Instance instance
);
292 void (*UpdateActivity
)(PP_Instance instance
);
293 struct PP_Var (*GetDeviceID
)(PP_Instance instance
);
294 int32_t (*GetSettingInt
)(PP_Instance instance
, PP_FlashSetting setting
);
295 struct PP_Var (*GetSetting
)(PP_Instance instance
, PP_FlashSetting setting
);
296 PP_Bool (*SetCrashData
)(PP_Instance instance
,
297 PP_FlashCrashKey key
,
298 struct PP_Var value
);
301 struct PPB_Flash_12_6
{
302 void (*SetInstanceAlwaysOnTop
)(PP_Instance instance
, PP_Bool on_top
);
303 PP_Bool (*DrawGlyphs
)(
304 PP_Instance instance
,
305 PP_Resource pp_image_data
,
306 const struct PP_BrowserFont_Trusted_Description
* font_desc
,
308 const struct PP_Point
* position
,
309 const struct PP_Rect
* clip
,
310 const float transformation
[3][3],
311 PP_Bool allow_subpixel_aa
,
312 uint32_t glyph_count
,
313 const uint16_t glyph_indices
[],
314 const struct PP_Point glyph_advances
[]);
315 struct PP_Var (*GetProxyForURL
)(PP_Instance instance
, const char* url
);
316 int32_t (*Navigate
)(PP_Resource request_info
,
318 PP_Bool from_user_action
);
319 void (*RunMessageLoop
)(PP_Instance instance
);
320 void (*QuitMessageLoop
)(PP_Instance instance
);
321 double (*GetLocalTimeZoneOffset
)(PP_Instance instance
, PP_Time t
);
322 struct PP_Var (*GetCommandLineArgs
)(PP_Module module
);
323 void (*PreloadFontWin
)(const void* logfontw
);
324 PP_Bool (*IsRectTopmost
)(PP_Instance instance
, const struct PP_Rect
* rect
);
325 int32_t (*InvokePrinting
)(PP_Instance instance
);
326 void (*UpdateActivity
)(PP_Instance instance
);
327 struct PP_Var (*GetDeviceID
)(PP_Instance instance
);
328 int32_t (*GetSettingInt
)(PP_Instance instance
, PP_FlashSetting setting
);
329 struct PP_Var (*GetSetting
)(PP_Instance instance
, PP_FlashSetting setting
);
330 PP_Bool (*SetCrashData
)(PP_Instance instance
,
331 PP_FlashCrashKey key
,
332 struct PP_Var value
);
333 int32_t (*EnumerateVideoCaptureDevices
)(PP_Instance instance
,
334 PP_Resource video_capture
,
335 struct PP_ArrayOutput devices
);
341 #endif /* PPAPI_C_PRIVATE_PPB_FLASH_H_ */