Chromium Code Reviews| 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 module mus.mojom; | 5 module mus.mojom; |
| 6 | 6 |
| 7 import "components/mus/public/interfaces/compositor_frame.mojom"; | 7 import "components/mus/public/interfaces/compositor_frame.mojom"; |
| 8 import "components/mus/public/interfaces/cursor.mojom"; | 8 import "components/mus/public/interfaces/cursor.mojom"; |
| 9 import "components/mus/public/interfaces/input_events.mojom"; | 9 import "components/mus/public/interfaces/input_events.mojom"; |
| 10 import "components/mus/public/interfaces/mus_constants.mojom"; | 10 import "components/mus/public/interfaces/mus_constants.mojom"; |
| 11 import "components/mus/public/interfaces/surface_id.mojom"; | 11 import "components/mus/public/interfaces/surface_id.mojom"; |
| 12 import "components/mus/public/interfaces/window_manager.mojom"; | 12 import "components/mus/public/interfaces/window_manager.mojom"; |
| 13 import "components/mus/public/interfaces/window_manager_constants.mojom"; | 13 import "components/mus/public/interfaces/window_manager_constants.mojom"; |
| 14 import "ui/mojo/geometry/geometry.mojom"; | 14 import "ui/mojo/geometry/geometry.mojom"; |
| 15 import "ui/mojo/ime/text_input_state.mojom"; | 15 import "ui/mojo/ime/text_input_state.mojom"; |
| 16 | 16 |
| 17 struct ViewportMetrics { | 17 struct ViewportMetrics { |
| 18 mojo.Size size_in_pixels; | 18 mojo.Size size_in_pixels; |
| 19 // A value of 0 indicates the real value is not yet available. | 19 // A value of 0 indicates the real value is not yet available. |
| 20 float device_pixel_ratio = 0.0; | 20 float device_pixel_ratio = 0.0; |
| 21 }; | 21 }; |
| 22 | 22 |
| 23 struct WindowData { | 23 struct WindowData { |
| 24 uint32 parent_id; | 24 uint32 parent_id; |
| 25 uint32 window_id; | 25 uint32 window_id; |
| 26 mojo.Rect bounds; | 26 mojo.Rect bounds; |
| 27 map<string, array<uint8>> properties; | 27 map<string, array<uint8>> properties; |
| 28 // True if this window is visible. The window may not be drawn on screen (see | 28 // True if this window is visible. The window may not be drawn on screen (see |
| 29 // drawn for specifics). | 29 // OnWindowParentDrawnStateChanged() for details). |
| 30 bool visible; | 30 bool visible; |
| 31 // True if this window is drawn on screen. A window is drawn if attached to | |
| 32 // the root and all ancestors (including this window) are visible. | |
| 33 bool drawn; | |
| 34 ViewportMetrics viewport_metrics; | 31 ViewportMetrics viewport_metrics; |
| 35 }; | 32 }; |
| 36 | 33 |
| 37 enum ErrorCode { | 34 enum ErrorCode { |
| 38 NONE, | 35 NONE, |
| 39 VALUE_IN_USE, | 36 VALUE_IN_USE, |
| 40 ILLEGAL_ARGUMENT, | 37 ILLEGAL_ARGUMENT, |
| 41 }; | 38 }; |
| 42 | 39 |
| 43 // Each Window has support for two surfaces. Generally the |DEFAULT| surface | 40 // Each Window has support for two surfaces. Generally the |DEFAULT| surface |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 241 }; | 238 }; |
| 242 | 239 |
| 243 // Changes to windows are not sent to the connection that originated the | 240 // Changes to windows are not sent to the connection that originated the |
| 244 // change. For example, if connection 1 changes the bounds of a window by | 241 // change. For example, if connection 1 changes the bounds of a window by |
| 245 // calling SetWindowBounds(), connection 1 does not receive | 242 // calling SetWindowBounds(), connection 1 does not receive |
| 246 // OnWindowBoundsChanged(). | 243 // OnWindowBoundsChanged(). |
| 247 interface WindowTreeClient { | 244 interface WindowTreeClient { |
| 248 // Invoked when the client application has been embedded at |root|. | 245 // Invoked when the client application has been embedded at |root|. |
| 249 // See Embed() on WindowTree for more details. |tree| will be a handle back to | 246 // See Embed() on WindowTree for more details. |tree| will be a handle back to |
| 250 // the window manager service, unless the connection is to the root connection | 247 // the window manager service, unless the connection is to the root connection |
| 251 // in which case it will be null. | 248 // in which case it will be null. |parent_drawn| is true if roots parent is |
| 249 // drawn, see OnDrawnStateChanged() for details. | |
| 252 OnEmbed(uint16 connection_id, | 250 OnEmbed(uint16 connection_id, |
| 253 WindowData root, | 251 WindowData root, |
| 254 WindowTree? tree, | 252 WindowTree? tree, |
| 255 uint32 focused_window); | 253 uint32 focused_window, |
| 254 bool parent_drawn); | |
| 256 | 255 |
| 257 // Invoked when the application embedded at |window| is disconnected. In other | 256 // Invoked when the application embedded at |window| is disconnected. In other |
| 258 // words the embedded app closes the connection to the server. This is called | 257 // words the embedded app closes the connection to the server. This is called |
| 259 // on the connection that created |window| as well as any ancestors that have | 258 // on the connection that created |window| as well as any ancestors that have |
| 260 // the embed root policy. | 259 // the embed root policy. |
| 261 OnEmbeddedAppDisconnected(uint32 window); | 260 OnEmbeddedAppDisconnected(uint32 window); |
| 262 | 261 |
| 263 // Sent when another connection is embedded in the Window this connection was | 262 // Sent when another connection is embedded in the Window this connection was |
| 264 // previously embedded in. See Embed() for more information. | 263 // previously embedded in. See Embed() for more information. |
| 265 OnUnembed(uint32 window); | 264 OnUnembed(uint32 window); |
| 266 | 265 |
| 267 // Sent when a window loses capture. | 266 // Sent when a window loses capture. |
| 268 OnLostCapture(uint32 window); | 267 OnLostCapture(uint32 window); |
| 269 | 268 |
| 270 // Called in response to NewTopLevelWindow() successfully completing. | 269 // Called in response to NewTopLevelWindow() successfully completing. |
| 271 OnTopLevelCreated(uint32 change_id, WindowData data); | 270 // |parent_drawn| is true if the parent of the window is drawn, see |
| 271 // OnDrawnStateChanged() for details. | |
|
Ben Goodger (Google)
2016/04/06 15:57:04
OnWindowParentDrawnStateChanged()
sky
2016/04/07 02:33:57
Done.
| |
| 272 OnTopLevelCreated(uint32 change_id, WindowData data, bool parent_drawn); | |
| 272 | 273 |
| 273 // Invoked when a window's bounds have changed. | 274 // Invoked when a window's bounds have changed. |
| 274 OnWindowBoundsChanged(uint32 window, | 275 OnWindowBoundsChanged(uint32 window, |
| 275 mojo.Rect old_bounds, | 276 mojo.Rect old_bounds, |
| 276 mojo.Rect new_bounds); | 277 mojo.Rect new_bounds); |
| 277 | 278 |
| 278 OnClientAreaChanged(uint32 window_id, | 279 OnClientAreaChanged(uint32 window_id, |
| 279 mojo.Insets new_client_area, | 280 mojo.Insets new_client_area, |
| 280 array<mojo.Rect> new_additional_client_areas); | 281 array<mojo.Rect> new_additional_client_areas); |
| 281 | 282 |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 310 OnWindowReordered(uint32 window_id, | 311 OnWindowReordered(uint32 window_id, |
| 311 uint32 relative_window_id, | 312 uint32 relative_window_id, |
| 312 OrderDirection direction); | 313 OrderDirection direction); |
| 313 | 314 |
| 314 // Invoked when a window is deleted. | 315 // Invoked when a window is deleted. |
| 315 OnWindowDeleted(uint32 window); | 316 OnWindowDeleted(uint32 window); |
| 316 | 317 |
| 317 // Invoked when the visibility of the specified window changes. | 318 // Invoked when the visibility of the specified window changes. |
| 318 OnWindowVisibilityChanged(uint32 window, bool visible); | 319 OnWindowVisibilityChanged(uint32 window, bool visible); |
| 319 | 320 |
| 320 // Invoked when a change to the visibility of |window| or one if it's | 321 // Invoked when the drawn state of |window|'s parent changes. The drawn state |
| 321 // ancestors is done such that the drawn state changes. This is only invoked | 322 // is determined by the visibility of a Window and the Windows ancestors. A |
| 322 // for the top most window of a particular connection. For example, if you | 323 // Window is drawn if all ancestors are visible, not drawn if any ancestor is |
| 323 // have the hierarchy: A -> B1 -> B2 (B2 is a child of B1 and B1 a child of | 324 // hidden. |
| 324 // A), B1/B2 are from connection 2 and A from connection 1 with all windows | |
| 325 // visible and drawn and the visiblity of A changes to false, then connection | |
| 326 // 2 is told the drawn state of B1 has changed (to false), but is not told | |
| 327 // anything about B2 as it's drawn state can be calculated from that of B1. | |
| 328 // | 325 // |
| 329 // NOTE: This is not invoked if OnWindowVisibilityChanged() is invoked. | 326 // The initial drawn state is communicated by way of OnTopLevelCreated() or |
| 330 OnWindowDrawnStateChanged(uint32 window, bool drawn); | 327 // OnEmbed(). |
| 328 // | |
| 329 // This function is only called for root Windows as the drawn state of all | |
| 330 // other windows can be determined from their parent. | |
| 331 OnWindowParentDrawnStateChanged(uint32 window, bool drawn); | |
| 331 | 332 |
| 332 // Invoked when a window property is changed. If this change is a removal, | 333 // Invoked when a window property is changed. If this change is a removal, |
| 333 // |new_data| is null. | 334 // |new_data| is null. |
| 334 OnWindowSharedPropertyChanged(uint32 window, | 335 OnWindowSharedPropertyChanged(uint32 window, |
| 335 string name, | 336 string name, |
| 336 array<uint8>? new_data); | 337 array<uint8>? new_data); |
| 337 | 338 |
| 338 // Invoked when an event is targeted at the specified window. The client must | 339 // Invoked when an event is targeted at the specified window. The client must |
| 339 // call WindowTree::OnWindowInputEventAck() with the same |event_id| to notify | 340 // call WindowTree::OnWindowInputEventAck() with the same |event_id| to notify |
| 340 // that the event has been processed, and with a boolean |handled| to notify | 341 // that the event has been processed, and with a boolean |handled| to notify |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 362 // See description of WindowManager for details. | 363 // See description of WindowManager for details. |
| 363 GetWindowManager(associated WindowManager& internal); | 364 GetWindowManager(associated WindowManager& internal); |
| 364 }; | 365 }; |
| 365 | 366 |
| 366 // Mus provides this interface as a way for clients to connect and obtain a | 367 // Mus provides this interface as a way for clients to connect and obtain a |
| 367 // WindowTree handle with a supplied WindowTreeClient handle. The | 368 // WindowTree handle with a supplied WindowTreeClient handle. The |
| 368 // WindowTreeClient has no roots, use NewTopLevelWindow() to create one. | 369 // WindowTreeClient has no roots, use NewTopLevelWindow() to create one. |
| 369 interface WindowTreeFactory { | 370 interface WindowTreeFactory { |
| 370 CreateWindowTree(WindowTree& tree_request, WindowTreeClient client); | 371 CreateWindowTree(WindowTree& tree_request, WindowTreeClient client); |
| 371 }; | 372 }; |
| OLD | NEW |