Implemented encoding/decoding

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@7375 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
nico 2000-09-04 22:59:23 +00:00
parent e0fa3900b9
commit d3f3e00f40
2 changed files with 66 additions and 0 deletions

View file

@ -415,4 +415,33 @@
return (_documentView != nil) ? [_documentView becomeFirstResponder] : NO;
}
/*
* NSCoding protocol
*/
- (void) encodeWithCoder: (NSCoder*)aCoder
{
[super encodeWithCoder: aCoder];
[aCoder encodeObject: _backgroundColor];
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_copiesOnScroll];
[aCoder encodeObject: _cursor];
[aCoder encodeObject: _documentView];
}
- (id) initWithCoder: (NSCoder*)aDecoder
{
NSView *document;
self = [super initWithCoder: aDecoder];
[self setAutoresizesSubviews: YES];
[aDecoder decodeValueOfObjCType: @encode(id) at: &_backgroundColor];
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_copiesOnScroll];
[aDecoder decodeValueOfObjCType: @encode(id) at: &_cursor];
document = [aDecoder decodeObject];
[self setDocumentView: document];
return self;
}
@end