objc2_sprite_kit/generated/
SKVideoNode.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-app-kit")]
7#[cfg(target_os = "macos")]
8use objc2_app_kit::*;
9#[cfg(feature = "objc2-av-foundation")]
10use objc2_av_foundation::*;
11#[cfg(feature = "objc2-core-foundation")]
12use objc2_core_foundation::*;
13use objc2_foundation::*;
14
15use crate::*;
16
17extern_class!(
18    /// [Apple's documentation](https://developer.apple.com/documentation/spritekit/skvideonode?language=objc)
19    #[unsafe(super(SKNode, NSResponder, NSObject))]
20    #[derive(Debug, PartialEq, Eq, Hash)]
21    #[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
22    #[cfg(target_os = "macos")]
23    pub struct SKVideoNode;
24);
25
26#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
27#[cfg(target_os = "macos")]
28extern_conformance!(
29    unsafe impl NSCoding for SKVideoNode {}
30);
31
32#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
33#[cfg(target_os = "macos")]
34extern_conformance!(
35    unsafe impl NSCopying for SKVideoNode {}
36);
37
38#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
39#[cfg(target_os = "macos")]
40unsafe impl CopyingHelper for SKVideoNode {
41    type Result = Self;
42}
43
44#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
45#[cfg(target_os = "macos")]
46extern_conformance!(
47    unsafe impl NSObjectProtocol for SKVideoNode {}
48);
49
50#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
51#[cfg(target_os = "macos")]
52extern_conformance!(
53    unsafe impl NSSecureCoding for SKVideoNode {}
54);
55
56#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
57#[cfg(target_os = "macos")]
58impl SKVideoNode {
59    extern_methods!(
60        #[cfg(feature = "objc2-av-foundation")]
61        /// Create a video node from an AVPlayer. You can use the AVPlayer to control playback.
62        #[unsafe(method(videoNodeWithAVPlayer:))]
63        #[unsafe(method_family = none)]
64        pub unsafe fn videoNodeWithAVPlayer(
65            player: &AVPlayer,
66            mtm: MainThreadMarker,
67        ) -> Retained<SKVideoNode>;
68
69        /// Create a video node from a file.
70        #[deprecated]
71        #[unsafe(method(videoNodeWithVideoFileNamed:))]
72        #[unsafe(method_family = none)]
73        pub unsafe fn videoNodeWithVideoFileNamed(
74            video_file: &NSString,
75            mtm: MainThreadMarker,
76        ) -> Retained<SKVideoNode>;
77
78        #[unsafe(method(videoNodeWithFileNamed:))]
79        #[unsafe(method_family = none)]
80        pub unsafe fn videoNodeWithFileNamed(
81            video_file: &NSString,
82            mtm: MainThreadMarker,
83        ) -> Retained<SKVideoNode>;
84
85        /// Create a video node from a URL.
86        #[deprecated]
87        #[unsafe(method(videoNodeWithVideoURL:))]
88        #[unsafe(method_family = none)]
89        pub unsafe fn videoNodeWithVideoURL(
90            video_url: &NSURL,
91            mtm: MainThreadMarker,
92        ) -> Retained<SKVideoNode>;
93
94        #[unsafe(method(videoNodeWithURL:))]
95        #[unsafe(method_family = none)]
96        pub unsafe fn videoNodeWithURL(
97            video_url: &NSURL,
98            mtm: MainThreadMarker,
99        ) -> Retained<SKVideoNode>;
100
101        #[cfg(feature = "objc2-av-foundation")]
102        /// Designated Initializer.
103        ///
104        /// Initialize a video node from an AVPlayer. You can use the AVPlayer to control playback.
105        #[unsafe(method(initWithAVPlayer:))]
106        #[unsafe(method_family = init)]
107        pub unsafe fn initWithAVPlayer(this: Allocated<Self>, player: &AVPlayer) -> Retained<Self>;
108
109        /// Initialize a video node from a file.
110        #[deprecated]
111        #[unsafe(method(initWithVideoFileNamed:))]
112        #[unsafe(method_family = init)]
113        pub unsafe fn initWithVideoFileNamed(
114            this: Allocated<Self>,
115            video_file: &NSString,
116        ) -> Retained<Self>;
117
118        #[unsafe(method(initWithFileNamed:))]
119        #[unsafe(method_family = init)]
120        pub unsafe fn initWithFileNamed(
121            this: Allocated<Self>,
122            video_file: &NSString,
123        ) -> Retained<Self>;
124
125        #[deprecated]
126        #[unsafe(method(initWithVideoURL:))]
127        #[unsafe(method_family = init)]
128        pub unsafe fn initWithVideoURL(this: Allocated<Self>, url: &NSURL) -> Retained<Self>;
129
130        #[unsafe(method(initWithURL:))]
131        #[unsafe(method_family = init)]
132        pub unsafe fn initWithURL(this: Allocated<Self>, url: &NSURL) -> Retained<Self>;
133
134        /// Support coding and decoding via NSKeyedArchiver.
135        #[unsafe(method(initWithCoder:))]
136        #[unsafe(method_family = init)]
137        pub unsafe fn initWithCoder(
138            this: Allocated<Self>,
139            a_decoder: &NSCoder,
140        ) -> Option<Retained<Self>>;
141
142        #[unsafe(method(play))]
143        #[unsafe(method_family = none)]
144        pub unsafe fn play(&self);
145
146        #[unsafe(method(pause))]
147        #[unsafe(method_family = none)]
148        pub unsafe fn pause(&self);
149
150        #[cfg(feature = "objc2-core-foundation")]
151        /// The display size of the video (in parent's coordinate space)
152        #[unsafe(method(size))]
153        #[unsafe(method_family = none)]
154        pub unsafe fn size(&self) -> CGSize;
155
156        #[cfg(feature = "objc2-core-foundation")]
157        /// Setter for [`size`][Self::size].
158        #[unsafe(method(setSize:))]
159        #[unsafe(method_family = none)]
160        pub unsafe fn setSize(&self, size: CGSize);
161
162        #[cfg(feature = "objc2-core-foundation")]
163        /// The location in the video that maps to its 'position' in the parent's coordinate space. (0.0-1.0)
164        #[unsafe(method(anchorPoint))]
165        #[unsafe(method_family = none)]
166        pub unsafe fn anchorPoint(&self) -> CGPoint;
167
168        #[cfg(feature = "objc2-core-foundation")]
169        /// Setter for [`anchorPoint`][Self::anchorPoint].
170        #[unsafe(method(setAnchorPoint:))]
171        #[unsafe(method_family = none)]
172        pub unsafe fn setAnchorPoint(&self, anchor_point: CGPoint);
173    );
174}
175
176/// Methods declared on superclass `SKNode`.
177#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
178#[cfg(target_os = "macos")]
179impl SKVideoNode {
180    extern_methods!(
181        #[unsafe(method(init))]
182        #[unsafe(method_family = init)]
183        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
184
185        #[unsafe(method(node))]
186        #[unsafe(method_family = none)]
187        pub unsafe fn node(mtm: MainThreadMarker) -> Retained<Self>;
188
189        #[unsafe(method(nodeWithFileNamed:))]
190        #[unsafe(method_family = none)]
191        pub unsafe fn nodeWithFileNamed(
192            filename: &NSString,
193            mtm: MainThreadMarker,
194        ) -> Option<Retained<Self>>;
195
196        #[unsafe(method(nodeWithFileNamed:securelyWithClasses:andError:_))]
197        #[unsafe(method_family = none)]
198        pub unsafe fn nodeWithFileNamed_securelyWithClasses_andError(
199            filename: &NSString,
200            classes: &NSSet<AnyClass>,
201            mtm: MainThreadMarker,
202        ) -> Result<Retained<Self>, Retained<NSError>>;
203    );
204}
205
206/// Methods declared on superclass `NSObject`.
207#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
208#[cfg(target_os = "macos")]
209impl SKVideoNode {
210    extern_methods!(
211        #[unsafe(method(new))]
212        #[unsafe(method_family = new)]
213        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
214    );
215}