/Frameworks/AppKit/rhino.platform/CPApplication.j

http://github.com/polymar/polish · Unknown · 444 lines · 444 code · 0 blank · 0 comment · 0 complexity · 8a43789c45acc226089a7ee933e5de26 MD5 · raw file

  1. I;21;Foundation/CPBundle.ji;17;CPCompatibility.ji;9;CPEvent.ji;8;CPMenu.ji;13;CPResponder.ji;22;CPDocumentController.ji;14;CPThemeBlend.jc;17316;
  2. var _1="CPMainCibFile",_2="Main cib file base name";
  3. CPApp=nil;
  4. CPApplicationWillFinishLaunchingNotification="CPApplicationWillFinishLaunchingNotification";
  5. CPApplicationDidFinishLaunchingNotification="CPApplicationDidFinishLaunchingNotification";
  6. CPRunStoppedResponse=-1000;
  7. CPRunAbortedResponse=-1001;
  8. CPRunContinuesResponse=-1002;
  9. var _3=objj_allocateClassPair(CPResponder,"CPApplication"),_4=_3.isa;
  10. class_addIvars(_3,[new objj_ivar("_eventListeners"),new objj_ivar("_currentEvent"),new objj_ivar("_windows"),new objj_ivar("_keyWindow"),new objj_ivar("_mainWindow"),new objj_ivar("_mainMenu"),new objj_ivar("_documentController"),new objj_ivar("_currentSession"),new objj_ivar("_delegate"),new objj_ivar("_namedArgs"),new objj_ivar("_args"),new objj_ivar("_fullArgsString")]);
  11. objj_registerClassPair(_3);
  12. objj_addClassForBundle(_3,objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
  13. class_addMethods(_3,[new objj_method(sel_getUid("init"),function(_5,_6){
  14. with(_5){
  15. _5=objj_msgSendSuper({receiver:_5,super_class:objj_getClass("CPResponder")},"init");
  16. if(_5){
  17. _eventListeners=[];
  18. _windows=[];
  19. objj_msgSend(_windows,"addObject:",nil);
  20. _mainMenu=objj_msgSend(objj_msgSend(CPMenu,"alloc"),"initWithTitle:","MainMenu");
  21. objj_msgSend(_mainMenu,"setAutoenablesItems:",NO);
  22. var _7=objj_msgSend(CPBundle,"bundleForClass:",objj_msgSend(CPApplication,"class")),_8=objj_msgSend(objj_msgSend(CPMenuItem,"alloc"),"initWithTitle:action:keyEquivalent:","New",sel_getUid("newDocument:"),"N");
  23. objj_msgSend(_8,"setImage:",objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_7,"pathForResource:","CPApplication/New.png"),CGSizeMake(16,16)));
  24. objj_msgSend(_8,"setAlternateImage:",objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_7,"pathForResource:","CPApplication/NewHighlighted.png"),CGSizeMake(16,16)));
  25. objj_msgSend(_mainMenu,"addItem:",_8);
  26. var _9=objj_msgSend(objj_msgSend(CPMenuItem,"alloc"),"initWithTitle:action:keyEquivalent:","Open",sel_getUid("openDocument:"),"O");
  27. objj_msgSend(_9,"setImage:",objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_7,"pathForResource:","CPApplication/Open.png"),CGSizeMake(16,16)));
  28. objj_msgSend(_9,"setAlternateImage:",objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_7,"pathForResource:","CPApplication/OpenHighlighted.png"),CGSizeMake(16,16)));
  29. objj_msgSend(_mainMenu,"addItem:",_9);
  30. var _a=objj_msgSend(objj_msgSend(CPMenu,"alloc"),"initWithTitle:","Save"),_b=objj_msgSend(objj_msgSend(CPMenuItem,"alloc"),"initWithTitle:action:keyEquivalent:","Save",sel_getUid("saveDocument:"),nil);
  31. objj_msgSend(_b,"setImage:",objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_7,"pathForResource:","CPApplication/Save.png"),CGSizeMake(16,16)));
  32. objj_msgSend(_b,"setAlternateImage:",objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_7,"pathForResource:","CPApplication/SaveHighlighted.png"),CGSizeMake(16,16)));
  33. objj_msgSend(_a,"addItem:",objj_msgSend(objj_msgSend(CPMenuItem,"alloc"),"initWithTitle:action:keyEquivalent:","Save",sel_getUid("saveDocument:"),"S"));
  34. objj_msgSend(_a,"addItem:",objj_msgSend(objj_msgSend(CPMenuItem,"alloc"),"initWithTitle:action:keyEquivalent:","Save As",sel_getUid("saveDocumentAs:"),nil));
  35. objj_msgSend(_b,"setSubmenu:",_a);
  36. objj_msgSend(_mainMenu,"addItem:",_b);
  37. var _c=objj_msgSend(objj_msgSend(CPMenuItem,"alloc"),"initWithTitle:action:keyEquivalent:","Edit",nil,nil),_d=objj_msgSend(objj_msgSend(CPMenu,"alloc"),"initWithTitle:","Edit"),_e=objj_msgSend(objj_msgSend(CPMenuItem,"alloc"),"initWithTitle:action:keyEquivalent:","Undo",sel_getUid("undo:"),CPUndoKeyEquivalent),_f=objj_msgSend(objj_msgSend(CPMenuItem,"alloc"),"initWithTitle:action:keyEquivalent:","Redo",sel_getUid("redo:"),CPRedoKeyEquivalent);
  38. objj_msgSend(_e,"setKeyEquivalentModifierMask:",CPUndoKeyEquivalentModifierMask);
  39. objj_msgSend(_f,"setKeyEquivalentModifierMask:",CPRedoKeyEquivalentModifierMask);
  40. objj_msgSend(_d,"addItem:",_e);
  41. objj_msgSend(_d,"addItem:",_f);
  42. objj_msgSend(_d,"addItem:",objj_msgSend(objj_msgSend(CPMenuItem,"alloc"),"initWithTitle:action:keyEquivalent:","Cut",sel_getUid("cut:"),"X")),objj_msgSend(_d,"addItem:",objj_msgSend(objj_msgSend(CPMenuItem,"alloc"),"initWithTitle:action:keyEquivalent:","Copy",sel_getUid("copy:"),"C")),objj_msgSend(_d,"addItem:",objj_msgSend(objj_msgSend(CPMenuItem,"alloc"),"initWithTitle:action:keyEquivalent:","Paste",sel_getUid("paste:"),"V"));
  43. objj_msgSend(_c,"setSubmenu:",_d);
  44. objj_msgSend(_c,"setHidden:",YES);
  45. objj_msgSend(_mainMenu,"addItem:",_c);
  46. objj_msgSend(_mainMenu,"addItem:",objj_msgSend(CPMenuItem,"separatorItem"));
  47. }
  48. return _5;
  49. }
  50. }),new objj_method(sel_getUid("setDelegate:"),function(_10,_11,_12){
  51. with(_10){
  52. if(_delegate==_12){
  53. return;
  54. }
  55. var _13=objj_msgSend(CPNotificationCenter,"defaultCenter");
  56. if(_delegate){
  57. objj_msgSend(_13,"removeObserver:name:object:",_delegate,CPApplicationWillFinishLaunchingNotification,_10);
  58. objj_msgSend(_13,"removeObserver:name:object:",_delegate,CPApplicationDidFinishLaunchingNotification,_10);
  59. }
  60. _delegate=_12;
  61. if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("applicationWillFinishLaunching:"))){
  62. objj_msgSend(_13,"addObserver:selector:name:object:",_delegate,sel_getUid("applicationWillFinishLaunching:"),CPApplicationWillFinishLaunchingNotification,_10);
  63. }
  64. if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("applicationDidFinishLaunching:"))){
  65. objj_msgSend(_13,"addObserver:selector:name:object:",_delegate,sel_getUid("applicationDidFinishLaunching:"),CPApplicationDidFinishLaunchingNotification,_10);
  66. }
  67. }
  68. }),new objj_method(sel_getUid("delegate"),function(_14,_15){
  69. with(_14){
  70. return _delegate;
  71. }
  72. }),new objj_method(sel_getUid("finishLaunching"),function(_16,_17){
  73. with(_16){
  74. var _18=objj_msgSend(CPBundle,"mainBundle"),_19=objj_msgSend(_18,"objectForInfoDictionaryKey:","CPBundleDocumentTypes");
  75. if(objj_msgSend(_19,"count")>0){
  76. _documentController=objj_msgSend(CPDocumentController,"sharedDocumentController");
  77. }
  78. var _1a=objj_msgSend(_18,"objectForInfoDictionaryKey:","CPApplicationDelegateClass");
  79. if(_1a){
  80. var _1b=objj_getClass(_1a);
  81. if(_1b){
  82. if(objj_msgSend(_documentController,"class")==_1b){
  83. objj_msgSend(_16,"setDelegate:",_documentController);
  84. }else{
  85. objj_msgSend(_16,"setDelegate:",objj_msgSend(objj_msgSend(_1b,"alloc"),"init"));
  86. }
  87. }
  88. }
  89. var _1c=objj_msgSend(CPNotificationCenter,"defaultCenter");
  90. objj_msgSend(_1c,"postNotificationName:object:",CPApplicationWillFinishLaunchingNotification,_16);
  91. if(_documentController){
  92. objj_msgSend(_documentController,"newDocument:",_16);
  93. }
  94. objj_msgSend(_1c,"postNotificationName:object:",CPApplicationDidFinishLaunchingNotification,_16);
  95. objj_msgSend(objj_msgSend(CPRunLoop,"currentRunLoop"),"limitDateForMode:",CPDefaultRunLoopMode);
  96. }
  97. }),new objj_method(sel_getUid("run"),function(_1d,_1e){
  98. with(_1d){
  99. objj_msgSend(_1d,"finishLaunching");
  100. }
  101. }),new objj_method(sel_getUid("runModalForWindow:"),function(_1f,_20,_21){
  102. with(_1f){
  103. objj_msgSend(_1f,"runModalSession:",objj_msgSend(_1f,"beginModalSessionForWindow:",_21));
  104. }
  105. }),new objj_method(sel_getUid("stopModalWithCode:"),function(_22,_23,_24){
  106. with(_22){
  107. if(!_currentSession){
  108. return;
  109. }
  110. _currentSession._state=_24;
  111. _currentSession=_currentSession._previous;
  112. objj_msgSend(_22,"_removeRunModalLoop");
  113. }
  114. }),new objj_method(sel_getUid("_removeRunModalLoop"),function(_25,_26){
  115. with(_25){
  116. var _27=_eventListeners.length;
  117. while(_27--){
  118. if(_eventListeners[_27]._callback===_28){
  119. _eventListeners.splice(_27,1);
  120. return;
  121. }
  122. }
  123. }
  124. }),new objj_method(sel_getUid("stopModal"),function(_29,_2a){
  125. with(_29){
  126. objj_msgSend(_29,"stopModalWithCode:",CPRunStoppedResponse);
  127. }
  128. }),new objj_method(sel_getUid("abortModal"),function(_2b,_2c){
  129. with(_2b){
  130. objj_msgSend(_2b,"stopModalWithCode:",CPRunAbortedResponse);
  131. }
  132. }),new objj_method(sel_getUid("beginModalSessionForWindow:"),function(_2d,_2e,_2f){
  133. with(_2d){
  134. return _30(_2f,0);
  135. }
  136. }),new objj_method(sel_getUid("runModalSession:"),function(_31,_32,_33){
  137. with(_31){
  138. _33._previous=_currentSession;
  139. _currentSession=_33;
  140. var _34=_33._window;
  141. objj_msgSend(_34,"center");
  142. objj_msgSend(_34,"makeKeyAndOrderFront:",_31);
  143. objj_msgSend(CPApp,"setCallback:forNextEventMatchingMask:untilDate:inMode:dequeue:",_28,CPAnyEventMask,nil,0,NO);
  144. }
  145. }),new objj_method(sel_getUid("modalWindow"),function(_35,_36){
  146. with(_35){
  147. if(!_currentSession){
  148. return nil;
  149. }
  150. return _currentSession._window;
  151. }
  152. }),new objj_method(sel_getUid("_handleKeyEquivalent:"),function(_37,_38,_39){
  153. with(_37){
  154. if(objj_msgSend(_mainMenu,"performKeyEquivalent:",_39)){
  155. return YES;
  156. }
  157. return NO;
  158. }
  159. }),new objj_method(sel_getUid("sendEvent:"),function(_3a,_3b,_3c){
  160. with(_3a){
  161. if(objj_msgSend(_3c,"type")==CPKeyDown&&objj_msgSend(_3c,"modifierFlags")&(CPCommandKeyMask|CPControlKeyMask)&&objj_msgSend(objj_msgSend(_3c,"characters"),"length")>0&&objj_msgSend(_3a,"_handleKeyEquivalent:",_3c)){
  162. return;
  163. }
  164. if(_eventListeners.length){
  165. if(_eventListeners[_eventListeners.length-1]._mask&(1<<objj_msgSend(_3c,"type"))){
  166. _eventListeners.pop()._callback(_3c);
  167. }
  168. return;
  169. }
  170. objj_msgSend(objj_msgSend(_3c,"window"),"sendEvent:",_3c);
  171. }
  172. }),new objj_method(sel_getUid("doCommandBySelector:"),function(_3d,_3e,_3f){
  173. with(_3d){
  174. if(objj_msgSend(_delegate,"respondsToSelector:",_3f)){
  175. objj_msgSend(_delegate,"performSelector:",_3f);
  176. }else{
  177. objj_msgSendSuper({receiver:_3d,super_class:objj_getClass("CPResponder")},"doCommandBySelector:",_3f);
  178. }
  179. }
  180. }),new objj_method(sel_getUid("keyWindow"),function(_40,_41){
  181. with(_40){
  182. return _keyWindow;
  183. }
  184. }),new objj_method(sel_getUid("mainWindow"),function(_42,_43){
  185. with(_42){
  186. return _mainWindow;
  187. }
  188. }),new objj_method(sel_getUid("windowWithWindowNumber:"),function(_44,_45,_46){
  189. with(_44){
  190. return _windows[_46];
  191. }
  192. }),new objj_method(sel_getUid("windows"),function(_47,_48){
  193. with(_47){
  194. return _windows;
  195. }
  196. }),new objj_method(sel_getUid("mainMenu"),function(_49,_4a){
  197. with(_49){
  198. return _mainMenu;
  199. }
  200. }),new objj_method(sel_getUid("setMainMenu:"),function(_4b,_4c,_4d){
  201. with(_4b){
  202. _mainMenu=_4d;
  203. }
  204. }),new objj_method(sel_getUid("orderFrontStandardAboutPanel:"),function(_4e,_4f,_50){
  205. with(_4e){
  206. objj_msgSend(_4e,"orderFrontStandardAboutPanelWithOptions:",nil);
  207. }
  208. }),new objj_method(sel_getUid("orderFrontStandardAboutPanelWithOptions:"),function(_51,_52,_53){
  209. with(_51){
  210. }
  211. }),new objj_method(sel_getUid("tryToPerform:with:"),function(_54,_55,_56,_57){
  212. with(_54){
  213. if(!_56){
  214. return NO;
  215. }
  216. if(objj_msgSendSuper({receiver:_54,super_class:objj_getClass("CPResponder")},"tryToPerform:with:",_56,_57)){
  217. return YES;
  218. }
  219. if(objj_msgSend(_delegate,"respondsToSelector:",_56)){
  220. objj_msgSend(_delegate,"performSelector:withObject:",_56,_57);
  221. return YES;
  222. }
  223. return NO;
  224. }
  225. }),new objj_method(sel_getUid("sendAction:to:from:"),function(_58,_59,_5a,_5b,_5c){
  226. with(_58){
  227. var _5d=objj_msgSend(_58,"targetForAction:to:from:",_5a,_5b,_5c);
  228. if(!_5d){
  229. return NO;
  230. }
  231. objj_msgSend(_5d,"performSelector:withObject:",_5a,_5c);
  232. return YES;
  233. }
  234. }),new objj_method(sel_getUid("targetForAction:to:from:"),function(_5e,_5f,_60,_61,_62){
  235. with(_5e){
  236. if(!_60){
  237. return nil;
  238. }
  239. if(_61){
  240. return _61;
  241. }
  242. return objj_msgSend(_5e,"targetForAction:",_60);
  243. }
  244. }),new objj_method(sel_getUid("_targetForWindow:action:"),function(_63,_64,_65,_66){
  245. with(_63){
  246. var _67=objj_msgSend(_65,"firstResponder"),_68=YES;
  247. while(_67){
  248. if(objj_msgSend(_67,"respondsToSelector:",_66)){
  249. return _67;
  250. }
  251. if(_67==_65){
  252. _68=NO;
  253. }
  254. _67=objj_msgSend(_67,"nextResponder");
  255. }
  256. if(_68&&objj_msgSend(_65,"respondsToSelector:",_66)){
  257. return _65;
  258. }
  259. var _69=objj_msgSend(_65,"delegate");
  260. if(objj_msgSend(_69,"respondsToSelector:",_66)){
  261. return _69;
  262. }
  263. var _6a=objj_msgSend(_65,"windowController");
  264. if(objj_msgSend(_6a,"respondsToSelector:",_66)){
  265. return _6a;
  266. }
  267. var _6b=objj_msgSend(_6a,"document");
  268. if(_6b!=_69&&objj_msgSend(_6b,"respondsToSelector:",_66)){
  269. return _6b;
  270. }
  271. return nil;
  272. }
  273. }),new objj_method(sel_getUid("targetForAction:"),function(_6c,_6d,_6e){
  274. with(_6c){
  275. if(!_6e){
  276. return nil;
  277. }
  278. var _6f=objj_msgSend(_6c,"_targetForWindow:action:",objj_msgSend(_6c,"keyWindow"),_6e);
  279. if(_6f){
  280. return _6f;
  281. }
  282. _6f=objj_msgSend(_6c,"_targetForWindow:action:",objj_msgSend(_6c,"mainWindow"),_6e);
  283. if(_6f){
  284. return _6f;
  285. }
  286. if(objj_msgSend(_6c,"respondsToSelector:",_6e)){
  287. return _6c;
  288. }
  289. if(objj_msgSend(_delegate,"respondsToSelector:",_6e)){
  290. return _delegate;
  291. }
  292. if(objj_msgSend(_documentController,"respondsToSelector:",_6e)){
  293. return _documentController;
  294. }
  295. return nil;
  296. }
  297. }),new objj_method(sel_getUid("setCallback:forNextEventMatchingMask:untilDate:inMode:dequeue:"),function(_70,_71,_72,_73,_74,_75,_76){
  298. with(_70){
  299. _eventListeners.push(_77(_73,_72));
  300. if(_eventListeners.length==3){
  301. objj_debug_print_backtrace();
  302. }
  303. }
  304. }),new objj_method(sel_getUid("setTarget:selector:forNextEventMatchingMask:untilDate:inMode:dequeue:"),function(_78,_79,_7a,_7b,_7c,_7d,_7e,_7f){
  305. with(_78){
  306. _eventListeners.push(_77(_7c,function(_80){
  307. objj_msgSend(_7a,_7b,_80);
  308. }));
  309. }
  310. }),new objj_method(sel_getUid("beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:"),function(_81,_82,_83,_84,_85,_86,_87){
  311. with(_81){
  312. objj_msgSend(_84,"_attachSheet:modalDelegate:didEndSelector:contextInfo:",_83,_85,_86,_87);
  313. }
  314. }),new objj_method(sel_getUid("arguments"),function(_88,_89){
  315. with(_88){
  316. if(_fullArgsString!=window.location.hash){
  317. objj_msgSend(_88,"_reloadArguments");
  318. }
  319. return _args;
  320. }
  321. }),new objj_method(sel_getUid("setArguments:"),function(_8a,_8b,_8c){
  322. with(_8a){
  323. if(!_8c||_8c.length==0){
  324. _args=[];
  325. window.location.hash="#";
  326. return;
  327. }
  328. if(objj_msgSend(_8c,"class")!=CPArray){
  329. _8c=objj_msgSend(CPArray,"arrayWithObject:",_8c);
  330. }
  331. _args=_8c;
  332. var _8d=objj_msgSend(_args,"copy");
  333. for(var i=0,_8f=_8d.length;i<_8f;i++){
  334. _8d[i]=encodeURIComponent(_8d[i]);
  335. }
  336. var _90=objj_msgSend(_8d,"componentsJoinedByString:","/");
  337. window.location.hash="#"+_90;
  338. }
  339. }),new objj_method(sel_getUid("_reloadArguments"),function(_91,_92){
  340. with(_91){
  341. _fullArgsString=window.location.hash;
  342. var _93=_fullArgsString.replace("#","").split("/").slice(0);
  343. for(var i=0,_95=_93.length;i<_95;i++){
  344. _93[i]=decodeURIComponent(_93[i]);
  345. }
  346. _args=_93;
  347. }
  348. }),new objj_method(sel_getUid("namedArguments"),function(_96,_97){
  349. with(_96){
  350. return _namedArgs;
  351. }
  352. })]);
  353. class_addMethods(_4,[new objj_method(sel_getUid("sharedApplication"),function(_98,_99){
  354. with(_98){
  355. if(!CPApp){
  356. CPApp=objj_msgSend(objj_msgSend(CPApplication,"alloc"),"init");
  357. }
  358. return CPApp;
  359. }
  360. })]);
  361. var _30=function(_9a,_9b){
  362. return {_window:_9a,_state:CPRunContinuesResponse,_previous:nil};
  363. };
  364. var _77=function(_9c,_9d){
  365. return {_mask:_9c,_callback:_9d};
  366. };
  367. var _28=function(_9e){
  368. objj_msgSend(CPApp,"setCallback:forNextEventMatchingMask:untilDate:inMode:dequeue:",_28,CPAnyEventMask,nil,0,NO);
  369. var _9f=objj_msgSend(_9e,"window"),_a0=CPApp._currentSession;
  370. if(_9f==_a0._window||objj_msgSend(_9f,"worksWhenModal")){
  371. objj_msgSend(_9f,"sendEvent:",_9e);
  372. }
  373. };
  374. CPApplicationMain=function(_a1,_a2){
  375. var _a3=objj_msgSend(CPBundle,"mainBundle"),_a4=objj_msgSend(_a3,"principalClass");
  376. if(!_a4){
  377. _a4=objj_msgSend(CPApplication,"class");
  378. }
  379. objj_msgSend(_a4,"sharedApplication");
  380. if(!_a1&&!_a2){
  381. var _a1=objj_msgSend(CPApp,"arguments"),_a5=window.location.search.substring(1).split("&");
  382. _a2=objj_msgSend(CPDictionary,"dictionary");
  383. if(objj_msgSend(_a1,"containsObject:","debug")){
  384. CPLogRegister(CPLogPopup);
  385. }
  386. for(var i=0;i<_a5.length;i++){
  387. var _a7=_a5[i].indexOf("=");
  388. if(_a7==-1){
  389. objj_msgSend(_a2,"setObject:forKey:","",_a5[i]);
  390. }else{
  391. objj_msgSend(_a2,"setObject:forKey:",_a5[i].substring(_a7+1),_a5[i].substring(0,_a7));
  392. }
  393. }
  394. }
  395. CPApp._args=_a1;
  396. CPApp._namedArgs=_a2;
  397. objj_msgSend(_CPAppBootstrapper,"performActions");
  398. };
  399. var _a8=nil;
  400. var _3=objj_allocateClassPair(CPObject,"_CPAppBootstrapper"),_4=_3.isa;
  401. objj_registerClassPair(_3);
  402. objj_addClassForBundle(_3,objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
  403. class_addMethods(_4,[new objj_method(sel_getUid("actions"),function(_a9,_aa){
  404. with(_a9){
  405. return [sel_getUid("loadDefaultTheme"),sel_getUid("loadMainCibFile")];
  406. }
  407. }),new objj_method(sel_getUid("performActions"),function(_ab,_ac){
  408. with(_ab){
  409. if(!_a8){
  410. _a8=objj_msgSend(_ab,"actions");
  411. }
  412. while(_a8.length){
  413. var _ad=_a8.shift();
  414. if(objj_msgSend(_ab,_ad)){
  415. return;
  416. }
  417. }
  418. objj_msgSend(CPApp,"run");
  419. }
  420. }),new objj_method(sel_getUid("loadDefaultTheme"),function(_ae,_af){
  421. with(_ae){
  422. var _b0=objj_msgSend(objj_msgSend(CPThemeBlend,"alloc"),"initWithContentsOfURL:",objj_msgSend(objj_msgSend(CPBundle,"bundleForClass:",objj_msgSend(CPApplication,"class")),"pathForResource:","Aristo.blend"));
  423. objj_msgSend(_b0,"loadWithDelegate:",_ae);
  424. return YES;
  425. }
  426. }),new objj_method(sel_getUid("blendDidFinishLoading:"),function(_b1,_b2,_b3){
  427. with(_b1){
  428. objj_msgSend(CPTheme,"setDefaultTheme:",objj_msgSend(CPTheme,"themeNamed:","Aristo"));
  429. objj_msgSend(_b1,"performActions");
  430. }
  431. }),new objj_method(sel_getUid("loadMainCibFile"),function(_b4,_b5){
  432. with(_b4){
  433. var _b6=objj_msgSend(CPBundle,"mainBundle"),_b7=objj_msgSend(_b6,"objectForInfoDictionaryKey:",_1)||objj_msgSend(_b6,"objectForInfoDictionaryKey:",_2);
  434. if(_b7){
  435. objj_msgSend(CPBundle,"loadCibFile:externalNameTable:loadDelegate:",objj_msgSend(_b6,"pathForResource:",_b7),objj_msgSend(CPDictionary,"dictionaryWithObject:forKey:",CPApp,CPCibOwner),_b4);
  436. return YES;
  437. }
  438. return NO;
  439. }
  440. }),new objj_method(sel_getUid("cibDidFinishLoading:"),function(_b8,_b9,_ba){
  441. with(_b8){
  442. objj_msgSend(_b8,"performActions");
  443. }
  444. })]);