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 | 5 |
| 6 /* From private/ppb_flash.idl modified Wed Dec 14 13:56:17 2011. */ |
| 7 |
6 #ifndef PPAPI_C_PRIVATE_PPB_FLASH_H_ | 8 #ifndef PPAPI_C_PRIVATE_PPB_FLASH_H_ |
7 #define PPAPI_C_PRIVATE_PPB_FLASH_H_ | 9 #define PPAPI_C_PRIVATE_PPB_FLASH_H_ |
8 | 10 |
| 11 #include "ppapi/c/dev/ppb_font_dev.h" |
9 #include "ppapi/c/pp_bool.h" | 12 #include "ppapi/c/pp_bool.h" |
10 #include "ppapi/c/pp_instance.h" | 13 #include "ppapi/c/pp_instance.h" |
| 14 #include "ppapi/c/pp_macros.h" |
11 #include "ppapi/c/pp_module.h" | 15 #include "ppapi/c/pp_module.h" |
12 #include "ppapi/c/pp_point.h" | 16 #include "ppapi/c/pp_point.h" |
13 #include "ppapi/c/pp_rect.h" | 17 #include "ppapi/c/pp_rect.h" |
14 #include "ppapi/c/pp_resource.h" | 18 #include "ppapi/c/pp_resource.h" |
| 19 #include "ppapi/c/pp_size.h" |
| 20 #include "ppapi/c/pp_stdint.h" |
15 #include "ppapi/c/pp_time.h" | 21 #include "ppapi/c/pp_time.h" |
16 #include "ppapi/c/pp_var.h" | 22 #include "ppapi/c/pp_var.h" |
17 | 23 |
18 #define PPB_FLASH_INTERFACE "PPB_Flash;11" | 24 #define PPB_FLASH_INTERFACE_12_0 "PPB_Flash;12.0" |
| 25 #define PPB_FLASH_INTERFACE PPB_FLASH_INTERFACE_12_0 |
19 | 26 |
20 /** | 27 /** |
21 * @file | 28 * @file |
22 * This file contains the <code>PPB_Flash</code> interface. | 29 * This file contains the <code>PPB_Flash</code> interface. |
23 */ | 30 */ |
24 | 31 |
25 | 32 |
26 /** | 33 /** |
27 * @addtogroup Interfaces | 34 * @addtogroup Interfaces |
28 * @{ | 35 * @{ |
29 */ | 36 */ |
30 /** | 37 /** |
31 * The <code>PPB_Flash</code> interface contains pointers to various functions | 38 * The <code>PPB_Flash</code> interface contains pointers to various functions |
32 * that are only needed to support Pepper Flash. | 39 * that are only needed to support Pepper Flash. |
33 */ | 40 */ |
34 struct PPB_Flash { | 41 struct PPB_Flash { |
35 /** | 42 /** |
36 * Sets or clears the rendering hint that the given plugin instance is always | 43 * Sets or clears the rendering hint that the given plugin instance is always |
37 * on top of page content. Somewhat more optimized painting can be used in | 44 * on top of page content. Somewhat more optimized painting can be used in |
38 * this case. | 45 * this case. |
39 */ | 46 */ |
40 void (*SetInstanceAlwaysOnTop)(PP_Instance instance, PP_Bool on_top); | 47 void (*SetInstanceAlwaysOnTop)(PP_Instance instance, PP_Bool on_top); |
| 48 /** |
| 49 * Draws the given pre-laid-out text. It is almost equivalent to Windows' |
| 50 * ExtTextOut with the addition of the transformation (a 3x3 matrix given the |
| 51 * transform to apply before drawing). It also adds the allow_subpixel_aa |
| 52 * flag which when true, will use subpixel antialiasing if enabled in the |
| 53 * system settings. For this to work properly, the graphics layer that the |
| 54 * text is being drawn into must be opaque. |
| 55 */ |
41 PP_Bool (*DrawGlyphs)(PP_Instance instance, | 56 PP_Bool (*DrawGlyphs)(PP_Instance instance, |
42 PP_Resource pp_image_data, | 57 PP_Resource pp_image_data, |
43 const struct PP_FontDescription_Dev* font_desc, | 58 const struct PP_FontDescription_Dev* font_desc, |
44 uint32_t color, | 59 uint32_t color, |
45 struct PP_Point position, | 60 const struct PP_Point* position, |
46 struct PP_Rect clip, | 61 const struct PP_Rect* clip, |
47 const float transformation[3][3], | 62 const float transformation[3][3], |
| 63 PP_Bool allow_subpixel_aa, |
48 uint32_t glyph_count, | 64 uint32_t glyph_count, |
49 const uint16_t glyph_indices[], | 65 const uint16_t glyph_indices[], |
50 const struct PP_Point glyph_advances[]); | 66 const struct PP_Point glyph_advances[]); |
51 /** | 67 /** |
52 * Retrieves the proxy that will be used for the given URL. The result will | 68 * Retrieves the proxy that will be used for the given URL. The result will |
53 * be a string in PAC format, or an undefined var on error. | 69 * be a string in PAC format, or an undefined var on error. |
54 */ | 70 */ |
55 struct PP_Var (*GetProxyForURL)(PP_Instance instance, const char* url); | 71 struct PP_Var (*GetProxyForURL)(PP_Instance instance, const char* url); |
56 /** | 72 /** |
57 * Navigate to the URL given by the given URLRequestInfo. (This supports GETs, | 73 * Navigate to the URL given by the given URLRequestInfo. (This supports GETs, |
58 * POSTs, and javascript: URLs.) May open a new tab if target is not "_self". | 74 * POSTs, and javascript: URLs.) May open a new tab if target is not "_self". |
59 */ | 75 */ |
60 int32_t (*Navigate)(PP_Resource request_info, | 76 int32_t (*Navigate)(PP_Resource request_info, |
61 const char* target, | 77 const char* target, |
62 bool from_user_action); | 78 PP_Bool from_user_action); |
63 /** | 79 /** |
64 * Runs a nested message loop. The plugin will be reentered from this call. | 80 * Runs a nested message loop. The plugin will be reentered from this call. |
65 * This function is used in places where Flash would normally enter a nested | 81 * This function is used in places where Flash would normally enter a nested |
66 * message loop (e.g., when displaying context menus), but Pepper provides | 82 * message loop (e.g., when displaying context menus), but Pepper provides |
67 * only an asynchronous call. After performing that asynchronous call, call | 83 * only an asynchronous call. After performing that asynchronous call, call |
68 * |RunMessageLoop()|. In the callback, call |QuitMessageLoop()|. | 84 * |RunMessageLoop()|. In the callback, call |QuitMessageLoop()|. |
69 */ | 85 */ |
70 void (*RunMessageLoop)(PP_Instance instance); | 86 void (*RunMessageLoop)(PP_Instance instance); |
71 /** | 87 /* Posts a quit message for the outermost nested message loop. Use this to |
72 * Posts a quit message for the outermost nested message loop. Use this to | |
73 * exit and return back to the caller after you call RunMessageLoop. | 88 * exit and return back to the caller after you call RunMessageLoop. |
74 */ | 89 */ |
75 void (*QuitMessageLoop)(PP_Instance instance); | 90 void (*QuitMessageLoop)(PP_Instance instance); |
76 /** | 91 /** |
77 * Retrieves the local time zone offset from GM time for the given UTC time. | 92 * Retrieves the local time zone offset from GM time for the given UTC time. |
78 */ | 93 */ |
79 double (*GetLocalTimeZoneOffset)(PP_Instance instance, PP_Time t); | 94 double (*GetLocalTimeZoneOffset)(PP_Instance instance, PP_Time t); |
80 /** | 95 /** |
81 * Gets a (string) with "command-line" options for Flash; used to pass | 96 * Gets a (string) with "command-line" options for Flash; used to pass |
82 * run-time debugging parameters, etc. | 97 * run-time debugging parameters, etc. |
83 */ | 98 */ |
84 struct PP_Var (*GetCommandLineArgs)(PP_Module module); | 99 struct PP_Var (*GetCommandLineArgs)(PP_Module module); |
| 100 /** |
| 101 * Loads the given font in a more priviledged process on Windows. Call this if |
| 102 * Windows is giving errors for font calls. See |
| 103 * content/renderer/font_cache_dispatcher_win.cc |
| 104 * |
| 105 * The parameter is a pointer to a LOGFONTW structure. |
| 106 * |
| 107 * On non-Windows platforms, this function does nothing. |
| 108 */ |
| 109 void (*PreloadFontWin)(const void* logfontw); |
85 }; | 110 }; |
86 /** | 111 /** |
87 * @} | 112 * @} |
88 */ | 113 */ |
89 | 114 |
| 115 /** |
| 116 * The old version of the interface, which cannot be generated from IDL. |
| 117 * TODO(viettrungluu): Remove this when enough time has passed. crbug.com/104184 |
| 118 */ |
| 119 #define PPB_FLASH_INTERFACE_11_0 "PPB_Flash;11" |
| 120 struct PPB_Flash_11 { |
| 121 void (*SetInstanceAlwaysOnTop)(PP_Instance instance, PP_Bool on_top); |
| 122 PP_Bool (*DrawGlyphs)(PP_Instance instance, |
| 123 PP_Resource pp_image_data, |
| 124 const struct PP_FontDescription_Dev* font_desc, |
| 125 uint32_t color, |
| 126 struct PP_Point position, |
| 127 struct PP_Rect clip, |
| 128 const float transformation[3][3], |
| 129 uint32_t glyph_count, |
| 130 const uint16_t glyph_indices[], |
| 131 const struct PP_Point glyph_advances[]); |
| 132 struct PP_Var (*GetProxyForURL)(PP_Instance instance, const char* url); |
| 133 int32_t (*Navigate)(PP_Resource request_info, |
| 134 const char* target, |
| 135 bool from_user_action); |
| 136 void (*RunMessageLoop)(PP_Instance instance); |
| 137 void (*QuitMessageLoop)(PP_Instance instance); |
| 138 double (*GetLocalTimeZoneOffset)(PP_Instance instance, PP_Time t); |
| 139 struct PP_Var (*GetCommandLineArgs)(PP_Module module); |
| 140 }; |
90 #endif /* PPAPI_C_PRIVATE_PPB_FLASH_H_ */ | 141 #endif /* PPAPI_C_PRIVATE_PPB_FLASH_H_ */ |
| 142 |
OLD | NEW |