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::*;
use objc2_foundation::*;
use crate::*;
// NS_TYPED_ENUM
pub type CAGradientLayerType = NSString;
extern_class!(
#[unsafe(super(CALayer, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "CALayer")]
pub struct CAGradientLayer;
);
#[cfg(all(feature = "CALayer", feature = "CAMediaTiming"))]
extern_conformance!(
unsafe impl CAMediaTiming for CAGradientLayer {}
);
#[cfg(feature = "CALayer")]
extern_conformance!(
unsafe impl NSCoding for CAGradientLayer {}
);
#[cfg(feature = "CALayer")]
extern_conformance!(
unsafe impl NSObjectProtocol for CAGradientLayer {}
);
#[cfg(feature = "CALayer")]
extern_conformance!(
unsafe impl NSSecureCoding for CAGradientLayer {}
);
#[cfg(feature = "CALayer")]
impl CAGradientLayer {
extern_methods!(
#[unsafe(method(colors))]
#[unsafe(method_family = none)]
pub fn colors(&self) -> Option<Retained<NSArray>>;
/// Setter for [`colors`][Self::colors].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
///
/// # Safety
///
/// `colors` generic should be of the correct type.
#[unsafe(method(setColors:))]
#[unsafe(method_family = none)]
pub unsafe fn setColors(&self, colors: Option<&NSArray>);
#[unsafe(method(locations))]
#[unsafe(method_family = none)]
pub fn locations(&self) -> Option<Retained<NSArray<NSNumber>>>;
/// Setter for [`locations`][Self::locations].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
#[unsafe(method(setLocations:))]
#[unsafe(method_family = none)]
pub fn setLocations(&self, locations: Option<&NSArray<NSNumber>>);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(startPoint))]
#[unsafe(method_family = none)]
pub fn startPoint(&self) -> CGPoint;
#[cfg(feature = "objc2-core-foundation")]
/// Setter for [`startPoint`][Self::startPoint].
#[unsafe(method(setStartPoint:))]
#[unsafe(method_family = none)]
pub fn setStartPoint(&self, start_point: CGPoint);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(endPoint))]
#[unsafe(method_family = none)]
pub fn endPoint(&self) -> CGPoint;
#[cfg(feature = "objc2-core-foundation")]
/// Setter for [`endPoint`][Self::endPoint].
#[unsafe(method(setEndPoint:))]
#[unsafe(method_family = none)]
pub fn setEndPoint(&self, end_point: CGPoint);
#[unsafe(method(type))]
#[unsafe(method_family = none)]
pub fn r#type(&self) -> Retained<CAGradientLayerType>;
/// 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: &CAGradientLayerType);
);
}
/// Methods declared on superclass `CALayer`.
#[cfg(feature = "CALayer")]
impl CAGradientLayer {
extern_methods!(
/// Layer creation and initialization. *
#[unsafe(method(layer))]
#[unsafe(method_family = none)]
pub fn layer() -> Retained<Self>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
/// # Safety
///
/// `layer` should be of the correct type.
#[unsafe(method(initWithLayer:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithLayer(this: Allocated<Self>, layer: &AnyObject) -> Retained<Self>;
);
}
/// Methods declared on superclass `NSObject`.
#[cfg(feature = "CALayer")]
impl CAGradientLayer {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new() -> Retained<Self>;
);
}
#[cfg(feature = "CALayer")]
impl DefaultRetained for CAGradientLayer {
#[inline]
fn default_retained() -> Retained<Self> {
Self::new()
}
}
extern "C" {
/// `type' values. *
///
pub static kCAGradientLayerAxial: &'static CAGradientLayerType;
}
extern "C" {
pub static kCAGradientLayerRadial: &'static CAGradientLayerType;
}
extern "C" {
pub static kCAGradientLayerConic: &'static CAGradientLayerType;
}