2023-07-29 00:33:03 +02:00
|
|
|
use objc2::rc::Id;
|
|
|
|
|
use objc2::{extern_class, extern_methods, msg_send_id, mutability, ClassType};
|
2024-04-18 17:34:19 +02:00
|
|
|
use objc2_foundation::NSObject;
|
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;
|
2023-07-29 00:33:03 +02:00
|
|
|
type Mutability = mutability::InteriorMutable;
|
2022-12-28 18:36:32 +01:00
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
extern_methods!(
|
|
|
|
|
unsafe impl UIWindow {
|
2023-07-29 00:33:03 +02:00
|
|
|
pub fn screen(&self) -> Id<UIScreen> {
|
2022-12-28 18:36:32 +01:00
|
|
|
unsafe { msg_send_id![self, screen] }
|
|
|
|
|
}
|
|
|
|
|
|
2023-07-29 00:33:03 +02:00
|
|
|
#[method(setScreen:)]
|
2022-12-28 18:36:32 +01:00
|
|
|
pub fn setScreen(&self, screen: &UIScreen);
|
|
|
|
|
|
2023-07-29 00:33:03 +02:00
|
|
|
#[method(setHidden:)]
|
2022-12-28 18:36:32 +01:00
|
|
|
pub fn setHidden(&self, flag: bool);
|
|
|
|
|
|
2023-07-29 00:33:03 +02:00
|
|
|
#[method(makeKeyAndVisible)]
|
2022-12-28 18:36:32 +01:00
|
|
|
pub fn makeKeyAndVisible(&self);
|
2023-01-17 03:30:14 +02:00
|
|
|
|
2023-07-29 00:33:03 +02:00
|
|
|
#[method(isKeyWindow)]
|
2023-01-17 03:30:14 +02:00
|
|
|
pub fn isKeyWindow(&self) -> bool;
|
2022-09-08 20:30:34 +02:00
|
|
|
}
|
|
|
|
|
);
|