/Frameworks/AppKit/browser.platform/_CPCibWindowTemplate.j

http://github.com/jfahrenkrug/MapKit-HelloWorld · Unknown · 68 lines · 68 code · 0 blank · 0 comment · 0 complexity · cf97115dec0dbab7547e60c3e233c12c MD5 · raw file

  1. I;21;Foundation/CPObject.jc;3174;
  2. var _1="_CPCibWindowTemplateMinSizeKey",_2="_CPCibWindowTemplateMaxSizeKey",_3="_CPCibWindowTemplateViewClassKey",_4="_CPCibWindowTemplateWindowClassKey",_5="_CPCibWindowTemplateWindowRectKey",_6="_CPCibWindowTempatStyleMaskKey",_7="_CPCibWindowTemplateWindowTitleKey",_8="_CPCibWindowTemplateWindowViewKey",_9="_CPCibWindowTemplateWindowIsFullBridgeKey";
  3. var _a=objj_allocateClassPair(CPObject,"_CPCibWindowTemplate"),_b=_a.isa;
  4. class_addIvars(_a,[new objj_ivar("_minSize"),new objj_ivar("_maxSize"),new objj_ivar("_viewClass"),new objj_ivar("_windowClass"),new objj_ivar("_windowRect"),new objj_ivar("_windowStyleMask"),new objj_ivar("_windowTitle"),new objj_ivar("_windowView"),new objj_ivar("_windowIsFullBridge")]);
  5. objj_registerClassPair(_a);
  6. objj_addClassForBundle(_a,objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
  7. class_addMethods(_a,[new objj_method(sel_getUid("initWithCoder:"),function(_c,_d,_e){
  8. with(_c){
  9. _c=objj_msgSendSuper({receiver:_c,super_class:objj_getClass("CPObject")},"init");
  10. if(_c){
  11. if(objj_msgSend(_e,"containsValueForKey:",_1)){
  12. _minSize=objj_msgSend(_e,"decodeSizeForKey:",_1);
  13. }
  14. if(objj_msgSend(_e,"containsValueForKey:",_2)){
  15. _maxSize=objj_msgSend(_e,"decodeSizeForKey:",_2);
  16. }
  17. _viewClass=objj_msgSend(_e,"decodeObjectForKey:",_3);
  18. _windowClass=objj_msgSend(_e,"decodeObjectForKey:",_4);
  19. _windowRect=objj_msgSend(_e,"decodeRectForKey:",_5);
  20. _windowStyleMask=objj_msgSend(_e,"decodeIntForKey:",_6);
  21. _windowTitle=objj_msgSend(_e,"decodeObjectForKey:",_7);
  22. _windowView=objj_msgSend(_e,"decodeObjectForKey:",_8);
  23. _windowIsFullBridge=objj_msgSend(_e,"decodeObjectForKey:",_9);
  24. }
  25. return _c;
  26. }
  27. }),new objj_method(sel_getUid("encodeWithCoder:"),function(_f,_10,_11){
  28. with(_f){
  29. if(_minSize){
  30. objj_msgSend(_11,"encodeSize:forKey:",_minSize,_1);
  31. }
  32. if(_maxSize){
  33. objj_msgSend(_11,"encodeSize:forKey:",_maxSize,_2);
  34. }
  35. objj_msgSend(_11,"encodeObject:forKey:",_viewClass,_3);
  36. objj_msgSend(_11,"encodeObject:forKey:",_windowClass,_4);
  37. objj_msgSend(_11,"encodeRect:forKey:",_windowRect,_5);
  38. objj_msgSend(_11,"encodeInt:forKey:",_windowStyleMask,_6);
  39. objj_msgSend(_11,"encodeObject:forKey:",_windowTitle,_7);
  40. objj_msgSend(_11,"encodeObject:forKey:",_windowView,_8);
  41. objj_msgSend(_11,"encodeObject:forKey:",_windowIsFullBridge,_9);
  42. }
  43. }),new objj_method(sel_getUid("windowClass"),function(_12,_13){
  44. with(_12){
  45. return _windowClass;
  46. }
  47. }),new objj_method(sel_getUid("_cibInstantiate"),function(_14,_15){
  48. with(_14){
  49. var _16=CPClassFromString(objj_msgSend(_14,"windowClass"));
  50. var _17=objj_msgSend(objj_msgSend(_16,"alloc"),"initWithContentRect:styleMask:",_windowRect,_windowStyleMask);
  51. if(_minSize){
  52. objj_msgSend(_17,"setMinSize:",_minSize);
  53. }
  54. if(_maxSize){
  55. objj_msgSend(_17,"setMaxSize:",_maxSize);
  56. }
  57. objj_msgSend(_17,"setLevel:",CPFloatingWindowLevel);
  58. objj_msgSend(_17,"setTitle:",_windowTitle);
  59. objj_msgSend(_windowView,"setAutoresizesSubviews:",NO);
  60. objj_msgSend(_17,"setContentView:",_windowView);
  61. objj_msgSend(_windowView,"setAutoresizesSubviews:",YES);
  62. if(objj_msgSend(_viewClass,"isKindOfClass:",objj_msgSend(CPToolbar,"class"))){
  63. objj_msgSend(_17,"setToolbar:",_viewClass);
  64. }
  65. objj_msgSend(_17,"setFullBridge:",_windowIsFullBridge);
  66. return _17;
  67. }
  68. })]);