2022-09-02 21:02:40 +02:00
|
|
|
use objc2::foundation::{NSObject, NSRect};
|
|
|
|
|
use objc2::{extern_class, extern_methods, ClassType};
|
2022-09-02 18:46:18 +02:00
|
|
|
|
2022-09-02 21:02:40 +02:00
|
|
|
use super::{NSCursor, NSResponder};
|
2022-09-02 18:46:18 +02:00
|
|
|
|
|
|
|
|
extern_class!(
|
|
|
|
|
#[derive(Debug, PartialEq, Eq, Hash)]
|
|
|
|
|
pub(crate) struct NSView;
|
|
|
|
|
|
|
|
|
|
unsafe impl ClassType for NSView {
|
|
|
|
|
#[inherits(NSObject)]
|
|
|
|
|
type Super = NSResponder;
|
|
|
|
|
}
|
|
|
|
|
);
|
2022-09-02 21:02:40 +02:00
|
|
|
|
|
|
|
|
extern_methods!(
|
|
|
|
|
/// Getter methods
|
|
|
|
|
unsafe impl NSView {
|
|
|
|
|
#[sel(bounds)]
|
|
|
|
|
pub fn bounds(&self) -> NSRect;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
unsafe impl NSView {
|
|
|
|
|
#[sel(addCursorRect:cursor:)]
|
|
|
|
|
// NSCursor safe to take by shared reference since it is already immutable
|
|
|
|
|
pub fn addCursorRect(&self, rect: NSRect, cursor: &NSCursor);
|
|
|
|
|
}
|
|
|
|
|
);
|