use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSRulerMarker;
);
extern_conformance!(
unsafe impl NSCoding for NSRulerMarker {}
);
extern_conformance!(
unsafe impl NSCopying for NSRulerMarker {}
);
unsafe impl CopyingHelper for NSRulerMarker {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for NSRulerMarker {}
);
impl NSRulerMarker {
extern_methods!(
#[cfg(all(
feature = "NSImage",
feature = "NSResponder",
feature = "NSRulerView",
feature = "NSView",
feature = "objc2-core-foundation"
))]
#[unsafe(method(initWithRulerView:markerLocation:image:imageOrigin:))]
#[unsafe(method_family = init)]
pub fn initWithRulerView_markerLocation_image_imageOrigin(
this: Allocated<Self>,
ruler: &NSRulerView,
location: CGFloat,
image: &NSImage,
image_origin: NSPoint,
) -> Retained<Self>;
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[cfg(all(feature = "NSResponder", feature = "NSRulerView", feature = "NSView"))]
#[unsafe(method(ruler))]
#[unsafe(method_family = none)]
pub fn ruler(&self, mtm: MainThreadMarker) -> Option<Retained<NSRulerView>>;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(markerLocation))]
#[unsafe(method_family = none)]
pub fn markerLocation(&self) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setMarkerLocation:))]
#[unsafe(method_family = none)]
pub fn setMarkerLocation(&self, marker_location: CGFloat);
#[cfg(feature = "NSImage")]
#[unsafe(method(image))]
#[unsafe(method_family = none)]
pub fn image(&self) -> Retained<NSImage>;
#[cfg(feature = "NSImage")]
#[unsafe(method(setImage:))]
#[unsafe(method_family = none)]
pub fn setImage(&self, image: &NSImage);
#[unsafe(method(imageOrigin))]
#[unsafe(method_family = none)]
pub fn imageOrigin(&self) -> NSPoint;
#[unsafe(method(setImageOrigin:))]
#[unsafe(method_family = none)]
pub fn setImageOrigin(&self, image_origin: NSPoint);
#[unsafe(method(isMovable))]
#[unsafe(method_family = none)]
pub fn isMovable(&self) -> bool;
#[unsafe(method(setMovable:))]
#[unsafe(method_family = none)]
pub fn setMovable(&self, movable: bool);
#[unsafe(method(isRemovable))]
#[unsafe(method_family = none)]
pub fn isRemovable(&self) -> bool;
#[unsafe(method(setRemovable:))]
#[unsafe(method_family = none)]
pub fn setRemovable(&self, removable: bool);
#[unsafe(method(isDragging))]
#[unsafe(method_family = none)]
pub fn isDragging(&self) -> bool;
#[unsafe(method(representedObject))]
#[unsafe(method_family = none)]
pub fn representedObject(&self) -> Option<Retained<ProtocolObject<dyn NSCopying>>>;
#[unsafe(method(setRepresentedObject:))]
#[unsafe(method_family = none)]
pub unsafe fn setRepresentedObject(
&self,
represented_object: Option<&ProtocolObject<dyn NSCopying>>,
);
#[unsafe(method(imageRectInRuler))]
#[unsafe(method_family = none)]
pub fn imageRectInRuler(&self) -> NSRect;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(thicknessRequiredInRuler))]
#[unsafe(method_family = none)]
pub fn thicknessRequiredInRuler(&self) -> CGFloat;
#[unsafe(method(drawRect:))]
#[unsafe(method_family = none)]
pub fn drawRect(&self, rect: NSRect);
#[cfg(feature = "NSEvent")]
#[unsafe(method(trackMouse:adding:))]
#[unsafe(method_family = none)]
pub fn trackMouse_adding(&self, mouse_down_event: &NSEvent, is_adding: bool) -> bool;
);
}
impl NSRulerMarker {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}