objc2_sprite_kit/generated/
SKShader.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11 #[unsafe(super(NSObject))]
13 #[derive(Debug, PartialEq, Eq, Hash)]
14 pub struct SKShader;
15);
16
17unsafe impl NSCoding for SKShader {}
18
19unsafe impl NSCopying for SKShader {}
20
21unsafe impl CopyingHelper for SKShader {
22 type Result = Self;
23}
24
25unsafe impl NSObjectProtocol for SKShader {}
26
27unsafe impl NSSecureCoding for SKShader {}
28
29impl SKShader {
30 extern_methods!(
31 #[unsafe(method(initWithSource:))]
36 #[unsafe(method_family = init)]
37 pub unsafe fn initWithSource(this: Allocated<Self>, source: &NSString) -> Retained<Self>;
38
39 #[cfg(feature = "SKUniform")]
40 #[unsafe(method(initWithSource:uniforms:))]
47 #[unsafe(method_family = init)]
48 pub unsafe fn initWithSource_uniforms(
49 this: Allocated<Self>,
50 source: &NSString,
51 uniforms: &NSArray<SKUniform>,
52 ) -> Retained<Self>;
53
54 #[unsafe(method(shader))]
55 #[unsafe(method_family = none)]
56 pub unsafe fn shader() -> Retained<Self>;
57
58 #[unsafe(method(shaderWithSource:))]
59 #[unsafe(method_family = none)]
60 pub unsafe fn shaderWithSource(source: &NSString) -> Retained<Self>;
61
62 #[cfg(feature = "SKUniform")]
63 #[unsafe(method(shaderWithSource:uniforms:))]
64 #[unsafe(method_family = none)]
65 pub unsafe fn shaderWithSource_uniforms(
66 source: &NSString,
67 uniforms: &NSArray<SKUniform>,
68 ) -> Retained<Self>;
69
70 #[unsafe(method(shaderWithFileNamed:))]
80 #[unsafe(method_family = none)]
81 pub unsafe fn shaderWithFileNamed(name: &NSString) -> Retained<Self>;
82
83 #[unsafe(method(source))]
107 #[unsafe(method_family = none)]
108 pub unsafe fn source(&self) -> Option<Retained<NSString>>;
109
110 #[unsafe(method(setSource:))]
112 #[unsafe(method_family = none)]
113 pub unsafe fn setSource(&self, source: Option<&NSString>);
114
115 #[cfg(feature = "SKUniform")]
116 #[unsafe(method(uniforms))]
121 #[unsafe(method_family = none)]
122 pub unsafe fn uniforms(&self) -> Retained<NSArray<SKUniform>>;
123
124 #[cfg(feature = "SKUniform")]
125 #[unsafe(method(setUniforms:))]
127 #[unsafe(method_family = none)]
128 pub unsafe fn setUniforms(&self, uniforms: &NSArray<SKUniform>);
129
130 #[cfg(feature = "SKUniform")]
131 #[unsafe(method(addUniform:))]
132 #[unsafe(method_family = none)]
133 pub unsafe fn addUniform(&self, uniform: &SKUniform);
134
135 #[cfg(feature = "SKUniform")]
136 #[unsafe(method(uniformNamed:))]
137 #[unsafe(method_family = none)]
138 pub unsafe fn uniformNamed(&self, name: &NSString) -> Option<Retained<SKUniform>>;
139
140 #[unsafe(method(removeUniformNamed:))]
141 #[unsafe(method_family = none)]
142 pub unsafe fn removeUniformNamed(&self, name: &NSString);
143
144 #[cfg(feature = "SKAttribute")]
145 #[unsafe(method(attributes))]
146 #[unsafe(method_family = none)]
147 pub unsafe fn attributes(&self) -> Retained<NSArray<SKAttribute>>;
148
149 #[cfg(feature = "SKAttribute")]
150 #[unsafe(method(setAttributes:))]
152 #[unsafe(method_family = none)]
153 pub unsafe fn setAttributes(&self, attributes: &NSArray<SKAttribute>);
154 );
155}
156
157impl SKShader {
159 extern_methods!(
160 #[unsafe(method(init))]
161 #[unsafe(method_family = init)]
162 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
163
164 #[unsafe(method(new))]
165 #[unsafe(method_family = new)]
166 pub unsafe fn new() -> Retained<Self>;
167 );
168}