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 unsafe fn scrollToPoint(&self, p: CGPoint);
51
52 #[cfg(feature = "objc2-core-foundation")]
53 #[unsafe(method(scrollToRect:))]
54 #[unsafe(method_family = none)]
55 pub unsafe fn scrollToRect(&self, r: CGRect);
56
57 #[unsafe(method(scrollMode))]
58 #[unsafe(method_family = none)]
59 pub unsafe fn scrollMode(&self) -> Retained<CAScrollLayerScrollMode>;
60
61 #[unsafe(method(setScrollMode:))]
63 #[unsafe(method_family = none)]
64 pub unsafe fn setScrollMode(&self, scroll_mode: &CAScrollLayerScrollMode);
65 );
66}
67
68#[cfg(feature = "CALayer")]
70impl CAScrollLayer {
71 extern_methods!(
72 #[unsafe(method(layer))]
74 #[unsafe(method_family = none)]
75 pub unsafe fn layer() -> Retained<Self>;
76
77 #[unsafe(method(init))]
78 #[unsafe(method_family = init)]
79 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
80
81 #[unsafe(method(initWithLayer:))]
82 #[unsafe(method_family = init)]
83 pub unsafe fn initWithLayer(this: Allocated<Self>, layer: &AnyObject) -> Retained<Self>;
84 );
85}
86
87#[cfg(feature = "CALayer")]
89impl CAScrollLayer {
90 extern_methods!(
91 #[unsafe(method(new))]
92 #[unsafe(method_family = new)]
93 pub unsafe fn new() -> Retained<Self>;
94 );
95}
96
97#[cfg(feature = "CALayer")]
99impl CALayer {
100 extern_methods!(
101 #[cfg(feature = "objc2-core-foundation")]
102 #[unsafe(method(scrollPoint:))]
103 #[unsafe(method_family = none)]
104 pub unsafe fn scrollPoint(&self, p: CGPoint);
105
106 #[cfg(feature = "objc2-core-foundation")]
107 #[unsafe(method(scrollRectToVisible:))]
108 #[unsafe(method_family = none)]
109 pub unsafe fn scrollRectToVisible(&self, r: CGRect);
110
111 #[cfg(feature = "objc2-core-foundation")]
112 #[unsafe(method(visibleRect))]
113 #[unsafe(method_family = none)]
114 pub unsafe fn visibleRect(&self) -> CGRect;
115 );
116}
117
118extern "C" {
119 pub static kCAScrollNone: &'static CAScrollLayerScrollMode;
121}
122
123extern "C" {
124 pub static kCAScrollVertically: &'static CAScrollLayerScrollMode;
126}
127
128extern "C" {
129 pub static kCAScrollHorizontally: &'static CAScrollLayerScrollMode;
131}
132
133extern "C" {
134 pub static kCAScrollBoth: &'static CAScrollLayerScrollMode;
136}