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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 // TODO(sky): convert additional_client_areas to a path. | 106 // TODO(sky): convert additional_client_areas to a path. |
107 SetClientArea(uint32 window_id, | 107 SetClientArea(uint32 window_id, |
108 gfx.mojom.Insets insets, | 108 gfx.mojom.Insets insets, |
109 array<gfx.mojom.Rect>? additional_client_areas); | 109 array<gfx.mojom.Rect>? additional_client_areas); |
110 | 110 |
111 // Mouse events outside a hit test mask do not hit the window. The |mask| is | 111 // Mouse events outside a hit test mask do not hit the window. The |mask| is |
112 // in window local coordinates. Pass null to clear the mask. | 112 // in window local coordinates. Pass null to clear the mask. |
113 // TODO(jamescook): Convert |mask| to a path. http://crbug.com/613210 | 113 // TODO(jamescook): Convert |mask| to a path. http://crbug.com/613210 |
114 SetHitTestMask(uint32 window_id, gfx.mojom.Rect? mask); | 114 SetHitTestMask(uint32 window_id, gfx.mojom.Rect? mask); |
115 | 115 |
| 116 // Called by clients that want to accept drag and drops. Windows default to |
| 117 // this being disabled; a window must actively opt-in to receiving OnDrag*() |
| 118 // calls. |
| 119 SetCanAcceptDrops(uint32 window_id, bool accepts_drops); |
| 120 |
116 // Sets the visibility of the specified window to |visible|. Connections are | 121 // Sets the visibility of the specified window to |visible|. Connections are |
117 // allowed to change the visibility of any window they have created, as well | 122 // allowed to change the visibility of any window they have created, as well |
118 // as any of their roots. | 123 // as any of their roots. |
119 SetWindowVisibility(uint32 change_id, uint32 window_id, bool visible); | 124 SetWindowVisibility(uint32 change_id, uint32 window_id, bool visible); |
120 | 125 |
121 // Sets an individual named property. Setting an individual property to null | 126 // Sets an individual named property. Setting an individual property to null |
122 // deletes the property. | 127 // deletes the property. |
123 SetWindowProperty(uint32 change_id, | 128 SetWindowProperty(uint32 change_id, |
124 uint32 window_id, | 129 uint32 window_id, |
125 string name, | 130 string name, |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 // Tells the window manager to start moving the window. OnChangeCompleted is | 268 // Tells the window manager to start moving the window. OnChangeCompleted is |
264 // called on whether the move was canceled. Because there's a delay between | 269 // called on whether the move was canceled. Because there's a delay between |
265 // when a client sends this message and when the window manager starts acting | 270 // when a client sends this message and when the window manager starts acting |
266 // on it, pass the cursor location at the start of the move. | 271 // on it, pass the cursor location at the start of the move. |
267 PerformWindowMove(uint32 change_id, uint32 window_id, MoveLoopSource source, | 272 PerformWindowMove(uint32 change_id, uint32 window_id, MoveLoopSource source, |
268 gfx.mojom.Point cursor); | 273 gfx.mojom.Point cursor); |
269 | 274 |
270 // Tells the window manager to cancel any in progress window move started with | 275 // Tells the window manager to cancel any in progress window move started with |
271 // StartWindowMove() and to revert the window bounds to how they were. | 276 // StartWindowMove() and to revert the window bounds to how they were. |
272 CancelWindowMove(uint32 window_id); | 277 CancelWindowMove(uint32 window_id); |
| 278 |
| 279 // Called by the client to start a drag operation. |source_window_id| is the |
| 280 // source window, |drag_data| is the entire set of mime to raw data |
| 281 // mapping. We send this during the start of the drag because most views |
| 282 // clients will try to read all this data on first entry. |
| 283 PerformDragDrop(uint32 change_id, |
| 284 uint32 source_window_id, |
| 285 int32 drag_pointer, |
| 286 map<string, array<uint8>> drag_data, |
| 287 uint32 drag_operation); |
273 }; | 288 }; |
274 | 289 |
275 // Changes to windows are not sent to the connection that originated the | 290 // Changes to windows are not sent to the connection that originated the |
276 // change. For example, if connection 1 changes the bounds of a window by | 291 // change. For example, if connection 1 changes the bounds of a window by |
277 // calling SetWindowBounds(), connection 1 does not receive | 292 // calling SetWindowBounds(), connection 1 does not receive |
278 // OnWindowBoundsChanged(). | 293 // OnWindowBoundsChanged(). |
279 interface WindowTreeClient { | 294 interface WindowTreeClient { |
280 // Invoked when the client application has been embedded at |root|. | 295 // Invoked when the client application has been embedded at |root|. |
281 // See Embed() on WindowTree for more details. |tree| will be a handle back to | 296 // See Embed() on WindowTree for more details. |tree| will be a handle back to |
282 // the window manager service, unless the connection is to the root connection | 297 // the window manager service, unless the connection is to the root connection |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 | 408 |
394 // Called in two distinct cases: when a window known to the connection gains | 409 // Called in two distinct cases: when a window known to the connection gains |
395 // focus, or when focus moves from a window known to the connection to a | 410 // focus, or when focus moves from a window known to the connection to a |
396 // window not known to the connection. In the later case |focused_window_id| | 411 // window not known to the connection. In the later case |focused_window_id| |
397 // is 0. As with other functions this is only called if the client did not | 412 // is 0. As with other functions this is only called if the client did not |
398 // initiate the change. | 413 // initiate the change. |
399 OnWindowFocused(uint32 focused_window_id); | 414 OnWindowFocused(uint32 focused_window_id); |
400 | 415 |
401 OnWindowPredefinedCursorChanged(uint32 window_id, Cursor cursor_id); | 416 OnWindowPredefinedCursorChanged(uint32 window_id, Cursor cursor_id); |
402 | 417 |
| 418 // Called when the mouse cursor enters a window on this connection for the |
| 419 // first time, providing a list of available mime types. We want to send this |
| 420 // set of data only one time, so this isn't part of OnDragEnter(), which |
| 421 // occurs every time the mouse enters a window. |
| 422 OnDragDropStart(map<string, array<uint8>> drag_data); |
| 423 |
| 424 // Called when the mouse cursor enters a window that has opted into |
| 425 // accepting drags through SetAcceptsDrags(), providing a list |
| 426 // of available mime types. Returns a bitmask of the supported |
| 427 // operations. |
| 428 OnDragEnter(uint32 window, |
| 429 uint32 key_state, |
| 430 gfx.mojom.Point position, |
| 431 uint32 effect_bitmask) => (uint32 supported_op_bitmask); |
| 432 |
| 433 // Called when the pointer moves over the window after the initial |
| 434 // DragEnter. Returns a bitmask of the supported operations at this |
| 435 // location. |
| 436 OnDragOver(uint32 window, |
| 437 uint32 key_state, |
| 438 gfx.mojom.Point position, |
| 439 uint32 effect_bitmask) => (uint32 supported_op_bitmask); |
| 440 |
| 441 // Called when the pointer leaves a window or if the drop is |
| 442 // canceled. |
| 443 OnDragLeave(uint32 window); |
| 444 |
| 445 // Called when the drop occurs on a window. Returns the action |
| 446 // taken. |
| 447 OnCompleteDrop(uint32 window, |
| 448 uint32 key_state, |
| 449 gfx.mojom.Point position, |
| 450 uint32 effect_bitmask) => (uint32 effect_taken); |
| 451 |
| 452 // Called after OnDragDrop completes for every connection which received an |
| 453 // OnDragDropStart() message. This signals that a client can forget the |
| 454 // |drag_data| passed in via the first message. |
| 455 OnDragDropDone(); |
| 456 |
403 // A change initiated from the client has completed. See description of | 457 // A change initiated from the client has completed. See description of |
404 // change ids for details. | 458 // change ids for details. |
405 OnChangeCompleted(uint32 change_id, bool success); | 459 OnChangeCompleted(uint32 change_id, bool success); |
406 | 460 |
407 // The WindowManager is requesting the specified window to close. If the | 461 // The WindowManager is requesting the specified window to close. If the |
408 // client allows the change it should delete the window. | 462 // client allows the change it should delete the window. |
409 RequestClose(uint32 window_id); | 463 RequestClose(uint32 window_id); |
410 | 464 |
411 // See description of WindowManager for details. | 465 // See description of WindowManager for details. |
412 GetWindowManager(associated WindowManager& internal); | 466 GetWindowManager(associated WindowManager& internal); |
413 }; | 467 }; |
414 | 468 |
415 // Mus provides this interface as a way for clients to connect and obtain a | 469 // Mus provides this interface as a way for clients to connect and obtain a |
416 // WindowTree handle with a supplied WindowTreeClient handle. The | 470 // WindowTree handle with a supplied WindowTreeClient handle. The |
417 // WindowTreeClient has no roots, use NewTopLevelWindow() to create one. | 471 // WindowTreeClient has no roots, use NewTopLevelWindow() to create one. |
418 interface WindowTreeFactory { | 472 interface WindowTreeFactory { |
419 CreateWindowTree(WindowTree& tree_request, WindowTreeClient client); | 473 CreateWindowTree(WindowTree& tree_request, WindowTreeClient client); |
420 }; | 474 }; |
OLD | NEW |