blob: 0ef933724f3ac6bea1df9a394419468c028536ef [file] [log] [blame]
// Copyright 2021 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.session.scene;
using fuchsia.ui.app;
using fuchsia.ui.policy;
using fuchsia.ui.views;
/// A protocol used to manage the scene graph of the session.
///
/// This protocol is exposed by the `scene_manager` component. The `scene_manager`
/// component configures and constructs a scene graph in Scenic. A product may
/// use the `scene_manager` to reduce Scenic-related configuration code in their session.
@discoverable
protocol Manager {
/// Sets the root view of the scene graph to the view provided by `view_provider`.
///
/// Subsequent calls will remove the existing root view, as well as any of its
/// descendants from the scene graph. The root view is shared between all clients
/// of `Manager`.
///
/// Returns a `fuchsia.ui.views.ViewRef` to the view provided by `view_provider`.
SetRootView(resource struct {
view_provider client_end:fuchsia.ui.app.ViewProvider;
}) -> (resource struct {
view_ref fuchsia.ui.views.ViewRef;
});
/// Focuses the provided `view_ref`.
///
/// Returns once the view associated with `view_ref` has been focused, or if there
/// was an error focusing the specified view.
RequestFocus(resource struct {
view_ref fuchsia.ui.views.ViewRef;
}) -> (struct {}) error fuchsia.ui.views.Error;
/// Adds a listener for "raw" pointer events.
///
/// This exists to support legacy clients, and new uses are discouraged. This method
/// will be removed prior to the inclusion of `Manager` in the SDK.
CapturePointerEvents(resource struct {
listener client_end:fuchsia.ui.policy.PointerCaptureListenerHACK;
});
};