/Frameworks/Foundation/objj.platform/CPInvocation.j

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

  1. i;10;CPObject.ji;13;CPException.jc;2623;
  2. var _1=objj_allocateClassPair(CPObject,"CPInvocation"),_2=_1.isa;
  3. class_addIvars(_1,[new objj_ivar("_returnValue"),new objj_ivar("_arguments"),new objj_ivar("_methodSignature")]);
  4. objj_registerClassPair(_1);
  5. objj_addClassForBundle(_1,objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
  6. class_addMethods(_1,[new objj_method(sel_getUid("initWithMethodSignature:"),function(_3,_4,_5){
  7. with(_3){
  8. _3=objj_msgSendSuper({receiver:_3,super_class:objj_getClass("CPObject")},"init");
  9. if(_3){
  10. _arguments=[];
  11. _methodSignature=_5;
  12. }
  13. return _3;
  14. }
  15. }),new objj_method(sel_getUid("setSelector:"),function(_6,_7,_8){
  16. with(_6){
  17. _arguments[1]=_8;
  18. }
  19. }),new objj_method(sel_getUid("selector"),function(_9,_a){
  20. with(_9){
  21. return _arguments[1];
  22. }
  23. }),new objj_method(sel_getUid("setTarget:"),function(_b,_c,_d){
  24. with(_b){
  25. _arguments[0]=_d;
  26. }
  27. }),new objj_method(sel_getUid("target"),function(_e,_f){
  28. with(_e){
  29. return _arguments[0];
  30. }
  31. }),new objj_method(sel_getUid("setArgument:atIndex:"),function(_10,_11,_12,_13){
  32. with(_10){
  33. _arguments[_13]=_12;
  34. }
  35. }),new objj_method(sel_getUid("argumentAtIndex:"),function(_14,_15,_16){
  36. with(_14){
  37. return _arguments[_16];
  38. }
  39. }),new objj_method(sel_getUid("setReturnValue:"),function(_17,_18,_19){
  40. with(_17){
  41. _returnValue=_19;
  42. }
  43. }),new objj_method(sel_getUid("returnValue"),function(_1a,_1b){
  44. with(_1a){
  45. return _returnValue;
  46. }
  47. }),new objj_method(sel_getUid("invoke"),function(_1c,_1d){
  48. with(_1c){
  49. _returnValue=objj_msgSend.apply(objj_msgSend,_arguments);
  50. }
  51. }),new objj_method(sel_getUid("invokeWithTarget:"),function(_1e,_1f,_20){
  52. with(_1e){
  53. _arguments[0]=_20;
  54. _returnValue=objj_msgSend.apply(objj_msgSend,_arguments);
  55. }
  56. })]);
  57. class_addMethods(_2,[new objj_method(sel_getUid("invocationWithMethodSignature:"),function(_21,_22,_23){
  58. with(_21){
  59. return objj_msgSend(objj_msgSend(_21,"alloc"),"initWithMethodSignature:",_23);
  60. }
  61. })]);
  62. var _24="CPInvocationArguments",_25="CPInvocationReturnValue";
  63. var _1=objj_getClass("CPInvocation");
  64. if(!_1){
  65. objj_exception_throw(new objj_exception(OBJJClassNotFoundException,"*** Could not find definition for class \"CPInvocation\""));
  66. }
  67. var _2=_1.isa;
  68. class_addMethods(_1,[new objj_method(sel_getUid("initWithCoder:"),function(_26,_27,_28){
  69. with(_26){
  70. _26=objj_msgSendSuper({receiver:_26,super_class:objj_getClass("CPObject")},"init");
  71. if(_26){
  72. _returnValue=objj_msgSend(_28,"decodeObjectForKey:",_25);
  73. _arguments=objj_msgSend(_28,"decodeObjectForKey:",_24);
  74. }
  75. return _26;
  76. }
  77. }),new objj_method(sel_getUid("encodeWithCoder:"),function(_29,_2a,_2b){
  78. with(_29){
  79. objj_msgSend(_2b,"encodeObject:forKey:",_returnValue,_25);
  80. objj_msgSend(_2b,"encodeObject:forKey:",_arguments,_24);
  81. }
  82. })]);