OLD | NEW |
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 ppb_view.idl modified Fri Feb 17 09:09:15 2012. */ | 6 /* From ppb_view.idl modified Thu Mar 21 11:28:20 2013. */ |
7 | 7 |
8 #ifndef PPAPI_C_PPB_VIEW_H_ | 8 #ifndef PPAPI_C_PPB_VIEW_H_ |
9 #define PPAPI_C_PPB_VIEW_H_ | 9 #define PPAPI_C_PPB_VIEW_H_ |
10 | 10 |
11 #include "ppapi/c/pp_bool.h" | 11 #include "ppapi/c/pp_bool.h" |
12 #include "ppapi/c/pp_macros.h" | 12 #include "ppapi/c/pp_macros.h" |
13 #include "ppapi/c/pp_point.h" | 13 #include "ppapi/c/pp_point.h" |
14 #include "ppapi/c/pp_rect.h" | 14 #include "ppapi/c/pp_rect.h" |
15 #include "ppapi/c/pp_resource.h" | 15 #include "ppapi/c/pp_resource.h" |
16 #include "ppapi/c/pp_size.h" | 16 #include "ppapi/c/pp_size.h" |
17 #include "ppapi/c/pp_stdint.h" | 17 #include "ppapi/c/pp_stdint.h" |
18 | 18 |
19 #define PPB_VIEW_INTERFACE_1_0 "PPB_View;1.0" | 19 #define PPB_VIEW_INTERFACE_1_0 "PPB_View;1.0" |
20 #define PPB_VIEW_INTERFACE PPB_VIEW_INTERFACE_1_0 | 20 #define PPB_VIEW_INTERFACE_1_1 "PPB_View;1.1" |
| 21 #define PPB_VIEW_INTERFACE PPB_VIEW_INTERFACE_1_1 |
21 | 22 |
22 /** | 23 /** |
23 * @file | 24 * @file |
24 * This file defines the <code>PPB_View</code> struct representing the state | 25 * This file defines the <code>PPB_View</code> struct representing the state |
25 * of the view of an instance. | 26 * of the view of an instance. |
26 */ | 27 */ |
27 | 28 |
28 | 29 |
29 /** | 30 /** |
30 * @addtogroup Interfaces | 31 * @addtogroup Interfaces |
31 * @{ | 32 * @{ |
32 */ | 33 */ |
33 /** | 34 /** |
34 * <code>PPB_View</code> represents the state of the view of an instance. | 35 * <code>PPB_View</code> represents the state of the view of an instance. |
35 * You will receive new view information using | 36 * You will receive new view information using |
36 * <code>PPP_Instance.DidChangeView</code>. | 37 * <code>PPP_Instance.DidChangeView</code>. |
37 */ | 38 */ |
38 struct PPB_View_1_0 { | 39 struct PPB_View_1_1 { |
39 /** | 40 /** |
40 * IsView() determines if the given resource is a valid | 41 * IsView() determines if the given resource is a valid |
41 * <code>PPB_View</code> resource. Note that <code>PPB_ViewChanged</code> | 42 * <code>PPB_View</code> resource. Note that <code>PPB_ViewChanged</code> |
42 * resources derive from <code>PPB_View</code> and will return true here | 43 * resources derive from <code>PPB_View</code> and will return true here |
43 * as well. | 44 * as well. |
44 * | 45 * |
45 * @param resource A <code>PP_Resource</code> corresponding to a | 46 * @param resource A <code>PP_Resource</code> corresponding to a |
46 * <code>PPB_View</code> resource. | 47 * <code>PPB_View</code> resource. |
47 * | 48 * |
48 * @return <code>PP_TRUE</code> if the given resource supports | 49 * @return <code>PP_TRUE</code> if the given resource supports |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 * | 161 * |
161 * @param resource A <code>PP_Resource</code> corresponding to a | 162 * @param resource A <code>PP_Resource</code> corresponding to a |
162 * <code>PPB_View</code> resource. | 163 * <code>PPB_View</code> resource. |
163 * | 164 * |
164 * @param clip Output argument receiving the clip rect on success. | 165 * @param clip Output argument receiving the clip rect on success. |
165 * | 166 * |
166 * @return Returns <code>PP_TRUE</code> if the resource was valid and the | 167 * @return Returns <code>PP_TRUE</code> if the resource was valid and the |
167 * clip rect was filled in, <code>PP_FALSE</code> if not. | 168 * clip rect was filled in, <code>PP_FALSE</code> if not. |
168 */ | 169 */ |
169 PP_Bool (*GetClipRect)(PP_Resource resource, struct PP_Rect* clip); | 170 PP_Bool (*GetClipRect)(PP_Resource resource, struct PP_Rect* clip); |
| 171 /** |
| 172 * GetDeviceScale returns the scale factor between device pixels and DIPs |
| 173 * (also known as logical pixels or UI pixels on some platforms). This allows |
| 174 * the developer to render their contents at device resolution, even as |
| 175 * coordinates / sizes are given in DIPs through the API. |
| 176 * |
| 177 * Note that the coordinate system for Pepper APIs is DIPs. Also note that |
| 178 * one DIP might not equal one CSS pixel - when page scale/zoom is in effect. |
| 179 * |
| 180 * @param[in] resource A <code>PP_Resource</code> corresponding to a |
| 181 * <code>PPB_View</code> resource. |
| 182 * |
| 183 * @return A <code>float</code> value representing the number of device pixels |
| 184 * per DIP. If the resource is invalid, the value will be 0.0. |
| 185 */ |
| 186 float (*GetDeviceScale)(PP_Resource resource); |
| 187 /** |
| 188 * GetCSSScale returns the scale factor between DIPs and CSS pixels. This |
| 189 * allows proper scaling between DIPs - as sent via the Pepper API - and CSS |
| 190 * pixel coordinates used for Web content. |
| 191 * |
| 192 * @param[in] resource A <code>PP_Resource</code> corresponding to a |
| 193 * <code>PPB_View</code> resource. |
| 194 * |
| 195 * @return css_scale A <code>float</code> value representing the number of |
| 196 * DIPs per CSS pixel. If the resource is invalid, the value will be 0.0. |
| 197 */ |
| 198 float (*GetCSSScale)(PP_Resource resource); |
170 }; | 199 }; |
171 | 200 |
172 typedef struct PPB_View_1_0 PPB_View; | 201 typedef struct PPB_View_1_1 PPB_View; |
| 202 |
| 203 struct PPB_View_1_0 { |
| 204 PP_Bool (*IsView)(PP_Resource resource); |
| 205 PP_Bool (*GetRect)(PP_Resource resource, struct PP_Rect* rect); |
| 206 PP_Bool (*IsFullscreen)(PP_Resource resource); |
| 207 PP_Bool (*IsVisible)(PP_Resource resource); |
| 208 PP_Bool (*IsPageVisible)(PP_Resource resource); |
| 209 PP_Bool (*GetClipRect)(PP_Resource resource, struct PP_Rect* clip); |
| 210 }; |
173 /** | 211 /** |
174 * @} | 212 * @} |
175 */ | 213 */ |
176 | 214 |
177 #endif /* PPAPI_C_PPB_VIEW_H_ */ | 215 #endif /* PPAPI_C_PPB_VIEW_H_ */ |
178 | 216 |
OLD | NEW |