| 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 import "../input_events/input_events.mojom" | 6 import "../input_events/input_events.mojom" |
| 7 import "view_manager_constants.mojom" |
| 7 | 8 |
| 8 module mojo.view_manager { | 9 module mojo.view_manager { |
| 9 | 10 |
| 10 struct INode { | 11 struct INode { |
| 11 uint32 parent_id; | 12 uint32 parent_id; |
| 12 uint32 node_id; | 13 uint32 node_id; |
| 13 uint32 view_id; | 14 uint32 view_id; |
| 14 mojo.Rect bounds; | 15 mojo.Rect bounds; |
| 15 }; | 16 }; |
| 16 | 17 |
| (...skipping 48 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. | 66 // |server_change_id| doesn't match, or the node already has no parent. |
| 66 // | 67 // |
| 67 // Removing a node from a parent may result in OnNodeDeleted() being sent to | 68 // 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 | 69 // 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 | 70 // 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 | 71 // OnNodeDeleted(). This is done as node 2 is effectively no longer visible to |
| 71 // connection B. | 72 // connection B. |
| 72 RemoveNodeFromParent(uint32 node_id, | 73 RemoveNodeFromParent(uint32 node_id, |
| 73 uint32 server_change_id) => (bool success); | 74 uint32 server_change_id) => (bool success); |
| 74 | 75 |
| 76 // Reorders a node in its parent, relative to |relative_node_id| according to |
| 77 // |direction|. |
| 78 // Only the connection that created the node's parent can reorder its |
| 79 // children. |
| 80 ReorderNode(uint32 node_id, |
| 81 uint32 relative_node_id, |
| 82 OrderDirection direction, |
| 83 uint32 server_change_id) => (bool success); |
| 84 |
| 75 // Returns the nodes comprising the tree starting at |node_id|. |node_id| is | 85 // 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 | 86 // 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 | 87 // case an empty vector is returned. The nodes are visited using a depth first |
| 78 // search (pre-order). | 88 // search (pre-order). |
| 79 GetNodeTree(uint32 node_id) => (INode[] nodes); | 89 GetNodeTree(uint32 node_id) => (INode[] nodes); |
| 80 | 90 |
| 81 // Creates a new view with the specified id. It is up to the client to ensure | 91 // 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). | 92 // 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 | 93 // Additionally the connection id (embedded in |view_id|) must match that of |
| 84 // the connection. | 94 // the connection. |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 // supplied. See description above ViewManager for details on the change ids. | 151 // supplied. See description above ViewManager for details on the change ids. |
| 142 // |nodes| contains any nodes that are that the client has not been told | 152 // |nodes| contains any nodes that are that the client has not been told |
| 143 // about. This is not sent for hierarchy changes of nodes not known to this | 153 // about. This is not sent for hierarchy changes of nodes not known to this |
| 144 // client or not attached to the tree. | 154 // client or not attached to the tree. |
| 145 OnNodeHierarchyChanged(uint32 node, | 155 OnNodeHierarchyChanged(uint32 node, |
| 146 uint32 new_parent, | 156 uint32 new_parent, |
| 147 uint32 old_parent, | 157 uint32 old_parent, |
| 148 uint32 server_change_id, | 158 uint32 server_change_id, |
| 149 INode[] nodes); | 159 INode[] nodes); |
| 150 | 160 |
| 161 // Invoked when the order of nodes within a parent changes. |
| 162 OnNodeReordered(uint32 node_id, |
| 163 uint32 relative_node_id, |
| 164 OrderDirection direction, |
| 165 uint32 server_change_id); |
| 166 |
| 151 // Invoked when a node is deleted. | 167 // Invoked when a node is deleted. |
| 152 OnNodeDeleted(uint32 node, uint32 server_change_id); | 168 OnNodeDeleted(uint32 node, uint32 server_change_id); |
| 153 | 169 |
| 154 // Invoked when the view associated with a node is replaced by another view. | 170 // Invoked when the view associated with a node is replaced by another view. |
| 155 // 0 is used to identify a null view. | 171 // 0 is used to identify a null view. |
| 156 OnNodeViewReplaced(uint32 node, uint32 new_view_id, uint32 old_view_id); | 172 OnNodeViewReplaced(uint32 node, uint32 new_view_id, uint32 old_view_id); |
| 157 | 173 |
| 158 // Invoked when a view is deleted. | 174 // Invoked when a view is deleted. |
| 159 OnViewDeleted(uint32 view); | 175 OnViewDeleted(uint32 view); |
| 160 | 176 |
| 161 // Invoked when an event is targeted at the specified view. | 177 // Invoked when an event is targeted at the specified view. |
| 162 OnViewInputEvent(uint32 view, mojo.Event event) => (); | 178 OnViewInputEvent(uint32 view, mojo.Event event) => (); |
| 163 }; | 179 }; |
| 164 | 180 |
| 165 } | 181 } |
| OLD | NEW |