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

/Frameworks/AppKit/rhino.platform/CPBezierPath.j

http://github.com/jfahrenkrug/MapKit-HelloWorld
Unknown | 133 lines | 133 code | 0 blank | 0 comment | 0 complexity | bfdba1ef76963ea7f45a993ce189ae31 MD5 | raw file
  1I;26;AppKit/CPGraphicsContext.jI;21;Foundation/CPObject.jc;4497;
  2var _1=1;
  3var _2=objj_allocateClassPair(CPObject,"CPBezierPath"),_3=_2.isa;
  4class_addIvars(_2,[new objj_ivar("_path"),new objj_ivar("_lineWidth")]);
  5objj_registerClassPair(_2);
  6objj_addClassForBundle(_2,objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
  7class_addMethods(_2,[new objj_method(sel_getUid("init"),function(_4,_5){
  8with(_4){
  9if(_4=objj_msgSendSuper({receiver:_4,super_class:objj_getClass("CPObject")},"init")){
 10_path=CGPathCreateMutable();
 11_lineWidth=objj_msgSend(objj_msgSend(_4,"class"),"defaultLineWidth");
 12}
 13return _4;
 14}
 15}),new objj_method(sel_getUid("moveToPoint:"),function(_6,_7,_8){
 16with(_6){
 17CGPathMoveToPoint(_path,nil,_8.x,_8.y);
 18}
 19}),new objj_method(sel_getUid("lineToPoint:"),function(_9,_a,_b){
 20with(_9){
 21CGPathAddLineToPoint(_path,nil,_b.x,_b.y);
 22}
 23}),new objj_method(sel_getUid("curveToPoint:controlPoint1:controlPoint2:"),function(_c,_d,_e,_f,_10){
 24with(_c){
 25CGPathAddCurveToPoint(_path,nil,_f.x,_f.y,_10.x,_10.y,_e.x,_e.y);
 26}
 27}),new objj_method(sel_getUid("closePath"),function(_11,_12){
 28with(_11){
 29CGPathCloseSubpath(_path);
 30}
 31}),new objj_method(sel_getUid("stroke"),function(_13,_14){
 32with(_13){
 33var ctx=objj_msgSend(objj_msgSend(CPGraphicsContext,"currentContext"),"graphicsPort");
 34CGContextBeginPath(ctx);
 35CGContextAddPath(ctx,_path);
 36CGContextSetLineWidth(ctx,objj_msgSend(_13,"lineWidth"));
 37CGContextClosePath(ctx);
 38CGContextStrokePath(ctx);
 39}
 40}),new objj_method(sel_getUid("fill"),function(_16,_17){
 41with(_16){
 42var ctx=objj_msgSend(objj_msgSend(CPGraphicsContext,"currentContext"),"graphicsPort");
 43CGContextBeginPath(ctx);
 44CGContextAddPath(ctx,_path);
 45CGContextSetLineWidth(ctx,objj_msgSend(_16,"lineWidth"));
 46CGContextClosePath(ctx);
 47CGContextFillPath(ctx);
 48}
 49}),new objj_method(sel_getUid("lineWidth"),function(_19,_1a){
 50with(_19){
 51return _lineWidth;
 52}
 53}),new objj_method(sel_getUid("setLineWidth:"),function(_1b,_1c,_1d){
 54with(_1b){
 55_lineWidth=_1d;
 56}
 57}),new objj_method(sel_getUid("elementCount"),function(_1e,_1f){
 58with(_1e){
 59return _path.count;
 60}
 61}),new objj_method(sel_getUid("isEmpty"),function(_20,_21){
 62with(_20){
 63return CGPathIsEmpty(_path);
 64}
 65}),new objj_method(sel_getUid("currentPoint"),function(_22,_23){
 66with(_22){
 67return CGPathGetCurrentPoint(_path);
 68}
 69}),new objj_method(sel_getUid("appendBezierPathWithPoints:count:"),function(_24,_25,_26,_27){
 70with(_24){
 71CGPathAddLines(_path,nil,_26,_27);
 72}
 73}),new objj_method(sel_getUid("appendBezierPathWithRect:"),function(_28,_29,_2a){
 74with(_28){
 75CGPathAddRect(_path,nil,_2a);
 76}
 77}),new objj_method(sel_getUid("appendBezierPathWithOvalInRect:"),function(_2b,_2c,_2d){
 78with(_2b){
 79CGPathAddPath(_path,nil,CGPathWithEllipseInRect(_2d));
 80}
 81}),new objj_method(sel_getUid("appendBezierPathWithRoundedRect:xRadius:yRadius:"),function(_2e,_2f,_30,_31,_32){
 82with(_2e){
 83CGPathAddPath(_path,nil,CGPathWithRoundedRectangleInRect(_30,_31,_32,YES,YES,YES,YES));
 84}
 85}),new objj_method(sel_getUid("appendBezierPath:"),function(_33,_34,_35){
 86with(_33){
 87CGPathAddPath(_path,nil,_35._path);
 88}
 89}),new objj_method(sel_getUid("removeAllPoints"),function(_36,_37){
 90with(_36){
 91_path=CGPathCreateMutable();
 92}
 93})]);
 94class_addMethods(_3,[new objj_method(sel_getUid("bezierPath"),function(_38,_39){
 95with(_38){
 96return objj_msgSend(objj_msgSend(objj_msgSend(_38,"class"),"alloc"),"init");
 97}
 98}),new objj_method(sel_getUid("bezierPathWithOvalInRect:"),function(_3a,_3b,_3c){
 99with(_3a){
100var _3d=objj_msgSend(objj_msgSend(_3a,"class"),"bezierPath");
101objj_msgSend(_3d,"appendBezierPathWithOvalInRect:",_3c);
102return _3d;
103}
104}),new objj_method(sel_getUid("bezierPathWithRect:"),function(_3e,_3f,_40){
105with(_3e){
106var _41=objj_msgSend(objj_msgSend(_3e,"class"),"bezierPath");
107objj_msgSend(_41,"appendBezierPathWithRect:",_40);
108return _41;
109}
110}),new objj_method(sel_getUid("defaultLineWidth"),function(_42,_43){
111with(_42){
112return _1;
113}
114}),new objj_method(sel_getUid("setDefaultLineWidth:"),function(_44,_45,_46){
115with(_44){
116_1=_46;
117}
118}),new objj_method(sel_getUid("fillRect:"),function(_47,_48,_49){
119with(_47){
120objj_msgSend(objj_msgSend(objj_msgSend(_47,"class"),"bezierPathWithRect:",_49),"fill");
121}
122}),new objj_method(sel_getUid("strokeRect:"),function(_4a,_4b,_4c){
123with(_4a){
124objj_msgSend(objj_msgSend(objj_msgSend(_4a,"class"),"bezierPathWithRect:",_4c),"stroke");
125}
126}),new objj_method(sel_getUid("strokeLineFromPoint:toPoint:"),function(_4d,_4e,_4f,_50){
127with(_4d){
128var _51=objj_msgSend(objj_msgSend(_4d,"class"),"bezierPath");
129objj_msgSend(_51,"moveToPoint:",_4f);
130objj_msgSend(_51,"lineToPoint:",_50);
131objj_msgSend(_51,"stroke");
132}
133})]);