| 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 used to grant an application a connection to the | 25 // ViewManagerInitService is responsible for launching the client that controls |
| 26 // ViewManager by embedding it at an approriate Node. | 26 // the root node. mojo::view_manager returns an instance of this. All other |
| 27 // connections are established by the client this creates. |
| 27 interface ViewManagerInitService { | 28 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. | |
| 36 EmbedRoot(string url) => (bool success); | 29 EmbedRoot(string url) => (bool success); |
| 37 }; | 30 }; |
| 38 | 31 |
| 39 // Nodes and Views are identified by a uint32. The upper 16 bits are the | 32 // 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. | 33 // connection id, and the lower 16 the id assigned by the client. |
| 41 // | 34 // |
| 42 // The root node is identified with a connection id of 0, and value of 1. | 35 // The root node is identified with a connection id of 0, and value of 1. |
| 43 [Client=ViewManagerClient] | 36 [Client=ViewManagerClient] |
| 44 interface ViewManagerService { | 37 interface ViewManagerService { |
| 45 // Creates a new node with the specified id. It is up to the client to ensure | 38 // 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... |
| 193 | 186 |
| 194 // Invoked when focus shifts from one Node to another. |gained_focus_id| is | 187 // Invoked when focus shifts from one Node to another. |gained_focus_id| is |
| 195 // the id of the node that gained focus, or 0 if the node that gained focus is | 188 // the id of the node that gained focus, or 0 if the node that gained focus is |
| 196 // not known to this connection. |lost_focus_id| is likewise the node that | 189 // not known to this connection. |lost_focus_id| is likewise the node that |
| 197 // lost focus. | 190 // lost focus. |
| 198 // TODO(beng): once aura is removed from the service, focus management should | 191 // TODO(beng): once aura is removed from the service, focus management should |
| 199 // entirely move to the window manager and this method can be | 192 // entirely move to the window manager and this method can be |
| 200 // removed. | 193 // removed. |
| 201 OnFocusChanged(uint32 gained_focus_id, uint32 lost_focus_id); | 194 OnFocusChanged(uint32 gained_focus_id, uint32 lost_focus_id); |
| 202 | 195 |
| 203 // TODO(sky): The following methods represent an interface between the view | 196 // TODO(sky): move to separate interface when FIFO sorted out. |
| 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. | |
| 208 | 197 |
| 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|. | |
| 213 DispatchOnViewInputEvent(uint32 view, mojo.Event event); | 198 DispatchOnViewInputEvent(uint32 view, mojo.Event event); |
| 214 }; | 199 }; |
| 215 | 200 |
| 216 } | 201 } |
| OLD | NEW |