Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(922)

Side by Side Diff: ppapi/c/ppb_view.h

Issue 329033003: Add GetScrollOffset function to PPB_View (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 Mar 29 11:55:32 2013. */ 6 /* From ppb_view.idl modified Wed Jun 11 16:36:35 2014. */
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_1_1 "PPB_View;1.1" 20 #define PPB_VIEW_INTERFACE_1_1 "PPB_View;1.1"
21 #define PPB_VIEW_INTERFACE PPB_VIEW_INTERFACE_1_1 21 #define PPB_VIEW_INTERFACE_1_2 "PPB_View;1.2"
22 #define PPB_VIEW_INTERFACE PPB_VIEW_INTERFACE_1_2
22 23
23 /** 24 /**
24 * @file 25 * @file
25 * This file defines the <code>PPB_View</code> struct representing the state 26 * This file defines the <code>PPB_View</code> struct representing the state
26 * of the view of an instance. 27 * of the view of an instance.
27 */ 28 */
28 29
29 30
30 /** 31 /**
31 * @addtogroup Interfaces 32 * @addtogroup Interfaces
32 * @{ 33 * @{
33 */ 34 */
34 /** 35 /**
35 * <code>PPB_View</code> represents the state of the view of an instance. 36 * <code>PPB_View</code> represents the state of the view of an instance.
36 * You will receive new view information using 37 * You will receive new view information using
37 * <code>PPP_Instance.DidChangeView</code>. 38 * <code>PPP_Instance.DidChangeView</code>.
38 */ 39 */
39 struct PPB_View_1_1 { 40 struct PPB_View_1_2 {
40 /** 41 /**
41 * IsView() determines if the given resource is a valid 42 * IsView() determines if the given resource is a valid
42 * <code>PPB_View</code> resource. Note that <code>PPB_ViewChanged</code> 43 * <code>PPB_View</code> resource. Note that <code>PPB_ViewChanged</code>
43 * resources derive from <code>PPB_View</code> and will return true here 44 * resources derive from <code>PPB_View</code> and will return true here
44 * as well. 45 * as well.
45 * 46 *
46 * @param resource A <code>PP_Resource</code> corresponding to a 47 * @param resource A <code>PP_Resource</code> corresponding to a
47 * <code>PPB_View</code> resource. 48 * <code>PPB_View</code> resource.
48 * 49 *
49 * @return <code>PP_TRUE</code> if the given resource supports 50 * @return <code>PP_TRUE</code> if the given resource supports
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 * allows proper scaling between DIPs - as sent via the Pepper API - and CSS 191 * allows proper scaling between DIPs - as sent via the Pepper API - and CSS
191 * pixel coordinates used for Web content. 192 * pixel coordinates used for Web content.
192 * 193 *
193 * @param[in] resource A <code>PP_Resource</code> corresponding to a 194 * @param[in] resource A <code>PP_Resource</code> corresponding to a
194 * <code>PPB_View</code> resource. 195 * <code>PPB_View</code> resource.
195 * 196 *
196 * @return css_scale A <code>float</code> value representing the number of 197 * @return css_scale A <code>float</code> value representing the number of
197 * DIPs per CSS pixel. If the resource is invalid, the value will be 0.0. 198 * DIPs per CSS pixel. If the resource is invalid, the value will be 0.0.
198 */ 199 */
199 float (*GetCSSScale)(PP_Resource resource); 200 float (*GetCSSScale)(PP_Resource resource);
201 /**
202 * GetScrollOffset returns the scroll offset of the window containing the
203 * plugin. This value will only be valid if the module instance is visible
204 * (that is, IsVisible() is true) otherwise (0, 0) will be returned.
205 *
206 * @param[in] resource A <code>PP_Resource</code> corresponding to a
207 * <code>PPB_View</code> resource.
208 *
209 * @param[out] offset A <code>PP_Point</code> which will be set to the value
210 * of the scroll offset.
211 *
212 * @return Returns <code>PP_TRUE</code> if the resource was valid and the
213 * offset was filled in, <code>PP_FALSE</code> if not.
214 */
215 PP_Bool (*GetScrollOffset)(PP_Resource resource, struct PP_Point* offset);
200 }; 216 };
201 217
202 typedef struct PPB_View_1_1 PPB_View; 218 typedef struct PPB_View_1_2 PPB_View;
203 219
204 struct PPB_View_1_0 { 220 struct PPB_View_1_0 {
205 PP_Bool (*IsView)(PP_Resource resource); 221 PP_Bool (*IsView)(PP_Resource resource);
206 PP_Bool (*GetRect)(PP_Resource resource, struct PP_Rect* rect); 222 PP_Bool (*GetRect)(PP_Resource resource, struct PP_Rect* rect);
207 PP_Bool (*IsFullscreen)(PP_Resource resource); 223 PP_Bool (*IsFullscreen)(PP_Resource resource);
208 PP_Bool (*IsVisible)(PP_Resource resource); 224 PP_Bool (*IsVisible)(PP_Resource resource);
209 PP_Bool (*IsPageVisible)(PP_Resource resource); 225 PP_Bool (*IsPageVisible)(PP_Resource resource);
210 PP_Bool (*GetClipRect)(PP_Resource resource, struct PP_Rect* clip); 226 PP_Bool (*GetClipRect)(PP_Resource resource, struct PP_Rect* clip);
211 }; 227 };
228
229 struct PPB_View_1_1 {
230 PP_Bool (*IsView)(PP_Resource resource);
231 PP_Bool (*GetRect)(PP_Resource resource, struct PP_Rect* rect);
232 PP_Bool (*IsFullscreen)(PP_Resource resource);
233 PP_Bool (*IsVisible)(PP_Resource resource);
234 PP_Bool (*IsPageVisible)(PP_Resource resource);
235 PP_Bool (*GetClipRect)(PP_Resource resource, struct PP_Rect* clip);
236 float (*GetDeviceScale)(PP_Resource resource);
237 float (*GetCSSScale)(PP_Resource resource);
238 };
212 /** 239 /**
213 * @} 240 * @}
214 */ 241 */
215 242
216 #endif /* PPAPI_C_PPB_VIEW_H_ */ 243 #endif /* PPAPI_C_PPB_VIEW_H_ */
217 244
OLDNEW
« ppapi/api/ppb_view.idl ('K') | « ppapi/api/ppb_view.idl ('k') | ppapi/cpp/view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698