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 "../geometry/geometry.mojom" | 5 import "../geometry/geometry.mojom" |
6 | 6 |
7 module mojo.view_manager { | 7 module mojo.view_manager { |
8 | 8 |
9 struct INode { | 9 struct INode { |
10 uint32 parent_id; | 10 uint32 parent_id; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 // |server_change_id| doesn't match, or the node already has no parent. | 65 // |server_change_id| doesn't match, or the node already has no parent. |
66 // | 66 // |
67 // Removing a node from a parent may result in OnNodeDeleted() being sent to | 67 // Removing a node from a parent may result in OnNodeDeleted() being sent to |
68 // other connections. For example, connection A has nodes 1 and 2, with 2 a | 68 // other connections. For example, connection A has nodes 1 and 2, with 2 a |
69 // child of 1. Connection B has a root 1. If 2 is removed from 1 then B gets | 69 // child of 1. Connection B has a root 1. If 2 is removed from 1 then B gets |
70 // OnNodeDeleted(). This is done as node 2 is effectively no longer visible to | 70 // OnNodeDeleted(). This is done as node 2 is effectively no longer visible to |
71 // connection B. | 71 // connection B. |
72 RemoveNodeFromParent(uint32 node_id, | 72 RemoveNodeFromParent(uint32 node_id, |
73 uint32 server_change_id) => (bool success); | 73 uint32 server_change_id) => (bool success); |
74 | 74 |
75 // Returns the nodes comprising the tree starting at |node_id|. |node_id| is | 75 // Returns the nodes comprising the tree starting at |node_id|. |node_id| is |
76 // the first result in the return value, unless |node_id| is invalid, in which | 76 // the first result in the return value, unless |node_id| is invalid, in which |
77 // case an empty vector is returned. The nodes are visited using a depth first | 77 // case an empty vector is returned. The nodes are visited using a depth first |
78 // search (pre-order). | 78 // search (pre-order). |
79 GetNodeTree(uint32 node_id) => (INode[] nodes); | 79 GetNodeTree(uint32 node_id) => (INode[] nodes); |
80 | 80 |
81 // Creates a new view with the specified id. It is up to the client to ensure | 81 // Creates a new view with the specified id. It is up to the client to ensure |
82 // the id is unique to the connection (the id need not be globally unique). | 82 // the id is unique to the connection (the id need not be globally unique). |
83 // Additionally the connection id (embedded in |view_id|) must match that of | 83 // Additionally the connection id (embedded in |view_id|) must match that of |
84 // the connection. | 84 // the connection. |
85 CreateView(uint32 view_id) => (bool success); | 85 CreateView(uint32 view_id) => (bool success); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 | 143 |
144 // Invoked when the view associated with a node is replaced by another view. | 144 // Invoked when the view associated with a node is replaced by another view. |
145 // 0 is used to identify a null view. | 145 // 0 is used to identify a null view. |
146 OnNodeViewReplaced(uint32 node, uint32 new_view_id, uint32 old_view_id); | 146 OnNodeViewReplaced(uint32 node, uint32 new_view_id, uint32 old_view_id); |
147 | 147 |
148 // Invoked when a view is deleted. | 148 // Invoked when a view is deleted. |
149 OnViewDeleted(uint32 view); | 149 OnViewDeleted(uint32 view); |
150 }; | 150 }; |
151 | 151 |
152 } | 152 } |
OLD | NEW |