mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-24 11:20:42 +00:00
Improved Cib Support.
Reviewed by ross.
This commit is contained in:
@@ -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
@@ -368,7 +368,7 @@ var DOMElementPrototype = nil,
|
||||
|
||||
[aSubview removeFromSuperview];
|
||||
|
||||
[aView _insertSubview:aView atIndex:index];
|
||||
[self _insertSubview:aView atIndex:index];
|
||||
}
|
||||
|
||||
/* @ignore */
|
||||
|
||||
+2
-1
@@ -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]])
|
||||
|
||||
@@ -28,7 +28,7 @@ var _CPCibCustomObjectClassName = @"_CPCibCustomObjectClassName";
|
||||
[aCoder encodeObject:_className forKey:_CPCibCustomObjectClassName];
|
||||
}
|
||||
|
||||
- (id)awakeAfterUsingCoder:(CPCoder)aCoder
|
||||
- (id)_cibInstantiate
|
||||
{
|
||||
var theClass = CPClassFromString(_className);
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -65,7 +65,7 @@ var _CPCibWindowTemplateMinSizeKey = @"_CPCibWindowTemplateMinSizeKey",
|
||||
[aCoder encodeObject:_windowView forKey:_CPCibWindowTemplateWindowViewKey];
|
||||
}
|
||||
|
||||
- (id)awakeAfterUsingCoder:(CPCoder)aCoder
|
||||
- (id)_cibInstantiate
|
||||
{
|
||||
var windowClass = CPClassFromString(_windowClass);
|
||||
|
||||
|
||||
@@ -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]];
|
||||
}
|
||||
|
||||
|
||||
Generated
+4
-1
@@ -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>
|
||||
|
||||
BIN
Binary file not shown.
Reference in New Issue
Block a user