| 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 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/mus_constants.mojom"; | 10 import "components/mus/public/interfaces/mus_constants.mojom"; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 // Only the owner of a window may obtain this surface. | 45 // Only the owner of a window may obtain this surface. |
| 46 // The window manager can change the offset of this by way of | 46 // The window manager can change the offset of this by way of |
| 47 // SetUnderlaySurfaceOffsetAndExtendedHitArea(). | 47 // SetUnderlaySurfaceOffsetAndExtendedHitArea(). |
| 48 UNDERLAY, | 48 UNDERLAY, |
| 49 | 49 |
| 50 // Only the embedded app may obtain this surface. If an app is not embedded | 50 // Only the embedded app may obtain this surface. If an app is not embedded |
| 51 // in the Window than the owner may also render to this surface as well. | 51 // in the Window than the owner may also render to this surface as well. |
| 52 DEFAULT, | 52 DEFAULT, |
| 53 }; | 53 }; |
| 54 | 54 |
| 55 // The result of an input event sent to a client app. |
| 56 enum EventResult { |
| 57 HANDLED, |
| 58 UNHANDLED, |
| 59 // The event was not handled and should be reposted (e.g. a mouse down that |
| 60 // closed a context menu). |
| 61 REPOST, |
| 62 }; |
| 63 |
| 55 // Windows are identified by a uint32. The upper 16 bits are the connection id, | 64 // Windows are identified by a uint32. The upper 16 bits are the connection id, |
| 56 // and the lower 16 the id assigned by the client. | 65 // and the lower 16 the id assigned by the client. |
| 57 // | 66 // |
| 58 // The root window is identified with a connection id of 0, and value of 1. | 67 // The root window is identified with a connection id of 0, and value of 1. |
| 59 // | 68 // |
| 60 // Most functions to the WindowTree take a change_id parameter. When | 69 // Most functions to the WindowTree take a change_id parameter. When |
| 61 // WindowTree completes processing of a function WindowTree calls | 70 // WindowTree completes processing of a function WindowTree calls |
| 62 // WindowTreeClient::OnChangeCompleted() with the change_id supplied by the | 71 // WindowTreeClient::OnChangeCompleted() with the change_id supplied by the |
| 63 // client and the result of the function. This allows the client to track | 72 // client and the result of the function. This allows the client to track |
| 64 // whether the call succeeded or not. Calls are done via the client interface | 73 // whether the call succeeded or not. Calls are done via the client interface |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 | 243 |
| 235 // Set text input state for the given window. | 244 // Set text input state for the given window. |
| 236 SetWindowTextInputState(uint32 window_id, mojo.TextInputState state); | 245 SetWindowTextInputState(uint32 window_id, mojo.TextInputState state); |
| 237 | 246 |
| 238 // Set the input method editor UI (software keyboard, etc) visibility. | 247 // Set the input method editor UI (software keyboard, etc) visibility. |
| 239 // If state is non-null, the specified window's text input state is updated. | 248 // If state is non-null, the specified window's text input state is updated. |
| 240 // Otherwise the existing state is used. | 249 // Otherwise the existing state is used. |
| 241 SetImeVisibility(uint32 window_id, bool visible, mojo.TextInputState? state); | 250 SetImeVisibility(uint32 window_id, bool visible, mojo.TextInputState? state); |
| 242 | 251 |
| 243 // See documentation for WindowTreeClient::OnWindowInputEvent(). | 252 // See documentation for WindowTreeClient::OnWindowInputEvent(). |
| 244 OnWindowInputEventAck(uint32 event_id, bool handled); | 253 OnWindowInputEventAck(uint32 event_id, EventResult result); |
| 245 | 254 |
| 246 // See description of WindowManager for details. | 255 // See description of WindowManager for details. |
| 247 GetWindowManagerClient(associated WindowManagerClient& internal); | 256 GetWindowManagerClient(associated WindowManagerClient& internal); |
| 248 }; | 257 }; |
| 249 | 258 |
| 250 // Changes to windows are not sent to the connection that originated the | 259 // Changes to windows are not sent to the connection that originated the |
| 251 // change. For example, if connection 1 changes the bounds of a window by | 260 // change. For example, if connection 1 changes the bounds of a window by |
| 252 // calling SetWindowBounds(), connection 1 does not receive | 261 // calling SetWindowBounds(), connection 1 does not receive |
| 253 // OnWindowBoundsChanged(). | 262 // OnWindowBoundsChanged(). |
| 254 interface WindowTreeClient { | 263 interface WindowTreeClient { |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 OnWindowParentDrawnStateChanged(uint32 window, bool drawn); | 353 OnWindowParentDrawnStateChanged(uint32 window, bool drawn); |
| 345 | 354 |
| 346 // Invoked when a window property is changed. If this change is a removal, | 355 // Invoked when a window property is changed. If this change is a removal, |
| 347 // |new_data| is null. | 356 // |new_data| is null. |
| 348 OnWindowSharedPropertyChanged(uint32 window, | 357 OnWindowSharedPropertyChanged(uint32 window, |
| 349 string name, | 358 string name, |
| 350 array<uint8>? new_data); | 359 array<uint8>? new_data); |
| 351 | 360 |
| 352 // Invoked when an event is targeted at the specified window. The client must | 361 // Invoked when an event is targeted at the specified window. The client must |
| 353 // call WindowTree::OnWindowInputEventAck() with the same |event_id| to notify | 362 // call WindowTree::OnWindowInputEventAck() with the same |event_id| to notify |
| 354 // that the event has been processed, and with a boolean |handled| to notify | 363 // that the event has been processed, and with an EventResult value to notify |
| 355 // if the event was consumed. The client will not receive farther events until | 364 // if the event was consumed. The client will not receive farther events until |
| 356 // the event is ack'ed. | 365 // the event is ack'ed. |
| 357 OnWindowInputEvent(uint32 event_id, uint32 window, Event event); | 366 OnWindowInputEvent(uint32 event_id, uint32 window, Event event); |
| 358 | 367 |
| 359 // Called in two distinct cases: when a window known to the connection gains | 368 // Called in two distinct cases: when a window known to the connection gains |
| 360 // focus, or when focus moves from a window known to the connection to a | 369 // focus, or when focus moves from a window known to the connection to a |
| 361 // window not known to the connection. In the later case |focused_window_id| | 370 // window not known to the connection. In the later case |focused_window_id| |
| 362 // is 0. As with other functions this is only called if the client did not | 371 // is 0. As with other functions this is only called if the client did not |
| 363 // initiate the change. | 372 // initiate the change. |
| 364 OnWindowFocused(uint32 focused_window_id); | 373 OnWindowFocused(uint32 focused_window_id); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 376 // See description of WindowManager for details. | 385 // See description of WindowManager for details. |
| 377 GetWindowManager(associated WindowManager& internal); | 386 GetWindowManager(associated WindowManager& internal); |
| 378 }; | 387 }; |
| 379 | 388 |
| 380 // Mus provides this interface as a way for clients to connect and obtain a | 389 // Mus provides this interface as a way for clients to connect and obtain a |
| 381 // WindowTree handle with a supplied WindowTreeClient handle. The | 390 // WindowTree handle with a supplied WindowTreeClient handle. The |
| 382 // WindowTreeClient has no roots, use NewTopLevelWindow() to create one. | 391 // WindowTreeClient has no roots, use NewTopLevelWindow() to create one. |
| 383 interface WindowTreeFactory { | 392 interface WindowTreeFactory { |
| 384 CreateWindowTree(WindowTree& tree_request, WindowTreeClient client); | 393 CreateWindowTree(WindowTree& tree_request, WindowTreeClient client); |
| 385 }; | 394 }; |
| OLD | NEW |