objc2_quartz_core/generated/
CADisplayLink.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-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12extern_class!(
13    /// Class representing a timer bound to the display vsync. *
14    ///
15    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartzcore/cadisplaylink?language=objc)
16    #[unsafe(super(NSObject))]
17    #[derive(Debug, PartialEq, Eq, Hash)]
18    pub struct CADisplayLink;
19);
20
21unsafe impl NSObjectProtocol for CADisplayLink {}
22
23impl CADisplayLink {
24    extern_methods!(
25        #[unsafe(method(displayLinkWithTarget:selector:))]
26        #[unsafe(method_family = none)]
27        pub unsafe fn displayLinkWithTarget_selector(
28            target: &AnyObject,
29            sel: Sel,
30        ) -> Retained<CADisplayLink>;
31
32        #[unsafe(method(addToRunLoop:forMode:))]
33        #[unsafe(method_family = none)]
34        pub unsafe fn addToRunLoop_forMode(&self, runloop: &NSRunLoop, mode: &NSRunLoopMode);
35
36        #[unsafe(method(removeFromRunLoop:forMode:))]
37        #[unsafe(method_family = none)]
38        pub unsafe fn removeFromRunLoop_forMode(&self, runloop: &NSRunLoop, mode: &NSRunLoopMode);
39
40        #[unsafe(method(invalidate))]
41        #[unsafe(method_family = none)]
42        pub unsafe fn invalidate(&self);
43
44        #[cfg(feature = "objc2-core-foundation")]
45        #[unsafe(method(timestamp))]
46        #[unsafe(method_family = none)]
47        pub unsafe fn timestamp(&self) -> CFTimeInterval;
48
49        #[cfg(feature = "objc2-core-foundation")]
50        #[unsafe(method(duration))]
51        #[unsafe(method_family = none)]
52        pub unsafe fn duration(&self) -> CFTimeInterval;
53
54        #[cfg(feature = "objc2-core-foundation")]
55        #[unsafe(method(targetTimestamp))]
56        #[unsafe(method_family = none)]
57        pub unsafe fn targetTimestamp(&self) -> CFTimeInterval;
58
59        #[unsafe(method(isPaused))]
60        #[unsafe(method_family = none)]
61        pub unsafe fn isPaused(&self) -> bool;
62
63        /// Setter for [`isPaused`][Self::isPaused].
64        #[unsafe(method(setPaused:))]
65        #[unsafe(method_family = none)]
66        pub unsafe fn setPaused(&self, paused: bool);
67
68        #[deprecated = "preferredFramesPerSecond"]
69        #[unsafe(method(frameInterval))]
70        #[unsafe(method_family = none)]
71        pub unsafe fn frameInterval(&self) -> NSInteger;
72
73        /// Setter for [`frameInterval`][Self::frameInterval].
74        #[deprecated = "preferredFramesPerSecond"]
75        #[unsafe(method(setFrameInterval:))]
76        #[unsafe(method_family = none)]
77        pub unsafe fn setFrameInterval(&self, frame_interval: NSInteger);
78
79        #[deprecated]
80        #[unsafe(method(preferredFramesPerSecond))]
81        #[unsafe(method_family = none)]
82        pub unsafe fn preferredFramesPerSecond(&self) -> NSInteger;
83
84        /// Setter for [`preferredFramesPerSecond`][Self::preferredFramesPerSecond].
85        #[deprecated]
86        #[unsafe(method(setPreferredFramesPerSecond:))]
87        #[unsafe(method_family = none)]
88        pub unsafe fn setPreferredFramesPerSecond(&self, preferred_frames_per_second: NSInteger);
89
90        #[cfg(feature = "CAFrameRateRange")]
91        #[unsafe(method(preferredFrameRateRange))]
92        #[unsafe(method_family = none)]
93        pub unsafe fn preferredFrameRateRange(&self) -> CAFrameRateRange;
94
95        #[cfg(feature = "CAFrameRateRange")]
96        /// Setter for [`preferredFrameRateRange`][Self::preferredFrameRateRange].
97        #[unsafe(method(setPreferredFrameRateRange:))]
98        #[unsafe(method_family = none)]
99        pub unsafe fn setPreferredFrameRateRange(
100            &self,
101            preferred_frame_rate_range: CAFrameRateRange,
102        );
103    );
104}
105
106/// Methods declared on superclass `NSObject`.
107impl CADisplayLink {
108    extern_methods!(
109        #[unsafe(method(init))]
110        #[unsafe(method_family = init)]
111        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
112
113        #[unsafe(method(new))]
114        #[unsafe(method_family = new)]
115        pub unsafe fn new() -> Retained<Self>;
116    );
117}