Correct coding/decoding after type changes.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@36160 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2013-02-17 16:53:48 +00:00
parent 4d953a5122
commit b1fc7cb066
15 changed files with 266 additions and 209 deletions

View file

@ -1,3 +1,22 @@
2013-02-17 Fred Kiefer <FredKiefer@gmx.de>
* Headers/AppKit/NSGraphicsContext.h
* Headers/AppKit/NSWindow.h
* Source/NSActionCell.m
* Source/NSBrowser.m
* Source/NSCell.m
* Source/NSEvent.m
* Source/NSImageRep.m
* Source/NSMatrix.m
* Source/NSMenuItem.m
* Source/NSParagraphStyle.m
* Source/NSRulerMarker.m
* Source/NSRulerView.m
* Source/NSSegmentedCell.m
* Source/NSView.m
* Source/NSWindow.m:
Correct coding/decoding after type changes.
2013-02-17 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSBezierPath.m: More keyed decoding.

View file

@ -53,13 +53,14 @@
/*
* Backing Store Types
*/
typedef enum _NSBackingStoreType
enum _NSBackingStoreType
{
NSBackingStoreRetained,
NSBackingStoreNonretained,
NSBackingStoreBuffered
} NSBackingStoreType;
};
typedef NSUInteger NSBackingStoreType;
/** NSCompositingOperation defines how an image is drawn or composited onto another.
* <list>

View file

@ -104,21 +104,23 @@ enum {
NSMiniWindowMask = 128 /* GNUstep extension - miniwindows */
};
typedef enum _NSSelectionDirection {
enum _NSSelectionDirection {
NSDirectSelection,
NSSelectingNext,
NSSelectingPrevious
} NSSelectionDirection;
};
typedef NSUInteger NSSelectionDirection;
#if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST)
typedef enum _NSWindowButton
enum _NSWindowButton
{
NSWindowCloseButton = 0,
NSWindowMiniaturizeButton,
NSWindowZoomButton,
NSWindowToolbarButton,
NSWindowDocumentIconButton
} NSWindowButton;
};
typedef NSUInteger NSWindowButton;
#endif
APPKIT_EXPORT NSSize NSIconSize;

View file

@ -366,7 +366,7 @@ static Class controlClass;
}
else
{
[aCoder encodeValueOfObjCType: @encode(int) at: &_tag];
[aCoder encodeValueOfObjCType: @encode(NSInteger) at: &_tag];
[aCoder encodeConditionalObject: _target];
[aCoder encodeValueOfObjCType: @encode(SEL) at: &_action];
// This is only encoded for backward compatibility and won't be decoded.
@ -400,7 +400,7 @@ static Class controlClass;
{
id dummy;
[aDecoder decodeValueOfObjCType: @encode(int) at: &_tag];
[aDecoder decodeValueOfObjCType: @encode(NSInteger) at: &_tag];
_target = [aDecoder decodeObject];
[aDecoder decodeValueOfObjCType: @encode(SEL) at: &_action];
// Don't decode _control_view, as this may no longer be valid.

View file

@ -2630,7 +2630,7 @@ static NSTextFieldCell *titleCell;
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_allowsEmptySelection];
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_allowsMultipleSelection];
[aCoder encodeValueOfObjCType: @encode(int) at: &_maxVisibleColumns];
[aCoder encodeValueOfObjCType: @encode(float) at: &_minColumnWidth];
[aCoder encodeValueOfObjCType: @encode(CGFloat) at: &_minColumnWidth];
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_reusesColumns];
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_separatesColumns];
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_takesTitleFromPreviousColumn];
@ -2784,7 +2784,7 @@ static NSTextFieldCell *titleCell;
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_allowsEmptySelection];
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_allowsMultipleSelection];
[aDecoder decodeValueOfObjCType: @encode(int) at: &_maxVisibleColumns];
[aDecoder decodeValueOfObjCType: @encode(float) at: &_minColumnWidth];
[aDecoder decodeValueOfObjCType: @encode(CGFloat) at: &_minColumnWidth];
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_reusesColumns];
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_separatesColumns];
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_takesTitleFromPreviousColumn];

