PageRenderTime 24ms CodeModel.GetById 12ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 1ms

/Frameworks/AppKit/rhino.platform/CPWindow.j

http://github.com/jfahrenkrug/MapKit-HelloWorld
Unknown | 1049 lines | 1049 code | 0 blank | 0 comment | 0 complexity | a966967248bcd8dab04e6b9038f67c25 MD5 | raw file
   1I;25;Foundation/CPCountedSet.jI;33;Foundation/CPNotificationCenter.jI;26;Foundation/CPUndoManager.ji;12;CGGeometry.ji;13;CPAnimation.ji;13;CPResponder.jc;39871;
   2CPBorderlessWindowMask=0;
   3CPTitledWindowMask=1<<0;
   4CPClosableWindowMask=1<<1;
   5CPMiniaturizableWindowMask=1<<2;
   6CPResizableWindowMask=1<<3;
   7CPTexturedBackgroundWindowMask=1<<8;
   8CPBorderlessBridgeWindowMask=1<<20;
   9CPHUDBackgroundWindowMask=1<<21;
  10CPWindowNotSizable=0;
  11CPWindowMinXMargin=1;
  12CPWindowWidthSizable=2;
  13CPWindowMaxXMargin=4;
  14CPWindowMinYMargin=8;
  15CPWindowHeightSizable=16;
  16CPWindowMaxYMargin=32;
  17CPBackgroundWindowLevel=-1;
  18CPNormalWindowLevel=4;
  19CPFloatingWindowLevel=5;
  20CPSubmenuWindowLevel=6;
  21CPTornOffMenuWindowLevel=6;
  22CPMainMenuWindowLevel=8;
  23CPStatusWindowLevel=9;
  24CPModalPanelWindowLevel=10;
  25CPPopUpMenuWindowLevel=11;
  26CPDraggingWindowLevel=12;
  27CPScreenSaverWindowLevel=13;
  28CPWindowOut=0;
  29CPWindowAbove=1;
  30CPWindowBelow=2;
  31CPWindowWillCloseNotification="CPWindowWillCloseNotification";
  32CPWindowDidBecomeMainNotification="CPWindowDidBecomeMainNotification";
  33CPWindowDidResignMainNotification="CPWindowDidResignMainNotification";
  34CPWindowDidMoveNotification="CPWindowDidMoveNotification";
  35var _1=20,_2=19,_3=10,_4=10,_5=5,_6=nil;
  36var _7=nil,_8=nil;
  37var _9=objj_allocateClassPair(CPResponder,"CPWindow"),_a=_9.isa;
  38class_addIvars(_9,[new objj_ivar("_windowNumber"),new objj_ivar("_styleMask"),new objj_ivar("_frame"),new objj_ivar("_level"),new objj_ivar("_isVisible"),new objj_ivar("_isAnimating"),new objj_ivar("_hasShadow"),new objj_ivar("_isMovableByWindowBackground"),new objj_ivar("_isDocumentEdited"),new objj_ivar("_isDocumentSaving"),new objj_ivar("_shadowView"),new objj_ivar("_windowView"),new objj_ivar("_contentView"),new objj_ivar("_toolbarView"),new objj_ivar("_mouseOverView"),new objj_ivar("_leftMouseDownView"),new objj_ivar("_rightMouseDownView"),new objj_ivar("_toolbar"),new objj_ivar("_firstResponder"),new objj_ivar("_initialFirstResponder"),new objj_ivar("_delegate"),new objj_ivar("_title"),new objj_ivar("_acceptsMouseMovedEvents"),new objj_ivar("_ignoresMouseEvents"),new objj_ivar("_windowController"),new objj_ivar("_minSize"),new objj_ivar("_maxSize"),new objj_ivar("_undoManager"),new objj_ivar("_representedURL"),new objj_ivar("_registeredDraggedTypes"),new objj_ivar("_registeredDraggedTypesArray"),new objj_ivar("_inclusiveRegisteredDraggedTypes"),new objj_ivar("_defaultButton"),new objj_ivar("_defaultButtonEnabled"),new objj_ivar("_autorecalculatesKeyViewLoop"),new objj_ivar("_keyViewLoopIsDirty"),new objj_ivar("_bridge"),new objj_ivar("_autoresizingMask"),new objj_ivar("_delegateRespondsToWindowWillReturnUndoManagerSelector"),new objj_ivar("_isFullBridge"),new objj_ivar("_fullBridgeSession")]);
  39objj_registerClassPair(_9);
  40objj_addClassForBundle(_9,objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
  41class_addMethods(_9,[new objj_method(sel_getUid("initWithContentRect:styleMask:"),function(_b,_c,_d,_e){
  42with(_b){
  43return objj_msgSend(_b,"initWithContentRect:styleMask:bridge:",_d,_e,nil);
  44}
  45}),new objj_method(sel_getUid("initWithContentRect:styleMask:bridge:"),function(_f,_10,_11,_12,_13){
  46with(_f){
  47_f=objj_msgSendSuper({receiver:_f,super_class:objj_getClass("CPResponder")},"init");
  48if(_f){
  49_isFullBridge=NO;
  50_registeredDraggedTypes=objj_msgSend(CPSet,"set");
  51_registeredDraggedTypesArray=[];
  52_windowNumber=objj_msgSend(CPApp._windows,"count");
  53CPApp._windows[_windowNumber]=_f;
  54_styleMask=_12;
  55_level=CPNormalWindowLevel;
  56_minSize=CGSizeMake(0,0);
  57_maxSize=CGSizeMake(1000000,1000000);
  58var _14=objj_msgSend(objj_msgSend(_f,"class"),"_windowViewClassForStyleMask:",_12);
  59_frame=objj_msgSend(_14,"frameRectForContentRect:",_11);
  60_windowView=objj_msgSend(objj_msgSend(_14,"alloc"),"initWithFrame:styleMask:",CGRectMake(0,0,CGRectGetWidth(_frame),CGRectGetHeight(_frame)),_12);
  61objj_msgSend(_windowView,"_setWindow:",_f);
  62objj_msgSend(_windowView,"setNextResponder:",_f);
  63objj_msgSend(_f,"setMovableByWindowBackground:",_12&CPHUDBackgroundWindowMask);
  64objj_msgSend(_f,"setContentView:",objj_msgSend(objj_msgSend(CPView,"alloc"),"initWithFrame:",CGRectMakeZero()));
  65_firstResponder=_f;
  66objj_msgSend(_f,"setBridge:",_13);
  67objj_msgSend(_f,"setNextResponder:",CPApp);
  68objj_msgSend(_f,"setHasShadow:",_12!==CPBorderlessWindowMask);
  69if(_12&CPBorderlessBridgeWindowMask){
  70objj_msgSend(_f,"setFullBridge:",YES);
  71}
  72_defaultButtonEnabled=YES;
  73_keyViewLoopIsDirty=YES;
  74}
  75return _f;
  76}
  77}),new objj_method(sel_getUid("awakeFromCib"),function(_15,_16){
  78with(_15){
  79if(_initialFirstResponder){
  80objj_msgSend(_15,"makeFirstResponder:",_initialFirstResponder);
  81}
  82_keyViewLoopIsDirty=!objj_msgSend(_15,"_hasKeyViewLoop");
  83}
  84}),new objj_method(sel_getUid("_setWindowView:"),function(_17,_18,_19){
  85with(_17){
  86if(_windowView===_19){
  87return;
  88}
  89var _1a=_windowView;
  90_windowView=_19;
  91}
  92}),new objj_method(sel_getUid("setFullBridge:"),function(_1b,_1c,_1d){
  93with(_1b){
  94_1d=!!_1d;
  95if(_isFullBridge===_1d){
  96return;
  97}
  98_isFullBridge=_1d;
  99if(_isFullBridge){
 100_fullBridgeSession=_CPWindowFullBridgeSessionMake(_windowView,objj_msgSend(_1b,"contentRectForFrameRect:",objj_msgSend(_1b,"frame")),objj_msgSend(_1b,"hasShadow"),objj_msgSend(_1b,"level"));
 101var _1e=objj_msgSend(objj_msgSend(_1b,"class"),"_windowViewClassForFullBridgeStyleMask:",_styleMask),_1f=objj_msgSend(objj_msgSend(_1e,"alloc"),"initWithFrame:styleMask:",CGRectMakeZero(),_styleMask);
 102objj_msgSend(_1b,"_setWindowView:",_1f);
 103objj_msgSend(_1b,"setLevel:",CPBackgroundWindowLevel);
 104objj_msgSend(_1b,"setHasShadow:",NO);
 105objj_msgSend(_1b,"setAutoresizingMask:",CPWindowWidthSizable|CPWindowHeightSizable);
 106objj_msgSend(_1b,"setFrame:",objj_msgSend(_bridge,"visibleFrame"));
 107}else{
 108var _1f=_fullBridgeSession.windowView;
 109objj_msgSend(_1b,"_setWindowView:",_1f);
 110objj_msgSend(_1b,"setLevel:",_fullBridgeSession.level);
 111objj_msgSend(_1b,"setHasShadow:",_fullBridgeSession.hasShadow);
 112objj_msgSend(_1b,"setAutoresizingMask:",CPWindowNotSizable);
 113objj_msgSend(_1b,"setFrame:",objj_msgSend(_1f,"frameRectForContentRect:",_fullBridgeSession.contentRect));
 114}
 115}
 116}),new objj_method(sel_getUid("isFullBridge"),function(_20,_21){
 117with(_20){
 118return _isFullBridge;
 119}
 120}),new objj_method(sel_getUid("styleMask"),function(_22,_23){
 121with(_22){
 122return _styleMask;
 123}
 124}),new objj_method(sel_getUid("contentRectForFrameRect:"),function(_24,_25,_26){
 125with(_24){
 126return objj_msgSend(_windowView,"contentRectForFrameRect:",_26);
 127}
 128}),new objj_method(sel_getUid("frameRectForContentRect:"),function(_27,_28,_29){
 129with(_27){
 130return objj_msgSend(_windowView,"frameRectForContentRect:",_29);
 131}
 132}),new objj_method(sel_getUid("frame"),function(_2a,_2b){
 133with(_2a){
 134return _frame;
 135}
 136}),new objj_method(sel_getUid("setFrame:display:animate:"),function(_2c,_2d,_2e,_2f,_30){
 137with(_2c){
 138if(_30){
 139var _31=objj_msgSend(objj_msgSend(_CPWindowFrameAnimation,"alloc"),"initWithWindow:targetFrame:",_2c,_2e);
 140objj_msgSend(_31,"startAnimation");
 141}else{
 142objj_msgSend(_2c,"setFrameOrigin:",_2e.origin);
 143objj_msgSend(_2c,"setFrameSize:",_2e.size);
 144}
 145}
 146}),new objj_method(sel_getUid("setFrame:"),function(_32,_33,_34){
 147with(_32){
 148objj_msgSend(_32,"setFrame:display:animate:",_34,YES,NO);
 149}
 150}),new objj_method(sel_getUid("setFrameOrigin:"),function(_35,_36,_37){
 151with(_35){
 152var _38=_frame.origin;
 153if((_38.x==_37.x&&_38.y==_37.y)){
 154return;
 155}
 156_38.x=_37.x;
 157_38.y=_37.y;
 158objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"postNotificationName:object:",CPWindowDidMoveNotification,_35);
 159}
 160}),new objj_method(sel_getUid("setFrameSize:"),function(_39,_3a,_3b){
 161with(_39){
 162_3b={width:MIN(MAX(_3b.width,_minSize.width),_maxSize.width),height:MIN(MAX(_3b.height,_minSize.height),_maxSize.height)};
 163if((_frame.size.width==_3b.width&&_frame.size.height==_3b.height)){
 164return;
 165}
 166_frame.size=_3b;
 167objj_msgSend(_windowView,"setFrameSize:",_3b);
 168if(_hasShadow){
 169objj_msgSend(_shadowView,"setFrameSize:",{width:_1+_3b.width+_2,height:_4+_3b.height+_3+_5});
 170}
 171if(!_isAnimating&&objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("windowDidResize:"))){
 172objj_msgSend(_delegate,"windowDidResize:",_39);
 173}
 174}
 175}),new objj_method(sel_getUid("orderFront:"),function(_3c,_3d,_3e){
 176with(_3c){
 177objj_msgSend(_bridge,"order:window:relativeTo:",CPWindowAbove,_3c,nil);
 178}
 179}),new objj_method(sel_getUid("orderBack:"),function(_3f,_40,_41){
 180with(_3f){
 181}
 182}),new objj_method(sel_getUid("orderOut:"),function(_42,_43,_44){
 183with(_42){
 184if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("windowWillClose:"))){
 185objj_msgSend(_delegate,"windowWillClose:",_42);
 186}
 187objj_msgSend(_bridge,"order:window:relativeTo:",CPWindowOut,_42,nil);
 188if(objj_msgSend(CPApp,"keyWindow")==_42){
 189objj_msgSend(_42,"resignKeyWindow");
 190CPApp._keyWindow=nil;
 191}
 192}
 193}),new objj_method(sel_getUid("orderWindow:relativeTo:"),function(_45,_46,_47,_48){
 194with(_45){
 195objj_msgSend(_bridge,"order:window:relativeTo:",_47,_45,CPApp._windows[_48]);
 196}
 197}),new objj_method(sel_getUid("setLevel:"),function(_49,_4a,_4b){
 198with(_49){
 199_level=_4b;
 200}
 201}),new objj_method(sel_getUid("level"),function(_4c,_4d){
 202with(_4c){
 203return _level;
 204}
 205}),new objj_method(sel_getUid("isVisible"),function(_4e,_4f){
 206with(_4e){
 207return _isVisible;
 208}
 209}),new objj_method(sel_getUid("showsResizeIndicator"),function(_50,_51){
 210with(_50){
 211return objj_msgSend(_windowView,"showsResizeIndicator");
 212}
 213}),new objj_method(sel_getUid("setShowsResizeIndicator:"),function(_52,_53,_54){
 214with(_52){
 215objj_msgSend(_windowView,"setShowsResizeIndicator:",_54);
 216}
 217}),new objj_method(sel_getUid("resizeIndicatorOffset"),function(_55,_56){
 218with(_55){
 219return objj_msgSend(_windowView,"resizeIndicatorOffset");
 220}
 221}),new objj_method(sel_getUid("setResizeIndicatorOffset:"),function(_57,_58,_59){
 222with(_57){
 223objj_msgSend(_windowView,"setResizeIndicatorOffset:",_59);
 224}
 225}),new objj_method(sel_getUid("setContentView:"),function(_5a,_5b,_5c){
 226with(_5a){
 227if(_contentView){
 228objj_msgSend(_contentView,"removeFromSuperview");
 229}
 230var _5d=CGRectMake(0,0,CGRectGetWidth(_frame),CGRectGetHeight(_frame));
 231_contentView=_5c;
 232objj_msgSend(_contentView,"setFrame:",objj_msgSend(_5a,"contentRectForFrameRect:",_5d));
 233objj_msgSend(_contentView,"setAutoresizingMask:",CPViewWidthSizable|CPViewHeightSizable);
 234objj_msgSend(_windowView,"addSubview:",_contentView);
 235}
 236}),new objj_method(sel_getUid("contentView"),function(_5e,_5f){
 237with(_5e){
 238return _contentView;
 239}
 240}),new objj_method(sel_getUid("setBackgroundColor:"),function(_60,_61,_62){
 241with(_60){
 242objj_msgSend(_windowView,"setBackgroundColor:",_62);
 243}
 244}),new objj_method(sel_getUid("backgroundColor"),function(_63,_64){
 245with(_63){
 246return objj_msgSend(_windowView,"backgroundColor");
 247}
 248}),new objj_method(sel_getUid("setMinSize:"),function(_65,_66,_67){
 249with(_65){
 250if(CGSizeEqualToSize(_minSize,_67)){
 251return;
 252}
 253_minSize=CGSizeCreateCopy(_67);
 254var _68=CGSizeMakeCopy(objj_msgSend(_65,"frame").size),_69=NO;
 255if(_68.width<_minSize.width){
 256_68.width=_minSize.width;
 257_69=YES;
 258}
 259if(_68.height<_minSize.height){
 260_68.height=_minSize.height;
 261_69=YES;
 262}
 263if(_69){
 264objj_msgSend(_65,"setFrameSize:",_68);
 265}
 266}
 267}),new objj_method(sel_getUid("minSize"),function(_6a,_6b){
 268with(_6a){
 269return _minSize;
 270}
 271}),new objj_method(sel_getUid("setMaxSize:"),function(_6c,_6d,_6e){
 272with(_6c){
 273if(CGSizeEqualToSize(_maxSize,_6e)){
 274return;
 275}
 276_maxSize=CGSizeCreateCopy(_6e);
 277var _6f=CGSizeMakeCopy(objj_msgSend(_6c,"frame").size),_70=NO;
 278if(_6f.width>_maxSize.width){
 279_6f.width=_maxSize.width;
 280_70=YES;
 281}
 282if(_6f.height>_maxSize.height){
 283_6f.height=_maxSize.height;
 284_70=YES;
 285}
 286if(_70){
 287objj_msgSend(_6c,"setFrameSize:",_6f);
 288}
 289}
 290}),new objj_method(sel_getUid("maxSize"),function(_71,_72){
 291with(_71){
 292return _maxSize;
 293}
 294}),new objj_method(sel_getUid("hasShadow"),function(_73,_74){
 295with(_73){
 296return _hasShadow;
 297}
 298}),new objj_method(sel_getUid("setHasShadow:"),function(_75,_76,_77){
 299with(_75){
 300if(_hasShadow===_77){
 301return;
 302}
 303_hasShadow=_77;
 304if(_hasShadow){
 305var _78=objj_msgSend(_windowView,"bounds");
 306_shadowView=objj_msgSend(objj_msgSend(CPView,"alloc"),"initWithFrame:",CGRectMake(-_1,-_3+_5,_1+CGRectGetWidth(_78)+_2,_3+CGRectGetHeight(_78)+_4));
 307if(!_6){
 308var _79=objj_msgSend(CPBundle,"bundleForClass:",objj_msgSend(CPWindow,"class"));
 309_6=objj_msgSend(CPColor,"colorWithPatternImage:",objj_msgSend(objj_msgSend(CPNinePartImage,"alloc"),"initWithImageSlices:",[objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_79,"pathForResource:","CPWindow/CPWindowShadow0.png"),CGSizeMake(20,19)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_79,"pathForResource:","CPWindow/CPWindowShadow1.png"),CGSizeMake(1,19)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_79,"pathForResource:","CPWindow/CPWindowShadow2.png"),CGSizeMake(19,19)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_79,"pathForResource:","CPWindow/CPWindowShadow3.png"),CGSizeMake(20,1)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_79,"pathForResource:","CPWindow/CPWindowShadow4.png"),CGSizeMake(1,1)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_79,"pathForResource:","CPWindow/CPWindowShadow5.png"),CGSizeMake(19,1)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_79,"pathForResource:","CPWindow/CPWindowShadow6.png"),CGSizeMake(20,18)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_79,"pathForResource:","CPWindow/CPWindowShadow7.png"),CGSizeMake(1,18)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_79,"pathForResource:","CPWindow/CPWindowShadow8.png"),CGSizeMake(19,18))]));
 310}
 311objj_msgSend(_shadowView,"setBackgroundColor:",_6);
 312objj_msgSend(_shadowView,"setAutoresizingMask:",CPViewWidthSizable|CPViewHeightSizable);
 313}else{
 314if(_shadowView){
 315_shadowView=nil;
 316}
 317}
 318}
 319}),new objj_method(sel_getUid("setDelegate:"),function(_7a,_7b,_7c){
 320with(_7a){
 321_delegate=_7c;
 322_delegateRespondsToWindowWillReturnUndoManagerSelector=objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("windowWillReturnUndoManager:"));
 323var _7d=objj_msgSend(CPNotificationCenter,"defaultCenter");
 324if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("windowDidBecomeMain:"))){
 325objj_msgSend(_7d,"addObserver:selector:name:object:",_delegate,sel_getUid("windowDidBecomeMain:"),CPWindowDidBecomeMainNotification,_7a);
 326}
 327if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("windowDidResignMain:"))){
 328objj_msgSend(_7d,"addObserver:selector:name:object:",_delegate,sel_getUid("windowDidResignMain:"),CPWindowDidResignMainNotification,_7a);
 329}
 330if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("windowDidMove:"))){
 331objj_msgSend(_7d,"addObserver:selector:name:object:",_delegate,sel_getUid("windowDidMove:"),CPWindowDidMoveNotification,_7a);
 332}
 333}
 334}),new objj_method(sel_getUid("delegate"),function(_7e,_7f){
 335with(_7e){
 336return _delegate;
 337}
 338}),new objj_method(sel_getUid("setWindowController:"),function(_80,_81,_82){
 339with(_80){
 340_windowController=_82;
 341}
 342}),new objj_method(sel_getUid("windowController"),function(_83,_84){
 343with(_83){
 344return _windowController;
 345}
 346}),new objj_method(sel_getUid("doCommandBySelector:"),function(_85,_86,_87){
 347with(_85){
 348if(objj_msgSend(_delegate,"respondsToSelector:",_87)){
 349objj_msgSend(_delegate,"performSelector:",_87);
 350}else{
 351objj_msgSendSuper({receiver:_85,super_class:objj_getClass("CPResponder")},"doCommandBySelector:",_87);
 352}
 353}
 354}),new objj_method(sel_getUid("acceptsFirstResponder"),function(_88,_89){
 355with(_88){
 356return YES;
 357}
 358}),new objj_method(sel_getUid("makeFirstResponder:"),function(_8a,_8b,_8c){
 359with(_8a){
 360if(_firstResponder==_8c){
 361return YES;
 362}
 363if(!objj_msgSend(_firstResponder,"resignFirstResponder")){
 364return NO;
 365}
 366if(!_8c||!objj_msgSend(_8c,"acceptsFirstResponder")||!objj_msgSend(_8c,"becomeFirstResponder")){
 367_firstResponder=_8a;
 368return NO;
 369}
 370_firstResponder=_8c;
 371return YES;
 372}
 373}),new objj_method(sel_getUid("firstResponder"),function(_8d,_8e){
 374with(_8d){
 375return _firstResponder;
 376}
 377}),new objj_method(sel_getUid("acceptsMouseMovedEvents"),function(_8f,_90){
 378with(_8f){
 379return _acceptsMouseMovedEvents;
 380}
 381}),new objj_method(sel_getUid("setAcceptsMouseMovedEvents:"),function(_91,_92,_93){
 382with(_91){
 383_acceptsMouseMovedEvents=_93;
 384}
 385}),new objj_method(sel_getUid("ignoresMouseEvents"),function(_94,_95){
 386with(_94){
 387return _ignoresMouseEvents;
 388}
 389}),new objj_method(sel_getUid("setIgnoresMouseEvents:"),function(_96,_97,_98){
 390with(_96){
 391_ignoresMouseEvents=_98;
 392}
 393}),new objj_method(sel_getUid("title"),function(_99,_9a){
 394with(_99){
 395return _title;
 396}
 397}),new objj_method(sel_getUid("setTitle:"),function(_9b,_9c,_9d){
 398with(_9b){
 399_title=_9d;
 400objj_msgSend(_windowView,"setTitle:",_9d);
 401objj_msgSend(_9b,"_synchronizeMenuBarTitleWithWindowTitle");
 402}
 403}),new objj_method(sel_getUid("setTitleWithRepresentedFilename:"),function(_9e,_9f,_a0){
 404with(_9e){
 405objj_msgSend(_9e,"setRepresentedFilename:",_a0);
 406objj_msgSend(_9e,"setTitle:",objj_msgSend(_a0,"lastPathComponent"));
 407}
 408}),new objj_method(sel_getUid("setRepresentedFilename:"),function(_a1,_a2,_a3){
 409with(_a1){
 410objj_msgSend(_a1,"setRepresentedURL:",_a3);
 411}
 412}),new objj_method(sel_getUid("representedFilename"),function(_a4,_a5){
 413with(_a4){
 414return _representedURL;
 415}
 416}),new objj_method(sel_getUid("setRepresentedURL:"),function(_a6,_a7,_a8){
 417with(_a6){
 418_representedURL=_a8;
 419}
 420}),new objj_method(sel_getUid("representedURL"),function(_a9,_aa){
 421with(_a9){
 422return _representedURL;
 423}
 424}),new objj_method(sel_getUid("setMovableByWindowBackground:"),function(_ab,_ac,_ad){
 425with(_ab){
 426_isMovableByWindowBackground=_ad;
 427}
 428}),new objj_method(sel_getUid("isMovableByWindowBackground"),function(_ae,_af){
 429with(_ae){
 430return _isMovableByWindowBackground;
 431}
 432}),new objj_method(sel_getUid("center"),function(_b0,_b1){
 433with(_b0){
 434var _b2=objj_msgSend(_b0,"frame").size,_b3=objj_msgSend(_bridge,"contentBounds").size;
 435objj_msgSend(_b0,"setFrameOrigin:",CGPointMake((_b3.width-_b2.width)/2,(_b3.height-_b2.height)/2));
 436}
 437}),new objj_method(sel_getUid("sendEvent:"),function(_b4,_b5,_b6){
 438with(_b4){
 439var _b7=objj_msgSend(_b6,"type"),_b8=objj_msgSend(_b6,"locationInWindow");
 440switch(_b7){
 441case CPKeyUp:
 442return objj_msgSend(objj_msgSend(_b4,"firstResponder"),"keyUp:",_b6);
 443case CPKeyDown:
 444return objj_msgSend(objj_msgSend(_b4,"firstResponder"),"keyDown:",_b6);
 445case CPScrollWheel:
 446return objj_msgSend(objj_msgSend(_windowView,"hitTest:",_b8),"scrollWheel:",_b6);
 447case CPLeftMouseUp:
 448if(!_leftMouseDownView){
 449return objj_msgSend(objj_msgSend(_windowView,"hitTest:",_b8),"mouseUp:",_b6);
 450}
 451objj_msgSend(_leftMouseDownView,"mouseUp:",_b6);
 452_leftMouseDownView=nil;
 453return;
 454case CPLeftMouseDown:
 455_leftMouseDownView=objj_msgSend(_windowView,"hitTest:",_b8);
 456if(_leftMouseDownView!=_firstResponder&&objj_msgSend(_leftMouseDownView,"acceptsFirstResponder")){
 457objj_msgSend(_b4,"makeFirstResponder:",_leftMouseDownView);
 458}
 459var _b9=objj_msgSend(_b6,"window");
 460if(objj_msgSend(_b9,"isKeyWindow")||objj_msgSend(_b9,"becomesKeyOnlyIfNeeded")){
 461return objj_msgSend(_leftMouseDownView,"mouseDown:",_b6);
 462}else{
 463objj_msgSend(_b4,"makeKeyAndOrderFront:",_b4);
 464if(objj_msgSend(_leftMouseDownView,"acceptsFirstMouse:",_b6)){
 465return objj_msgSend(_leftMouseDownView,"mouseDown:",_b6);
 466}
 467}
 468break;
 469case CPLeftMouseDragged:
 470if(!_leftMouseDownView){
 471return objj_msgSend(objj_msgSend(_windowView,"hitTest:",_b8),"mouseDragged:",_b6);
 472}
 473return objj_msgSend(_leftMouseDownView,"mouseDragged:",_b6);
 474case CPRightMouseUp:
 475return objj_msgSend(_rightMouseDownView,"mouseUp:",_b6);
 476case CPRightMouseDown:
 477_rightMouseDownView=objj_msgSend(_windowView,"hitTest:",_b8);
 478return objj_msgSend(_rightMouseDownView,"mouseDown:",_b6);
 479case CPRightMouseDragged:
 480return objj_msgSend(_rightMouseDownView,"mouseDragged:",_b6);
 481case CPMouseMoved:
 482if(!_acceptsMouseMovedEvents){
 483return;
 484}
 485var _ba=objj_msgSend(_windowView,"hitTest:",_b8);
 486if(_ba!=_mouseOverView){
 487if(_mouseOverView){
 488objj_msgSend(_mouseOverView,"mouseExited:",objj_msgSend(CPEvent,"mouseEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:clickCount:pressure:",CPMouseExited,_b8,objj_msgSend(_b6,"modifierFlags"),objj_msgSend(_b6,"timestamp"),_windowNumber,nil,-1,1,0));
 489}
 490if(_ba){
 491objj_msgSend(_ba,"mouseEntered:",objj_msgSend(CPEvent,"mouseEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:clickCount:pressure:",CPMouseEntered,_b8,objj_msgSend(_b6,"modifierFlags"),objj_msgSend(_b6,"timestamp"),_windowNumber,nil,-1,1,0));
 492}
 493_mouseOverView=_ba;
 494}
 495objj_msgSend(_mouseOverView,"mouseMoved:",_b6);
 496}
 497}
 498}),new objj_method(sel_getUid("windowNumber"),function(_bb,_bc){
 499with(_bb){
 500return _windowNumber;
 501}
 502}),new objj_method(sel_getUid("becomeKeyWindow"),function(_bd,_be){
 503with(_bd){
 504if(_firstResponder!=_bd&&objj_msgSend(_firstResponder,"respondsToSelector:",sel_getUid("becomeKeyWindow"))){
 505objj_msgSend(_firstResponder,"becomeKeyWindow");
 506}
 507}
 508}),new objj_method(sel_getUid("canBecomeKeyWindow"),function(_bf,_c0){
 509with(_bf){
 510return YES;
 511}
 512}),new objj_method(sel_getUid("isKeyWindow"),function(_c1,_c2){
 513with(_c1){
 514return objj_msgSend(CPApp,"keyWindow")==_c1;
 515}
 516}),new objj_method(sel_getUid("makeKeyAndOrderFront:"),function(_c3,_c4,_c5){
 517with(_c3){
 518objj_msgSend(_c3,"orderFront:",_c3);
 519objj_msgSend(_c3,"makeKeyWindow");
 520objj_msgSend(_c3,"makeMainWindow");
 521}
 522}),new objj_method(sel_getUid("makeKeyWindow"),function(_c6,_c7){
 523with(_c6){
 524if(!objj_msgSend(_c6,"canBecomeKeyWindow")){
 525return;
 526}
 527objj_msgSend(CPApp._keyWindow,"resignKeyWindow");
 528CPApp._keyWindow=_c6;
 529objj_msgSend(_c6,"becomeKeyWindow");
 530}
 531}),new objj_method(sel_getUid("resignKeyWindow"),function(_c8,_c9){
 532with(_c8){
 533if(_firstResponder!=_c8&&objj_msgSend(_firstResponder,"respondsToSelector:",sel_getUid("resignKeyWindow"))){
 534objj_msgSend(_firstResponder,"resignKeyWindow");
 535}
 536if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("windowDidResignKey:"))){
 537objj_msgSend(_delegate,"windowDidResignKey:",_c8);
 538}
 539}
 540}),new objj_method(sel_getUid("dragImage:at:offset:event:pasteboard:source:slideBack:"),function(_ca,_cb,_cc,_cd,_ce,_cf,_d0,_d1,_d2){
 541with(_ca){
 542objj_msgSend(objj_msgSend(CPDragServer,"sharedDragServer"),"dragImage:fromWindow:at:offset:event:pasteboard:source:slideBack:",_cc,_ca,objj_msgSend(_ca,"convertBaseToBridge:",_cd),_ce,_cf,_d0,_d1,_d2);
 543}
 544}),new objj_method(sel_getUid("_noteRegisteredDraggedTypes:"),function(_d3,_d4,_d5){
 545with(_d3){
 546if(!_d5){
 547return;
 548}
 549if(!_inclusiveRegisteredDraggedTypes){
 550_inclusiveRegisteredDraggedTypes=objj_msgSend(CPCountedSet,"set");
 551}
 552objj_msgSend(_inclusiveRegisteredDraggedTypes,"unionSet:",_d5);
 553}
 554}),new objj_method(sel_getUid("_noteUnregisteredDraggedTypes:"),function(_d6,_d7,_d8){
 555with(_d6){
 556if(!_d8){
 557return;
 558}
 559objj_msgSend(_inclusiveRegisteredDraggedTypes,"minusSet:",_d8);
 560if(objj_msgSend(_inclusiveRegisteredDraggedTypes,"count")===0){
 561_inclusiveRegisteredDraggedTypes=nil;
 562}
 563}
 564}),new objj_method(sel_getUid("dragView:at:offset:event:pasteboard:source:slideBack:"),function(_d9,_da,_db,_dc,_dd,_de,_df,_e0,_e1){
 565with(_d9){
 566objj_msgSend(objj_msgSend(CPDragServer,"sharedDragServer"),"dragView:fromWindow:at:offset:event:pasteboard:source:slideBack:",_db,_d9,objj_msgSend(_d9,"convertBaseToBridge:",_dc),_dd,_de,_df,_e0,_e1);
 567}
 568}),new objj_method(sel_getUid("registerForDraggedTypes:"),function(_e2,_e3,_e4){
 569with(_e2){
 570if(!_e4){
 571return;
 572}
 573objj_msgSend(_e2,"_noteUnregisteredDraggedTypes:",_registeredDraggedTypes);
 574objj_msgSend(_registeredDraggedTypes,"addObjectsFromArray:",_e4);
 575objj_msgSend(_e2,"_noteRegisteredDraggedTypes:",_registeredDraggedTypes);
 576_registeredDraggedTypesArray=nil;
 577}
 578}),new objj_method(sel_getUid("registeredDraggedTypes"),function(_e5,_e6){
 579with(_e5){
 580if(!_registeredDraggedTypesArray){
 581_registeredDraggedTypesArray=objj_msgSend(_registeredDraggedTypes,"allObjects");
 582}
 583return _registeredDraggedTypesArray;
 584}
 585}),new objj_method(sel_getUid("unregisterDraggedTypes"),function(_e7,_e8){
 586with(_e7){
 587objj_msgSend(_e7,"_noteUnregisteredDraggedTypes:",_registeredDraggedTypes);
 588_registeredDraggedTypes=objj_msgSend(CPSet,"set");
 589_registeredDraggedTypesArray=[];
 590}
 591}),new objj_method(sel_getUid("setDocumentEdited:"),function(_e9,_ea,_eb){
 592with(_e9){
 593if(_isDocumentEdited==_eb){
 594return;
 595}
 596_isDocumentEdited=_eb;
 597objj_msgSend(CPMenu,"_setMenuBarIconImageAlphaValue:",_isDocumentEdited?0.5:1);
 598}
 599}),new objj_method(sel_getUid("isDocumentEdited"),function(_ec,_ed){
 600with(_ec){
 601return _isDocumentEdited;
 602}
 603}),new objj_method(sel_getUid("setDocumentSaving:"),function(_ee,_ef,_f0){
 604with(_ee){
 605if(_isDocumentSaving==_f0){
 606return;
 607}
 608_isDocumentSaving=_f0;
 609objj_msgSend(_ee,"_synchronizeSaveMenuWithDocumentSaving");
 610objj_msgSend(_windowView,"windowDidChangeDocumentSaving");
 611}
 612}),new objj_method(sel_getUid("isDocumentSaving"),function(_f1,_f2){
 613with(_f1){
 614return _isDocumentSaving;
 615}
 616}),new objj_method(sel_getUid("_synchronizeSaveMenuWithDocumentSaving"),function(_f3,_f4){
 617with(_f3){
 618if(!objj_msgSend(_f3,"isMainWindow")){
 619return;
 620}
 621var _f5=objj_msgSend(CPApp,"mainMenu"),_f6=objj_msgSend(_f5,"indexOfItemWithTitle:",_isDocumentSaving?"Save":"Saving...");
 622if(_f6==CPNotFound){
 623return;
 624}
 625var _f7=objj_msgSend(_f5,"itemAtIndex:",_f6);
 626if(_isDocumentSaving){
 627_7=objj_msgSend(_f7,"image");
 628objj_msgSend(_f7,"setTitle:","Saving...");
 629objj_msgSend(_f7,"setImage:",_8);
 630objj_msgSend(_f7,"setEnabled:",NO);
 631}else{
 632objj_msgSend(_f7,"setTitle:","Save");
 633objj_msgSend(_f7,"setImage:",_7);
 634objj_msgSend(_f7,"setEnabled:",YES);
 635}
 636}
 637}),new objj_method(sel_getUid("performClose:"),function(_f8,_f9,_fa){
 638with(_f8){
 639if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("windowShouldClose:"))){
 640if(!objj_msgSend(_delegate,"windowShouldClose:",_f8)){
 641return;
 642}
 643}else{
 644if(objj_msgSend(_f8,"respondsToSelector:",sel_getUid("windowShouldClose:"))&&!objj_msgSend(_f8,"windowShouldClose:",_f8)){
 645return;
 646}
 647}
 648objj_msgSend(_f8,"close");
 649}
 650}),new objj_method(sel_getUid("close"),function(_fb,_fc){
 651with(_fb){
 652objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"postNotificationName:object:",CPWindowWillCloseNotification,_fb);
 653objj_msgSend(_fb,"orderOut:",nil);
 654}
 655}),new objj_method(sel_getUid("isMainWindow"),function(_fd,_fe){
 656with(_fd){
 657return objj_msgSend(CPApp,"mainWindow")==_fd;
 658}
 659}),new objj_method(sel_getUid("canBecomeMainWindow"),function(_ff,_cmd){
 660with(_ff){
 661if(objj_msgSend(_ff,"isVisible")){
 662return YES;
 663}
 664return NO;
 665}
 666}),new objj_method(sel_getUid("makeMainWindow"),function(self,_cmd){
 667with(self){
 668if(!objj_msgSend(self,"canBecomeMainWindow")){
 669return;
 670}
 671objj_msgSend(CPApp._mainWindow,"resignMainWindow");
 672CPApp._mainWindow=self;
 673objj_msgSend(self,"becomeMainWindow");
 674}
 675}),new objj_method(sel_getUid("becomeMainWindow"),function(self,_cmd){
 676with(self){
 677objj_msgSend(self,"_synchronizeMenuBarTitleWithWindowTitle");
 678objj_msgSend(self,"_synchronizeSaveMenuWithDocumentSaving");
 679objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"postNotificationName:object:",CPWindowDidBecomeMainNotification,self);
 680}
 681}),new objj_method(sel_getUid("resignMainWindow"),function(self,_cmd){
 682with(self){
 683objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"postNotificationName:object:",CPWindowDidResignMainNotification,self);
 684}
 685}),new objj_method(sel_getUid("toolbar"),function(self,_cmd){
 686with(self){
 687return _toolbar;
 688}
 689}),new objj_method(sel_getUid("setToolbar:"),function(self,_cmd,_10b){
 690with(self){
 691if(_toolbar===_10b){
 692return;
 693}
 694objj_msgSend(objj_msgSend(_10b,"_window"),"setToolbar:",nil);
 695objj_msgSend(_toolbar,"_setWindow:",nil);
 696_toolbar=_10b;
 697objj_msgSend(_toolbar,"_setWindow:",self);
 698objj_msgSend(self,"_noteToolbarChanged");
 699}
 700}),new objj_method(sel_getUid("toggleToolbarShown:"),function(self,_cmd,_10e){
 701with(self){
 702var _10f=objj_msgSend(self,"toolbar");
 703objj_msgSend(_10f,"setVisible:",!objj_msgSend(_10f,"isVisible"));
 704}
 705}),new objj_method(sel_getUid("_noteToolbarChanged"),function(self,_cmd){
 706with(self){
 707var _112=CGRectMakeCopy(objj_msgSend(self,"frame")),_113;
 708objj_msgSend(_windowView,"noteToolbarChanged");
 709if(_isFullBridge){
 710_113=objj_msgSend(_bridge,"visibleFrame");
 711}else{
 712_113=CGRectMakeCopy(objj_msgSend(self,"frame"));
 713_113.origin=_112.origin;
 714}
 715objj_msgSend(self,"setFrame:",_113);
 716}
 717}),new objj_method(sel_getUid("_setAttachedSheetFrameOrigin"),function(self,_cmd){
 718with(self){
 719var _116=objj_msgSend(objj_msgSend(self,"contentView"),"frame"),_117=CGRectMakeCopy(objj_msgSend(_attachedSheet,"frame"));
 720_117.origin.y=CGRectGetMinY(_frame)+CGRectGetMinY(_116);
 721_117.origin.x=CGRectGetMinX(_frame)+FLOOR((CGRectGetWidth(_frame)-CGRectGetWidth(_117))/2);
 722objj_msgSend(_attachedSheet,"setFrameOrigin:",_117.origin);
 723}
 724}),new objj_method(sel_getUid("_animateAttachedSheet"),function(self,_cmd){
 725with(self){
 726}
 727}),new objj_method(sel_getUid("_attachSheet:modalDelegate:didEndSelector:contextInfo:"),function(self,_cmd,_11c,_11d,_11e,_11f){
 728with(self){
 729_attachedSheet=_11c;
 730_11c._isSheet=YES;
 731objj_msgSend(self,"_setAttachedSheetFrameOrigin");
 732objj_msgSend(_bridge,"order:window:relativeTo:",CPWindowAbove,_11c,self);
 733}
 734}),new objj_method(sel_getUid("attachedSheet"),function(self,_cmd){
 735with(self){
 736return _attachedSheet;
 737}
 738}),new objj_method(sel_getUid("isSheet"),function(self,_cmd){
 739with(self){
 740return _isSheet;
 741}
 742}),new objj_method(sel_getUid("becomesKeyOnlyIfNeeded"),function(self,_cmd){
 743with(self){
 744return NO;
 745}
 746}),new objj_method(sel_getUid("worksWhenModal"),function(self,_cmd){
 747with(self){
 748return NO;
 749}
 750}),new objj_method(sel_getUid("keyDown:"),function(self,_cmd,_12a){
 751with(self){
 752if(!objj_msgSend(self,"performKeyEquivalent:",_12a)){
 753objj_msgSend(self,"interpretKeyEvents:",[_12a]);
 754}
 755}
 756}),new objj_method(sel_getUid("insertNewline:"),function(self,_cmd,_12d){
 757with(self){
 758if(_defaultButton&&_defaultButtonEnabled){
 759objj_msgSend(_defaultButton,"performClick:",nil);
 760}
 761}
 762}),new objj_method(sel_getUid("insertTab:"),function(self,_cmd,_130){
 763with(self){
 764objj_msgSend(self,"selectNextKeyView:",nil);
 765}
 766}),new objj_method(sel_getUid("_dirtyKeyViewLoop"),function(self,_cmd){
 767with(self){
 768if(_autorecalculatesKeyViewLoop){
 769_keyViewLoopIsDirty=YES;
 770}
 771}
 772}),new objj_method(sel_getUid("_hasKeyViewLoop"),function(self,_cmd){
 773with(self){
 774var _135=[];
 775objj_msgSend(self,"_appendSubviewsOf:toArray:",_contentView,_135);
 776for(var i=0,_137=objj_msgSend(_135,"count");i<_137;i++){
 777if(_135[i]._nextKeyView){
 778return YES;
 779}
 780}
 781return NO;
 782}
 783}),new objj_method(sel_getUid("recalculateKeyViewLoop"),function(self,_cmd){
 784with(self){
 785var _13a=[];
 786objj_msgSend(self,"_appendSubviewsOf:toArray:",_contentView,_13a);
 787var _13b=objj_msgSend(_13a,"sortedArrayUsingFunction:context:",_13c,_contentView),_13d=objj_msgSend(_13b,"count");
 788for(var i=0;i<_13d;i++){
 789objj_msgSend(_13b[i],"setNextKeyView:",_13b[(i+1)%_13d]);
 790}
 791_keyViewLoopIsDirty=NO;
 792}
 793}),new objj_method(sel_getUid("_appendSubviewsOf:toArray:"),function(self,_cmd,_141,_142){
 794with(self){
 795var _143=objj_msgSend(_141,"subviews"),_144=objj_msgSend(_143,"count");
 796while(_144--){
 797objj_msgSend(self,"_appendSubviewsOf:toArray:",_143[_144],_142);
 798}
 799objj_msgSend(_142,"addObject:",_141);
 800}
 801}),new objj_method(sel_getUid("setAutorecalculatesKeyViewLoop:"),function(self,_cmd,_147){
 802with(self){
 803if(_autorecalculatesKeyViewLoop===_147){
 804return;
 805}
 806_autorecalculatesKeyViewLoop=_147;
 807objj_msgSend(self,"_dirtyKeyViewLoop");
 808}
 809}),new objj_method(sel_getUid("autorecalculatesKeyViewLoop"),function(self,_cmd){
 810with(self){
 811return _autorecalculatesKeyViewLoop;
 812}
 813}),new objj_method(sel_getUid("selectNextKeyView:"),function(self,_cmd,_14c){
 814with(self){
 815if(objj_msgSend(_firstResponder,"isKindOfClass:",objj_msgSend(CPView,"class"))){
 816objj_msgSend(self,"selectKeyViewFollowingView:",_firstResponder);
 817}
 818}
 819}),new objj_method(sel_getUid("selectPreviousKeyView:"),function(self,_cmd,_14f){
 820with(self){
 821if(objj_msgSend(_firstResponder,"isKindOfClass:",objj_msgSend(CPView,"class"))){
 822objj_msgSend(self,"selectKeyViewPrecedingView:",_firstResponder);
 823}
 824}
 825}),new objj_method(sel_getUid("selectKeyViewFollowingView:"),function(self,_cmd,_152){
 826with(self){
 827if(_keyViewLoopIsDirty){
 828objj_msgSend(self,"recalculateKeyViewLoop");
 829}
 830objj_msgSend(self,"makeFirstResponder:",objj_msgSend(_152,"nextValidKeyView"));
 831}
 832}),new objj_method(sel_getUid("selectKeyViewPrecedingView:"),function(self,_cmd,_155){
 833with(self){
 834if(_keyViewLoopIsDirty){
 835objj_msgSend(self,"recalculateKeyViewLoop");
 836}
 837objj_msgSend(self,"makeFirstResponder:",objj_msgSend(_155,"previousValidKeyView"));
 838}
 839}),new objj_method(sel_getUid("setDefaultButtonCell:"),function(self,_cmd,_158){
 840with(self){
 841objj_msgSend(self,"setDefaultButton:",_158);
 842}
 843}),new objj_method(sel_getUid("defaultButtonCell"),function(self,_cmd){
 844with(self){
 845return objj_msgSend(self,"defaultButton");
 846}
 847}),new objj_method(sel_getUid("setDefaultButton:"),function(self,_cmd,_15d){
 848with(self){
 849objj_msgSend(_defaultButton,"setDefaultButton:",NO);
 850_defaultButton=_15d;
 851objj_msgSend(_defaultButton,"setDefaultButton:",YES);
 852}
 853}),new objj_method(sel_getUid("defaultButton"),function(self,_cmd){
 854with(self){
 855return _defaultButton;
 856}
 857}),new objj_method(sel_getUid("enableKeyEquivalentForDefaultButton"),function(self,_cmd){
 858with(self){
 859_defaultButtonEnabled=YES;
 860}
 861}),new objj_method(sel_getUid("enableKeyEquivalentForDefaultButtonCell"),function(self,_cmd){
 862with(self){
 863objj_msgSend(self,"enableKeyEquivalentForDefaultButton");
 864}
 865}),new objj_method(sel_getUid("disableKeyEquivalentForDefaultButton"),function(self,_cmd){
 866with(self){
 867_defaultButtonEnabled=NO;
 868}
 869}),new objj_method(sel_getUid("disableKeyEquivalentForDefaultButtonCell"),function(self,_cmd){
 870with(self){
 871objj_msgSend(self,"disableKeyEquivalentForDefaultButton");
 872}
 873})]);
 874class_addMethods(_a,[new objj_method(sel_getUid("initialize"),function(self,_cmd){
 875with(self){
 876if(self!=objj_msgSend(CPWindow,"class")){
 877return;
 878}
 879var _16a=objj_msgSend(CPBundle,"bundleForClass:",objj_msgSend(CPWindow,"class"));
 880_8=objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_16a,"pathForResource:","CPProgressIndicator/CPProgressIndicatorSpinningStyleRegular.gif"),CGSizeMake(16,16));
 881}
 882}),new objj_method(sel_getUid("_windowViewClassForStyleMask:"),function(self,_cmd,_16d){
 883with(self){
 884if(_16d&CPHUDBackgroundWindowMask){
 885return _CPHUDWindowView;
 886}else{
 887if(_16d===CPBorderlessWindowMask){
 888return _CPBorderlessWindowView;
 889}
 890}
 891return _CPStandardWindowView;
 892}
 893}),new objj_method(sel_getUid("_windowViewClassForFullBridgeStyleMask:"),function(self,_cmd,_170){
 894with(self){
 895return _CPBorderlessBridgeWindowView;
 896}
 897}),new objj_method(sel_getUid("frameRectForContentRect:styleMask:"),function(self,_cmd,_173,_174){
 898with(self){
 899return objj_msgSend(objj_msgSend(objj_msgSend(self,"class"),"_windowViewClassForStyleMask:",_styleMask),"frameRectForContentRect:",_173);
 900}
 901})]);
 902var _13c=function(a,b,_177){
 903var _178=objj_msgSend(a,"convertRect:toView:",objj_msgSend(a,"bounds"),nil),_179=objj_msgSend(b,"convertRect:toView:",objj_msgSend(b,"bounds"),nil);
 904if(CGRectGetMinY(_178)<CGRectGetMinY(_179)){
 905return -1;
 906}else{
 907if(CGRectGetMinY(_178)==CGRectGetMinY(_179)&&CGRectGetMinX(_178)<CGRectGetMinX(_179)){
 908return -1;
 909}else{
 910if(CGRectGetMinX(_178)==CGRectGetMinX(_179)&&CGRectGetMinX(_178)==CGRectGetMinX(_179)){
 911return 0;
 912}else{
 913return 1;
 914}
 915}
 916}
 917};
 918var _9=objj_getClass("CPWindow");
 919if(!_9){
 920objj_exception_throw(new objj_exception(OBJJClassNotFoundException,"*** Could not find definition for class \"CPWindow\""));
 921}
 922var _a=_9.isa;
 923class_addMethods(_9,[new objj_method(sel_getUid("_synchronizeMenuBarTitleWithWindowTitle"),function(self,_cmd){
 924with(self){
 925if(!objj_msgSend(_windowController,"document")||!objj_msgSend(self,"isMainWindow")){
 926return;
 927}
 928objj_msgSend(CPMenu,"setMenuBarTitle:",_title);
 929}
 930})]);
 931var _9=objj_getClass("CPWindow");
 932if(!_9){
 933objj_exception_throw(new objj_exception(OBJJClassNotFoundException,"*** Could not find definition for class \"CPWindow\""));
 934}
 935var _a=_9.isa;
 936class_addMethods(_9,[new objj_method(sel_getUid("setBridge:"),function(self,_cmd,_17e){
 937with(self){
 938if(_bridge==_17e){
 939return;
 940}
 941if(_bridge){
 942objj_msgSend(self,"orderOut:",self);
 943}
 944_bridge=_17e;
 945if(objj_msgSend(self,"isFullBridge")){
 946objj_msgSend(self,"setFrame:",objj_msgSend(_17e,"contentBounds"));
 947}
 948}
 949}),new objj_method(sel_getUid("resizeWithOldBridgeSize:"),function(self,_cmd,_181){
 950with(self){
 951if(objj_msgSend(self,"isFullBridge")){
 952return objj_msgSend(self,"setFrame:",objj_msgSend(_bridge,"visibleFrame"));
 953}
 954if(_autoresizingMask==CPWindowNotSizable){
 955return;
 956}
 957var _182=objj_msgSend(_bridge,"contentBounds"),_183=CGRectMakeCopy(_frame),dX=(CGRectGetWidth(_182)-_181.width)/(((_autoresizingMask&CPWindowMinXMargin)?1:0)+(_autoresizingMask&CPWindowWidthSizable?1:0)+(_autoresizingMask&CPWindowMaxXMargin?1:0)),dY=(CGRectGetHeight(_182)-_181.height)/((_autoresizingMask&CPWindowMinYMargin?1:0)+(_autoresizingMask&CPWindowHeightSizable?1:0)+(_autoresizingMask&CPWindowMaxYMargin?1:0));
 958if(_autoresizingMask&CPWindowMinXMargin){
 959_183.origin.x+=dX;
 960}
 961if(_autoresizingMask&CPWindowWidthSizable){
 962_183.size.width+=dX;
 963}
 964if(_autoresizingMask&CPWindowMinYMargin){
 965_183.origin.y+=dY;
 966}
 967if(_autoresizingMask&CPWindowHeightSizable){
 968_183.size.height+=dY;
 969}
 970objj_msgSend(self,"setFrame:",_183);
 971}
 972}),new objj_method(sel_getUid("setAutoresizingMask:"),function(self,_cmd,_188){
 973with(self){
 974_autoresizingMask=_188;
 975}
 976}),new objj_method(sel_getUid("autoresizingMask"),function(self,_cmd){
 977with(self){
 978return _autoresizingMask;
 979}
 980}),new objj_method(sel_getUid("convertBaseToBridge:"),function(self,_cmd,_18d){
 981with(self){
 982var _18e=objj_msgSend(self,"frame").origin;
 983return CGPointMake(_18d.x+_18e.x,_18d.y+_18e.y);
 984}
 985}),new objj_method(sel_getUid("convertBridgeToBase:"),function(self,_cmd,_191){
 986with(self){
 987var _192=objj_msgSend(self,"frame").origin;
 988return CGPointMake(_191.x-_192.x,_191.y-_192.y);
 989}
 990}),new objj_method(sel_getUid("undoManager"),function(self,_cmd){
 991with(self){
 992if(_delegateRespondsToWindowWillReturnUndoManagerSelector){
 993return objj_msgSend(_delegate,"windowWillReturnUndoManager:",self);
 994}
 995if(!_undoManager){
 996_undoManager=objj_msgSend(objj_msgSend(CPUndoManager,"alloc"),"init");
 997}
 998return _undoManager;
 999}
1000}),new objj_method(sel_getUid("undo:"),function(self,_cmd,_197){
1001with(self){
1002objj_msgSend(objj_msgSend(self,"undoManager"),"undo");
1003}
1004}),new objj_method(sel_getUid("redo:"),function(self,_cmd,_19a){
1005with(self){
1006objj_msgSend(objj_msgSend(self,"undoManager"),"redo");
1007}
1008}),new objj_method(sel_getUid("containsPoint:"),function(self,_cmd,_19d){
1009with(self){
1010return CGRectContainsPoint(_frame,_19d);
1011}
1012})]);
1013var _19e=function(_19f,_1a0,_1a1){
1014return _19f+(_1a0-_19f)*_1a1;
1015};
1016var _9=objj_allocateClassPair(CPAnimation,"_CPWindowFrameAnimation"),_a=_9.isa;
1017class_addIvars(_9,[new objj_ivar("_window"),new objj_ivar("_startFrame"),new objj_ivar("_targetFrame")]);
1018objj_registerClassPair(_9);
1019objj_addClassForBundle(_9,objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
1020class_addMethods(_9,[new objj_method(sel_getUid("initWithWindow:targetFrame:"),function(self,_cmd,_1a4,_1a5){
1021with(self){
1022self=objj_msgSendSuper({receiver:self,super_class:objj_getClass("CPAnimation")},"initWithDuration:animationCurve:",0.2,CPAnimationLinear);
1023if(self){
1024_window=_1a4;
1025_targetFrame=CGRectMakeCopy(_1a5);
1026_startFrame=CGRectMakeCopy(objj_msgSend(_window,"frame"));
1027}
1028return self;
1029}
1030}),new objj_method(sel_getUid("startAnimation"),function(self,_cmd){
1031with(self){
1032objj_msgSendSuper({receiver:self,super_class:objj_getClass("CPAnimation")},"startAnimation");
1033_window._isAnimating=YES;
1034}
1035}),new objj_method(sel_getUid("setCurrentProgress:"),function(self,_cmd,_1aa){
1036with(self){
1037objj_msgSendSuper({receiver:self,super_class:objj_getClass("CPAnimation")},"setCurrentProgress:",_1aa);
1038var _1ab=objj_msgSend(self,"currentValue");
1039if(_1ab==1){
1040_window._isAnimating=NO;
1041}
1042objj_msgSend(_window,"setFrameOrigin:",CGPointMake(_19e(CGRectGetMinX(_startFrame),CGRectGetMinX(_targetFrame),_1ab),_19e(CGRectGetMinY(_startFrame),CGRectGetMinY(_targetFrame),_1ab)));
1043objj_msgSend(_window,"setFrameSize:",CGSizeMake(_19e(CGRectGetWidth(_startFrame),CGRectGetWidth(_targetFrame),_1ab),_19e(CGRectGetHeight(_startFrame),CGRectGetHeight(_targetFrame),_1ab)));
1044}
1045})]);
1046_CPWindowFullBridgeSessionMake=function(_1ac,_1ad,_1ae,_1af){
1047return {windowView:_1ac,contentRect:_1ad,hasShadow:_1ae,level:_1af};
1048};
1049i;15;_CPWindowView.ji;23;_CPStandardWindowView.ji;18;_CPHUDWindowView.ji;25;_CPBorderlessWindowView.ji;31;_CPBorderlessBridgeWindowView.ji;14;CPDragServer.ji;19;CPDOMWindowBridge.ji;8;CPView.j