PageRenderTime 21ms CodeModel.GetById 14ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/Frameworks/AppKit/rhino.platform/_CPCibCustomResource.j

http://github.com/polymar/polish
Unknown | 69 lines | 69 code | 0 blank | 0 comment | 0 complexity | 6fdbb27cf80f4dfd3d4ef210116db83e MD5 | raw file
 1I;21;Foundation/CPObject.jI;21;Foundation/CPString.jc;2848;
 2var _1="_CPCibCustomResourceClassNameKey",_2="_CPCibCustomResourceResourceNameKey",_3="_CPCibCustomResourcePropertiesKey";
 3var _4=objj_allocateClassPair(CPObject,"_CPCibCustomResource"),_5=_4.isa;
 4class_addIvars(_4,[new objj_ivar("_className"),new objj_ivar("_resourceName"),new objj_ivar("_properties")]);
 5objj_registerClassPair(_4);
 6objj_addClassForBundle(_4,objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
 7class_addMethods(_4,[new objj_method(sel_getUid("initWithClassName:resourceName:properties:"),function(_6,_7,_8,_9,_a){
 8with(_6){
 9_6=objj_msgSendSuper({receiver:_6,super_class:objj_getClass("CPObject")},"init");
10if(_6){
11_className=_8;
12_resourceName=_9;
13_properties=_a;
14}
15return _6;
16}
17}),new objj_method(sel_getUid("initWithCoder:"),function(_b,_c,_d){
18with(_b){
19_b=objj_msgSendSuper({receiver:_b,super_class:objj_getClass("CPObject")},"init");
20if(_b){
21_className=objj_msgSend(_d,"decodeObjectForKey:",_1);
22_resourceName=objj_msgSend(_d,"decodeObjectForKey:",_2);
23_properties=objj_msgSend(_d,"decodeObjectForKey:",_3);
24}
25return _b;
26}
27}),new objj_method(sel_getUid("encodeWithCoder:"),function(_e,_f,_10){
28with(_e){
29objj_msgSend(_10,"encodeObject:forKey:",_className,_1);
30objj_msgSend(_10,"encodeObject:forKey:",_resourceName,_2);
31objj_msgSend(_10,"encodeObject:forKey:",_properties,_3);
32}
33}),new objj_method(sel_getUid("awakeAfterUsingCoder:"),function(_11,_12,_13){
34with(_11){
35if(objj_msgSend(_13,"respondsToSelector:",sel_getUid("bundle"))&&(!objj_msgSend(_13,"respondsToSelector:",sel_getUid("awakenCustomResources"))||objj_msgSend(_13,"awakenCustomResources"))){
36if(_className==="CPImage"){
37return objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(objj_msgSend(_13,"bundle"),"pathForResource:",_resourceName),objj_msgSend(_properties,"objectForKey:","size"));
38}
39}
40return _11;
41}
42})]);
43class_addMethods(_5,[new objj_method(sel_getUid("imageResourceWithName:size:"),function(_14,_15,_16,_17){
44with(_14){
45return objj_msgSend(objj_msgSend(_14,"alloc"),"initWithClassName:resourceName:properties:","CPImage",_16,objj_msgSend(CPDictionary,"dictionaryWithObject:forKey:",_17,"size"));
46}
47})]);
48var _4=objj_getClass("_CPCibCustomResource");
49if(!_4){
50objj_exception_throw(new objj_exception(OBJJClassNotFoundException,"*** Could not find definition for class \"_CPCibCustomResource\""));
51}
52var _5=_4.isa;
53class_addMethods(_4,[new objj_method(sel_getUid("filename"),function(_18,_19){
54with(_18){
55return objj_msgSend(objj_msgSend(CPBundle,"mainBundle"),"pathForResource:",_resourceName);
56}
57}),new objj_method(sel_getUid("size"),function(_1a,_1b){
58with(_1a){
59return objj_msgSend(_properties,"objectForKey:","size");
60}
61}),new objj_method(sel_getUid("isThreePartImage"),function(_1c,_1d){
62with(_1c){
63return NO;
64}
65}),new objj_method(sel_getUid("isNinePartImage"),function(_1e,_1f){
66with(_1e){
67return NO;
68}
69})]);