1use super::*;
4use crate::abi;
5use crate::resolve;
6swift_statics! {
12 pub enum AccessibilityChildBehavior {
16 Combine = c"$s7SwiftUI26AccessibilityChildBehaviorV7combineACvgZ",
17 Contain = c"$s7SwiftUI26AccessibilityChildBehaviorV7containACvgZ",
18 Ignore = c"$s7SwiftUI26AccessibilityChildBehaviorV6ignoreACvgZ",
19 }
20}
21
22swift_statics! {
23 pub enum ContentMarginPlacement {
27 Automatic = c"$s7SwiftUI22ContentMarginPlacementV9automaticACvgZ",
28 ScrollIndicators = c"$s7SwiftUI22ContentMarginPlacementV16scrollIndicatorsACvgZ",
29 }
30}
31
32swift_statics! {
33 pub enum HandGestureShortcut {
37 PrimaryAction = c"$s7SwiftUI19HandGestureShortcutV13primaryActionACvgZ",
38 }
39}
40
41swift_statics! {
42 pub enum RedactionReasons {
46 Invalidated = c"$s7SwiftUI16RedactionReasonsV11invalidatedACvgZ",
47 Placeholder = c"$s7SwiftUI16RedactionReasonsV11placeholderACvgZ",
48 Privacy = c"$s7SwiftUI16RedactionReasonsV7privacyACvgZ",
49 }
50}
51
52swift_statics! {
53 pub enum TabBarMinimizeBehavior {
57 Automatic = c"$s7SwiftUI22TabBarMinimizeBehaviorV9automaticACvgZ",
58 }
59}
60
61swift_statics! {
62 pub enum ToolbarRole {
66 Automatic = c"$s7SwiftUI11ToolbarRoleV9automaticACvgZ",
67 Editor = c"$s7SwiftUI11ToolbarRoleV6editorACvgZ",
68 }
69}
70
71swift_statics! {
72 pub enum TypesettingLanguage {
76 Automatic = c"$s7SwiftUI19TypesettingLanguageV9automaticACvgZ",
77 }
78}
79
80pub fn accessibility_element(view: &ViewHandle, v0: AccessibilityChildBehavior) -> ViewHandle {
82 unsafe {
83 let m0 = abi::metadata0(resolve::accessibility_child_behavior_ma());
84 let mut a0 = static_getter_indirect(v0.resolved(), m0, 0);
85 opaque_modifier(
86 resolve::accessibility_element_fn(),
87 resolve::accessibility_element_oret(),
88 view,
89 &[a0.as_mut_ptr() as u64],
90 [0.0, 0.0, 0.0, 0.0],
91 )
92 }
93}
94
95pub fn accessibility_shows_large_content_viewer(view: &ViewHandle, ) -> ViewHandle {
97 unsafe {
98 opaque_modifier(
100 resolve::accessibility_shows_large_content_viewer_fn(),
101 resolve::accessibility_shows_large_content_viewer_oret(),
102 view,
103 &[],
104 [0.0, 0.0, 0.0, 0.0],
105 )
106 }
107}
108
109pub fn assistive_access_navigation_icon(view: &ViewHandle, v0: &str) -> ViewHandle {
111 unsafe {
112 let s0 = abi::swift_string(v0);
113 opaque_modifier(
114 resolve::assistive_access_navigation_icon_fn(),
115 resolve::assistive_access_navigation_icon_oret(),
116 view,
117 &[u64::from_le_bytes(s0[..8].try_into().expect("lo")), u64::from_le_bytes(s0[8..].try_into().expect("hi"))],
118 [0.0, 0.0, 0.0, 0.0],
119 )
120 }
121}
122
123pub fn content_margins(view: &ViewHandle, v0: f64, v1: ContentMarginPlacement) -> ViewHandle {
125 unsafe {
126 let m1 = abi::metadata0(resolve::content_margin_placement_ma());
127 let mut a1 = static_getter_indirect(v1.resolved(), m1, 0);
128 opaque_modifier(
129 resolve::content_margins_fn(),
130 resolve::content_margins_oret(),
131 view,
132 &[a1.as_mut_ptr() as u64],
133 [v0, 0.0, 0.0, 0.0],
134 )
135 }
136}
137
138pub fn hand_gesture_shortcut(view: &ViewHandle, v0: HandGestureShortcut, v1: bool) -> ViewHandle {
140 unsafe {
141 let m0 = abi::metadata0(resolve::hand_gesture_shortcut_ma());
142 let mut a0 = static_getter_indirect(v0.resolved(), m0, 0);
143 opaque_modifier(
144 resolve::hand_gesture_shortcut_fn(),
145 resolve::hand_gesture_shortcut_oret(),
146 view,
147 &[a0.as_mut_ptr() as u64, u64::from(v1)],
148 [0.0, 0.0, 0.0, 0.0],
149 )
150 }
151}
152
153pub fn position(view: &ViewHandle, v0: f64, v1: f64) -> ViewHandle {
155 unsafe {
156 opaque_modifier(
158 resolve::position_fn(),
159 resolve::position_oret(),
160 view,
161 &[],
162 [v0, v1, 0.0, 0.0],
163 )
164 }
165}
166
167
168pub fn redacted(view: &ViewHandle, v0: RedactionReasons) -> ViewHandle {
170 unsafe {
171 let m0 = abi::metadata0(resolve::redaction_reasons_ma());
172 let mut a0 = static_getter_indirect(v0.resolved(), m0, 0);
173 opaque_modifier(
174 resolve::redacted_fn(),
175 resolve::redacted_oret(),
176 view,
177 &[a0.as_mut_ptr() as u64],
178 [0.0, 0.0, 0.0, 0.0],
179 )
180 }
181}
182
183pub fn scroll_indicators_flash(view: &ViewHandle, v0: bool) -> ViewHandle {
185 unsafe {
186 opaque_modifier(
188 resolve::scroll_indicators_flash_fn(),
189 resolve::scroll_indicators_flash_oret(),
190 view,
191 &[u64::from(v0)],
192 [0.0, 0.0, 0.0, 0.0],
193 )
194 }
195}
196
197pub fn scroll_target_layout(view: &ViewHandle, v0: bool) -> ViewHandle {
199 unsafe {
200 opaque_modifier(
202 resolve::scroll_target_layout_fn(),
203 resolve::scroll_target_layout_oret(),
204 view,
205 &[u64::from(v0)],
206 [0.0, 0.0, 0.0, 0.0],
207 )
208 }
209}
210
211pub fn tab_bar_minimize_behavior(view: &ViewHandle, v0: TabBarMinimizeBehavior) -> ViewHandle {
213 unsafe {
214 let m0 = abi::metadata0(resolve::tab_bar_minimize_behavior_ma());
215 let mut a0 = static_getter_indirect(v0.resolved(), m0, 0);
216 opaque_modifier(
217 resolve::tab_bar_minimize_behavior_fn(),
218 resolve::tab_bar_minimize_behavior_oret(),
219 view,
220 &[a0.as_mut_ptr() as u64],
221 [0.0, 0.0, 0.0, 0.0],
222 )
223 }
224}
225
226pub fn toolbar_role(view: &ViewHandle, v0: ToolbarRole) -> ViewHandle {
228 unsafe {
229 let m0 = abi::metadata0(resolve::toolbar_role_ma());
230 let mut a0 = static_getter_indirect(v0.resolved(), m0, 0);
231 opaque_modifier(
232 resolve::toolbar_role_fn(),
233 resolve::toolbar_role_oret(),
234 view,
235 &[a0.as_mut_ptr() as u64],
236 [0.0, 0.0, 0.0, 0.0],
237 )
238 }
239}
240
241pub fn typesetting_language(view: &ViewHandle, v0: TypesettingLanguage, v1: bool) -> ViewHandle {
243 unsafe {
244 let m0 = abi::metadata0(resolve::typesetting_language_ma());
245 let mut a0 = static_getter_indirect(v0.resolved(), m0, 0);
246 opaque_modifier(
247 resolve::typesetting_language_fn(),
248 resolve::typesetting_language_oret(),
249 view,
250 &[a0.as_mut_ptr() as u64, u64::from(v1)],
251 [0.0, 0.0, 0.0, 0.0],
252 )
253 }
254}
255
256pub fn inspector_column_width_range(
266 view: &ViewHandle,
267 min: Option<f64>,
268 ideal: f64,
269 max: Option<f64>,
270) -> ViewHandle {
271 unsafe {
272 opaque_modifier(
273 resolve::inspector_column_width_range_fn(),
274 resolve::inspector_column_width_range_oret(),
275 view,
276 &[
277 min.map_or(0, f64::to_bits),
278 u64::from(min.is_none()),
279 max.map_or(0, f64::to_bits),
280 u64::from(max.is_none()),
281 ],
282 [ideal, 0.0, 0.0, 0.0],
283 )
284 }
285}
286
287