View file

@ -2481,8 +2481,8 @@ static NSColor *dtxtCol;
[aCoder encodeValueOfObjCType: @encode(unsigned int) at: &tmp_int];
tmp_int = _cell.mnemonic_location;
[aCoder encodeValueOfObjCType: @encode(unsigned int) at: &tmp_int];
[aCoder encodeValueOfObjCType: @encode(unsigned int) at: &_mouse_down_flags];
[aCoder encodeValueOfObjCType: @encode(unsigned int) at: &_action_mask];
[aCoder encodeValueOfObjCType: @encode(NSUInteger) at: &_mouse_down_flags];
[aCoder encodeValueOfObjCType: @encode(NSUInteger) at: &_action_mask];
[aCoder encodeValueOfObjCType: @encode(id) at: &_formatter];
[aCoder encodeValueOfObjCType: @encode(id) at: &_menu];
[aCoder encodeValueOfObjCType: @encode(id) at: &_represented_object];
@ -2647,9 +2647,9 @@ static NSColor *dtxtCol;
_cell.state = tmp_int;
[aDecoder decodeValueOfObjCType: @encode(unsigned int) at: &tmp_int];
_cell.mnemonic_location = tmp_int;
[aDecoder decodeValueOfObjCType: @encode(unsigned int)
[aDecoder decodeValueOfObjCType: @encode(NSUInteger)
at: &_mouse_down_flags];
[aDecoder decodeValueOfObjCType: @encode(unsigned int) at: &_action_mask];
[aDecoder decodeValueOfObjCType: @encode(NSUInteger) at: &_action_mask];
if (version < 3)
{
unsigned int mask = 0;

View file

@ -698,61 +698,68 @@ static const char *eventTypes[] = {
- (void) encodeWithCoder: (NSCoder*)aCoder
{
[aCoder encodeValueOfObjCType: @encode(int) at: &event_type];
[aCoder encodePoint: location_point];
[aCoder encodeValueOfObjCType: @encode(unsigned) at: &modifier_flags];
[aCoder encodeValueOfObjCType: @encode(NSTimeInterval) at: &event_time];
[aCoder encodeValueOfObjCType: @encode(unsigned) at: &window_num];
switch (event_type)
if ([aCoder allowsKeyedCoding])
{
case NSLeftMouseDown:
case NSLeftMouseUp:
case NSOtherMouseDown:
case NSOtherMouseUp:
case NSRightMouseDown:
case NSRightMouseUp:
case NSScrollWheel:
case NSMouseMoved:
case NSLeftMouseDragged:
case NSOtherMouseDragged:
case NSRightMouseDragged:
[aCoder encodeValuesOfObjCTypes: "iififff", &event_data.mouse.event_num,
&event_data.mouse.click, &event_data.mouse.pressure,
&event_data.mouse.button, &event_data.mouse.deltaX,
&event_data.mouse.deltaY, &event_data.mouse.deltaZ];
break;
// FIXME
}
else
{
[aCoder encodeValueOfObjCType: @encode(NSEventType) at: &event_type];
[aCoder encodePoint: location_point];
[aCoder encodeValueOfObjCType: @encode(NSUInteger) at: &modifier_flags];
[aCoder encodeValueOfObjCType: @encode(NSTimeInterval) at: &event_time];
[aCoder encodeValueOfObjCType: @encode(NSInteger) at: &window_num];
switch (event_type)
{
case NSLeftMouseDown:
case NSLeftMouseUp:
case NSOtherMouseDown:
case NSOtherMouseUp:
case NSRightMouseDown:
case NSRightMouseUp:
case NSScrollWheel:
case NSMouseMoved:
case NSLeftMouseDragged:
case NSOtherMouseDragged:
case NSRightMouseDragged:
[aCoder encodeValuesOfObjCTypes: "iififff", &event_data.mouse.event_num,
&event_data.mouse.click, &event_data.mouse.pressure,
&event_data.mouse.button, &event_data.mouse.deltaX,
&event_data.mouse.deltaY, &event_data.mouse.deltaZ];
break;
case NSMouseEntered:
case NSMouseExited:
case NSCursorUpdate:
// Can't do anything with the user_data!?
[aCoder encodeValuesOfObjCTypes: "ii", &event_data.tracking.event_num,
&event_data.tracking.tracking_num];
break;
case NSKeyDown:
case NSKeyUp:
case NSFlagsChanged:
[aCoder encodeValueOfObjCType: @encode(BOOL)
at: &event_data.key.repeat];
[aCoder encodeObject: event_data.key.char_keys];
[aCoder encodeObject: event_data.key.unmodified_keys];
[aCoder encodeValueOfObjCType: "S" at: &event_data.key.key_code];
break;
case NSPeriodic:
case NSAppKitDefined:
case NSSystemDefined:
case NSApplicationDefined:
[aCoder encodeValuesOfObjCTypes: "sii", &event_data.misc.sub_type,
&event_data.misc.data1, &event_data.misc.data2];
break;
case NSTabletPoint:
case NSTabletProximity:
// FIXME: Tablet events
break;
case NSMouseEntered:
case NSMouseExited:
case NSCursorUpdate:
// Can't do anything with the user_data!?
[aCoder encodeValuesOfObjCTypes: "ii", &event_data.tracking.event_num,
&event_data.tracking.tracking_num];
break;
case NSKeyDown:
case NSKeyUp:
case NSFlagsChanged:
[aCoder encodeValueOfObjCType: @encode(BOOL)
at: &event_data.key.repeat];
[aCoder encodeObject: event_data.key.char_keys];
[aCoder encodeObject: event_data.key.unmodified_keys];
[aCoder encodeValueOfObjCType: "S" at: &event_data.key.key_code];
break;
case NSPeriodic:
case NSAppKitDefined:
case NSSystemDefined:
case NSApplicationDefined:
[aCoder encodeValuesOfObjCTypes: "sii", &event_data.misc.sub_type,
&event_data.misc.data1, &event_data.misc.data2];
break;
case NSTabletPoint:
case NSTabletProximity:
// FIXME: Tablet events
break;
}
}
}
@ -779,103 +786,110 @@ static const char *eventTypes[] = {
- (id) initWithCoder: (NSCoder*)aDecoder
{
int version = [aDecoder versionForClassName: @"NSEvent"];
[aDecoder decodeValueOfObjCType: @encode(int) at: &event_type];
location_point = [aDecoder decodePoint];
[aDecoder decodeValueOfObjCType: @encode(unsigned) at: &modifier_flags];
[aDecoder decodeValueOfObjCType: @encode(NSTimeInterval) at: &event_time];
[aDecoder decodeValueOfObjCType: @encode(unsigned) at: &window_num];
if (version == 1)
if ([aDecoder allowsKeyedCoding])
{
// For the unlikely case that old events have been stored, convert them.
switch ((int)event_type)
// FIXME
}
else
{
int version = [aDecoder versionForClassName: @"NSEvent"];
[aDecoder decodeValueOfObjCType: @encode(NSEventType) at: &event_type];
location_point = [aDecoder decodePoint];
[aDecoder decodeValueOfObjCType: @encode(NSUInteger) at: &modifier_flags];
[aDecoder decodeValueOfObjCType: @encode(NSTimeInterval) at: &event_time];
[aDecoder decodeValueOfObjCType: @encode(NSInteger) at: &window_num];
if (version == 1)
{
case 0: event_type = NSLeftMouseDown; break;
case 1: event_type = NSLeftMouseUp; break;
case 2: event_type = NSOtherMouseDown; break;
case 3: event_type = NSOtherMouseUp; break;
case 4: event_type = NSRightMouseDown; break;
case 5: event_type = NSRightMouseUp; break;
case 6: event_type = NSMouseMoved; break;
case 7: event_type = NSLeftMouseDragged; break;
case 8: event_type = NSOtherMouseDragged; break;
case 9: event_type = NSRightMouseDragged; break;
case 10: event_type = NSMouseEntered; break;
case 11: event_type = NSMouseExited; break;
case 12: event_type = NSKeyDown; break;
case 13: event_type = NSKeyUp; break;
case 14: event_type = NSFlagsChanged; break;
case 15: event_type = NSAppKitDefined; break;
case 16: event_type = NSSystemDefined; break;
case 17: event_type = NSApplicationDefined; break;
case 18: event_type = NSPeriodic; break;
case 19: event_type = NSCursorUpdate; break;
case 20: event_type = NSScrollWheel; break;
default: break;
}
// For the unlikely case that old events have been stored, convert them.
switch ((int)event_type)
{
case 0: event_type = NSLeftMouseDown; break;
case 1: event_type = NSLeftMouseUp; break;
case 2: event_type = NSOtherMouseDown; break;
case 3: event_type = NSOtherMouseUp; break;
case 4: event_type = NSRightMouseDown; break;
case 5: event_type = NSRightMouseUp; break;
case 6: event_type = NSMouseMoved; break;
case 7: event_type = NSLeftMouseDragged; break;
case 8: event_type = NSOtherMouseDragged; break;
case 9: event_type = NSRightMouseDragged; break;
case 10: event_type = NSMouseEntered; break;
case 11: event_type = NSMouseExited; break;
case 12: event_type = NSKeyDown; break;
case 13: event_type = NSKeyUp; break;
case 14: event_type = NSFlagsChanged; break;
case 15: event_type = NSAppKitDefined; break;
case 16: event_type = NSSystemDefined; break;
case 17: event_type = NSApplicationDefined; break;
case 18: event_type = NSPeriodic; break;
case 19: event_type = NSCursorUpdate; break;
case 20: event_type = NSScrollWheel; break;
default: break;
}
}
// Previously flag change events where encoded wrongly
if ((version == 2) && (event_type == NSFlagsChanged))
{
[aDecoder decodeValuesOfObjCTypes: "sii", &event_data.misc.sub_type,
&event_data.misc.data1, &event_data.misc.data2];
return self;
}
// Previously flag change events where encoded wrongly
if ((version == 2) && (event_type == NSFlagsChanged))
{
[aDecoder decodeValuesOfObjCTypes: "sii", &event_data.misc.sub_type,
&event_data.misc.data1, &event_data.misc.data2];
return self;
}
// Decode the event date based upon the event type
switch (event_type)
{
case NSLeftMouseDown:
case NSLeftMouseUp:
case NSOtherMouseDown:
case NSOtherMouseUp:
case NSRightMouseDown:
case NSRightMouseUp:
case NSScrollWheel:
case NSMouseMoved:
case NSLeftMouseDragged:
case NSOtherMouseDragged:
case NSRightMouseDragged:
[aDecoder decodeValuesOfObjCTypes: "iififff",
&event_data.mouse.event_num, &event_data.mouse.click,
&event_data.mouse.pressure, &event_data.mouse.button,
&event_data.mouse.deltaX, &event_data.mouse.deltaY,
&event_data.mouse.deltaZ];
break;
case NSMouseEntered:
case NSMouseExited:
case NSCursorUpdate:
// Can't do anything with the user_data!?
[aDecoder decodeValuesOfObjCTypes: "ii", &event_data.tracking.event_num,
&event_data.tracking.tracking_num];
break;
case NSKeyDown:
case NSKeyUp:
case NSFlagsChanged:
[aDecoder decodeValueOfObjCType: @encode(BOOL)
at: &event_data.key.repeat];
event_data.key.char_keys = [aDecoder decodeObject];
event_data.key.unmodified_keys = [aDecoder decodeObject];
[aDecoder decodeValueOfObjCType: "S" at: &event_data.key.key_code];
break;
case NSPeriodic:
case NSAppKitDefined:
case NSSystemDefined:
case NSApplicationDefined:
[aDecoder decodeValuesOfObjCTypes: "sii", &event_data.misc.sub_type,
&event_data.misc.data1, &event_data.misc.data2];
break;
// Decode the event date based upon the event type
switch (event_type)
{
case NSLeftMouseDown:
case NSLeftMouseUp:
case NSOtherMouseDown:
case NSOtherMouseUp:
case NSRightMouseDown:
case NSRightMouseUp:
case NSScrollWheel:
case NSMouseMoved:
case NSLeftMouseDragged:
case NSOtherMouseDragged:
case NSRightMouseDragged:
[aDecoder decodeValuesOfObjCTypes: "iififff",
&event_data.mouse.event_num, &event_data.mouse.click,
&event_data.mouse.pressure, &event_data.mouse.button,
&event_data.mouse.deltaX, &event_data.mouse.deltaY,
&event_data.mouse.deltaZ];
break;
case NSMouseEntered:
case NSMouseExited:
case NSCursorUpdate:
// Can't do anything with the user_data!?
[aDecoder decodeValuesOfObjCTypes: "ii", &event_data.tracking.event_num,
&event_data.tracking.tracking_num];
break;
case NSKeyDown:
case NSKeyUp:
case NSFlagsChanged:
[aDecoder decodeValueOfObjCType: @encode(BOOL)
at: &event_data.key.repeat];
event_data.key.char_keys = [aDecoder decodeObject];
event_data.key.unmodified_keys = [aDecoder decodeObject];
[aDecoder decodeValueOfObjCType: "S" at: &event_data.key.key_code];
break;
case NSPeriodic:
case NSAppKitDefined:
case NSSystemDefined:
case NSApplicationDefined:
[aDecoder decodeValuesOfObjCTypes: "sii", &event_data.misc.sub_type,
&event_data.misc.data1, &event_data.misc.data2];
break;
case NSTabletPoint:
case NSTabletProximity:
// FIXME: Tablet events
break;
case NSTabletPoint:
case NSTabletProximity:
// FIXME: Tablet events
break;
}
}
return self;

View file

@ -871,24 +871,38 @@ Fallback for backends other than Cairo. */
// NSCoding protocol
- (void) encodeWithCoder: (NSCoder*)aCoder
{
[aCoder encodeObject: _colorSpace];
[aCoder encodeSize: _size];
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_hasAlpha];
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_isOpaque];
[aCoder encodeValueOfObjCType: @encode(int) at: &_bitsPerSample];
[aCoder encodeValueOfObjCType: @encode(int) at: &_pixelsWide];
[aCoder encodeValueOfObjCType: @encode(int) at: &_pixelsHigh];
if ([aCoder allowsKeyedCoding])
{
// FIXME
}
else
{
[aCoder encodeObject: _colorSpace];
[aCoder encodeSize: _size];
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_hasAlpha];
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_isOpaque];
[aCoder encodeValueOfObjCType: @encode(NSInteger) at: &_bitsPerSample];
[aCoder encodeValueOfObjCType: @encode(NSInteger) at: &_pixelsWide];
[aCoder encodeValueOfObjCType: @encode(NSInteger) at: &_pixelsHigh];
}
}
- (id) initWithCoder: (NSCoder*)aDecoder
{
[aDecoder decodeValueOfObjCType: @encode(id) at: &_colorSpace];
_size = [aDecoder decodeSize];
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_hasAlpha];
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_isOpaque];
[aDecoder decodeValueOfObjCType: @encode(int) at: &_bitsPerSample];
[aDecoder decodeValueOfObjCType: @encode(int) at: &_pixelsWide];
[aDecoder decodeValueOfObjCType: @encode(int) at: &_pixelsHigh];
if ([aDecoder allowsKeyedCoding])
{
// FIXME
}
else
{
[aDecoder decodeValueOfObjCType: @encode(id) at: &_colorSpace];
_size = [aDecoder decodeSize];
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_hasAlpha];
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_isOpaque];
[aDecoder decodeValueOfObjCType: @encode(NSInteger) at: &_bitsPerSample];
[aDecoder decodeValueOfObjCType: @encode(NSInteger) at: &_pixelsWide];
[aDecoder decodeValueOfObjCType: @encode(NSInteger) at: &_pixelsHigh];
}
return self;
}

