objc2_quartz_core/generated/
CAScrollLayer.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 CAScrollLayerScrollMode = NSString;
15
16extern_class!(
17 #[unsafe(super(CALayer, NSObject))]
19 #[derive(Debug, PartialEq, Eq, Hash)]
20 #[cfg(feature = "CALayer")]
21 pub struct CAScrollLayer;
22);
23
24#[cfg(all(feature = "CALayer", feature = "CAMediaTiming"))]
25extern_conformance!(
26 unsafe impl CAMediaTiming for CAScrollLayer {}
27);
28
29#[cfg(feature = "CALayer")]
30extern_conformance!(
31 unsafe impl NSCoding for CAScrollLayer {}
32);
33
34#[cfg(feature = "CALayer")]
35extern_conformance!(
36 unsafe impl NSObjectProtocol for CAScrollLayer {}
37);
38
39#[cfg(feature = "CALayer")]
40extern_conformance!(
41 unsafe impl NSSecureCoding for CAScrollLayer {}
42);
43
44#[cfg(feature = "CALayer")]
45impl CAScrollLayer {
46 extern_methods!(
47 #[cfg(feature = "objc2-core-foundation")]
48 #[unsafe(method(scrollToPoint:))]
49 #[unsafe(method_family = none)]
50 pub fn scrollToPoint(&self, p: CGPoint);
51
52 #[cfg(feature = "objc2-core-foundation")]
53 #[unsafe(method(scrollToRect:))]
54 #[unsafe(method_family = none)]
55 pub fn scrollToRect(&self, r: CGRect);
56
57 #[unsafe(method(scrollMode))]
58 #[unsafe(method_family = none)]
59 pub fn scrollMode(&self) -> Retained<CAScrollLayerScrollMode>;
60
61 #[unsafe(method(setScrollMode:))]
65 #[unsafe(method_family = none)]
66 pub fn setScrollMode(&self, scroll_mode: &CAScrollLayerScrollMode);
67 );
68}
69
70#[cfg(feature = "CALayer")]
72impl CAScrollLayer {
73 extern_methods!(
74 #[unsafe(method(layer))]
76 #[unsafe(method_family = none)]
77 pub fn layer() -> Retained<Self>;
78
79 #[unsafe(method(init))]
80 #[unsafe(method_family = init)]
81 pub fn init(this: Allocated<Self>) -> Retained<Self>;
82
83 #[unsafe(method(initWithLayer:))]
87 #[unsafe(method_family = init)]
88 pub unsafe fn initWithLayer(this: Allocated<Self>, layer: &AnyObject) -> Retained<Self>;
89 );
90}
91
92#[cfg(feature = "CALayer")]
94impl CAScrollLayer {
95 extern_methods!(
96 #[unsafe(method(new))]
97 #[unsafe(method_family = new)]
98 pub fn new() -> Retained<Self>;
99 );
100}
101
102#[cfg(feature = "CALayer")]
103impl DefaultRetained for CAScrollLayer {
104 #[inline]
105 fn default_retained() -> Retained<Self> {
106 Self::new()
107 }
108}
109
110#[cfg(feature = "CALayer")]
112impl CALayer {
113 extern_methods!(
114 #[cfg(feature = "objc2-core-foundation")]
115 #[unsafe(method(scrollPoint:))]
116 #[unsafe(method_family = none)]
117 pub fn scrollPoint(&self, p: CGPoint);
118
119 #[cfg(feature = "objc2-core-foundation")]
120 #[unsafe(method(scrollRectToVisible:))]
121 #[unsafe(method_family = none)]
122 pub fn scrollRectToVisible(&self, r: CGRect);
123
124 #[cfg(feature = "objc2-core-foundation")]
125 #[unsafe(method(visibleRect))]
126 #[unsafe(method_family = none)]
127 pub fn visibleRect(&self) -> CGRect;
128 );
129}
130
131extern "C" {
132 pub static kCAScrollNone: &'static CAScrollLayerScrollMode;
134}
135
136extern "C" {
137 pub static kCAScrollVertically: &'static CAScrollLayerScrollMode;
139}
140
141extern "C" {
142 pub static kCAScrollHorizontally: &'static CAScrollLayerScrollMode;
144}
145
146extern "C" {
147 pub static kCAScrollBoth: &'static CAScrollLayerScrollMode;
149}