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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
65 | 65 |
66 // Releases input event capture for the given |window_id|. This does nothing | 66 // Releases input event capture for the given |window_id|. This does nothing |
67 // if |window_id| does not currently have capture. | 67 // if |window_id| does not currently have capture. |
68 ReleaseCapture(uint32 change_id, uint32 window_id); | 68 ReleaseCapture(uint32 change_id, uint32 window_id); |
69 | 69 |
70 // Sets an observer that monitors all events, even if they are not targeted | 70 // Sets an observer that monitors all events, even if they are not targeted |
71 // at a window in this tree. If an event matchs |matcher| the observer reports | 71 // at a window in this tree. If an event matchs |matcher| the observer reports |
72 // it to the WindowTreeClient via OnWindowInputEvent (if the event target is | 72 // it to the WindowTreeClient via OnWindowInputEvent (if the event target is |
73 // this window tree) or OnEventObserved (if the target is another tree). The | 73 // this window tree) or OnEventObserved (if the target is another tree). The |
74 // client must supply a non-zero |observer_id|, which is reported back with | 74 // client must supply a non-zero |observer_id|, which is reported back with |
75 // observed events. Set the matcher to null to clear the observer. | 75 // observed events. |
76 SetEventObserver(EventMatcher? matcher, uint32 observer_id); | 76 AddEventObserver(EventMatcher? matcher, uint32 observer_id); |
sky
2016/07/08 15:41:11
In thinking about this a bit could we we implement
sadrul
2016/07/08 15:51:30
I think this would be possible (and how I was thin
riajiang
2016/07/11 20:13:22
Changed back to support only one event matcher wit
| |
77 | |
78 // Remove the event observer of the window tree with the observer_id. | |
79 RemoveEventObserver(uint32 observer_id); | |
77 | 80 |
78 // Sets the specified bounds of the specified window. | 81 // Sets the specified bounds of the specified window. |
79 SetWindowBounds(uint32 change_id, uint32 window_id, gfx.mojom.Rect bounds); | 82 SetWindowBounds(uint32 change_id, uint32 window_id, gfx.mojom.Rect bounds); |
80 | 83 |
81 // Sets the client area of the specified window. The client area is specified | 84 // Sets the client area of the specified window. The client area is specified |
82 // by way of insets. Everything outside of the insets, and not in | 85 // by way of insets. Everything outside of the insets, and not in |
83 // |additional_client_areas| is considered non-client area. | 86 // |additional_client_areas| is considered non-client area. |
84 // TODO(sky): convert additional_client_areas to a path. | 87 // TODO(sky): convert additional_client_areas to a path. |
85 SetClientArea(uint32 window_id, | 88 SetClientArea(uint32 window_id, |
86 gfx.mojom.Insets insets, | 89 gfx.mojom.Insets insets, |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
346 | 349 |
347 // Invoked when an event is targeted at the specified window. The client must | 350 // Invoked when an event is targeted at the specified window. The client must |
348 // call WindowTree::OnWindowInputEventAck() with the same |event_id| to notify | 351 // call WindowTree::OnWindowInputEventAck() with the same |event_id| to notify |
349 // that the event has been processed, and with an EventResult value to notify | 352 // that the event has been processed, and with an EventResult value to notify |
350 // if the event was consumed. |event_observer_id| is non-zero if the event | 353 // if the event was consumed. |event_observer_id| is non-zero if the event |
351 // also matched the active event observer for this client. The client will not | 354 // also matched the active event observer for this client. The client will not |
352 // receive farther events until the event is ack'ed. | 355 // receive farther events until the event is ack'ed. |
353 OnWindowInputEvent(uint32 event_id, | 356 OnWindowInputEvent(uint32 event_id, |
354 uint32 window, | 357 uint32 window, |
355 ui.mojom.Event event, | 358 ui.mojom.Event event, |
356 uint32 event_observer_id); | 359 array<uint32> event_observer_id); |
357 | 360 |
358 // Invoked when an |event| is sent via the EventObserver and not targeted at a | 361 // Invoked when an |event| is sent via the EventObserver and not targeted at a |
359 // specific window. The |event_observer_id| is the one supplied to | 362 // specific window. The |event_observer_id| is the one supplied to |
360 // SetEventObserver. The client should not acknowledge these events. | 363 // SetEventObserver. The client should not acknowledge these events. |
361 OnEventObserved(ui.mojom.Event event, uint32 event_observer_id); | 364 OnEventObserved(ui.mojom.Event event, array<uint32> event_observer_id); |
362 | 365 |
363 // Called in two distinct cases: when a window known to the connection gains | 366 // Called in two distinct cases: when a window known to the connection gains |
364 // focus, or when focus moves from a window known to the connection to a | 367 // focus, or when focus moves from a window known to the connection to a |
365 // window not known to the connection. In the later case |focused_window_id| | 368 // window not known to the connection. In the later case |focused_window_id| |
366 // is 0. As with other functions this is only called if the client did not | 369 // is 0. As with other functions this is only called if the client did not |
367 // initiate the change. | 370 // initiate the change. |
368 OnWindowFocused(uint32 focused_window_id); | 371 OnWindowFocused(uint32 focused_window_id); |
369 | 372 |
370 OnWindowPredefinedCursorChanged(uint32 window_id, Cursor cursor_id); | 373 OnWindowPredefinedCursorChanged(uint32 window_id, Cursor cursor_id); |
371 | 374 |
372 // A change initiated from the client has completed. See description of | 375 // A change initiated from the client has completed. See description of |
373 // change ids for details. | 376 // change ids for details. |
374 OnChangeCompleted(uint32 change_id, bool success); | 377 OnChangeCompleted(uint32 change_id, bool success); |
375 | 378 |
376 // The WindowManager is requesting the specified window to close. If the | 379 // The WindowManager is requesting the specified window to close. If the |
377 // client allows the change it should delete the window. | 380 // client allows the change it should delete the window. |
378 RequestClose(uint32 window_id); | 381 RequestClose(uint32 window_id); |
379 | 382 |
380 // See description of WindowManager for details. | 383 // See description of WindowManager for details. |
381 GetWindowManager(associated WindowManager& internal); | 384 GetWindowManager(associated WindowManager& internal); |
382 }; | 385 }; |
383 | 386 |
384 // Mus provides this interface as a way for clients to connect and obtain a | 387 // Mus provides this interface as a way for clients to connect and obtain a |
385 // WindowTree handle with a supplied WindowTreeClient handle. The | 388 // WindowTree handle with a supplied WindowTreeClient handle. The |
386 // WindowTreeClient has no roots, use NewTopLevelWindow() to create one. | 389 // WindowTreeClient has no roots, use NewTopLevelWindow() to create one. |
387 interface WindowTreeFactory { | 390 interface WindowTreeFactory { |
388 CreateWindowTree(WindowTree& tree_request, WindowTreeClient client); | 391 CreateWindowTree(WindowTree& tree_request, WindowTreeClient client); |
389 }; | 392 }; |
OLD | NEW |