View file

@ -614,9 +614,9 @@ static Class imageClass;
{
[aCoder encodeObject: _title];
[aCoder encodeObject: _keyEquivalent];
[aCoder encodeValueOfObjCType: "I" at: &_keyEquivalentModifierMask];
[aCoder encodeValueOfObjCType: "I" at: &_mnemonicLocation];
[aCoder encodeValueOfObjCType: "i" at: &_state];
[aCoder encodeValueOfObjCType: @encode(NSUInteger) at: &_keyEquivalentModifierMask];
[aCoder encodeValueOfObjCType: @encode(NSUInteger) at: &_mnemonicLocation];
[aCoder encodeValueOfObjCType: @encode(NSInteger) at: &_state];
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_enabled];
[aCoder encodeObject: _image];
[aCoder encodeObject: _onStateImage];
@ -624,7 +624,7 @@ static Class imageClass;
[aCoder encodeObject: _mixedStateImage];
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_changesState];
[aCoder encodeValueOfObjCType: @encode(SEL) at: &_action];
[aCoder encodeValueOfObjCType: "i" at: &_tag];
[aCoder encodeValueOfObjCType: @encode(NSInteger) at: &_tag];
[aCoder encodeConditionalObject: _representedObject];
[aCoder encodeObject: _submenu];
[aCoder encodeConditionalObject: _target];
@ -729,13 +729,13 @@ static Class imageClass;
[aDecoder decodeValueOfObjCType: @encode(id) at: &_title];
[aDecoder decodeValueOfObjCType: @encode(id) at: &_keyEquivalent];
[aDecoder decodeValueOfObjCType: "I" at: &_keyEquivalentModifierMask];
[aDecoder decodeValueOfObjCType: @encode(NSUInteger) at: &_keyEquivalentModifierMask];
if (version <= 3)
{
_keyEquivalentModifierMask = _keyEquivalentModifierMask << 16;
}
[aDecoder decodeValueOfObjCType: "I" at: &_mnemonicLocation];
[aDecoder decodeValueOfObjCType: "i" at: &_state];
[aDecoder decodeValueOfObjCType: @encode(NSUInteger) at: &_mnemonicLocation];
[aDecoder decodeValueOfObjCType: @encode(NSInteger) at: &_state];
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_enabled];
[aDecoder decodeValueOfObjCType: @encode(id) at: &_image];
[aDecoder decodeValueOfObjCType: @encode(id) at: &_onStateImage];
@ -747,7 +747,7 @@ static Class imageClass;
_target = [aDecoder decodeObject];
}
[aDecoder decodeValueOfObjCType: @encode(SEL) at: &_action];
[aDecoder decodeValueOfObjCType: "i" at: &_tag];
[aDecoder decodeValueOfObjCType: @encode(NSInteger) at: &_tag];
[aDecoder decodeValueOfObjCType: @encode(id) at: &_representedObject];
[aDecoder decodeValueOfObjCType: @encode(id) at: &_submenu];
if (version >= 2)

