objc2_ui_kit/generated/
UIGravityBehavior.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
12extern_class!(
13 #[unsafe(super(UIDynamicBehavior, NSObject))]
15 #[thread_kind = MainThreadOnly]
16 #[derive(Debug, PartialEq, Eq, Hash)]
17 #[cfg(feature = "UIDynamicBehavior")]
18 pub struct UIGravityBehavior;
19);
20
21#[cfg(feature = "UIDynamicBehavior")]
22unsafe impl NSObjectProtocol for UIGravityBehavior {}
23
24#[cfg(feature = "UIDynamicBehavior")]
25impl UIGravityBehavior {
26 extern_methods!(
27 #[unsafe(method(initWithItems:))]
28 #[unsafe(method_family = init)]
29 pub unsafe fn initWithItems(
30 this: Allocated<Self>,
31 items: &NSArray<ProtocolObject<dyn UIDynamicItem>>,
32 ) -> Retained<Self>;
33
34 #[unsafe(method(addItem:))]
35 #[unsafe(method_family = none)]
36 pub unsafe fn addItem(&self, item: &ProtocolObject<dyn UIDynamicItem>);
37
38 #[unsafe(method(removeItem:))]
39 #[unsafe(method_family = none)]
40 pub unsafe fn removeItem(&self, item: &ProtocolObject<dyn UIDynamicItem>);
41
42 #[unsafe(method(items))]
43 #[unsafe(method_family = none)]
44 pub unsafe fn items(&self) -> Retained<NSArray<ProtocolObject<dyn UIDynamicItem>>>;
45
46 #[cfg(feature = "objc2-core-foundation")]
47 #[unsafe(method(gravityDirection))]
48 #[unsafe(method_family = none)]
49 pub unsafe fn gravityDirection(&self) -> CGVector;
50
51 #[cfg(feature = "objc2-core-foundation")]
52 #[unsafe(method(setGravityDirection:))]
54 #[unsafe(method_family = none)]
55 pub unsafe fn setGravityDirection(&self, gravity_direction: CGVector);
56
57 #[cfg(feature = "objc2-core-foundation")]
58 #[unsafe(method(angle))]
59 #[unsafe(method_family = none)]
60 pub unsafe fn angle(&self) -> CGFloat;
61
62 #[cfg(feature = "objc2-core-foundation")]
63 #[unsafe(method(setAngle:))]
65 #[unsafe(method_family = none)]
66 pub unsafe fn setAngle(&self, angle: CGFloat);
67
68 #[cfg(feature = "objc2-core-foundation")]
69 #[unsafe(method(magnitude))]
70 #[unsafe(method_family = none)]
71 pub unsafe fn magnitude(&self) -> CGFloat;
72
73 #[cfg(feature = "objc2-core-foundation")]
74 #[unsafe(method(setMagnitude:))]
76 #[unsafe(method_family = none)]
77 pub unsafe fn setMagnitude(&self, magnitude: CGFloat);
78
79 #[cfg(feature = "objc2-core-foundation")]
80 #[unsafe(method(setAngle:magnitude:))]
81 #[unsafe(method_family = none)]
82 pub unsafe fn setAngle_magnitude(&self, angle: CGFloat, magnitude: CGFloat);
83 );
84}
85
86#[cfg(feature = "UIDynamicBehavior")]
88impl UIGravityBehavior {
89 extern_methods!(
90 #[unsafe(method(init))]
91 #[unsafe(method_family = init)]
92 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
93
94 #[unsafe(method(new))]
95 #[unsafe(method_family = new)]
96 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
97 );
98}