-
Notifications
You must be signed in to change notification settings - Fork 98
Expand file tree
/
Copy pathwindow.rs
More file actions
38 lines (31 loc) · 1022 Bytes
/
window.rs
File metadata and controls
38 lines (31 loc) · 1022 Bytes
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
// Copyright 2022 The AccessKit Authors. All rights reserved.
// Licensed under the Apache License, Version 2.0 (found in
// the LICENSE-APACHE file) or the MIT license (found in
// the LICENSE-MIT file), at your option.
use objc2::{
extern_class, extern_methods,
foundation::{NSObject, NSPoint, NSRect},
msg_send_id,
rc::{Id, Shared},
ClassType,
};
use super::{NSResponder, NSView};
extern_class!(
#[derive(Debug)]
pub(crate) struct NSWindow;
unsafe impl ClassType for NSWindow {
#[inherits(NSObject)]
type Super = NSResponder;
}
);
extern_methods!(
unsafe impl NSWindow {
#[sel(convertRectToScreen:)]
pub(crate) fn convert_rect_to_screen(&self, rect: NSRect) -> NSRect;
#[sel(convertPointFromScreen:)]
pub(crate) fn convert_point_from_screen(&self, point: NSPoint) -> NSPoint;
pub(crate) fn content_view(&self) -> Option<Id<NSView, Shared>> {
unsafe { msg_send_id![self, contentView] }
}
}
);