// Copyright © SixtyFPS GmbH // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0 #pragma once #include namespace slint { /// The Point structure is used to represent a two-dimensional point /// with x and y coordinates. template struct Point { /// The x coordinate of the point T x; /// The y coordinate of the point T y; /// Compares with \a other and returns true if they are equal; false otherwise. bool operator==(const Point &other) const = default; }; namespace cbindgen_private { // The Point types are expanded to the Point2D<...> type from the euclid crate which // is binary compatible with Point template using Point2D = Point; } /// A position in logical pixel coordinates struct LogicalPosition : public Point { /// Explicitly convert a Point to a LogicalPosition explicit LogicalPosition(const Point p) : Point(p) { }; /// Default construct a LogicalPosition in the origin LogicalPosition() : Point { 0., 0. } { }; }; /// A position in physical pixel coordinates struct PhysicalPosition : public Point { /// Explicitly convert a Point to a LogicalPosition explicit PhysicalPosition(const Point p) : Point(p) { }; /// Default construct a PhysicalPosition in the origin PhysicalPosition() : Point { 0, 0 } { }; }; }