Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(182)

Side by Side Diff: components/mus/public/interfaces/window_tree.mojom

Issue 1909733002: mus: Add EventObserver to allow passively listening to UI events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/mus/public/interfaces/input_event_matcher.mojom ('k') | components/mus/ws/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 OnWindowInputEvent (if the event target is
116 // this window tree) or OnEventObserved (if the target is another tree). The
117 // client must supply a non-zero |observer_id|, which is reported back with
118 // observed events. Set the matcher to null to clear the observer.
119 SetEventObserver(EventMatcher? matcher, uint32 observer_id);
sadrul 2016/04/23 01:24:39 This feels fairly awkward. What happens if multipl
James Cook 2016/04/25 16:23:35 I don't understand. You can't have multiple EventM
sadrul 2016/04/25 16:33:34 I realized this after I left the comment. My initi
James Cook 2016/04/25 16:52:00 I agree that the observer_id thing feels weird (yo
120
112 // Sets the specified bounds of the specified window. 121 // Sets the specified bounds of the specified window.
113 SetWindowBounds(uint32 change_id, uint32 window_id, mojo.Rect bounds); 122 SetWindowBounds(uint32 change_id, uint32 window_id, mojo.Rect bounds);
114 123
115 // Sets the client area of the specified window. The client area is specified 124 // 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 125 // by way of insets. Everything outside of the insets, and not in
117 // |additional_client_areas| is considered non-client area. 126 // |additional_client_areas| is considered non-client area.
118 // TODO(sky): convert additional_client_areas to a path. 127 // TODO(sky): convert additional_client_areas to a path.
119 SetClientArea(uint32 window_id, 128 SetClientArea(uint32 window_id,
120 mojo.Insets insets, 129 mojo.Insets insets,
121 array<mojo.Rect>? additional_client_areas); 130 array<mojo.Rect>? additional_client_areas);
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 360
352 // Invoked when a window property is changed. If this change is a removal, 361 // Invoked when a window property is changed. If this change is a removal,
353 // |new_data| is null. 362 // |new_data| is null.
354 OnWindowSharedPropertyChanged(uint32 window, 363 OnWindowSharedPropertyChanged(uint32 window,
355 string name, 364 string name,
356 array<uint8>? new_data); 365 array<uint8>? new_data);
357 366
358 // Invoked when an event is targeted at the specified window. The client must 367 // Invoked when an event is targeted at the specified window. The client must
359 // call WindowTree::OnWindowInputEventAck() with the same |event_id| to notify 368 // call WindowTree::OnWindowInputEventAck() with the same |event_id| to notify
360 // that the event has been processed, and with an EventResult value to notify 369 // 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 370 // if the event was consumed. |event_observer_id| is non-zero if the event
362 // the event is ack'ed. 371 // also matched the active event observer for this client. The client will not
363 OnWindowInputEvent(uint32 event_id, uint32 window, Event event); 372 // receive farther events until the event is ack'ed.
373 OnWindowInputEvent(uint32 event_id,
374 uint32 window,
375 Event event,
376 uint32 event_observer_id);
377
378 // Invoked when an |event| is sent via the EventObserver and not targeted at a
379 // specific window. The |event_observer_id| is the one supplied to
380 // SetEventObserver. The client should not acknowledge these events.
381 OnEventObserved(Event event, uint32 event_observer_id);
364 382
365 // Called in two distinct cases: when a window known to the connection gains 383 // 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 384 // 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| 385 // 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 386 // is 0. As with other functions this is only called if the client did not
369 // initiate the change. 387 // initiate the change.
370 OnWindowFocused(uint32 focused_window_id); 388 OnWindowFocused(uint32 focused_window_id);
371 389
372 OnWindowPredefinedCursorChanged(uint32 window_id, Cursor cursor_id); 390 OnWindowPredefinedCursorChanged(uint32 window_id, Cursor cursor_id);
373 391
374 // A change initiated from the client has completed. See description of 392 // A change initiated from the client has completed. See description of
375 // change ids for details. 393 // change ids for details.
376 OnChangeCompleted(uint32 change_id, bool success); 394 OnChangeCompleted(uint32 change_id, bool success);
377 395
378 // The WindowManager is requesting the specified window to close. If the 396 // The WindowManager is requesting the specified window to close. If the
379 // client allows the change it should delete the window. 397 // client allows the change it should delete the window.
380 RequestClose(uint32 window_id); 398 RequestClose(uint32 window_id);
381 399
382 // See description of WindowManager for details. 400 // See description of WindowManager for details.
383 GetWindowManager(associated WindowManager& internal); 401 GetWindowManager(associated WindowManager& internal);
384 }; 402 };
385 403
386 // Mus provides this interface as a way for clients to connect and obtain a 404 // Mus provides this interface as a way for clients to connect and obtain a
387 // WindowTree handle with a supplied WindowTreeClient handle. The 405 // WindowTree handle with a supplied WindowTreeClient handle. The
388 // WindowTreeClient has no roots, use NewTopLevelWindow() to create one. 406 // WindowTreeClient has no roots, use NewTopLevelWindow() to create one.
389 interface WindowTreeFactory { 407 interface WindowTreeFactory {
390 CreateWindowTree(WindowTree& tree_request, WindowTreeClient client); 408 CreateWindowTree(WindowTree& tree_request, WindowTreeClient client);
391 }; 409 };
OLDNEW
« no previous file with comments | « components/mus/public/interfaces/input_event_matcher.mojom ('k') | components/mus/ws/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698