* 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:
Fred Kiefer 2013-03-17 19:53:50 +00:00
parent 6b09581658
commit 12c4d6cbdb
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>
* Source/NSTableView.m: Use new method -_isCellSelectableColumn:row:,

View file

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

View file

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

View file

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

View file

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

View file

@ -7,9 +7,9 @@
Author: Scott Christley <scottc@net-community.com>
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
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>
Author: Nicola Pero <n.pero@mi.flashnet.it>
@ -43,7 +43,7 @@
@class NSString;
@class NSArray;
@interface NSOpenPanel : NSSavePanel <NSCoding>
@interface NSOpenPanel : NSSavePanel
{
BOOL _canChooseDirectories;
BOOL _canChooseFiles;

View file

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

View file

@ -760,21 +760,4 @@ static int _gs_gui_color_picker_mode = NSRGBModeColorPanel;
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

View file

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

View file

@ -245,21 +245,4 @@ static NSDataLinkPanel *_sharedDataLinkPanel;
[_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

View file

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

View file

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

View file

@ -410,18 +410,4 @@ static Class defaultCellClass = nil;
[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

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

View file

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

View file

@ -181,10 +181,10 @@
if ([aCoder allowsKeyedCoding])
{
_location = [aCoder decodeFloatForKey: @"NSLocation"];
}
}
else
{
// FIXME
// FIXME
}
return self;
}
@ -197,7 +197,7 @@
}
else
{
// FIXME
// FIXME
}
}
@ -468,9 +468,9 @@ static NSParagraphStyle *defaultStyle = nil;
}
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(float) at: &_firstLineHeadIndent];
[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.
*/
[aCoder decodeValueOfObjCType: @encode(unsigned) at: &count];
[aCoder decodeValueOfObjCType: @encode(NSUInteger) at: &count];
_tabStops = [[NSMutableArray alloc] initWithCapacity: count];
if (count > 0)
{
float locations[count];
NSTextTabType types[count];
unsigned i;
float locations[count];
NSTextTabType types[count];
NSUInteger i;
[aCoder decodeArrayOfObjCType: @encode(float)
count: count
at: locations];
[aCoder decodeArrayOfObjCType: @encode(NSTextTabType)
[aCoder decodeArrayOfObjCType: @encode(NSInteger)
count: count
at: types];
for (i = 0; i < count; i++)
@ -510,7 +510,7 @@ static NSParagraphStyle *defaultStyle = nil;
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
{
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(float) at: &_firstLineHeadIndent];
[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.
*/
count = [_tabStops count];
[aCoder encodeValueOfObjCType: @encode(unsigned) at: &count];
[aCoder encodeValueOfObjCType: @encode(NSUInteger) at: &count];
if (count > 0)
{
float locations[count];
NSTextTabType types[count];
unsigned i;
float locations[count];
NSTextTabType types[count];
NSUInteger i;
for (i = 0; i < count; i++)
{
@ -558,12 +558,12 @@ static NSParagraphStyle *defaultStyle = nil;
[aCoder encodeArrayOfObjCType: @encode(float)
count: count
at: locations];
[aCoder encodeArrayOfObjCType: @encode(NSTextTabType)
[aCoder encodeArrayOfObjCType: @encode(NSInteger)
count: count
at: types];
}
[aCoder encodeValueOfObjCType: @encode(NSWritingDirection) at: &_baseDirection];
[aCoder encodeValueOfObjCType: @encode(NSInteger) at: &_baseDirection];
}
}

View file

@ -540,25 +540,38 @@
// NSCoding protocol
- (void) encodeWithCoder: (NSCoder*)aCoder
{
[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];
if ([aCoder allowsKeyedCoding])
{
// FIXME
}
else
{
[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
{
_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];
if ([aDecoder allowsKeyedCoding])
{
// FIXME
}
else
{
_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;
}