mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 15:11:37 +00:00
Archiving fixes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@5518 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
99a03c580b
commit
2d3a5a1ac6
4 changed files with 53 additions and 40 deletions
|
@ -1,3 +1,11 @@
|
|||
Wed Dec 15 11:13:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
||||
|
||||
* Source/NSResponder.m: Don't try to encode/decode next responder -
|
||||
this info should be reconstructed by subclasses.
|
||||
* Source/NSWindow.m: Remove code to save/restore next responder in
|
||||
order to defeat NSResponder archiving.
|
||||
* Source/NSView.m: Rewrite encoding/decoding.
|
||||
|
||||
Tue Dec 14 19:40:12 1999 Nicola Pero <n.pero@mi.flashnet.it>
|
||||
|
||||
* Source/NSBrowserCell.m: Tiny tidings in initialization;
|
||||
|
|
|
@ -248,17 +248,17 @@
|
|||
|
||||
/*
|
||||
* NSCoding protocol
|
||||
* NB. Don't encode responder chanin - it's transient information that should
|
||||
* be reconstructed from elsewhere in the encoded archive.
|
||||
*/
|
||||
- (void) encodeWithCoder: (NSCoder*)aCoder
|
||||
{
|
||||
[aCoder encodeConditionalObject: next_responder];
|
||||
[aCoder encodeValueOfObjCType: @encode(NSInterfaceStyle)
|
||||
at: &interface_style];
|
||||
}
|
||||
|
||||
- (id) initWithCoder: (NSCoder*)aDecoder
|
||||
{
|
||||
next_responder = [aDecoder decodeObject];
|
||||
[aDecoder decodeValueOfObjCType: @encode(NSInterfaceStyle)
|
||||
at: &interface_style];
|
||||
return self;
|
||||
|
|
|
@ -2412,69 +2412,77 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level)
|
|||
*/
|
||||
- (void) encodeWithCoder: (NSCoder*)aCoder
|
||||
{
|
||||
BOOL flag;
|
||||
|
||||
[super encodeWithCoder: aCoder];
|
||||
|
||||
NSDebugLLog(@"NSView", @"NSView: start encoding\n");
|
||||
[aCoder encodeRect: frame];
|
||||
[aCoder encodeRect: bounds];
|
||||
[aCoder encodeConditionalObject: super_view];
|
||||
[aCoder encodeObject: sub_views];
|
||||
[aCoder encodeConditionalObject: window];
|
||||
[aCoder encodeObject: tracking_rects];
|
||||
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &is_rotated_from_base];
|
||||
[aCoder encodeValueOfObjCType: @encode(BOOL)
|
||||
at: &is_rotated_or_scaled_from_base];
|
||||
flag = _rFlags.needs_display;
|
||||
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag];
|
||||
at: &is_rotated_or_scaled_from_base];
|
||||
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &post_frame_changes];
|
||||
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &autoresize_subviews];
|
||||
[aCoder encodeValueOfObjCType: @encode(unsigned int) at: &autoresizingMask];
|
||||
[aCoder encodeConditionalObject: _nextKeyView];
|
||||
[aCoder encodeConditionalObject: _previousKeyView];
|
||||
[aCoder encodeObject: sub_views];
|
||||
NSDebugLLog(@"NSView", @"NSView: finish encoding\n");
|
||||
}
|
||||
|
||||
- (id) initWithCoder: (NSCoder*)aDecoder
|
||||
{
|
||||
BOOL flag;
|
||||
NSRect rect;
|
||||
NSEnumerator *e;
|
||||
NSView *sub;
|
||||
NSArray *subs;
|
||||
|
||||
[super initWithCoder: aDecoder];
|
||||
self = [super initWithCoder: aDecoder];
|
||||
|
||||
NSDebugLLog(@"NSView", @"NSView: start decoding\n");
|
||||
|
||||
frame = [aDecoder decodeRect];
|
||||
bounds = [aDecoder decodeRect];
|
||||
super_view = [aDecoder decodeObject];
|
||||
[aDecoder decodeValueOfObjCType: @encode(id) at: &sub_views];
|
||||
window = [aDecoder decodeObject];
|
||||
[aDecoder decodeValueOfObjCType: @encode(id) at: &tracking_rects];
|
||||
bounds.origin = NSZeroPoint;
|
||||
bounds.size = frame.size;
|
||||
|
||||
frameMatrix = [NSAffineTransform new]; // Map fromsuperview to frame
|
||||
boundsMatrix = [NSAffineTransform new]; // Map fromsuperview to bounds
|
||||
matrixToWindow = [NSAffineTransform new]; // Map to window coordinates
|
||||
matrixFromWindow = [NSAffineTransform new]; // Map from window coordinates
|
||||
[frameMatrix setFrameOrigin: frame.origin];
|
||||
|
||||
rect = [aDecoder decodeRect];
|
||||
[self setBounds: rect];
|
||||
|
||||
sub_views = [NSMutableArray new];
|
||||
tracking_rects = [NSMutableArray new];
|
||||
cursor_rects = [NSMutableArray new];
|
||||
|
||||
super_view = nil;
|
||||
window = nil;
|
||||
_rFlags.needs_display = YES;
|
||||
coordinates_valid = NO;
|
||||
|
||||
_rFlags.flipped_view = [self isFlipped];
|
||||
|
||||
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &is_rotated_from_base];
|
||||
[aDecoder decodeValueOfObjCType: @encode(BOOL)
|
||||
at: &is_rotated_or_scaled_from_base];
|
||||
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
|
||||
_rFlags.needs_display = flag;
|
||||
at: &is_rotated_or_scaled_from_base];
|
||||
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &post_frame_changes];
|
||||
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &autoresize_subviews];
|
||||
[aDecoder decodeValueOfObjCType: @encode(unsigned int) at: &autoresizingMask];
|
||||
[aDecoder decodeValueOfObjCType: @encode(id) at: &_nextKeyView];
|
||||
[aDecoder decodeValueOfObjCType: @encode(id) at: &_previousKeyView];
|
||||
_nextKeyView = [aDecoder decodeObject];
|
||||
_previousKeyView = [aDecoder decodeObject];
|
||||
|
||||
[aDecoder decodeValueOfObjCType: @encode(id) at: &subs];
|
||||
e = [subs objectEnumerator];
|
||||
while ((sub = [e nextObject]) != nil)
|
||||
{
|
||||
[self addSubview: sub];
|
||||
}
|
||||
RELEASE(subs);
|
||||
|
||||
NSDebugLLog(@"NSView", @"NSView: finish decoding\n");
|
||||
|
||||
frameMatrix = [NSAffineTransform new];
|
||||
boundsMatrix = [NSAffineTransform new];
|
||||
matrixToWindow = [NSAffineTransform new];
|
||||
matrixFromWindow = [NSAffineTransform new];
|
||||
[frameMatrix setFrameOrigin: frame.origin];
|
||||
|
||||
/*
|
||||
* Keep a note of whether this is a flipped view or not.
|
||||
*/
|
||||
_rFlags.flipped_view = [self isFlipped];
|
||||
|
||||
if ([sub_views count])
|
||||
_rFlags.has_subviews = 1;
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
|
|
|
@ -2769,8 +2769,6 @@ resetCursorRectsForView(NSView *theView)
|
|||
NSPoint p;
|
||||
id nxt = RETAIN([self nextResponder]);
|
||||
|
||||
[self setNextResponder: nil];
|
||||
|
||||
[super encodeWithCoder: aCoder];
|
||||
|
||||
NSDebugLog(@"NSWindow: start encoding\n");
|
||||
|
@ -2815,7 +2813,6 @@ resetCursorRectsForView(NSView *theView)
|
|||
|
||||
NSDebugLog(@"NSWindow: finish encoding\n");
|
||||
|
||||
[self setNextResponder: nxt];
|
||||
RELEASE(nxt);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue