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 /** | 6 /** |
7 * Defines the <code>PPB_View</code> struct representing the state of the | 7 * Defines the <code>PPB_View</code> struct representing the state of the |
8 * view of an instance. | 8 * 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 can get a View object with the <code>PPB_Instance.GetView()</code> | 17 * You will receive new view information via |
18 * function. Additionally, all </code>PPB_ViewChanged</code> objects are also | |
19 * <code>PPB_View</code> objects so you will receive new view information via | |
20 * <code>PPP_Instance.DidChangeView</code>. | 18 * <code>PPP_Instance.DidChangeView</code>. |
21 */ | 19 */ |
22 [macro="PPB_VIEW_INTERFACE"] | 20 [macro="PPB_VIEW_INTERFACE"] |
23 interface PPB_View { | 21 interface PPB_View { |
24 /** | 22 /** |
25 * <code>IsView()</code> determines if the given resource is a valid | 23 * <code>IsView()</code> determines if the given resource is a valid |
26 * <code>PPB_View</code> resource. Note that <code>PPB_ViewChanged</code> | 24 * <code>PPB_View</code> resource. Note that <code>PPB_ViewChanged</code> |
27 * 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 |
28 * as well. | 26 * as well. |
29 * | 27 * |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 * user, <code>PP_FALSE</code> if it is definitely not visible. | 91 * user, <code>PP_FALSE</code> if it is definitely not visible. |
94 */ | 92 */ |
95 PP_Bool IsPageVisible([in] PP_Resource resource); | 93 PP_Bool IsPageVisible([in] PP_Resource resource); |
96 | 94 |
97 /** | 95 /** |
98 * <code>GetClipRect()</code> returns the clip rectangle relative to the | 96 * <code>GetClipRect()</code> returns the clip rectangle relative to the |
99 * upper left corner of the instance. This rectangle indicates which parts of | 97 * upper left corner of the instance. This rectangle indicates which parts of |
100 * the instance are scrolled into view. | 98 * the instance are scrolled into view. |
101 * | 99 * |
102 * If the instance is scrolled off the view, the return value will be | 100 * If the instance is scrolled off the view, the return value will be |
103 * (0, 0, 0, 0). this state. This clip rect does <i>not</i> take into account | 101 * (0, 0, 0, 0). This clip rect does <i>not</i> take into account page |
104 * page visibility. This means if the instance is scrolled into view but the | 102 * visibility. This means if the instance is scrolled into view but the page |
105 * page itself is in an invisible tab, the return rect will contain the | 103 * itself is in an invisible tab, the return rect will contain the visible |
106 * visible rect assuming the page was visible. See | 104 * rect assuming the page was visible. See <code>IsPageVisible()</code> and |
107 * <code>IsPageVisible()</code> and <code>IsVisible()</code> if you want to | 105 * <code>IsVisible()</code> if you want to handle this case. |
108 * handle this case. | |
109 * | 106 * |
110 * Most applications will not need to worry about the clip. The recommended | 107 * Most applications will not need to worry about the clip. The recommended |
111 * behavior is to do full updates if the instance is visible as determined by | 108 * behavior is to do full updates if the instance is visible as determined by |
112 * <code>IsVisible()</code> and do no updates if not. | 109 * <code>IsVisible()</code> and do no updates if not. |
113 * | 110 * |
114 * However, if the cost for computing pixels is very high for your | 111 * However, if the cost for computing pixels is very high for your |
115 * application or the pages you're targeting frequently have very large | 112 * application or the pages you're targeting frequently have very large |
116 * instances with small visible portions, you may wish to optimize further. | 113 * instances with small visible portions, you may wish to optimize further. |
117 * In this case, the clip rect will tell you which parts of the plugin to | 114 * In this case, the clip rect will tell you which parts of the plugin to |
118 * update. | 115 * update. |
(...skipping 11 matching lines...) Expand all Loading... |
130 * | 127 * |
131 * @param clip Output argument receiving the clip rect on success. | 128 * @param clip Output argument receiving the clip rect on success. |
132 * | 129 * |
133 * @return Returns <code>PP_TRUE</code> if the resource was valid and the | 130 * @return Returns <code>PP_TRUE</code> if the resource was valid and the |
134 * clip rect was filled in, <code>PP_FALSE</code> if not. | 131 * clip rect was filled in, <code>PP_FALSE</code> if not. |
135 */ | 132 */ |
136 PP_Bool GetClipRect([in] PP_Resource resource, | 133 PP_Bool GetClipRect([in] PP_Resource resource, |
137 [out] PP_Rect clip); | 134 [out] PP_Rect clip); |
138 }; | 135 }; |
139 | 136 |
OLD | NEW |