View file

@ -470,8 +470,8 @@ static NSParagraphStyle *defaultStyle = nil;
{
unsigned count;
[aCoder decodeValueOfObjCType: @encode(int) at: &_alignment];
[aCoder decodeValueOfObjCType: @encode(int) at: &_lineBreakMode];
[aCoder decodeValueOfObjCType: @encode(NSTextAlignment) at: &_alignment];
[aCoder decodeValueOfObjCType: @encode(NSLineBreakMode) at: &_lineBreakMode];
[aCoder decodeValueOfObjCType: @encode(float) at: &_firstLineHeadIndent];
[aCoder decodeValueOfObjCType: @encode(float) at: &_headIndent];
[aCoder decodeValueOfObjCType: @encode(float) at: &_lineSpacing];
@ -494,7 +494,7 @@ static NSParagraphStyle *defaultStyle = nil;
[aCoder decodeArrayOfObjCType: @encode(float)
count: count
at: locations];
[aCoder decodeArrayOfObjCType: @encode(int)
[aCoder decodeArrayOfObjCType: @encode(NSTextTabType)
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(int) at: &_baseDirection];
[aCoder decodeValueOfObjCType: @encode(NSWritingDirection) at: &_baseDirection];
}
}
@ -527,8 +527,8 @@ static NSParagraphStyle *defaultStyle = nil;
{
unsigned count;
[aCoder encodeValueOfObjCType: @encode(int) at: &_alignment];
[aCoder encodeValueOfObjCType: @encode(int) at: &_lineBreakMode];
[aCoder encodeValueOfObjCType: @encode(NSTextAlignment) at: &_alignment];
[aCoder encodeValueOfObjCType: @encode(NSLineBreakMode) at: &_lineBreakMode];
[aCoder encodeValueOfObjCType: @encode(float) at: &_firstLineHeadIndent];
[aCoder encodeValueOfObjCType: @encode(float) at: &_headIndent];
[aCoder encodeValueOfObjCType: @encode(float) at: &_lineSpacing];
@ -558,12 +558,12 @@ static NSParagraphStyle *defaultStyle = nil;
[aCoder encodeArrayOfObjCType: @encode(float)
count: count
at: locations];
[aCoder encodeArrayOfObjCType: @encode(int)
[aCoder encodeArrayOfObjCType: @encode(NSTextTabType)
count: count
at: types];
}
[aCoder encodeValueOfObjCType: @encode(int) at: &_baseDirection];
[aCoder encodeValueOfObjCType: @encode(NSWritingDirection) at: &_baseDirection];
}
}
@ -692,7 +692,7 @@ static NSParagraphStyle *defaultStyle = nil;
_lineHeightMultiple = factor;
}
- (void) setParagraphSpacingBefore: (float)spacing
- (void) setParagraphSpacingBefore: (CGFloat)spacing
{
_paragraphSpacingBefore = spacing;
}

