| // Copyright 2019 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| library fuchsia.ui.views; |
| |
| /// Deprecated API for view creation. DO NOT USE. |
| @deprecated |
| @discoverable |
| protocol View { |
| |
| /// Provides the View with an attachment point to Scenic's scene graph. |
| /// |
| /// When `Present()` is called the View's implementation should create a |
| /// View resource within Scenic by providing it with the `view_token` (using |
| /// a `fuchsia.ui.gfx.CreateResourceCmd` and `fuchsia.ui.gfx.ViewArgs`). |
| /// |
| /// Then the implementation should attach its graphical content to the |
| /// newly-created View resource using a `fuchsia.ui.gfx.AddChildCmd`. |
| /// |
| /// If the implementation already owns a View resource (because `Present()` |
| /// had already been called before), then it should terminate the connection |
| /// with an error. |
| /// |
| /// TODO(fxbug.dev/24470): Allow re-parenting `View`s with a new `Present()` call. |
| @transitional |
| Present(resource struct { |
| view_token ViewToken; |
| }); |
| }; |