blob: e6196cf695186bafaf5de3d631f7bbbc3d0798f5 [file] [log] [blame]
// Copyright 2018 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.scenic;
using fuchsia.images;
using fuchsia.mem;
using fuchsia.ui.gfx;
// Scenic.TakeScreenshot() returns a raw BGRA formatted image in this struct.
struct ScreenshotData {
fuchsia.images.ImageInfo info;
fuchsia.mem.Buffer data;
protocol Scenic {
// Create a new Session, which is the primary way to interact with Scenic.
CreateSession(request<Session> session, SessionListener? listener);
// Get information about the Scenic's primary display.
// TODO(SCN-453): in the future there will probably be a DisplayManager, and
// info about which displays to use will be provided to the Scenic.
GetDisplayInfo() -> (fuchsia.ui.gfx.DisplayInfo info);
// Gets an event signaled with displayOwnedSignal or displayNotOwnedSignal
// when display ownership changes.
GetDisplayOwnershipEvent() -> (handle<event> ownership_event);
// Take a screenshot and return the data in |img_data|. |img_data| will
// not contain BGRA data if |success| is false.
// TODO(SCN-678): The permissions here are too wide (anyone can take a
// screenshot), we should narrow them.
TakeScreenshot() -> (ScreenshotData img_data, bool success);
const uint32 displayOwnedSignal = 0x02000000;
const uint32 displayNotOwnedSignal = 0x01000000;