PageRenderTime 23ms CodeModel.GetById 17ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/Frameworks/Debug/AppKit/rhino.platform/CPThemeBlend.j

http://github.com/jfahrenkrug/MapKit-HelloWorld
Unknown | 48 lines | 47 code | 1 blank | 0 comment | 0 complexity | e13e056c54c9556ce95770280bb4cbfa MD5 | raw file
 1I;21;Foundation/CPObject.jI;16;AppKit/CPTheme.jI;29;AppKit/_CPCibCustomResource.jI;30;AppKit/_CPCibKeyedUnarchiver.jc;1992;
 2{var the_class = objj_allocateClassPair(CPObject, "CPThemeBlend"),
 3meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_bundle"), new objj_ivar("_themes"), new objj_ivar("_loadDelegate")]);
 4objj_registerClassPair(the_class);
 5objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
 6class_addMethods(the_class, [new objj_method(sel_getUid("themes"), function $CPThemeBlend__themes(self, _cmd)
 7{ with(self)
 8{
 9return _themes;
10}
11}), new objj_method(sel_getUid("initWithContentsOfURL:"), function $CPThemeBlend__initWithContentsOfURL_(self, _cmd, aURL)
12{ with(self)
13{
14    self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("CPObject") }, "init");
15    if (self)
16    {
17        _bundle = objj_msgSend(objj_msgSend(CPBundle, "alloc"), "initWithPath:", aURL + "/Info.plist");
18    }
19    return self;
20}
21}), new objj_method(sel_getUid("loadWithDelegate:"), function $CPThemeBlend__loadWithDelegate_(self, _cmd, aDelegate)
22{ with(self)
23{
24    _loadDelegate = aDelegate;
25    objj_msgSend(_bundle, "loadWithDelegate:", self);
26}
27}), new objj_method(sel_getUid("bundleDidFinishLoading:"), function $CPThemeBlend__bundleDidFinishLoading_(self, _cmd, aBundle)
28{ with(self)
29{
30    var paths = objj_msgSend(_bundle, "objectForInfoDictionaryKey:", "CPBundleReplacedFiles"),
31        index = 0,
32        count = paths.length,
33        bundlePath = objj_msgSend(_bundle, "bundlePath");
34    while (count--)
35    {
36        var path = paths[count];
37        if (objj_msgSend(path, "pathExtension") === "keyedtheme")
38        {
39            var unarchiver = objj_msgSend(objj_msgSend(_CPThemeKeyedUnarchiver, "alloc"), "initForReadingWithData:bundle:", objj_msgSend(CPData, "dataWithString:", objj_files[bundlePath + '/' + path].contents), _bundle);
40            objj_msgSend(unarchiver, "decodeObjectForKey:", "root");
41            objj_msgSend(unarchiver, "finishDecoding");
42        }
43    }
44    objj_msgSend(_loadDelegate, "blendDidFinishLoading:", self);
45}
46})]);
47}
48