objc2-quartz-core 0.3.2

Bindings to the QuartzCore/CoreAnimation framework
Documentation
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
#[cfg(feature = "objc2-core-graphics")]
use objc2_core_graphics::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/caemittercell?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct CAEmitterCell;
);

#[cfg(feature = "CAMediaTiming")]
extern_conformance!(
    unsafe impl CAMediaTiming for CAEmitterCell {}
);

extern_conformance!(
    unsafe impl NSCoding for CAEmitterCell {}
);

extern_conformance!(
    unsafe impl NSObjectProtocol for CAEmitterCell {}
);

extern_conformance!(
    unsafe impl NSSecureCoding for CAEmitterCell {}
);

impl CAEmitterCell {
    extern_methods!(
        #[unsafe(method(emitterCell))]
        #[unsafe(method_family = none)]
        pub fn emitterCell() -> Retained<Self>;

        #[unsafe(method(defaultValueForKey:))]
        #[unsafe(method_family = none)]
        pub fn defaultValueForKey(key: &NSString) -> Option<Retained<AnyObject>>;

        #[unsafe(method(shouldArchiveValueForKey:))]
        #[unsafe(method_family = none)]
        pub fn shouldArchiveValueForKey(&self, key: &NSString) -> bool;

        #[unsafe(method(name))]
        #[unsafe(method_family = none)]
        pub fn name(&self) -> Option<Retained<NSString>>;

        /// Setter for [`name`][Self::name].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setName:))]
        #[unsafe(method_family = none)]
        pub fn setName(&self, name: Option<&NSString>);

        #[unsafe(method(isEnabled))]
        #[unsafe(method_family = none)]
        pub fn isEnabled(&self) -> bool;

        /// Setter for [`isEnabled`][Self::isEnabled].
        #[unsafe(method(setEnabled:))]
        #[unsafe(method_family = none)]
        pub fn setEnabled(&self, enabled: bool);

        #[unsafe(method(birthRate))]
        #[unsafe(method_family = none)]
        pub fn birthRate(&self) -> c_float;

        /// Setter for [`birthRate`][Self::birthRate].
        #[unsafe(method(setBirthRate:))]
        #[unsafe(method_family = none)]
        pub fn setBirthRate(&self, birth_rate: c_float);

        #[unsafe(method(lifetime))]
        #[unsafe(method_family = none)]
        pub fn lifetime(&self) -> c_float;

        /// Setter for [`lifetime`][Self::lifetime].
        #[unsafe(method(setLifetime:))]
        #[unsafe(method_family = none)]
        pub fn setLifetime(&self, lifetime: c_float);

        #[unsafe(method(lifetimeRange))]
        #[unsafe(method_family = none)]
        pub fn lifetimeRange(&self) -> c_float;

        /// Setter for [`lifetimeRange`][Self::lifetimeRange].
        #[unsafe(method(setLifetimeRange:))]
        #[unsafe(method_family = none)]
        pub fn setLifetimeRange(&self, lifetime_range: c_float);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(emissionLatitude))]
        #[unsafe(method_family = none)]
        pub fn emissionLatitude(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`emissionLatitude`][Self::emissionLatitude].
        #[unsafe(method(setEmissionLatitude:))]
        #[unsafe(method_family = none)]
        pub fn setEmissionLatitude(&self, emission_latitude: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(emissionLongitude))]
        #[unsafe(method_family = none)]
        pub fn emissionLongitude(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`emissionLongitude`][Self::emissionLongitude].
        #[unsafe(method(setEmissionLongitude:))]
        #[unsafe(method_family = none)]
        pub fn setEmissionLongitude(&self, emission_longitude: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(emissionRange))]
        #[unsafe(method_family = none)]
        pub fn emissionRange(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`emissionRange`][Self::emissionRange].
        #[unsafe(method(setEmissionRange:))]
        #[unsafe(method_family = none)]
        pub fn setEmissionRange(&self, emission_range: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(velocity))]
        #[unsafe(method_family = none)]
        pub fn velocity(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`velocity`][Self::velocity].
        #[unsafe(method(setVelocity:))]
        #[unsafe(method_family = none)]
        pub fn setVelocity(&self, velocity: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(velocityRange))]
        #[unsafe(method_family = none)]
        pub fn velocityRange(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`velocityRange`][Self::velocityRange].
        #[unsafe(method(setVelocityRange:))]
        #[unsafe(method_family = none)]
        pub fn setVelocityRange(&self, velocity_range: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(xAcceleration))]
        #[unsafe(method_family = none)]
        pub fn xAcceleration(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`xAcceleration`][Self::xAcceleration].
        #[unsafe(method(setXAcceleration:))]
        #[unsafe(method_family = none)]
        pub fn setXAcceleration(&self, x_acceleration: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(yAcceleration))]
        #[unsafe(method_family = none)]
        pub fn yAcceleration(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`yAcceleration`][Self::yAcceleration].
        #[unsafe(method(setYAcceleration:))]
        #[unsafe(method_family = none)]
        pub fn setYAcceleration(&self, y_acceleration: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(zAcceleration))]
        #[unsafe(method_family = none)]
        pub fn zAcceleration(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`zAcceleration`][Self::zAcceleration].
        #[unsafe(method(setZAcceleration:))]
        #[unsafe(method_family = none)]
        pub fn setZAcceleration(&self, z_acceleration: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(scale))]
        #[unsafe(method_family = none)]
        pub fn scale(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`scale`][Self::scale].
        #[unsafe(method(setScale:))]
        #[unsafe(method_family = none)]
        pub fn setScale(&self, scale: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(scaleRange))]
        #[unsafe(method_family = none)]
        pub fn scaleRange(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`scaleRange`][Self::scaleRange].
        #[unsafe(method(setScaleRange:))]
        #[unsafe(method_family = none)]
        pub fn setScaleRange(&self, scale_range: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(scaleSpeed))]
        #[unsafe(method_family = none)]
        pub fn scaleSpeed(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`scaleSpeed`][Self::scaleSpeed].
        #[unsafe(method(setScaleSpeed:))]
        #[unsafe(method_family = none)]
        pub fn setScaleSpeed(&self, scale_speed: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(spin))]
        #[unsafe(method_family = none)]
        pub fn spin(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`spin`][Self::spin].
        #[unsafe(method(setSpin:))]
        #[unsafe(method_family = none)]
        pub fn setSpin(&self, spin: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(spinRange))]
        #[unsafe(method_family = none)]
        pub fn spinRange(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`spinRange`][Self::spinRange].
        #[unsafe(method(setSpinRange:))]
        #[unsafe(method_family = none)]
        pub fn setSpinRange(&self, spin_range: CGFloat);

        #[cfg(feature = "objc2-core-graphics")]
        #[unsafe(method(color))]
        #[unsafe(method_family = none)]
        pub fn color(&self) -> Option<Retained<CGColor>>;

        #[cfg(feature = "objc2-core-graphics")]
        /// Setter for [`color`][Self::color].
        #[unsafe(method(setColor:))]
        #[unsafe(method_family = none)]
        pub fn setColor(&self, color: Option<&CGColor>);

        #[unsafe(method(redRange))]
        #[unsafe(method_family = none)]
        pub fn redRange(&self) -> c_float;

        /// Setter for [`redRange`][Self::redRange].
        #[unsafe(method(setRedRange:))]
        #[unsafe(method_family = none)]
        pub fn setRedRange(&self, red_range: c_float);

        #[unsafe(method(greenRange))]
        #[unsafe(method_family = none)]
        pub fn greenRange(&self) -> c_float;

        /// Setter for [`greenRange`][Self::greenRange].
        #[unsafe(method(setGreenRange:))]
        #[unsafe(method_family = none)]
        pub fn setGreenRange(&self, green_range: c_float);

        #[unsafe(method(blueRange))]
        #[unsafe(method_family = none)]
        pub fn blueRange(&self) -> c_float;

        /// Setter for [`blueRange`][Self::blueRange].
        #[unsafe(method(setBlueRange:))]
        #[unsafe(method_family = none)]
        pub fn setBlueRange(&self, blue_range: c_float);

        #[unsafe(method(alphaRange))]
        #[unsafe(method_family = none)]
        pub fn alphaRange(&self) -> c_float;

        /// Setter for [`alphaRange`][Self::alphaRange].
        #[unsafe(method(setAlphaRange:))]
        #[unsafe(method_family = none)]
        pub fn setAlphaRange(&self, alpha_range: c_float);

        #[unsafe(method(redSpeed))]
        #[unsafe(method_family = none)]
        pub fn redSpeed(&self) -> c_float;

        /// Setter for [`redSpeed`][Self::redSpeed].
        #[unsafe(method(setRedSpeed:))]
        #[unsafe(method_family = none)]
        pub fn setRedSpeed(&self, red_speed: c_float);

        #[unsafe(method(greenSpeed))]
        #[unsafe(method_family = none)]
        pub fn greenSpeed(&self) -> c_float;

        /// Setter for [`greenSpeed`][Self::greenSpeed].
        #[unsafe(method(setGreenSpeed:))]
        #[unsafe(method_family = none)]
        pub fn setGreenSpeed(&self, green_speed: c_float);

        #[unsafe(method(blueSpeed))]
        #[unsafe(method_family = none)]
        pub fn blueSpeed(&self) -> c_float;

        /// Setter for [`blueSpeed`][Self::blueSpeed].
        #[unsafe(method(setBlueSpeed:))]
        #[unsafe(method_family = none)]
        pub fn setBlueSpeed(&self, blue_speed: c_float);

        #[unsafe(method(alphaSpeed))]
        #[unsafe(method_family = none)]
        pub fn alphaSpeed(&self) -> c_float;

        /// Setter for [`alphaSpeed`][Self::alphaSpeed].
        #[unsafe(method(setAlphaSpeed:))]
        #[unsafe(method_family = none)]
        pub fn setAlphaSpeed(&self, alpha_speed: c_float);

        #[unsafe(method(contents))]
        #[unsafe(method_family = none)]
        pub fn contents(&self) -> Option<Retained<AnyObject>>;

        /// Setter for [`contents`][Self::contents].
        ///
        /// # Safety
        ///
        /// `contents` should be of the correct type.
        #[unsafe(method(setContents:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setContents(&self, contents: Option<&AnyObject>);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(contentsRect))]
        #[unsafe(method_family = none)]
        pub fn contentsRect(&self) -> CGRect;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`contentsRect`][Self::contentsRect].
        #[unsafe(method(setContentsRect:))]
        #[unsafe(method_family = none)]
        pub fn setContentsRect(&self, contents_rect: CGRect);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(contentsScale))]
        #[unsafe(method_family = none)]
        pub fn contentsScale(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`contentsScale`][Self::contentsScale].
        #[unsafe(method(setContentsScale:))]
        #[unsafe(method_family = none)]
        pub fn setContentsScale(&self, contents_scale: CGFloat);

        #[unsafe(method(minificationFilter))]
        #[unsafe(method_family = none)]
        pub fn minificationFilter(&self) -> Retained<NSString>;

        /// Setter for [`minificationFilter`][Self::minificationFilter].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setMinificationFilter:))]
        #[unsafe(method_family = none)]
        pub fn setMinificationFilter(&self, minification_filter: &NSString);

        #[unsafe(method(magnificationFilter))]
        #[unsafe(method_family = none)]
        pub fn magnificationFilter(&self) -> Retained<NSString>;

        /// Setter for [`magnificationFilter`][Self::magnificationFilter].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setMagnificationFilter:))]
        #[unsafe(method_family = none)]
        pub fn setMagnificationFilter(&self, magnification_filter: &NSString);

        #[unsafe(method(minificationFilterBias))]
        #[unsafe(method_family = none)]
        pub fn minificationFilterBias(&self) -> c_float;

        /// Setter for [`minificationFilterBias`][Self::minificationFilterBias].
        #[unsafe(method(setMinificationFilterBias:))]
        #[unsafe(method_family = none)]
        pub fn setMinificationFilterBias(&self, minification_filter_bias: c_float);

        #[unsafe(method(emitterCells))]
        #[unsafe(method_family = none)]
        pub fn emitterCells(&self) -> Option<Retained<NSArray<CAEmitterCell>>>;

        /// Setter for [`emitterCells`][Self::emitterCells].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setEmitterCells:))]
        #[unsafe(method_family = none)]
        pub fn setEmitterCells(&self, emitter_cells: Option<&NSArray<CAEmitterCell>>);

        #[unsafe(method(style))]
        #[unsafe(method_family = none)]
        pub fn style(&self) -> Option<Retained<NSDictionary>>;

        /// Setter for [`style`][Self::style].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        ///
        /// # Safety
        ///
        /// `style` generic should be of the correct type.
        #[unsafe(method(setStyle:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setStyle(&self, style: Option<&NSDictionary>);
    );
}

/// Methods declared on superclass `NSObject`.
impl CAEmitterCell {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub fn new() -> Retained<Self>;
    );
}

impl DefaultRetained for CAEmitterCell {
    #[inline]
    fn default_retained() -> Retained<Self> {
        Self::new()
    }
}