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

Side by Side Diff: services/ui/public/interfaces/window_tree.mojom

Issue 2183163002: mus: Change PointerWatcher to observe all pointer events, with moves optional. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change to use PointerEvent. Created 4 years, 4 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
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 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 // current input events are canceled. The given window will receive all 73 // current input events are canceled. The given window will receive all
74 // subsequent input until an alternate window is set via SetCapture, or 74 // subsequent input until an alternate window is set via SetCapture, or
75 // ReleaseCapture is called for |window_id|. OnLostCapture is called to notify 75 // ReleaseCapture is called for |window_id|. OnLostCapture is called to notify
76 // of capture ending. 76 // of capture ending.
77 SetCapture(uint32 change_id, uint32 window_id); 77 SetCapture(uint32 change_id, uint32 window_id);
78 78
79 // Releases input event capture for the given |window_id|. This does nothing 79 // Releases input event capture for the given |window_id|. This does nothing
80 // if |window_id| does not currently have capture. 80 // if |window_id| does not currently have capture.
81 ReleaseCapture(uint32 change_id, uint32 window_id); 81 ReleaseCapture(uint32 change_id, uint32 window_id);
82 82
83 // Sets an observer that monitors all events, even if they are not targeted 83 // Starts the pointer watcher that monitors all events (including move events
84 // at a window in this tree. If an event matchs |matcher| the observer reports 84 // if |want_moves| is true), even if they are not targeted at a window in this
85 // it to the WindowTreeClient via OnWindowInputEvent (if the event target is 85 // tree. If an event matches the pointer watcher the observer reports it to
86 // this window tree) or OnEventObserved (if the target is another tree). The 86 // the WindowTreeClient via OnWindowInputEvent (if the event target is this
87 // client must supply a non-zero |observer_id|, which is reported back with 87 // window tree) or OnEventObserved (if the target is another tree). The client
88 // observed events. Set the matcher to null to clear the observer. 88 // must supply a non-zero |observer_id|, which is reported back with observed
89 // events.
89 // 90 //
James Cook 2016/07/27 01:54:01 I would add a note (or revise the above) to say th
riajiang 2016/07/27 22:39:16 Done.
90 // See class description for details on event delivery. 91 // See class description for details on event delivery.
91 SetEventObserver(EventMatcher? matcher, uint32 observer_id); 92 StartPointerWatcher(bool want_moves, uint32 observer_id);
93
94 // Stops the pointer watcher for all events.
95 StopPointerWatcher();
92 96
93 // Sets the specified bounds of the specified window. 97 // Sets the specified bounds of the specified window.
94 SetWindowBounds(uint32 change_id, uint32 window_id, gfx.mojom.Rect bounds); 98 SetWindowBounds(uint32 change_id, uint32 window_id, gfx.mojom.Rect bounds);
95 99
96 // Sets the client area of the specified window. The client area is specified 100 // Sets the client area of the specified window. The client area is specified
97 // by way of insets. Everything outside of the insets, and not in 101 // by way of insets. Everything outside of the insets, and not in
98 // |additional_client_areas| is considered non-client area. 102 // |additional_client_areas| is considered non-client area.
99 // TODO(sky): convert additional_client_areas to a path. 103 // TODO(sky): convert additional_client_areas to a path.
100 SetClientArea(uint32 window_id, 104 SetClientArea(uint32 window_id,
101 gfx.mojom.Insets insets, 105 gfx.mojom.Insets insets,
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 363
360 // Invoked when a window property is changed. If this change is a removal, 364 // Invoked when a window property is changed. If this change is a removal,
361 // |new_data| is null. 365 // |new_data| is null.
362 OnWindowSharedPropertyChanged(uint32 window, 366 OnWindowSharedPropertyChanged(uint32 window,
363 string name, 367 string name,
364 array<uint8>? new_data); 368 array<uint8>? new_data);
365 369
366 // Invoked when an event is targeted at the specified window. The client must 370 // Invoked when an event is targeted at the specified window. The client must
367 // call WindowTree::OnWindowInputEventAck() with the same |event_id| to notify 371 // call WindowTree::OnWindowInputEventAck() with the same |event_id| to notify
368 // that the event has been processed, and with an EventResult value to notify 372 // that the event has been processed, and with an EventResult value to notify
369 // if the event was consumed. |event_observer_id| is non-zero if the event 373 // if the event was consumed. |pointer_watcher_id| is non-zero if the event
370 // also matched the active event observer for this client. The client will not 374 // also matched the active pointer watcher for this client. The client will
371 // receive farther events until the event is ack'ed. 375 // not receive farther events until the event is ack'ed.
372 OnWindowInputEvent(uint32 event_id, 376 OnWindowInputEvent(uint32 event_id,
373 uint32 window, 377 uint32 window,
374 ui.mojom.Event event, 378 ui.mojom.Event event,
375 uint32 event_observer_id); 379 uint32 pointer_watcher_id);
376 380
377 // Invoked when an |event| is sent via the EventObserver and not targeted at a 381 // Invoked when an |event| is sent via the EventObserver and not targeted at a
378 // specific window. The |event_observer_id| is the one supplied to 382 // specific window. The |pointer_watcher_id| is the one supplied to
379 // SetEventObserver. The client should not acknowledge these events. 383 // StartPointerWatcher. The client should not acknowledge these events.
380 OnEventObserved(ui.mojom.Event event, uint32 event_observer_id); 384 OnEventObserved(ui.mojom.Event event, uint32 pointer_watcher_id);
James Cook 2016/07/27 01:54:01 I think this should be renamed to OnPointerWatcher
riajiang 2016/07/27 22:39:16 No worries, done :)
381 385
382 // Called in two distinct cases: when a window known to the connection gains 386 // Called in two distinct cases: when a window known to the connection gains
383 // focus, or when focus moves from a window known to the connection to a 387 // focus, or when focus moves from a window known to the connection to a
384 // window not known to the connection. In the later case |focused_window_id| 388 // window not known to the connection. In the later case |focused_window_id|
385 // is 0. As with other functions this is only called if the client did not 389 // is 0. As with other functions this is only called if the client did not
386 // initiate the change. 390 // initiate the change.
387 OnWindowFocused(uint32 focused_window_id); 391 OnWindowFocused(uint32 focused_window_id);
388 392
389 OnWindowPredefinedCursorChanged(uint32 window_id, Cursor cursor_id); 393 OnWindowPredefinedCursorChanged(uint32 window_id, Cursor cursor_id);
390 394
391 // A change initiated from the client has completed. See description of 395 // A change initiated from the client has completed. See description of
392 // change ids for details. 396 // change ids for details.
393 OnChangeCompleted(uint32 change_id, bool success); 397 OnChangeCompleted(uint32 change_id, bool success);
394 398
395 // The WindowManager is requesting the specified window to close. If the 399 // The WindowManager is requesting the specified window to close. If the
396 // client allows the change it should delete the window. 400 // client allows the change it should delete the window.
397 RequestClose(uint32 window_id); 401 RequestClose(uint32 window_id);
398 402
399 // See description of WindowManager for details. 403 // See description of WindowManager for details.
400 GetWindowManager(associated WindowManager& internal); 404 GetWindowManager(associated WindowManager& internal);
401 }; 405 };
402 406
403 // Mus provides this interface as a way for clients to connect and obtain a 407 // Mus provides this interface as a way for clients to connect and obtain a
404 // WindowTree handle with a supplied WindowTreeClient handle. The 408 // WindowTree handle with a supplied WindowTreeClient handle. The
405 // WindowTreeClient has no roots, use NewTopLevelWindow() to create one. 409 // WindowTreeClient has no roots, use NewTopLevelWindow() to create one.
406 interface WindowTreeFactory { 410 interface WindowTreeFactory {
407 CreateWindowTree(WindowTree& tree_request, WindowTreeClient client); 411 CreateWindowTree(WindowTree& tree_request, WindowTreeClient client);
408 }; 412 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698