* Source/NSEvent.m,

* Source/NSParagraphStyle.m: Use NSInteger instead of enumerator
        type name for decoding and encoding.
        * Header/AppKit/NSFontPanel.h,
        * Header/AppKit/NSOpenPanel.h,
        * Header/AppKit/NSDataLinkPanel.h,
        * Source/NSDataLinkPanel.m,
        * Header/AppKit/NSForm.h,
        * Source/NSForm.m,
        * Header/AppKit/NSHelpPanel.h,
        * Source/NSHelpPanel.m,
        * Source/NSColorPanel.m: Remove unused encoding/decoding
        * methods.
        * Source/NSCustomImageRep.m,
        * Source/NSEPSImageRep.m,
        * Source/NSMovie.m,
        * Source/NSRulerMarker.m,
        * Source/NSColorList.m: Flag missing keyed encoding/decoding.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@36377 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
fredkiefer 2013-03-17 19:53:50 +00:00
parent 7ce551f716
commit 20dbc07afd
17 changed files with 150 additions and 129 deletions

View file

@ -1,3 +1,23 @@
2013-03-17 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSEvent.m,
* Source/NSParagraphStyle.m: Use NSInteger instead of enumerator
type name for decoding and encoding.
* Header/AppKit/NSFontPanel.h,
* Header/AppKit/NSOpenPanel.h,
* Header/AppKit/NSDataLinkPanel.h,
* Source/NSDataLinkPanel.m,
* Header/AppKit/NSForm.h,
* Source/NSForm.m,
* Header/AppKit/NSHelpPanel.h,
* Source/NSHelpPanel.m,
* Source/NSColorPanel.m: Remove unused encoding/decoding methods.
* Source/NSCustomImageRep.m,
* Source/NSEPSImageRep.m,
* Source/NSMovie.m,
* Source/NSRulerMarker.m,
* Source/NSColorList.m: Flag missing keyed encoding/decoding.
2013-03-15 Fred Kiefer <FredKiefer@gmx.de> 2013-03-15 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSTableView.m: Use new method -_isCellSelectableColumn:row:, * Source/NSTableView.m: Use new method -_isCellSelectableColumn:row:,

View file

