mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 16:00:37 +00:00
Change encode/init to use encode/decode functions to handle integers
This commit is contained in:
parent
f7730c97d3
commit
d6b78ff06e
1 changed files with 24 additions and 0 deletions
|
@ -24,6 +24,8 @@
|
||||||
|
|
||||||
#import "AppKit/NSCollectionViewGridLayout.h"
|
#import "AppKit/NSCollectionViewGridLayout.h"
|
||||||
|
|
||||||
|
#import "GSGuiPrivate.h"
|
||||||
|
|
||||||
@implementation NSCollectionViewGridLayout
|
@implementation NSCollectionViewGridLayout
|
||||||
|
|
||||||
- (id) initWithCoder: (NSCoder *)coder
|
- (id) initWithCoder: (NSCoder *)coder
|
||||||
|
@ -81,6 +83,17 @@
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
decode_NSUInteger(coder, &_maximumNumberOfRows);
|
||||||
|
decode_NSUInteger(coder, &_maximumNumberOfColumns);
|
||||||
|
|
||||||
|
_maximumItemSize = [coder decodeSize];
|
||||||
|
_minimumItemSize = [coder decodeSize];
|
||||||
|
|
||||||
|
[coder decodeValueOfObjCType: @encode(CGFloat) at: &_minimumInteritemSpacing];
|
||||||
|
[coder decodeValueOfObjCType: @encode(CGFloat) at: &_margins.bottom];
|
||||||
|
[coder decodeValueOfObjCType: @encode(CGFloat) at: &_margins.top];
|
||||||
|
[coder decodeValueOfObjCType: @encode(CGFloat) at: &_margins.left];
|
||||||
|
[coder decodeValueOfObjCType: @encode(CGFloat) at: &_margins.right];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
|
@ -114,6 +127,17 @@
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
encode_NSUInteger(coder, &_maximumNumberOfRows);
|
||||||
|
encode_NSUInteger(coder, &_maximumNumberOfColumns);
|
||||||
|
|
||||||
|
[coder encodeSize: _maximumItemSize];
|
||||||
|
[coder encodeSize: _minimumItemSize];
|
||||||
|
|
||||||
|
[coder encodeValueOfObjCType: @encode(CGFloat) at: &_minimumInteritemSpacing];
|
||||||
|
[coder encodeValueOfObjCType: @encode(CGFloat) at: &_margins.bottom];
|
||||||
|
[coder encodeValueOfObjCType: @encode(CGFloat) at: &_margins.top];
|
||||||
|
[coder encodeValueOfObjCType: @encode(CGFloat) at: &_margins.left];
|
||||||
|
[coder encodeValueOfObjCType: @encode(CGFloat) at: &_margins.right];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue