mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-20 17:36:23 +00:00
Added keyed decoding.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@18530 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
2c97e5fa28
commit
afabdddd55
7 changed files with 171 additions and 61 deletions
|
@ -374,12 +374,34 @@ scaleProportionally(NSSize imageSize, NSRect canvasRect)
|
|||
|
||||
- (id) initWithCoder: (NSCoder *)aDecoder
|
||||
{
|
||||
[super initWithCoder: aDecoder];
|
||||
self = [super initWithCoder: aDecoder];
|
||||
|
||||
[aDecoder decodeValueOfObjCType: @encode(NSImageAlignment) at: &_imageAlignment];
|
||||
[aDecoder decodeValueOfObjCType: @encode(NSImageFrameStyle) at: &_frameStyle];
|
||||
[aDecoder decodeValueOfObjCType: @encode(NSImageScaling) at: &_imageScaling];
|
||||
_original_image_size = [aDecoder decodeSize];
|
||||
if ([aDecoder allowsKeyedCoding])
|
||||
{
|
||||
if ([aDecoder containsValueForKey: @"NSAlign"])
|
||||
{
|
||||
[self setImageAlignment: [aDecoder decodeIntForKey: @"NSAlign"]];
|
||||
}
|
||||
if ([aDecoder containsValueForKey: @"NSScale"])
|
||||
{
|
||||
[self setImageScaling: [aDecoder decodeIntForKey: @"NSScale"]];
|
||||
}
|
||||
if ([aDecoder containsValueForKey: @"NSStyle"])
|
||||
{
|
||||
[self setImageFrameStyle: [aDecoder decodeIntForKey: @"NSStyle"]];
|
||||
}
|
||||
if ([aDecoder containsValueForKey: @"NSAnimates"])
|
||||
{
|
||||
//BOOL animates = [aDecoder decodeBoolForKey: @"NSAnimates"];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
[aDecoder decodeValueOfObjCType: @encode(NSImageAlignment) at: &_imageAlignment];
|
||||
[aDecoder decodeValueOfObjCType: @encode(NSImageFrameStyle) at: &_frameStyle];
|
||||
[aDecoder decodeValueOfObjCType: @encode(NSImageScaling) at: &_imageScaling];
|
||||
_original_image_size = [aDecoder decodeSize];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue