blob: 6a3f26993f19df73b257d03441eba840647910bd [file] [log] [blame]
// Copyright 2020 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.pointer;
/// A floating-point 3x3 matrix.
/// - The values are placed in column-major order.
alias Mat3 = array<float32>:9;
/// An axis-aligned rectangle. It is defined by its minimal and maximal extents
/// in a coordinate system.
///
/// All fields are required.
table Rectangle {
/// The minimal extent of this rectangle, inclusive.
/// - Its coordinates are pairwise less than the maximal extent's
/// coordinates.
1: Point2 min;
/// The maximal extent of this rectangle, inclusive.
/// - Its coordinates are pairwise greater than the minimal extent's
/// coordinates.
2: Point2 max;
};
/// The parameters of the associated view and viewport, sufficient to correctly
/// interpret the position and scale of pointer events dispatched to this view.
///
/// Ordering. These parameters arrive over the same channel as pointer events,
/// to provide synchronous context for interpreting the position of pointer
/// events in the view's local coordinate system.
///
/// Inter-protocol redundancy. Some of these parameters may also be sent over an
/// independent channel dedicated to view control; the client is responsible for
/// correct use of asynchronously received parameters.
///
/// All fields are required.
table ViewParameters {
/// The view's area of content, placed in the coordinate system of the view.
///
/// The rectangle is defined by the parent view's setup of clipping on this
/// view.
1: Rectangle view;
/// The viewport's area of interaction, placed in an independent coordinate
/// system.
///
/// A pointer event's position is defined in the coordinate system of this
/// viewport.
///
/// A change in viewport extents means the region for pointer interaction
/// has itself moved, or changed in size, or both.
2: Rectangle viewport;
/// The transform matrix that relates a point's position in the viewport's
/// coordinate system to its position in the view's coordinate system.
3: Mat3 viewport_to_view_transform;
};