@ -42,7 +42,7 @@
- (void) orderFrontDataLinkPanel: (id)sender; - (void) orderFrontDataLinkPanel: (id)sender;
@end @end
@interface NSDataLinkPanel : NSPanel <NSCoding> @interface NSDataLinkPanel : NSPanel
{ {
// Outlets // Outlets
id _sourceField; id _sourceField;

View file

@ -56,7 +56,7 @@ enum {
NSFPSizeBrowser NSFPSizeBrowser
}; };
@interface NSFontPanel : NSPanel <NSCoding, NSTextFieldDelegate> @interface NSFontPanel : NSPanel <NSTextFieldDelegate>
{ {
// Attributes // Attributes
NSFont *_panelFont; NSFont *_panelFont;

View file

@ -36,7 +36,7 @@
@class NSFormCell; @class NSFormCell;
@class NSFont; @class NSFont;
@interface NSForm : NSMatrix <NSCoding> @interface NSForm : NSMatrix
{ {
BOOL _title_width_needs_update; BOOL _title_width_needs_update;
} }

View file

@ -42,7 +42,7 @@
- (void) orderFrontHelpPanel: (id)sender; - (void) orderFrontHelpPanel: (id)sender;
@end @end
@interface NSHelpPanel : NSPanel <NSCoding> @interface NSHelpPanel : NSPanel
{ {
// Attributes // Attributes
} }

View file

@ -7,9 +7,9 @@
Author: Scott Christley <scottc@net-community.com> Author: Scott Christley <scottc@net-community.com>
Date: 1996 Date: 1996
Author: Daniel Bðhringer <boehring@biomed.ruhr-uni-bochum.de> Author: Daniel Böhringer <boehring@biomed.ruhr-uni-bochum.de>
Date: August 1998 Date: August 1998
Source by Daniel Bðhringer integrated into Scott Christley's preliminary Source by Daniel Böhringer integrated into Scott Christley's preliminary
implementation by Felipe A. Rodriguez <far@ix.netcom.com> implementation by Felipe A. Rodriguez <far@ix.netcom.com>
Author: Nicola Pero <n.pero@mi.flashnet.it> Author: Nicola Pero <n.pero@mi.flashnet.it>
@ -43,7 +43,7 @@
@class NSString; @class NSString;
@class NSArray; @class NSArray;
@interface NSOpenPanel : NSSavePanel <NSCoding> @interface NSOpenPanel : NSSavePanel
{ {
BOOL _canChooseDirectories; BOOL _canChooseDirectories;
BOOL _canChooseFiles; BOOL _canChooseFiles;

View file

@ -533,17 +533,30 @@ static NSColorList *themeColorList = nil;
- (void) encodeWithCoder: (NSCoder*)aCoder - (void) encodeWithCoder: (NSCoder*)aCoder
{ {
[aCoder encodeObject: _name]; if ([aCoder allowsKeyedCoding])
[aCoder encodeObject: _colorDictionary]; {
[aCoder encodeObject: _orderedColorKeys]; // FIXME
}
else
{
[aCoder encodeObject: _name];
[aCoder encodeObject: _colorDictionary];
[aCoder encodeObject: _orderedColorKeys];
}
} }
- (id) initWithCoder: (NSCoder*)aDecoder - (id) initWithCoder: (NSCoder*)aDecoder
{ {
[aDecoder decodeValueOfObjCType: @encode(id) at: &_name]; if ([aDecoder allowsKeyedCoding])
[aDecoder decodeValueOfObjCType: @encode(id) at: &_colorDictionary]; {
[aDecoder decodeValueOfObjCType: @encode(id) at: &_orderedColorKeys]; // FIXME
}
else
{
[aDecoder decodeValueOfObjCType: @encode(id) at: &_name];
[aDecoder decodeValueOfObjCType: @encode(id) at: &_colorDictionary];
[aDecoder decodeValueOfObjCType: @encode(id) at: &_orderedColorKeys];
}
return self; return self;
} }

View file

@ -760,21 +760,4 @@ static int _gs_gui_color_picker_mode = NSRGBModeColorPanel;
return YES; return YES;
} }
//
// NSCoding protocol
//
- (void) encodeWithCoder: (NSCoder*)aCoder
{
[super encodeWithCoder: aCoder];
}
- (id) initWithCoder: (NSCoder*)aDecoder
{
self = [super initWithCoder: aDecoder];
if (nil == self)
return nil;
return self;
}
@end @end

View file

@ -154,17 +154,31 @@
{ {
[super encodeWithCoder: aCoder]; [super encodeWithCoder: aCoder];
// FIXME: Should this be changed to encodeConditionalObject: ? if ([aCoder allowsKeyedCoding])
[aCoder encodeObject: _delegate]; {
[aCoder encodeValueOfObjCType: @encode(SEL) at: &_selector]; // FIXME
}
else
{
// FIXME: Should this be changed to encodeConditionalObject: ?
[aCoder encodeObject: _delegate];
[aCoder encodeValueOfObjCType: @encode(SEL) at: &_selector];
}
} }
- (id) initWithCoder: (NSCoder*)aDecoder - (id) initWithCoder: (NSCoder*)aDecoder
{ {
self = [super initWithCoder: aDecoder]; self = [super initWithCoder: aDecoder];
[aDecoder decodeValueOfObjCType: @encode(id) at: &_delegate]; if ([aDecoder allowsKeyedCoding])
[aDecoder decodeValueOfObjCType: @encode(SEL) at: &_selector]; {
// FIXME
}
else
{
[aDecoder decodeValueOfObjCType: @encode(id) at: &_delegate];
[aDecoder decodeValueOfObjCType: @encode(SEL) at: &_selector];
}
return self; return self;
} }

View file

@ -245,21 +245,4 @@ static NSDataLinkPanel *_sharedDataLinkPanel;
[_currentDataLink setUpdateMode: mode]; [_currentDataLink setUpdateMode: mode];
} }
//
// NSCoding protocol
//
- (void) encodeWithCoder: (NSCoder*)aCoder
{
[super encodeWithCoder: aCoder];
}
- (id) initWithCoder: (NSCoder*)aDecoder
{
self = [super initWithCoder: aDecoder];
if (nil == self)
return nil;
return self;
}
@end @end

View file

@ -129,16 +129,29 @@
NSData *data = [self EPSRepresentation]; NSData *data = [self EPSRepresentation];
[super encodeWithCoder: aCoder]; [super encodeWithCoder: aCoder];
[data encodeWithCoder: aCoder]; if ([aCoder allowsKeyedCoding])
{
// FIXME
}
else
{
[data encodeWithCoder: aCoder];
}
} }
- (id) initWithCoder: (NSCoder*)aDecoder - (id) initWithCoder: (NSCoder*)aDecoder
{ {
NSData *data; NSData *data = nil;
self = [super initWithCoder: aDecoder]; self = [super initWithCoder: aDecoder];
data = [aDecoder decodeObject]; if ([aDecoder allowsKeyedCoding])
{
// FIXME
}
else
{
data = [aDecoder decodeObject];
}
return [self initWithData: data]; return [self initWithData: data];
} }

