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-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
#[unsafe(super(NSView, NSResponder, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
pub struct SKView;
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSAccessibility for SKView {}
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSAccessibilityElementProtocol for SKView {}
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSAnimatablePropertyContainer for SKView {}
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSAppearanceCustomization for SKView {}
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSCoding for SKView {}
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSDraggingDestination for SKView {}
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSObjectProtocol for SKView {}
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSSecureCoding for SKView {}
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSUserInterfaceItemIdentification for SKView {}
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl SKView {
extern_methods!(
#[unsafe(method(isPaused))]
#[unsafe(method_family = none)]
pub unsafe fn isPaused(&self) -> bool;
#[unsafe(method(setPaused:))]
#[unsafe(method_family = none)]
pub unsafe fn setPaused(&self, paused: bool);
#[unsafe(method(showsFPS))]
#[unsafe(method_family = none)]
pub unsafe fn showsFPS(&self) -> bool;
#[unsafe(method(setShowsFPS:))]
#[unsafe(method_family = none)]
pub unsafe fn setShowsFPS(&self, shows_fps: bool);
#[unsafe(method(showsDrawCount))]
#[unsafe(method_family = none)]
pub unsafe fn showsDrawCount(&self) -> bool;
#[unsafe(method(setShowsDrawCount:))]
#[unsafe(method_family = none)]
pub unsafe fn setShowsDrawCount(&self, shows_draw_count: bool);
#[unsafe(method(showsNodeCount))]
#[unsafe(method_family = none)]
pub unsafe fn showsNodeCount(&self) -> bool;
#[unsafe(method(setShowsNodeCount:))]
#[unsafe(method_family = none)]
pub unsafe fn setShowsNodeCount(&self, shows_node_count: bool);
#[unsafe(method(showsQuadCount))]
#[unsafe(method_family = none)]
pub unsafe fn showsQuadCount(&self) -> bool;
#[unsafe(method(setShowsQuadCount:))]
#[unsafe(method_family = none)]
pub unsafe fn setShowsQuadCount(&self, shows_quad_count: bool);
#[unsafe(method(showsPhysics))]
#[unsafe(method_family = none)]
pub unsafe fn showsPhysics(&self) -> bool;
#[unsafe(method(setShowsPhysics:))]
#[unsafe(method_family = none)]
pub unsafe fn setShowsPhysics(&self, shows_physics: bool);
#[unsafe(method(showsFields))]
#[unsafe(method_family = none)]
pub unsafe fn showsFields(&self) -> bool;
#[unsafe(method(setShowsFields:))]
#[unsafe(method_family = none)]
pub unsafe fn setShowsFields(&self, shows_fields: bool);
#[unsafe(method(isAsynchronous))]
#[unsafe(method_family = none)]
pub unsafe fn isAsynchronous(&self) -> bool;
#[unsafe(method(setAsynchronous:))]
#[unsafe(method_family = none)]
pub unsafe fn setAsynchronous(&self, asynchronous: bool);
#[unsafe(method(allowsTransparency))]
#[unsafe(method_family = none)]
pub unsafe fn allowsTransparency(&self) -> bool;
#[unsafe(method(setAllowsTransparency:))]
#[unsafe(method_family = none)]
pub unsafe fn setAllowsTransparency(&self, allows_transparency: bool);
#[unsafe(method(ignoresSiblingOrder))]
#[unsafe(method_family = none)]
pub unsafe fn ignoresSiblingOrder(&self) -> bool;
#[unsafe(method(setIgnoresSiblingOrder:))]
#[unsafe(method_family = none)]
pub unsafe fn setIgnoresSiblingOrder(&self, ignores_sibling_order: bool);
#[unsafe(method(shouldCullNonVisibleNodes))]
#[unsafe(method_family = none)]
pub unsafe fn shouldCullNonVisibleNodes(&self) -> bool;
#[unsafe(method(setShouldCullNonVisibleNodes:))]
#[unsafe(method_family = none)]
pub unsafe fn setShouldCullNonVisibleNodes(&self, should_cull_non_visible_nodes: bool);
#[unsafe(method(preferredFramesPerSecond))]
#[unsafe(method_family = none)]
pub unsafe fn preferredFramesPerSecond(&self) -> NSInteger;
#[unsafe(method(setPreferredFramesPerSecond:))]
#[unsafe(method_family = none)]
pub unsafe fn setPreferredFramesPerSecond(&self, preferred_frames_per_second: NSInteger);
#[unsafe(method(disableDepthStencilBuffer))]
#[unsafe(method_family = none)]
pub unsafe fn disableDepthStencilBuffer(&self) -> bool;
#[unsafe(method(setDisableDepthStencilBuffer:))]
#[unsafe(method_family = none)]
pub unsafe fn setDisableDepthStencilBuffer(&self, disable_depth_stencil_buffer: bool);
#[unsafe(method(delegate))]
#[unsafe(method_family = none)]
pub unsafe fn delegate(&self) -> Option<Retained<NSObject>>;
#[unsafe(method(setDelegate:))]
#[unsafe(method_family = none)]
pub unsafe fn setDelegate(&self, delegate: Option<&NSObject>);
#[deprecated]
#[unsafe(method(frameInterval))]
#[unsafe(method_family = none)]
pub unsafe fn frameInterval(&self) -> NSInteger;
#[deprecated]
#[unsafe(method(setFrameInterval:))]
#[unsafe(method_family = none)]
pub unsafe fn setFrameInterval(&self, frame_interval: NSInteger);
#[deprecated]
#[unsafe(method(preferredFrameRate))]
#[unsafe(method_family = none)]
pub unsafe fn preferredFrameRate(&self) -> c_float;
#[deprecated]
#[unsafe(method(setPreferredFrameRate:))]
#[unsafe(method_family = none)]
pub unsafe fn setPreferredFrameRate(&self, preferred_frame_rate: c_float);
#[cfg(all(feature = "SKEffectNode", feature = "SKNode", feature = "SKScene"))]
#[unsafe(method(presentScene:))]
#[unsafe(method_family = none)]
pub unsafe fn presentScene(&self, scene: Option<&SKScene>);
#[cfg(all(
feature = "SKEffectNode",
feature = "SKNode",
feature = "SKScene",
feature = "SKTransition"
))]
#[unsafe(method(presentScene:transition:))]
#[unsafe(method_family = none)]
pub unsafe fn presentScene_transition(&self, scene: &SKScene, transition: &SKTransition);
#[cfg(all(feature = "SKEffectNode", feature = "SKNode", feature = "SKScene"))]
#[unsafe(method(scene))]
#[unsafe(method_family = none)]
pub unsafe fn scene(&self) -> Option<Retained<SKScene>>;
#[cfg(all(feature = "SKNode", feature = "SKTexture"))]
#[unsafe(method(textureFromNode:))]
#[unsafe(method_family = none)]
pub unsafe fn textureFromNode(&self, node: &SKNode) -> Option<Retained<SKTexture>>;
#[cfg(all(
feature = "SKNode",
feature = "SKTexture",
feature = "objc2-core-foundation"
))]
#[unsafe(method(textureFromNode:crop:))]
#[unsafe(method_family = none)]
pub unsafe fn textureFromNode_crop(
&self,
node: &SKNode,
crop: CGRect,
) -> Option<Retained<SKTexture>>;
#[cfg(all(
feature = "SKEffectNode",
feature = "SKNode",
feature = "SKScene",
feature = "objc2-core-foundation"
))]
#[unsafe(method(convertPoint:toScene:))]
#[unsafe(method_family = none)]
pub unsafe fn convertPoint_toScene(&self, point: CGPoint, scene: &SKScene) -> CGPoint;
#[cfg(all(
feature = "SKEffectNode",
feature = "SKNode",
feature = "SKScene",
feature = "objc2-core-foundation"
))]
#[unsafe(method(convertPoint:fromScene:))]
#[unsafe(method_family = none)]
pub unsafe fn convertPoint_fromScene(&self, point: CGPoint, scene: &SKScene) -> CGPoint;
);
}
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl SKView {
extern_methods!(
#[unsafe(method(initWithFrame:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
);
}
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl SKView {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl SKView {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}
extern_protocol!(
pub unsafe trait SKViewDelegate: NSObjectProtocol {
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
#[optional]
#[unsafe(method(view:shouldRenderAtTime:))]
#[unsafe(method_family = none)]
unsafe fn view_shouldRenderAtTime(&self, view: &SKView, time: NSTimeInterval) -> bool;
}
);