PageRenderTime 19ms CodeModel.GetById 14ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/Frameworks/AppKit/rhino.platform/_CPCibLoading.j

http://github.com/jfahrenkrug/MapKit-HelloWorld
Unknown | 35 lines | 34 code | 1 blank | 0 comment | 0 complexity | 993cbf451547a9d35abafbb4714e06e5 MD5 | raw file
 1I;21;Foundation/CPBundle.jI;25;Foundation/CPDictionary.jI;21;Foundation/CPString.jc;1627;
 2var CPCibOwner = "CPCibOwner";
 3{
 4var the_class = objj_getClass("CPObject")
 5if(!the_class) objj_exception_throw(new objj_exception(OBJJClassNotFoundException, "*** Could not find definition for class \"CPObject\""));
 6var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("awakeFromCib"), function(self, _cmd)
 7{ with(self)
 8{
 9}
10})]);
11}
12{
13var the_class = objj_getClass("CPBundle")
14if(!the_class) objj_exception_throw(new objj_exception(OBJJClassNotFoundException, "*** Could not find definition for class \"CPBundle\""));
15var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("loadCibFile:externalNameTable:"), function(self, _cmd, aPath, aNameTable)
16{ with(self)
17{
18    return objj_msgSend(objj_msgSend(objj_msgSend(CPCib, "alloc"), "initWithContentsOfFile:", aPath), "instantiateCibWithExternalNameTable:", aNameTable);
19}
20})]);
21class_addMethods(meta_class, [new objj_method(sel_getUid("loadCibFile:externalNameTable:"), function(self, _cmd, aPath, aNameTable)
22{ with(self)
23{
24    return objj_msgSend(objj_msgSend(objj_msgSend(CPCib, "alloc"), "initWithContentsOfFile:", aPath), "instantiateCibWithExternalNameTable:", aNameTable);
25}
26}), new objj_method(sel_getUid("loadCibNamed:owner:"), function(self, _cmd, aName, anOwner)
27{ with(self)
28{
29    var bundle = objj_msgSend(CPBundle, "bundleForClass:", objj_msgSend(anOwner, "class"));
30    var path = objj_msgSend(bundle, "pathForResource:", aName);
31    return objj_msgSend(CPBundle, "loadCibFile:externalNameTable:", aPath, objj_msgSend(CPDictionary, "dictionaryWithObject:forKey:", anOwner, CPCibOwner));
32}
33})]);
34}
35