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/services/public/interfaces/geometry/geometry.mojom" | 5 import "mojo/services/public/interfaces/geometry/geometry.mojom" |
6 import "mojo/services/public/interfaces/input_events/input_events.mojom" | 6 import "mojo/services/public/interfaces/input_events/input_events.mojom" |
7 import "mojo/services/public/interfaces/view_manager/view_manager_constants.mojo
m" | 7 import "mojo/services/public/interfaces/view_manager/view_manager_constants.mojo
m" |
8 | 8 |
9 module mojo.view_manager { | 9 module mojo.view_manager { |
10 | 10 |
11 struct NodeData { | 11 struct NodeData { |
12 uint32 parent_id; | 12 uint32 parent_id; |
13 uint32 node_id; | 13 uint32 node_id; |
14 uint32 view_id; | 14 uint32 view_id; |
15 mojo.Rect bounds; | 15 mojo.Rect bounds; |
16 // TODO(sky): add visible. | 16 // TODO(sky): add visible. |
17 }; | 17 }; |
18 | 18 |
19 enum ErrorCode { | 19 enum ErrorCode { |
20 NONE, | 20 NONE, |
21 VALUE_IN_USE, | 21 VALUE_IN_USE, |
22 ILLEGAL_ARGUMENT, | 22 ILLEGAL_ARGUMENT, |
23 }; | 23 }; |
24 | 24 |
25 // ViewManagerInitService is responsible for launching the client that controls | 25 // ViewManagerInitService is used to grant an application a connection to the |
26 // the root node. mojo::view_manager returns an instance of this. All other | 26 // ViewManager by embedding it at an approriate Node. |
27 // connections are established by the client this creates. | |
28 interface ViewManagerInitService { | 27 interface ViewManagerInitService { |
| 28 // Embed the application @ |url| at an appropriate Node. |
| 29 // The first time this method is called in the lifetime of a View Manager |
| 30 // application instance, the "appropriate Node" is defined as being the |
| 31 // service root Node. |
| 32 // Subsequent times, implementation of this method is delegated to the |
| 33 // application embedded at the service root Node. This application is |
| 34 // typically referred to as the "window manager", and will have a specific |
| 35 // definition of where within its Node hierarchy to embed an unparented URL. |
29 EmbedRoot(string url) => (bool success); | 36 EmbedRoot(string url) => (bool success); |
30 }; | 37 }; |
31 | 38 |
32 // Nodes and Views are identified by a uint32. The upper 16 bits are the | 39 // Nodes and Views are identified by a uint32. The upper 16 bits are the |
33 // connection id, and the lower 16 the id assigned by the client. | 40 // connection id, and the lower 16 the id assigned by the client. |
34 // | 41 // |
35 // The root node is identified with a connection id of 0, and value of 1. | 42 // The root node is identified with a connection id of 0, and value of 1. |
36 [Client=ViewManagerClient] | 43 [Client=ViewManagerClient] |
37 interface ViewManagerService { | 44 interface ViewManagerService { |
38 // Creates a new node with the specified id. It is up to the client to ensure | 45 // Creates a new node with the specified id. It is up to the client to ensure |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 | 193 |
187 // Invoked when focus shifts from one Node to another. |gained_focus_id| is | 194 // Invoked when focus shifts from one Node to another. |gained_focus_id| is |
188 // the id of the node that gained focus, or 0 if the node that gained focus is | 195 // the id of the node that gained focus, or 0 if the node that gained focus is |
189 // not known to this connection. |lost_focus_id| is likewise the node that | 196 // not known to this connection. |lost_focus_id| is likewise the node that |
190 // lost focus. | 197 // lost focus. |
191 // TODO(beng): once aura is removed from the service, focus management should | 198 // TODO(beng): once aura is removed from the service, focus management should |
192 // entirely move to the window manager and this method can be | 199 // entirely move to the window manager and this method can be |
193 // removed. | 200 // removed. |
194 OnFocusChanged(uint32 gained_focus_id, uint32 lost_focus_id); | 201 OnFocusChanged(uint32 gained_focus_id, uint32 lost_focus_id); |
195 | 202 |
196 // TODO(sky): move to separate interface when FIFO sorted out. | 203 // TODO(sky): The following methods represent an interface between the view |
| 204 // manager and the application embedded at the service root node |
| 205 // (i.e. the window manager). These methods are not called on |
| 206 // any other clients. They should be moved to a separate interface |
| 207 // once support for derived FIFOs is landed. |
197 | 208 |
| 209 // Requests the window manager create a "top level" node embedding |url|. |
| 210 EmbedRoot(string url); |
| 211 |
| 212 // Requests the view manager dispatch the event targeted at |view|. |
198 DispatchOnViewInputEvent(uint32 view, mojo.Event event); | 213 DispatchOnViewInputEvent(uint32 view, mojo.Event event); |
199 }; | 214 }; |
200 | 215 |
201 } | 216 } |
OLD | NEW |