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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 SetWindowTextInputState(uint32 window_id, mojo.TextInputState state); | 228 SetWindowTextInputState(uint32 window_id, mojo.TextInputState state); |
229 | 229 |
230 // Set the input method editor UI (software keyboard, etc) visibility. | 230 // Set the input method editor UI (software keyboard, etc) visibility. |
231 // If state is non-null, the specified window's text input state is updated. | 231 // If state is non-null, the specified window's text input state is updated. |
232 // Otherwise the existing state is used. | 232 // Otherwise the existing state is used. |
233 SetImeVisibility(uint32 window_id, bool visible, mojo.TextInputState? state); | 233 SetImeVisibility(uint32 window_id, bool visible, mojo.TextInputState? state); |
234 | 234 |
235 // See documentation for WindowTreeClient::OnWindowInputEvent(). | 235 // See documentation for WindowTreeClient::OnWindowInputEvent(). |
236 OnWindowInputEventAck(uint32 event_id); | 236 OnWindowInputEventAck(uint32 event_id); |
237 | 237 |
238 // See description of WindowManagerInternal for details. | 238 // See description of WindowManager for details. |
239 GetWindowManagerInternalClient( | 239 GetWindowManagerClient(associated WindowManagerClient& internal); |
240 associated WindowManagerInternalClient& internal); | |
241 }; | 240 }; |
242 | 241 |
243 // Changes to windows are not sent to the connection that originated the | 242 // Changes to windows are not sent to the connection that originated the |
244 // change. For example, if connection 1 changes the bounds of a window by | 243 // change. For example, if connection 1 changes the bounds of a window by |
245 // calling SetWindowBounds(), connection 1 does not receive | 244 // calling SetWindowBounds(), connection 1 does not receive |
246 // OnWindowBoundsChanged(). | 245 // OnWindowBoundsChanged(). |
247 interface WindowTreeClient { | 246 interface WindowTreeClient { |
248 // Invoked when the client application has been embedded at |root|. | 247 // Invoked when the client application has been embedded at |root|. |
249 // See Embed() on WindowTree for more details. |tree| will be a handle back to | 248 // See Embed() on WindowTree for more details. |tree| will be a handle back to |
250 // the window manager service, unless the connection is to the root connection | 249 // the window manager service, unless the connection is to the root connection |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 OnWindowPredefinedCursorChanged(uint32 window_id, Cursor cursor_id); | 343 OnWindowPredefinedCursorChanged(uint32 window_id, Cursor cursor_id); |
345 | 344 |
346 // A change initiated from the client has completed. See description of | 345 // A change initiated from the client has completed. See description of |
347 // change ids for details. | 346 // change ids for details. |
348 OnChangeCompleted(uint32 change_id, bool success); | 347 OnChangeCompleted(uint32 change_id, bool success); |
349 | 348 |
350 // The WindowManager is requesting the specified window to close. If the | 349 // The WindowManager is requesting the specified window to close. If the |
351 // client allows the change it should delete the window. | 350 // client allows the change it should delete the window. |
352 RequestClose(uint32 window_id); | 351 RequestClose(uint32 window_id); |
353 | 352 |
354 // See description of WindowManagerInternal for details. | 353 // See description of WindowManager for details. |
355 GetWindowManagerInternal(associated WindowManagerInternal& internal); | 354 GetWindowManager(associated WindowManager& internal); |
356 }; | 355 }; |
357 | 356 |
358 // WindowManagerInternal is used when a WindowTreeClient attempts to modify | 357 // WindowManager is used when a WindowTreeClient attempts to modify |
359 // a property of the embed root. When this happens WindowTree calls the | 358 // a property of the embed root. When this happens WindowTree calls the |
360 // appropriate function on WindowManagerInternal. For example, if a | 359 // appropriate function on WindowManager. For example, if a |
361 // WindowTreeClient calls SetWindowBounds() on its embed root, WindowTree | 360 // WindowTreeClient calls SetWindowBounds() on its embed root, WindowTree |
362 // calls WmSetBounds(). WindowManagerInternal can then decide if it wants to | 361 // calls WmSetBounds(). WindowManager can then decide if it wants to |
363 // change the bounds or not. | 362 // change the bounds or not. |
364 // | 363 // |
365 // WindowManagerInternal may only be installed from the connection that created | 364 // WindowManager may only be installed from the connection that created |
366 // a new window tree (see WindowTreeHostFactory). | 365 // a new window tree (see WindowTreeHostFactory). |
367 // | 366 // |
368 // This interface is only used as an associated interface and is associated | 367 // This interface is only used as an associated interface and is associated |
369 // with WindowTreeClient. | 368 // with WindowTreeClient. |
370 // TODO(sky): rename this to WindowManager. | 369 interface WindowManager { |
371 interface WindowManagerInternal { | 370 // The window's preferred size as defined by its content. Type: gfx::Size. |
372 // When the WindowManagerInternal completes a request it must call back to | 371 const string kPreferredSize_Property = "prop:preferred-size"; |
373 // WindowManagerInternalClient::WmResponse(). | 372 // The window's resize behavior. Type: ResizeBehavior. |
| 373 const string kResizeBehavior_Property = "prop:resize-behavior"; |
| 374 // Bounds the window is restored to. Type: gfx::Rect. |
| 375 const string kRestoreBounds_Property = "prop:restore-bounds"; |
| 376 // Shadow style for the window. Type: mojom::ShadowStyle. |
| 377 const string kShadowStyle_Property = "prop:shadow-style"; |
| 378 // The window's show state. Type: ShowState. |
| 379 const string kShowState_Property = "prop:show-state"; |
| 380 // The window bounds as set by user input. Type: gfx::Rect. |
| 381 const string kUserSetBounds_Property = "prop:user-set-bounds"; |
| 382 const string kWindowType_Property = "prop:window-type"; |
| 383 // The window's title. Type: mojom::String |
| 384 const string kWindowTitle_Property = "prop:window-title"; |
| 385 |
| 386 // When the WindowManager completes a request it must call back to |
| 387 // WindowManagerClient::WmResponse(). |
374 WmSetBounds(uint32 change_id, uint32 window_id, mojo.Rect bounds); | 388 WmSetBounds(uint32 change_id, uint32 window_id, mojo.Rect bounds); |
375 WmSetProperty(uint32 change_id, | 389 WmSetProperty(uint32 change_id, |
376 uint32 window_id, | 390 uint32 window_id, |
377 string name, | 391 string name, |
378 array<uint8>? value); | 392 array<uint8>? value); |
379 // Asks the WindowManager to create a new window. | 393 // Asks the WindowManager to create a new window. |
380 WmCreateTopLevelWindow(uint32 change_id, | 394 WmCreateTopLevelWindow(uint32 change_id, |
381 map<string, array<uint8>> properties); | 395 map<string, array<uint8>> properties); |
382 }; | 396 }; |
383 | 397 |
384 // This interface is only used as an associated interface and is associated | 398 // This interface is only used as an associated interface and is associated |
385 // with WindowTree. | 399 // with WindowTree. |
386 // TODO(sky): rename this to WindowManagerClient. | 400 interface WindowManagerClient { |
387 interface WindowManagerInternalClient { | |
388 // The window manager has completed a request with the specific change id. | 401 // The window manager has completed a request with the specific change id. |
389 WmResponse(uint32 change_id, bool response); | 402 WmResponse(uint32 change_id, bool response); |
390 | 403 |
391 // Calls WindowTreeClient::RequestClose() on the embedded app at the | 404 // Calls WindowTreeClient::RequestClose() on the embedded app at the |
392 // specified window. | 405 // specified window. |
393 WmRequestClose(uint32 window_id); | 406 WmRequestClose(uint32 window_id); |
394 | 407 |
395 // Sets the frame decoration constants of the display the window manager is | 408 // Sets the frame decoration constants of the display the window manager is |
396 // associated with. | 409 // associated with. |
397 WmSetFrameDecorationValues(FrameDecorationValues values); | 410 WmSetFrameDecorationValues(FrameDecorationValues values); |
398 | 411 |
399 // Response from WmCreateTopLevelWindow() informing the client of the id for | 412 // Response from WmCreateTopLevelWindow() informing the client of the id for |
400 // the new window. | 413 // the new window. |
401 OnWmCreatedTopLevelWindow(uint32 change_id, uint32 window_id); | 414 OnWmCreatedTopLevelWindow(uint32 change_id, uint32 window_id); |
402 }; | 415 }; |
OLD | NEW |