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::*;
#[cfg(feature = "objc2-core-foundation")]
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct UIPointerAccessoryPosition {
pub offset: CGFloat,
pub angle: CGFloat,
}
#[cfg(feature = "objc2-core-foundation")]
unsafe impl Encode for UIPointerAccessoryPosition {
const ENCODING: Encoding = Encoding::Struct("?", &[<CGFloat>::ENCODING, <CGFloat>::ENCODING]);
}
#[cfg(feature = "objc2-core-foundation")]
unsafe impl RefEncode for UIPointerAccessoryPosition {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[cfg(feature = "objc2-core-foundation")]
unsafe impl Send for UIPointerAccessoryPosition {}
#[cfg(feature = "objc2-core-foundation")]
unsafe impl Sync for UIPointerAccessoryPosition {}
#[cfg(feature = "objc2-core-foundation")]
impl UIPointerAccessoryPosition {
}
extern "C" {
#[cfg(feature = "objc2-core-foundation")]
pub static UIPointerAccessoryPositionTop: UIPointerAccessoryPosition;
}
extern "C" {
#[cfg(feature = "objc2-core-foundation")]
pub static UIPointerAccessoryPositionTopRight: UIPointerAccessoryPosition;
}
extern "C" {
#[cfg(feature = "objc2-core-foundation")]
pub static UIPointerAccessoryPositionRight: UIPointerAccessoryPosition;
}
extern "C" {
#[cfg(feature = "objc2-core-foundation")]
pub static UIPointerAccessoryPositionBottomRight: UIPointerAccessoryPosition;
}
extern "C" {
#[cfg(feature = "objc2-core-foundation")]
pub static UIPointerAccessoryPositionBottom: UIPointerAccessoryPosition;
}
extern "C" {
#[cfg(feature = "objc2-core-foundation")]
pub static UIPointerAccessoryPositionBottomLeft: UIPointerAccessoryPosition;
}
extern "C" {
#[cfg(feature = "objc2-core-foundation")]
pub static UIPointerAccessoryPositionLeft: UIPointerAccessoryPosition;
}
extern "C" {
#[cfg(feature = "objc2-core-foundation")]
pub static UIPointerAccessoryPositionTopLeft: UIPointerAccessoryPosition;
}
extern_class!(
#[unsafe(super(NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UIPointerAccessory;
);
extern_conformance!(
unsafe impl NSCopying for UIPointerAccessory {}
);
unsafe impl CopyingHelper for UIPointerAccessory {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for UIPointerAccessory {}
);
impl UIPointerAccessory {
extern_methods!(
#[cfg(feature = "UIPointerStyle")]
#[unsafe(method(shape))]
#[unsafe(method_family = none)]
pub fn shape(&self) -> Retained<UIPointerShape>;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(position))]
#[unsafe(method_family = none)]
pub fn position(&self) -> UIPointerAccessoryPosition;
#[unsafe(method(orientationMatchesAngle))]
#[unsafe(method_family = none)]
pub fn orientationMatchesAngle(&self) -> bool;
#[unsafe(method(setOrientationMatchesAngle:))]
#[unsafe(method_family = none)]
pub fn setOrientationMatchesAngle(&self, orientation_matches_angle: bool);
#[cfg(all(feature = "UIPointerStyle", feature = "objc2-core-foundation"))]
#[unsafe(method(accessoryWithShape:position:))]
#[unsafe(method_family = none)]
pub fn accessoryWithShape_position(
shape: &UIPointerShape,
position: UIPointerAccessoryPosition,
) -> Retained<Self>;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(arrowAccessoryWithPosition:))]
#[unsafe(method_family = none)]
pub fn arrowAccessoryWithPosition(
position: UIPointerAccessoryPosition,
mtm: MainThreadMarker,
) -> Retained<Self>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}