diff --git a/AppKit/CPDocumentController.j b/AppKit/CPDocumentController.j index 84fbd9d7a..80edb065b 100644 --- a/AppKit/CPDocumentController.j +++ b/AppKit/CPDocumentController.j @@ -100,18 +100,18 @@ var CPSharedDocumentController = nil; */ - (void)openUntitledDocumentOfType:(CPString)aType display:(BOOL)shouldDisplay { - var document = [self makeUntitledDocumentOfType:aType error:nil]; + var theDocument = [self makeUntitledDocumentOfType:aType error:nil]; - if (document) - [self addDocument:document]; + if (theDocument) + [self addDocument:theDocument]; if (shouldDisplay) { - [document makeWindowControllers]; - [document showWindows]; + [theDocument makeWindowControllers]; + [theDocument showWindows]; } - return document; + return theDocument; } /* diff --git a/AppKit/CPView.j b/AppKit/CPView.j index 8a90392db..481cce508 100644 --- a/AppKit/CPView.j +++ b/AppKit/CPView.j @@ -368,7 +368,7 @@ var DOMElementPrototype = nil, [aSubview removeFromSuperview]; - [aView _insertSubview:aView atIndex:index]; + [self _insertSubview:aView atIndex:index]; } /* @ignore */ diff --git a/AppKit/Cib/CPCib.j b/AppKit/Cib/CPCib.j index be630aedb..ee27f538d 100644 --- a/AppKit/Cib/CPCib.j +++ b/AppKit/Cib/CPCib.j @@ -26,6 +26,7 @@ import import "CPCustomView.j" import "_CPCibCustomObject.j" +import "_CPCibKeyedUnarchiver.j" import "_CPCibObjectData.j" import "_CPCibWindowTemplate.j" @@ -51,7 +52,7 @@ var CPCibObjectDataKey = @"CPCibObjectDataKey"; - (BOOL)instantiateCibWithExternalNameTable:(CPDictionary)anExternalNameTable { - var unarchiver = [[CPKeyedUnarchiver alloc] initForReadingWithData:_data], + var unarchiver = [[_CPCibKeyedUnarchiver alloc] initForReadingWithData:_data], objectData = [unarchiver decodeObjectForKey:CPCibObjectDataKey]; if (!objectData || ![objectData isKindOfClass:[_CPCibObjectData class]]) diff --git a/AppKit/Cib/_CPCibCustomObject.j b/AppKit/Cib/_CPCibCustomObject.j index 56b633c9a..5064784d8 100644 --- a/AppKit/Cib/_CPCibCustomObject.j +++ b/AppKit/Cib/_CPCibCustomObject.j @@ -28,7 +28,7 @@ var _CPCibCustomObjectClassName = @"_CPCibCustomObjectClassName"; [aCoder encodeObject:_className forKey:_CPCibCustomObjectClassName]; } -- (id)awakeAfterUsingCoder:(CPCoder)aCoder +- (id)_cibInstantiate { var theClass = CPClassFromString(_className); diff --git a/AppKit/Cib/_CPCibKeyedUnarchiver.j b/AppKit/Cib/_CPCibKeyedUnarchiver.j new file mode 100644 index 000000000..f962d2be6 --- /dev/null +++ b/AppKit/Cib/_CPCibKeyedUnarchiver.j @@ -0,0 +1,34 @@ + +import + + +@implementation _CPCibKeyedUnarchiver : CPKeyedUnarchiver +{ +} + +- (id)decodeObjectForKey:(CPString)aKey +{ + var object = [super decodeObjectForKey:aKey]; + + if ([object respondsToSelector:@selector(_cibInstantiate)]) + { + var index = [[_plistObject objectForKey:aKey] objectForKey:_CPKeyedArchiverUIDKey], + processedObject = [object _cibInstantiate]; + + if (processedObject != object) + { + object = processedObject; + + [self replaceObjectAtUID:index withObject:processedObject]; + } + } + + return object; +} + +- (void)replaceObjectAtUID:(int)aUID withObject:(id)anObject +{ + _objects[aUID] = anObject; +} + +@end \ No newline at end of file diff --git a/AppKit/Cib/_CPCibWindowTemplate.j b/AppKit/Cib/_CPCibWindowTemplate.j index 7147656aa..dec6bd3c4 100644 --- a/AppKit/Cib/_CPCibWindowTemplate.j +++ b/AppKit/Cib/_CPCibWindowTemplate.j @@ -65,7 +65,7 @@ var _CPCibWindowTemplateMinSizeKey = @"_CPCibWindowTemplateMinSizeKey", [aCoder encodeObject:_windowView forKey:_CPCibWindowTemplateWindowViewKey]; } -- (id)awakeAfterUsingCoder:(CPCoder)aCoder +- (id)_cibInstantiate { var windowClass = CPClassFromString(_windowClass); diff --git a/AppKit/Platform/DOM/CPDOMDisplayServer.j b/AppKit/Platform/DOM/CPDOMDisplayServer.j index 0e34fef89..b2338c339 100644 --- a/AppKit/Platform/DOM/CPDOMDisplayServer.j +++ b/AppKit/Platform/DOM/CPDOMDisplayServer.j @@ -133,7 +133,7 @@ CPDOMDisplayServerViewsContext = {}; CPDOMDisplayServerInstructions[index++] = nil; break; - }}catch(e) { alert("here?" + instruction) } + }}catch(e) { CPLog("here?" + instruction) } } CPDOMDisplayServerInstructionCount = 0; @@ -155,7 +155,7 @@ CPDOMDisplayServerViewsContext = {}; [view displayIfNeeded]; } } - + [CPDOMDisplayRunLoop performSelector:@selector(run) target:CPDOMDisplayServer argument:nil order:0 modes:[CPDefaultRunLoopMode]]; } diff --git a/Tools/NibApp/HelloWorld.nib/info.nib b/Tools/NibApp/HelloWorld.nib/info.nib index b8f7650f5..d92bee152 100644 --- a/Tools/NibApp/HelloWorld.nib/info.nib +++ b/Tools/NibApp/HelloWorld.nib/info.nib @@ -7,7 +7,10 @@ IBOldestOS 5 IBOpenObjects - + + 1 + 10 + IBSystem Version 9F33 targetFramework diff --git a/Tools/NibApp/HelloWorld.nib/keyedobjects.nib b/Tools/NibApp/HelloWorld.nib/keyedobjects.nib index 3ad8add67..acebe2aa0 100644 Binary files a/Tools/NibApp/HelloWorld.nib/keyedobjects.nib and b/Tools/NibApp/HelloWorld.nib/keyedobjects.nib differ