use crate::common::*;
use crate::CoreAnimation::*;
use crate::Foundation::*;
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "CoreAnimation_CAMetalDisplayLinkUpdate")]
pub struct CAMetalDisplayLinkUpdate;
#[cfg(feature = "CoreAnimation_CAMetalDisplayLinkUpdate")]
unsafe impl ClassType for CAMetalDisplayLinkUpdate {
type Super = NSObject;
type Mutability = InteriorMutable;
}
);
#[cfg(feature = "CoreAnimation_CAMetalDisplayLinkUpdate")]
unsafe impl NSObjectProtocol for CAMetalDisplayLinkUpdate {}
extern_methods!(
#[cfg(feature = "CoreAnimation_CAMetalDisplayLinkUpdate")]
unsafe impl CAMetalDisplayLinkUpdate {
#[method_id(@__retain_semantics Other drawable)]
pub unsafe fn drawable(&self) -> Id<ProtocolObject<dyn CAMetalDrawable>>;
#[method(targetTimestamp)]
pub unsafe fn targetTimestamp(&self) -> CFTimeInterval;
#[method(targetPresentationTimestamp)]
pub unsafe fn targetPresentationTimestamp(&self) -> CFTimeInterval;
}
);
extern_methods!(
#[cfg(feature = "CoreAnimation_CAMetalDisplayLinkUpdate")]
unsafe impl CAMetalDisplayLinkUpdate {
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Id<Self>;
}
);
extern_protocol!(
pub unsafe trait CAMetalDisplayLinkDelegate {
#[cfg(all(
feature = "CoreAnimation_CAMetalDisplayLink",
feature = "CoreAnimation_CAMetalDisplayLinkUpdate"
))]
#[method(metalDisplayLink:needsUpdate:)]
unsafe fn metalDisplayLink_needsUpdate(
&self,
link: &CAMetalDisplayLink,
update: &CAMetalDisplayLinkUpdate,
);
}
unsafe impl ProtocolType for dyn CAMetalDisplayLinkDelegate {}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "CoreAnimation_CAMetalDisplayLink")]
pub struct CAMetalDisplayLink;
#[cfg(feature = "CoreAnimation_CAMetalDisplayLink")]
unsafe impl ClassType for CAMetalDisplayLink {
type Super = NSObject;
type Mutability = InteriorMutable;
}
);
#[cfg(feature = "CoreAnimation_CAMetalDisplayLink")]
unsafe impl NSObjectProtocol for CAMetalDisplayLink {}
extern_methods!(
#[cfg(feature = "CoreAnimation_CAMetalDisplayLink")]
unsafe impl CAMetalDisplayLink {
#[cfg(feature = "CoreAnimation_CAMetalLayer")]
#[method_id(@__retain_semantics Init initWithMetalLayer:)]
pub unsafe fn initWithMetalLayer(this: Allocated<Self>, layer: &CAMetalLayer) -> Id<Self>;
#[cfg(feature = "Foundation_NSRunLoop")]
#[method(addToRunLoop:forMode:)]
pub unsafe fn addToRunLoop_forMode(&self, runloop: &NSRunLoop, mode: &NSRunLoopMode);
#[cfg(feature = "Foundation_NSRunLoop")]
#[method(removeFromRunLoop:forMode:)]
pub unsafe fn removeFromRunLoop_forMode(&self, runloop: &NSRunLoop, mode: &NSRunLoopMode);
#[method(invalidate)]
pub unsafe fn invalidate(&self);
#[method_id(@__retain_semantics Other delegate)]
pub unsafe fn delegate(&self)
-> Option<Id<ProtocolObject<dyn CAMetalDisplayLinkDelegate>>>;
#[method(setDelegate:)]
pub unsafe fn setDelegate(
&self,
delegate: Option<&ProtocolObject<dyn CAMetalDisplayLinkDelegate>>,
);
#[method(preferredFrameLatency)]
pub unsafe fn preferredFrameLatency(&self) -> c_float;
#[method(setPreferredFrameLatency:)]
pub unsafe fn setPreferredFrameLatency(&self, preferred_frame_latency: c_float);
#[method(preferredFrameRateRange)]
pub unsafe fn preferredFrameRateRange(&self) -> CAFrameRateRange;
#[method(setPreferredFrameRateRange:)]
pub unsafe fn setPreferredFrameRateRange(
&self,
preferred_frame_rate_range: CAFrameRateRange,
);
#[method(isPaused)]
pub unsafe fn isPaused(&self) -> bool;
#[method(setPaused:)]
pub unsafe fn setPaused(&self, paused: bool);
}
);
extern_methods!(
#[cfg(feature = "CoreAnimation_CAMetalDisplayLink")]
unsafe impl CAMetalDisplayLink {
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Id<Self>;
}
);