1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
use objc2_app_kit::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
/// A Camera node is a full fledged SKNode that can have actions and physics applied to it.
/// It also uses the standard SKNode transform system so modifying the camera node's position
/// is how you translate the camera's viewport. Applying a scale to the node would zoom
/// the viewport in or out etc. As an added benefit you can now rotate the viewport by
/// applying a zRotation to the camera node, just as you would with any other SKNode.
///
/// The camera viewport is centered on the camera's position. It uses the scene's frame
/// and scale mode along with the node transforms to determine the size, origin and
/// rotation of the viewport.
///
/// There are some convenience functions included for testing if nodes are contained
/// within the camera viewport. It can be used to determine if objects are no longer
/// visible on the display.
///
/// In order to use a camera; set it on the scene that contains the camera.
///
/// See: SKScene.camera
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/spritekit/skcameranode?language=objc)
#[unsafe(super(SKNode, NSResponder, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
pub struct SKCameraNode;
);
#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSCoding for SKCameraNode {}
);
#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSCopying for SKCameraNode {}
);
#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
unsafe impl CopyingHelper for SKCameraNode {
type Result = Self;
}
#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSObjectProtocol for SKCameraNode {}
);
#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSSecureCoding for SKCameraNode {}
);
#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
impl SKCameraNode {
extern_methods!(
/// Checks if the node is contained inside the viewport of the camera.
/// The camera and node must both be in the same scene and presented on a view in order
/// to determine if the node is inside the camera viewport rectangle.
///
///
/// Returns: YES if the node is inside the viewport. NO if node is nil or the node is outside the viewport.
#[unsafe(method(containsNode:))]
#[unsafe(method_family = none)]
pub unsafe fn containsNode(&self, node: &SKNode) -> bool;
/// Returns the set of nodes in the same scene as the camera that are contained within its viewport.
///
/// Returns: the set of nodes contained
#[unsafe(method(containedNodeSet))]
#[unsafe(method_family = none)]
pub unsafe fn containedNodeSet(&self) -> Retained<NSSet<SKNode>>;
);
}
/// Methods declared on superclass `SKNode`.
#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
impl SKCameraNode {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
/// Support coding and decoding via NSKeyedArchiver.
///
/// # Safety
///
/// `a_decoder` possibly has further requirements.
#[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>>;
/// # Safety
///
/// `classes` generic probably has further requirements.
#[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>>;
);
}
/// Methods declared on superclass `NSObject`.
#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
impl SKCameraNode {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}