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

Side by Side Diff: ppapi/api/ppb_view.idl

Issue 9401012: Updated grammar, added resource argument to all functions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 10 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
« no previous file with comments | « no previous file | ppapi/c/ppb_view.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 /** 6 /**
7 * Defines the <code>PPB_View</code> struct representing the state of the 7 * This file defines the <code>PPB_View</code> struct representing the state
8 * view of an instance. 8 * of the view of an instance.
9 */ 9 */
10 10
11 label Chrome { 11 label Chrome {
12 M18 = 1.0 12 M18 = 1.0
13 }; 13 };
14 14
15 /** 15 /**
16 * <code>PPB_View</code> represents the state of the view of an instance. 16 * <code>PPB_View</code> represents the state of the view of an instance.
17 * You will receive new view information via 17 * You will receive new view information using
18 * <code>PPP_Instance.DidChangeView</code>. 18 * <code>PPP_Instance.DidChangeView</code>.
19 */ 19 */
20 [macro="PPB_VIEW_INTERFACE"] 20 [macro="PPB_VIEW_INTERFACE"]
21 interface PPB_View { 21 interface PPB_View {
22 /** 22 /**
23 * <code>IsView()</code> determines if the given resource is a valid 23 * IsView() determines if the given resource is a valid
24 * <code>PPB_View</code> resource. Note that <code>PPB_ViewChanged</code> 24 * <code>PPB_View</code> resource. Note that <code>PPB_ViewChanged</code>
25 * resources derive from <code>PPB_View</code> and will return true here 25 * resources derive from <code>PPB_View</code> and will return true here
26 * as well. 26 * as well.
27 * 27 *
28 * @param resource A <code>PP_Resource</code> corresponding to a
29 * <code>PPB_View</code> resource.
30 *
28 * @return <code>PP_TRUE</code> if the given resource supports 31 * @return <code>PP_TRUE</code> if the given resource supports
29 * <code>PPB_View</code> or <code>PP_FALSE</code> if it is an invalid 32 * <code>PPB_View</code> or <code>PP_FALSE</code> if it is an invalid
30 * resource or is a resource of another type. 33 * resource or is a resource of another type.
31 */ 34 */
32 PP_Bool IsView([in] PP_Resource resource); 35 PP_Bool IsView([in] PP_Resource resource);
33 36
34 /** 37 /**
35 * <code>GetRect()</code> retrieves the rectangle of the instance 38 * GetRect() retrieves the rectangle of the module instance associated
36 * associated with the view changed notification relative to the upper left 39 * with a view changed notification relative to the upper-left of the browser
37 * of the browser viewport. This position changes when the page is scrolled. 40 * viewport. This position changes when the page is scrolled.
38 * 41 *
39 * The returned rectangle may not be inside the visible portion of the 42 * The returned rectangle may not be inside the visible portion of the
40 * viewport if the instance is scrolled off the page. Therefore, the position 43 * viewport if the module instance is scrolled off the page. Therefore, the
41 * may be negative or larger than the size of the page. The size will always 44 * position may be negative or larger than the size of the page. The size will
42 * reflect the size of the plugin were it to be scrolled entirely into view. 45 * always reflect the size of the module were it to be scrolled entirely into
46 * view.
43 * 47 *
44 * In general, most plugins will not need to worry about the position of the 48 * In general, most modules will not need to worry about the position of the
45 * instance in the viewport, and only need to use the size. 49 * module instance in the viewport, and only need to use the size.
46 * 50 *
47 * @param rect Output argument receiving the rectangle on success. 51 * @param resource A <code>PP_Resource</code> corresponding to a
52 * <code>PPB_View</code> resource.
53 *
54 * @param rect A <code>PP_Rect</code> receiving the rectangle on success.
48 * 55 *
49 * @return Returns <code>PP_TRUE</code> if the resource was valid and the 56 * @return Returns <code>PP_TRUE</code> if the resource was valid and the
50 * viewport rect was filled in, <code>PP_FALSE</code> if not. 57 * viewport rectangle was filled in, <code>PP_FALSE</code> if not.
51 */ 58 */
52 PP_Bool GetRect([in] PP_Resource resource, 59 PP_Bool GetRect([in] PP_Resource resource,
53 [out] PP_Rect rect); 60 [out] PP_Rect rect);
54 61
55 /** 62 /**
56 * <code>IsFullscreen()</code> returns whether the instance is currently 63 * IsFullscreen() returns whether the instance is currently
57 * displaying in fullscreen mode. 64 * displaying in fullscreen mode.
58 * 65 *
66 * @param resource A <code>PP_Resource</code> corresponding to a
67 * <code>PPB_View</code> resource.
68 *
59 * @return <code>PP_TRUE</code> if the instance is in full screen mode, 69 * @return <code>PP_TRUE</code> if the instance is in full screen mode,
60 * or <code>PP_FALSE</code> if it's not or the resource is invalid. 70 * or <code>PP_FALSE</code> if it's not or the resource is invalid.
61 */ 71 */
62 PP_Bool IsFullscreen([in] PP_Resource resource); 72 PP_Bool IsFullscreen([in] PP_Resource resource);
63 73
64 /** 74 /**
65 * <code>IsVisible()</code> returns whether the instance is plausibly 75 * IsVisible() determines whether the module instance might be visible to
66 * visible to the user. You should use this flag to throttle or stop updates 76 * the user. For example, the Chrome window could be minimized or another wind ow
brettw 2012/02/16 23:44:28 80 cols.
jond 2012/02/17 16:07:28 Done.
67 * for invisible plugins. 77 * could be over it. In both of these cases, the module instance would not be
78 * visible to the user, but IsVisible() will return true.
68 * 79 *
69 * Thie measure incorporates both whether the instance is scrolled into 80 * Use the result to speed up or stop updates for invisible module
70 * view (whether the clip rect is nonempty) and whether the page is plausibly 81 * instances.
71 * visible to the user (<code>IsPageVisible()</code>).
72 * 82 *
73 * @return <code>PP_TRUE</code> if the instance is plausibly visible to the 83 * This function performs the duties of GetRect() (determining whether the
84 * module instance is scrolled into view and the clip rectangle is nonempty)
85 * and IsPageVisible() (whether the page is visible to the user).
86 *
87 * @param resource A <code>PP_Resource</code> corresponding to a
88 * <code>PPB_View</code> resource.
89 *
90 * @return <code>PP_TRUE</code> if the instance might be visible to the
74 * user, <code>PP_FALSE</code> if it is definitely not visible. 91 * user, <code>PP_FALSE</code> if it is definitely not visible.
75 */ 92 */
76 PP_Bool IsVisible([in] PP_Resource resource); 93 PP_Bool IsVisible([in] PP_Resource resource);
77 94
78 /** 95 /**
79 * <code>IsPageVisible()</code> determines if the page that contains the 96 * IsPageVisible() determines if the page that contains the module instance
80 * instance is visible. The most common cause of invisible pages is that 97 * is visible. The most common cause of invisible pages is that
81 * the page is in a background tab in the browser. 98 * the page is in a background tab in the browser.
82 * 99 *
83 * Most applications should use <code>IsVisible()</code> rather than 100 * Most applications should use IsVisible() instead of this function since
84 * this function since the instance could be scrolled off of a visible 101 * the module instance could be scrolled off of a visible page, and this
85 * page, and this function will still return true. However, depending on 102 * function will still return true. However, depending on how your module
86 * how your plugin interacts with the page, there may be certain updates 103 * interacts with the page, there may be certain updates that you may want to
87 * that you may want to perform when the page is visible even if your 104 * perform when the page is visible even if your specific module instance is
88 * specific instance isn't. 105 * not visible.
106 *
107 * @param resource A <code>PP_Resource</code> corresponding to a
108 * <code>PPB_View</code> resource.
89 * 109 *
90 * @return <code>PP_TRUE</code> if the instance is plausibly visible to the 110 * @return <code>PP_TRUE</code> if the instance is plausibly visible to the
91 * user, <code>PP_FALSE</code> if it is definitely not visible. 111 * user, <code>PP_FALSE</code> if it is definitely not visible.
92 */ 112 */
93 PP_Bool IsPageVisible([in] PP_Resource resource); 113 PP_Bool IsPageVisible([in] PP_Resource resource);
94 114
95 /** 115 /**
96 * <code>GetClipRect()</code> returns the clip rectangle relative to the 116 * GetClipRect() returns the clip rectangle relative to the upper-left corner
97 * upper left corner of the instance. This rectangle indicates which parts of 117 * of the module instance. This rectangle indicates the portions of the module
98 * the instance are scrolled into view. 118 * instance that are scrolled into view.
99 * 119 *
100 * If the instance is scrolled off the view, the return value will be 120 * If the module instance is scrolled off the view, the return value will be
101 * (0, 0, 0, 0). This clip rect does <i>not</i> take into account page 121 * (0, 0, 0, 0). This clip rectangle does <i>not</i> take into account page
102 * visibility. This means if the instance is scrolled into view but the page 122 * visibility. Therefore, if the module instance is scrolled into view, but
103 * itself is in an invisible tab, the return rect will contain the visible 123 * the page itself is on a tab that is not visible, the return rectangle will
104 * rect assuming the page was visible. See <code>IsPageVisible()</code> and 124 * contain the visible rectangle as though the page were visible. Refer to
105 * <code>IsVisible()</code> if you want to handle this case. 125 * IsPageVisible() and IsVisible() if you want to account for page
126 * visibility.
106 * 127 *
107 * Most applications will not need to worry about the clip. The recommended 128 * Most applications will not need to worry about the clip rectangle. The
108 * behavior is to do full updates if the instance is visible as determined by 129 * recommended behavior is to do full updates if the module instance is
109 * <code>IsVisible()</code> and do no updates if not. 130 * visible, as determined by IsVisible(), and do no updates if it is not
131 * visible.
110 * 132 *
111 * However, if the cost for computing pixels is very high for your 133 * However, if the cost for computing pixels is very high for your
112 * application or the pages you're targeting frequently have very large 134 * application, or the pages you're targeting frequently have very large
113 * instances with small visible portions, you may wish to optimize further. 135 * module instances with small visible portions, you may wish to optimize
114 * In this case, the clip rect will tell you which parts of the plugin to 136 * further. In this case, the clip rectangle will tell you which parts of
115 * update. 137 * the module to update.
116 * 138 *
117 * Note that painting of the page and sending of view changed updates 139 * Note that painting of the page and sending of view changed updates
118 * happens asynchronously. This means when the user scrolls, for example, 140 * happens asynchronously. This means when the user scrolls, for example,
119 * it is likely that the previous backing store of the instance will be used 141 * it is likely that the previous backing store of the module instance will
120 * for the first paint, and will be updated later when your application 142 * be used for the first paint, and will be updated later when your
121 * generates new content with the new clip. This may cause flickering at the 143 * application generates new content with the new clip. This may cause
122 * boundaries when scrolling. If you do choose to do partial updates, you may 144 * flickering at the boundaries when scrolling. If you do choose to do
123 * want to think about what color the invisible portions of your backing 145 * partial updates, you may want to think about what color the invisible
124 * store contain (be it transparent or some background color) or to paint 146 * portions of your backing store contain (be it transparent or some
125 * a certain region outside the clip to reduce the visual distraction when 147 * background color) or to paint a certain region outside the clip to reduce
126 * this happens. 148 * the visual distraction when this happens.
149 *
150 * @param resource A <code>PP_Resource</code> corresponding to a
151 * <code>PPB_View</code> resource.
127 * 152 *
128 * @param clip Output argument receiving the clip rect on success. 153 * @param clip Output argument receiving the clip rect on success.
129 * 154 *
130 * @return Returns <code>PP_TRUE</code> if the resource was valid and the 155 * @return Returns <code>PP_TRUE</code> if the resource was valid and the
131 * clip rect was filled in, <code>PP_FALSE</code> if not. 156 * clip rect was filled in, <code>PP_FALSE</code> if not.
132 */ 157 */
133 PP_Bool GetClipRect([in] PP_Resource resource, 158 PP_Bool GetClipRect([in] PP_Resource resource,
134 [out] PP_Rect clip); 159 [out] PP_Rect clip);
135 }; 160 };
136 161
OLDNEW
« no previous file with comments | « no previous file | ppapi/c/ppb_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698