Improved Cib Support.

Reviewed by ross.
This commit is contained in:
Francisco Ryan Tolmasky I
2008-09-19 20:19:08 -07:00
parent d183f6c434
commit a10058fc7f
9 changed files with 51 additions and 13 deletions
+6 -6
View File
@@ -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;
}
/*
+1 -1
View File
@@ -368,7 +368,7 @@ var DOMElementPrototype = nil,
[aSubview removeFromSuperview];
[aView _insertSubview:aView atIndex:index];
[self _insertSubview:aView atIndex:index];
}
/* @ignore */
+2 -1
View File
@@ -26,6 +26,7 @@ import <Foundation/CPURLRequest.j>
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]])
+1 -1
View File
@@ -28,7 +28,7 @@ var _CPCibCustomObjectClassName = @"_CPCibCustomObjectClassName";
[aCoder encodeObject:_className forKey:_CPCibCustomObjectClassName];
}
- (id)awakeAfterUsingCoder:(CPCoder)aCoder
- (id)_cibInstantiate
{
var theClass = CPClassFromString(_className);
+34
View File
@@ -0,0 +1,34 @@
import <Foundation/CPKeyedUnarchiver.j>
@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
+1 -1
View File
@@ -65,7 +65,7 @@ var _CPCibWindowTemplateMinSizeKey = @"_CPCibWindowTemplateMinSizeKey",
[aCoder encodeObject:_windowView forKey:_CPCibWindowTemplateWindowViewKey];
}
- (id)awakeAfterUsingCoder:(CPCoder)aCoder
- (id)_cibInstantiate
{
var windowClass = CPClassFromString(_windowClass);
+2 -2
View File
@@ -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]];
}
+4 -1
View File
@@ -7,7 +7,10 @@
<key>IBOldestOS</key>
<integer>5</integer>
<key>IBOpenObjects</key>
<array/>
<array>
<integer>1</integer>
<integer>10</integer>
</array>
<key>IBSystem Version</key>
<string>9F33</string>
<key>targetFramework</key>
Binary file not shown.