View file

@ -544,7 +544,7 @@
[aCoder encodeObject: _image];
[aCoder encodeConditionalObject: _representedObject];
[aCoder encodePoint: _imageOrigin];
[aCoder encodeValueOfObjCType: @encode(float) at: &_location];
[aCoder encodeValueOfObjCType: @encode(CGFloat) at: &_location];
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_isMovable];
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_isRemovable];
}
@ -555,7 +555,7 @@
_image = [aDecoder decodeObject];
_representedObject = [aDecoder decodeObject];
_imageOrigin = [aDecoder decodePoint];
[aDecoder decodeValueOfObjCType: @encode(float) at: &_location];
[aDecoder decodeValueOfObjCType: @encode(CGFloat) at: &_location];
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_isMovable];
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_isRemovable];

View file

@ -861,14 +861,19 @@ static NSMutableDictionary *units = nil;
- (void) encodeWithCoder: (NSCoder *)encoder
{
[super encodeWithCoder: encoder];
/* FIXME/TODO: not implemented */
return;
}
- (id) initWithCoder: (NSCoder *)decoder
{
self = [super initWithCoder: decoder];
if (self == nil)
return nil;
/* FIXME/TODO: not implemented */
return nil;
return self;
}
- (void) dealloc

View file

@ -210,8 +210,8 @@
[aCoder encodeObject: _menu];
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_enabled];
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_selected];
[aCoder encodeValueOfObjCType: @encode(float) at: &_width];
[aCoder encodeValueOfObjCType: @encode(int) at: &_tag];
[aCoder encodeValueOfObjCType: @encode(CGFloat) at: &_width];
[aCoder encodeValueOfObjCType: @encode(NSInteger) at: &_tag];
}
}
@ -245,8 +245,8 @@
ASSIGN(_menu, [aDecoder decodeObject]);
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_enabled];
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_selected];
[aDecoder decodeValueOfObjCType: @encode(float) at: &_width];
[aDecoder decodeValueOfObjCType: @encode(int) at: &_tag];
[aDecoder decodeValueOfObjCType: @encode(CGFloat) at: &_width];
[aDecoder decodeValueOfObjCType: @encode(NSInteger) at: &_tag];
}
return self;
@ -626,7 +626,7 @@
{
int style;
[aCoder encodeObject: _items];
[aCoder encodeValueOfObjCType: @encode(int) at: &_selected_segment];
[aCoder encodeValueOfObjCType: @encode(NSInteger) at: &_selected_segment];
style = _segmentCellFlags._style;
[aCoder encodeValueOfObjCType: @encode(int) at: &style];
}
@ -670,7 +670,7 @@
_segmentCellFlags._tracking_mode = NSSegmentSwitchTrackingSelectOne;
ASSIGN(_items,[aDecoder decodeObject]);
[aDecoder decodeValueOfObjCType: @encode(int) at: &_selected_segment];
[aDecoder decodeValueOfObjCType: @encode(NSInteger) at: &_selected_segment];
if (_selected_segment != -1)
[self setSelectedSegment: _selected_segment];
[aDecoder decodeValueOfObjCType: @encode(int) at: &style];

