use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
use objc2_app_kit::*;
#[cfg(feature = "objc2-avf-audio")]
use objc2_avf_audio::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct SKSceneScaleMode(pub NSInteger);
impl SKSceneScaleMode {
#[doc(alias = "SKSceneScaleModeFill")]
pub const Fill: Self = Self(0);
#[doc(alias = "SKSceneScaleModeAspectFill")]
pub const AspectFill: Self = Self(1);
#[doc(alias = "SKSceneScaleModeAspectFit")]
pub const AspectFit: Self = Self(2);
#[doc(alias = "SKSceneScaleModeResizeFill")]
pub const ResizeFill: Self = Self(3);
}
unsafe impl Encode for SKSceneScaleMode {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for SKSceneScaleMode {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_protocol!(
pub unsafe trait SKSceneDelegate: NSObjectProtocol {
#[cfg(all(
feature = "SKEffectNode",
feature = "SKNode",
feature = "objc2-app-kit"
))]
#[cfg(target_os = "macos")]
#[optional]
#[unsafe(method(update:forScene:))]
#[unsafe(method_family = none)]
unsafe fn update_forScene(&self, current_time: NSTimeInterval, scene: &SKScene);
#[cfg(all(
feature = "SKEffectNode",
feature = "SKNode",
feature = "objc2-app-kit"
))]
#[cfg(target_os = "macos")]
#[optional]
#[unsafe(method(didEvaluateActionsForScene:))]
#[unsafe(method_family = none)]
unsafe fn didEvaluateActionsForScene(&self, scene: &SKScene);
#[cfg(all(
feature = "SKEffectNode",
feature = "SKNode",
feature = "objc2-app-kit"
))]
#[cfg(target_os = "macos")]
#[optional]
#[unsafe(method(didSimulatePhysicsForScene:))]
#[unsafe(method_family = none)]
unsafe fn didSimulatePhysicsForScene(&self, scene: &SKScene);
#[cfg(all(
feature = "SKEffectNode",
feature = "SKNode",
feature = "objc2-app-kit"
))]
#[cfg(target_os = "macos")]
#[optional]
#[unsafe(method(didApplyConstraintsForScene:))]
#[unsafe(method_family = none)]
unsafe fn didApplyConstraintsForScene(&self, scene: &SKScene);
#[cfg(all(
feature = "SKEffectNode",
feature = "SKNode",
feature = "objc2-app-kit"
))]
#[cfg(target_os = "macos")]
#[optional]
#[unsafe(method(didFinishUpdateForScene:))]
#[unsafe(method_family = none)]
unsafe fn didFinishUpdateForScene(&self, scene: &SKScene);
}
);
extern_class!(
#[unsafe(super(SKEffectNode, SKNode, NSResponder, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(all(
feature = "SKEffectNode",
feature = "SKNode",
feature = "objc2-app-kit"
))]
#[cfg(target_os = "macos")]
pub struct SKScene;
);
#[cfg(all(
feature = "SKEffectNode",
feature = "SKNode",
feature = "objc2-app-kit"
))]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSCoding for SKScene {}
);
#[cfg(all(
feature = "SKEffectNode",
feature = "SKNode",
feature = "objc2-app-kit"
))]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSCopying for SKScene {}
);
#[cfg(all(
feature = "SKEffectNode",
feature = "SKNode",
feature = "objc2-app-kit"
))]
#[cfg(target_os = "macos")]
unsafe impl CopyingHelper for SKScene {
type Result = Self;
}
#[cfg(all(
feature = "SKEffectNode",
feature = "SKNode",
feature = "objc2-app-kit"
))]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSObjectProtocol for SKScene {}
);
#[cfg(all(
feature = "SKEffectNode",
feature = "SKNode",
feature = "objc2-app-kit"
))]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSSecureCoding for SKScene {}
);
#[cfg(all(
feature = "SKEffectNode",
feature = "SKNode",
feature = "SKWarpGeometry",
feature = "objc2-app-kit"
))]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl SKWarpable for SKScene {}
);
#[cfg(all(
feature = "SKEffectNode",
feature = "SKNode",
feature = "objc2-app-kit"
))]
#[cfg(target_os = "macos")]
impl SKScene {
extern_methods!(
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(initWithSize:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithSize(this: Allocated<Self>, size: CGSize) -> Retained<Self>;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(sceneWithSize:))]
#[unsafe(method_family = none)]
pub unsafe fn sceneWithSize(size: CGSize, mtm: MainThreadMarker) -> Retained<Self>;
#[unsafe(method(sceneDidLoad))]
#[unsafe(method_family = none)]
pub unsafe fn sceneDidLoad(&self);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(size))]
#[unsafe(method_family = none)]
pub unsafe fn size(&self) -> CGSize;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setSize:))]
#[unsafe(method_family = none)]
pub unsafe fn setSize(&self, size: CGSize);
#[unsafe(method(scaleMode))]
#[unsafe(method_family = none)]
pub unsafe fn scaleMode(&self) -> SKSceneScaleMode;
#[unsafe(method(setScaleMode:))]
#[unsafe(method_family = none)]
pub unsafe fn setScaleMode(&self, scale_mode: SKSceneScaleMode);
#[cfg(feature = "SKCameraNode")]
#[unsafe(method(camera))]
#[unsafe(method_family = none)]
pub unsafe fn camera(&self) -> Option<Retained<SKCameraNode>>;
#[cfg(feature = "SKCameraNode")]
#[unsafe(method(setCamera:))]
#[unsafe(method_family = none)]
pub unsafe fn setCamera(&self, camera: Option<&SKCameraNode>);
#[unsafe(method(listener))]
#[unsafe(method_family = none)]
pub unsafe fn listener(&self) -> Option<Retained<SKNode>>;
#[unsafe(method(setListener:))]
#[unsafe(method_family = none)]
pub unsafe fn setListener(&self, listener: Option<&SKNode>);
#[cfg(feature = "objc2-avf-audio")]
#[unsafe(method(audioEngine))]
#[unsafe(method_family = none)]
pub unsafe fn audioEngine(&self) -> Retained<AVAudioEngine>;
#[unsafe(method(backgroundColor))]
#[unsafe(method_family = none)]
pub unsafe fn backgroundColor(&self) -> Retained<NSColor>;
#[unsafe(method(setBackgroundColor:))]
#[unsafe(method_family = none)]
pub unsafe fn setBackgroundColor(&self, background_color: &NSColor);
#[unsafe(method(delegate))]
#[unsafe(method_family = none)]
pub unsafe fn delegate(&self) -> Option<Retained<ProtocolObject<dyn SKSceneDelegate>>>;
#[unsafe(method(setDelegate:))]
#[unsafe(method_family = none)]
pub unsafe fn setDelegate(&self, delegate: Option<&ProtocolObject<dyn SKSceneDelegate>>);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(anchorPoint))]
#[unsafe(method_family = none)]
pub unsafe fn anchorPoint(&self) -> CGPoint;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setAnchorPoint:))]
#[unsafe(method_family = none)]
pub unsafe fn setAnchorPoint(&self, anchor_point: CGPoint);
#[cfg(feature = "SKPhysicsWorld")]
#[unsafe(method(physicsWorld))]
#[unsafe(method_family = none)]
pub unsafe fn physicsWorld(&self) -> Retained<SKPhysicsWorld>;
#[cfg(feature = "SKView")]
#[unsafe(method(view))]
#[unsafe(method_family = none)]
pub unsafe fn view(&self) -> Option<Retained<SKView>>;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(convertPointFromView:))]
#[unsafe(method_family = none)]
pub unsafe fn convertPointFromView(&self, point: CGPoint) -> CGPoint;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(convertPointToView:))]
#[unsafe(method_family = none)]
pub unsafe fn convertPointToView(&self, point: CGPoint) -> CGPoint;
#[unsafe(method(update:))]
#[unsafe(method_family = none)]
pub unsafe fn update(&self, current_time: NSTimeInterval);
#[unsafe(method(didEvaluateActions))]
#[unsafe(method_family = none)]
pub unsafe fn didEvaluateActions(&self);
#[unsafe(method(didSimulatePhysics))]
#[unsafe(method_family = none)]
pub unsafe fn didSimulatePhysics(&self);
#[unsafe(method(didApplyConstraints))]
#[unsafe(method_family = none)]
pub unsafe fn didApplyConstraints(&self);
#[unsafe(method(didFinishUpdate))]
#[unsafe(method_family = none)]
pub unsafe fn didFinishUpdate(&self);
#[cfg(feature = "SKView")]
#[unsafe(method(didMoveToView:))]
#[unsafe(method_family = none)]
pub unsafe fn didMoveToView(&self, view: &SKView);
#[cfg(feature = "SKView")]
#[unsafe(method(willMoveFromView:))]
#[unsafe(method_family = none)]
pub unsafe fn willMoveFromView(&self, view: &SKView);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(didChangeSize:))]
#[unsafe(method_family = none)]
pub unsafe fn didChangeSize(&self, old_size: CGSize);
);
}
#[cfg(all(
feature = "SKEffectNode",
feature = "SKNode",
feature = "objc2-app-kit"
))]
#[cfg(target_os = "macos")]
impl SKScene {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
a_decoder: &NSCoder,
) -> Option<Retained<Self>>;
#[unsafe(method(node))]
#[unsafe(method_family = none)]
pub unsafe fn node(mtm: MainThreadMarker) -> Retained<Self>;
#[unsafe(method(nodeWithFileNamed:))]
#[unsafe(method_family = none)]
pub unsafe fn nodeWithFileNamed(
filename: &NSString,
mtm: MainThreadMarker,
) -> Option<Retained<Self>>;
#[unsafe(method(nodeWithFileNamed:securelyWithClasses:andError:_))]
#[unsafe(method_family = none)]
pub unsafe fn nodeWithFileNamed_securelyWithClasses_andError(
filename: &NSString,
classes: &NSSet<AnyClass>,
mtm: MainThreadMarker,
) -> Result<Retained<Self>, Retained<NSError>>;
);
}
#[cfg(all(
feature = "SKEffectNode",
feature = "SKNode",
feature = "objc2-app-kit"
))]
#[cfg(target_os = "macos")]
impl SKScene {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}