1use 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
12#[repr(transparent)]
15#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
16pub struct NSDirectionalRectEdge(pub NSUInteger);
17bitflags::bitflags! {
18 impl NSDirectionalRectEdge: NSUInteger {
19 #[doc(alias = "NSDirectionalRectEdgeNone")]
20 const None = 0;
21 #[doc(alias = "NSDirectionalRectEdgeTop")]
22 const Top = 1<<0;
23 #[doc(alias = "NSDirectionalRectEdgeLeading")]
24 const Leading = 1<<1;
25 #[doc(alias = "NSDirectionalRectEdgeBottom")]
26 const Bottom = 1<<2;
27 #[doc(alias = "NSDirectionalRectEdgeTrailing")]
28 const Trailing = 1<<3;
29 #[doc(alias = "NSDirectionalRectEdgeAll")]
30 const All = NSDirectionalRectEdge::Top.0|NSDirectionalRectEdge::Leading.0|NSDirectionalRectEdge::Bottom.0|NSDirectionalRectEdge::Trailing.0;
31 }
32}
33
34unsafe impl Encode for NSDirectionalRectEdge {
35 const ENCODING: Encoding = NSUInteger::ENCODING;
36}
37
38unsafe impl RefEncode for NSDirectionalRectEdge {
39 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
40}
41
42#[cfg(feature = "objc2-core-foundation")]
44#[repr(C)]
45#[derive(Clone, Copy, Debug, PartialEq)]
46pub struct NSDirectionalEdgeInsets {
47 pub top: CGFloat,
48 pub leading: CGFloat,
49 pub bottom: CGFloat,
50 pub trailing: CGFloat,
51}
52
53#[cfg(feature = "objc2-core-foundation")]
54unsafe impl Encode for NSDirectionalEdgeInsets {
55 const ENCODING: Encoding = Encoding::Struct(
56 "NSDirectionalEdgeInsets",
57 &[
58 <CGFloat>::ENCODING,
59 <CGFloat>::ENCODING,
60 <CGFloat>::ENCODING,
61 <CGFloat>::ENCODING,
62 ],
63 );
64}
65
66#[cfg(feature = "objc2-core-foundation")]
67unsafe impl RefEncode for NSDirectionalEdgeInsets {
68 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
69}
70
71#[cfg(feature = "objc2-core-foundation")]
72unsafe impl Send for NSDirectionalEdgeInsets {}
73
74#[cfg(feature = "objc2-core-foundation")]
75unsafe impl Sync for NSDirectionalEdgeInsets {}
76
77extern "C" {
78 #[cfg(feature = "objc2-core-foundation")]
80 pub static NSDirectionalEdgeInsetsZero: NSDirectionalEdgeInsets;
81}
82
83#[repr(transparent)]
86#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
87pub struct NSRectAlignment(pub NSInteger);
88impl NSRectAlignment {
89 #[doc(alias = "NSRectAlignmentNone")]
90 pub const None: Self = Self(0);
91 #[doc(alias = "NSRectAlignmentTop")]
92 pub const Top: Self = Self(1);
93 #[doc(alias = "NSRectAlignmentTopLeading")]
94 pub const TopLeading: Self = Self(2);
95 #[doc(alias = "NSRectAlignmentLeading")]
96 pub const Leading: Self = Self(3);
97 #[doc(alias = "NSRectAlignmentBottomLeading")]
98 pub const BottomLeading: Self = Self(4);
99 #[doc(alias = "NSRectAlignmentBottom")]
100 pub const Bottom: Self = Self(5);
101 #[doc(alias = "NSRectAlignmentBottomTrailing")]
102 pub const BottomTrailing: Self = Self(6);
103 #[doc(alias = "NSRectAlignmentTrailing")]
104 pub const Trailing: Self = Self(7);
105 #[doc(alias = "NSRectAlignmentTopTrailing")]
106 pub const TopTrailing: Self = Self(8);
107}
108
109unsafe impl Encode for NSRectAlignment {
110 const ENCODING: Encoding = NSInteger::ENCODING;
111}
112
113unsafe impl RefEncode for NSRectAlignment {
114 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
115}
116
117#[cfg(feature = "objc2-core-foundation")]
118impl NSDirectionalEdgeInsets {
119 }
121
122extern_class!(
123 #[unsafe(super(NSObject))]
125 #[thread_kind = MainThreadOnly]
126 #[derive(Debug, PartialEq, Eq, Hash)]
127 pub struct NSCollectionViewCompositionalLayoutConfiguration;
128);
129
130extern_conformance!(
131 unsafe impl NSCopying for NSCollectionViewCompositionalLayoutConfiguration {}
132);
133
134unsafe impl CopyingHelper for NSCollectionViewCompositionalLayoutConfiguration {
135 type Result = Self;
136}
137
138extern_conformance!(
139 unsafe impl NSObjectProtocol for NSCollectionViewCompositionalLayoutConfiguration {}
140);
141
142impl NSCollectionViewCompositionalLayoutConfiguration {
143 extern_methods!(
144 #[cfg(feature = "NSCollectionViewFlowLayout")]
145 #[unsafe(method(scrollDirection))]
146 #[unsafe(method_family = none)]
147 pub fn scrollDirection(&self) -> NSCollectionViewScrollDirection;
148
149 #[cfg(feature = "NSCollectionViewFlowLayout")]
150 #[unsafe(method(setScrollDirection:))]
152 #[unsafe(method_family = none)]
153 pub fn setScrollDirection(&self, scroll_direction: NSCollectionViewScrollDirection);
154
155 #[cfg(feature = "objc2-core-foundation")]
156 #[unsafe(method(interSectionSpacing))]
157 #[unsafe(method_family = none)]
158 pub fn interSectionSpacing(&self) -> CGFloat;
159
160 #[cfg(feature = "objc2-core-foundation")]
161 #[unsafe(method(setInterSectionSpacing:))]
163 #[unsafe(method_family = none)]
164 pub fn setInterSectionSpacing(&self, inter_section_spacing: CGFloat);
165
166 #[unsafe(method(boundarySupplementaryItems))]
167 #[unsafe(method_family = none)]
168 pub fn boundarySupplementaryItems(
169 &self,
170 ) -> Retained<NSArray<NSCollectionLayoutBoundarySupplementaryItem>>;
171
172 #[unsafe(method(setBoundarySupplementaryItems:))]
176 #[unsafe(method_family = none)]
177 pub fn setBoundarySupplementaryItems(
178 &self,
179 boundary_supplementary_items: &NSArray<NSCollectionLayoutBoundarySupplementaryItem>,
180 );
181 );
182}
183
184impl NSCollectionViewCompositionalLayoutConfiguration {
186 extern_methods!(
187 #[unsafe(method(init))]
188 #[unsafe(method_family = init)]
189 pub fn init(this: Allocated<Self>) -> Retained<Self>;
190
191 #[unsafe(method(new))]
192 #[unsafe(method_family = new)]
193 pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
194 );
195}
196
197#[cfg(feature = "block2")]
199pub type NSCollectionViewCompositionalLayoutSectionProvider = *mut block2::DynBlock<
200 dyn Fn(
201 NSInteger,
202 NonNull<ProtocolObject<dyn NSCollectionLayoutEnvironment>>,
203 ) -> *mut NSCollectionLayoutSection,
204>;
205
206extern_class!(
207 #[unsafe(super(NSCollectionViewLayout, NSObject))]
209 #[derive(Debug, PartialEq, Eq, Hash)]
210 #[cfg(feature = "NSCollectionViewLayout")]
211 pub struct NSCollectionViewCompositionalLayout;
212);
213
214#[cfg(feature = "NSCollectionViewLayout")]
215extern_conformance!(
216 unsafe impl NSCoding for NSCollectionViewCompositionalLayout {}
217);
218
219#[cfg(feature = "NSCollectionViewLayout")]
220extern_conformance!(
221 unsafe impl NSObjectProtocol for NSCollectionViewCompositionalLayout {}
222);
223
224#[cfg(feature = "NSCollectionViewLayout")]
225impl NSCollectionViewCompositionalLayout {
226 extern_methods!(
227 #[unsafe(method(initWithSection:))]
228 #[unsafe(method_family = init)]
229 pub fn initWithSection(
230 this: Allocated<Self>,
231 section: &NSCollectionLayoutSection,
232 ) -> Retained<Self>;
233
234 #[unsafe(method(initWithSection:configuration:))]
235 #[unsafe(method_family = init)]
236 pub fn initWithSection_configuration(
237 this: Allocated<Self>,
238 section: &NSCollectionLayoutSection,
239 configuration: &NSCollectionViewCompositionalLayoutConfiguration,
240 ) -> Retained<Self>;
241
242 #[cfg(feature = "block2")]
243 #[unsafe(method(initWithSectionProvider:))]
247 #[unsafe(method_family = init)]
248 pub unsafe fn initWithSectionProvider(
249 this: Allocated<Self>,
250 section_provider: NSCollectionViewCompositionalLayoutSectionProvider,
251 ) -> Retained<Self>;
252
253 #[cfg(feature = "block2")]
254 #[unsafe(method(initWithSectionProvider:configuration:))]
258 #[unsafe(method_family = init)]
259 pub unsafe fn initWithSectionProvider_configuration(
260 this: Allocated<Self>,
261 section_provider: NSCollectionViewCompositionalLayoutSectionProvider,
262 configuration: &NSCollectionViewCompositionalLayoutConfiguration,
263 ) -> Retained<Self>;
264
265 #[unsafe(method(init))]
266 #[unsafe(method_family = init)]
267 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
268
269 #[unsafe(method(new))]
270 #[unsafe(method_family = new)]
271 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
272
273 #[unsafe(method(configuration))]
274 #[unsafe(method_family = none)]
275 pub fn configuration(&self) -> Retained<NSCollectionViewCompositionalLayoutConfiguration>;
276
277 #[unsafe(method(setConfiguration:))]
281 #[unsafe(method_family = none)]
282 pub fn setConfiguration(
283 &self,
284 configuration: &NSCollectionViewCompositionalLayoutConfiguration,
285 );
286 );
287}
288
289#[repr(transparent)]
292#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
293pub struct NSCollectionLayoutSectionOrthogonalScrollingBehavior(pub NSInteger);
294impl NSCollectionLayoutSectionOrthogonalScrollingBehavior {
295 #[doc(alias = "NSCollectionLayoutSectionOrthogonalScrollingBehaviorNone")]
296 pub const None: Self = Self(0);
297 #[doc(alias = "NSCollectionLayoutSectionOrthogonalScrollingBehaviorContinuous")]
298 pub const Continuous: Self = Self(1);
299 #[doc(
300 alias = "NSCollectionLayoutSectionOrthogonalScrollingBehaviorContinuousGroupLeadingBoundary"
301 )]
302 pub const ContinuousGroupLeadingBoundary: Self = Self(2);
303 #[doc(alias = "NSCollectionLayoutSectionOrthogonalScrollingBehaviorPaging")]
304 pub const Paging: Self = Self(3);
305 #[doc(alias = "NSCollectionLayoutSectionOrthogonalScrollingBehaviorGroupPaging")]
306 pub const GroupPaging: Self = Self(4);
307 #[doc(alias = "NSCollectionLayoutSectionOrthogonalScrollingBehaviorGroupPagingCentered")]
308 pub const GroupPagingCentered: Self = Self(5);
309}
310
311unsafe impl Encode for NSCollectionLayoutSectionOrthogonalScrollingBehavior {
312 const ENCODING: Encoding = NSInteger::ENCODING;
313}
314
315unsafe impl RefEncode for NSCollectionLayoutSectionOrthogonalScrollingBehavior {
316 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
317}
318
319#[cfg(feature = "block2")]
321pub type NSCollectionLayoutSectionVisibleItemsInvalidationHandler = *mut block2::DynBlock<
322 dyn Fn(
323 NonNull<NSArray<ProtocolObject<dyn NSCollectionLayoutVisibleItem>>>,
324 NSPoint,
325 NonNull<ProtocolObject<dyn NSCollectionLayoutEnvironment>>,
326 ),
327>;
328
329extern_class!(
330 #[unsafe(super(NSObject))]
332 #[thread_kind = MainThreadOnly]
333 #[derive(Debug, PartialEq, Eq, Hash)]
334 pub struct NSCollectionLayoutSection;
335);
336
337extern_conformance!(
338 unsafe impl NSCopying for NSCollectionLayoutSection {}
339);
340
341unsafe impl CopyingHelper for NSCollectionLayoutSection {
342 type Result = Self;
343}
344
345extern_conformance!(
346 unsafe impl NSObjectProtocol for NSCollectionLayoutSection {}
347);
348
349impl NSCollectionLayoutSection {
350 extern_methods!(
351 #[unsafe(method(sectionWithGroup:))]
352 #[unsafe(method_family = none)]
353 pub fn sectionWithGroup(group: &NSCollectionLayoutGroup) -> Retained<Self>;
354
355 #[unsafe(method(init))]
356 #[unsafe(method_family = init)]
357 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
358
359 #[unsafe(method(new))]
360 #[unsafe(method_family = new)]
361 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
362
363 #[cfg(feature = "objc2-core-foundation")]
364 #[unsafe(method(contentInsets))]
365 #[unsafe(method_family = none)]
366 pub fn contentInsets(&self) -> NSDirectionalEdgeInsets;
367
368 #[cfg(feature = "objc2-core-foundation")]
369 #[unsafe(method(setContentInsets:))]
371 #[unsafe(method_family = none)]
372 pub fn setContentInsets(&self, content_insets: NSDirectionalEdgeInsets);
373
374 #[cfg(feature = "objc2-core-foundation")]
375 #[unsafe(method(interGroupSpacing))]
376 #[unsafe(method_family = none)]
377 pub fn interGroupSpacing(&self) -> CGFloat;
378
379 #[cfg(feature = "objc2-core-foundation")]
380 #[unsafe(method(setInterGroupSpacing:))]
382 #[unsafe(method_family = none)]
383 pub fn setInterGroupSpacing(&self, inter_group_spacing: CGFloat);
384
385 #[unsafe(method(orthogonalScrollingBehavior))]
386 #[unsafe(method_family = none)]
387 pub fn orthogonalScrollingBehavior(
388 &self,
389 ) -> NSCollectionLayoutSectionOrthogonalScrollingBehavior;
390
391 #[unsafe(method(setOrthogonalScrollingBehavior:))]
393 #[unsafe(method_family = none)]
394 pub fn setOrthogonalScrollingBehavior(
395 &self,
396 orthogonal_scrolling_behavior: NSCollectionLayoutSectionOrthogonalScrollingBehavior,
397 );
398
399 #[unsafe(method(boundarySupplementaryItems))]
400 #[unsafe(method_family = none)]
401 pub fn boundarySupplementaryItems(
402 &self,
403 ) -> Retained<NSArray<NSCollectionLayoutBoundarySupplementaryItem>>;
404
405 #[unsafe(method(setBoundarySupplementaryItems:))]
409 #[unsafe(method_family = none)]
410 pub fn setBoundarySupplementaryItems(
411 &self,
412 boundary_supplementary_items: &NSArray<NSCollectionLayoutBoundarySupplementaryItem>,
413 );
414
415 #[unsafe(method(supplementariesFollowContentInsets))]
416 #[unsafe(method_family = none)]
417 pub fn supplementariesFollowContentInsets(&self) -> bool;
418
419 #[unsafe(method(setSupplementariesFollowContentInsets:))]
421 #[unsafe(method_family = none)]
422 pub fn setSupplementariesFollowContentInsets(
423 &self,
424 supplementaries_follow_content_insets: bool,
425 );
426
427 #[cfg(feature = "block2")]
428 #[unsafe(method(visibleItemsInvalidationHandler))]
433 #[unsafe(method_family = none)]
434 pub unsafe fn visibleItemsInvalidationHandler(
435 &self,
436 ) -> NSCollectionLayoutSectionVisibleItemsInvalidationHandler;
437
438 #[cfg(feature = "block2")]
439 #[unsafe(method(setVisibleItemsInvalidationHandler:))]
447 #[unsafe(method_family = none)]
448 pub unsafe fn setVisibleItemsInvalidationHandler(
449 &self,
450 visible_items_invalidation_handler: NSCollectionLayoutSectionVisibleItemsInvalidationHandler,
451 );
452
453 #[unsafe(method(decorationItems))]
454 #[unsafe(method_family = none)]
455 pub fn decorationItems(&self) -> Retained<NSArray<NSCollectionLayoutDecorationItem>>;
456
457 #[unsafe(method(setDecorationItems:))]
461 #[unsafe(method_family = none)]
462 pub fn setDecorationItems(
463 &self,
464 decoration_items: &NSArray<NSCollectionLayoutDecorationItem>,
465 );
466 );
467}
468
469extern_class!(
470 #[unsafe(super(NSObject))]
472 #[thread_kind = MainThreadOnly]
473 #[derive(Debug, PartialEq, Eq, Hash)]
474 pub struct NSCollectionLayoutItem;
475);
476
477extern_conformance!(
478 unsafe impl NSCopying for NSCollectionLayoutItem {}
479);
480
481unsafe impl CopyingHelper for NSCollectionLayoutItem {
482 type Result = Self;
483}
484
485extern_conformance!(
486 unsafe impl NSObjectProtocol for NSCollectionLayoutItem {}
487);
488
489impl NSCollectionLayoutItem {
490 extern_methods!(
491 #[unsafe(method(itemWithLayoutSize:))]
492 #[unsafe(method_family = none)]
493 pub fn itemWithLayoutSize(layout_size: &NSCollectionLayoutSize) -> Retained<Self>;
494
495 #[unsafe(method(itemWithLayoutSize:supplementaryItems:))]
496 #[unsafe(method_family = none)]
497 pub fn itemWithLayoutSize_supplementaryItems(
498 layout_size: &NSCollectionLayoutSize,
499 supplementary_items: &NSArray<NSCollectionLayoutSupplementaryItem>,
500 ) -> Retained<Self>;
501
502 #[unsafe(method(init))]
503 #[unsafe(method_family = init)]
504 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
505
506 #[unsafe(method(new))]
507 #[unsafe(method_family = new)]
508 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
509
510 #[cfg(feature = "objc2-core-foundation")]
511 #[unsafe(method(contentInsets))]
512 #[unsafe(method_family = none)]
513 pub fn contentInsets(&self) -> NSDirectionalEdgeInsets;
514
515 #[cfg(feature = "objc2-core-foundation")]
516 #[unsafe(method(setContentInsets:))]
518 #[unsafe(method_family = none)]
519 pub fn setContentInsets(&self, content_insets: NSDirectionalEdgeInsets);
520
521 #[unsafe(method(edgeSpacing))]
522 #[unsafe(method_family = none)]
523 pub fn edgeSpacing(&self) -> Option<Retained<NSCollectionLayoutEdgeSpacing>>;
524
525 #[unsafe(method(setEdgeSpacing:))]
529 #[unsafe(method_family = none)]
530 pub fn setEdgeSpacing(&self, edge_spacing: Option<&NSCollectionLayoutEdgeSpacing>);
531
532 #[unsafe(method(layoutSize))]
533 #[unsafe(method_family = none)]
534 pub fn layoutSize(&self) -> Retained<NSCollectionLayoutSize>;
535
536 #[unsafe(method(supplementaryItems))]
537 #[unsafe(method_family = none)]
538 pub fn supplementaryItems(&self) -> Retained<NSArray<NSCollectionLayoutSupplementaryItem>>;
539 );
540}
541
542extern_class!(
543 #[unsafe(super(NSObject))]
545 #[thread_kind = MainThreadOnly]
546 #[derive(Debug, PartialEq, Eq, Hash)]
547 pub struct NSCollectionLayoutGroupCustomItem;
548);
549
550extern_conformance!(
551 unsafe impl NSCopying for NSCollectionLayoutGroupCustomItem {}
552);
553
554unsafe impl CopyingHelper for NSCollectionLayoutGroupCustomItem {
555 type Result = Self;
556}
557
558extern_conformance!(
559 unsafe impl NSObjectProtocol for NSCollectionLayoutGroupCustomItem {}
560);
561
562impl NSCollectionLayoutGroupCustomItem {
563 extern_methods!(
564 #[unsafe(method(customItemWithFrame:))]
565 #[unsafe(method_family = none)]
566 pub fn customItemWithFrame(frame: NSRect, mtm: MainThreadMarker) -> Retained<Self>;
567
568 #[unsafe(method(customItemWithFrame:zIndex:))]
569 #[unsafe(method_family = none)]
570 pub fn customItemWithFrame_zIndex(
571 frame: NSRect,
572 z_index: NSInteger,
573 mtm: MainThreadMarker,
574 ) -> Retained<Self>;
575
576 #[unsafe(method(init))]
577 #[unsafe(method_family = init)]
578 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
579
580 #[unsafe(method(new))]
581 #[unsafe(method_family = new)]
582 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
583
584 #[unsafe(method(frame))]
585 #[unsafe(method_family = none)]
586 pub fn frame(&self) -> NSRect;
587
588 #[unsafe(method(zIndex))]
589 #[unsafe(method_family = none)]
590 pub fn zIndex(&self) -> NSInteger;
591 );
592}
593
594#[cfg(feature = "block2")]
596pub type NSCollectionLayoutGroupCustomItemProvider = *mut block2::DynBlock<
597 dyn Fn(
598 NonNull<ProtocolObject<dyn NSCollectionLayoutEnvironment>>,
599 ) -> NonNull<NSArray<NSCollectionLayoutGroupCustomItem>>,
600>;
601
602extern_class!(
603 #[unsafe(super(NSCollectionLayoutItem, NSObject))]
605 #[derive(Debug, PartialEq, Eq, Hash)]
606 pub struct NSCollectionLayoutGroup;
607);
608
609extern_conformance!(
610 unsafe impl NSCopying for NSCollectionLayoutGroup {}
611);
612
613unsafe impl CopyingHelper for NSCollectionLayoutGroup {
614 type Result = Self;
615}
616
617extern_conformance!(
618 unsafe impl NSObjectProtocol for NSCollectionLayoutGroup {}
619);
620
621impl NSCollectionLayoutGroup {
622 extern_methods!(
623 #[unsafe(method(horizontalGroupWithLayoutSize:subitem:count:))]
624 #[unsafe(method_family = none)]
625 pub fn horizontalGroupWithLayoutSize_subitem_count(
626 layout_size: &NSCollectionLayoutSize,
627 subitem: &NSCollectionLayoutItem,
628 count: NSInteger,
629 ) -> Retained<Self>;
630
631 #[unsafe(method(horizontalGroupWithLayoutSize:subitems:))]
632 #[unsafe(method_family = none)]
633 pub fn horizontalGroupWithLayoutSize_subitems(
634 layout_size: &NSCollectionLayoutSize,
635 subitems: &NSArray<NSCollectionLayoutItem>,
636 ) -> Retained<Self>;
637
638 #[unsafe(method(verticalGroupWithLayoutSize:subitem:count:))]
639 #[unsafe(method_family = none)]
640 pub fn verticalGroupWithLayoutSize_subitem_count(
641 layout_size: &NSCollectionLayoutSize,
642 subitem: &NSCollectionLayoutItem,
643 count: NSInteger,
644 ) -> Retained<Self>;
645
646 #[unsafe(method(verticalGroupWithLayoutSize:subitems:))]
647 #[unsafe(method_family = none)]
648 pub fn verticalGroupWithLayoutSize_subitems(
649 layout_size: &NSCollectionLayoutSize,
650 subitems: &NSArray<NSCollectionLayoutItem>,
651 ) -> Retained<Self>;
652
653 #[cfg(feature = "block2")]
654 #[unsafe(method(customGroupWithLayoutSize:itemProvider:))]
658 #[unsafe(method_family = none)]
659 pub unsafe fn customGroupWithLayoutSize_itemProvider(
660 layout_size: &NSCollectionLayoutSize,
661 item_provider: NSCollectionLayoutGroupCustomItemProvider,
662 ) -> Retained<Self>;
663
664 #[unsafe(method(init))]
665 #[unsafe(method_family = init)]
666 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
667
668 #[unsafe(method(new))]
669 #[unsafe(method_family = new)]
670 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
671
672 #[unsafe(method(supplementaryItems))]
673 #[unsafe(method_family = none)]
674 pub fn supplementaryItems(&self) -> Retained<NSArray<NSCollectionLayoutSupplementaryItem>>;
675
676 #[unsafe(method(setSupplementaryItems:))]
680 #[unsafe(method_family = none)]
681 pub fn setSupplementaryItems(
682 &self,
683 supplementary_items: &NSArray<NSCollectionLayoutSupplementaryItem>,
684 );
685
686 #[unsafe(method(interItemSpacing))]
687 #[unsafe(method_family = none)]
688 pub fn interItemSpacing(&self) -> Option<Retained<NSCollectionLayoutSpacing>>;
689
690 #[unsafe(method(setInterItemSpacing:))]
694 #[unsafe(method_family = none)]
695 pub fn setInterItemSpacing(&self, inter_item_spacing: Option<&NSCollectionLayoutSpacing>);
696
697 #[unsafe(method(subitems))]
698 #[unsafe(method_family = none)]
699 pub fn subitems(&self) -> Retained<NSArray<NSCollectionLayoutItem>>;
700
701 #[unsafe(method(visualDescription))]
702 #[unsafe(method_family = none)]
703 pub fn visualDescription(&self) -> Retained<NSString>;
704 );
705}
706
707impl NSCollectionLayoutGroup {
709 extern_methods!(
710 #[unsafe(method(itemWithLayoutSize:))]
711 #[unsafe(method_family = none)]
712 pub fn itemWithLayoutSize(layout_size: &NSCollectionLayoutSize) -> Retained<Self>;
713
714 #[unsafe(method(itemWithLayoutSize:supplementaryItems:))]
715 #[unsafe(method_family = none)]
716 pub fn itemWithLayoutSize_supplementaryItems(
717 layout_size: &NSCollectionLayoutSize,
718 supplementary_items: &NSArray<NSCollectionLayoutSupplementaryItem>,
719 ) -> Retained<Self>;
720 );
721}
722
723extern_class!(
724 #[unsafe(super(NSObject))]
726 #[thread_kind = MainThreadOnly]
727 #[derive(Debug, PartialEq, Eq, Hash)]
728 pub struct NSCollectionLayoutDimension;
729);
730
731extern_conformance!(
732 unsafe impl NSCopying for NSCollectionLayoutDimension {}
733);
734
735unsafe impl CopyingHelper for NSCollectionLayoutDimension {
736 type Result = Self;
737}
738
739extern_conformance!(
740 unsafe impl NSObjectProtocol for NSCollectionLayoutDimension {}
741);
742
743impl NSCollectionLayoutDimension {
744 extern_methods!(
745 #[cfg(feature = "objc2-core-foundation")]
746 #[unsafe(method(fractionalWidthDimension:))]
747 #[unsafe(method_family = none)]
748 pub fn fractionalWidthDimension(
749 fractional_width: CGFloat,
750 mtm: MainThreadMarker,
751 ) -> Retained<Self>;
752
753 #[cfg(feature = "objc2-core-foundation")]
754 #[unsafe(method(fractionalHeightDimension:))]
755 #[unsafe(method_family = none)]
756 pub fn fractionalHeightDimension(
757 fractional_height: CGFloat,
758 mtm: MainThreadMarker,
759 ) -> Retained<Self>;
760
761 #[cfg(feature = "objc2-core-foundation")]
762 #[unsafe(method(absoluteDimension:))]
763 #[unsafe(method_family = none)]
764 pub fn absoluteDimension(
765 absolute_dimension: CGFloat,
766 mtm: MainThreadMarker,
767 ) -> Retained<Self>;
768
769 #[cfg(feature = "objc2-core-foundation")]
770 #[unsafe(method(estimatedDimension:))]
771 #[unsafe(method_family = none)]
772 pub fn estimatedDimension(
773 estimated_dimension: CGFloat,
774 mtm: MainThreadMarker,
775 ) -> Retained<Self>;
776
777 #[unsafe(method(init))]
778 #[unsafe(method_family = init)]
779 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
780
781 #[unsafe(method(new))]
782 #[unsafe(method_family = new)]
783 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
784
785 #[unsafe(method(isFractionalWidth))]
786 #[unsafe(method_family = none)]
787 pub fn isFractionalWidth(&self) -> bool;
788
789 #[unsafe(method(isFractionalHeight))]
790 #[unsafe(method_family = none)]
791 pub fn isFractionalHeight(&self) -> bool;
792
793 #[unsafe(method(isAbsolute))]
794 #[unsafe(method_family = none)]
795 pub fn isAbsolute(&self) -> bool;
796
797 #[unsafe(method(isEstimated))]
798 #[unsafe(method_family = none)]
799 pub fn isEstimated(&self) -> bool;
800
801 #[cfg(feature = "objc2-core-foundation")]
802 #[unsafe(method(dimension))]
803 #[unsafe(method_family = none)]
804 pub fn dimension(&self) -> CGFloat;
805 );
806}
807
808extern_class!(
809 #[unsafe(super(NSObject))]
811 #[thread_kind = MainThreadOnly]
812 #[derive(Debug, PartialEq, Eq, Hash)]
813 pub struct NSCollectionLayoutSize;
814);
815
816extern_conformance!(
817 unsafe impl NSCopying for NSCollectionLayoutSize {}
818);
819
820unsafe impl CopyingHelper for NSCollectionLayoutSize {
821 type Result = Self;
822}
823
824extern_conformance!(
825 unsafe impl NSObjectProtocol for NSCollectionLayoutSize {}
826);
827
828impl NSCollectionLayoutSize {
829 extern_methods!(
830 #[unsafe(method(sizeWithWidthDimension:heightDimension:))]
831 #[unsafe(method_family = none)]
832 pub fn sizeWithWidthDimension_heightDimension(
833 width: &NSCollectionLayoutDimension,
834 height: &NSCollectionLayoutDimension,
835 ) -> Retained<Self>;
836
837 #[unsafe(method(init))]
838 #[unsafe(method_family = init)]
839 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
840
841 #[unsafe(method(new))]
842 #[unsafe(method_family = new)]
843 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
844
845 #[unsafe(method(widthDimension))]
846 #[unsafe(method_family = none)]
847 pub fn widthDimension(&self) -> Retained<NSCollectionLayoutDimension>;
848
849 #[unsafe(method(heightDimension))]
850 #[unsafe(method_family = none)]
851 pub fn heightDimension(&self) -> Retained<NSCollectionLayoutDimension>;
852 );
853}
854
855extern_class!(
856 #[unsafe(super(NSObject))]
858 #[thread_kind = MainThreadOnly]
859 #[derive(Debug, PartialEq, Eq, Hash)]
860 pub struct NSCollectionLayoutSpacing;
861);
862
863extern_conformance!(
864 unsafe impl NSCopying for NSCollectionLayoutSpacing {}
865);
866
867unsafe impl CopyingHelper for NSCollectionLayoutSpacing {
868 type Result = Self;
869}
870
871extern_conformance!(
872 unsafe impl NSObjectProtocol for NSCollectionLayoutSpacing {}
873);
874
875impl NSCollectionLayoutSpacing {
876 extern_methods!(
877 #[cfg(feature = "objc2-core-foundation")]
878 #[unsafe(method(flexibleSpacing:))]
879 #[unsafe(method_family = none)]
880 pub fn flexibleSpacing(flexible_spacing: CGFloat, mtm: MainThreadMarker) -> Retained<Self>;
881
882 #[cfg(feature = "objc2-core-foundation")]
883 #[unsafe(method(fixedSpacing:))]
884 #[unsafe(method_family = none)]
885 pub fn fixedSpacing(fixed_spacing: CGFloat, mtm: MainThreadMarker) -> Retained<Self>;
886
887 #[unsafe(method(init))]
888 #[unsafe(method_family = init)]
889 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
890
891 #[unsafe(method(new))]
892 #[unsafe(method_family = new)]
893 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
894
895 #[cfg(feature = "objc2-core-foundation")]
896 #[unsafe(method(spacing))]
897 #[unsafe(method_family = none)]
898 pub fn spacing(&self) -> CGFloat;
899
900 #[unsafe(method(isFlexibleSpacing))]
901 #[unsafe(method_family = none)]
902 pub fn isFlexibleSpacing(&self) -> bool;
903
904 #[unsafe(method(isFixedSpacing))]
905 #[unsafe(method_family = none)]
906 pub fn isFixedSpacing(&self) -> bool;
907 );
908}
909
910extern_class!(
911 #[unsafe(super(NSObject))]
913 #[thread_kind = MainThreadOnly]
914 #[derive(Debug, PartialEq, Eq, Hash)]
915 pub struct NSCollectionLayoutEdgeSpacing;
916);
917
918extern_conformance!(
919 unsafe impl NSCopying for NSCollectionLayoutEdgeSpacing {}
920);
921
922unsafe impl CopyingHelper for NSCollectionLayoutEdgeSpacing {
923 type Result = Self;
924}
925
926extern_conformance!(
927 unsafe impl NSObjectProtocol for NSCollectionLayoutEdgeSpacing {}
928);
929
930impl NSCollectionLayoutEdgeSpacing {
931 extern_methods!(
932 #[unsafe(method(spacingForLeading:top:trailing:bottom:))]
933 #[unsafe(method_family = none)]
934 pub fn spacingForLeading_top_trailing_bottom(
935 leading: Option<&NSCollectionLayoutSpacing>,
936 top: Option<&NSCollectionLayoutSpacing>,
937 trailing: Option<&NSCollectionLayoutSpacing>,
938 bottom: Option<&NSCollectionLayoutSpacing>,
939 mtm: MainThreadMarker,
940 ) -> Retained<Self>;
941
942 #[unsafe(method(init))]
943 #[unsafe(method_family = init)]
944 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
945
946 #[unsafe(method(new))]
947 #[unsafe(method_family = new)]
948 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
949
950 #[unsafe(method(leading))]
951 #[unsafe(method_family = none)]
952 pub fn leading(&self) -> Option<Retained<NSCollectionLayoutSpacing>>;
953
954 #[unsafe(method(top))]
955 #[unsafe(method_family = none)]
956 pub fn top(&self) -> Option<Retained<NSCollectionLayoutSpacing>>;
957
958 #[unsafe(method(trailing))]
959 #[unsafe(method_family = none)]
960 pub fn trailing(&self) -> Option<Retained<NSCollectionLayoutSpacing>>;
961
962 #[unsafe(method(bottom))]
963 #[unsafe(method_family = none)]
964 pub fn bottom(&self) -> Option<Retained<NSCollectionLayoutSpacing>>;
965 );
966}
967
968extern_class!(
969 #[unsafe(super(NSCollectionLayoutItem, NSObject))]
971 #[derive(Debug, PartialEq, Eq, Hash)]
972 pub struct NSCollectionLayoutSupplementaryItem;
973);
974
975extern_conformance!(
976 unsafe impl NSCopying for NSCollectionLayoutSupplementaryItem {}
977);
978
979unsafe impl CopyingHelper for NSCollectionLayoutSupplementaryItem {
980 type Result = Self;
981}
982
983extern_conformance!(
984 unsafe impl NSObjectProtocol for NSCollectionLayoutSupplementaryItem {}
985);
986
987impl NSCollectionLayoutSupplementaryItem {
988 extern_methods!(
989 #[unsafe(method(supplementaryItemWithLayoutSize:elementKind:containerAnchor:))]
990 #[unsafe(method_family = none)]
991 pub fn supplementaryItemWithLayoutSize_elementKind_containerAnchor(
992 layout_size: &NSCollectionLayoutSize,
993 element_kind: &NSString,
994 container_anchor: &NSCollectionLayoutAnchor,
995 ) -> Retained<Self>;
996
997 #[unsafe(method(supplementaryItemWithLayoutSize:elementKind:containerAnchor:itemAnchor:))]
998 #[unsafe(method_family = none)]
999 pub fn supplementaryItemWithLayoutSize_elementKind_containerAnchor_itemAnchor(
1000 layout_size: &NSCollectionLayoutSize,
1001 element_kind: &NSString,
1002 container_anchor: &NSCollectionLayoutAnchor,
1003 item_anchor: &NSCollectionLayoutAnchor,
1004 ) -> Retained<Self>;
1005
1006 #[unsafe(method(init))]
1007 #[unsafe(method_family = init)]
1008 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1009
1010 #[unsafe(method(new))]
1011 #[unsafe(method_family = new)]
1012 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
1013
1014 #[unsafe(method(zIndex))]
1015 #[unsafe(method_family = none)]
1016 pub fn zIndex(&self) -> NSInteger;
1017
1018 #[unsafe(method(setZIndex:))]
1020 #[unsafe(method_family = none)]
1021 pub fn setZIndex(&self, z_index: NSInteger);
1022
1023 #[unsafe(method(elementKind))]
1024 #[unsafe(method_family = none)]
1025 pub fn elementKind(&self) -> Retained<NSString>;
1026
1027 #[unsafe(method(containerAnchor))]
1028 #[unsafe(method_family = none)]
1029 pub fn containerAnchor(&self) -> Retained<NSCollectionLayoutAnchor>;
1030
1031 #[unsafe(method(itemAnchor))]
1032 #[unsafe(method_family = none)]
1033 pub fn itemAnchor(&self) -> Option<Retained<NSCollectionLayoutAnchor>>;
1034 );
1035}
1036
1037impl NSCollectionLayoutSupplementaryItem {
1039 extern_methods!(
1040 #[unsafe(method(itemWithLayoutSize:))]
1041 #[unsafe(method_family = none)]
1042 pub fn itemWithLayoutSize(layout_size: &NSCollectionLayoutSize) -> Retained<Self>;
1043
1044 #[unsafe(method(itemWithLayoutSize:supplementaryItems:))]
1045 #[unsafe(method_family = none)]
1046 pub fn itemWithLayoutSize_supplementaryItems(
1047 layout_size: &NSCollectionLayoutSize,
1048 supplementary_items: &NSArray<NSCollectionLayoutSupplementaryItem>,
1049 ) -> Retained<Self>;
1050 );
1051}
1052
1053extern_class!(
1054 #[unsafe(super(NSCollectionLayoutSupplementaryItem, NSCollectionLayoutItem, NSObject))]
1056 #[derive(Debug, PartialEq, Eq, Hash)]
1057 pub struct NSCollectionLayoutBoundarySupplementaryItem;
1058);
1059
1060extern_conformance!(
1061 unsafe impl NSCopying for NSCollectionLayoutBoundarySupplementaryItem {}
1062);
1063
1064unsafe impl CopyingHelper for NSCollectionLayoutBoundarySupplementaryItem {
1065 type Result = Self;
1066}
1067
1068extern_conformance!(
1069 unsafe impl NSObjectProtocol for NSCollectionLayoutBoundarySupplementaryItem {}
1070);
1071
1072impl NSCollectionLayoutBoundarySupplementaryItem {
1073 extern_methods!(
1074 #[unsafe(method(boundarySupplementaryItemWithLayoutSize:elementKind:alignment:))]
1075 #[unsafe(method_family = none)]
1076 pub fn boundarySupplementaryItemWithLayoutSize_elementKind_alignment(
1077 layout_size: &NSCollectionLayoutSize,
1078 element_kind: &NSString,
1079 alignment: NSRectAlignment,
1080 ) -> Retained<Self>;
1081
1082 #[unsafe(method(boundarySupplementaryItemWithLayoutSize:elementKind:alignment:absoluteOffset:))]
1083 #[unsafe(method_family = none)]
1084 pub fn boundarySupplementaryItemWithLayoutSize_elementKind_alignment_absoluteOffset(
1085 layout_size: &NSCollectionLayoutSize,
1086 element_kind: &NSString,
1087 alignment: NSRectAlignment,
1088 absolute_offset: NSPoint,
1089 ) -> Retained<Self>;
1090
1091 #[unsafe(method(init))]
1092 #[unsafe(method_family = init)]
1093 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1094
1095 #[unsafe(method(new))]
1096 #[unsafe(method_family = new)]
1097 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
1098
1099 #[unsafe(method(extendsBoundary))]
1100 #[unsafe(method_family = none)]
1101 pub fn extendsBoundary(&self) -> bool;
1102
1103 #[unsafe(method(setExtendsBoundary:))]
1105 #[unsafe(method_family = none)]
1106 pub fn setExtendsBoundary(&self, extends_boundary: bool);
1107
1108 #[unsafe(method(pinToVisibleBounds))]
1109 #[unsafe(method_family = none)]
1110 pub fn pinToVisibleBounds(&self) -> bool;
1111
1112 #[unsafe(method(setPinToVisibleBounds:))]
1114 #[unsafe(method_family = none)]
1115 pub fn setPinToVisibleBounds(&self, pin_to_visible_bounds: bool);
1116
1117 #[unsafe(method(alignment))]
1118 #[unsafe(method_family = none)]
1119 pub fn alignment(&self) -> NSRectAlignment;
1120
1121 #[unsafe(method(offset))]
1122 #[unsafe(method_family = none)]
1123 pub fn offset(&self) -> NSPoint;
1124 );
1125}
1126
1127impl NSCollectionLayoutBoundarySupplementaryItem {
1129 extern_methods!(
1130 #[unsafe(method(supplementaryItemWithLayoutSize:elementKind:containerAnchor:))]
1131 #[unsafe(method_family = none)]
1132 pub fn supplementaryItemWithLayoutSize_elementKind_containerAnchor(
1133 layout_size: &NSCollectionLayoutSize,
1134 element_kind: &NSString,
1135 container_anchor: &NSCollectionLayoutAnchor,
1136 ) -> Retained<Self>;
1137
1138 #[unsafe(method(supplementaryItemWithLayoutSize:elementKind:containerAnchor:itemAnchor:))]
1139 #[unsafe(method_family = none)]
1140 pub fn supplementaryItemWithLayoutSize_elementKind_containerAnchor_itemAnchor(
1141 layout_size: &NSCollectionLayoutSize,
1142 element_kind: &NSString,
1143 container_anchor: &NSCollectionLayoutAnchor,
1144 item_anchor: &NSCollectionLayoutAnchor,
1145 ) -> Retained<Self>;
1146 );
1147}
1148
1149impl NSCollectionLayoutBoundarySupplementaryItem {
1151 extern_methods!(
1152 #[unsafe(method(itemWithLayoutSize:))]
1153 #[unsafe(method_family = none)]
1154 pub fn itemWithLayoutSize(layout_size: &NSCollectionLayoutSize) -> Retained<Self>;
1155
1156 #[unsafe(method(itemWithLayoutSize:supplementaryItems:))]
1157 #[unsafe(method_family = none)]
1158 pub fn itemWithLayoutSize_supplementaryItems(
1159 layout_size: &NSCollectionLayoutSize,
1160 supplementary_items: &NSArray<NSCollectionLayoutSupplementaryItem>,
1161 ) -> Retained<Self>;
1162 );
1163}
1164
1165extern_class!(
1166 #[unsafe(super(NSCollectionLayoutItem, NSObject))]
1168 #[derive(Debug, PartialEq, Eq, Hash)]
1169 pub struct NSCollectionLayoutDecorationItem;
1170);
1171
1172extern_conformance!(
1173 unsafe impl NSCopying for NSCollectionLayoutDecorationItem {}
1174);
1175
1176unsafe impl CopyingHelper for NSCollectionLayoutDecorationItem {
1177 type Result = Self;
1178}
1179
1180extern_conformance!(
1181 unsafe impl NSObjectProtocol for NSCollectionLayoutDecorationItem {}
1182);
1183
1184impl NSCollectionLayoutDecorationItem {
1185 extern_methods!(
1186 #[unsafe(method(backgroundDecorationItemWithElementKind:))]
1187 #[unsafe(method_family = none)]
1188 pub fn backgroundDecorationItemWithElementKind(
1189 element_kind: &NSString,
1190 mtm: MainThreadMarker,
1191 ) -> Retained<Self>;
1192
1193 #[unsafe(method(init))]
1194 #[unsafe(method_family = init)]
1195 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1196
1197 #[unsafe(method(new))]
1198 #[unsafe(method_family = new)]
1199 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
1200
1201 #[unsafe(method(zIndex))]
1202 #[unsafe(method_family = none)]
1203 pub fn zIndex(&self) -> NSInteger;
1204
1205 #[unsafe(method(setZIndex:))]
1207 #[unsafe(method_family = none)]
1208 pub fn setZIndex(&self, z_index: NSInteger);
1209
1210 #[unsafe(method(elementKind))]
1211 #[unsafe(method_family = none)]
1212 pub fn elementKind(&self) -> Retained<NSString>;
1213 );
1214}
1215
1216impl NSCollectionLayoutDecorationItem {
1218 extern_methods!(
1219 #[unsafe(method(itemWithLayoutSize:))]
1220 #[unsafe(method_family = none)]
1221 pub fn itemWithLayoutSize(layout_size: &NSCollectionLayoutSize) -> Retained<Self>;
1222
1223 #[unsafe(method(itemWithLayoutSize:supplementaryItems:))]
1224 #[unsafe(method_family = none)]
1225 pub fn itemWithLayoutSize_supplementaryItems(
1226 layout_size: &NSCollectionLayoutSize,
1227 supplementary_items: &NSArray<NSCollectionLayoutSupplementaryItem>,
1228 ) -> Retained<Self>;
1229 );
1230}
1231
1232extern_class!(
1233 #[unsafe(super(NSObject))]
1235 #[thread_kind = MainThreadOnly]
1236 #[derive(Debug, PartialEq, Eq, Hash)]
1237 pub struct NSCollectionLayoutAnchor;
1238);
1239
1240extern_conformance!(
1241 unsafe impl NSCopying for NSCollectionLayoutAnchor {}
1242);
1243
1244unsafe impl CopyingHelper for NSCollectionLayoutAnchor {
1245 type Result = Self;
1246}
1247
1248extern_conformance!(
1249 unsafe impl NSObjectProtocol for NSCollectionLayoutAnchor {}
1250);
1251
1252impl NSCollectionLayoutAnchor {
1253 extern_methods!(
1254 #[unsafe(method(layoutAnchorWithEdges:))]
1255 #[unsafe(method_family = none)]
1256 pub fn layoutAnchorWithEdges(
1257 edges: NSDirectionalRectEdge,
1258 mtm: MainThreadMarker,
1259 ) -> Retained<Self>;
1260
1261 #[unsafe(method(layoutAnchorWithEdges:absoluteOffset:))]
1262 #[unsafe(method_family = none)]
1263 pub fn layoutAnchorWithEdges_absoluteOffset(
1264 edges: NSDirectionalRectEdge,
1265 absolute_offset: NSPoint,
1266 mtm: MainThreadMarker,
1267 ) -> Retained<Self>;
1268
1269 #[unsafe(method(layoutAnchorWithEdges:fractionalOffset:))]
1270 #[unsafe(method_family = none)]
1271 pub fn layoutAnchorWithEdges_fractionalOffset(
1272 edges: NSDirectionalRectEdge,
1273 fractional_offset: NSPoint,
1274 mtm: MainThreadMarker,
1275 ) -> Retained<Self>;
1276
1277 #[unsafe(method(init))]
1278 #[unsafe(method_family = init)]
1279 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1280
1281 #[unsafe(method(new))]
1282 #[unsafe(method_family = new)]
1283 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
1284
1285 #[unsafe(method(edges))]
1286 #[unsafe(method_family = none)]
1287 pub fn edges(&self) -> NSDirectionalRectEdge;
1288
1289 #[unsafe(method(offset))]
1290 #[unsafe(method_family = none)]
1291 pub fn offset(&self) -> NSPoint;
1292
1293 #[unsafe(method(isAbsoluteOffset))]
1294 #[unsafe(method_family = none)]
1295 pub fn isAbsoluteOffset(&self) -> bool;
1296
1297 #[unsafe(method(isFractionalOffset))]
1298 #[unsafe(method_family = none)]
1299 pub fn isFractionalOffset(&self) -> bool;
1300 );
1301}
1302
1303extern_protocol!(
1304 pub unsafe trait NSCollectionLayoutContainer: NSObjectProtocol + MainThreadOnly {
1306 #[unsafe(method(contentSize))]
1307 #[unsafe(method_family = none)]
1308 fn contentSize(&self) -> NSSize;
1309
1310 #[unsafe(method(effectiveContentSize))]
1311 #[unsafe(method_family = none)]
1312 fn effectiveContentSize(&self) -> NSSize;
1313
1314 #[cfg(feature = "objc2-core-foundation")]
1315 #[unsafe(method(contentInsets))]
1316 #[unsafe(method_family = none)]
1317 fn contentInsets(&self) -> NSDirectionalEdgeInsets;
1318
1319 #[cfg(feature = "objc2-core-foundation")]
1320 #[unsafe(method(effectiveContentInsets))]
1321 #[unsafe(method_family = none)]
1322 fn effectiveContentInsets(&self) -> NSDirectionalEdgeInsets;
1323 }
1324);
1325
1326extern_protocol!(
1327 pub unsafe trait NSCollectionLayoutEnvironment:
1329 NSObjectProtocol + MainThreadOnly
1330 {
1331 #[unsafe(method(container))]
1332 #[unsafe(method_family = none)]
1333 fn container(&self) -> Retained<ProtocolObject<dyn NSCollectionLayoutContainer>>;
1334 }
1335);
1336
1337extern_protocol!(
1338 pub unsafe trait NSCollectionLayoutVisibleItem:
1340 NSObjectProtocol + MainThreadOnly
1341 {
1342 #[cfg(feature = "objc2-core-foundation")]
1343 #[unsafe(method(alpha))]
1344 #[unsafe(method_family = none)]
1345 fn alpha(&self) -> CGFloat;
1346
1347 #[cfg(feature = "objc2-core-foundation")]
1348 #[unsafe(method(setAlpha:))]
1350 #[unsafe(method_family = none)]
1351 fn setAlpha(&self, alpha: CGFloat);
1352
1353 #[unsafe(method(zIndex))]
1354 #[unsafe(method_family = none)]
1355 fn zIndex(&self) -> NSInteger;
1356
1357 #[unsafe(method(setZIndex:))]
1359 #[unsafe(method_family = none)]
1360 fn setZIndex(&self, z_index: NSInteger);
1361
1362 #[unsafe(method(isHidden))]
1363 #[unsafe(method_family = none)]
1364 fn isHidden(&self) -> bool;
1365
1366 #[unsafe(method(setHidden:))]
1368 #[unsafe(method_family = none)]
1369 fn setHidden(&self, hidden: bool);
1370
1371 #[unsafe(method(center))]
1372 #[unsafe(method_family = none)]
1373 fn center(&self) -> NSPoint;
1374
1375 #[unsafe(method(setCenter:))]
1377 #[unsafe(method_family = none)]
1378 fn setCenter(&self, center: NSPoint);
1379
1380 #[unsafe(method(name))]
1381 #[unsafe(method_family = none)]
1382 fn name(&self) -> Retained<NSString>;
1383
1384 #[unsafe(method(indexPath))]
1385 #[unsafe(method_family = none)]
1386 fn indexPath(&self) -> Retained<NSIndexPath>;
1387
1388 #[unsafe(method(frame))]
1389 #[unsafe(method_family = none)]
1390 fn frame(&self) -> NSRect;
1391
1392 #[unsafe(method(bounds))]
1393 #[unsafe(method_family = none)]
1394 fn bounds(&self) -> NSRect;
1395
1396 #[cfg(feature = "NSCollectionViewLayout")]
1397 #[unsafe(method(representedElementCategory))]
1398 #[unsafe(method_family = none)]
1399 fn representedElementCategory(&self) -> NSCollectionElementCategory;
1400
1401 #[unsafe(method(representedElementKind))]
1402 #[unsafe(method_family = none)]
1403 fn representedElementKind(&self) -> Option<Retained<NSString>>;
1404 }
1405);