| 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 "cc/ipc/surface_id.mojom"; | 7 import "cc/ipc/surface_id.mojom"; |
| 8 import "components/mus/public/interfaces/cursor.mojom"; | 8 import "components/mus/public/interfaces/cursor.mojom"; |
| 9 import "components/mus/public/interfaces/event_matcher.mojom"; | 9 import "components/mus/public/interfaces/event_matcher.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.mojom"; | 11 import "components/mus/public/interfaces/surface.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 "components/mus/public/interfaces/window_tree_constants.mojom"; | 14 import "components/mus/public/interfaces/window_tree_constants.mojom"; |
| 15 import "ui/events/mojo/event.mojom"; | 15 import "ui/events/mojo/event.mojom"; |
| 16 import "ui/gfx/geometry/mojo/geometry.mojom"; | 16 import "ui/gfx/geometry/mojo/geometry.mojom"; |
| 17 import "ui/platform_window/mojo/text_input_state.mojom"; | 17 import "ui/platform_window/mojo/text_input_state.mojom"; |
| 18 | 18 |
| 19 interface InputEventHandler { |
| 20 OnInputEvent(uint32 window_id, ui.mojom.Event event) => (bool handled); |
| 21 }; |
| 22 |
| 19 // Windows are identified by a uint32. The upper 16 bits are the connection id, | 23 // Windows are identified by a uint32. The upper 16 bits are the connection id, |
| 20 // and the lower 16 the id assigned by the client. | 24 // and the lower 16 the id assigned by the client. |
| 21 // | 25 // |
| 22 // The root window is identified with a connection id of 0, and value of 1. | 26 // The root window is identified with a connection id of 0, and value of 1. |
| 23 // | 27 // |
| 24 // Most functions to the WindowTree take a change_id parameter. When | 28 // Most functions to the WindowTree take a change_id parameter. When |
| 25 // WindowTree completes processing of a function WindowTree calls | 29 // WindowTree completes processing of a function WindowTree calls |
| 26 // WindowTreeClient::OnChangeCompleted() with the change_id supplied by the | 30 // WindowTreeClient::OnChangeCompleted() with the change_id supplied by the |
| 27 // client and the result of the function. This allows the client to track | 31 // client and the result of the function. This allows the client to track |
| 28 // whether the call succeeded or not. Calls are done via the client interface | 32 // whether the call succeeded or not. Calls are done via the client interface |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 // Embed() for the same window result in the currently embedded | 193 // Embed() for the same window result in the currently embedded |
| 190 // WindowTreeClient being removed. The embedded app is told this by way of | 194 // WindowTreeClient being removed. The embedded app is told this by way of |
| 191 // OnUnembed(), which is followed by OnWindowDeleted() (as the connection no | 195 // OnUnembed(), which is followed by OnWindowDeleted() (as the connection no |
| 192 // longer has access to the window). | 196 // longer has access to the window). |
| 193 // | 197 // |
| 194 // The embedder can detect when the embedded app disconnects by way of | 198 // The embedder can detect when the embedded app disconnects by way of |
| 195 // OnEmbeddedAppDisconnected(). | 199 // OnEmbeddedAppDisconnected(). |
| 196 // | 200 // |
| 197 // The callback returns whether the embedding was successful. | 201 // The callback returns whether the embedding was successful. |
| 198 Embed(uint32 window_id, WindowTreeClient client, uint32 embed_flags) | 202 Embed(uint32 window_id, WindowTreeClient client, uint32 embed_flags) |
| 199 => (bool success); | 203 => (bool success, InputEventHandler? event_handler); |
| 200 | 204 |
| 201 // Sets focus to the specified window, use 0 to clear focus. For a window to | 205 // Sets focus to the specified window, use 0 to clear focus. For a window to |
| 202 // get focus the following has to happen: the window is drawn, the window has | 206 // get focus the following has to happen: the window is drawn, the window has |
| 203 // been marked as focusable (see SetCanFocus()) and the window is in a | 207 // been marked as focusable (see SetCanFocus()) and the window is in a |
| 204 // container the WindowManager has identified as allowing activation | 208 // container the WindowManager has identified as allowing activation |
| 205 // (see WindowManagerClient::AddActivationParent()). | 209 // (see WindowManagerClient::AddActivationParent()). |
| 206 SetFocus(uint32 change_id, uint32 window_id); | 210 SetFocus(uint32 change_id, uint32 window_id); |
| 207 | 211 |
| 208 // Marks the specified window as being able to receive focus. | 212 // Marks the specified window as being able to receive focus. |
| 209 SetCanFocus(uint32 window_id, bool can_focus); | 213 SetCanFocus(uint32 window_id, bool can_focus); |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 // is 0. As with other functions this is only called if the client did not | 359 // is 0. As with other functions this is only called if the client did not |
| 356 // initiate the change. | 360 // initiate the change. |
| 357 OnWindowFocused(uint32 focused_window_id); | 361 OnWindowFocused(uint32 focused_window_id); |
| 358 | 362 |
| 359 OnWindowPredefinedCursorChanged(uint32 window_id, Cursor cursor_id); | 363 OnWindowPredefinedCursorChanged(uint32 window_id, Cursor cursor_id); |
| 360 | 364 |
| 361 // A change initiated from the client has completed. See description of | 365 // A change initiated from the client has completed. See description of |
| 362 // change ids for details. | 366 // change ids for details. |
| 363 OnChangeCompleted(uint32 change_id, bool success); | 367 OnChangeCompleted(uint32 change_id, bool success); |
| 364 | 368 |
| 369 RequestInputEventHandler(InputEventHandler& handler); |
| 370 |
| 365 // The WindowManager is requesting the specified window to close. If the | 371 // The WindowManager is requesting the specified window to close. If the |
| 366 // client allows the change it should delete the window. | 372 // client allows the change it should delete the window. |
| 367 RequestClose(uint32 window_id); | 373 RequestClose(uint32 window_id); |
| 368 | 374 |
| 369 // See description of WindowManager for details. | 375 // See description of WindowManager for details. |
| 370 GetWindowManager(associated WindowManager& internal); | 376 GetWindowManager(associated WindowManager& internal); |
| 371 }; | 377 }; |
| 372 | 378 |
| 373 // Mus provides this interface as a way for clients to connect and obtain a | 379 // Mus provides this interface as a way for clients to connect and obtain a |
| 374 // WindowTree handle with a supplied WindowTreeClient handle. The | 380 // WindowTree handle with a supplied WindowTreeClient handle. The |
| 375 // WindowTreeClient has no roots, use NewTopLevelWindow() to create one. | 381 // WindowTreeClient has no roots, use NewTopLevelWindow() to create one. |
| 376 interface WindowTreeFactory { | 382 interface WindowTreeFactory { |
| 377 CreateWindowTree(WindowTree& tree_request, WindowTreeClient client); | 383 CreateWindowTree(WindowTree& tree_request, WindowTreeClient client); |
| 378 }; | 384 }; |
| OLD | NEW |