libs-gui/Source/NSCollectionViewFlowLayout.m
Gregory John Casamento 8572458a5d Add methods and actions for layout classes as well as the abstract classes for NSCollectionViewLayout.
Declarations added to collectionview layout header.

Clean compile for NSCollectionViewLayout abstract class

Add header for NSCollectionViewFlowLayout.h

Add skeleton implementation of NSCollectionViewFlowLayout

Add implementation for simple setter/getter methods.

Correct compilation error with non-clang compilers

Fix compilation issues

Add getter/setter for collectionViewLayout

Skeleton of NSCollectionViewTransitionLayout implementation

Add encoding/decoding for collectionViewLayout key

Make NSCollectionViewGridLayout default if the NSCollectionViewLayoutKey is not set

Add protocols for DataSource and Prefetching for NSCollectionView

Add 10.11 methods to delegate declaration

remove templating from NSCollectionViewDelegate that gcc can't handle.

New delegate methods for NSCollectionViewDelegate to support NSSets of NSIndexPaths and multiple selection.

Reset .travis.yml to the proper version and modify NSCollectionView.h to use forward declarations for both NSPasteboard and NSPasteboardWriting so that we don't explicitly import.

Add declarations for missing methods from 10.11 version of NSCollectionView

Add new methods for 10.11 for moving, deleting and collapsing sections.

Add new methods from 10.11

Add the remaining missing methods as well as delcarations for blocks needed for batch handler and completion handler.

Add skeleton implementations for all new methods

Changes to add new methods to collection view for delegate

Consolidate the registeredClass and registeredNib maps.

Implementation of dataSource related methods

Implment nib loading for NSCollectionViewItem subclasses

Remove uneeded ivars, add categories for override and layout

Minor formatting change

Update categories and organization of code

Add init method to NSCollectionViewFlowLayoutInvalidationContext

Add collectionview layout subclasses

Declarations added to collectionview layout header.

Clean compile for NSCollectionViewLayout abstract class

Add skeleton implementation of NSCollectionViewFlowLayout

Add implementation for simple setter/getter methods.

Correct compilation error with non-clang compilers

Fix compilation issues

Add getter/setter for collectionViewLayout

Add encoding/decoding for collectionViewLayout key

Make NSCollectionViewGridLayout default if the NSCollectionViewLayoutKey is not set

Add protocols for DataSource and Prefetching for NSCollectionView

New delegate methods for NSCollectionViewDelegate to support NSSets of NSIndexPaths and multiple selection.

Reset .travis.yml to the proper version and modify NSCollectionView.h to use forward declarations for both NSPasteboard and NSPasteboardWriting so that we don't explicitly import.

Add declarations for missing methods from 10.11 version of NSCollectionView

Add new methods for 10.11 for moving, deleting and collapsing sections.

Add new methods from 10.11

Changes to add new methods to collection view for delegate

Consolidate the registeredClass and registeredNib maps.

Add init method to NSCollectionViewFlowLayoutInvalidationContext

Fix issues with rebase
2023-01-30 10:48:02 -05:00

178 lines
3.4 KiB
Objective-C

/* Implementation of class NSCollectionViewFlowLayout
Copyright (C) 2021 Free Software Foundation, Inc.
By: Gregory John Casamento
Date: 30-05-2021
This file is part of the GNUstep Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110 USA.
*/
#import "AppKit/NSCollectionViewFlowLayout.h"
@implementation NSCollectionViewFlowLayoutInvalidationContext
- (instancetype) init
{
self = [super init];
if (self != nil)
{
_invalidateFlowLayoutAttributes = YES;
_invalidateFlowLayoutDelegateMetrics = YES;
}
return self;
}
- (void) setInvalidateFlowLayoutDelegateMetrics: (BOOL)flag
{
_invalidateFlowLayoutDelegateMetrics = flag;
}
- (BOOL) invalidateFlowLayoutDelegateMetrics
{
return _invalidateFlowLayoutDelegateMetrics;
}
- (void) setInvalidateFlowLayoutAttributes: (BOOL)flag
{
_invalidateFlowLayoutAttributes = flag;
}
- (BOOL) invalidateFlowLayoutAttributes
{
return _invalidateFlowLayoutAttributes;
}
@end
@implementation NSCollectionViewFlowLayout
- (CGFloat) minimumLineSpacing
{
return _minimumLineSpacing;
}
- (void) setMinimumLineSpacing: (CGFloat)spacing
{
_minimumLineSpacing = spacing;
}
- (CGFloat) minimumInteritemSpacing
{
return _minimumInteritemSpacing;
}
- (void) setMinimumInteritemSpacing: (CGFloat)spacing
{
_minimumInteritemSpacing = spacing;
}
- (NSSize) itemSize
{
return _itemSize;
}
- (void) setItemSize: (NSSize)itemSize
{
_itemSize = itemSize;
}
- (NSSize) estimatedItemSize
{
return _estimatedItemSize;
}
- (void) setEstimatedItemSize: (NSSize)size
{
_estimatedItemSize = size;
}
- (NSCollectionViewScrollDirection) scrollDirection
{
return _scrollDirection;
}
- (void) setScrollDirection: (NSCollectionViewScrollDirection)direction
{
_scrollDirection = direction;
}
- (NSSize) headerReferenceSize
{
return _headerReferenceSize;
}
- (void) setHeaderReferenceSize: (NSSize)size
{
_headerReferenceSize = size;
}
- (NSSize) footerReferenceSize
{
return _footerReferenceSize;
}
- (void) setFooterReferenceSize: (NSSize)size
{
_footerReferenceSize = size;
}
- (NSEdgeInsets) sectionInset
{
return _sectionInset;
}
- (void) setSectionInset: (NSEdgeInsets)inset
{
_sectionInset = inset;
}
- (BOOL) sectionHeadersPinToVisibleBounds
{
return _sectionHeadersPinToVisibleBounds;
}
- (void) setSectionHeadersPinToVisibleBounds: (BOOL)f
{
_sectionHeadersPinToVisibleBounds = f;
}
- (BOOL) sectionFootersPinToVisibleBounds
{
return _sectionFootersPinToVisibleBounds;
}
- (void) setSectionFootersPinToVisibleBounds: (BOOL)f
{
_sectionFootersPinToVisibleBounds = f;
}
- (BOOL) sectionAtIndexIsCollapsed: (NSUInteger)sectionIndex
{
return NO;
}
- (void) collapseSectionAtIndex: (NSUInteger)sectionIndex
{
}
- (void) expandSectionAtIndex: (NSUInteger)sectionIndex
{
}
@end