use crate::common::*;
use crate::AppKit::*;
use crate::CoreData::*;
use crate::Foundation::*;
ns_options!(
#[underlying(NSUInteger)]
pub enum NSDirectionalRectEdge {
NSDirectionalRectEdgeNone = 0,
NSDirectionalRectEdgeTop = 1 << 0,
NSDirectionalRectEdgeLeading = 1 << 1,
NSDirectionalRectEdgeBottom = 1 << 2,
NSDirectionalRectEdgeTrailing = 1 << 3,
NSDirectionalRectEdgeAll = NSDirectionalRectEdgeTop
| NSDirectionalRectEdgeLeading
| NSDirectionalRectEdgeBottom
| NSDirectionalRectEdgeTrailing,
}
);
extern_struct!(
pub struct NSDirectionalEdgeInsets {
pub top: CGFloat,
pub leading: CGFloat,
pub bottom: CGFloat,
pub trailing: CGFloat,
}
);
extern_static!(NSDirectionalEdgeInsetsZero: NSDirectionalEdgeInsets);
ns_enum!(
#[underlying(NSInteger)]
pub enum NSRectAlignment {
NSRectAlignmentNone = 0,
NSRectAlignmentTop = 1,
NSRectAlignmentTopLeading = 2,
NSRectAlignmentLeading = 3,
NSRectAlignmentBottomLeading = 4,
NSRectAlignmentBottom = 5,
NSRectAlignmentBottomTrailing = 6,
NSRectAlignmentTrailing = 7,
NSRectAlignmentTopTrailing = 8,
}
);
inline_fn!(
pub unsafe fn NSDirectionalEdgeInsetsMake(
top: CGFloat,
leading: CGFloat,
bottom: CGFloat,
trailing: CGFloat,
) -> NSDirectionalEdgeInsets {
todo!()
}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSCollectionViewCompositionalLayoutConfiguration;
unsafe impl ClassType for NSCollectionViewCompositionalLayoutConfiguration {
type Super = NSObject;
}
);
extern_methods!(
unsafe impl NSCollectionViewCompositionalLayoutConfiguration {
#[method(scrollDirection)]
pub unsafe fn scrollDirection(&self) -> NSCollectionViewScrollDirection;
#[method(setScrollDirection:)]
pub unsafe fn setScrollDirection(&self, scrollDirection: NSCollectionViewScrollDirection);
#[method(interSectionSpacing)]
pub unsafe fn interSectionSpacing(&self) -> CGFloat;
#[method(setInterSectionSpacing:)]
pub unsafe fn setInterSectionSpacing(&self, interSectionSpacing: CGFloat);
#[method_id(@__retain_semantics Other boundarySupplementaryItems)]
pub unsafe fn boundarySupplementaryItems(
&self,
) -> Id<NSArray<NSCollectionLayoutBoundarySupplementaryItem>, Shared>;
#[method(setBoundarySupplementaryItems:)]
pub unsafe fn setBoundarySupplementaryItems(
&self,
boundarySupplementaryItems: &NSArray<NSCollectionLayoutBoundarySupplementaryItem>,
);
}
);
pub type NSCollectionViewCompositionalLayoutSectionProvider =
*mut Block<(NSInteger, NonNull<NSCollectionLayoutEnvironment>), *mut NSCollectionLayoutSection>;
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSCollectionViewCompositionalLayout;
unsafe impl ClassType for NSCollectionViewCompositionalLayout {
#[inherits(NSObject)]
type Super = NSCollectionViewLayout;
}
);
extern_methods!(
unsafe impl NSCollectionViewCompositionalLayout {
#[method_id(@__retain_semantics Init initWithSection:)]
pub unsafe fn initWithSection(
this: Option<Allocated<Self>>,
section: &NSCollectionLayoutSection,
) -> Id<Self, Shared>;
#[method_id(@__retain_semantics Init initWithSection:configuration:)]
pub unsafe fn initWithSection_configuration(
this: Option<Allocated<Self>>,
section: &NSCollectionLayoutSection,
configuration: &NSCollectionViewCompositionalLayoutConfiguration,
) -> Id<Self, Shared>;
#[method_id(@__retain_semantics Init initWithSectionProvider:)]
pub unsafe fn initWithSectionProvider(
this: Option<Allocated<Self>>,
sectionProvider: NSCollectionViewCompositionalLayoutSectionProvider,
) -> Id<Self, Shared>;
#[method_id(@__retain_semantics Init initWithSectionProvider:configuration:)]
pub unsafe fn initWithSectionProvider_configuration(
this: Option<Allocated<Self>>,
sectionProvider: NSCollectionViewCompositionalLayoutSectionProvider,
configuration: &NSCollectionViewCompositionalLayoutConfiguration,
) -> Id<Self, Shared>;
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Option<Allocated<Self>>) -> Id<Self, Shared>;
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Id<Self, Shared>;
#[method_id(@__retain_semantics Other configuration)]
pub unsafe fn configuration(
&self,
) -> Id<NSCollectionViewCompositionalLayoutConfiguration, Shared>;
#[method(setConfiguration:)]
pub unsafe fn setConfiguration(
&self,
configuration: &NSCollectionViewCompositionalLayoutConfiguration,
);
}
);
ns_enum!(
#[underlying(NSInteger)]
pub enum NSCollectionLayoutSectionOrthogonalScrollingBehavior {
NSCollectionLayoutSectionOrthogonalScrollingBehaviorNone = 0,
NSCollectionLayoutSectionOrthogonalScrollingBehaviorContinuous = 1,
NSCollectionLayoutSectionOrthogonalScrollingBehaviorContinuousGroupLeadingBoundary = 2,
NSCollectionLayoutSectionOrthogonalScrollingBehaviorPaging = 3,
NSCollectionLayoutSectionOrthogonalScrollingBehaviorGroupPaging = 4,
NSCollectionLayoutSectionOrthogonalScrollingBehaviorGroupPagingCentered = 5,
}
);
pub type NSCollectionLayoutSectionVisibleItemsInvalidationHandler = *mut Block<
(
NonNull<NSArray<NSCollectionLayoutVisibleItem>>,
NSPoint,
NonNull<NSCollectionLayoutEnvironment>,
),
(),
>;
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSCollectionLayoutSection;
unsafe impl ClassType for NSCollectionLayoutSection {
type Super = NSObject;
}
);
extern_methods!(
unsafe impl NSCollectionLayoutSection {
#[method_id(@__retain_semantics Other sectionWithGroup:)]
pub unsafe fn sectionWithGroup(group: &NSCollectionLayoutGroup) -> Id<Self, Shared>;
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Option<Allocated<Self>>) -> Id<Self, Shared>;
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Id<Self, Shared>;
#[method(contentInsets)]
pub unsafe fn contentInsets(&self) -> NSDirectionalEdgeInsets;
#[method(setContentInsets:)]
pub unsafe fn setContentInsets(&self, contentInsets: NSDirectionalEdgeInsets);
#[method(interGroupSpacing)]
pub unsafe fn interGroupSpacing(&self) -> CGFloat;
#[method(setInterGroupSpacing:)]
pub unsafe fn setInterGroupSpacing(&self, interGroupSpacing: CGFloat);
#[method(orthogonalScrollingBehavior)]
pub unsafe fn orthogonalScrollingBehavior(
&self,
) -> NSCollectionLayoutSectionOrthogonalScrollingBehavior;
#[method(setOrthogonalScrollingBehavior:)]
pub unsafe fn setOrthogonalScrollingBehavior(
&self,
orthogonalScrollingBehavior: NSCollectionLayoutSectionOrthogonalScrollingBehavior,
);
#[method_id(@__retain_semantics Other boundarySupplementaryItems)]
pub unsafe fn boundarySupplementaryItems(
&self,
) -> Id<NSArray<NSCollectionLayoutBoundarySupplementaryItem>, Shared>;
#[method(setBoundarySupplementaryItems:)]
pub unsafe fn setBoundarySupplementaryItems(
&self,
boundarySupplementaryItems: &NSArray<NSCollectionLayoutBoundarySupplementaryItem>,
);
#[method(supplementariesFollowContentInsets)]
pub unsafe fn supplementariesFollowContentInsets(&self) -> bool;
#[method(setSupplementariesFollowContentInsets:)]
pub unsafe fn setSupplementariesFollowContentInsets(
&self,
supplementariesFollowContentInsets: bool,
);
#[method(visibleItemsInvalidationHandler)]
pub unsafe fn visibleItemsInvalidationHandler(
&self,
) -> NSCollectionLayoutSectionVisibleItemsInvalidationHandler;
#[method(setVisibleItemsInvalidationHandler:)]
pub unsafe fn setVisibleItemsInvalidationHandler(
&self,
visibleItemsInvalidationHandler: NSCollectionLayoutSectionVisibleItemsInvalidationHandler,
);
#[method_id(@__retain_semantics Other decorationItems)]
pub unsafe fn decorationItems(
&self,
) -> Id<NSArray<NSCollectionLayoutDecorationItem>, Shared>;
#[method(setDecorationItems:)]
pub unsafe fn setDecorationItems(
&self,
decorationItems: &NSArray<NSCollectionLayoutDecorationItem>,
);
}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSCollectionLayoutItem;
unsafe impl ClassType for NSCollectionLayoutItem {
type Super = NSObject;
}
);
extern_methods!(
unsafe impl NSCollectionLayoutItem {
#[method_id(@__retain_semantics Other itemWithLayoutSize:)]
pub unsafe fn itemWithLayoutSize(layoutSize: &NSCollectionLayoutSize) -> Id<Self, Shared>;
#[method_id(@__retain_semantics Other itemWithLayoutSize:supplementaryItems:)]
pub unsafe fn itemWithLayoutSize_supplementaryItems(
layoutSize: &NSCollectionLayoutSize,
supplementaryItems: &NSArray<NSCollectionLayoutSupplementaryItem>,
) -> Id<Self, Shared>;
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Option<Allocated<Self>>) -> Id<Self, Shared>;
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Id<Self, Shared>;
#[method(contentInsets)]
pub unsafe fn contentInsets(&self) -> NSDirectionalEdgeInsets;
#[method(setContentInsets:)]
pub unsafe fn setContentInsets(&self, contentInsets: NSDirectionalEdgeInsets);
#[method_id(@__retain_semantics Other edgeSpacing)]
pub unsafe fn edgeSpacing(&self) -> Option<Id<NSCollectionLayoutEdgeSpacing, Shared>>;
#[method(setEdgeSpacing:)]
pub unsafe fn setEdgeSpacing(&self, edgeSpacing: Option<&NSCollectionLayoutEdgeSpacing>);
#[method_id(@__retain_semantics Other layoutSize)]
pub unsafe fn layoutSize(&self) -> Id<NSCollectionLayoutSize, Shared>;
#[method_id(@__retain_semantics Other supplementaryItems)]
pub unsafe fn supplementaryItems(
&self,
) -> Id<NSArray<NSCollectionLayoutSupplementaryItem>, Shared>;
}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSCollectionLayoutGroupCustomItem;
unsafe impl ClassType for NSCollectionLayoutGroupCustomItem {
type Super = NSObject;
}
);
extern_methods!(
unsafe impl NSCollectionLayoutGroupCustomItem {
#[method_id(@__retain_semantics Other customItemWithFrame:)]
pub unsafe fn customItemWithFrame(frame: NSRect) -> Id<Self, Shared>;
#[method_id(@__retain_semantics Other customItemWithFrame:zIndex:)]
pub unsafe fn customItemWithFrame_zIndex(
frame: NSRect,
zIndex: NSInteger,
) -> Id<Self, Shared>;
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Option<Allocated<Self>>) -> Id<Self, Shared>;
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Id<Self, Shared>;
#[method(frame)]
pub unsafe fn frame(&self) -> NSRect;
#[method(zIndex)]
pub unsafe fn zIndex(&self) -> NSInteger;
}
);
pub type NSCollectionLayoutGroupCustomItemProvider = *mut Block<
(NonNull<NSCollectionLayoutEnvironment>,),
NonNull<NSArray<NSCollectionLayoutGroupCustomItem>>,
>;
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSCollectionLayoutGroup;
unsafe impl ClassType for NSCollectionLayoutGroup {
#[inherits(NSObject)]
type Super = NSCollectionLayoutItem;
}
);
extern_methods!(
unsafe impl NSCollectionLayoutGroup {
#[method_id(@__retain_semantics Other horizontalGroupWithLayoutSize:subitem:count:)]
pub unsafe fn horizontalGroupWithLayoutSize_subitem_count(
layoutSize: &NSCollectionLayoutSize,
subitem: &NSCollectionLayoutItem,
count: NSInteger,
) -> Id<Self, Shared>;
#[method_id(@__retain_semantics Other horizontalGroupWithLayoutSize:subitems:)]
pub unsafe fn horizontalGroupWithLayoutSize_subitems(
layoutSize: &NSCollectionLayoutSize,
subitems: &NSArray<NSCollectionLayoutItem>,
) -> Id<Self, Shared>;
#[method_id(@__retain_semantics Other verticalGroupWithLayoutSize:subitem:count:)]
pub unsafe fn verticalGroupWithLayoutSize_subitem_count(
layoutSize: &NSCollectionLayoutSize,
subitem: &NSCollectionLayoutItem,
count: NSInteger,
) -> Id<Self, Shared>;
#[method_id(@__retain_semantics Other verticalGroupWithLayoutSize:subitems:)]
pub unsafe fn verticalGroupWithLayoutSize_subitems(
layoutSize: &NSCollectionLayoutSize,
subitems: &NSArray<NSCollectionLayoutItem>,
) -> Id<Self, Shared>;
#[method_id(@__retain_semantics Other customGroupWithLayoutSize:itemProvider:)]
pub unsafe fn customGroupWithLayoutSize_itemProvider(
layoutSize: &NSCollectionLayoutSize,
itemProvider: NSCollectionLayoutGroupCustomItemProvider,
) -> Id<Self, Shared>;
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Option<Allocated<Self>>) -> Id<Self, Shared>;
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Id<Self, Shared>;
#[method_id(@__retain_semantics Other supplementaryItems)]
pub unsafe fn supplementaryItems(
&self,
) -> Id<NSArray<NSCollectionLayoutSupplementaryItem>, Shared>;
#[method(setSupplementaryItems:)]
pub unsafe fn setSupplementaryItems(
&self,
supplementaryItems: &NSArray<NSCollectionLayoutSupplementaryItem>,
);
#[method_id(@__retain_semantics Other interItemSpacing)]
pub unsafe fn interItemSpacing(&self) -> Option<Id<NSCollectionLayoutSpacing, Shared>>;
#[method(setInterItemSpacing:)]
pub unsafe fn setInterItemSpacing(
&self,
interItemSpacing: Option<&NSCollectionLayoutSpacing>,
);
#[method_id(@__retain_semantics Other subitems)]
pub unsafe fn subitems(&self) -> Id<NSArray<NSCollectionLayoutItem>, Shared>;
#[method_id(@__retain_semantics Other visualDescription)]
pub unsafe fn visualDescription(&self) -> Id<NSString, Shared>;
}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSCollectionLayoutDimension;
unsafe impl ClassType for NSCollectionLayoutDimension {
type Super = NSObject;
}
);
extern_methods!(
unsafe impl NSCollectionLayoutDimension {
#[method_id(@__retain_semantics Other fractionalWidthDimension:)]
pub unsafe fn fractionalWidthDimension(fractionalWidth: CGFloat) -> Id<Self, Shared>;
#[method_id(@__retain_semantics Other fractionalHeightDimension:)]
pub unsafe fn fractionalHeightDimension(fractionalHeight: CGFloat) -> Id<Self, Shared>;
#[method_id(@__retain_semantics Other absoluteDimension:)]
pub unsafe fn absoluteDimension(absoluteDimension: CGFloat) -> Id<Self, Shared>;
#[method_id(@__retain_semantics Other estimatedDimension:)]
pub unsafe fn estimatedDimension(estimatedDimension: CGFloat) -> Id<Self, Shared>;
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Option<Allocated<Self>>) -> Id<Self, Shared>;
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Id<Self, Shared>;
#[method(isFractionalWidth)]
pub unsafe fn isFractionalWidth(&self) -> bool;
#[method(isFractionalHeight)]
pub unsafe fn isFractionalHeight(&self) -> bool;
#[method(isAbsolute)]
pub unsafe fn isAbsolute(&self) -> bool;
#[method(isEstimated)]
pub unsafe fn isEstimated(&self) -> bool;
#[method(dimension)]
pub unsafe fn dimension(&self) -> CGFloat;
}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSCollectionLayoutSize;
unsafe impl ClassType for NSCollectionLayoutSize {
type Super = NSObject;
}
);
extern_methods!(
unsafe impl NSCollectionLayoutSize {
#[method_id(@__retain_semantics Other sizeWithWidthDimension:heightDimension:)]
pub unsafe fn sizeWithWidthDimension_heightDimension(
width: &NSCollectionLayoutDimension,
height: &NSCollectionLayoutDimension,
) -> Id<Self, Shared>;
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Option<Allocated<Self>>) -> Id<Self, Shared>;
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Id<Self, Shared>;
#[method_id(@__retain_semantics Other widthDimension)]
pub unsafe fn widthDimension(&self) -> Id<NSCollectionLayoutDimension, Shared>;
#[method_id(@__retain_semantics Other heightDimension)]
pub unsafe fn heightDimension(&self) -> Id<NSCollectionLayoutDimension, Shared>;
}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSCollectionLayoutSpacing;
unsafe impl ClassType for NSCollectionLayoutSpacing {
type Super = NSObject;
}
);
extern_methods!(
unsafe impl NSCollectionLayoutSpacing {
#[method_id(@__retain_semantics Other flexibleSpacing:)]
pub unsafe fn flexibleSpacing(flexibleSpacing: CGFloat) -> Id<Self, Shared>;
#[method_id(@__retain_semantics Other fixedSpacing:)]
pub unsafe fn fixedSpacing(fixedSpacing: CGFloat) -> Id<Self, Shared>;
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Option<Allocated<Self>>) -> Id<Self, Shared>;
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Id<Self, Shared>;
#[method(spacing)]
pub unsafe fn spacing(&self) -> CGFloat;
#[method(isFlexibleSpacing)]
pub unsafe fn isFlexibleSpacing(&self) -> bool;
#[method(isFixedSpacing)]
pub unsafe fn isFixedSpacing(&self) -> bool;
}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSCollectionLayoutEdgeSpacing;
unsafe impl ClassType for NSCollectionLayoutEdgeSpacing {
type Super = NSObject;
}
);
extern_methods!(
unsafe impl NSCollectionLayoutEdgeSpacing {
#[method_id(@__retain_semantics Other spacingForLeading:top:trailing:bottom:)]
pub unsafe fn spacingForLeading_top_trailing_bottom(
leading: Option<&NSCollectionLayoutSpacing>,
top: Option<&NSCollectionLayoutSpacing>,
trailing: Option<&NSCollectionLayoutSpacing>,
bottom: Option<&NSCollectionLayoutSpacing>,
) -> Id<Self, Shared>;
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Option<Allocated<Self>>) -> Id<Self, Shared>;
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Id<Self, Shared>;
#[method_id(@__retain_semantics Other leading)]
pub unsafe fn leading(&self) -> Option<Id<NSCollectionLayoutSpacing, Shared>>;
#[method_id(@__retain_semantics Other top)]
pub unsafe fn top(&self) -> Option<Id<NSCollectionLayoutSpacing, Shared>>;
#[method_id(@__retain_semantics Other trailing)]
pub unsafe fn trailing(&self) -> Option<Id<NSCollectionLayoutSpacing, Shared>>;
#[method_id(@__retain_semantics Other bottom)]
pub unsafe fn bottom(&self) -> Option<Id<NSCollectionLayoutSpacing, Shared>>;
}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSCollectionLayoutSupplementaryItem;
unsafe impl ClassType for NSCollectionLayoutSupplementaryItem {
#[inherits(NSObject)]
type Super = NSCollectionLayoutItem;
}
);
extern_methods!(
unsafe impl NSCollectionLayoutSupplementaryItem {
#[method_id(@__retain_semantics Other supplementaryItemWithLayoutSize:elementKind:containerAnchor:)]
pub unsafe fn supplementaryItemWithLayoutSize_elementKind_containerAnchor(
layoutSize: &NSCollectionLayoutSize,
elementKind: &NSString,
containerAnchor: &NSCollectionLayoutAnchor,
) -> Id<Self, Shared>;
#[method_id(@__retain_semantics Other supplementaryItemWithLayoutSize:elementKind:containerAnchor:itemAnchor:)]
pub unsafe fn supplementaryItemWithLayoutSize_elementKind_containerAnchor_itemAnchor(
layoutSize: &NSCollectionLayoutSize,
elementKind: &NSString,
containerAnchor: &NSCollectionLayoutAnchor,
itemAnchor: &NSCollectionLayoutAnchor,
) -> Id<Self, Shared>;
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Option<Allocated<Self>>) -> Id<Self, Shared>;
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Id<Self, Shared>;
#[method(zIndex)]
pub unsafe fn zIndex(&self) -> NSInteger;
#[method(setZIndex:)]
pub unsafe fn setZIndex(&self, zIndex: NSInteger);
#[method_id(@__retain_semantics Other elementKind)]
pub unsafe fn elementKind(&self) -> Id<NSString, Shared>;
#[method_id(@__retain_semantics Other containerAnchor)]
pub unsafe fn containerAnchor(&self) -> Id<NSCollectionLayoutAnchor, Shared>;
#[method_id(@__retain_semantics Other itemAnchor)]
pub unsafe fn itemAnchor(&self) -> Option<Id<NSCollectionLayoutAnchor, Shared>>;
}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSCollectionLayoutBoundarySupplementaryItem;
unsafe impl ClassType for NSCollectionLayoutBoundarySupplementaryItem {
#[inherits(NSCollectionLayoutItem, NSObject)]
type Super = NSCollectionLayoutSupplementaryItem;
}
);
extern_methods!(
unsafe impl NSCollectionLayoutBoundarySupplementaryItem {
#[method_id(@__retain_semantics Other boundarySupplementaryItemWithLayoutSize:elementKind:alignment:)]
pub unsafe fn boundarySupplementaryItemWithLayoutSize_elementKind_alignment(
layoutSize: &NSCollectionLayoutSize,
elementKind: &NSString,
alignment: NSRectAlignment,
) -> Id<Self, Shared>;
#[method_id(@__retain_semantics Other boundarySupplementaryItemWithLayoutSize:elementKind:alignment:absoluteOffset:)]
pub unsafe fn boundarySupplementaryItemWithLayoutSize_elementKind_alignment_absoluteOffset(
layoutSize: &NSCollectionLayoutSize,
elementKind: &NSString,
alignment: NSRectAlignment,
absoluteOffset: NSPoint,
) -> Id<Self, Shared>;
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Option<Allocated<Self>>) -> Id<Self, Shared>;
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Id<Self, Shared>;
#[method(extendsBoundary)]
pub unsafe fn extendsBoundary(&self) -> bool;
#[method(setExtendsBoundary:)]
pub unsafe fn setExtendsBoundary(&self, extendsBoundary: bool);
#[method(pinToVisibleBounds)]
pub unsafe fn pinToVisibleBounds(&self) -> bool;
#[method(setPinToVisibleBounds:)]
pub unsafe fn setPinToVisibleBounds(&self, pinToVisibleBounds: bool);
#[method(alignment)]
pub unsafe fn alignment(&self) -> NSRectAlignment;
#[method(offset)]
pub unsafe fn offset(&self) -> NSPoint;
}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSCollectionLayoutDecorationItem;
unsafe impl ClassType for NSCollectionLayoutDecorationItem {
#[inherits(NSObject)]
type Super = NSCollectionLayoutItem;
}
);
extern_methods!(
unsafe impl NSCollectionLayoutDecorationItem {
#[method_id(@__retain_semantics Other backgroundDecorationItemWithElementKind:)]
pub unsafe fn backgroundDecorationItemWithElementKind(
elementKind: &NSString,
) -> Id<Self, Shared>;
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Option<Allocated<Self>>) -> Id<Self, Shared>;
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Id<Self, Shared>;
#[method(zIndex)]
pub unsafe fn zIndex(&self) -> NSInteger;
#[method(setZIndex:)]
pub unsafe fn setZIndex(&self, zIndex: NSInteger);
#[method_id(@__retain_semantics Other elementKind)]
pub unsafe fn elementKind(&self) -> Id<NSString, Shared>;
}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSCollectionLayoutAnchor;
unsafe impl ClassType for NSCollectionLayoutAnchor {
type Super = NSObject;
}
);
extern_methods!(
unsafe impl NSCollectionLayoutAnchor {
#[method_id(@__retain_semantics Other layoutAnchorWithEdges:)]
pub unsafe fn layoutAnchorWithEdges(edges: NSDirectionalRectEdge) -> Id<Self, Shared>;
#[method_id(@__retain_semantics Other layoutAnchorWithEdges:absoluteOffset:)]
pub unsafe fn layoutAnchorWithEdges_absoluteOffset(
edges: NSDirectionalRectEdge,
absoluteOffset: NSPoint,
) -> Id<Self, Shared>;
#[method_id(@__retain_semantics Other layoutAnchorWithEdges:fractionalOffset:)]
pub unsafe fn layoutAnchorWithEdges_fractionalOffset(
edges: NSDirectionalRectEdge,
fractionalOffset: NSPoint,
) -> Id<Self, Shared>;
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Option<Allocated<Self>>) -> Id<Self, Shared>;
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Id<Self, Shared>;
#[method(edges)]
pub unsafe fn edges(&self) -> NSDirectionalRectEdge;
#[method(offset)]
pub unsafe fn offset(&self) -> NSPoint;
#[method(isAbsoluteOffset)]
pub unsafe fn isAbsoluteOffset(&self) -> bool;
#[method(isFractionalOffset)]
pub unsafe fn isFractionalOffset(&self) -> bool;
}
);
extern_protocol!(
pub struct NSCollectionLayoutContainer;
unsafe impl ProtocolType for NSCollectionLayoutContainer {
#[method(contentSize)]
pub unsafe fn contentSize(&self) -> NSSize;
#[method(effectiveContentSize)]
pub unsafe fn effectiveContentSize(&self) -> NSSize;
#[method(contentInsets)]
pub unsafe fn contentInsets(&self) -> NSDirectionalEdgeInsets;
#[method(effectiveContentInsets)]
pub unsafe fn effectiveContentInsets(&self) -> NSDirectionalEdgeInsets;
}
);
extern_protocol!(
pub struct NSCollectionLayoutEnvironment;
unsafe impl ProtocolType for NSCollectionLayoutEnvironment {
#[method_id(@__retain_semantics Other container)]
pub unsafe fn container(&self) -> Id<NSCollectionLayoutContainer, Shared>;
}
);
extern_protocol!(
pub struct NSCollectionLayoutVisibleItem;
unsafe impl ProtocolType for NSCollectionLayoutVisibleItem {
#[method(alpha)]
pub unsafe fn alpha(&self) -> CGFloat;
#[method(setAlpha:)]
pub unsafe fn setAlpha(&self, alpha: CGFloat);
#[method(zIndex)]
pub unsafe fn zIndex(&self) -> NSInteger;
#[method(setZIndex:)]
pub unsafe fn setZIndex(&self, zIndex: NSInteger);
#[method(isHidden)]
pub unsafe fn isHidden(&self) -> bool;
#[method(setHidden:)]
pub unsafe fn setHidden(&self, hidden: bool);
#[method(center)]
pub unsafe fn center(&self) -> NSPoint;
#[method(setCenter:)]
pub unsafe fn setCenter(&self, center: NSPoint);
#[method_id(@__retain_semantics Other name)]
pub unsafe fn name(&self) -> Id<NSString, Shared>;
#[method_id(@__retain_semantics Other indexPath)]
pub unsafe fn indexPath(&self) -> Id<NSIndexPath, Shared>;
#[method(frame)]
pub unsafe fn frame(&self) -> NSRect;
#[method(bounds)]
pub unsafe fn bounds(&self) -> NSRect;
#[method(representedElementCategory)]
pub unsafe fn representedElementCategory(&self) -> NSCollectionElementCategory;
#[method_id(@__retain_semantics Other representedElementKind)]
pub unsafe fn representedElementKind(&self) -> Option<Id<NSString, Shared>>;
}
);
extern_methods!(
unsafe impl NSCollectionLayoutGroup {
#[method_id(@__retain_semantics Other itemWithLayoutSize:)]
pub unsafe fn itemWithLayoutSize(layoutSize: &NSCollectionLayoutSize) -> Id<Self, Shared>;
#[method_id(@__retain_semantics Other itemWithLayoutSize:supplementaryItems:)]
pub unsafe fn itemWithLayoutSize_supplementaryItems(
layoutSize: &NSCollectionLayoutSize,
supplementaryItems: &NSArray<NSCollectionLayoutSupplementaryItem>,
) -> Id<Self, Shared>;
}
);
extern_methods!(
unsafe impl NSCollectionLayoutSupplementaryItem {
#[method_id(@__retain_semantics Other itemWithLayoutSize:)]
pub unsafe fn itemWithLayoutSize(layoutSize: &NSCollectionLayoutSize) -> Id<Self, Shared>;
#[method_id(@__retain_semantics Other itemWithLayoutSize:supplementaryItems:)]
pub unsafe fn itemWithLayoutSize_supplementaryItems(
layoutSize: &NSCollectionLayoutSize,
supplementaryItems: &NSArray<NSCollectionLayoutSupplementaryItem>,
) -> Id<Self, Shared>;
}
);
extern_methods!(
unsafe impl NSCollectionLayoutBoundarySupplementaryItem {
#[method_id(@__retain_semantics Other supplementaryItemWithLayoutSize:elementKind:containerAnchor:)]
pub unsafe fn supplementaryItemWithLayoutSize_elementKind_containerAnchor(
layoutSize: &NSCollectionLayoutSize,
elementKind: &NSString,
containerAnchor: &NSCollectionLayoutAnchor,
) -> Id<Self, Shared>;
#[method_id(@__retain_semantics Other supplementaryItemWithLayoutSize:elementKind:containerAnchor:itemAnchor:)]
pub unsafe fn supplementaryItemWithLayoutSize_elementKind_containerAnchor_itemAnchor(
layoutSize: &NSCollectionLayoutSize,
elementKind: &NSString,
containerAnchor: &NSCollectionLayoutAnchor,
itemAnchor: &NSCollectionLayoutAnchor,
) -> Id<Self, Shared>;
}
);
extern_methods!(
unsafe impl NSCollectionLayoutBoundarySupplementaryItem {
#[method_id(@__retain_semantics Other itemWithLayoutSize:)]
pub unsafe fn itemWithLayoutSize(layoutSize: &NSCollectionLayoutSize) -> Id<Self, Shared>;
#[method_id(@__retain_semantics Other itemWithLayoutSize:supplementaryItems:)]
pub unsafe fn itemWithLayoutSize_supplementaryItems(
layoutSize: &NSCollectionLayoutSize,
supplementaryItems: &NSArray<NSCollectionLayoutSupplementaryItem>,
) -> Id<Self, Shared>;
}
);
extern_methods!(
unsafe impl NSCollectionLayoutDecorationItem {
#[method_id(@__retain_semantics Other itemWithLayoutSize:)]
pub unsafe fn itemWithLayoutSize(layoutSize: &NSCollectionLayoutSize) -> Id<Self, Shared>;
#[method_id(@__retain_semantics Other itemWithLayoutSize:supplementaryItems:)]
pub unsafe fn itemWithLayoutSize_supplementaryItems(
layoutSize: &NSCollectionLayoutSize,
supplementaryItems: &NSArray<NSCollectionLayoutSupplementaryItem>,
) -> Id<Self, Shared>;
}
);