1use objc2::encode::{Encode, Encoding, RefEncode};
10use objc2_foundation::NSUInteger;
11
12#[repr(transparent)]
15#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
16pub struct UIRectEdge(pub NSUInteger);
17bitflags::bitflags! {
18 impl UIRectEdge: NSUInteger {
19 #[doc(alias = "UIRectEdgeNone")]
20 const None = 0;
21 #[doc(alias = "UIRectEdgeTop")]
22 const Top = 1<<0;
23 #[doc(alias = "UIRectEdgeLeft")]
24 const Left = 1<<1;
25 #[doc(alias = "UIRectEdgeBottom")]
26 const Bottom = 1<<2;
27 #[doc(alias = "UIRectEdgeRight")]
28 const Right = 1<<3;
29 #[doc(alias = "UIRectEdgeAll")]
30 const All = UIRectEdge::Top.0|UIRectEdge::Left.0|UIRectEdge::Bottom.0|UIRectEdge::Right.0;
31 }
32}
33
34unsafe impl Encode for UIRectEdge {
35 const ENCODING: Encoding = NSUInteger::ENCODING;
36}
37
38unsafe impl RefEncode for UIRectEdge {
39 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
40}
41
42#[repr(transparent)]
45#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
46pub struct UIAxis(pub NSUInteger);
47bitflags::bitflags! {
48 impl UIAxis: NSUInteger {
49 #[doc(alias = "UIAxisNeither")]
50 const Neither = 0;
51 #[doc(alias = "UIAxisHorizontal")]
52 const Horizontal = 1<<0;
53 #[doc(alias = "UIAxisVertical")]
54 const Vertical = 1<<1;
55 #[doc(alias = "UIAxisBoth")]
56 const Both = UIAxis::Horizontal.0|UIAxis::Vertical.0;
57 }
58}
59
60unsafe impl Encode for UIAxis {
61 const ENCODING: Encoding = NSUInteger::ENCODING;
62}
63
64unsafe impl RefEncode for UIAxis {
65 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
66}