OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/input_event_constants.mojom"; | 7 import "components/mus/public/interfaces/input_event_constants.mojom"; |
8 import "components/mus/public/interfaces/input_event_matcher.mojom"; | 8 import "components/mus/public/interfaces/input_event_matcher.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/input_key_codes.mojom"; | 10 import "components/mus/public/interfaces/input_key_codes.mojom"; |
11 import "components/mus/public/interfaces/window_manager.mojom"; | 11 import "components/mus/public/interfaces/window_manager.mojom"; |
12 import "components/mus/public/interfaces/window_tree.mojom"; | 12 import "components/mus/public/interfaces/window_tree.mojom"; |
13 import "ui/mojo/geometry/geometry.mojom"; | 13 import "ui/mojo/geometry/geometry.mojom"; |
14 | 14 |
15 // WindowTreeHost encapsulates a unique underlying platform window, with a tree | 15 // WindowTreeHost encapsulates a unique underlying platform window, with a tree |
16 // of windows. | 16 // of windows. |
17 interface WindowTreeHost { | 17 interface WindowTreeHost { |
18 // Sets the size of the platform window. | 18 // Sets the size of the platform window. |
19 SetSize(mojo.Size size); | 19 SetSize(mojo.Size size); |
20 | 20 |
21 // Sets a title string to be displayed on the platform window. | 21 // Sets a title string to be displayed on the platform window. |
22 SetTitle(string title); | 22 SetTitle(string title); |
23 | 23 |
24 // Add and remove accelerators. When accelerators are registered the | 24 // Add and remove accelerators. When accelerators are registered the |
25 // WindowTreeHostClient receives the event via OnAccelerator() rather than the | 25 // WindowTreeHostClient receives the event via OnAccelerator() rather than the |
26 // target window. The id is defined by the client and can be used to more | 26 // target window. The id is defined by the client and can be used to more |
27 // easily identify the accelerator's action. | 27 // easily identify the accelerator's action. If an accelerator with the same |
28 AddAccelerator(uint32 id, EventMatcher matcher); | 28 // id or the same matcher already exists, then the accelerator is not added, |
| 29 // and returns false. |
| 30 AddAccelerator(uint32 id, EventMatcher matcher) => (bool success); |
29 RemoveAccelerator(uint32 id); | 31 RemoveAccelerator(uint32 id); |
30 | 32 |
31 // Enables (or disables) child windows of |window_id| to be activated. | 33 // Enables (or disables) child windows of |window_id| to be activated. |
32 AddActivationParent(uint32 window_id); | 34 AddActivationParent(uint32 window_id); |
33 RemoveActivationParent(uint32 window_id); | 35 RemoveActivationParent(uint32 window_id); |
34 | 36 |
35 ActivateNextWindow(); | 37 ActivateNextWindow(); |
36 | 38 |
37 // Sets the underlay surface offset for the specified window and additional | 39 // Sets the underlay surface offset for the specified window and additional |
38 // hit area. The underlay surface is drawn at the bounds of the window minus | 40 // hit area. The underlay surface is drawn at the bounds of the window minus |
(...skipping 11 matching lines...) Expand all Loading... |
50 // An accelerator registered via AddAccelerator() has been triggered. | 52 // An accelerator registered via AddAccelerator() has been triggered. |
51 OnAccelerator(uint32 id, Event event); | 53 OnAccelerator(uint32 id, Event event); |
52 }; | 54 }; |
53 | 55 |
54 interface WindowTreeHostFactory { | 56 interface WindowTreeHostFactory { |
55 CreateWindowTreeHost(WindowTreeHost& window_tree_host, | 57 CreateWindowTreeHost(WindowTreeHost& window_tree_host, |
56 WindowTreeHostClient? host_client, | 58 WindowTreeHostClient? host_client, |
57 WindowTreeClient tree_client, | 59 WindowTreeClient tree_client, |
58 WindowManager? window_manager); | 60 WindowManager? window_manager); |
59 }; | 61 }; |
OLD | NEW |