mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 20:10:47 +00:00
Correction for GSNibCompatibility. Added coding to classes for keyed archiving.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@23225 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
2998c54fed
commit
1a8528922e
11 changed files with 227 additions and 91 deletions
14
ChangeLog
14
ChangeLog
|
@ -1,3 +1,17 @@
|
||||||
|
2006-08-08 21:33-EDT Gregory John Casamento <greg_casamento@yahoo.com>
|
||||||
|
|
||||||
|
* Headers/Additions/GNUstepGUI/GSNibCompatibility.h
|
||||||
|
* Source/GSNibCompatibility.m: Fix for window size issue caused
|
||||||
|
by previous change.
|
||||||
|
* Source/NSBitmapImageRep.m
|
||||||
|
* Source/NSBox.m
|
||||||
|
* Source/NSButtonCell.m
|
||||||
|
* Source/NSCachedImageRep.m
|
||||||
|
* Source/NSImage.m
|
||||||
|
* Source/NSTabViewItem.m
|
||||||
|
* Source/NSTabView.m
|
||||||
|
* Source/NSTextFieldCell.m: Added encoding in encodeWithCoder:
|
||||||
|
|
||||||
2006-08-09 Fred Kiefer <FredKiefer@gmx.de>
|
2006-08-09 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
* Headers/AppKit/NSStepper.h
|
* Headers/AppKit/NSStepper.h
|
||||||
|
|
|
@ -82,6 +82,17 @@ typedef struct _GSWindowTemplateFlags
|
||||||
@interface NSIBHelpConnector : NSNibConnector
|
@interface NSIBHelpConnector : NSNibConnector
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Button image source class.
|
||||||
|
*/
|
||||||
|
@interface NSButtonImageSource : NSObject <NSCoding>
|
||||||
|
{
|
||||||
|
NSString *imageName;
|
||||||
|
}
|
||||||
|
- (id) initWithImageNamed: (NSString *)name;
|
||||||
|
- (NSString *)imageName;
|
||||||
|
@end
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class acts as a placeholder for the window. It doesn't derive from
|
* This class acts as a placeholder for the window. It doesn't derive from
|
||||||
* NSWindow for two reasons. First, it shouldn't instantiate a window immediately
|
* NSWindow for two reasons. First, it shouldn't instantiate a window immediately
|
||||||
|
|
|
@ -186,7 +186,7 @@ static BOOL _isInInterfaceBuilder = NO;
|
||||||
}
|
}
|
||||||
if ([coder containsValueForKey: @"NSWindowRect"])
|
if ([coder containsValueForKey: @"NSWindowRect"])
|
||||||
{
|
{
|
||||||
_windowRect = [coder decodeRectForKey: @"NSWindowRect"];
|
_windowRect = [coder decodeRectForKey: @"NSWindowRect"];
|
||||||
}
|
}
|
||||||
if ([coder containsValueForKey: @"NSFrameAutosaveName"])
|
if ([coder containsValueForKey: @"NSFrameAutosaveName"])
|
||||||
{
|
{
|
||||||
|
@ -214,7 +214,8 @@ static BOOL _isInInterfaceBuilder = NO;
|
||||||
if ([aCoder allowsKeyedCoding])
|
if ([aCoder allowsKeyedCoding])
|
||||||
{
|
{
|
||||||
unsigned long flags = 0;
|
unsigned long flags = 0;
|
||||||
|
NSRect rect = [NSWindow contentRectForFrameRect: _windowRect
|
||||||
|
styleMask: _windowStyle];
|
||||||
memcpy((void *)&flags,(void *)&_flags,sizeof(unsigned long));
|
memcpy((void *)&flags,(void *)&_flags,sizeof(unsigned long));
|
||||||
|
|
||||||
[aCoder encodeObject: _viewClass forKey: @"NSViewClass"];
|
[aCoder encodeObject: _viewClass forKey: @"NSViewClass"];
|
||||||
|
@ -225,7 +226,7 @@ static BOOL _isInInterfaceBuilder = NO;
|
||||||
[aCoder encodeInt: flags forKey: @"NSWTFlags"];
|
[aCoder encodeInt: flags forKey: @"NSWTFlags"];
|
||||||
[aCoder encodeSize: _minSize forKey: @"NSMinSize"];
|
[aCoder encodeSize: _minSize forKey: @"NSMinSize"];
|
||||||
[aCoder encodeSize: _maxSize forKey: @"NSMaxSize"];
|
[aCoder encodeSize: _maxSize forKey: @"NSMaxSize"];
|
||||||
[aCoder encodeRect: _windowRect forKey: @"NSWindowRect"];
|
[aCoder encodeRect: rect forKey: @"NSWindowRect"];
|
||||||
[aCoder encodeObject: _title forKey: @"NSWindowTitle"];
|
[aCoder encodeObject: _title forKey: @"NSWindowTitle"];
|
||||||
[aCoder encodeObject: _autosaveName forKey: @"NSFrameAutosaveName"];
|
[aCoder encodeObject: _autosaveName forKey: @"NSFrameAutosaveName"];
|
||||||
}
|
}
|
||||||
|
@ -283,9 +284,10 @@ static BOOL _isInInterfaceBuilder = NO;
|
||||||
[_view _fixSubviews];
|
[_view _fixSubviews];
|
||||||
|
|
||||||
// resize the window...
|
// resize the window...
|
||||||
[_realObject setFrame: [self windowRect]
|
[_realObject setFrame: [NSWindow frameRectForContentRect: [self windowRect]
|
||||||
|
styleMask: [self windowStyle]]
|
||||||
display: NO];
|
display: NO];
|
||||||
|
|
||||||
// swap out any views which need to be swapped...
|
// swap out any views which need to be swapped...
|
||||||
en = [[[_realObject contentView] subviews] objectEnumerator];
|
en = [[[_realObject contentView] subviews] objectEnumerator];
|
||||||
while((v = [en nextObject]) != nil)
|
while((v = [en nextObject]) != nil)
|
||||||
|
@ -1386,13 +1388,6 @@ static BOOL _isInInterfaceBuilder = NO;
|
||||||
}
|
}
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface NSButtonImageSource : NSObject <NSCoding>
|
|
||||||
{
|
|
||||||
NSString *imageName;
|
|
||||||
}
|
|
||||||
- (NSString *)imageName;
|
|
||||||
@end
|
|
||||||
|
|
||||||
@implementation NSButtonImageSource
|
@implementation NSButtonImageSource
|
||||||
- (id) initWithCoder: (NSCoder *)coder
|
- (id) initWithCoder: (NSCoder *)coder
|
||||||
{
|
{
|
||||||
|
@ -1425,6 +1420,15 @@ static BOOL _isInInterfaceBuilder = NO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (id) initWithImageNamed: (NSString *)name
|
||||||
|
{
|
||||||
|
if((self = [super init]) != nil)
|
||||||
|
{
|
||||||
|
ASSIGN(imageName,name);
|
||||||
|
}
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
- (NSString *)imageName
|
- (NSString *)imageName
|
||||||
{
|
{
|
||||||
return imageName;
|
return imageName;
|
||||||
|
|
|
@ -948,7 +948,14 @@ static BOOL supports_lzw_compression = NO;
|
||||||
NSData *data = [self TIFFRepresentation];
|
NSData *data = [self TIFFRepresentation];
|
||||||
|
|
||||||
[super encodeWithCoder: aCoder];
|
[super encodeWithCoder: aCoder];
|
||||||
[aCoder encodeObject: data];
|
if([aCoder allowsKeyedCoding])
|
||||||
|
{
|
||||||
|
[aCoder encodeObject: data forKey: @"NSTIFFRepresentation"];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
[aCoder encodeObject: data];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id) initWithCoder: (NSCoder*)aDecoder
|
- (id) initWithCoder: (NSCoder*)aDecoder
|
||||||
|
|
|
@ -479,12 +479,24 @@
|
||||||
{
|
{
|
||||||
[super encodeWithCoder: aCoder];
|
[super encodeWithCoder: aCoder];
|
||||||
|
|
||||||
[aCoder encodeObject: _cell];
|
if ([aCoder allowsKeyedCoding])
|
||||||
[aCoder encodeSize: _offsets];
|
{
|
||||||
[aCoder encodeValueOfObjCType: @encode(NSBorderType) at: &_border_type];
|
[aCoder encodeObject: [self contentView] forKey: @"NSContentView"];
|
||||||
[aCoder encodeValueOfObjCType: @encode(NSTitlePosition) at: &_title_position];
|
[aCoder encodeObject: _cell forKey: @"NSTitleCell"];
|
||||||
// NB: the content view is our (only) subview, so it is already
|
[aCoder encodeInt: [self borderType] forKey: @"NSBorderType"];
|
||||||
// encoded by NSView.
|
[aCoder encodeInt: [self titlePosition] forKey: @"NSTitlePosition"];
|
||||||
|
[aCoder encodeBool: NO forKey: @"NSTransparent"];
|
||||||
|
[aCoder encodeSize: [self contentViewMargins] forKey: @"NSOffsets"];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
[aCoder encodeObject: _cell];
|
||||||
|
[aCoder encodeSize: _offsets];
|
||||||
|
[aCoder encodeValueOfObjCType: @encode(NSBorderType) at: &_border_type];
|
||||||
|
[aCoder encodeValueOfObjCType: @encode(NSTitlePosition) at: &_title_position];
|
||||||
|
// NB: the content view is our (only) subview, so it is already
|
||||||
|
// encoded by NSView.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id) initWithCoder: (NSCoder*)aDecoder
|
- (id) initWithCoder: (NSCoder*)aDecoder
|
||||||
|
|
|
@ -52,6 +52,7 @@
|
||||||
#include "AppKit/NSSound.h"
|
#include "AppKit/NSSound.h"
|
||||||
#include "AppKit/NSWindow.h"
|
#include "AppKit/NSWindow.h"
|
||||||
#include "GNUstepGUI/GSDrawFunctions.h"
|
#include "GNUstepGUI/GSDrawFunctions.h"
|
||||||
|
#include "GNUstepGUI/GSNibCompatibility.h"
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
|
@ -1449,6 +1450,8 @@ typedef struct _GSButtonCellFlags
|
||||||
GSButtonCellFlags buttonCellFlags;
|
GSButtonCellFlags buttonCellFlags;
|
||||||
unsigned int bFlags = 0;
|
unsigned int bFlags = 0;
|
||||||
unsigned int bFlags2 = 0;
|
unsigned int bFlags2 = 0;
|
||||||
|
NSImage *image = nil;
|
||||||
|
NSButtonImageSource *bi = nil;
|
||||||
|
|
||||||
[aCoder encodeObject: [self keyEquivalent] forKey: @"NSKeyEquivalent"];
|
[aCoder encodeObject: [self keyEquivalent] forKey: @"NSKeyEquivalent"];
|
||||||
[aCoder encodeObject: [self image] forKey: @"NSNormalImage"];
|
[aCoder encodeObject: [self image] forKey: @"NSNormalImage"];
|
||||||
|
@ -1469,6 +1472,25 @@ typedef struct _GSButtonCellFlags
|
||||||
bFlags2 != [self showsBorderOnlyWhileMouseInside] ? 0x8 : 0;
|
bFlags2 != [self showsBorderOnlyWhileMouseInside] ? 0x8 : 0;
|
||||||
bFlags2 |= [self bezelStyle];
|
bFlags2 |= [self bezelStyle];
|
||||||
[aCoder encodeInt: bFlags2 forKey: @"NSButtonFlags2"];
|
[aCoder encodeInt: bFlags2 forKey: @"NSButtonFlags2"];
|
||||||
|
|
||||||
|
// alternate image encoding...
|
||||||
|
image = [self image];
|
||||||
|
if ([image isKindOfClass: [NSImage class]])
|
||||||
|
{
|
||||||
|
if([NSImage imageNamed: @"NSSwitch"] == image)
|
||||||
|
{
|
||||||
|
bi = [[NSButtonImageSource alloc] initWithImageNamed: @"NSHighlightedSwitch"];
|
||||||
|
}
|
||||||
|
else if([NSImage imageNamed: @"NSRadioButton"] == image)
|
||||||
|
{
|
||||||
|
bi = [[NSButtonImageSource alloc] initWithImageNamed: @"NSHighlightedRadioButton"];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
[aCoder encodeObject: bi forKey: @"NSAlternateImage"];
|
||||||
|
|
||||||
|
// repeat and delay
|
||||||
|
[aCoder encodeFloat: _delayInterval forKey: @"NSPeriodicDelay"];
|
||||||
|
[aCoder encodeFloat: _repeatInterval forKey: @"NSPeriodicInterval"];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -167,16 +167,21 @@
|
||||||
- (void) encodeWithCoder: (NSCoder*)aCoder
|
- (void) encodeWithCoder: (NSCoder*)aCoder
|
||||||
{
|
{
|
||||||
[super encodeWithCoder: aCoder];
|
[super encodeWithCoder: aCoder];
|
||||||
[aCoder encodeObject: _window];
|
if([aCoder allowsKeyedCoding] == NO)
|
||||||
[aCoder encodeRect: _rect];
|
{
|
||||||
|
[aCoder encodeObject: _window];
|
||||||
|
[aCoder encodeRect: _rect];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id) initWithCoder: (NSCoder*)aDecoder
|
- (id) initWithCoder: (NSCoder*)aDecoder
|
||||||
{
|
{
|
||||||
self = [super initWithCoder: aDecoder];
|
self = [super initWithCoder: aDecoder];
|
||||||
[aDecoder decodeValueOfObjCType: @encode(id) at: &_window];
|
if([aDecoder allowsKeyedCoding] == NO)
|
||||||
_rect = [aDecoder decodeRect];
|
{
|
||||||
|
[aDecoder decodeValueOfObjCType: @encode(id) at: &_window];
|
||||||
|
_rect = [aDecoder decodeRect];
|
||||||
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
126
Source/NSImage.m
126
Source/NSImage.m
|
@ -1479,63 +1479,93 @@ repd_for_rep(NSArray *_reps, NSImageRep *rep)
|
||||||
{
|
{
|
||||||
BOOL flag;
|
BOOL flag;
|
||||||
|
|
||||||
flag = _flags.archiveByName;
|
if([coder allowsKeyedCoding])
|
||||||
[coder encodeValueOfObjCType: @encode(BOOL) at: &flag];
|
|
||||||
if (flag == YES)
|
|
||||||
{
|
{
|
||||||
/*
|
// FIXME: Not sure this is the way it goes...
|
||||||
* System image - just encode the name.
|
if(_flags.archiveByName == NO)
|
||||||
*/
|
{
|
||||||
[coder encodeValueOfObjCType: @encode(id) at: &_name];
|
NSMutableArray *container = [NSMutableArray array];
|
||||||
|
NSMutableArray *reps = [NSMutableArray array];
|
||||||
|
NSEnumerator *en = [_reps objectEnumerator];
|
||||||
|
GSRepData *rd = nil;
|
||||||
|
|
||||||
|
// add the reps to the container...
|
||||||
|
[container addObject: reps];
|
||||||
|
while((rd = [en nextObject]) != nil)
|
||||||
|
{
|
||||||
|
[reps addObject: rd->rep];
|
||||||
|
}
|
||||||
|
[coder encodeObject: container forKey: @"NSReps"];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
[coder encodeObject: _name forKey: @"NSImageName"];
|
||||||
|
}
|
||||||
|
|
||||||
|
// encode the rest...
|
||||||
|
[coder encodeObject: _color forKey: @"NSColor"];
|
||||||
|
[coder encodeInt: 0 forKey: @"NSImageFlags"]; // zero...
|
||||||
|
[coder encodeSize: _size forKey: @"NSSize"];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
NSMutableArray *a;
|
flag = _flags.archiveByName;
|
||||||
NSEnumerator *e;
|
|
||||||
NSImageRep *r;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Normal image - encode the ivars
|
|
||||||
*/
|
|
||||||
[coder encodeValueOfObjCType: @encode(NSSize) at: &_size];
|
|
||||||
[coder encodeValueOfObjCType: @encode(id) at: &_color];
|
|
||||||
flag = _flags.scalable;
|
|
||||||
[coder encodeValueOfObjCType: @encode(BOOL) at: &flag];
|
[coder encodeValueOfObjCType: @encode(BOOL) at: &flag];
|
||||||
flag = _flags.dataRetained;
|
if (flag == YES)
|
||||||
[coder encodeValueOfObjCType: @encode(BOOL) at: &flag];
|
|
||||||
flag = _flags.flipDraw;
|
|
||||||
[coder encodeValueOfObjCType: @encode(BOOL) at: &flag];
|
|
||||||
flag = _flags.sizeWasExplicitlySet;
|
|
||||||
[coder encodeValueOfObjCType: @encode(BOOL) at: &flag];
|
|
||||||
flag = _flags.useEPSOnResolutionMismatch;
|
|
||||||
[coder encodeValueOfObjCType: @encode(BOOL) at: &flag];
|
|
||||||
flag = _flags.colorMatchPreferred;
|
|
||||||
[coder encodeValueOfObjCType: @encode(BOOL) at: &flag];
|
|
||||||
flag = _flags.multipleResolutionMatching;
|
|
||||||
[coder encodeValueOfObjCType: @encode(BOOL) at: &flag];
|
|
||||||
flag = _flags.cacheSeparately;
|
|
||||||
[coder encodeValueOfObjCType: @encode(BOOL) at: &flag];
|
|
||||||
flag = _flags.unboundedCacheDepth;
|
|
||||||
[coder encodeValueOfObjCType: @encode(BOOL) at: &flag];
|
|
||||||
|
|
||||||
// FIXME: The documentation says to archive only the file name,
|
|
||||||
// if not data retained!
|
|
||||||
/*
|
|
||||||
* Now encode an array of all the image reps (excluding cache)
|
|
||||||
*/
|
|
||||||
a = [NSMutableArray arrayWithCapacity: 2];
|
|
||||||
e = [[self representations] objectEnumerator];
|
|
||||||
while ((r = [e nextObject]) != nil)
|
|
||||||
{
|
{
|
||||||
if ([r isKindOfClass: cachedClass] == NO)
|
/*
|
||||||
{
|
* System image - just encode the name.
|
||||||
[a addObject: r];
|
*/
|
||||||
}
|
[coder encodeValueOfObjCType: @encode(id) at: &_name];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
NSMutableArray *a;
|
||||||
|
NSEnumerator *e;
|
||||||
|
NSImageRep *r;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Normal image - encode the ivars
|
||||||
|
*/
|
||||||
|
[coder encodeValueOfObjCType: @encode(NSSize) at: &_size];
|
||||||
|
[coder encodeValueOfObjCType: @encode(id) at: &_color];
|
||||||
|
flag = _flags.scalable;
|
||||||
|
[coder encodeValueOfObjCType: @encode(BOOL) at: &flag];
|
||||||
|
flag = _flags.dataRetained;
|
||||||
|
[coder encodeValueOfObjCType: @encode(BOOL) at: &flag];
|
||||||
|
flag = _flags.flipDraw;
|
||||||
|
[coder encodeValueOfObjCType: @encode(BOOL) at: &flag];
|
||||||
|
flag = _flags.sizeWasExplicitlySet;
|
||||||
|
[coder encodeValueOfObjCType: @encode(BOOL) at: &flag];
|
||||||
|
flag = _flags.useEPSOnResolutionMismatch;
|
||||||
|
[coder encodeValueOfObjCType: @encode(BOOL) at: &flag];
|
||||||
|
flag = _flags.colorMatchPreferred;
|
||||||
|
[coder encodeValueOfObjCType: @encode(BOOL) at: &flag];
|
||||||
|
flag = _flags.multipleResolutionMatching;
|
||||||
|
[coder encodeValueOfObjCType: @encode(BOOL) at: &flag];
|
||||||
|
flag = _flags.cacheSeparately;
|
||||||
|
[coder encodeValueOfObjCType: @encode(BOOL) at: &flag];
|
||||||
|
flag = _flags.unboundedCacheDepth;
|
||||||
|
[coder encodeValueOfObjCType: @encode(BOOL) at: &flag];
|
||||||
|
|
||||||
|
// FIXME: The documentation says to archive only the file name,
|
||||||
|
// if not data retained!
|
||||||
|
/*
|
||||||
|
* Now encode an array of all the image reps (excluding cache)
|
||||||
|
*/
|
||||||
|
a = [NSMutableArray arrayWithCapacity: 2];
|
||||||
|
e = [[self representations] objectEnumerator];
|
||||||
|
while ((r = [e nextObject]) != nil)
|
||||||
|
{
|
||||||
|
if ([r isKindOfClass: cachedClass] == NO)
|
||||||
|
{
|
||||||
|
[a addObject: r];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
[coder encodeValueOfObjCType: @encode(id) at: &a];
|
||||||
}
|
}
|
||||||
[coder encodeValueOfObjCType: @encode(id) at: &a];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id) initWithCoder: (NSCoder*)coder
|
- (id) initWithCoder: (NSCoder*)coder
|
||||||
{
|
{
|
||||||
BOOL flag;
|
BOOL flag;
|
||||||
|
|
|
@ -766,14 +766,25 @@
|
||||||
- (void) encodeWithCoder: (NSCoder*)aCoder
|
- (void) encodeWithCoder: (NSCoder*)aCoder
|
||||||
{
|
{
|
||||||
[super encodeWithCoder: aCoder];
|
[super encodeWithCoder: aCoder];
|
||||||
|
if ([aCoder allowsKeyedCoding])
|
||||||
[aCoder encodeObject: _items];
|
{
|
||||||
[aCoder encodeObject: _font];
|
[aCoder encodeBool: [self allowsTruncatedLabels] forKey: @"NSAllowTruncatedLabels"];
|
||||||
[aCoder encodeValueOfObjCType: @encode(NSTabViewType) at: &_type];
|
[aCoder encodeBool: [self drawsBackground] forKey: @"NSDrawsBackground"];
|
||||||
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_draws_background];
|
[aCoder encodeObject: [self font] forKey: @"NSFont"];
|
||||||
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_truncated_label];
|
[aCoder encodeObject: _items forKey: @"NSTabViewItems"];
|
||||||
[aCoder encodeConditionalObject: _delegate];
|
[aCoder encodeObject: [self selectedTabViewItem] forKey: @"NSSelectedTabViewItem"];
|
||||||
[aCoder encodeValueOfObjCType: "i" at: &_selected_item];
|
[aCoder encodeInt: 0 forKey: @"NSTvFlags"]; // no flags set...
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
[aCoder encodeObject: _items];
|
||||||
|
[aCoder encodeObject: _font];
|
||||||
|
[aCoder encodeValueOfObjCType: @encode(NSTabViewType) at: &_type];
|
||||||
|
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_draws_background];
|
||||||
|
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_truncated_label];
|
||||||
|
[aCoder encodeConditionalObject: _delegate];
|
||||||
|
[aCoder encodeValueOfObjCType: "i" at: &_selected_item];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id) initWithCoder: (NSCoder*)aDecoder
|
- (id) initWithCoder: (NSCoder*)aDecoder
|
||||||
|
|
|
@ -208,13 +208,24 @@
|
||||||
|
|
||||||
- (void) encodeWithCoder: (NSCoder*)aCoder
|
- (void) encodeWithCoder: (NSCoder*)aCoder
|
||||||
{
|
{
|
||||||
[aCoder encodeObject:_ident];
|
if ([aCoder allowsKeyedCoding])
|
||||||
[aCoder encodeObject:_label];
|
{
|
||||||
[aCoder encodeObject:_view];
|
[aCoder encodeObject: _ident forKey: @"NSIdentifier"];
|
||||||
[aCoder encodeObject:_color];
|
[aCoder encodeObject: _label forKey: @"NSLabel"];
|
||||||
[aCoder encodeValueOfObjCType: @encode(NSTabState) at: &_state];
|
[aCoder encodeObject: _view forKey: @"NSView"];
|
||||||
[aCoder encodeObject:_first_responder];
|
[aCoder encodeObject: _color forKey: @"NSColor"];
|
||||||
[aCoder encodeObject:_tabview];
|
[aCoder encodeObject: _tabview forKey: @"NSTabView"];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
[aCoder encodeObject:_ident];
|
||||||
|
[aCoder encodeObject:_label];
|
||||||
|
[aCoder encodeObject:_view];
|
||||||
|
[aCoder encodeObject:_color];
|
||||||
|
[aCoder encodeValueOfObjCType: @encode(NSTabState) at: &_state];
|
||||||
|
[aCoder encodeObject:_first_responder];
|
||||||
|
[aCoder encodeObject:_tabview];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id) initWithCoder: (NSCoder*)aDecoder
|
- (id) initWithCoder: (NSCoder*)aDecoder
|
||||||
|
|
|
@ -208,10 +208,19 @@ static NSColor *txtCol;
|
||||||
BOOL tmp;
|
BOOL tmp;
|
||||||
[super encodeWithCoder: aCoder];
|
[super encodeWithCoder: aCoder];
|
||||||
|
|
||||||
[aCoder encodeValueOfObjCType: @encode(id) at: &_background_color];
|
if([aCoder allowsKeyedCoding])
|
||||||
[aCoder encodeValueOfObjCType: @encode(id) at: &_text_color];
|
{
|
||||||
tmp = _textfieldcell_draws_background;
|
[aCoder encodeObject: [self backgroundColor] forKey: @"NSBackgroundColor"];
|
||||||
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &tmp];
|
[aCoder encodeObject: [self textColor] forKey: @"NSTextColor"];
|
||||||
|
[aCoder encodeBool: [self drawsBackground] forKey: @"NSDrawsBackground"];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
[aCoder encodeValueOfObjCType: @encode(id) at: &_background_color];
|
||||||
|
[aCoder encodeValueOfObjCType: @encode(id) at: &_text_color];
|
||||||
|
tmp = _textfieldcell_draws_background;
|
||||||
|
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &tmp];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id) initWithCoder: (NSCoder*)aDecoder
|
- (id) initWithCoder: (NSCoder*)aDecoder
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue