use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_protocol!(
pub unsafe trait SKWarpable: NSObjectProtocol {
#[unsafe(method(warpGeometry))]
#[unsafe(method_family = none)]
unsafe fn warpGeometry(&self) -> Option<Retained<SKWarpGeometry>>;
#[unsafe(method(setWarpGeometry:))]
#[unsafe(method_family = none)]
unsafe fn setWarpGeometry(&self, warp_geometry: Option<&SKWarpGeometry>);
#[unsafe(method(subdivisionLevels))]
#[unsafe(method_family = none)]
unsafe fn subdivisionLevels(&self) -> NSInteger;
#[unsafe(method(setSubdivisionLevels:))]
#[unsafe(method_family = none)]
unsafe fn setSubdivisionLevels(&self, subdivision_levels: NSInteger);
}
);
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct SKWarpGeometry;
);
extern_conformance!(
unsafe impl NSCoding for SKWarpGeometry {}
);
extern_conformance!(
unsafe impl NSCopying for SKWarpGeometry {}
);
unsafe impl CopyingHelper for SKWarpGeometry {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for SKWarpGeometry {}
);
extern_conformance!(
unsafe impl NSSecureCoding for SKWarpGeometry {}
);
impl SKWarpGeometry {
extern_methods!();
}
impl SKWarpGeometry {
extern_methods!(
#[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() -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(SKWarpGeometry, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct SKWarpGeometryGrid;
);
extern_conformance!(
unsafe impl NSCoding for SKWarpGeometryGrid {}
);
extern_conformance!(
unsafe impl NSCopying for SKWarpGeometryGrid {}
);
unsafe impl CopyingHelper for SKWarpGeometryGrid {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for SKWarpGeometryGrid {}
);
extern_conformance!(
unsafe impl NSSecureCoding for SKWarpGeometryGrid {}
);
impl SKWarpGeometryGrid {
extern_methods!(
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
a_decoder: &NSCoder,
) -> Option<Retained<Self>>;
#[unsafe(method(grid))]
#[unsafe(method_family = none)]
pub unsafe fn grid() -> Retained<Self>;
#[unsafe(method(gridWithColumns:rows:))]
#[unsafe(method_family = none)]
pub unsafe fn gridWithColumns_rows(cols: NSInteger, rows: NSInteger) -> Retained<Self>;
#[unsafe(method(numberOfColumns))]
#[unsafe(method_family = none)]
pub unsafe fn numberOfColumns(&self) -> NSInteger;
#[unsafe(method(numberOfRows))]
#[unsafe(method_family = none)]
pub unsafe fn numberOfRows(&self) -> NSInteger;
#[unsafe(method(vertexCount))]
#[unsafe(method_family = none)]
pub unsafe fn vertexCount(&self) -> NSInteger;
);
}
impl SKWarpGeometryGrid {
extern_methods!(
#[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() -> Retained<Self>;
);
}
#[cfg(feature = "SKAction")]
impl SKAction {
extern_methods!(
#[unsafe(method(warpTo:duration:))]
#[unsafe(method_family = none)]
pub unsafe fn warpTo_duration(
warp: &SKWarpGeometry,
duration: NSTimeInterval,
) -> Option<Retained<SKAction>>;
#[unsafe(method(animateWithWarps:times:))]
#[unsafe(method_family = none)]
pub unsafe fn animateWithWarps_times(
warps: &NSArray<SKWarpGeometry>,
times: &NSArray<NSNumber>,
) -> Option<Retained<SKAction>>;
#[unsafe(method(animateWithWarps:times:restore:))]
#[unsafe(method_family = none)]
pub unsafe fn animateWithWarps_times_restore(
warps: &NSArray<SKWarpGeometry>,
times: &NSArray<NSNumber>,
restore: bool,
) -> Option<Retained<SKAction>>;
);
}