objc2_quartz_core/generated/
CAGradientLayer.rs1use 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
12pub type CAGradientLayerType = NSString;
15
16extern_class!(
17 #[unsafe(super(CALayer, NSObject))]
19 #[derive(Debug, PartialEq, Eq, Hash)]
20 #[cfg(feature = "CALayer")]
21 pub struct CAGradientLayer;
22);
23
24#[cfg(all(feature = "CALayer", feature = "CAMediaTiming"))]
25extern_conformance!(
26 unsafe impl CAMediaTiming for CAGradientLayer {}
27);
28
29#[cfg(feature = "CALayer")]
30extern_conformance!(
31 unsafe impl NSCoding for CAGradientLayer {}
32);
33
34#[cfg(feature = "CALayer")]
35extern_conformance!(
36 unsafe impl NSObjectProtocol for CAGradientLayer {}
37);
38
39#[cfg(feature = "CALayer")]
40extern_conformance!(
41 unsafe impl NSSecureCoding for CAGradientLayer {}
42);
43
44#[cfg(feature = "CALayer")]
45impl CAGradientLayer {
46 extern_methods!(
47 #[unsafe(method(colors))]
48 #[unsafe(method_family = none)]
49 pub fn colors(&self) -> Option<Retained<NSArray>>;
50
51 #[unsafe(method(setColors:))]
59 #[unsafe(method_family = none)]
60 pub unsafe fn setColors(&self, colors: Option<&NSArray>);
61
62 #[unsafe(method(locations))]
63 #[unsafe(method_family = none)]
64 pub fn locations(&self) -> Option<Retained<NSArray<NSNumber>>>;
65
66 #[unsafe(method(setLocations:))]
70 #[unsafe(method_family = none)]
71 pub fn setLocations(&self, locations: Option<&NSArray<NSNumber>>);
72
73 #[cfg(feature = "objc2-core-foundation")]
74 #[unsafe(method(startPoint))]
75 #[unsafe(method_family = none)]
76 pub fn startPoint(&self) -> CGPoint;
77
78 #[cfg(feature = "objc2-core-foundation")]
79 #[unsafe(method(setStartPoint:))]
81 #[unsafe(method_family = none)]
82 pub fn setStartPoint(&self, start_point: CGPoint);
83
84 #[cfg(feature = "objc2-core-foundation")]
85 #[unsafe(method(endPoint))]
86 #[unsafe(method_family = none)]
87 pub fn endPoint(&self) -> CGPoint;
88
89 #[cfg(feature = "objc2-core-foundation")]
90 #[unsafe(method(setEndPoint:))]
92 #[unsafe(method_family = none)]
93 pub fn setEndPoint(&self, end_point: CGPoint);
94
95 #[unsafe(method(type))]
96 #[unsafe(method_family = none)]
97 pub fn r#type(&self) -> Retained<CAGradientLayerType>;
98
99 #[unsafe(method(setType:))]
103 #[unsafe(method_family = none)]
104 pub fn setType(&self, r#type: &CAGradientLayerType);
105 );
106}
107
108#[cfg(feature = "CALayer")]
110impl CAGradientLayer {
111 extern_methods!(
112 #[unsafe(method(layer))]
114 #[unsafe(method_family = none)]
115 pub fn layer() -> Retained<Self>;
116
117 #[unsafe(method(init))]
118 #[unsafe(method_family = init)]
119 pub fn init(this: Allocated<Self>) -> Retained<Self>;
120
121 #[unsafe(method(initWithLayer:))]
125 #[unsafe(method_family = init)]
126 pub unsafe fn initWithLayer(this: Allocated<Self>, layer: &AnyObject) -> Retained<Self>;
127 );
128}
129
130#[cfg(feature = "CALayer")]
132impl CAGradientLayer {
133 extern_methods!(
134 #[unsafe(method(new))]
135 #[unsafe(method_family = new)]
136 pub fn new() -> Retained<Self>;
137 );
138}
139
140#[cfg(feature = "CALayer")]
141impl DefaultRetained for CAGradientLayer {
142 #[inline]
143 fn default_retained() -> Retained<Self> {
144 Self::new()
145 }
146}
147
148extern "C" {
149 pub static kCAGradientLayerAxial: &'static CAGradientLayerType;
153}
154
155extern "C" {
156 pub static kCAGradientLayerRadial: &'static CAGradientLayerType;
158}
159
160extern "C" {
161 pub static kCAGradientLayerConic: &'static CAGradientLayerType;
163}