Skip to main content

rust_macios/foundation/
ns_edge_insets.rs

1use crate::core_graphics::CGFloat;
2
3/// A description of the distance between the edges of two rectangles.
4#[derive(Clone, Copy, Debug, Default, PartialEq)]
5#[repr(C)]
6pub struct NSEdgeInsets {
7    /// The distance from the top of the source rectangle to the top of the result rectangle.
8    pub top: CGFloat,
9    /// The distance from the left side of the source rectangle to the left side of the result rectangle.
10    pub left: CGFloat,
11    /// The distance from the bottom of the source rectangle to the bottom of the result rectangle.
12    pub bottom: CGFloat,
13    /// The distance from the right side of the source rectangle to the right side of the result rectangle.
14    pub right: CGFloat,
15}
16
17extern "C" {
18    /// Checks if the receiver is equal to the given edge insets.
19    pub fn NSEdgeInsetsEqual(insets1: NSEdgeInsets, insets2: NSEdgeInsets) -> bool;
20
21    /// Returns a new edge insets with the given top, left, bottom, and right values.
22    pub fn NSEdgeInsetsMake(
23        top: CGFloat,
24        left: CGFloat,
25        bottom: CGFloat,
26        right: CGFloat,
27    ) -> NSEdgeInsets;
28}