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 [DartPackage="mojo_services"] | 5 [DartPackage="mojo_services"] |
6 module mojo.ui; | 6 module mojo.ui; |
7 | 7 |
8 import "mojo/public/interfaces/application/service_provider.mojom"; | 8 import "mojo/public/interfaces/application/service_provider.mojom"; |
9 import "mojo/services/gfx/composition/interfaces/hit_tests.mojom"; | 9 import "mojo/services/gfx/composition/interfaces/hit_tests.mojom"; |
10 import "mojo/services/gfx/composition/interfaces/scene_token.mojom"; | 10 import "mojo/services/gfx/composition/interfaces/scene_token.mojom"; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 // The associate must return information about the services that it | 42 // The associate must return information about the services that it |
43 // offers in |info|. | 43 // offers in |info|. |
44 Connect(ViewInspector inspector) => (ViewAssociateInfo info); | 44 Connect(ViewInspector inspector) => (ViewAssociateInfo info); |
45 | 45 |
46 // Asks the associate to provide the view service identified by | 46 // Asks the associate to provide the view service identified by |
47 // |interface_name| through the message |pipe| endpoint supplied by | 47 // |interface_name| through the message |pipe| endpoint supplied by |
48 // the caller. If the associate is not willing or able to provide the | 48 // the caller. If the associate is not willing or able to provide the |
49 // requested service, it should close the |pipe|. | 49 // requested service, it should close the |pipe|. |
50 // | 50 // |
51 // The |view_token| is the token of the view which requested the service. | 51 // The |view_token| is the token of the view which requested the service. |
52 ConnectToViewService(ViewToken view_token, string service_name, | 52 ConnectToViewService(ViewToken view_token, |
53 handle<message_pipe> pipe); | 53 string service_name, |
| 54 handle<message_pipe> pipe); |
54 | 55 |
55 // Asks the associate to provide the view tree service identified by | 56 // Asks the associate to provide the view tree service identified by |
56 // |interface_name| through the message |pipe| endpoint supplied by | 57 // |interface_name| through the message |pipe| endpoint supplied by |
57 // the caller. If the associate is not willing or able to provide the | 58 // the caller. If the associate is not willing or able to provide the |
58 // requested service, it should close the |pipe|. | 59 // requested service, it should close the |pipe|. |
59 // | 60 // |
60 // The |view_tree_token| is the token of the view tree which requested | 61 // The |view_tree_token| is the token of the view tree which requested |
61 // the service. | 62 // the service. |
62 ConnectToViewTreeService(ViewTreeToken view_tree_token, | 63 ConnectToViewTreeService(ViewTreeToken view_tree_token, |
63 string service_name, handle<message_pipe> pipe); | 64 string service_name, |
| 65 handle<message_pipe> pipe); |
64 }; | 66 }; |
65 | 67 |
66 // Provides information about the services offered by an associate. | 68 // Provides information about the services offered by an associate. |
67 struct ViewAssociateInfo { | 69 struct ViewAssociateInfo { |
68 // The names of view services offered by the associate. | 70 // The names of view services offered by the associate. |
69 // May be null if none. | 71 // May be null if none. |
70 array<string>? view_service_names; | 72 array<string>? view_service_names; |
71 | 73 |
72 // The names of view tree services offered by the associate. | 74 // The names of view tree services offered by the associate. |
73 // May be null if none. | 75 // May be null if none. |
74 array<string>? view_tree_service_names; | 76 array<string>? view_tree_service_names; |
75 }; | 77 }; |
76 | 78 |
77 // Provides a view associate with the ability to inspect and perform operations | 79 // Provides a view associate with the ability to inspect and perform operations |
78 // on the contents of views and view trees. | 80 // on the contents of views and view trees. |
79 interface ViewInspector { | 81 interface ViewInspector { |
80 // Provides an interface which can be used to perform hit tests on the | 82 // Provides an interface which can be used to perform hit tests on the |
81 // contents of the view tree's scene graph. | 83 // contents of the view tree's scene graph. |
82 // | 84 // |
83 // The |hit_tester| will be closed if the view tree is not attached to a | 85 // The |hit_tester| will be closed if the view tree is not attached to a |
84 // renderer, when it is reattached to a different renderer, or when the | 86 // renderer, when it is reattached to a different renderer, or when the |
85 // view tree is destroyed. | 87 // view tree is destroyed. |
86 // | 88 // |
87 // The callback will be invoked the hit tester is invalidated. | 89 // The callback will be invoked the hit tester is invalidated. |
88 // If |renderer_changed| is true, the client should call |GetHitTester| | 90 // If |renderer_changed| is true, the client should call |GetHitTester| |
89 // again to obtain a new one. Otherwise it should assume that the view | 91 // again to obtain a new one. Otherwise it should assume that the view |
90 // tree has become unavailable (so no hit tester is available). | 92 // tree has become unavailable (so no hit tester is available). |
91 GetHitTester(ViewTreeToken view_tree_token, | 93 GetHitTester(ViewTreeToken view_tree_token, |
92 mojo.gfx.composition.HitTester& hit_tester) => | 94 mojo.gfx.composition.HitTester& hit_tester) |
93 (bool renderer_changed); | 95 => (bool renderer_changed); |
94 | 96 |
95 // Given an array of scene tokens, produces an array of view tokens | 97 // Given an array of scene tokens, produces an array of view tokens |
96 // of equal size containing the view to which the scene belongs or null | 98 // of equal size containing the view to which the scene belongs or null |
97 // if the scene token does not belong to any view. | 99 // if the scene token does not belong to any view. |
98 // | 100 // |
99 // It is safe to cache the results of this operation because a scene will | 101 // It is safe to cache the results of this operation because a scene will |
100 // only ever be associated with at most one view although a view may | 102 // only ever be associated with at most one view although a view may |
101 // create several scenes during its lifetime. | 103 // create several scenes during its lifetime. |
102 ResolveScenes(array<mojo.gfx.composition.SceneToken> scene_tokens) => | 104 ResolveScenes(array<mojo.gfx.composition.SceneToken> scene_tokens) |
103 (array<ViewToken?> view_tokens); | 105 => (array<ViewToken?> view_tokens); |
104 }; | 106 }; |
OLD | NEW |