objc2_av_foundation/generated/
AVSynchronizedLayer.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::*;
6use objc2_foundation::*;
7#[cfg(feature = "objc2-quartz-core")]
8#[cfg(not(target_os = "watchos"))]
9use objc2_quartz_core::*;
10
11use crate::*;
12
13extern_class!(
14    /// [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avsynchronizedlayer?language=objc)
15    #[unsafe(super(CALayer, NSObject))]
16    #[derive(Debug, PartialEq, Eq, Hash)]
17    #[cfg(feature = "objc2-quartz-core")]
18    #[cfg(not(target_os = "watchos"))]
19    pub struct AVSynchronizedLayer;
20);
21
22#[cfg(feature = "objc2-quartz-core")]
23#[cfg(not(target_os = "watchos"))]
24extern_conformance!(
25    unsafe impl CAMediaTiming for AVSynchronizedLayer {}
26);
27
28#[cfg(feature = "objc2-quartz-core")]
29#[cfg(not(target_os = "watchos"))]
30extern_conformance!(
31    unsafe impl NSCoding for AVSynchronizedLayer {}
32);
33
34#[cfg(feature = "objc2-quartz-core")]
35#[cfg(not(target_os = "watchos"))]
36extern_conformance!(
37    unsafe impl NSObjectProtocol for AVSynchronizedLayer {}
38);
39
40#[cfg(feature = "objc2-quartz-core")]
41#[cfg(not(target_os = "watchos"))]
42extern_conformance!(
43    unsafe impl NSSecureCoding for AVSynchronizedLayer {}
44);
45
46#[cfg(feature = "objc2-quartz-core")]
47#[cfg(not(target_os = "watchos"))]
48impl AVSynchronizedLayer {
49    extern_methods!(
50        #[cfg(feature = "AVPlayerItem")]
51        /// Returns an instance of AVSynchronizedLayer with timing synchronized with the specified AVPlayerItem.
52        ///
53        /// Returns: An instance of AVSynchronizedLayer.
54        #[unsafe(method(synchronizedLayerWithPlayerItem:))]
55        #[unsafe(method_family = none)]
56        pub unsafe fn synchronizedLayerWithPlayerItem(
57            player_item: &AVPlayerItem,
58        ) -> Retained<AVSynchronizedLayer>;
59
60        #[cfg(feature = "AVPlayerItem")]
61        /// Indicates the instance of AVPlayerItem to which the timing of the AVSynchronizedLayer is synchronized.
62        ///
63        /// Before macOS 13, iOS 16, tvOS 16, and watchOS 9, this property must be accessed on the main thread/queue.
64        #[unsafe(method(playerItem))]
65        #[unsafe(method_family = none)]
66        pub unsafe fn playerItem(&self, mtm: MainThreadMarker) -> Option<Retained<AVPlayerItem>>;
67
68        #[cfg(feature = "AVPlayerItem")]
69        /// Setter for [`playerItem`][Self::playerItem].
70        #[unsafe(method(setPlayerItem:))]
71        #[unsafe(method_family = none)]
72        pub unsafe fn setPlayerItem(
73            &self,
74            player_item: Option<&AVPlayerItem>,
75            mtm: MainThreadMarker,
76        );
77    );
78}
79
80/// Methods declared on superclass `CALayer`.
81#[cfg(feature = "objc2-quartz-core")]
82#[cfg(not(target_os = "watchos"))]
83impl AVSynchronizedLayer {
84    extern_methods!(
85        /// Layer creation and initialization. *
86        #[unsafe(method(layer))]
87        #[unsafe(method_family = none)]
88        pub unsafe fn layer() -> Retained<Self>;
89
90        #[unsafe(method(init))]
91        #[unsafe(method_family = init)]
92        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
93
94        /// # Safety
95        ///
96        /// `layer` should be of the correct type.
97        #[unsafe(method(initWithLayer:))]
98        #[unsafe(method_family = init)]
99        pub unsafe fn initWithLayer(this: Allocated<Self>, layer: &AnyObject) -> Retained<Self>;
100    );
101}
102
103/// Methods declared on superclass `NSObject`.
104#[cfg(feature = "objc2-quartz-core")]
105#[cfg(not(target_os = "watchos"))]
106impl AVSynchronizedLayer {
107    extern_methods!(
108        #[unsafe(method(new))]
109        #[unsafe(method_family = new)]
110        pub unsafe fn new() -> Retained<Self>;
111    );
112}