diff --git a/AppKit/CPImage.j b/AppKit/CPImage.j index e42bf35b1..4fc370237 100644 --- a/AppKit/CPImage.j +++ b/AppKit/CPImage.j @@ -49,15 +49,6 @@ function CPImageInBundle(aFilename, aSize, aBundle) return [[CPImage alloc] initWithContentsOfFile:[aBundle pathForResource:aFilename]]; } -@implementation CPBundle (CPImageAdditions) - -- (CPString)pathForResource:(CPString)aFilename -{ - return [self resourcePath] + '/' + aFilename; -} - -@end - /*! @ingroup appkit @class CPImage diff --git a/Foundation/CPBundle.j b/Foundation/CPBundle.j index 563655fc7..cb763e13a 100644 --- a/Foundation/CPBundle.j +++ b/Foundation/CPBundle.j @@ -99,8 +99,15 @@ } - (CPString)pathForResource:(CPString)aFilename -{ - return [self resourcePath] + '/' + aFilename; +{console.log("?!!!!!!!"); + var path = [self resourcePath] + '/' + aFilename, + mappedPath = _URIMap["Resources/" + aFilename];//path]; +console.log("~!THE MAPPED PATH FOR " + path + " IS " + mappedPath); + + if (mappedPath) + return mappedPath; + + return path; } - (CPDictionary)infoDictionary diff --git a/Objective-J/CommonJS/objective-j/lib-js/objective-j/jake/bundletask.js b/Objective-J/CommonJS/objective-j/lib-js/objective-j/jake/bundletask.js index 0587e0ea2..494591da3 100644 --- a/Objective-J/CommonJS/objective-j/lib-js/objective-j/jake/bundletask.js +++ b/Objective-J/CommonJS/objective-j/lib-js/objective-j/jake/bundletask.js @@ -499,6 +499,7 @@ BundleTask.prototype.defineSourceTasks = function() filedir (staticPath, [compiledPlatformSource]); // FIXME: how do we non flatten? + // dir in common replacedFiles.push(flattensSources ? FILE.basename(aFilename) : FILE.relative(sourcesPath, aFilename)); }, this); diff --git a/Objective-J/Runtime/file.js b/Objective-J/Runtime/file.js index 7c1059739..644853005 100644 --- a/Objective-J/Runtime/file.js +++ b/Objective-J/Runtime/file.js @@ -69,7 +69,9 @@ function objj_bundle() { this.path = NULL; this.info = NULL; - + + this._URIMap = { }; + this.__address = _objj_generateObjectHash(); } @@ -577,6 +579,7 @@ var OBJJUnrecognizedFormatException = "OBJJUnrecognizedFormatException"; var STATIC_MAGIC_NUMBER = "@STATIC", MARKER_PATH = "p", + MARKER_URI = "u", MARKER_CODE = "c", MARKER_BUNDLE = "b", MARKER_TEXT = "t", @@ -618,7 +621,10 @@ function objj_decompile(aString, bundle) objj_files[file.path] = file; break; - + + case MARKER_URI: bundle._URIMap[text] = stream.getString(); + break; + case MARKER_BUNDLE: var bundlePath = DIRECTORY(bundle.path) + '/' + text; file.bundle = objj_getBundleWithPath(bundlePath);