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

/Frameworks/AppKit/rhino.platform/CPWindowController.j

http://github.com/jfahrenkrug/MapKit-HelloWorld
Unknown | 121 lines | 121 code | 0 blank | 0 comment | 0 complexity | bfc683d4dc44eb243b000b4bc9da4003 MD5 | raw file
  1I;21;Foundation/CPObject.jI;21;Foundation/CPString.ji;13;CPResponder.ji;10;CPWindow.ji;12;CPDocument.jc;4651;
  2var _1=objj_allocateClassPair(CPResponder,"CPWindowController"),_2=_1.isa;
  3class_addIvars(_1,[new objj_ivar("_owner"),new objj_ivar("_window"),new objj_ivar("_document"),new objj_ivar("_windowCibName")]);
  4objj_registerClassPair(_1);
  5objj_addClassForBundle(_1,objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
  6class_addMethods(_1,[new objj_method(sel_getUid("initWithWindow:"),function(_3,_4,_5){
  7with(_3){
  8_3=objj_msgSendSuper({receiver:_3,super_class:objj_getClass("CPResponder")},"init");
  9if(_3){
 10objj_msgSend(_3,"setWindow:",_5);
 11objj_msgSend(_3,"setNextResponder:",CPApp);
 12}
 13return _3;
 14}
 15}),new objj_method(sel_getUid("initWithWindowCibName:"),function(_6,_7,_8){
 16with(_6){
 17return objj_msgSend(_6,"initWithWindowCibName:owner:",_8,_6);
 18}
 19}),new objj_method(sel_getUid("initWithWindowCibName:owner:"),function(_9,_a,_b,_c){
 20with(_9){
 21_9=objj_msgSendSuper({receiver:_9,super_class:objj_getClass("CPResponder")},"init");
 22if(_9){
 23_owner=_c;
 24_windowCibName=_b;
 25objj_msgSend(_9,"setNextResponder:",CPApp);
 26}
 27return _9;
 28}
 29}),new objj_method(sel_getUid("loadWindow"),function(_d,_e){
 30with(_d){
 31objj_msgSend(_d,"windowWillLoad");
 32objj_msgSend(_d,"setWindow:",CPApp._keyWindow=objj_msgSend(objj_msgSend(CPWindow,"alloc"),"initWithContentRect:styleMask:",CPRectMakeZero(),CPBorderlessBridgeWindowMask|CPTitledWindowMask|CPClosableWindowMask|CPResizableWindowMask));
 33objj_msgSend(_d,"windowDidLoad");
 34}
 35}),new objj_method(sel_getUid("showWindow:"),function(_f,_10,_11){
 36with(_f){
 37var _12=objj_msgSend(_f,"window");
 38if(objj_msgSend(_12,"respondsToSelector:",sel_getUid("becomesKeyOnlyIfNeeded"))&&objj_msgSend(_12,"becomesKeyOnlyIfNeeded")){
 39objj_msgSend(_12,"orderFront:",_11);
 40}else{
 41objj_msgSend(_12,"makeKeyAndOrderFront:",_11);
 42}
 43}
 44}),new objj_method(sel_getUid("isWindowLoaded"),function(_13,_14){
 45with(_13){
 46return _window;
 47}
 48}),new objj_method(sel_getUid("window"),function(_15,_16){
 49with(_15){
 50if(!_window){
 51objj_msgSend(_15,"loadWindow");
 52}
 53return _window;
 54}
 55}),new objj_method(sel_getUid("setWindow:"),function(_17,_18,_19){
 56with(_17){
 57_window=_19;
 58objj_msgSend(_window,"setWindowController:",_17);
 59objj_msgSend(_window,"setNextResponder:",_17);
 60}
 61}),new objj_method(sel_getUid("windowDidLoad"),function(_1a,_1b){
 62with(_1a){
 63objj_msgSend(_document,"windowControllerDidLoadNib:",_1a);
 64objj_msgSend(_1a,"synchronizeWindowTitleWithDocumentName");
 65}
 66}),new objj_method(sel_getUid("windowWillLoad"),function(_1c,_1d){
 67with(_1c){
 68objj_msgSend(_document,"windowControllerWillLoadNib:",_1c);
 69}
 70}),new objj_method(sel_getUid("setDocument:"),function(_1e,_1f,_20){
 71with(_1e){
 72if(_document==_20){
 73return;
 74}
 75var _21=objj_msgSend(CPNotificationCenter,"defaultCenter");
 76if(_document){
 77objj_msgSend(_21,"removeObserver:name:object:",_1e,CPDocumentWillSaveNotification,_document);
 78objj_msgSend(_21,"removeObserver:name:object:",_1e,CPDocumentDidSaveNotification,_document);
 79objj_msgSend(_21,"removeObserver:name:object:",_1e,CPDocumentDidFailToSaveNotification,_document);
 80}
 81_document=_20;
 82if(_document){
 83objj_msgSend(_21,"addObserver:selector:name:object:",_1e,sel_getUid("_documentWillSave:"),CPDocumentWillSaveNotification,_document);
 84objj_msgSend(_21,"addObserver:selector:name:object:",_1e,sel_getUid("_documentDidSave:"),CPDocumentDidSaveNotification,_document);
 85objj_msgSend(_21,"addObserver:selector:name:object:",_1e,sel_getUid("_documentDidFailToSave:"),CPDocumentDidFailToSaveNotification,_document);
 86objj_msgSend(_1e,"setDocumentEdited:",objj_msgSend(_document,"isDocumentEdited"));
 87}
 88objj_msgSend(_1e,"synchronizeWindowTitleWithDocumentName");
 89}
 90}),new objj_method(sel_getUid("_documentWillSave:"),function(_22,_23,_24){
 91with(_22){
 92objj_msgSend(objj_msgSend(_22,"window"),"setDocumentSaving:",YES);
 93}
 94}),new objj_method(sel_getUid("_documentDidSave:"),function(_25,_26,_27){
 95with(_25){
 96objj_msgSend(objj_msgSend(_25,"window"),"setDocumentSaving:",NO);
 97}
 98}),new objj_method(sel_getUid("_documentDidFailToSave:"),function(_28,_29,_2a){
 99with(_28){
100objj_msgSend(objj_msgSend(_28,"window"),"setDocumentSaving:",NO);
101}
102}),new objj_method(sel_getUid("document"),function(_2b,_2c){
103with(_2b){
104return _document;
105}
106}),new objj_method(sel_getUid("setDocumentEdited:"),function(_2d,_2e,_2f){
107with(_2d){
108objj_msgSend(objj_msgSend(_2d,"window"),"setDocumentEdited:",_2f);
109}
110}),new objj_method(sel_getUid("synchronizeWindowTitleWithDocumentName"),function(_30,_31){
111with(_30){
112if(!_document||!_window){
113return;
114}
115objj_msgSend(_window,"setTitle:",objj_msgSend(_30,"windowTitleForDocumentDisplayName:",objj_msgSend(_document,"displayName")));
116}
117}),new objj_method(sel_getUid("windowTitleForDocumentDisplayName:"),function(_32,_33,_34){
118with(_32){
119return _34;
120}
121})]);