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:
fredkiefer 2013-02-17 16:53:48 +00:00
parent 695b0ae8e8
commit 6880e50086
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> 2013-02-17 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSBezierPath.m: More keyed decoding. * Source/NSBezierPath.m: More keyed decoding.

View file

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

View file

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

View file

@ -366,7 +366,7 @@ static Class controlClass;
} }
else else
{ {
[aCoder encodeValueOfObjCType: @encode(int) at: &_tag]; [aCoder encodeValueOfObjCType: @encode(NSInteger) at: &_tag];
[aCoder encodeConditionalObject: _target]; [aCoder encodeConditionalObject: _target];
[aCoder encodeValueOfObjCType: @encode(SEL) at: &_action]; [aCoder encodeValueOfObjCType: @encode(SEL) at: &_action];
// This is only encoded for backward compatibility and won't be decoded. // This is only encoded for backward compatibility and won't be decoded.
@ -400,7 +400,7 @@ static Class controlClass;
{ {
id dummy; id dummy;
[aDecoder decodeValueOfObjCType: @encode(int) at: &_tag]; [aDecoder decodeValueOfObjCType: @encode(NSInteger) at: &_tag];
_target = [aDecoder decodeObject]; _target = [aDecoder decodeObject];
[aDecoder decodeValueOfObjCType: @encode(SEL) at: &_action]; [aDecoder decodeValueOfObjCType: @encode(SEL) at: &_action];
// Don't decode _control_view, as this may no longer be valid. // 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: &_allowsEmptySelection];
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_allowsMultipleSelection]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_allowsMultipleSelection];
[aCoder encodeValueOfObjCType: @encode(int) at: &_maxVisibleColumns]; [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: &_reusesColumns];
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_separatesColumns]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_separatesColumns];
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_takesTitleFromPreviousColumn]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_takesTitleFromPreviousColumn];
@ -2784,7 +2784,7 @@ static NSTextFieldCell *titleCell;
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_allowsEmptySelection]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_allowsEmptySelection];
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_allowsMultipleSelection]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_allowsMultipleSelection];
[aDecoder decodeValueOfObjCType: @encode(int) at: &_maxVisibleColumns]; [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: &_reusesColumns];
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_separatesColumns]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_separatesColumns];
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_takesTitleFromPreviousColumn]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_takesTitleFromPreviousColumn];

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -544,7 +544,7 @@
[aCoder encodeObject: _image]; [aCoder encodeObject: _image];
[aCoder encodeConditionalObject: _representedObject]; [aCoder encodeConditionalObject: _representedObject];
[aCoder encodePoint: _imageOrigin]; [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: &_isMovable];
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_isRemovable]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_isRemovable];
} }
@ -555,7 +555,7 @@
_image = [aDecoder decodeObject]; _image = [aDecoder decodeObject];
_representedObject = [aDecoder decodeObject]; _representedObject = [aDecoder decodeObject];
_imageOrigin = [aDecoder decodePoint]; _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: &_isMovable];
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_isRemovable]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_isRemovable];

View file

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

View file

@ -210,8 +210,8 @@
[aCoder encodeObject: _menu]; [aCoder encodeObject: _menu];
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_enabled]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_enabled];
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_selected]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_selected];
[aCoder encodeValueOfObjCType: @encode(float) at: &_width]; [aCoder encodeValueOfObjCType: @encode(CGFloat) at: &_width];
[aCoder encodeValueOfObjCType: @encode(int) at: &_tag]; [aCoder encodeValueOfObjCType: @encode(NSInteger) at: &_tag];
} }
} }
@ -245,8 +245,8 @@
ASSIGN(_menu, [aDecoder decodeObject]); ASSIGN(_menu, [aDecoder decodeObject]);
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_enabled]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_enabled];
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_selected]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_selected];
[aDecoder decodeValueOfObjCType: @encode(float) at: &_width]; [aDecoder decodeValueOfObjCType: @encode(CGFloat) at: &_width];
[aDecoder decodeValueOfObjCType: @encode(int) at: &_tag]; [aDecoder decodeValueOfObjCType: @encode(NSInteger) at: &_tag];
} }
return self; return self;
@ -626,7 +626,7 @@
{ {
int style; int style;
[aCoder encodeObject: _items]; [aCoder encodeObject: _items];
[aCoder encodeValueOfObjCType: @encode(int) at: &_selected_segment]; [aCoder encodeValueOfObjCType: @encode(NSInteger) at: &_selected_segment];
style = _segmentCellFlags._style; style = _segmentCellFlags._style;
[aCoder encodeValueOfObjCType: @encode(int) at: &style]; [aCoder encodeValueOfObjCType: @encode(int) at: &style];
} }
@ -670,7 +670,7 @@
_segmentCellFlags._tracking_mode = NSSegmentSwitchTrackingSelectOne; _segmentCellFlags._tracking_mode = NSSegmentSwitchTrackingSelectOne;
ASSIGN(_items,[aDecoder decodeObject]); ASSIGN(_items,[aDecoder decodeObject]);
[aDecoder decodeValueOfObjCType: @encode(int) at: &_selected_segment]; [aDecoder decodeValueOfObjCType: @encode(NSInteger) at: &_selected_segment];
if (_selected_segment != -1) if (_selected_segment != -1)
[self setSelectedSegment: _selected_segment]; [self setSelectedSegment: _selected_segment];
[aDecoder decodeValueOfObjCType: @encode(int) at: &style]; [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]; at: &_is_rotated_or_scaled_from_base];
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_post_frame_changes]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_post_frame_changes];
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_autoresizes_subviews]; [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 nextKeyView]];
[aCoder encodeConditionalObject: [self previousKeyView]]; [aCoder encodeConditionalObject: [self previousKeyView]];
[aCoder encodeObject: _sub_views]; [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: &_post_frame_changes];
[aDecoder decodeValueOfObjCType: @encode(BOOL) [aDecoder decodeValueOfObjCType: @encode(BOOL)
at: &_autoresizes_subviews]; at: &_autoresizes_subviews];
[aDecoder decodeValueOfObjCType: @encode(unsigned int) [aDecoder decodeValueOfObjCType: @encode(NSUInteger)
at: &_autoresizingMask]; at: &_autoresizingMask];
_coordinates_valid = NO; _coordinates_valid = NO;
[self setNextKeyView: [aDecoder decodeObject]]; [self setNextKeyView: [aDecoder decodeObject]];

View file

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