PageRenderTime 20ms CodeModel.GetById 11ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/Frameworks/AppKit/rhino.platform/CGContext.j

http://github.com/jfahrenkrug/MapKit-HelloWorld
Unknown | 680 lines | 680 code | 0 blank | 0 comment | 0 complexity | bba763f062dd2491225f26ab36777526 MD5 | raw file
  1i;12;CGGeometry.ji;19;CGAffineTransform.ji;8;CGPath.jc;20322;
  2kCGLineCapButt=0;
  3kCGLineCapRound=1;
  4kCGLineCapSquare=2;
  5kCGLineJoinMiter=0;
  6kCGLineJoinRound=1;
  7kCGLineJoinBevel=2;
  8kCGPathFill=0;
  9kCGPathEOFill=1;
 10kCGPathStroke=2;
 11kCGPathFillStroke=3;
 12kCGPathEOFillStroke=4;
 13kCGBlendModeNormal=0;
 14kCGBlendModeMultiply=1;
 15kCGBlendModeScreen=2;
 16kCGBlendModeOverlay=3;
 17kCGBlendModeDarken=4;
 18kCGBlendModeLighten=5;
 19kCGBlendModeColorDodge=6;
 20kCGBlendModeColorBurn=7;
 21kCGBlendModeSoftLight=8;
 22kCGBlendModeHardLight=9;
 23kCGBlendModeDifference=10;
 24kCGBlendModeExclusion=11;
 25kCGBlendModeHue=12;
 26kCGBlendModeSaturation=13;
 27kCGBlendModeColor=14;
 28kCGBlendModeLuminosity=15;
 29kCGBlendModeClear=16;
 30kCGBlendModeCopy=17;
 31kCGBlendModeSourceIn=18;
 32kCGBlendModeSourceOut=19;
 33kCGBlendModeSourceAtop=20;
 34kCGBlendModeDestinationOver=21;
 35kCGBlendModeDestinationIn=22;
 36kCGBlendModeDestinationOut=23;
 37kCGBlendModeDestinationAtop=24;
 38kCGBlendModeXOR=25;
 39kCGBlendModePlusDarker=26;
 40kCGBlendModePlusLighter=27;
 41CGContextRelease=function(){
 42};
 43CGContextRetain=function(_1){
 44return _1;
 45};
 46if(!CPFeatureIsCompatible(CPHTMLCanvasFeature)){
 47CGGStateCreate=function(){
 48return {alpha:1,strokeStyle:"#000",fillStyle:"#ccc",lineWidth:1,lineJoin:kCGLineJoinMiter,lineCap:kCGLineCapButt,miterLimit:10,globalAlpha:1,blendMode:kCGBlendModeNormal,shadowOffset:{width:0,height:0},shadowBlur:0,shadowColor:NULL,CTM:{a:1,b:0,c:0,d:1,tx:0,ty:0}};
 49};
 50CGGStateCreateCopy=function(_2){
 51return {alpha:_2.alpha,strokeStyle:_2.strokeStyle,fillStyle:_2.fillStyle,lineWidth:_2.lineWidth,lineJoin:_2.lineJoin,lineCap:_2.lineCap,miterLimit:_2.miterLimit,globalAlpha:_2.globalAlpha,blendMode:_2.blendMode,shadowOffset:_2.shadowOffset,shadowBlur:_2.shadowBlur,shadowColor:_2.shadowColor,CTM:{a:_2.CTM.a,b:_2.CTM.b,c:_2.CTM.c,d:_2.CTM.d,tx:_2.CTM.tx,ty:_2.CTM.ty}};
 52};
 53CGBitmapGraphicsContextCreate=function(){
 54return {DOMElement:document.createElement("div"),path:NULL,gState:CGGStateCreate(),gStateStack:[]};
 55};
 56CGContextSaveGState=function(_3){
 57_3.gStateStack.push(CGGStateCreateCopy(_3.gState));
 58};
 59CGContextRestoreGState=function(_4){
 60_4.gState=_4.gStateStack.pop();
 61};
 62CGContextSetLineCap=function(_5,_6){
 63_5.gState.lineCap=_6;
 64};
 65CGContextSetLineJoin=function(_7,_8){
 66_7.gState.lineJoin=_8;
 67};
 68CGContextSetLineWidth=function(_9,_a){
 69_9.gState.lineWidth=_a;
 70};
 71CGContextSetMiterLimit=function(_b,_c){
 72_b.gState.miterLimit=_c;
 73};
 74CGContextSetBlendMode=function(_d,_e){
 75_d.gState.blendMode=_e;
 76};
 77CGContextAddArc=function(_f,x,y,_12,_13,_14,_15){
 78CGPathAddArc(_f.path,_f.gState.CTM,x,y,_12,_13,_14,_15);
 79};
 80CGContextAddArcToPoint=function(_16,x1,y1,x2,y2,_1b){
 81CGPathAddArcToPoint(_16.path,_16.gState.CTM,x1,y1,x2,y2,_1b);
 82};
 83CGContextAddCurveToPoint=function(_1c,_1d,_1e,_1f,_20,x,y){
 84CGPathAddCurveToPoint(_1c.path,_1c.gState.CTM,_1d,_1e,_1f,_20,x,y);
 85};
 86CGContextAddLines=function(_23,_24,_25){
 87CGPathAddLines(_23.path,_23.gState.CTM,_24,_25);
 88};
 89CGContextAddLineToPoint=function(_26,x,y){
 90CGPathAddLineToPoint(_26.path,_26.gState.CTM,x,y);
 91};
 92CGContextAddPath=function(_29,_2a){
 93if(!_29||CGPathIsEmpty(_2a)){
 94return;
 95}
 96if(!_29.path){
 97_29.path=CGPathCreateMutable();
 98}
 99CGPathAddPath(_29.path,_29.gState.CTM,_2a);
100};
101CGContextAddQuadCurveToPoint=function(_2b,cpx,cpy,x,y){
102CGPathAddQuadCurveToPoint(_2b.path,_2b.gState.CTM,cpx,cpy,x,y);
103};
104CGContextAddRect=function(_30,_31){
105CGPathAddRect(_30.path,_30.gState.CTM,_31);
106};
107CGContextAddRects=function(_32,_33,_34){
108CGPathAddRects(_32.path,_32.gState.CTM,_33,_34);
109};
110CGContextBeginPath=function(_35){
111_35.path=CGPathCreateMutable();
112};
113CGContextClosePath=function(_36){
114CGPathCloseSubpath(_36.path);
115};
116CGContextMoveToPoint=function(_37,x,y){
117if(!_37.path){
118_37.path=CGPathCreateMutable();
119}
120CGPathMoveToPoint(_37.path,_37.gState.CTM,x,y);
121};
122CGContextFillRect=function(_3a,_3b){
123CGContextFillRects(_3a,[_3b],1);
124};
125CGContextFillRects=function(_3c,_3d,_3e){
126if(arguments[2]===undefined){
127var _3e=_3d.length;
128}
129CGContextBeginPath(_3c);
130CGContextAddRects(_3c,_3d,_3e);
131CGContextClosePath(_3c);
132CGContextDrawPath(_3c,kCGPathFill);
133};
134CGContextStrokeRect=function(_3f,_40){
135CGContextBeginPath(_3f);
136CGContextAddRect(_3f,_40);
137CGContextClosePath(_3f);
138CGContextDrawPath(_3f,kCGPathStroke);
139};
140CGContextStrokeRectWithWidth=function(_41,_42,_43){
141CGContextSaveGState(_41);
142CGContextSetLineWidth(_41,_43);
143CGContextStrokeRect(_41,_42);
144CGContextRestoreGState(_41);
145};
146CGContextConcatCTM=function(_44,_45){
147var CTM=_44.gState.CTM;
148var tx=CTM.tx*_45.a+CTM.ty*_45.c+_45.tx;
149CTM.ty=CTM.tx*_45.b+CTM.ty*_45.d+_45.ty;
150CTM.tx=tx;
151var a=CTM.a*_45.a+CTM.b*_45.c,b=CTM.a*_45.b+CTM.b*_45.d,c=CTM.c*_45.a+CTM.d*_45.c;
152CTM.d=CTM.c*_45.b+CTM.d*_45.d;
153CTM.a=a;
154CTM.b=b;
155CTM.c=c;
156};
157CGContextGetCTM=function(_4b){
158return _4b.gState.CTM;
159};
160CGContextRotateCTM=function(_4c,_4d){
161var _4e=_4c.gState;
162_4e.CTM=CGAffineTransformRotate(_4e.CTM,_4d);
163};
164CGContextScaleCTM=function(_4f,sx,sy){
165var _52=_4f.gState;
166_52.CTM={a:_52.CTM.a*sx,b:_52.CTM.b*sx,c:_52.CTM.c*sy,d:_52.CTM.d*sy,tx:_52.CTM.tx,ty:_52.CTM.ty};
167};
168CGContextTranslateCTM=function(_53,tx,ty){
169var _56=_53.gState;
170_56.CTM={a:_56.CTM.a,b:_56.CTM.b,c:_56.CTM.c,d:_56.CTM.d,tx:_56.CTM.tx+_56.CTM.a*tx+_56.CTM.c*ty,ty:_56.CTM.ty+_56.CTM.b*tx+_56.CTM.d*ty};
171};
172CGContextSetShadow=function(_57,_58,_59){
173var _5a=_57.gState;
174_5a.shadowOffset={width:_58.width,height:_58.height};
175_5a.shadowBlur=_59;
176_5a.shadowColor=objj_msgSend(CPColor,"shadowColor");
177};
178CGContextSetShadowWithColor=function(_5b,_5c,_5d,_5e){
179var _5f=_5b.gState;
180_5f.shadowOffset={width:_5c.width,height:_5c.height};
181_5f.shadowBlur=_5d;
182_5f.shadowColor=_5e;
183};
184CGContextSetAlpha=function(_60,_61){
185_60.gState.alpha=MAX(MIN(_61,1),0);
186};
187}
188CGContextEOFillPath=function(_62){
189CGContextDrawPath(_62,kCGPathEOFill);
190};
191CGContextFillPath=function(_63){
192CGContextDrawPath(_63,kCGPathFill);
193};
194var _64=4*((SQRT2-1)/3);
195CGContextAddEllipseInRect=function(_65,_66){
196CGContextAddPath(_65,CGPathWithEllipseInRect(_66));
197};
198CGContextFillEllipseInRect=function(_67,_68){
199CGContextBeginPath(_67);
200CGContextAddEllipseInRect(_67,_68);
201CGContextClosePath(_67);
202CGContextFillPath(_67);
203};
204CGContextStrokeEllipseInRect=function(_69,_6a){
205CGContextBeginPath(_69);
206CGContextAddEllipseInRect(_69,_6a);
207CGContextClosePath(_69);
208CGContextStrokePath(_69);
209};
210CGContextStrokePath=function(_6b){
211CGContextDrawPath(_6b,kCGPathStroke);
212};
213CGContextStrokeLineSegments=function(_6c,_6d,_6e){
214var i=0;
215if(arguments["count"]==NULL){
216var _6e=_6d.length;
217}
218CGContextBeginPath(_6c);
219for(;i<_6e;i+=2){
220CGContextMoveToPoint(_6c,_6d[i].x,_6d[i].y);
221CGContextAddLineToPoint(_6c,_6d[i+1].x,_6d[i+1].y);
222}
223CGContextStrokePath(_6c);
224};
225CGContextSetFillColor=function(_70,_71){
226if(_71){
227_70.gState.fillStyle=objj_msgSend(_71,"cssString");
228}
229};
230CGContextSetStrokeColor=function(_72,_73){
231if(_73){
232_72.gState.strokeStyle=objj_msgSend(_73,"cssString");
233}
234};
235CGContextFillRoundedRectangleInRect=function(_74,_75,_76,ne,se,sw,nw){
236CGContextAddPath(_74,CGPathWithRoundedRectangleInRect(_75,_76,_76,ne,se,sw,nw));
237CGContextFillPath(_74);
238};
239CGContextStrokeRoundedRectangleInRect=function(_7b,_7c,_7d,ne,se,sw,nw){
240CGContextAddPath(_7b,CGPathWithRoundedRectangleInRect(_7c,_7d,_7d,ne,se,sw,nw));
241CGContextStrokePath(_7b);
242};
243if(CPFeatureIsCompatible(CPHTMLCanvasFeature)){
244var _82=["butt","round","square"],_83=["miter","round","bevel"],_84=["source-over","source-over","source-over","source-over","darker","lighter","source-over","source-over","source-over","source-over","source-over","source-over","source-over","source-over","source-over","source-over","source-over","copy","source-in","source-out","source-atop","destination-over","destination-in","destination-out","destination-atop","xor","source-over","source-over"];
245CGContextSaveGState=function(_85){
246_85.save();
247};
248CGContextRestoreGState=function(_86){
249_86.restore();
250};
251CGContextSetLineCap=function(_87,_88){
252_87.lineCap=_82[_88];
253};
254CGContextSetLineJoin=function(_89,_8a){
255_89.lineJoin=_83[_8a];
256};
257CGContextSetLineWidth=function(_8b,_8c){
258_8b.lineWidth=_8c;
259};
260CGContextSetMiterLimit=function(_8d,_8e){
261_8d.miterLimit=_8e;
262};
263CGContextSetBlendMode=function(_8f,_90){
264_8f.globalCompositeOperation=_84[_90];
265};
266CGContextAddArc=function(_91,x,y,_94,_95,_96,_97){
267_91.arc(x,y,_94,_95,_96,!_97);
268};
269CGContextAddArcToPoint=function(_98,x1,y1,x2,y2,_9d){
270_98.arcTo(x1,y1,x2,y2,_9d);
271};
272CGContextAddCurveToPoint=function(_9e,_9f,_a0,_a1,_a2,x,y){
273_9e.bezierCurveTo(_9f,_a0,_a1,_a2,x,y);
274};
275CGContextAddLineToPoint=function(_a5,x,y){
276_a5.lineTo(x,y);
277};
278CGContextAddPath=function(_a8,_a9){
279if(!_a8||CGPathIsEmpty(_a9)){
280return;
281}
282var _aa=_a9.elements,i=0,_ac=_a9.count;
283for(;i<_ac;++i){
284var _ad=_aa[i],_ae=_ad.type;
285switch(_ae){
286case kCGPathElementMoveToPoint:
287_a8.moveTo(_ad.x,_ad.y);
288break;
289case kCGPathElementAddLineToPoint:
290_a8.lineTo(_ad.x,_ad.y);
291break;
292case kCGPathElementAddQuadCurveToPoint:
293_a8.quadraticCurveTo(_ad.cpx,_ad.cpy,_ad.x,_ad.y);
294break;
295case kCGPathElementAddCurveToPoint:
296_a8.bezierCurveTo(_ad.cp1x,_ad.cp1y,_ad.cp2x,_ad.cp2y,_ad.x,_ad.y);
297break;
298case kCGPathElementCloseSubpath:
299_a8.closePath();
300break;
301case kCGPathElementAddArc:
302_a8.arc(_ad.x,_ad.y,_ad.radius,_ad.startAngle,_ad.endAngle,_ad.clockwise);
303break;
304case kCGPathElementAddArcTo:
305break;
306}
307}
308};
309CGContextAddRect=function(_af,_b0){
310_af.rect((_b0.origin.x),(_b0.origin.y),(_b0.size.width),(_b0.size.height));
311};
312CGContextAddRects=function(_b1,_b2,_b3){
313var i=0;
314if(arguments["count"]==NULL){
315var _b3=_b2.length;
316}
317for(;i<_b3;++i){
318var _b5=_b2[i];
319_b1.rect((_b5.origin.x),(_b5.origin.y),(_b5.size.width),(_b5.size.height));
320}
321};
322CGContextBeginPath=function(_b6){
323_b6.beginPath();
324};
325CGContextClosePath=function(_b7){
326_b7.closePath();
327};
328CGContextMoveToPoint=function(_b8,x,y){
329_b8.moveTo(x,y);
330};
331CGContextClearRect=function(_bb,_bc){
332_bb.clearRect((_bc.origin.x),(_bc.origin.y),(_bc.size.width),(_bc.size.height));
333};
334CGContextDrawPath=function(_bd,_be){
335if(_be==kCGPathFill||_be==kCGPathFillStroke){
336_bd.fill();
337}else{
338if(_be==kCGPathEOFill||_be==kCGPathEOFillStroke){
339alert("not implemented!!!");
340}
341}
342if(_be==kCGPathStroke||_be==kCGPathFillStroke||_be==kCGPathEOFillStroke){
343_bd.stroke();
344}
345};
346CGContextFillRect=function(_bf,_c0){
347_bf.fillRect((_c0.origin.x),(_c0.origin.y),(_c0.size.width),(_c0.size.height));
348};
349CGContextFillRects=function(_c1,_c2,_c3){
350var i=0;
351if(arguments["count"]==NULL){
352var _c3=_c2.length;
353}
354for(;i<_c3;++i){
355var _c5=_c2[i];
356_c1.fillRect((_c5.origin.x),(_c5.origin.y),(_c5.size.width),(_c5.size.height));
357}
358};
359CGContextStrokeRect=function(_c6,_c7){
360_c6.strokeRect((_c7.origin.x),(_c7.origin.y),(_c7.size.width),(_c7.size.height));
361};
362CGContextClip=function(_c8){
363_c8.clip();
364};
365CGContextClipToRect=function(_c9,_ca){
366_c9.beginPath();
367_c9.rect((_ca.origin.x),(_ca.origin.y),(_ca.size.width),(_ca.size.height));
368_c9.closePath();
369_c9.clip();
370};
371CGContextClipToRects=function(_cb,_cc,_cd){
372if(arguments["count"]==NULL){
373var _cd=_cc.length;
374}
375_cb.beginPath();
376CGContextAddRects(_cb,_cc,_cd);
377_cb.clip();
378};
379CGContextSetAlpha=function(_ce,_cf){
380_ce.globalAlpha=_cf;
381};
382CGContextSetFillColor=function(_d0,_d1){
383_d0.fillStyle=objj_msgSend(_d1,"cssString");
384};
385CGContextSetStrokeColor=function(_d2,_d3){
386_d2.strokeStyle=objj_msgSend(_d3,"cssString");
387};
388CGContextSetShadow=function(_d4,_d5,_d6){
389_d4.shadowOffsetX=_d5.width;
390_d4.shadowOffsetY=_d5.height;
391_d4.shadowBlur=_d6;
392};
393CGContextSetShadowWithColor=function(_d7,_d8,_d9,_da){
394_d7.shadowOffsetX=_d8.width;
395_d7.shadowOffsetY=_d8.height;
396_d7.shadowBlur=_d9;
397_d7.shadowColor=objj_msgSend(_da,"cssString");
398};
399CGContextRotateCTM=function(_db,_dc){
400_db.rotate(_dc);
401};
402CGContextScaleCTM=function(_dd,sx,sy){
403_dd.scale(sx,sy);
404};
405CGContextTranslateCTM=function(_e0,tx,ty){
406_e0.translate(tx,ty);
407};
408eigen=function(_e3){
409alert("IMPLEMENT ME!");
410};
411if(CPFeatureIsCompatible(CPJavaScriptCanvasTransformFeature)){
412CGContextConcatCTM=function(_e4,_e5){
413_e4.transform(_e5.a,_e5.b,_e5.c,_e5.d,_e5.tx,_e5.ty);
414};
415}else{
416CGContextConcatCTM=function(_e6,_e7){
417var a=_e7.a,b=_e7.b,c=_e7.c,d=_e7.d,tx=_e7.tx,ty=_e7.ty,sx=1,sy=1,a1=0,a2=0;
418if(b==0&&c==0){
419sx=a;
420sy=d;
421}else{
422if(a*b==-c*d){
423var _f2=(a*d<0||b*c>0)?-1:1,a2=(ATAN2(b,d)+ATAN2(-_f2*c,_f2*a))/2,cos=COS(a2),sin=SIN(a2);
424if(cos==0){
425sx=-c/sin;
426sy=b/sin;
427}else{
428if(sin==0){
429sx=a/cos;
430sy=d/cos;
431}else{
432abs_cos=ABS(cos);
433abs_sin=ABS(sin);
434sx=(abs_cos*a/cos+abs_sin*-c/sin)/(abs_cos+abs_sin);
435sy=(abs_cos*d/cos+abs_sin*b/sin)/(abs_cos+abs_sin);
436}
437}
438}else{
439if(a*c==-b*d){
440var _f2=(a*d<0||b*c>0)?-1:1;
441a1=(Math.atan2(_f2*b,_f2*a)+Math.atan2(-c,d))/2,cos=COS(a1),sin=SIN(a1);
442if(cos==0){
443sx=b/sin;
444sy=-c/sin;
445}else{
446if(sin==0){
447sx=a/cos;
448sy=d/cos;
449}else{
450abs_cos=ABS(cos);
451abs_sin=ABS(sin);
452sx=(abs_cos*a/cos+abs_sin*b/sin)/(abs_cos+abs_sin);
453sy=(abs_cos*d/cos+abs_sin*-c/sin)/(abs_cos+abs_sin);
454}
455}
456}else{
457var _f5=CGAffineTransformMake(a,c,b,d,0,0),u=eigen(CGAffineTransformConcat(_e7,_f5)),v=eigen(CGAffineTransformConcat(_f5,_e7)),U=CGAffineTransformMake(u.vector_1.x,u.vector_2.x,u.vector_1.y,u.vector_2.y,0,0),VT=CGAffineTransformMake(v.vector_1.x,v.vector_1.y,v.vector_2.x,v.vector_2.y,0,0),S=CGAffineTransformConcat(CGAffineTransformConcat(CGAffineTransformInvert(U),_e7),CGAffineTransformInvert(VT));
458a=VT.a;
459b=VT.b;
460c=VT.c;
461d=VT.d;
462var _f2=(a*d<0||b*c>0)?-1:1,a2=(ATAN2(b,d)+ATAN2(-_f2*c,_f2*a))/2,cos=COS(a2),sin=SIN(a2);
463if(cos==0){
464sx=-c/sin;
465sy=b/sin;
466}else{
467if(sin==0){
468sx=a/cos;
469sy=d/cos;
470}else{
471abs_cos=ABS(cos);
472abs_sin=ABS(sin);
473sx=(abs_cos*a/cos+abs_sin*-c/sin)/(abs_cos+abs_sin);
474sy=(abs_cos*d/cos+abs_sin*b/sin)/(abs_cos+abs_sin);
475}
476}
477S.a*=sx;
478S.d*=sy;
479a=U.a;
480b=U.b;
481c=U.c;
482d=U.d;
483var _f2=(a*d<0||b*c>0)?-1:1;
484a1=(Math.atan2(_f2*b,_f2*a)+Math.atan2(-c,d))/2,cos=COS(a1),sin=SIN(a1);
485if(cos==0){
486sx=b/sin;
487sy=-c/sin;
488}else{
489if(sin==0){
490sx=a/cos;
491sy=d/cos;
492}else{
493abs_cos=ABS(cos);
494abs_sin=ABS(sin);
495sx=(abs_cos*a/cos+abs_sin*b/sin)/(abs_cos+abs_sin);
496sy=(abs_cos*d/cos+abs_sin*-c/sin)/(abs_cos+abs_sin);
497}
498}
499sx=S.a*sx;
500sy=S.d*sy;
501}
502}
503}
504if(tx!=0||ty!=0){
505CGContextTranslateCTM(_e6,tx,ty);
506}
507if(a1!=0){
508CGContextRotateCTM(_e6,a1);
509}
510if(sx!=1||sy!=1){
511CGContextScaleCTM(_e6,sx,sy);
512}
513if(a2!=0){
514CGContextRotateCTM(_e6,a2);
515}
516};
517}
518CGContextDrawImage=function(_fb,_fc,_fd){
519_fb.drawImage(_fd._image,(_fc.origin.x),(_fc.origin.y),(_fc.size.width),(_fc.size.height));
520};
521to_string=function(_fe){
522return "rgba("+ROUND(_fe.components[0]*255)+", "+ROUND(_fe.components[1]*255)+", "+ROUND(255*_fe.components[2])+", "+_fe.components[3]+")";
523};
524CGContextDrawLinearGradient=function(_ff,_100,_101,_102,_103){
525var _104=_100.colors,_105=_104.length,_106=_ff.createLinearGradient(_101.x,_101.y,_102.x,_102.y);
526while(_105--){
527_106.addColorStop(_100.locations[_105],to_string(_104[_105]));
528}
529_ff.fillStyle=_106;
530_ff.fill();
531};
532CGBitmapGraphicsContextCreate=function(){
533var _107=document.createElement("canvas"),_108=_107.getContext("2d");
534_108.DOMElement=_107;
535return _108;
536};
537}else{
538if(CPFeatureIsCompatible(CPVMLFeature)){
539var _109=["f","t"],_10a=["flat","round","square"],_10b=["miter","round","bevel"],_10c=[" m "," l ","qb"," c "," x ",[" at "," wa "]];
540var _10d=CGBitmapGraphicsContextCreate;
541CGBitmapGraphicsContextCreate=function(){
542document.namespaces.add("cg_vml_","urn:schemas-microsoft-com:vml");
543document.createStyleSheet().cssText="cg_vml_\\:*{behavior:url(#default#VML)}";
544CGBitmapGraphicsContextCreate=_10d;
545return _10d();
546};
547CGContextClearRect=function(_10e,_10f){
548if(_10e.buffer!=nil){
549_10e.buffer="";
550}else{
551_10e.DOMElement.innerHTML="";
552}
553_10e.path=NULL;
554};
555var W=10,H=10,Z=10,Z_2=Z/2;
556CGContextDrawImage=function(_114,_115,_116){
557var _117="";
558if(_116.buffer!=nil){
559_117=_116.buffer;
560}else{
561var ctm=_114.gState.CTM,_119=CGPointApplyAffineTransform(_115.origin,ctm),_11a=ctm.a==ctm.d&&ctm.b==-ctm.c,vml=["<cg_vml_:group coordsize=\"1,1\" coordorigin=\"0,0\" style=\"width:1;height:1;position:absolute"];
562var _11c=CGRectApplyAffineTransform(_115,ctm);
563vml.push(";padding:0 ",ROUND((_11c.origin.x+_11c.size.width)),"px ",ROUND((_11c.origin.y+_11c.size.height)),"px 0;filter:progid:DXImageTransform.Microsoft.Matrix(","M11='",ctm.a,"',M12='",ctm.c,"',M21='",ctm.b,"',M22='",ctm.d,"',","Dx='",ROUND(_119.x),"', Dy='",ROUND(_119.y),"', sizingmethod='clip');");
564vml.push("\"><cg_vml_:image src=\"",_116._image.src,"\" style=\"width:",(_115.size.width),"px;height:",(_115.size.height),"px;\"/></g_vml_:group>");
565_117=vml.join("");
566}
567if(_114.buffer!=nil){
568_114.buffer+=_117;
569}else{
570_114.DOMElement.insertAdjacentHTML("BeforeEnd",_117);
571}
572};
573CGContextDrawPath=function(_11d,_11e){
574if(!_11d||CGPathIsEmpty(_11d.path)){
575return;
576}
577var _11f=_11d.path.elements,i=0,_121=_11d.path.count,_122=_11d.gState,fill=(_11e==kCGPathFill||_11e==kCGPathFillStroke)?1:0,_124=(_11e==kCGPathStroke||_11e==kCGPathFillStroke)?1:0,_125=_122.alpha,vml=["<cg_vml_:shape"," fillcolor=\"",_122.fillStyle,"\" filled=\"",_109[fill],"\" style=\"position:absolute;width:",W,";height:",H,";\" coordorigin=\"0 0\" coordsize=\"",Z*W," ",Z*H,"\" stroked=\"",_109[_124],"\" strokeweight=\"",_122.lineWidth,"\" strokecolor=\"",_122.strokeStyle,"\" path=\""];
578for(;i<_121;++i){
579var _127=_11f[i],type=_127.type;
580switch(type){
581case kCGPathElementMoveToPoint:
582case kCGPathElementAddLineToPoint:
583vml.push(_10c[type],(ROUND(Z*(_127.x)-Z_2)),",",(ROUND(Z*(_127.y)-Z_2)));
584break;
585case kCGPathElementAddQuadCurveToPoint:
586vml.push(_10c[type],(ROUND(Z*(_127.cpx)-Z_2)),",",(ROUND(Z*(_127.cpy)-Z_2)),",",(ROUND(Z*(_127.x)-Z_2)),",",(ROUND(Z*(_127.y)-Z_2)));
587break;
588case kCGPathElementAddCurveToPoint:
589vml.push(_10c[type],(ROUND(Z*(_127.cp1x)-Z_2)),",",(ROUND(Z*(_127.cp1y)-Z_2)),",",(ROUND(Z*(_127.cp2x)-Z_2)),",",(ROUND(Z*(_127.cp2y)-Z_2)),",",(ROUND(Z*(_127.x)-Z_2)),",",(ROUND(Z*(_127.y)-Z_2)));
590break;
591case kCGPathElementCloseSubpath:
592vml.push(_10c[type]);
593break;
594case kCGPathElementAddArc:
595var x=_127.x,y=_127.y,_12b=_127.radius,_12c=_127.clockwise?1:0,_12d=_127.endAngle,_12e=_127.startAngle,_12f={x:x+_12b*COS(_12e),y:y+_12b*SIN(_12e)};
596if(_12e==_12d&&!_12c){
597vml.push(_10c[kCGPathElementMoveToPoint],(ROUND(Z*(_12f.x)-Z_2)),",",(ROUND(Z*(_12f.y)-Z_2)));
598continue;
599}
600var end={x:x+_12b*COS(_12d),y:y+_12b*SIN(_12d)};
601if(_12c&&_12e!=_12d&&(_12f.x==end.x&&_12f.y==end.y)){
602if(_12f.x>=x){
603if(_12f.y<y){
604_12f.x+=0.125;
605}else{
606_12f.y+=0.125;
607}
608}else{
609if(end.y<=y){
610end.x+=0.125;
611}else{
612end.y+=0.125;
613}
614}
615}
616vml.push(_10c[type][_12c],(ROUND(Z*(x-_12b)-Z_2)),",",(ROUND(Z*(y-_12b)-Z_2))," ",(ROUND(Z*(x+_12b)-Z_2)),",",(ROUND(Z*(y+_12b)-Z_2))," ",(ROUND(Z*(_12f.x)-Z_2)),",",(ROUND(Z*(_12f.y)-Z_2))," ",(ROUND(Z*(end.x)-Z_2)),",",(ROUND(Z*(end.y)-Z_2)));
617break;
618case kCGPathElementAddArcTo:
619break;
620}
621}
622vml.push("\">");
623if(_122.gradient){
624vml.push(_122.gradient);
625}else{
626if(fill){
627vml.push("<cg_vml_:fill color=\"",_122.fillStyle,"\" opacity=\"",_125,"\" />");
628}
629}
630if(_124){
631vml.push("<cg_vml_:stroke opacity=\"",_125,"\" joinstyle=\"",_10b[_122.lineJoin],"\" miterlimit=\"",_122.miterLimit,"\" endcap=\"",_10a[_122.lineCap],"\" weight=\"",_122.lineWidth,"","px\" color=\"",_122.strokeStyle,"\" />");
632}
633var _131=_122.shadowColor;
634if(_131){
635var _132=_122.shadowOffset;
636vml.push("<cg_vml_:shadow on=\"t\" offset=\"",_132.width,"pt ",_132.height,"pt\" opacity=\"",objj_msgSend(_131,"alphaComponent"),"\" color=black />");
637}
638vml.push("</cg_vml_:shape>");
639_11d.path=NULL;
640if(_11d.buffer!=nil){
641_11d.buffer+=vml.join("");
642}else{
643_11d.DOMElement.insertAdjacentHTML("BeforeEnd",vml.join(""));
644}
645};
646to_string=function(_133){
647return "rgb("+ROUND(_133.components[0]*255)+", "+ROUND(_133.components[1]*255)+", "+ROUND(255*_133.components[2])+")";
648};
649CGContextDrawLinearGradient=function(_134,_135,_136,_137,_138){
650if(!_134||!_135){
651return;
652}
653var vml=nil;
654if(_135.vml_gradient){
655var _13a=objj_msgSend(objj_msgSend(_135.vml_gradient,"stops"),"sortedArrayUsingSelector:",sel_getUid("comparePosition:")),_13b=objj_msgSend(_13a,"count");
656vml=["<cg_vml_:fill type=\"gradient\" method=\"linear sigma\" "];
657vml.push("angle=\""+(objj_msgSend(_135.vml_gradient,"angle")+90)+"\" ");
658vml.push("colors=\"");
659for(var i=0;i<_13b;i++){
660vml.push((objj_msgSend(_13a[i],"position")*100).toFixed(0)+"% ");
661vml.push(objj_msgSend(objj_msgSend(objj_msgSend(_13a[i],"color"),"colorForSlideBase:",nil),"cssString"));
662if(i<_13b-1){
663vml.push(",");
664}
665}
666vml.push("\" />");
667}else{
668var _13d=_135.colors,_13b=_13d.length;
669vml=["<cg_vml_:fill type=\"gradient\" "];
670vml.push("colors=\"");
671for(var i=0;i<_13b;i++){
672vml.push((_135.locations[i]*100).toFixed(0)+"% "+to_string(_13d[i])+(i<_13b-1?",":""));
673}
674vml.push("\" />");
675}
676_134.gState.gradient=vml.join("");
677console.log(vml.join(""));
678};
679}
680}