mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 15:00:38 +00:00
Added more coding and TODO's for nib coding/decoding.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@23030 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
d567eebe96
commit
158514d6a4
10 changed files with 470 additions and 254 deletions
|
@ -333,46 +333,84 @@
|
|||
{
|
||||
BOOL flag = NO;
|
||||
|
||||
[aCoder encodeValueOfObjCType: @encode(id) at: &filename];
|
||||
[aCoder encodeValueOfObjCType: @encode(id) at: &sourceLinks];
|
||||
[aCoder encodeValueOfObjCType: @encode(id) at: &destinationLinks];
|
||||
|
||||
flag = _flags.areLinkOutlinesVisible;
|
||||
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag];
|
||||
flag = _flags.delegateVerifiesLinks;
|
||||
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag];
|
||||
flag = _flags.interactsWithUser;
|
||||
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag];
|
||||
flag = _flags.isEdited;
|
||||
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag];
|
||||
if([aCoder allowsKeyedCoding])
|
||||
{
|
||||
[aCoder encodeObject: filename forKey: @"GSFilename"];
|
||||
[aCoder encodeObject: sourceLinks forKey: @"GSSourceLinks"];
|
||||
[aCoder encodeObject: destinationLinks forKey: @"GSDestinationLinks"];
|
||||
|
||||
flag = _flags.areLinkOutlinesVisible;
|
||||
[aCoder encodeBool: flag forKey: @"GSAreLinkOutlinesVisible"];
|
||||
flag = _flags.delegateVerifiesLinks;
|
||||
[aCoder encodeBool: flag forKey: @"GSDelegateVerifiesLinks"];
|
||||
flag = _flags.interactsWithUser;
|
||||
[aCoder encodeBool: flag forKey: @"GSInteractsWithUser"];
|
||||
flag = _flags.isEdited;
|
||||
[aCoder encodeBool: flag forKey: @"GSIsEdited"];
|
||||
}
|
||||
else
|
||||
{
|
||||
[aCoder encodeValueOfObjCType: @encode(id) at: &filename];
|
||||
[aCoder encodeValueOfObjCType: @encode(id) at: &sourceLinks];
|
||||
[aCoder encodeValueOfObjCType: @encode(id) at: &destinationLinks];
|
||||
|
||||
flag = _flags.areLinkOutlinesVisible;
|
||||
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag];
|
||||
flag = _flags.delegateVerifiesLinks;
|
||||
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag];
|
||||
flag = _flags.interactsWithUser;
|
||||
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag];
|
||||
flag = _flags.isEdited;
|
||||
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag];
|
||||
}
|
||||
}
|
||||
|
||||
- (id) initWithCoder: (NSCoder*)aCoder
|
||||
{
|
||||
int version = [aCoder versionForClassName: @"NSDataLinkManager"];
|
||||
|
||||
if (version == 0)
|
||||
if([aCoder allowsKeyedCoding])
|
||||
{
|
||||
BOOL flag = NO;
|
||||
id obj;
|
||||
|
||||
obj = [aCoder decodeObjectForKey: @"GSFilename"];
|
||||
ASSIGN(filename,obj);
|
||||
obj = [aCoder decodeObjectForKey: @"GSSourceLinks"];
|
||||
ASSIGN(sourceLinks,obj);
|
||||
obj = [aCoder decodeObjectForKey: @"GSDestinationLinks"];
|
||||
ASSIGN(destinationLinks,obj);
|
||||
|
||||
[aCoder decodeValueOfObjCType: @encode(id) at: &filename];
|
||||
[aCoder decodeValueOfObjCType: @encode(id) at: &sourceLinks];
|
||||
[aCoder decodeValueOfObjCType: @encode(id) at: &destinationLinks];
|
||||
|
||||
[aCoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
|
||||
flag = [aCoder decodeBoolForKey: @"GSAreLinkOutlinesVisible"];
|
||||
_flags.areLinkOutlinesVisible = flag;
|
||||
[aCoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
|
||||
flag = [aCoder decodeBoolForKey: @"GSDelegateVerifiesLinks"];
|
||||
_flags.delegateVerifiesLinks = flag;
|
||||
[aCoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
|
||||
flag = [aCoder decodeBoolForKey: @"GSInteractsWithUser"];
|
||||
_flags.interactsWithUser = flag;
|
||||
[aCoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
|
||||
flag = [aCoder decodeBoolForKey: @"GSIsEdited"];
|
||||
_flags.isEdited = flag;
|
||||
}
|
||||
else
|
||||
{
|
||||
return nil;
|
||||
int version = [aCoder versionForClassName: @"NSDataLinkManager"];
|
||||
if (version == 0)
|
||||
{
|
||||
BOOL flag = NO;
|
||||
|
||||
[aCoder decodeValueOfObjCType: @encode(id) at: &filename];
|
||||
[aCoder decodeValueOfObjCType: @encode(id) at: &sourceLinks];
|
||||
[aCoder decodeValueOfObjCType: @encode(id) at: &destinationLinks];
|
||||
|
||||
[aCoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
|
||||
_flags.areLinkOutlinesVisible = flag;
|
||||
[aCoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
|
||||
_flags.delegateVerifiesLinks = flag;
|
||||
[aCoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
|
||||
_flags.interactsWithUser = flag;
|
||||
[aCoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
|
||||
_flags.isEdited = flag;
|
||||
}
|
||||
else
|
||||
return nil;
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue