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 ui.mojom; | 5 module ui.mojom; |
| 6 | 6 |
| 7 import "cc/ipc/surface_id.mojom"; | 7 import "cc/ipc/surface_id.mojom"; |
| 8 import "services/ui/public/interfaces/cursor.mojom"; | 8 import "services/ui/public/interfaces/cursor.mojom"; |
| 9 import "services/ui/public/interfaces/event_matcher.mojom"; | 9 import "services/ui/public/interfaces/event_matcher.mojom"; |
| 10 import "services/ui/public/interfaces/mus_constants.mojom"; | 10 import "services/ui/public/interfaces/mus_constants.mojom"; |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 80 // Releases input event capture for the given |window_id|. This does nothing | 80 // Releases input event capture for the given |window_id|. This does nothing |
| 81 // if |window_id| does not currently have capture. | 81 // if |window_id| does not currently have capture. |
| 82 ReleaseCapture(uint32 change_id, uint32 window_id); | 82 ReleaseCapture(uint32 change_id, uint32 window_id); |
| 83 | 83 |
| 84 // Starts the pointer watcher that monitors pointer events (up/down events if | 84 // Starts the pointer watcher that monitors pointer events (up/down events if |
| 85 // |wants_moves| is false, up/down and move if |wants_moves| is true), even if | 85 // |wants_moves| is false, up/down and move if |wants_moves| is true), even if |
| 86 // they are not targeted at a window in this tree. For pointer events that | 86 // they are not targeted at a window in this tree. For pointer events that |
| 87 // would normally be sent to the requesting client (if the event target is | 87 // would normally be sent to the requesting client (if the event target is |
| 88 // this window tree) OnWindowInputEvent() is called, all other matching | 88 // this window tree) OnWindowInputEvent() is called, all other matching |
| 89 // pointer events (if the target is another tree) result in | 89 // pointer events (if the target is another tree) result in |
| 90 // OnPointerEventObserved(). The client must supply a non-zero | 90 // OnPointerEventObserved(). There is only ever one pointer watcher active at |
| 91 // |pointer_watcher_id|, which is reported back with matched events. There is | 91 // a given time. The client should prefer |want_moves| to be false, as there's |
| 92 // only ever one pointer watcher active at a given time. The client should | 92 // a system-wide performance/ battery penalty for listening to moves. |
|
msw
2016/08/18 22:45:23
nit: no space after slash
sky
2016/08/18 23:17:14
Done.
| |
| 93 // prefer |want_moves| to be false, as there's a system-wide performance/ | |
| 94 // battery penalty for listening to moves. | |
| 95 // | 93 // |
| 96 // See class description for details on event delivery. | 94 // See class description for details on event delivery. |
| 97 StartPointerWatcher(bool want_moves, uint32 pointer_watcher_id); | 95 StartPointerWatcher(bool want_moves); |
| 98 | 96 |
| 99 // Stops the pointer watcher for all events. | 97 // Stops the pointer watcher for all events. |
| 100 StopPointerWatcher(); | 98 StopPointerWatcher(); |
| 101 | 99 |
| 102 // Sets the specified bounds of the specified window. | 100 // Sets the specified bounds of the specified window. |
| 103 SetWindowBounds(uint32 change_id, uint32 window_id, gfx.mojom.Rect bounds); | 101 SetWindowBounds(uint32 change_id, uint32 window_id, gfx.mojom.Rect bounds); |
| 104 | 102 |
| 105 // Sets the client area of the specified window. The client area is specified | 103 // Sets the client area of the specified window. The client area is specified |
| 106 // by way of insets. Everything outside of the insets, and not in | 104 // by way of insets. Everything outside of the insets, and not in |
| 107 // |additional_client_areas| is considered non-client area. | 105 // |additional_client_areas| is considered non-client area. |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 369 | 367 |
| 370 // Invoked when a window property is changed. If this change is a removal, | 368 // Invoked when a window property is changed. If this change is a removal, |
| 371 // |new_data| is null. | 369 // |new_data| is null. |
| 372 OnWindowSharedPropertyChanged(uint32 window, | 370 OnWindowSharedPropertyChanged(uint32 window, |
| 373 string name, | 371 string name, |
| 374 array<uint8>? new_data); | 372 array<uint8>? new_data); |
| 375 | 373 |
| 376 // Invoked when an event is targeted at the specified window. The client must | 374 // Invoked when an event is targeted at the specified window. The client must |
| 377 // call WindowTree::OnWindowInputEventAck() with the same |event_id| to notify | 375 // call WindowTree::OnWindowInputEventAck() with the same |event_id| to notify |
| 378 // that the event has been processed, and with an EventResult value to notify | 376 // that the event has been processed, and with an EventResult value to notify |
| 379 // if the event was consumed. |pointer_watcher_id| is the id supplied to | 377 // if the event was consumed. |matches_pointer_watcher| is true if the client |
| 380 // StartPointerWatcher() if the event is a pointer event and the client called | 378 // has called StartPointerWatcher() and the event matches the type of events |
| 381 // StartPointerWatcher(). The client will not receive farther events until the | 379 // specified by StartPointerWatcher(). The client will not receive farther |
| 382 // event is ack'ed. | 380 // events until the event is ack'ed. |
|
msw
2016/08/18 22:45:23
optional nit: clarify if pointer watcher events sh
sky
2016/08/18 23:17:14
Done.
| |
| 383 OnWindowInputEvent(uint32 event_id, | 381 OnWindowInputEvent(uint32 event_id, |
| 384 uint32 window, | 382 uint32 window, |
| 385 ui.mojom.Event event, | 383 ui.mojom.Event event, |
| 386 uint32 pointer_watcher_id); | 384 bool matches_pointer_watcher); |
| 387 | 385 |
| 388 // Called when a pointer event that would not normally be targeted at this | 386 // Called when a pointer event that would not normally be targeted at this |
|
msw
2016/08/18 22:45:23
aside q: Could we fold this into OnWindowInputEven
sky
2016/08/18 23:17:14
We certainly could, but in some ways it's nice to
| |
| 389 // client is encountered and the client called StartPointerWatcher(). The | 387 // client is encountered and the client called StartPointerWatcher(). See |
| 390 // |pointer_watcher_id| is the one supplied to StartPointerWatcher(). See | |
| 391 // StartPointerWatcher() for details. |window_id| is the window id of the | 388 // StartPointerWatcher() for details. |window_id| is the window id of the |
| 392 // event target, or 0 if the window is not known to this client. The | 389 // event target, or 0 if the window is not known to this client. The |
| 393 // client should not acknowledge these events. | 390 // client should not acknowledge these events. |
| 394 OnPointerEventObserved(ui.mojom.Event event, | 391 OnPointerEventObserved(ui.mojom.Event event, uint32 window_id); |
| 395 uint32 pointer_watcher_id, | |
| 396 uint32 window_id); | |
| 397 | 392 |
| 398 // Called in two distinct cases: when a window known to the connection gains | 393 // Called in two distinct cases: when a window known to the connection gains |
| 399 // focus, or when focus moves from a window known to the connection to a | 394 // focus, or when focus moves from a window known to the connection to a |
| 400 // window not known to the connection. In the later case |focused_window_id| | 395 // window not known to the connection. In the later case |focused_window_id| |
| 401 // is 0. As with other functions this is only called if the client did not | 396 // is 0. As with other functions this is only called if the client did not |
| 402 // initiate the change. | 397 // initiate the change. |
| 403 OnWindowFocused(uint32 focused_window_id); | 398 OnWindowFocused(uint32 focused_window_id); |
| 404 | 399 |
| 405 OnWindowPredefinedCursorChanged(uint32 window_id, Cursor cursor_id); | 400 OnWindowPredefinedCursorChanged(uint32 window_id, Cursor cursor_id); |
| 406 | 401 |
| 407 // A change initiated from the client has completed. See description of | 402 // A change initiated from the client has completed. See description of |
| 408 // change ids for details. | 403 // change ids for details. |
| 409 OnChangeCompleted(uint32 change_id, bool success); | 404 OnChangeCompleted(uint32 change_id, bool success); |
| 410 | 405 |
| 411 // The WindowManager is requesting the specified window to close. If the | 406 // The WindowManager is requesting the specified window to close. If the |
| 412 // client allows the change it should delete the window. | 407 // client allows the change it should delete the window. |
| 413 RequestClose(uint32 window_id); | 408 RequestClose(uint32 window_id); |
| 414 | 409 |
| 415 // See description of WindowManager for details. | 410 // See description of WindowManager for details. |
| 416 GetWindowManager(associated WindowManager& internal); | 411 GetWindowManager(associated WindowManager& internal); |
| 417 }; | 412 }; |
| 418 | 413 |
| 419 // Mus provides this interface as a way for clients to connect and obtain a | 414 // Mus provides this interface as a way for clients to connect and obtain a |
| 420 // WindowTree handle with a supplied WindowTreeClient handle. The | 415 // WindowTree handle with a supplied WindowTreeClient handle. The |
| 421 // WindowTreeClient has no roots, use NewTopLevelWindow() to create one. | 416 // WindowTreeClient has no roots, use NewTopLevelWindow() to create one. |
| 422 interface WindowTreeFactory { | 417 interface WindowTreeFactory { |
| 423 CreateWindowTree(WindowTree& tree_request, WindowTreeClient client); | 418 CreateWindowTree(WindowTree& tree_request, WindowTreeClient client); |
| 424 }; | 419 }; |
| OLD | NEW |