1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;

use crate::*;

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIDeviceOrientation(pub NSInteger);
impl UIDeviceOrientation {
    #[doc(alias = "UIDeviceOrientationUnknown")]
    pub const Unknown: Self = Self(0);
    #[doc(alias = "UIDeviceOrientationPortrait")]
    pub const Portrait: Self = Self(1);
    #[doc(alias = "UIDeviceOrientationPortraitUpsideDown")]
    pub const PortraitUpsideDown: Self = Self(2);
    #[doc(alias = "UIDeviceOrientationLandscapeLeft")]
    pub const LandscapeLeft: Self = Self(3);
    #[doc(alias = "UIDeviceOrientationLandscapeRight")]
    pub const LandscapeRight: Self = Self(4);
    #[doc(alias = "UIDeviceOrientationFaceUp")]
    pub const FaceUp: Self = Self(5);
    #[doc(alias = "UIDeviceOrientationFaceDown")]
    pub const FaceDown: Self = Self(6);
}

unsafe impl Encode for UIDeviceOrientation {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for UIDeviceOrientation {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

// TODO: pub fn UIDeviceOrientationIsPortrait(orientation: UIDeviceOrientation,) -> Bool;

// TODO: pub fn UIDeviceOrientationIsLandscape(orientation: UIDeviceOrientation,) -> Bool;

// TODO: pub fn UIDeviceOrientationIsFlat(orientation: UIDeviceOrientation,) -> Bool;

// TODO: pub fn UIDeviceOrientationIsValidInterfaceOrientation(orientation: UIDeviceOrientation,) -> Bool;

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIInterfaceOrientation(pub NSInteger);
impl UIInterfaceOrientation {
    #[doc(alias = "UIInterfaceOrientationUnknown")]
    pub const Unknown: Self = Self(UIDeviceOrientation::Unknown.0);
    #[doc(alias = "UIInterfaceOrientationPortrait")]
    pub const Portrait: Self = Self(UIDeviceOrientation::Portrait.0);
    #[doc(alias = "UIInterfaceOrientationPortraitUpsideDown")]
    pub const PortraitUpsideDown: Self = Self(UIDeviceOrientation::PortraitUpsideDown.0);
    #[doc(alias = "UIInterfaceOrientationLandscapeLeft")]
    pub const LandscapeLeft: Self = Self(UIDeviceOrientation::LandscapeRight.0);
    #[doc(alias = "UIInterfaceOrientationLandscapeRight")]
    pub const LandscapeRight: Self = Self(UIDeviceOrientation::LandscapeLeft.0);
}

unsafe impl Encode for UIInterfaceOrientation {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for UIInterfaceOrientation {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

// NS_OPTIONS
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIInterfaceOrientationMask(pub NSUInteger);
bitflags::bitflags! {
    impl UIInterfaceOrientationMask: NSUInteger {
        #[doc(alias = "UIInterfaceOrientationMaskPortrait")]
        const Portrait = 1<<UIInterfaceOrientation::Portrait.0;
        #[doc(alias = "UIInterfaceOrientationMaskLandscapeLeft")]
        const LandscapeLeft = 1<<UIInterfaceOrientation::LandscapeLeft.0;
        #[doc(alias = "UIInterfaceOrientationMaskLandscapeRight")]
        const LandscapeRight = 1<<UIInterfaceOrientation::LandscapeRight.0;
        #[doc(alias = "UIInterfaceOrientationMaskPortraitUpsideDown")]
        const PortraitUpsideDown = 1<<UIInterfaceOrientation::PortraitUpsideDown.0;
        #[doc(alias = "UIInterfaceOrientationMaskLandscape")]
        const Landscape = UIInterfaceOrientationMask::LandscapeLeft.0|UIInterfaceOrientationMask::LandscapeRight.0;
        #[doc(alias = "UIInterfaceOrientationMaskAll")]
        const All = UIInterfaceOrientationMask::Portrait.0|UIInterfaceOrientationMask::LandscapeLeft.0|UIInterfaceOrientationMask::LandscapeRight.0|UIInterfaceOrientationMask::PortraitUpsideDown.0;
        #[doc(alias = "UIInterfaceOrientationMaskAllButUpsideDown")]
        const AllButUpsideDown = UIInterfaceOrientationMask::Portrait.0|UIInterfaceOrientationMask::LandscapeLeft.0|UIInterfaceOrientationMask::LandscapeRight.0;
    }
}

unsafe impl Encode for UIInterfaceOrientationMask {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for UIInterfaceOrientationMask {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

// TODO: pub fn UIInterfaceOrientationIsPortrait(orientation: UIInterfaceOrientation,) -> Bool;

// TODO: pub fn UIInterfaceOrientationIsLandscape(orientation: UIInterfaceOrientation,) -> Bool;