PageRenderTime 21ms CodeModel.GetById 16ms app.highlight 2ms RepoModel.GetById 0ms app.codeStats 1ms

/Frameworks/AppKit/rhino.platform/CPResponder.j

http://github.com/jfahrenkrug/MapKit-HelloWorld
Unknown | 189 lines | 189 code | 0 blank | 0 comment | 0 complexity | 9629cfb0e641f91c7929befe56dd5c4b MD5 | raw file
  1I;21;Foundation/CPObject.jc;5510;
  2CPDeleteKeyCode=8;
  3CPTabKeyCode=9;
  4CPReturnKeyCode=13;
  5CPEscapeKeyCode=27;
  6CPLeftArrowKeyCode=37;
  7CPUpArrowKeyCode=38;
  8CPRightArrowKeyCode=39;
  9CPDownArrowKeyCode=40;
 10var _1=objj_allocateClassPair(CPObject,"CPResponder"),_2=_1.isa;
 11class_addIvars(_1,[new objj_ivar("_menu"),new objj_ivar("_nextResponder")]);
 12objj_registerClassPair(_1);
 13objj_addClassForBundle(_1,objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
 14class_addMethods(_1,[new objj_method(sel_getUid("acceptsFirstResponder"),function(_3,_4){
 15with(_3){
 16return NO;
 17}
 18}),new objj_method(sel_getUid("becomeFirstResponder"),function(_5,_6){
 19with(_5){
 20return YES;
 21}
 22}),new objj_method(sel_getUid("resignFirstResponder"),function(_7,_8){
 23with(_7){
 24return YES;
 25}
 26}),new objj_method(sel_getUid("setNextResponder:"),function(_9,_a,_b){
 27with(_9){
 28_nextResponder=_b;
 29}
 30}),new objj_method(sel_getUid("nextResponder"),function(_c,_d){
 31with(_c){
 32return _nextResponder;
 33}
 34}),new objj_method(sel_getUid("interpretKeyEvents:"),function(_e,_f,_10){
 35with(_e){
 36var _11,_12=0;
 37while(_11=_10[_12++]){
 38switch(objj_msgSend(_11,"keyCode")){
 39case CPLeftArrowKeyCode:
 40objj_msgSend(_e,"moveBackward:",_e);
 41break;
 42case CPRightArrowKeyCode:
 43objj_msgSend(_e,"moveForward:",_e);
 44break;
 45case CPUpArrowKeyCode:
 46objj_msgSend(_e,"moveUp:",_e);
 47break;
 48case CPDownArrowKeyCode:
 49objj_msgSend(_e,"moveDown:",_e);
 50break;
 51case CPDeleteKeyCode:
 52objj_msgSend(_e,"deleteBackward:",_e);
 53break;
 54case CPReturnKeyCode:
 55case 3:
 56objj_msgSend(_e,"insertLineBreak:",_e);
 57break;
 58case CPEscapeKeyCode:
 59objj_msgSend(_e,"cancel:",_e);
 60break;
 61case CPTabKeyCode:
 62var _13=objj_msgSend(_11,"modifierFlags")&CPShiftKeyMask;
 63if(!_13){
 64objj_msgSend(_e,"insertTab:",_e);
 65}else{
 66objj_msgSend(_e,"insertBackTab:",_e);
 67}
 68break;
 69default:
 70objj_msgSend(_e,"insertText:",objj_msgSend(_11,"characters"));
 71}
 72}
 73}
 74}),new objj_method(sel_getUid("mouseDown:"),function(_14,_15,_16){
 75with(_14){
 76objj_msgSend(_nextResponder,"performSelector:withObject:",_15,_16);
 77}
 78}),new objj_method(sel_getUid("mouseDragged:"),function(_17,_18,_19){
 79with(_17){
 80objj_msgSend(_nextResponder,"performSelector:withObject:",_18,_19);
 81}
 82}),new objj_method(sel_getUid("mouseUp:"),function(_1a,_1b,_1c){
 83with(_1a){
 84objj_msgSend(_nextResponder,"performSelector:withObject:",_1b,_1c);
 85}
 86}),new objj_method(sel_getUid("mouseMoved:"),function(_1d,_1e,_1f){
 87with(_1d){
 88objj_msgSend(_nextResponder,"performSelector:withObject:",_1e,_1f);
 89}
 90}),new objj_method(sel_getUid("mouseEntered:"),function(_20,_21,_22){
 91with(_20){
 92objj_msgSend(_nextResponder,"performSelector:withObject:",_21,_22);
 93}
 94}),new objj_method(sel_getUid("mouseExited:"),function(_23,_24,_25){
 95with(_23){
 96objj_msgSend(_nextResponder,"performSelector:withObject:",_24,_25);
 97}
 98}),new objj_method(sel_getUid("scrollWheel:"),function(_26,_27,_28){
 99with(_26){
100objj_msgSend(_nextResponder,"performSelector:withObject:",_27,_28);
101}
102}),new objj_method(sel_getUid("keyDown:"),function(_29,_2a,_2b){
103with(_29){
104objj_msgSend(_nextResponder,"performSelector:withObject:",_2a,_2b);
105}
106}),new objj_method(sel_getUid("keyUp:"),function(_2c,_2d,_2e){
107with(_2c){
108objj_msgSend(_nextResponder,"performSelector:withObject:",_2d,_2e);
109}
110}),new objj_method(sel_getUid("performKeyEquivalent:"),function(_2f,_30,_31){
111with(_2f){
112return NO;
113}
114}),new objj_method(sel_getUid("deleteBackward:"),function(_32,_33,_34){
115with(_32){
116}
117}),new objj_method(sel_getUid("insertLineBreak:"),function(_35,_36,_37){
118with(_35){
119objj_msgSend(_35,"insertNewline:",_37);
120}
121}),new objj_method(sel_getUid("insertNewline:"),function(_38,_39,_3a){
122with(_38){
123objj_msgSend(_38,"insertNewline:",_3a);
124}
125}),new objj_method(sel_getUid("cancel:"),function(_3b,_3c,_3d){
126with(_3b){
127}
128}),new objj_method(sel_getUid("insertTab:"),function(_3e,_3f,_40){
129with(_3e){
130}
131}),new objj_method(sel_getUid("insertBackTab:"),function(_41,_42,_43){
132with(_41){
133}
134}),new objj_method(sel_getUid("insertText:"),function(_44,_45,_46){
135with(_44){
136}
137}),new objj_method(sel_getUid("doCommandBySelector:"),function(_47,_48,_49){
138with(_47){
139if(objj_msgSend(_47,"respondsToSelector:",_49)){
140objj_msgSend(_47,"performSelector:",_49);
141}else{
142objj_msgSend(_nextResponder,"doCommandBySelector:",_49);
143}
144}
145}),new objj_method(sel_getUid("tryToPerform:with:"),function(_4a,_4b,_4c,_4d){
146with(_4a){
147if(objj_msgSend(_4a,"respondsToSelector:",_4c)){
148objj_msgSend(_4a,"performSelector:withObject:",_4c,_4d);
149return YES;
150}
151return objj_msgSend(_nextResponder,"tryToPerform:with:",_4c,_4d);
152}
153}),new objj_method(sel_getUid("setMenu:"),function(_4e,_4f,_50){
154with(_4e){
155_menu=_50;
156}
157}),new objj_method(sel_getUid("menu"),function(_51,_52){
158with(_51){
159return _menu;
160}
161}),new objj_method(sel_getUid("undoManager"),function(_53,_54){
162with(_53){
163return objj_msgSend(_nextResponder,"performSelector:",_54);
164}
165}),new objj_method(sel_getUid("noResponderFor:"),function(_55,_56,_57){
166with(_55){
167}
168})]);
169var _58="CPResponderNextResponderKey";
170var _1=objj_getClass("CPResponder");
171if(!_1){
172objj_exception_throw(new objj_exception(OBJJClassNotFoundException,"*** Could not find definition for class \"CPResponder\""));
173}
174var _2=_1.isa;
175class_addMethods(_1,[new objj_method(sel_getUid("initWithCoder:"),function(_59,_5a,_5b){
176with(_59){
177_59=objj_msgSendSuper({receiver:_59,super_class:objj_getClass("CPObject")},"init");
178if(_59){
179_nextResponder=objj_msgSend(_5b,"decodeObjectForKey:",_58);
180}
181return _59;
182}
183}),new objj_method(sel_getUid("encodeWithCoder:"),function(_5c,_5d,_5e){
184with(_5c){
185if(_nextResponder!==nil){
186objj_msgSend(_5e,"encodeConditionalObject:forKey:",_nextResponder,_58);
187}
188}
189})]);