blob: 3377ebfe8a1c6df0003999a12f3571c674a57887 [file] [log] [blame]
// Copyright 2022 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.test.input;
/// Indicates the units used to specify spatial event parameters (unless otherwise
/// noted).
@available(added=11)
type CoordinateUnit = flexible enum {
/// The physical display is mapped to a coordinate space spanning [-1000, 1000]
/// on both the x and y axes, where positive x extends rightward and positive y
/// extends downward.
///
/// Example: (500, -500) in the default coordinate space maps to the center of
/// the top-right quadrant of the physical display.
DEFAULT = 0;
/// The physical display is mapped to a coordinate space spanning (0, 0) -
/// (dispaly width, display height), where positive x extends rightward and
/// positive y extends downward.
///
/// Test writers should use `fuchsia.ui.display.singleton.Info` to retrieve
/// the physical dimensions of the display.
///
/// Note that this space matches both the size AND orientation of the physical
/// display, so it will NOT mirror any rotations applied to the scene graph.
///
/// In general, test writers should NOT assume that a particular view's logical
/// coordinate space matches the physical coordinate space.
PHYSICAL_PIXELS = 1;
};
/// *** This protocol must not be used in production. ***
///
/// Enables clients to register fake input devices, which can be used to
/// inject input events directly into Input Pipeline.
@discoverable
closed protocol Registry {
/// Enables the client to inject touch events using the corresponding
/// client end to `device`.
///
/// Clients are allowed at most one in-flight call at a time. Subsequent
/// calls must wait until the acknowledgment returns. Non-compliance
/// results in channel closure.
///
/// The `fuchsia.ui.test.input.TouchScreen` channel will remain open even
/// if the `Registry` connection closes.
strict RegisterTouchScreen(resource table {
1: device server_end:TouchScreen;
/// Indicates the coordinate space in which to describe touch events.
@available(added=11)
2: coordinate_unit CoordinateUnit;
}) -> ();
/// Enables the client to inject media buttons events using the
/// corresponding client end to `device`.
///
/// Clients are allowed at most one in-flight call at a time. Subsequent
/// calls must wait until the acknowledgment returns. Non-compliance
/// results in channel closure.
///
/// The `fuchsia.ui.test.input.MediaButtonsDevice` channel will remain open
/// even if the `Registry` connection closes.
strict RegisterMediaButtonsDevice(resource table {
1: device server_end:MediaButtonsDevice;
}) -> ();
/// Enables the client to inject keyboard events using the corresponding
/// client end to `device`.
///
/// Clients are allowed at most one in-flight call at a time. Subsequent
/// calls must wait until the acknowledgment returns. Non-compliance
/// results in channel closure.
///
/// The `fuchsia.ui.test.input.Keyboard` channel will remain open even
/// if the `Registry` connection closes.
strict RegisterKeyboard(resource table {
1: device server_end:Keyboard;
}) -> ();
/// Enables the client to inject mouse events using the corresponding
/// client end to `device`.
///
/// Clients are allowed at most one in-flight call at a time. Subsequent
/// calls must wait until the acknowledgment returns. Non-compliance
/// results in channel closure.
///
/// The `fuchsia.ui.test.input.Mouse` channel will remain open even
/// if the `Registry` connection closes.
strict RegisterMouse(resource table {
1: device server_end:Mouse;
}) -> ();
};