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 unsafe fn colors(&self) -> Option<Retained<NSArray>>;
50
51 #[unsafe(method(setColors:))]
53 #[unsafe(method_family = none)]
54 pub unsafe fn setColors(&self, colors: Option<&NSArray>);
55
56 #[unsafe(method(locations))]
57 #[unsafe(method_family = none)]
58 pub unsafe fn locations(&self) -> Option<Retained<NSArray<NSNumber>>>;
59
60 #[unsafe(method(setLocations:))]
62 #[unsafe(method_family = none)]
63 pub unsafe fn setLocations(&self, locations: Option<&NSArray<NSNumber>>);
64
65 #[cfg(feature = "objc2-core-foundation")]
66 #[unsafe(method(startPoint))]
67 #[unsafe(method_family = none)]
68 pub unsafe fn startPoint(&self) -> CGPoint;
69
70 #[cfg(feature = "objc2-core-foundation")]
71 #[unsafe(method(setStartPoint:))]
73 #[unsafe(method_family = none)]
74 pub unsafe fn setStartPoint(&self, start_point: CGPoint);
75
76 #[cfg(feature = "objc2-core-foundation")]
77 #[unsafe(method(endPoint))]
78 #[unsafe(method_family = none)]
79 pub unsafe fn endPoint(&self) -> CGPoint;
80
81 #[cfg(feature = "objc2-core-foundation")]
82 #[unsafe(method(setEndPoint:))]
84 #[unsafe(method_family = none)]
85 pub unsafe fn setEndPoint(&self, end_point: CGPoint);
86
87 #[unsafe(method(type))]
88 #[unsafe(method_family = none)]
89 pub unsafe fn r#type(&self) -> Retained<CAGradientLayerType>;
90
91 #[unsafe(method(setType:))]
93 #[unsafe(method_family = none)]
94 pub unsafe fn setType(&self, r#type: &CAGradientLayerType);
95 );
96}
97
98#[cfg(feature = "CALayer")]
100impl CAGradientLayer {
101 extern_methods!(
102 #[unsafe(method(layer))]
104 #[unsafe(method_family = none)]
105 pub unsafe fn layer() -> Retained<Self>;
106
107 #[unsafe(method(init))]
108 #[unsafe(method_family = init)]
109 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
110
111 #[unsafe(method(initWithLayer:))]
112 #[unsafe(method_family = init)]
113 pub unsafe fn initWithLayer(this: Allocated<Self>, layer: &AnyObject) -> Retained<Self>;
114 );
115}
116
117#[cfg(feature = "CALayer")]
119impl CAGradientLayer {
120 extern_methods!(
121 #[unsafe(method(new))]
122 #[unsafe(method_family = new)]
123 pub unsafe fn new() -> Retained<Self>;
124 );
125}
126
127extern "C" {
128 pub static kCAGradientLayerAxial: &'static CAGradientLayerType;
132}
133
134extern "C" {
135 pub static kCAGradientLayerRadial: &'static CAGradientLayerType;
137}
138
139extern "C" {
140 pub static kCAGradientLayerConic: &'static CAGradientLayerType;
142}