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

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

Issue 12989006: Move HiDPI-related Pepper interfaces to stable (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase after spelling-correction CL Created 7 years, 8 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 Feb 17 09:09:15 2012. */ 6 /* From ppb_view.idl modified Fri Mar 29 11:55:32 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
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 Density
173 * Independent Pixels (DIPs, also known as logical pixels or UI pixels on
174 * some platforms). This allows the developer to render their contents at
175 * device resolution, even as coordinates / sizes are given in DIPs through
176 * the API.
177 *
178 * Note that the coordinate system for Pepper APIs is DIPs. Also note that
179 * one DIP might not equal one CSS pixel - when page scale/zoom is in effect.
180 *
181 * @param[in] resource A <code>PP_Resource</code> corresponding to a
182 * <code>PPB_View</code> resource.
183 *
184 * @return A <code>float</code> value representing the number of device pixels
185 * per DIP. If the resource is invalid, the value will be 0.0.
186 */
187 float (*GetDeviceScale)(PP_Resource resource);
188 /**
189 * GetCSSScale returns the scale factor between DIPs and CSS pixels. This
190 * allows proper scaling between DIPs - as sent via the Pepper API - and CSS
191 * pixel coordinates used for Web content.
192 *
193 * @param[in] resource A <code>PP_Resource</code> corresponding to a
194 * <code>PPB_View</code> resource.
195 *
196 * @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 */
199 float (*GetCSSScale)(PP_Resource resource);
170 }; 200 };
171 201
172 typedef struct PPB_View_1_0 PPB_View; 202 typedef struct PPB_View_1_1 PPB_View;
203
204 struct PPB_View_1_0 {
205 PP_Bool (*IsView)(PP_Resource resource);
206 PP_Bool (*GetRect)(PP_Resource resource, struct PP_Rect* rect);
207 PP_Bool (*IsFullscreen)(PP_Resource resource);
208 PP_Bool (*IsVisible)(PP_Resource resource);
209 PP_Bool (*IsPageVisible)(PP_Resource resource);
210 PP_Bool (*GetClipRect)(PP_Resource resource, struct PP_Rect* clip);
211 };
173 /** 212 /**
174 * @} 213 * @}
175 */ 214 */
176 215
177 #endif /* PPAPI_C_PPB_VIEW_H_ */ 216 #endif /* PPAPI_C_PPB_VIEW_H_ */
178 217
OLDNEW
« no previous file with comments | « ppapi/c/ppb_graphics_2d.h ('k') | ppapi/cpp/graphics_2d.h » ('j') | ppapi/cpp/graphics_2d.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698