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/input_event_matcher.mojom"; | |
| 10 import "components/mus/public/interfaces/mus_constants.mojom"; | 11 import "components/mus/public/interfaces/mus_constants.mojom"; |
| 11 import "components/mus/public/interfaces/surface_id.mojom"; | 12 import "components/mus/public/interfaces/surface_id.mojom"; |
| 12 import "components/mus/public/interfaces/window_manager.mojom"; | 13 import "components/mus/public/interfaces/window_manager.mojom"; |
| 13 import "components/mus/public/interfaces/window_manager_constants.mojom"; | 14 import "components/mus/public/interfaces/window_manager_constants.mojom"; |
| 14 import "ui/mojo/geometry/geometry.mojom"; | 15 import "ui/mojo/geometry/geometry.mojom"; |
| 15 import "ui/mojo/ime/text_input_state.mojom"; | 16 import "ui/mojo/ime/text_input_state.mojom"; |
| 16 | 17 |
| 17 struct ViewportMetrics { | 18 struct ViewportMetrics { |
| 18 mojo.Size size_in_pixels; | 19 mojo.Size size_in_pixels; |
| 19 // A value of 0 indicates the real value is not yet available. | 20 // A value of 0 indicates the real value is not yet available. |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 102 // current input events are canceled. The given window will receive all | 103 // current input events are canceled. The given window will receive all |
| 103 // subsequent input until an alternate window is set via SetCapture, or | 104 // subsequent input until an alternate window is set via SetCapture, or |
| 104 // ReleaseCapture is called for |window_id|. OnLostCapture is called to notify | 105 // ReleaseCapture is called for |window_id|. OnLostCapture is called to notify |
| 105 // of capture ending. | 106 // of capture ending. |
| 106 SetCapture(uint32 change_id, uint32 window_id); | 107 SetCapture(uint32 change_id, uint32 window_id); |
| 107 | 108 |
| 108 // Releases input event capture for the given |window_id|. This does nothing | 109 // Releases input event capture for the given |window_id|. This does nothing |
| 109 // if |window_id| does not currently have capture. | 110 // if |window_id| does not currently have capture. |
| 110 ReleaseCapture(uint32 change_id, uint32 window_id); | 111 ReleaseCapture(uint32 change_id, uint32 window_id); |
| 111 | 112 |
| 113 // Sets an observer that monitors all events, even if they are not targeted | |
| 114 // at a window in this tree. If an event matchs |matcher| the observer reports | |
| 115 // it to the WindowTreeClient via OnEventObserved(). Each client may only have | |
| 116 // one observer at a time. | |
| 117 SetEventObserver(EventMatcher matcher); | |
|
sky
2016/04/21 17:23:03
Declare this as EventMatcher?, then you can pass i
James Cook
2016/04/22 18:22:54
Done.
| |
| 118 ClearEventObserver(); | |
| 119 | |
| 112 // Sets the specified bounds of the specified window. | 120 // Sets the specified bounds of the specified window. |
| 113 SetWindowBounds(uint32 change_id, uint32 window_id, mojo.Rect bounds); | 121 SetWindowBounds(uint32 change_id, uint32 window_id, mojo.Rect bounds); |
| 114 | 122 |
| 115 // Sets the client area of the specified window. The client area is specified | 123 // Sets the client area of the specified window. The client area is specified |
| 116 // by way of insets. Everything outside of the insets, and not in | 124 // by way of insets. Everything outside of the insets, and not in |
| 117 // |additional_client_areas| is considered non-client area. | 125 // |additional_client_areas| is considered non-client area. |
| 118 // TODO(sky): convert additional_client_areas to a path. | 126 // TODO(sky): convert additional_client_areas to a path. |
| 119 SetClientArea(uint32 window_id, | 127 SetClientArea(uint32 window_id, |
| 120 mojo.Insets insets, | 128 mojo.Insets insets, |
| 121 array<mojo.Rect>? additional_client_areas); | 129 array<mojo.Rect>? additional_client_areas); |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 355 string name, | 363 string name, |
| 356 array<uint8>? new_data); | 364 array<uint8>? new_data); |
| 357 | 365 |
| 358 // Invoked when an event is targeted at the specified window. The client must | 366 // Invoked when an event is targeted at the specified window. The client must |
| 359 // call WindowTree::OnWindowInputEventAck() with the same |event_id| to notify | 367 // call WindowTree::OnWindowInputEventAck() with the same |event_id| to notify |
| 360 // that the event has been processed, and with an EventResult value to notify | 368 // that the event has been processed, and with an EventResult value to notify |
| 361 // if the event was consumed. The client will not receive farther events until | 369 // if the event was consumed. The client will not receive farther events until |
| 362 // the event is ack'ed. | 370 // the event is ack'ed. |
| 363 OnWindowInputEvent(uint32 event_id, uint32 window, Event event); | 371 OnWindowInputEvent(uint32 event_id, uint32 window, Event event); |
| 364 | 372 |
| 373 // Invoked when an event is sent via the EventObserver. Not targeted at a | |
| 374 // specific window. The client does not need to acknowledge these events. | |
| 375 OnEventObserved(Event event); | |
| 376 | |
| 365 // Called in two distinct cases: when a window known to the connection gains | 377 // Called in two distinct cases: when a window known to the connection gains |
| 366 // focus, or when focus moves from a window known to the connection to a | 378 // focus, or when focus moves from a window known to the connection to a |
| 367 // window not known to the connection. In the later case |focused_window_id| | 379 // window not known to the connection. In the later case |focused_window_id| |
| 368 // is 0. As with other functions this is only called if the client did not | 380 // is 0. As with other functions this is only called if the client did not |
| 369 // initiate the change. | 381 // initiate the change. |
| 370 OnWindowFocused(uint32 focused_window_id); | 382 OnWindowFocused(uint32 focused_window_id); |
| 371 | 383 |
| 372 OnWindowPredefinedCursorChanged(uint32 window_id, Cursor cursor_id); | 384 OnWindowPredefinedCursorChanged(uint32 window_id, Cursor cursor_id); |
| 373 | 385 |
| 374 // A change initiated from the client has completed. See description of | 386 // A change initiated from the client has completed. See description of |
| 375 // change ids for details. | 387 // change ids for details. |
| 376 OnChangeCompleted(uint32 change_id, bool success); | 388 OnChangeCompleted(uint32 change_id, bool success); |
| 377 | 389 |
| 378 // The WindowManager is requesting the specified window to close. If the | 390 // The WindowManager is requesting the specified window to close. If the |
| 379 // client allows the change it should delete the window. | 391 // client allows the change it should delete the window. |
| 380 RequestClose(uint32 window_id); | 392 RequestClose(uint32 window_id); |
| 381 | 393 |
| 382 // See description of WindowManager for details. | 394 // See description of WindowManager for details. |
| 383 GetWindowManager(associated WindowManager& internal); | 395 GetWindowManager(associated WindowManager& internal); |
| 384 }; | 396 }; |
| 385 | 397 |
| 386 // Mus provides this interface as a way for clients to connect and obtain a | 398 // Mus provides this interface as a way for clients to connect and obtain a |
| 387 // WindowTree handle with a supplied WindowTreeClient handle. The | 399 // WindowTree handle with a supplied WindowTreeClient handle. The |
| 388 // WindowTreeClient has no roots, use NewTopLevelWindow() to create one. | 400 // WindowTreeClient has no roots, use NewTopLevelWindow() to create one. |
| 389 interface WindowTreeFactory { | 401 interface WindowTreeFactory { |
| 390 CreateWindowTree(WindowTree& tree_request, WindowTreeClient client); | 402 CreateWindowTree(WindowTree& tree_request, WindowTreeClient client); |
| 391 }; | 403 }; |
| OLD | NEW |