2022-09-08 20:30:34 +02:00
|
|
|
use objc2::foundation::NSObject;
|
2022-12-28 18:36:32 +01:00
|
|
|
use objc2::rc::{Id, Shared};
|
|
|
|
|
use objc2::{extern_class, extern_methods, msg_send_id, ClassType};
|
2022-09-08 20:30:34 +02:00
|
|
|
|
2022-12-28 18:36:32 +01:00
|
|
|
use super::{UIResponder, UIScreen, UIView};
|
2022-09-08 20:30:34 +02:00
|
|
|
|
|
|
|
|
extern_class!(
|
|
|
|
|
#[derive(Debug, PartialEq, Eq, Hash)]
|
|
|
|
|
pub(crate) struct UIWindow;
|
|
|
|
|
|
|
|
|
|
unsafe impl ClassType for UIWindow {
|
2022-12-28 18:36:32 +01:00
|
|
|
#[inherits(UIResponder, NSObject)]
|
|
|
|
|
type Super = UIView;
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
extern_methods!(
|
|
|
|
|
unsafe impl UIWindow {
|
|
|
|
|
pub fn screen(&self) -> Id<UIScreen, Shared> {
|
|
|
|
|
unsafe { msg_send_id![self, screen] }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[sel(setScreen:)]
|
|
|
|
|
pub fn setScreen(&self, screen: &UIScreen);
|
|
|
|
|
|
|
|
|
|
#[sel(setHidden:)]
|
|
|
|
|
pub fn setHidden(&self, flag: bool);
|
|
|
|
|
|
|
|
|
|
#[sel(makeKeyAndVisible)]
|
|
|
|
|
pub fn makeKeyAndVisible(&self);
|
2023-01-17 03:30:14 +02:00
|
|
|
|
|
|
|
|
#[sel(isKeyWindow)]
|
|
|
|
|
pub fn isKeyWindow(&self) -> bool;
|
2022-09-08 20:30:34 +02:00
|
|
|
}
|
|
|
|
|
);
|