View file

@ -704,7 +704,7 @@ static const char *eventTypes[] = {
} }
else else
{ {
[aCoder encodeValueOfObjCType: @encode(NSEventType) at: &event_type]; [aCoder encodeValueOfObjCType: @encode(NSInteger) at: &event_type];
[aCoder encodePoint: location_point]; [aCoder encodePoint: location_point];
[aCoder encodeValueOfObjCType: @encode(NSUInteger) at: &modifier_flags]; [aCoder encodeValueOfObjCType: @encode(NSUInteger) at: &modifier_flags];
[aCoder encodeValueOfObjCType: @encode(NSTimeInterval) at: &event_time]; [aCoder encodeValueOfObjCType: @encode(NSTimeInterval) at: &event_time];
@ -794,7 +794,7 @@ static const char *eventTypes[] = {
{ {
int version = [aDecoder versionForClassName: @"NSEvent"]; int version = [aDecoder versionForClassName: @"NSEvent"];
[aDecoder decodeValueOfObjCType: @encode(NSEventType) at: &event_type]; [aDecoder decodeValueOfObjCType: @encode(NSInteger) at: &event_type];
location_point = [aDecoder decodePoint]; location_point = [aDecoder decodePoint];
[aDecoder decodeValueOfObjCType: @encode(NSUInteger) at: &modifier_flags]; [aDecoder decodeValueOfObjCType: @encode(NSUInteger) at: &modifier_flags];
[aDecoder decodeValueOfObjCType: @encode(NSTimeInterval) at: &event_time]; [aDecoder decodeValueOfObjCType: @encode(NSTimeInterval) at: &event_time];

View file

@ -410,18 +410,4 @@ static Class defaultCellClass = nil;
[self selectTextAtRow: index column: 0]; [self selectTextAtRow: index column: 0];
} }
- (void) encodeWithCoder: (NSCoder*)aCoder
{
[super encodeWithCoder: aCoder];
}
- (id) initWithCoder: (NSCoder*)aDecoder
{
self = [super initWithCoder: aDecoder];
if (nil == self)
return nil;
return self;
}
@end @end

View file

@ -214,21 +214,4 @@ static NSHelpPanel *_sharedPanel = nil;
{ {
} }
//
// NSCoding protocol
//
- (void) encodeWithCoder: (NSCoder*)aCoder
{
[super encodeWithCoder: aCoder];
}
- (id) initWithCoder: (NSCoder*)aDecoder
{
self = [super initWithCoder: aDecoder];
if (nil == self)
return nil;
return self;
}
@end @end

View file

@ -149,15 +149,28 @@
// NSCoding protocoll // NSCoding protocoll
- (void) encodeWithCoder: (NSCoder*)aCoder - (void) encodeWithCoder: (NSCoder*)aCoder
{ {
[aCoder encodeObject: _movie]; if ([aCoder allowsKeyedCoding])
[aCoder encodeObject: _url]; {
// FIXME
}
else
{
[aCoder encodeObject: _movie];
[aCoder encodeObject: _url];
}
} }
- (id) initWithCoder: (NSCoder*)aDecoder - (id) initWithCoder: (NSCoder*)aDecoder
{ {
ASSIGN (_movie, [aDecoder decodeObject]); if ([aDecoder allowsKeyedCoding])
ASSIGN (_url, [aDecoder decodeObject]); {
// FIXME
}
else
{
ASSIGN (_movie, [aDecoder decodeObject]);
ASSIGN (_url, [aDecoder decodeObject]);
}
return self; return self;
} }

View file

@ -181,10 +181,10 @@
if ([aCoder allowsKeyedCoding]) if ([aCoder allowsKeyedCoding])
{ {
_location = [aCoder decodeFloatForKey: @"NSLocation"]; _location = [aCoder decodeFloatForKey: @"NSLocation"];
} }
else else
{ {
// FIXME // FIXME
} }
return self; return self;
} }
@ -197,7 +197,7 @@
} }
else else
{ {
// FIXME // FIXME
} }
} }
@ -468,9 +468,9 @@ static NSParagraphStyle *defaultStyle = nil;
} }
else else
{ {
unsigned count; NSUInteger count;
[aCoder decodeValueOfObjCType: @encode(NSTextAlignment) at: &_alignment]; [aCoder decodeValueOfObjCType: @encode(NSInteger) at: &_alignment];
[aCoder decodeValueOfObjCType: @encode(NSInteger) at: &_lineBreakMode]; [aCoder decodeValueOfObjCType: @encode(NSInteger) at: &_lineBreakMode];
[aCoder decodeValueOfObjCType: @encode(float) at: &_firstLineHeadIndent]; [aCoder decodeValueOfObjCType: @encode(float) at: &_firstLineHeadIndent];
[aCoder decodeValueOfObjCType: @encode(float) at: &_headIndent]; [aCoder decodeValueOfObjCType: @encode(float) at: &_headIndent];
@ -483,18 +483,18 @@ static NSParagraphStyle *defaultStyle = nil;
/* /*
* Tab stops don't conform to NSCoding - so we do it the long way. * Tab stops don't conform to NSCoding - so we do it the long way.
*/ */
[aCoder decodeValueOfObjCType: @encode(unsigned) at: &count]; [aCoder decodeValueOfObjCType: @encode(NSUInteger) at: &count];
_tabStops = [[NSMutableArray alloc] initWithCapacity: count]; _tabStops = [[NSMutableArray alloc] initWithCapacity: count];
if (count > 0) if (count > 0)
{ {
float locations[count]; float locations[count];
NSTextTabType types[count]; NSTextTabType types[count];
unsigned i; NSUInteger i;
[aCoder decodeArrayOfObjCType: @encode(float) [aCoder decodeArrayOfObjCType: @encode(float)
count: count count: count
at: locations]; at: locations];
[aCoder decodeArrayOfObjCType: @encode(NSTextTabType) [aCoder decodeArrayOfObjCType: @encode(NSInteger)
count: count count: count
at: types]; at: types];
for (i = 0; i < count; i++) for (i = 0; i < count; i++)
@ -510,7 +510,7 @@ static NSParagraphStyle *defaultStyle = nil;
if ([aCoder versionForClassName: @"NSParagraphStyle"] >= 2) if ([aCoder versionForClassName: @"NSParagraphStyle"] >= 2)
{ {
[aCoder decodeValueOfObjCType: @encode(NSWritingDirection) at: &_baseDirection]; [aCoder decodeValueOfObjCType: @encode(NSInteger) at: &_baseDirection];
} }
} }
@ -525,9 +525,9 @@ static NSParagraphStyle *defaultStyle = nil;
} }
else else
{ {
unsigned count; NSUInteger count;
[aCoder encodeValueOfObjCType: @encode(NSTextAlignment) at: &_alignment]; [aCoder encodeValueOfObjCType: @encode(NSInteger) at: &_alignment];
[aCoder encodeValueOfObjCType: @encode(NSInteger) at: &_lineBreakMode]; [aCoder encodeValueOfObjCType: @encode(NSInteger) at: &_lineBreakMode];
[aCoder encodeValueOfObjCType: @encode(float) at: &_firstLineHeadIndent]; [aCoder encodeValueOfObjCType: @encode(float) at: &_firstLineHeadIndent];
[aCoder encodeValueOfObjCType: @encode(float) at: &_headIndent]; [aCoder encodeValueOfObjCType: @encode(float) at: &_headIndent];
@ -541,12 +541,12 @@ static NSParagraphStyle *defaultStyle = nil;
* Tab stops don't conform to NSCoding - so we do it the long way. * Tab stops don't conform to NSCoding - so we do it the long way.
*/ */
count = [_tabStops count]; count = [_tabStops count];
[aCoder encodeValueOfObjCType: @encode(unsigned) at: &count]; [aCoder encodeValueOfObjCType: @encode(NSUInteger) at: &count];
if (count > 0) if (count > 0)
{ {
float locations[count]; float locations[count];
NSTextTabType types[count]; NSTextTabType types[count];
unsigned i; NSUInteger i;
for (i = 0; i < count; i++) for (i = 0; i < count; i++)
{ {
@ -558,12 +558,12 @@ static NSParagraphStyle *defaultStyle = nil;
[aCoder encodeArrayOfObjCType: @encode(float) [aCoder encodeArrayOfObjCType: @encode(float)
count: count count: count
at: locations]; at: locations];
[aCoder encodeArrayOfObjCType: @encode(NSTextTabType) [aCoder encodeArrayOfObjCType: @encode(NSInteger)
count: count count: count
at: types]; at: types];
} }
[aCoder encodeValueOfObjCType: @encode(NSWritingDirection) at: &_baseDirection]; [aCoder encodeValueOfObjCType: @encode(NSInteger) at: &_baseDirection];
} }
} }

