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"; |
11 import "services/ui/public/interfaces/surface.mojom"; | 11 import "services/ui/public/interfaces/surface.mojom"; |
12 import "services/ui/public/interfaces/window_manager.mojom"; | 12 import "services/ui/public/interfaces/window_manager.mojom"; |
13 import "services/ui/public/interfaces/window_manager_constants.mojom"; | 13 import "services/ui/public/interfaces/window_manager_constants.mojom"; |
14 import "services/ui/public/interfaces/window_tree_constants.mojom"; | 14 import "services/ui/public/interfaces/window_tree_constants.mojom"; |
| 15 import "skia/public/interfaces/bitmap.mojom"; |
15 import "ui/events/mojo/event.mojom"; | 16 import "ui/events/mojo/event.mojom"; |
16 import "ui/gfx/geometry/mojo/geometry.mojom"; | 17 import "ui/gfx/geometry/mojo/geometry.mojom"; |
17 import "ui/platform_window/mojo/text_input_state.mojom"; | 18 import "ui/platform_window/mojo/text_input_state.mojom"; |
18 | 19 |
19 // Windows are identified by a uint32. The upper 16 bits are the connection id, | 20 // Windows are identified by a uint32. The upper 16 bits are the connection id, |
20 // and the lower 16 the id assigned by the client. | 21 // and the lower 16 the id assigned by the client. |
21 // | 22 // |
22 // The root window is identified with a connection id of 0, and value of 1. | 23 // The root window is identified with a connection id of 0, and value of 1. |
23 // | 24 // |
24 // Most functions to the WindowTree take a change_id parameter. When | 25 // Most functions to the WindowTree take a change_id parameter. When |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 // TODO(sky): convert additional_client_areas to a path. | 107 // TODO(sky): convert additional_client_areas to a path. |
107 SetClientArea(uint32 window_id, | 108 SetClientArea(uint32 window_id, |
108 gfx.mojom.Insets insets, | 109 gfx.mojom.Insets insets, |
109 array<gfx.mojom.Rect>? additional_client_areas); | 110 array<gfx.mojom.Rect>? additional_client_areas); |
110 | 111 |
111 // Mouse events outside a hit test mask do not hit the window. The |mask| is | 112 // 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. | 113 // in window local coordinates. Pass null to clear the mask. |
113 // TODO(jamescook): Convert |mask| to a path. http://crbug.com/613210 | 114 // TODO(jamescook): Convert |mask| to a path. http://crbug.com/613210 |
114 SetHitTestMask(uint32 window_id, gfx.mojom.Rect? mask); | 115 SetHitTestMask(uint32 window_id, gfx.mojom.Rect? mask); |
115 | 116 |
| 117 // Called by clients that want to accept drags. Windows default |
| 118 // to this being disabled; a window must actively opt-in to |
| 119 // receiving Drag*() calls. |
| 120 SetCanAcceptDrags(uint32 window_id, bool accepts_drags); |
| 121 |
116 // Sets the visibility of the specified window to |visible|. Connections are | 122 // 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 | 123 // allowed to change the visibility of any window they have created, as well |
118 // as any of their roots. | 124 // as any of their roots. |
119 SetWindowVisibility(uint32 change_id, uint32 window_id, bool visible); | 125 SetWindowVisibility(uint32 change_id, uint32 window_id, bool visible); |
120 | 126 |
121 // Sets an individual named property. Setting an individual property to null | 127 // Sets an individual named property. Setting an individual property to null |
122 // deletes the property. | 128 // deletes the property. |
123 SetWindowProperty(uint32 change_id, | 129 SetWindowProperty(uint32 change_id, |
124 uint32 window_id, | 130 uint32 window_id, |
125 string name, | 131 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 | 269 // 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 | 270 // 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 | 271 // 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. | 272 // on it, pass the cursor location at the start of the move. |
267 PerformWindowMove(uint32 change_id, uint32 window_id, MoveLoopSource source, | 273 PerformWindowMove(uint32 change_id, uint32 window_id, MoveLoopSource source, |
268 gfx.mojom.Point cursor); | 274 gfx.mojom.Point cursor); |
269 | 275 |
270 // Tells the window manager to cancel any in progress window move started with | 276 // 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. | 277 // StartWindowMove() and to revert the window bounds to how they were. |
272 CancelWindowMove(uint32 window_id); | 278 CancelWindowMove(uint32 window_id); |
| 279 |
| 280 // Called by the client to start a drag operation. |
| 281 // |
| 282 // This will cause the window server to create a window with |
| 283 // |drag_representation| and start processing events for drag and |
| 284 // drop. It will set the clipboard’s DRAG clipboard to |drag_data| |
| 285 // (this is part of this interface since mojom.Clipboard is usually |
| 286 // on a different pipe). |
| 287 PerformDragDrop(uint32 change_id, |
| 288 uint32 source_window_id, |
| 289 map<string, array<uint8>> drag_data, |
| 290 uint32 drag_operation, |
| 291 gfx.mojom.Point cursor_location, |
| 292 skia.mojom.Bitmap drag_representation); |
273 }; | 293 }; |
274 | 294 |
275 // Changes to windows are not sent to the connection that originated the | 295 // 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 | 296 // change. For example, if connection 1 changes the bounds of a window by |
277 // calling SetWindowBounds(), connection 1 does not receive | 297 // calling SetWindowBounds(), connection 1 does not receive |
278 // OnWindowBoundsChanged(). | 298 // OnWindowBoundsChanged(). |
279 interface WindowTreeClient { | 299 interface WindowTreeClient { |
280 // Invoked when the client application has been embedded at |root|. | 300 // 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 | 301 // 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 | 302 // 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 | 413 |
394 // Called in two distinct cases: when a window known to the connection gains | 414 // 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 | 415 // 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| | 416 // 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 | 417 // is 0. As with other functions this is only called if the client did not |
398 // initiate the change. | 418 // initiate the change. |
399 OnWindowFocused(uint32 focused_window_id); | 419 OnWindowFocused(uint32 focused_window_id); |
400 | 420 |
401 OnWindowPredefinedCursorChanged(uint32 window_id, Cursor cursor_id); | 421 OnWindowPredefinedCursorChanged(uint32 window_id, Cursor cursor_id); |
402 | 422 |
| 423 // Called when the mouse cursor enters a window that has opted into |
| 424 // accepting drags through SetAcceptsDrags(), providing a list |
| 425 // of available mime types. Returns a bitmask of the supported |
| 426 // operations. |
| 427 OnDragEnter(uint32 window, |
| 428 map<string, array<uint8>> drag_data, |
| 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 OnDragDrop(uint32 window, |
| 448 uint32 key_state, |
| 449 gfx.mojom.Point position, |
| 450 uint32 effect_bitmask) => (uint32 effect_taken); |
| 451 |
403 // A change initiated from the client has completed. See description of | 452 // A change initiated from the client has completed. See description of |
404 // change ids for details. | 453 // change ids for details. |
405 OnChangeCompleted(uint32 change_id, bool success); | 454 OnChangeCompleted(uint32 change_id, bool success); |
406 | 455 |
407 // The WindowManager is requesting the specified window to close. If the | 456 // The WindowManager is requesting the specified window to close. If the |
408 // client allows the change it should delete the window. | 457 // client allows the change it should delete the window. |
409 RequestClose(uint32 window_id); | 458 RequestClose(uint32 window_id); |
410 | 459 |
411 // See description of WindowManager for details. | 460 // See description of WindowManager for details. |
412 GetWindowManager(associated WindowManager& internal); | 461 GetWindowManager(associated WindowManager& internal); |
413 }; | 462 }; |
414 | 463 |
415 // Mus provides this interface as a way for clients to connect and obtain a | 464 // Mus provides this interface as a way for clients to connect and obtain a |
416 // WindowTree handle with a supplied WindowTreeClient handle. The | 465 // WindowTree handle with a supplied WindowTreeClient handle. The |
417 // WindowTreeClient has no roots, use NewTopLevelWindow() to create one. | 466 // WindowTreeClient has no roots, use NewTopLevelWindow() to create one. |
418 interface WindowTreeFactory { | 467 interface WindowTreeFactory { |
419 CreateWindowTree(WindowTree& tree_request, WindowTreeClient client); | 468 CreateWindowTree(WindowTree& tree_request, WindowTreeClient client); |
420 }; | 469 }; |
OLD | NEW |