OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 import "mojo/public/interfaces/application/service_provider.mojom" | 5 import "mojo/public/interfaces/application/service_provider.mojom" |
6 import "mojo/services/public/interfaces/geometry/geometry.mojom" | 6 import "mojo/services/public/interfaces/geometry/geometry.mojom" |
7 import "mojo/services/public/interfaces/input_events/input_events.mojom" | 7 import "mojo/services/public/interfaces/input_events/input_events.mojom" |
8 import "mojo/services/public/interfaces/view_manager/view_manager_constants.mojo
m" | 8 import "mojo/services/public/interfaces/view_manager/view_manager_constants.mojo
m" |
9 | 9 |
10 module mojo { | 10 module mojo { |
11 | 11 |
12 struct ViewData { | 12 struct ViewData { |
13 uint32 parent_id; | 13 uint32 parent_id; |
14 uint32 view_id; | 14 uint32 view_id; |
15 mojo.Rect bounds; | 15 mojo.Rect bounds; |
16 // TODO(sky): add visible. | 16 // True if this view is visible. The view may not be drawn on screen (see |
| 17 // drawn for specifics). |
| 18 bool visible; |
| 19 // True if this view is drawn on screen. A view is drawn if attached to the |
| 20 // root and all ancestors (including this view) are visible. |
| 21 bool drawn; |
17 }; | 22 }; |
18 | 23 |
19 enum ErrorCode { | 24 enum ErrorCode { |
20 NONE, | 25 NONE, |
21 VALUE_IN_USE, | 26 VALUE_IN_USE, |
22 ILLEGAL_ARGUMENT, | 27 ILLEGAL_ARGUMENT, |
23 }; | 28 }; |
24 | 29 |
25 // ViewManagerInitService is used to grant an application a connection to the | 30 // ViewManagerInitService is used to grant an application a connection to the |
26 // ViewManager by embedding it at an approriate View. | 31 // ViewManager by embedding it at an approriate View. |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 ViewData[] views); | 174 ViewData[] views); |
170 | 175 |
171 // Invoked when the order of views within a parent changes. | 176 // Invoked when the order of views within a parent changes. |
172 OnViewReordered(uint32 view_id, | 177 OnViewReordered(uint32 view_id, |
173 uint32 relative_view_id, | 178 uint32 relative_view_id, |
174 OrderDirection direction); | 179 OrderDirection direction); |
175 | 180 |
176 // Invoked when a view is deleted. | 181 // Invoked when a view is deleted. |
177 OnViewDeleted(uint32 view); | 182 OnViewDeleted(uint32 view); |
178 | 183 |
| 184 // Invoked when the visibility of the specified view changes. |
| 185 OnViewVisibilityChanged(uint32 view, bool visible); |
| 186 |
| 187 // Invoked when a change to the visibility of |view| or one if it's ancestors |
| 188 // is done such that the drawn state changes. This is only invoked for the |
| 189 // top most view of a particular connection. For example, if you have the |
| 190 // hierarchy: A -> B1 -> B2 (B2 is a child of B1 and B1 a child of A), B1/B2 |
| 191 // are from connection 2 and A from connection 1 with all views visible and |
| 192 // drawn and the visiblity of A changes to false, then connection 2 is told |
| 193 // the drawn state of B1 has changed (to false), but is not told anything |
| 194 // about B2 as it's drawn state can be calculated from that of B1. |
| 195 // |
| 196 // NOTE: This is not invoked if OnViewVisibilityChanged() is invoked. |
| 197 OnViewDrawnStateChanged(uint32 view, bool drawn); |
| 198 |
179 // Invoked when an event is targeted at the specified view. | 199 // Invoked when an event is targeted at the specified view. |
180 OnViewInputEvent(uint32 view, mojo.Event event) => (); | 200 OnViewInputEvent(uint32 view, mojo.Event event) => (); |
181 | 201 |
182 // TODO(sky): The following methods represent an interface between the view | 202 // TODO(sky): The following methods represent an interface between the view |
183 // manager and the application embedded at the service root view | 203 // manager and the application embedded at the service root view |
184 // (i.e. the window manager). These methods are not called on | 204 // (i.e. the window manager). These methods are not called on |
185 // any other clients. They should be moved to a separate interface | 205 // any other clients. They should be moved to a separate interface |
186 // once support for derived FIFOs is landed. | 206 // once support for derived FIFOs is landed. |
187 | 207 |
188 // Requests the window manager create a "top level" view embedding |url|. | 208 // Requests the window manager create a "top level" view embedding |url|. |
189 Embed(string url, ServiceProvider&? service_provider); | 209 Embed(string url, ServiceProvider&? service_provider); |
190 | 210 |
191 // Requests the view manager dispatch the event. | 211 // Requests the view manager dispatch the event. |
192 DispatchOnViewInputEvent(mojo.Event event); | 212 DispatchOnViewInputEvent(mojo.Event event); |
193 }; | 213 }; |
194 | 214 |
195 } | 215 } |
OLD | NEW |