View file

@ -540,25 +540,38 @@
// NSCoding protocol // NSCoding protocol
- (void) encodeWithCoder: (NSCoder*)aCoder - (void) encodeWithCoder: (NSCoder*)aCoder
{ {
[aCoder encodeObject: _rulerView]; if ([aCoder allowsKeyedCoding])
[aCoder encodeObject: _image]; {
[aCoder encodeConditionalObject: _representedObject]; // FIXME
[aCoder encodePoint: _imageOrigin]; }
[aCoder encodeValueOfObjCType: @encode(CGFloat) at: &_location]; else
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_isMovable]; {
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_isRemovable]; [aCoder encodeObject: _rulerView];
[aCoder encodeObject: _image];
[aCoder encodeConditionalObject: _representedObject];
[aCoder encodePoint: _imageOrigin];
[aCoder encodeValueOfObjCType: @encode(CGFloat) at: &_location];
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_isMovable];
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_isRemovable];
}
} }
- (id) initWithCoder: (NSCoder*)aDecoder - (id) initWithCoder: (NSCoder*)aDecoder
{ {
_rulerView = [aDecoder decodeObject]; if ([aDecoder allowsKeyedCoding])
_image = [aDecoder decodeObject]; {
_representedObject = [aDecoder decodeObject]; // FIXME
_imageOrigin = [aDecoder decodePoint]; }
[aDecoder decodeValueOfObjCType: @encode(CGFloat) at: &_location]; else
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_isMovable]; {
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_isRemovable]; _rulerView = [aDecoder decodeObject];
_image = [aDecoder decodeObject];
_representedObject = [aDecoder decodeObject];
_imageOrigin = [aDecoder decodePoint];
[aDecoder decodeValueOfObjCType: @encode(CGFloat) at: &_location];
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_isMovable];
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_isRemovable];
}
return self; return self;
} }