Source code
Revision control
Copy as Markdown
Other Tools
//! 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::*;
/// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/caanimationcalculationmode?language=objc)
// NS_TYPED_ENUM
pub type CAAnimationCalculationMode = NSString;
/// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/caanimationrotationmode?language=objc)
// NS_TYPED_ENUM
pub type CAAnimationRotationMode = NSString;
/// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/catransitiontype?language=objc)
// NS_TYPED_ENUM
pub type CATransitionType = NSString;
/// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/catransitionsubtype?language=objc)
// NS_TYPED_ENUM
pub type CATransitionSubtype = NSString;
extern_class!(
/// The base animation class. *
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/quartzcore/caanimation?language=objc)
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct CAAnimation;
);
#[cfg(feature = "CALayer")]
extern_conformance!(
unsafe impl CAAction for CAAnimation {}
);
#[cfg(feature = "CAMediaTiming")]
extern_conformance!(
unsafe impl CAMediaTiming for CAAnimation {}
);
extern_conformance!(
unsafe impl NSCoding for CAAnimation {}
);
extern_conformance!(
unsafe impl NSCopying for CAAnimation {}
);
unsafe impl CopyingHelper for CAAnimation {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for CAAnimation {}
);
extern_conformance!(
unsafe impl NSSecureCoding for CAAnimation {}
);
impl CAAnimation {
extern_methods!(
#[unsafe(method(animation))]
#[unsafe(method_family = none)]
pub fn animation() -> 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;
#[cfg(feature = "CAMediaTimingFunction")]
#[unsafe(method(timingFunction))]
#[unsafe(method_family = none)]
pub fn timingFunction(&self) -> Option<Retained<CAMediaTimingFunction>>;
#[cfg(feature = "CAMediaTimingFunction")]
/// Setter for [`timingFunction`][Self::timingFunction].
#[unsafe(method(setTimingFunction:))]
#[unsafe(method_family = none)]
pub fn setTimingFunction(&self, timing_function: Option<&CAMediaTimingFunction>);
#[unsafe(method(delegate))]
#[unsafe(method_family = none)]
pub fn delegate(&self) -> Option<Retained<ProtocolObject<dyn CAAnimationDelegate>>>;
/// Setter for [`delegate`][Self::delegate].
#[unsafe(method(setDelegate:))]
#[unsafe(method_family = none)]
pub fn setDelegate(&self, delegate: Option<&ProtocolObject<dyn CAAnimationDelegate>>);
#[unsafe(method(isRemovedOnCompletion))]
#[unsafe(method_family = none)]
pub fn isRemovedOnCompletion(&self) -> bool;
/// Setter for [`isRemovedOnCompletion`][Self::isRemovedOnCompletion].
#[unsafe(method(setRemovedOnCompletion:))]
#[unsafe(method_family = none)]
pub fn setRemovedOnCompletion(&self, removed_on_completion: bool);
#[cfg(feature = "CAFrameRateRange")]
#[unsafe(method(preferredFrameRateRange))]
#[unsafe(method_family = none)]
pub fn preferredFrameRateRange(&self) -> CAFrameRateRange;
#[cfg(feature = "CAFrameRateRange")]
/// Setter for [`preferredFrameRateRange`][Self::preferredFrameRateRange].
#[unsafe(method(setPreferredFrameRateRange:))]
#[unsafe(method_family = none)]
pub fn setPreferredFrameRateRange(&self, preferred_frame_rate_range: CAFrameRateRange);
);
}
/// Methods declared on superclass `NSObject`.
impl CAAnimation {
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 CAAnimation {
#[inline]
fn default_retained() -> Retained<Self> {
Self::new()
}
}
extern_protocol!(
/// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/caanimationdelegate?language=objc)
pub unsafe trait CAAnimationDelegate: NSObjectProtocol {
#[optional]
#[unsafe(method(animationDidStart:))]
#[unsafe(method_family = none)]
fn animationDidStart(&self, anim: &CAAnimation);
#[optional]
#[unsafe(method(animationDidStop:finished:))]
#[unsafe(method_family = none)]
fn animationDidStop_finished(&self, anim: &CAAnimation, flag: bool);
}
);
extern_class!(
/// Subclass for property-based animations. *
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/quartzcore/capropertyanimation?language=objc)
#[unsafe(super(CAAnimation, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct CAPropertyAnimation;
);
#[cfg(feature = "CALayer")]
extern_conformance!(
unsafe impl CAAction for CAPropertyAnimation {}
);
#[cfg(feature = "CAMediaTiming")]
extern_conformance!(
unsafe impl CAMediaTiming for CAPropertyAnimation {}
);
extern_conformance!(
unsafe impl NSCoding for CAPropertyAnimation {}
);
extern_conformance!(
unsafe impl NSCopying for CAPropertyAnimation {}
);
unsafe impl CopyingHelper for CAPropertyAnimation {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for CAPropertyAnimation {}
);
extern_conformance!(
unsafe impl NSSecureCoding for CAPropertyAnimation {}
);
impl CAPropertyAnimation {
extern_methods!(
#[unsafe(method(animationWithKeyPath:))]
#[unsafe(method_family = none)]
pub fn animationWithKeyPath(path: Option<&NSString>) -> Retained<Self>;
#[unsafe(method(keyPath))]
#[unsafe(method_family = none)]
pub fn keyPath(&self) -> Option<Retained<NSString>>;
/// Setter for [`keyPath`][Self::keyPath].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
#[unsafe(method(setKeyPath:))]
#[unsafe(method_family = none)]
pub fn setKeyPath(&self, key_path: Option<&NSString>);
#[unsafe(method(isAdditive))]
#[unsafe(method_family = none)]
pub fn isAdditive(&self) -> bool;
/// Setter for [`isAdditive`][Self::isAdditive].
#[unsafe(method(setAdditive:))]
#[unsafe(method_family = none)]
pub fn setAdditive(&self, additive: bool);
#[unsafe(method(isCumulative))]
#[unsafe(method_family = none)]
pub fn isCumulative(&self) -> bool;
/// Setter for [`isCumulative`][Self::isCumulative].
#[unsafe(method(setCumulative:))]
#[unsafe(method_family = none)]
pub fn setCumulative(&self, cumulative: bool);
#[cfg(feature = "CAValueFunction")]
#[unsafe(method(valueFunction))]
#[unsafe(method_family = none)]
pub fn valueFunction(&self) -> Option<Retained<CAValueFunction>>;
#[cfg(feature = "CAValueFunction")]
/// Setter for [`valueFunction`][Self::valueFunction].
#[unsafe(method(setValueFunction:))]
#[unsafe(method_family = none)]
pub fn setValueFunction(&self, value_function: Option<&CAValueFunction>);
);
}
/// Methods declared on superclass `CAAnimation`.
impl CAPropertyAnimation {
extern_methods!(
#[unsafe(method(animation))]
#[unsafe(method_family = none)]
pub fn animation() -> Retained<Self>;
);
}
/// Methods declared on superclass `NSObject`.
impl CAPropertyAnimation {
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 CAPropertyAnimation {
#[inline]
fn default_retained() -> Retained<Self> {
Self::new()
}
}
extern_class!(
/// Subclass for basic (single-keyframe) animations. *
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/quartzcore/cabasicanimation?language=objc)
#[unsafe(super(CAPropertyAnimation, CAAnimation, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct CABasicAnimation;
);
#[cfg(feature = "CALayer")]
extern_conformance!(
unsafe impl CAAction for CABasicAnimation {}
);
#[cfg(feature = "CAMediaTiming")]
extern_conformance!(
unsafe impl CAMediaTiming for CABasicAnimation {}
);
extern_conformance!(
unsafe impl NSCoding for CABasicAnimation {}
);
extern_conformance!(
unsafe impl NSCopying for CABasicAnimation {}
);
unsafe impl CopyingHelper for CABasicAnimation {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for CABasicAnimation {}
);
extern_conformance!(
unsafe impl NSSecureCoding for CABasicAnimation {}
);
impl CABasicAnimation {
extern_methods!(
#[unsafe(method(fromValue))]
#[unsafe(method_family = none)]
pub fn fromValue(&self) -> Option<Retained<AnyObject>>;
/// Setter for [`fromValue`][Self::fromValue].
///
/// # Safety
///
/// `from_value` should be of the correct type.
#[unsafe(method(setFromValue:))]
#[unsafe(method_family = none)]
pub unsafe fn setFromValue(&self, from_value: Option<&AnyObject>);
#[unsafe(method(toValue))]
#[unsafe(method_family = none)]
pub fn toValue(&self) -> Option<Retained<AnyObject>>;
/// Setter for [`toValue`][Self::toValue].
///
/// # Safety
///
/// `to_value` should be of the correct type.
#[unsafe(method(setToValue:))]
#[unsafe(method_family = none)]
pub unsafe fn setToValue(&self, to_value: Option<&AnyObject>);
#[unsafe(method(byValue))]
#[unsafe(method_family = none)]
pub fn byValue(&self) -> Option<Retained<AnyObject>>;
/// Setter for [`byValue`][Self::byValue].
///
/// # Safety
///
/// `by_value` should be of the correct type.
#[unsafe(method(setByValue:))]
#[unsafe(method_family = none)]
pub unsafe fn setByValue(&self, by_value: Option<&AnyObject>);
);
}
/// Methods declared on superclass `CAPropertyAnimation`.
impl CABasicAnimation {
extern_methods!(
#[unsafe(method(animationWithKeyPath:))]
#[unsafe(method_family = none)]
pub fn animationWithKeyPath(path: Option<&NSString>) -> Retained<Self>;
);
}
/// Methods declared on superclass `CAAnimation`.
impl CABasicAnimation {
extern_methods!(
#[unsafe(method(animation))]
#[unsafe(method_family = none)]
pub fn animation() -> Retained<Self>;
);
}
/// Methods declared on superclass `NSObject`.
impl CABasicAnimation {
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 CABasicAnimation {
#[inline]
fn default_retained() -> Retained<Self> {
Self::new()
}
}
extern_class!(
/// General keyframe animation class. *
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/quartzcore/cakeyframeanimation?language=objc)
#[unsafe(super(CAPropertyAnimation, CAAnimation, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct CAKeyframeAnimation;
);
#[cfg(feature = "CALayer")]
extern_conformance!(
unsafe impl CAAction for CAKeyframeAnimation {}
);
#[cfg(feature = "CAMediaTiming")]
extern_conformance!(
unsafe impl CAMediaTiming for CAKeyframeAnimation {}
);
extern_conformance!(
unsafe impl NSCoding for CAKeyframeAnimation {}
);
extern_conformance!(
unsafe impl NSCopying for CAKeyframeAnimation {}
);
unsafe impl CopyingHelper for CAKeyframeAnimation {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for CAKeyframeAnimation {}
);
extern_conformance!(
unsafe impl NSSecureCoding for CAKeyframeAnimation {}
);
impl CAKeyframeAnimation {
extern_methods!(
#[unsafe(method(values))]
#[unsafe(method_family = none)]
pub fn values(&self) -> Option<Retained<NSArray>>;
/// Setter for [`values`][Self::values].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
///
/// # Safety
///
/// `values` generic should be of the correct type.
#[unsafe(method(setValues:))]
#[unsafe(method_family = none)]
pub unsafe fn setValues(&self, values: Option<&NSArray>);
#[cfg(feature = "objc2-core-graphics")]
#[unsafe(method(path))]
#[unsafe(method_family = none)]
pub fn path(&self) -> Option<Retained<CGPath>>;
#[cfg(feature = "objc2-core-graphics")]
/// Setter for [`path`][Self::path].
#[unsafe(method(setPath:))]
#[unsafe(method_family = none)]
pub fn setPath(&self, path: Option<&CGPath>);
#[unsafe(method(keyTimes))]
#[unsafe(method_family = none)]
pub fn keyTimes(&self) -> Option<Retained<NSArray<NSNumber>>>;
/// Setter for [`keyTimes`][Self::keyTimes].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
#[unsafe(method(setKeyTimes:))]
#[unsafe(method_family = none)]
pub fn setKeyTimes(&self, key_times: Option<&NSArray<NSNumber>>);
#[cfg(feature = "CAMediaTimingFunction")]
#[unsafe(method(timingFunctions))]
#[unsafe(method_family = none)]
pub fn timingFunctions(&self) -> Option<Retained<NSArray<CAMediaTimingFunction>>>;
#[cfg(feature = "CAMediaTimingFunction")]
/// Setter for [`timingFunctions`][Self::timingFunctions].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
#[unsafe(method(setTimingFunctions:))]
#[unsafe(method_family = none)]
pub fn setTimingFunctions(&self, timing_functions: Option<&NSArray<CAMediaTimingFunction>>);
#[unsafe(method(calculationMode))]
#[unsafe(method_family = none)]
pub fn calculationMode(&self) -> Retained<CAAnimationCalculationMode>;
/// Setter for [`calculationMode`][Self::calculationMode].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
#[unsafe(method(setCalculationMode:))]
#[unsafe(method_family = none)]
pub fn setCalculationMode(&self, calculation_mode: &CAAnimationCalculationMode);
#[unsafe(method(tensionValues))]
#[unsafe(method_family = none)]
pub fn tensionValues(&self) -> Option<Retained<NSArray<NSNumber>>>;
/// Setter for [`tensionValues`][Self::tensionValues].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
#[unsafe(method(setTensionValues:))]
#[unsafe(method_family = none)]
pub fn setTensionValues(&self, tension_values: Option<&NSArray<NSNumber>>);
#[unsafe(method(continuityValues))]
#[unsafe(method_family = none)]
pub fn continuityValues(&self) -> Option<Retained<NSArray<NSNumber>>>;
/// Setter for [`continuityValues`][Self::continuityValues].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
#[unsafe(method(setContinuityValues:))]
#[unsafe(method_family = none)]
pub fn setContinuityValues(&self, continuity_values: Option<&NSArray<NSNumber>>);
#[unsafe(method(biasValues))]
#[unsafe(method_family = none)]
pub fn biasValues(&self) -> Option<Retained<NSArray<NSNumber>>>;
/// Setter for [`biasValues`][Self::biasValues].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
#[unsafe(method(setBiasValues:))]
#[unsafe(method_family = none)]
pub fn setBiasValues(&self, bias_values: Option<&NSArray<NSNumber>>);
#[unsafe(method(rotationMode))]
#[unsafe(method_family = none)]
pub fn rotationMode(&self) -> Option<Retained<CAAnimationRotationMode>>;
/// Setter for [`rotationMode`][Self::rotationMode].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
#[unsafe(method(setRotationMode:))]
#[unsafe(method_family = none)]
pub fn setRotationMode(&self, rotation_mode: Option<&CAAnimationRotationMode>);
);
}
/// Methods declared on superclass `CAPropertyAnimation`.
impl CAKeyframeAnimation {
extern_methods!(
#[unsafe(method(animationWithKeyPath:))]
#[unsafe(method_family = none)]
pub fn animationWithKeyPath(path: Option<&NSString>) -> Retained<Self>;
);
}
/// Methods declared on superclass `CAAnimation`.
impl CAKeyframeAnimation {
extern_methods!(
#[unsafe(method(animation))]
#[unsafe(method_family = none)]
pub fn animation() -> Retained<Self>;
);
}
/// Methods declared on superclass `NSObject`.
impl CAKeyframeAnimation {
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 CAKeyframeAnimation {
#[inline]
fn default_retained() -> Retained<Self> {
Self::new()
}
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcaanimationlinear?language=objc)
pub static kCAAnimationLinear: &'static CAAnimationCalculationMode;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcaanimationdiscrete?language=objc)
pub static kCAAnimationDiscrete: &'static CAAnimationCalculationMode;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcaanimationpaced?language=objc)
pub static kCAAnimationPaced: &'static CAAnimationCalculationMode;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcaanimationcubic?language=objc)
pub static kCAAnimationCubic: &'static CAAnimationCalculationMode;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcaanimationcubicpaced?language=objc)
pub static kCAAnimationCubicPaced: &'static CAAnimationCalculationMode;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcaanimationrotateauto?language=objc)
pub static kCAAnimationRotateAuto: &'static CAAnimationRotationMode;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcaanimationrotateautoreverse?language=objc)
pub static kCAAnimationRotateAutoReverse: &'static CAAnimationRotationMode;
}
extern_class!(
/// Subclass for mass-spring animations.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/quartzcore/caspringanimation?language=objc)
#[unsafe(super(CABasicAnimation, CAPropertyAnimation, CAAnimation, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct CASpringAnimation;
);
#[cfg(feature = "CALayer")]
extern_conformance!(
unsafe impl CAAction for CASpringAnimation {}
);
#[cfg(feature = "CAMediaTiming")]
extern_conformance!(
unsafe impl CAMediaTiming for CASpringAnimation {}
);
extern_conformance!(
unsafe impl NSCoding for CASpringAnimation {}
);
extern_conformance!(
unsafe impl NSCopying for CASpringAnimation {}
);
unsafe impl CopyingHelper for CASpringAnimation {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for CASpringAnimation {}
);
extern_conformance!(
unsafe impl NSSecureCoding for CASpringAnimation {}
);
impl CASpringAnimation {
extern_methods!(
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(mass))]
#[unsafe(method_family = none)]
pub fn mass(&self) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
/// Setter for [`mass`][Self::mass].
#[unsafe(method(setMass:))]
#[unsafe(method_family = none)]
pub fn setMass(&self, mass: CGFloat);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(stiffness))]
#[unsafe(method_family = none)]
pub fn stiffness(&self) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
/// Setter for [`stiffness`][Self::stiffness].
#[unsafe(method(setStiffness:))]
#[unsafe(method_family = none)]
pub fn setStiffness(&self, stiffness: CGFloat);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(damping))]
#[unsafe(method_family = none)]
pub fn damping(&self) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
/// Setter for [`damping`][Self::damping].
#[unsafe(method(setDamping:))]
#[unsafe(method_family = none)]
pub fn setDamping(&self, damping: CGFloat);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(initialVelocity))]
#[unsafe(method_family = none)]
pub fn initialVelocity(&self) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
/// Setter for [`initialVelocity`][Self::initialVelocity].
#[unsafe(method(setInitialVelocity:))]
#[unsafe(method_family = none)]
pub fn setInitialVelocity(&self, initial_velocity: CGFloat);
#[unsafe(method(allowsOverdamping))]
#[unsafe(method_family = none)]
pub fn allowsOverdamping(&self) -> bool;
/// Setter for [`allowsOverdamping`][Self::allowsOverdamping].
#[unsafe(method(setAllowsOverdamping:))]
#[unsafe(method_family = none)]
pub fn setAllowsOverdamping(&self, allows_overdamping: bool);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(settlingDuration))]
#[unsafe(method_family = none)]
pub fn settlingDuration(&self) -> CFTimeInterval;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(initWithPerceptualDuration:bounce:))]
#[unsafe(method_family = init)]
pub fn initWithPerceptualDuration_bounce(
this: Allocated<Self>,
perceptual_duration: CFTimeInterval,
bounce: CGFloat,
) -> Retained<Self>;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(perceptualDuration))]
#[unsafe(method_family = none)]
pub fn perceptualDuration(&self) -> CFTimeInterval;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(bounce))]
#[unsafe(method_family = none)]
pub fn bounce(&self) -> CGFloat;
);
}
/// Methods declared on superclass `CAPropertyAnimation`.
impl CASpringAnimation {
extern_methods!(
#[unsafe(method(animationWithKeyPath:))]
#[unsafe(method_family = none)]
pub fn animationWithKeyPath(path: Option<&NSString>) -> Retained<Self>;
);
}
/// Methods declared on superclass `CAAnimation`.
impl CASpringAnimation {
extern_methods!(
#[unsafe(method(animation))]
#[unsafe(method_family = none)]
pub fn animation() -> Retained<Self>;
);
}
/// Methods declared on superclass `NSObject`.
impl CASpringAnimation {
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 CASpringAnimation {
#[inline]
fn default_retained() -> Retained<Self> {
Self::new()
}
}
extern_class!(
/// Transition animation subclass. *
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/quartzcore/catransition?language=objc)
#[unsafe(super(CAAnimation, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct CATransition;
);
#[cfg(feature = "CALayer")]
extern_conformance!(
unsafe impl CAAction for CATransition {}
);
#[cfg(feature = "CAMediaTiming")]
extern_conformance!(
unsafe impl CAMediaTiming for CATransition {}
);
extern_conformance!(
unsafe impl NSCoding for CATransition {}
);
extern_conformance!(
unsafe impl NSCopying for CATransition {}
);
unsafe impl CopyingHelper for CATransition {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for CATransition {}
);
extern_conformance!(
unsafe impl NSSecureCoding for CATransition {}
);
impl CATransition {
extern_methods!(
#[unsafe(method(type))]
#[unsafe(method_family = none)]
pub fn r#type(&self) -> Retained<CATransitionType>;
/// Setter for [`type`][Self::type].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
#[unsafe(method(setType:))]
#[unsafe(method_family = none)]
pub fn setType(&self, r#type: &CATransitionType);
#[unsafe(method(subtype))]
#[unsafe(method_family = none)]
pub fn subtype(&self) -> Option<Retained<CATransitionSubtype>>;
/// Setter for [`subtype`][Self::subtype].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
#[unsafe(method(setSubtype:))]
#[unsafe(method_family = none)]
pub fn setSubtype(&self, subtype: Option<&CATransitionSubtype>);
#[unsafe(method(startProgress))]
#[unsafe(method_family = none)]
pub fn startProgress(&self) -> c_float;
/// Setter for [`startProgress`][Self::startProgress].
#[unsafe(method(setStartProgress:))]
#[unsafe(method_family = none)]
pub fn setStartProgress(&self, start_progress: c_float);
#[unsafe(method(endProgress))]
#[unsafe(method_family = none)]
pub fn endProgress(&self) -> c_float;
/// Setter for [`endProgress`][Self::endProgress].
#[unsafe(method(setEndProgress:))]
#[unsafe(method_family = none)]
pub fn setEndProgress(&self, end_progress: c_float);
#[unsafe(method(filter))]
#[unsafe(method_family = none)]
pub fn filter(&self) -> Option<Retained<AnyObject>>;
/// Setter for [`filter`][Self::filter].
///
/// # Safety
///
/// `filter` should be of the correct type.
#[unsafe(method(setFilter:))]
#[unsafe(method_family = none)]
pub unsafe fn setFilter(&self, filter: Option<&AnyObject>);
);
}
/// Methods declared on superclass `CAAnimation`.
impl CATransition {
extern_methods!(
#[unsafe(method(animation))]
#[unsafe(method_family = none)]
pub fn animation() -> Retained<Self>;
);
}
/// Methods declared on superclass `NSObject`.
impl CATransition {
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 CATransition {
#[inline]
fn default_retained() -> Retained<Self> {
Self::new()
}
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcatransitionfade?language=objc)
pub static kCATransitionFade: &'static CATransitionType;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcatransitionmovein?language=objc)
pub static kCATransitionMoveIn: &'static CATransitionType;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcatransitionpush?language=objc)
pub static kCATransitionPush: &'static CATransitionType;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcatransitionreveal?language=objc)
pub static kCATransitionReveal: &'static CATransitionType;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcatransitionfromright?language=objc)
pub static kCATransitionFromRight: &'static CATransitionSubtype;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcatransitionfromleft?language=objc)
pub static kCATransitionFromLeft: &'static CATransitionSubtype;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcatransitionfromtop?language=objc)
pub static kCATransitionFromTop: &'static CATransitionSubtype;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcatransitionfrombottom?language=objc)
pub static kCATransitionFromBottom: &'static CATransitionSubtype;
}
extern_class!(
/// Animation subclass for grouped animations. *
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/quartzcore/caanimationgroup?language=objc)
#[unsafe(super(CAAnimation, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct CAAnimationGroup;
);
#[cfg(feature = "CALayer")]
extern_conformance!(
unsafe impl CAAction for CAAnimationGroup {}
);
#[cfg(feature = "CAMediaTiming")]
extern_conformance!(
unsafe impl CAMediaTiming for CAAnimationGroup {}
);
extern_conformance!(
unsafe impl NSCoding for CAAnimationGroup {}
);
extern_conformance!(
unsafe impl NSCopying for CAAnimationGroup {}
);
unsafe impl CopyingHelper for CAAnimationGroup {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for CAAnimationGroup {}
);
extern_conformance!(
unsafe impl NSSecureCoding for CAAnimationGroup {}
);
impl CAAnimationGroup {
extern_methods!(
#[unsafe(method(animations))]
#[unsafe(method_family = none)]
pub fn animations(&self) -> Option<Retained<NSArray<CAAnimation>>>;
/// Setter for [`animations`][Self::animations].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
#[unsafe(method(setAnimations:))]
#[unsafe(method_family = none)]
pub fn setAnimations(&self, animations: Option<&NSArray<CAAnimation>>);
);
}
/// Methods declared on superclass `CAAnimation`.
impl CAAnimationGroup {
extern_methods!(
#[unsafe(method(animation))]
#[unsafe(method_family = none)]
pub fn animation() -> Retained<Self>;
);
}
/// Methods declared on superclass `NSObject`.
impl CAAnimationGroup {
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 CAAnimationGroup {
#[inline]
fn default_retained() -> Retained<Self> {
Self::new()
}
}