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 |
(...skipping 15 matching lines...) Expand all Loading... |
26 // ViewManager by embedding it at an approriate Node. | 26 // ViewManager by embedding it at an approriate Node. |
27 interface ViewManagerInitService { | 27 interface ViewManagerInitService { |
28 // Embed the application @ |url| at an appropriate Node. | 28 // Embed the application @ |url| at an appropriate Node. |
29 // The first time this method is called in the lifetime of a View Manager | 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 | 30 // application instance, the "appropriate Node" is defined as being the |
31 // service root Node. | 31 // service root Node. |
32 // Subsequent times, implementation of this method is delegated to the | 32 // Subsequent times, implementation of this method is delegated to the |
33 // application embedded at the service root Node. This application is | 33 // application embedded at the service root Node. This application is |
34 // typically referred to as the "window manager", and will have a specific | 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. | 35 // definition of where within its Node hierarchy to embed an unparented URL. |
36 EmbedRoot(string url) => (bool success); | 36 Embed(string url) => (bool success); |
37 }; | 37 }; |
38 | 38 |
39 // 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 |
40 // 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. |
41 // | 41 // |
42 // 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. |
43 [Client=ViewManagerClient] | 43 [Client=ViewManagerClient] |
44 interface ViewManagerService { | 44 interface ViewManagerService { |
45 // 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 |
46 // the id is unique to the connection (the id need not be globally unique). | 46 // the id is unique to the connection (the id need not be globally unique). |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 // | 127 // |
128 // If a particular client invokes Embed() multiple times with the same url, | 128 // If a particular client invokes Embed() multiple times with the same url, |
129 // the connection is reused. When this happens the ViewManagerClient is | 129 // the connection is reused. When this happens the ViewManagerClient is |
130 // notified of the additional roots by way of OnRootAdded(). | 130 // notified of the additional roots by way of OnRootAdded(). |
131 // | 131 // |
132 // A node may only be a root of one connection at a time. Subsequent calls to | 132 // A node may only be a root of one connection at a time. Subsequent calls to |
133 // Embed() for the same node result in the node being removed from the | 133 // Embed() for the same node result in the node being removed from the |
134 // current connection. The current connection is told this by way of | 134 // current connection. The current connection is told this by way of |
135 // OnNodeDeleted(). | 135 // OnNodeDeleted(). |
136 // | 136 // |
| 137 // If |node_id| is 0, the View Manager delegates determination of what node to |
| 138 // embed |url| at to the app embedded at the service root node (i.e. the |
| 139 // window manager). |
| 140 // |
137 // This advances the server change id. | 141 // This advances the server change id. |
138 Embed(string url, uint32 node_id) => (bool success); | 142 Embed(string url, uint32 node_id) => (bool success); |
139 | 143 |
140 // TODO(sky): move these to a separate interface when FIFO works. | 144 // TODO(sky): move these to a separate interface when FIFO works. |
141 | 145 |
142 // Sends OnViewInputEvent() to the owner of the specified view. | 146 // Sends OnViewInputEvent() to the owner of the specified view. |
143 DispatchOnViewInputEvent(uint32 view_id, mojo.Event event); | 147 DispatchOnViewInputEvent(uint32 view_id, mojo.Event event); |
144 }; | 148 }; |
145 | 149 |
146 // Changes to nodes/views are not sent to the connection that originated the | 150 // Changes to nodes/views are not sent to the connection that originated the |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 // removed. | 204 // removed. |
201 OnFocusChanged(uint32 gained_focus_id, uint32 lost_focus_id); | 205 OnFocusChanged(uint32 gained_focus_id, uint32 lost_focus_id); |
202 | 206 |
203 // TODO(sky): The following methods represent an interface between the view | 207 // TODO(sky): The following methods represent an interface between the view |
204 // manager and the application embedded at the service root node | 208 // manager and the application embedded at the service root node |
205 // (i.e. the window manager). These methods are not called on | 209 // (i.e. the window manager). These methods are not called on |
206 // any other clients. They should be moved to a separate interface | 210 // any other clients. They should be moved to a separate interface |
207 // once support for derived FIFOs is landed. | 211 // once support for derived FIFOs is landed. |
208 | 212 |
209 // Requests the window manager create a "top level" node embedding |url|. | 213 // Requests the window manager create a "top level" node embedding |url|. |
210 EmbedRoot(string url); | 214 Embed(string url); |
211 | 215 |
212 // Requests the view manager dispatch the event targeted at |view|. | 216 // Requests the view manager dispatch the event targeted at |view|. |
213 DispatchOnViewInputEvent(uint32 view, mojo.Event event); | 217 DispatchOnViewInputEvent(uint32 view, mojo.Event event); |
214 }; | 218 }; |
215 | 219 |
216 } | 220 } |
OLD | NEW |