View file

@ -4581,7 +4581,7 @@ static NSView* findByTag(NSView *view, NSInteger aTag, NSUInteger *level)
at: &_is_rotated_or_scaled_from_base];
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_post_frame_changes];
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_autoresizes_subviews];
[aCoder encodeValueOfObjCType: @encode(unsigned int) at: &_autoresizingMask];
[aCoder encodeValueOfObjCType: @encode(NSUInteger) at: &_autoresizingMask];
[aCoder encodeConditionalObject: [self nextKeyView]];
[aCoder encodeConditionalObject: [self previousKeyView]];
[aCoder encodeObject: _sub_views];
@ -4729,7 +4729,7 @@ static NSView* findByTag(NSView *view, NSInteger aTag, NSUInteger *level)
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_post_frame_changes];
[aDecoder decodeValueOfObjCType: @encode(BOOL)
at: &_autoresizes_subviews];
[aDecoder decodeValueOfObjCType: @encode(unsigned int)
[aDecoder decodeValueOfObjCType: @encode(NSUInteger)
at: &_autoresizingMask];
_coordinates_valid = NO;
[self setNextKeyView: [aDecoder decodeObject]];

View file

@ -5283,8 +5283,9 @@ current key view.<br />
[super encodeWithCoder: aCoder];
[aCoder encodeRect: [[self contentView] frame]];
[aCoder encodeValueOfObjCType: @encode(unsigned) at: &_styleMask];
[aCoder encodeValueOfObjCType: @encode(int) at: &_backingType];
[aCoder encodeValueOfObjCType: @encode(NSUInteger) at: &_styleMask];
// This used to be int, we need to stay compatible
[aCoder encodeValueOfObjCType: @encode(NSInteger) at: &_backingType];
[aCoder encodePoint: NSMakePoint(NSMinX([self frame]), NSMaxY([self frame]))];
[aCoder encodeObject: _contentView];
@ -5296,7 +5297,7 @@ current key view.<br />
[aCoder encodeSize: _minimumSize];
[aCoder encodeSize: _maximumSize];
[aCoder encodeValueOfObjCType: @encode(int) at: &_windowLevel];
[aCoder encodeValueOfObjCType: @encode(NSInteger) at: &_windowLevel];
flag = _f.menu_exclude;
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag];
@ -5345,13 +5346,14 @@ current key view.<br />
NSPoint p;
NSUInteger aStyle;
NSBackingStoreType aBacking;
int anInt;
NSInteger level;
id obj;
aRect = [aDecoder decodeRect];
[aDecoder decodeValueOfObjCType: @encode(unsigned)
[aDecoder decodeValueOfObjCType: @encode(NSUInteger)
at: &aStyle];
[aDecoder decodeValueOfObjCType: @encode(int)
// This used to be int, we need to stay compatible
[aDecoder decodeValueOfObjCType: @encode(NSInteger)
at: &aBacking];
// call the designated initializer....
@ -5378,8 +5380,8 @@ current key view.<br />
[self setMaxSize: aSize];
[aDecoder decodeValueOfObjCType: @encode(int)
at: &anInt];
[self setLevel: anInt];
at: &level];
[self setLevel: level];
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
[self setExcludedFromWindowsMenu: flag];