Rev 7784 | Rev 7786 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7784 | Rev 7785 | ||
---|---|---|---|
Line 77... | Line 77... | ||
77 | double tmin = -2; |
77 | double tmin = -2; |
78 | /* flag to indicate parsing of line status */ |
78 | /* flag to indicate parsing of line status */ |
79 | int done = FALSE; |
79 | int done = FALSE; |
80 | int type; /* eg command number */ |
80 | int type; /* eg command number */ |
81 | int onclick = 0;/* 0 = noninteractive ; 1 = onclick ; 2 = draggable*/ |
81 | int onclick = 0;/* 0 = noninteractive ; 1 = onclick ; 2 = draggable*/ |
- | 82 | int use_affine = FALSE; |
|
82 | int use_rotate = FALSE; |
83 | int use_rotate = FALSE; |
83 | int use_translate = FALSE; |
84 | int use_translate = FALSE; |
84 | int use_filled = FALSE; |
85 | int use_filled = FALSE; |
85 | int use_dashed = FALSE; /* dashing not natively supported in firefox , for now... */ |
86 | int use_dashed = FALSE; /* dashing not natively supported in firefox , for now... */ |
86 | char buffer[MAX_BUFFER];/* contains js-functions with arguments ... all other basic code is directly printed into js-include file */ |
87 | char buffer[MAX_BUFFER];/* contains js-functions with arguments ... all other basic code is directly printed into js-include file */ |
Line 114... | Line 115... | ||
114 | char *font_color = "#00000"; |
115 | char *font_color = "#00000"; |
115 | char *draw_type = "points"; |
116 | char *draw_type = "points"; |
116 | char *fly_font = "normal"; |
117 | char *fly_font = "normal"; |
117 | char *input_style = ""; |
118 | char *input_style = ""; |
118 | char *flytext = ""; |
119 | char *flytext = ""; |
- | 120 | char *affine_matrix = "[1,0,0,1,0,0]"; |
|
119 | int pixelsize = 1; |
121 | int pixelsize = 1; |
120 | int reply_format = 0; |
122 | int reply_format = 0; |
121 | int input_cnt = 0; |
123 | int input_cnt = 0; |
122 | int ext_img_cnt = 0; |
124 | int ext_img_cnt = 0; |
123 | int font_size = 12; |
125 | int font_size = 12; |
Line 324... | Line 326... | ||
324 | switch(i){ |
326 | switch(i){ |
325 | case 0: double_data[0] = get_real(infile,0);break; /* x */ |
327 | case 0: double_data[0] = get_real(infile,0);break; /* x */ |
326 | case 1: double_data[1] = get_real(infile,0);break; /* y */ |
328 | case 1: double_data[1] = get_real(infile,0);break; /* y */ |
327 | case 2: stroke_color = get_color(infile,1);/* name or hex color */ |
329 | case 2: stroke_color = get_color(infile,1);/* name or hex color */ |
328 | decimals = find_number_of_digits(precision); |
330 | decimals = find_number_of_digits(precision); |
329 | fprintf(js_include_file,"dragstuff.addShape(new Shape(%d,%d,%d,7,[%.*f],[%.*f],[%d],[%d],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%.1f,\"%s\",%d,\"%s\"));\n",click_cnt,onclick,drag_type,decimals,double_data[0],decimals,double_data[1],crosshair_size,crosshair_size,line_width,stroke_color,stroke_opacity,fill_color,fill_opacity,use_filled,0,0,0,use_rotate,angle,flytext,font_size,font_family); |
331 | fprintf(js_include_file,"dragstuff.addShape(new Shape(%d,%d,%d,7,[%.*f],[%.*f],[%d],[%d],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%.1f,\"%s\",%d,\"%s\",%d,%s));\n",click_cnt,onclick,drag_type,decimals,double_data[0],decimals,double_data[1],crosshair_size,crosshair_size,line_width,stroke_color,stroke_opacity,fill_color,fill_opacity,use_filled,0,0,0,use_rotate,angle,flytext,font_size,font_family,use_affine,affine_matrix); |
330 | click_cnt++;reset(); |
332 | click_cnt++;reset(); |
331 | break; |
333 | break; |
332 | default:break; |
334 | default:break; |
333 | } |
335 | } |
334 | } |
336 | } |
Line 354... | Line 356... | ||
354 | } |
356 | } |
355 | i++; |
357 | i++; |
356 | } |
358 | } |
357 | decimals = find_number_of_digits(precision); |
359 | decimals = find_number_of_digits(precision); |
358 | for(c=0 ; c < i-1 ; c = c+2){ |
360 | for(c=0 ; c < i-1 ; c = c+2){ |
359 | fprintf(js_include_file,"dragstuff.addShape(new Shape(%d,%d,%d,7,[%.*f],[%.*f],[%d],[%d],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%.1f,\"%s\",%d,\"%s\"));\n",click_cnt,onclick,drag_type,decimals,double_data[c],decimals,double_data[c+1],crosshair_size,crosshair_size,line_width,stroke_color,stroke_opacity,stroke_color,stroke_opacity,1,0,0,0,use_rotate,angle,flytext,font_size,font_family); |
361 | fprintf(js_include_file,"dragstuff.addShape(new Shape(%d,%d,%d,7,[%.*f],[%.*f],[%d],[%d],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%.1f,\"%s\",%d,\"%s\",%d,%s));\n",click_cnt,onclick,drag_type,decimals,double_data[c],decimals,double_data[c+1],crosshair_size,crosshair_size,line_width,stroke_color,stroke_opacity,stroke_color,stroke_opacity,1,0,0,0,use_rotate,angle,flytext,font_size,font_family,use_affine,affine_matrix); |
360 | click_cnt++; |
362 | click_cnt++; |
361 | } |
363 | } |
362 | reset(); |
364 | reset(); |
363 | break; |
365 | break; |
364 | case POINT: |
366 | case POINT: |
Line 373... | Line 375... | ||
373 | switch(i){ |
375 | switch(i){ |
374 | case 0: double_data[0] = get_real(infile,0);break; /* x */ |
376 | case 0: double_data[0] = get_real(infile,0);break; /* x */ |
375 | case 1: double_data[1] = get_real(infile,0);break; /* y */ |
377 | case 1: double_data[1] = get_real(infile,0);break; /* y */ |
376 | case 2: stroke_color = get_color(infile,1);/* name or hex color */ |
378 | case 2: stroke_color = get_color(infile,1);/* name or hex color */ |
377 | decimals = find_number_of_digits(precision); |
379 | decimals = find_number_of_digits(precision); |
378 | fprintf(js_include_file,"dragstuff.addShape(new Shape(%d,%d,%d,2,[%.*f],[%.*f],[%d],[%d],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%.1f,\"%s\",%d,\"%s\"));\n",click_cnt,onclick,drag_type,decimals,double_data[0],decimals,double_data[1],line_width,line_width,line_width,stroke_color,stroke_opacity,stroke_color,stroke_opacity,1,0,0,0,use_rotate,angle,flytext,font_size,font_family); |
380 | fprintf(js_include_file,"dragstuff.addShape(new Shape(%d,%d,%d,2,[%.*f],[%.*f],[%d],[%d],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%.1f,\"%s\",%d,\"%s\",%d,%s));\n",click_cnt,onclick,drag_type,decimals,double_data[0],decimals,double_data[1],line_width,line_width,line_width,stroke_color,stroke_opacity,stroke_color,stroke_opacity,1,0,0,0,use_rotate,angle,flytext,font_size,font_family,use_affine,affine_matrix); |
379 | click_cnt++;break; |
381 | click_cnt++;break; |
380 | default: break; |
382 | default: break; |
381 | } |
383 | } |
382 | } |
384 | } |
383 | reset(); |
385 | reset(); |
Line 403... | Line 405... | ||
403 | } |
405 | } |
404 | i++; |
406 | i++; |
405 | } |
407 | } |
406 | decimals = find_number_of_digits(precision); |
408 | decimals = find_number_of_digits(precision); |
407 | for(c = 0 ; c < i-1 ; c = c+2){ |
409 | for(c = 0 ; c < i-1 ; c = c+2){ |
408 | fprintf(js_include_file,"dragstuff.addShape(new Shape(%d,%d,%d,2,[%.*f],[%.*f],[%d],[%d],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%.1f,\"%s\",%d,\"%s\"));\n",click_cnt,onclick,drag_type,decimals,double_data[c],decimals,double_data[c+1],line_width,line_width,line_width,stroke_color,stroke_opacity,stroke_color,stroke_opacity,1,0,0,0,use_rotate,angle,flytext,font_size,font_family); |
410 | fprintf(js_include_file,"dragstuff.addShape(new Shape(%d,%d,%d,2,[%.*f],[%.*f],[%d],[%d],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%.1f,\"%s\",%d,\"%s\",%d,%s));\n",click_cnt,onclick,drag_type,decimals,double_data[c],decimals,double_data[c+1],line_width,line_width,line_width,stroke_color,stroke_opacity,stroke_color,stroke_opacity,1,0,0,0,use_rotate,angle,flytext,font_size,font_family,use_affine,affine_matrix); |
409 | click_cnt++; |
411 | click_cnt++; |
410 | } |
412 | } |
411 | reset(); |
413 | reset(); |
412 | break; |
414 | break; |
413 | case SEGMENT: |
415 | case SEGMENT: |
Line 422... | Line 424... | ||
422 | case 1: double_data[1]= get_real(infile,0);break; /* y1-values */ |
424 | case 1: double_data[1]= get_real(infile,0);break; /* y1-values */ |
423 | case 2: double_data[2]= get_real(infile,0);break; /* x2-values */ |
425 | case 2: double_data[2]= get_real(infile,0);break; /* x2-values */ |
424 | case 3: double_data[3]= get_real(infile,0);break; /* y2-values */ |
426 | case 3: double_data[3]= get_real(infile,0);break; /* y2-values */ |
425 | case 4: stroke_color=get_color(infile,1);/* name or hex color */ |
427 | case 4: stroke_color=get_color(infile,1);/* name or hex color */ |
426 | decimals = find_number_of_digits(precision); |
428 | decimals = find_number_of_digits(precision); |
427 | fprintf(js_include_file,"dragstuff.addShape(new Shape(%d,%d,%d,4,[%.*f,%.*f],[%.*f,%.*f],[30,30],[30,30],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%.1f,\"%s\",%d,\"%s\"));\n",click_cnt,onclick,drag_type,decimals,double_data[0],decimals,double_data[2],decimals,double_data[1],decimals,double_data[3],line_width,stroke_color,stroke_opacity,stroke_color,stroke_opacity,0,use_dashed,dashtype[0],dashtype[1],use_rotate,angle,flytext,font_size,font_family); |
429 | fprintf(js_include_file,"dragstuff.addShape(new Shape(%d,%d,%d,4,[%.*f,%.*f],[%.*f,%.*f],[30,30],[30,30],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%.1f,\"%s\",%d,\"%s\",%d,%s));\n",click_cnt,onclick,drag_type,decimals,double_data[0],decimals,double_data[2],decimals,double_data[1],decimals,double_data[3],line_width,stroke_color,stroke_opacity,stroke_color,stroke_opacity,0,use_dashed,dashtype[0],dashtype[1],use_rotate,angle,flytext,font_size,font_family,use_affine,affine_matrix); |
428 | click_cnt++;reset(); |
430 | click_cnt++;reset(); |
429 | break; |
431 | break; |
430 | default: break; |
432 | default: break; |
431 | } |
433 | } |
432 | } |
434 | } |
Line 473... | Line 475... | ||
473 | double_data[0] = xmin; |
475 | double_data[0] = xmin; |
474 | double_data[2] = xmax; |
476 | double_data[2] = xmax; |
475 | } |
477 | } |
476 | } |
478 | } |
477 | decimals = find_number_of_digits(precision); |
479 | decimals = find_number_of_digits(precision); |
478 | fprintf(js_include_file,"dragstuff.addShape(new Shape(%d,%d,%d,4,[%.*f,%.*f],[%.*f,%.*f],[30,30],[30,30],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%.1f,\"%s\",%d,\"%s\"));\n",click_cnt,onclick,drag_type,decimals,double_data[0],decimals,double_data[2],decimals,double_data[1],decimals,double_data[3],line_width,stroke_color,stroke_opacity,stroke_color,stroke_opacity,0,use_dashed,dashtype[0],dashtype[1],use_rotate,angle,flytext,font_size,font_family); |
480 | fprintf(js_include_file,"dragstuff.addShape(new Shape(%d,%d,%d,4,[%.*f,%.*f],[%.*f,%.*f],[30,30],[30,30],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%.1f,\"%s\",%d,\"%s\",%d,%s));\n",click_cnt,onclick,drag_type,decimals,double_data[0],decimals,double_data[2],decimals,double_data[1],decimals,double_data[3],line_width,stroke_color,stroke_opacity,stroke_color,stroke_opacity,0,use_dashed,dashtype[0],dashtype[1],use_rotate,angle,flytext,font_size,font_family,use_affine,affine_matrix); |
479 | click_cnt++;reset(); |
481 | click_cnt++;reset(); |
480 | break; |
482 | break; |
481 | } |
483 | } |
482 | } |
484 | } |
483 | break; |
485 | break; |
Line 493... | Line 495... | ||
493 | case 0: double_data[0] = get_real(infile,0);break; /* x-values */ |
495 | case 0: double_data[0] = get_real(infile,0);break; /* x-values */ |
494 | case 1: double_data[1] = get_real(infile,0);break; /* y-values */ |
496 | case 1: double_data[1] = get_real(infile,0);break; /* y-values */ |
495 | case 2: stroke_color = get_color(infile,1);/* name or hex color */ |
497 | case 2: stroke_color = get_color(infile,1);/* name or hex color */ |
496 | double_data[3] = double_data[1]; |
498 | double_data[3] = double_data[1]; |
497 | decimals = find_number_of_digits(precision); |
499 | decimals = find_number_of_digits(precision); |
498 | fprintf(js_include_file,"dragstuff.addShape(new Shape(%d,%d,%d,4,[%.*f,%.*f],[%.*f,%.*f],[30,30],[30,30],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%.1f,\"%s\",%d,\"%s\"));\n",click_cnt,onclick,drag_type,decimals,xmin,decimals,xmax,decimals,double_data[1],decimals,double_data[3],line_width,stroke_color,stroke_opacity,stroke_color,stroke_opacity,0,use_dashed,dashtype[0],dashtype[1],use_rotate,angle,flytext,font_size,font_family); |
500 | fprintf(js_include_file,"dragstuff.addShape(new Shape(%d,%d,%d,4,[%.*f,%.*f],[%.*f,%.*f],[30,30],[30,30],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%.1f,\"%s\",%d,\"%s\",%d,%s));\n",click_cnt,onclick,drag_type,decimals,xmin,decimals,xmax,decimals,double_data[1],decimals,double_data[3],line_width,stroke_color,stroke_opacity,stroke_color,stroke_opacity,0,use_dashed,dashtype[0],dashtype[1],use_rotate,angle,flytext,font_size,font_family,use_affine,affine_matrix); |
499 | click_cnt++;reset(); |
501 | click_cnt++;reset(); |
500 | break; |
502 | break; |
501 | } |
503 | } |
502 | } |
504 | } |
503 | break; |
505 | break; |
Line 512... | Line 514... | ||
512 | case 0: double_data[0] = get_real(infile,0);break; /* x-values */ |
514 | case 0: double_data[0] = get_real(infile,0);break; /* x-values */ |
513 | case 1: double_data[1] = get_real(infile,0);break; /* y-values */ |
515 | case 1: double_data[1] = get_real(infile,0);break; /* y-values */ |
514 | case 2: stroke_color=get_color(infile,1);/* name or hex color */ |
516 | case 2: stroke_color=get_color(infile,1);/* name or hex color */ |
515 | double_data[2] = double_data[0]; |
517 | double_data[2] = double_data[0]; |
516 | decimals = find_number_of_digits(precision); |
518 | decimals = find_number_of_digits(precision); |
517 | fprintf(js_include_file,"dragstuff.addShape(new Shape(%d,%d,%d,4,[%.*f,%.*f],[%.*f,%.*f],[30],[30],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%.1f,\"%s\",%d,\"%s\"));\n",click_cnt,onclick,drag_type,decimals,double_data[0],decimals,double_data[2],decimals,ymin,decimals,ymax,line_width,stroke_color,stroke_opacity,fill_color,fill_opacity,use_filled,use_dashed,dashtype[0],dashtype[1],use_rotate,angle,flytext,font_size,font_family); |
519 | fprintf(js_include_file,"dragstuff.addShape(new Shape(%d,%d,%d,4,[%.*f,%.*f],[%.*f,%.*f],[30],[30],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%.1f,\"%s\",%d,\"%s\",%d,%s));\n",click_cnt,onclick,drag_type,decimals,double_data[0],decimals,double_data[2],decimals,ymin,decimals,ymax,line_width,stroke_color,stroke_opacity,fill_color,fill_opacity,use_filled,use_dashed,dashtype[0],dashtype[1],use_rotate,angle,flytext,font_size,font_family,use_affine,affine_matrix); |
518 | click_cnt++;reset(); |
520 | click_cnt++;reset(); |
519 | break; |
521 | break; |
520 | } |
522 | } |
521 | } |
523 | } |
522 | break; |
524 | break; |
Line 536... | Line 538... | ||
536 | case 2:double_data[2] = get_real(infile,0); |
538 | case 2:double_data[2] = get_real(infile,0); |
537 | double_data[3] = double_data[2]; |
539 | double_data[3] = double_data[2]; |
538 | break; /* x-values */ |
540 | break; /* x-values */ |
539 | case 3:stroke_color = get_color(infile,1);/* name or hex color */ |
541 | case 3:stroke_color = get_color(infile,1);/* name or hex color */ |
540 | decimals = find_number_of_digits(precision); |
542 | decimals = find_number_of_digits(precision); |
541 | fprintf(js_include_file,"dragstuff.addShape(new Shape(%d,%d,%d,1,[%.*f,%.*f],[%.*f,%.*f],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%.1f,\"%s\",%d,\"%s\"));\n",click_cnt,onclick,drag_type,decimals,double_data[0],decimals,double_data[1],decimals,double_data[2],decimals,double_data[3],line_width,stroke_color,stroke_opacity,fill_color,fill_opacity,use_filled,use_dashed,dashtype[0],dashtype[1],use_rotate,angle,flytext,font_size,font_family); |
543 | fprintf(js_include_file,"dragstuff.addShape(new Shape(%d,%d,%d,1,[%.*f,%.*f],[%.*f,%.*f],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%.1f,\"%s\",%d,\"%s\",%d,%s));\n",click_cnt,onclick,drag_type,decimals,double_data[0],decimals,double_data[1],decimals,double_data[2],decimals,double_data[3],line_width,stroke_color,stroke_opacity,fill_color,fill_opacity,use_filled,use_dashed,dashtype[0],dashtype[1],use_rotate,angle,flytext,font_size,font_family,use_affine,affine_matrix); |
542 | click_cnt++;reset(); |
544 | click_cnt++;reset(); |
543 | break; |
545 | break; |
544 | } |
546 | } |
545 | } |
547 | } |
546 | break; |
548 | break; |
Line 559... | Line 561... | ||
559 | case 2:double_data[2] = get_real(infile,0);break; /* x-values */ |
561 | case 2:double_data[2] = get_real(infile,0);break; /* x-values */ |
560 | case 3:double_data[3] = get_real(infile,0);break; /* y-values */ |
562 | case 3:double_data[3] = get_real(infile,0);break; /* y-values */ |
561 | case 4:int_data[0] = (int) (get_real(infile,0));break; /* radius value in pixels */ |
563 | case 4:int_data[0] = (int) (get_real(infile,0));break; /* radius value in pixels */ |
562 | case 5:stroke_color = get_color(infile,1);/* name or hex color */ |
564 | case 5:stroke_color = get_color(infile,1);/* name or hex color */ |
563 | decimals = find_number_of_digits(precision); |
565 | decimals = find_number_of_digits(precision); |
564 | fprintf(js_include_file,"dragstuff.addShape(new Shape(%d,%d,%d,6,[%.*f,%.*f],[%.*f,%.*f],[%d,%d],[%d,%d],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%.1f,\"%s\",%d,\"%s\"));\n",click_cnt,onclick,drag_type,decimals,double_data[0],decimals,double_data[2],decimals,double_data[1],decimals,double_data[3],int_data[0],int_data[0],int_data[0],int_data[0],line_width,stroke_color,stroke_opacity,stroke_color,fill_opacity,use_filled,use_dashed,dashtype[0],dashtype[1],use_rotate,angle,flytext,font_size,font_family); |
566 | fprintf(js_include_file,"dragstuff.addShape(new Shape(%d,%d,%d,6,[%.*f,%.*f],[%.*f,%.*f],[%d,%d],[%d,%d],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%.1f,\"%s\",%d,\"%s\",%d,%s));\n",click_cnt,onclick,drag_type,decimals,double_data[0],decimals,double_data[2],decimals,double_data[1],decimals,double_data[3],int_data[0],int_data[0],int_data[0],int_data[0],line_width,stroke_color,stroke_opacity,stroke_color,fill_opacity,use_filled,use_dashed,dashtype[0],dashtype[1],use_rotate,angle,flytext,font_size,font_family,use_affine,affine_matrix); |
565 | click_cnt++;reset(); |
567 | click_cnt++;reset(); |
566 | break; |
568 | break; |
567 | } |
569 | } |
568 | } |
570 | } |
569 | break; |
571 | break; |
Line 581... | Line 583... | ||
581 | case 1:double_data[1] = get_real(infile,0);break; /* y-values */ |
583 | case 1:double_data[1] = get_real(infile,0);break; /* y-values */ |
582 | case 2:double_data[2] = get_real(infile,0);break; /* x-values */ |
584 | case 2:double_data[2] = get_real(infile,0);break; /* x-values */ |
583 | case 3:double_data[3] = get_real(infile,0);break; /* y-values */ |
585 | case 3:double_data[3] = get_real(infile,0);break; /* y-values */ |
584 | case 4:stroke_color = get_color(infile,1);/* name or hex color */ |
586 | case 4:stroke_color = get_color(infile,1);/* name or hex color */ |
585 | decimals = find_number_of_digits(precision); |
587 | decimals = find_number_of_digits(precision); |
586 | fprintf(js_include_file,"dragstuff.addShape(new Shape(%d,%d,%d,1,[%.*f,%.*f,%.*f,%.*f],[%.*f,%.*f,%.*f,%.*f],[%d],[%d],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%.1f,\"%s\",%d,\"%s\"));\n",click_cnt,onclick,drag_type,decimals,double_data[0],decimals,double_data[2],decimals,double_data[2],decimals,double_data[0],decimals,double_data[1],decimals,double_data[1],decimals,double_data[3],decimals,double_data[3],line_width,line_width,line_width,stroke_color,stroke_opacity,stroke_color,fill_opacity,use_filled,use_dashed,dashtype[0],dashtype[1],use_rotate,angle,flytext,font_size,font_family); |
588 | fprintf(js_include_file,"dragstuff.addShape(new Shape(%d,%d,%d,1,[%.*f,%.*f,%.*f,%.*f],[%.*f,%.*f,%.*f,%.*f],[%d],[%d],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%.1f,\"%s\",%d,\"%s\",%d,%s));\n",click_cnt,onclick,drag_type,decimals,double_data[0],decimals,double_data[2],decimals,double_data[2],decimals,double_data[0],decimals,double_data[1],decimals,double_data[1],decimals,double_data[3],decimals,double_data[3],line_width,line_width,line_width,stroke_color,stroke_opacity,stroke_color,fill_opacity,use_filled,use_dashed,dashtype[0],dashtype[1],use_rotate,angle,flytext,font_size,font_family,use_affine,affine_matrix); |
587 | click_cnt++;reset(); |
589 | click_cnt++;reset(); |
588 | break; |
590 | break; |
589 | } |
591 | } |
590 | } |
592 | } |
591 | break; |
593 | break; |
Line 611... | Line 613... | ||
611 | } |
613 | } |
612 | } |
614 | } |
613 | } |
615 | } |
614 | /* draw path : not closed & not filled */ |
616 | /* draw path : not closed & not filled */ |
615 | decimals = find_number_of_digits(precision); |
617 | decimals = find_number_of_digits(precision); |
616 | fprintf(js_include_file,"dragstuff.addShape(new Shape(%d,%d,%d,4,%s,[30],[30],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%.1f,\"%s\",%d,\"%s\"));\n",click_cnt,onclick,drag_type,double_xy2js_array(double_data,i,decimals),line_width,stroke_color,stroke_opacity,stroke_color,fill_opacity,use_filled,use_dashed,dashtype[0],dashtype[1],use_rotate,angle,flytext,font_size,font_family); |
618 | fprintf(js_include_file,"dragstuff.addShape(new Shape(%d,%d,%d,4,%s,[30],[30],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%.1f,\"%s\",%d,\"%s\",%d,%s));\n",click_cnt,onclick,drag_type,double_xy2js_array(double_data,i,decimals),line_width,stroke_color,stroke_opacity,stroke_color,fill_opacity,use_filled,use_dashed,dashtype[0],dashtype[1],use_rotate,angle,flytext,font_size,font_family,use_affine,affine_matrix); |
617 | click_cnt++;reset(); |
619 | click_cnt++;reset(); |
618 | break; |
620 | break; |
619 | case POLY: |
621 | case POLY: |
620 | /* |
622 | /* |
621 | @ poly color,x1,y1,x2,y2...x_n,y_n |
623 | @ poly color,x1,y1,x2,y2...x_n,y_n |
Line 640... | Line 642... | ||
640 | } |
642 | } |
641 | } |
643 | } |
642 | } |
644 | } |
643 | /* draw path : closed & optional filled */ |
645 | /* draw path : closed & optional filled */ |
644 | decimals = find_number_of_digits(precision); |
646 | decimals = find_number_of_digits(precision); |
645 | fprintf(js_include_file,"dragstuff.addShape(new Shape(%d,%d,%d,5,%s,[30],[30],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%.1f,\"%s\",%d,\"%s\"));\n",click_cnt,onclick,drag_type,double_xy2js_array(double_data,i,decimals),line_width,stroke_color,stroke_opacity,stroke_color,fill_opacity,use_filled,use_dashed,dashtype[0],dashtype[1],use_rotate,angle,flytext,font_size,font_family); |
647 | fprintf(js_include_file,"dragstuff.addShape(new Shape(%d,%d,%d,5,%s,[30],[30],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%.1f,\"%s\",%d,\"%s\",%d,%s));\n",click_cnt,onclick,drag_type,double_xy2js_array(double_data,i,decimals),line_width,stroke_color,stroke_opacity,stroke_color,fill_opacity,use_filled,use_dashed,dashtype[0],dashtype[1],use_rotate,angle,flytext,font_size,font_family,use_affine,affine_matrix); |
646 | click_cnt++;reset(); |
648 | click_cnt++;reset(); |
647 | break; |
649 | break; |
648 | case ARC: |
650 | case ARC: |
649 | /* |
651 | /* |
650 | @ arc xc,yc,width,height,start_angle,end_angle,color |
652 | @ arc xc,yc,width,height,start_angle,end_angle,color |
Line 665... | Line 667... | ||
665 | y[0] = y[1] = yc |
667 | y[0] = y[1] = yc |
666 | w[0] = w[1] = radius = width = height |
668 | w[0] = w[1] = radius = width = height |
667 | h[0] = start_angle ; h[1] = end_engle |
669 | h[0] = start_angle ; h[1] = end_engle |
668 | */ |
670 | */ |
669 | decimals = find_number_of_digits(precision); |
671 | decimals = find_number_of_digits(precision); |
670 | fprintf(js_include_file,"dragstuff.addShape(new Shape(%d,%d,%d,12,[%.*f,%.*f],[%.*f,%.*f],[%d,%d],[%.*f,%.*f],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%.1f,\"%s\",%d,\"%s\"));\n",click_cnt,onclick,drag_type,decimals,double_data[0],decimals,double_data[0],decimals,double_data[1],decimals,double_data[1],int_data[0],int_data[0],decimals,double_data[2],decimals,double_data[3],line_width,stroke_color,stroke_opacity,fill_color,fill_opacity,use_filled,use_dashed,dashtype[0],dashtype[1],use_rotate,angle,flytext,font_size,font_family); |
672 | fprintf(js_include_file,"dragstuff.addShape(new Shape(%d,%d,%d,12,[%.*f,%.*f],[%.*f,%.*f],[%d,%d],[%.*f,%.*f],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%.1f,\"%s\",%d,\"%s\",%d,%s));\n",click_cnt,onclick,drag_type,decimals,double_data[0],decimals,double_data[0],decimals,double_data[1],decimals,double_data[1],int_data[0],int_data[0],decimals,double_data[2],decimals,double_data[3],line_width,stroke_color,stroke_opacity,fill_color,fill_opacity,use_filled,use_dashed,dashtype[0],dashtype[1],use_rotate,angle,flytext,font_size,font_family,use_affine,affine_matrix); |
671 | reset(); |
673 | reset(); |
672 | break; |
674 | break; |
673 | } |
675 | } |
674 | } |
676 | } |
675 | break; |
677 | break; |
Line 687... | Line 689... | ||
687 | case 1:double_data[1] = get_real(infile,0);break; /* y-values */ |
689 | case 1:double_data[1] = get_real(infile,0);break; /* y-values */ |
688 | case 2:double_data[2] = get_real(infile,0);break; /* rx -> px */ |
690 | case 2:double_data[2] = get_real(infile,0);break; /* rx -> px */ |
689 | case 3:double_data[3] = get_real(infile,0);break; /* ry -> px */ |
691 | case 3:double_data[3] = get_real(infile,0);break; /* ry -> px */ |
690 | case 4:stroke_color = get_color(infile,1);/* name or hex color */ |
692 | case 4:stroke_color = get_color(infile,1);/* name or hex color */ |
691 | decimals = find_number_of_digits(precision); |
693 | decimals = find_number_of_digits(precision); |
692 | fprintf(js_include_file,"dragstuff.addShape(new Shape(%d,%d,%d,3,[%.*f],[%.*f],[%.*f],[%.*f],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%.1f,\"%s\",%d,\"%s\"));\n",click_cnt,onclick,drag_type,decimals,double_data[0],decimals,double_data[1],decimals,double_data[2],decimals,double_data[3],line_width,stroke_color,stroke_opacity,stroke_color,fill_opacity,use_filled,use_dashed,dashtype[0],dashtype[1],use_rotate,angle,flytext,font_size,font_family); |
694 | fprintf(js_include_file,"dragstuff.addShape(new Shape(%d,%d,%d,3,[%.*f],[%.*f],[%.*f],[%.*f],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%.1f,\"%s\",%d,\"%s\",%d,%s));\n",click_cnt,onclick,drag_type,decimals,double_data[0],decimals,double_data[1],decimals,double_data[2],decimals,double_data[3],line_width,stroke_color,stroke_opacity,stroke_color,fill_opacity,use_filled,use_dashed,dashtype[0],dashtype[1],use_rotate,angle,flytext,font_size,font_family,use_affine,affine_matrix); |
693 | click_cnt++;reset(); |
695 | click_cnt++;reset(); |
694 | break; |
696 | break; |
695 | } |
697 | } |
696 | } |
698 | } |
697 | break; |
699 | break; |
Line 721... | Line 723... | ||
721 | case 0: double_data[0] = get_real(infile,0);break; /* x */ |
723 | case 0: double_data[0] = get_real(infile,0);break; /* x */ |
722 | case 1: double_data[1] = get_real(infile,0);break; /* y */ |
724 | case 1: double_data[1] = get_real(infile,0);break; /* y */ |
723 | case 2: double_data[2] = px2x((get_real(infile,0))/2) - px2x(0);break; /* radius in 'dx' xrange*/ |
725 | case 2: double_data[2] = px2x((get_real(infile,0))/2) - px2x(0);break; /* radius in 'dx' xrange*/ |
724 | case 3: stroke_color = get_color(infile,1);/* name or hex color */ |
726 | case 3: stroke_color = get_color(infile,1);/* name or hex color */ |
725 | decimals = find_number_of_digits(precision); |
727 | decimals = find_number_of_digits(precision); |
726 | fprintf(js_include_file,"dragstuff.addShape(new Shape(%d,%d,%d,13,[%.*f],[%.*f],[%.3f],[%.3f],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%.1f,\"%s\",%d,\"%s\"));\n",click_cnt,onclick,drag_type,decimals,double_data[0],decimals,double_data[1],double_data[2],double_data[2],line_width,stroke_color,stroke_opacity,stroke_color,fill_opacity,use_filled,use_dashed,dashtype[0],dashtype[1],use_rotate,angle,flytext,font_size,font_family); |
728 | fprintf(js_include_file,"dragstuff.addShape(new Shape(%d,%d,%d,13,[%.*f],[%.*f],[%.3f],[%.3f],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%.1f,\"%s\",%d,\"%s\",%d,%s));\n",click_cnt,onclick,drag_type,decimals,double_data[0],decimals,double_data[1],double_data[2],double_data[2],line_width,stroke_color,stroke_opacity,stroke_color,fill_opacity,use_filled,use_dashed,dashtype[0],dashtype[1],use_rotate,angle,flytext,font_size,font_family,use_affine,affine_matrix); |
727 | click_cnt++;reset(); |
729 | click_cnt++;reset(); |
728 | break; |
730 | break; |
729 | } |
731 | } |
730 | } |
732 | } |
731 | break; |
733 | break; |
Line 748... | Line 750... | ||
748 | } |
750 | } |
749 | } |
751 | } |
750 | decimals = find_number_of_digits(precision); |
752 | decimals = find_number_of_digits(precision); |
751 | for(c=0; c<i;c = c+4){ |
753 | for(c=0; c<i;c = c+4){ |
752 | click_cnt++; |
754 | click_cnt++; |
753 | fprintf(js_include_file,"dragstuff.addShape(new Shape(%d,%d,%d,4,[%.*f,%.*f],[%.*f,%.*f],[30,30],[30,30],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%.1f,\"%s\",%d,\"%s\"));\n",click_cnt,onclick,drag_type,decimals,double_data[0],decimals,double_data[c+2],decimals,double_data[0],decimals,double_data[c+3],line_width,stroke_color,stroke_opacity,stroke_color,stroke_opacity,0,use_dashed,dashtype[0],dashtype[1],use_rotate,angle,flytext,font_size,font_family); |
755 | fprintf(js_include_file,"dragstuff.addShape(new Shape(%d,%d,%d,4,[%.*f,%.*f],[%.*f,%.*f],[30,30],[30,30],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%.1f,\"%s\",%d,\"%s\",%d,%s));\n",click_cnt,onclick,drag_type,decimals,double_data[0],decimals,double_data[c+2],decimals,double_data[0],decimals,double_data[c+3],line_width,stroke_color,stroke_opacity,stroke_color,stroke_opacity,0,use_dashed,dashtype[0],dashtype[1],use_rotate,angle,flytext,font_size,font_family,use_affine,affine_matrix); |
754 | } |
756 | } |
755 | reset(); |
757 | reset(); |
756 | break; |
758 | break; |
757 | case ARROW: |
759 | case ARROW: |
758 | /* |
760 | /* |
Line 768... | Line 770... | ||
768 | case 2: double_data[2] = get_real(infile,0);break; /* x */ |
770 | case 2: double_data[2] = get_real(infile,0);break; /* x */ |
769 | case 3: double_data[3] = get_real(infile,0);break; /* y */ |
771 | case 3: double_data[3] = get_real(infile,0);break; /* y */ |
770 | case 4: arrow_head = (int) get_real(infile,0);break;/* h */ |
772 | case 4: arrow_head = (int) get_real(infile,0);break;/* h */ |
771 | case 5: stroke_color = get_color(infile,1);/* name or hex color */ |
773 | case 5: stroke_color = get_color(infile,1);/* name or hex color */ |
772 | decimals = find_number_of_digits(precision); |
774 | decimals = find_number_of_digits(precision); |
773 | fprintf(js_include_file,"dragstuff.addShape(new Shape(%d,%d,%d,8,[%.*f,%.*f],[%.*f,%.*f],[%d,%d],[%d,%d],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%.1f,\"%s\",%d,\"%s\"));\n",click_cnt,onclick,drag_type,decimals,double_data[0],decimals,double_data[2],decimals,double_data[1],decimals,double_data[3],arrow_head,arrow_head,arrow_head,arrow_head,line_width,stroke_color,stroke_opacity,stroke_color,stroke_opacity,0,use_dashed,dashtype[0],dashtype[1],use_rotate,angle,flytext,font_size,font_family); |
775 | fprintf(js_include_file,"dragstuff.addShape(new Shape(%d,%d,%d,8,[%.*f,%.*f],[%.*f,%.*f],[%d,%d],[%d,%d],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%.1f,\"%s\",%d,\"%s\",%d,%s));\n",click_cnt,onclick,drag_type,decimals,double_data[0],decimals,double_data[2],decimals,double_data[1],decimals,double_data[3],arrow_head,arrow_head,arrow_head,arrow_head,line_width,stroke_color,stroke_opacity,stroke_color,stroke_opacity,0,use_dashed,dashtype[0],dashtype[1],use_rotate,angle,flytext,font_size,font_family,use_affine,affine_matrix); |
774 | click_cnt++; |
776 | click_cnt++; |
775 | reset(); |
777 | reset(); |
776 | break; |
778 | break; |
777 | } |
779 | } |
778 | } |
780 | } |
Line 792... | Line 794... | ||
792 | case 2: double_data[2] = get_real(infile,0);break; /* x */ |
794 | case 2: double_data[2] = get_real(infile,0);break; /* x */ |
793 | case 3: double_data[3] = get_real(infile,0);break; /* y */ |
795 | case 3: double_data[3] = get_real(infile,0);break; /* y */ |
794 | case 4: arrow_head = (int) get_real(infile,0);break;/* h */ |
796 | case 4: arrow_head = (int) get_real(infile,0);break;/* h */ |
795 | case 5: stroke_color = get_color(infile,1);/* name or hex color */ |
797 | case 5: stroke_color = get_color(infile,1);/* name or hex color */ |
796 | decimals = find_number_of_digits(precision); |
798 | decimals = find_number_of_digits(precision); |
797 | fprintf(js_include_file,"dragstuff.addShape(new Shape(%d,%d,%d,10,[%.*f,%.*f],[%.*f,%.*f],[%d,%d],[%d,%d],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%.1f,\"%s\",%d,\"%s\"));\n",click_cnt,onclick,drag_type,decimals,double_data[0],decimals,double_data[2],decimals,double_data[1],decimals,double_data[3],arrow_head,arrow_head,arrow_head,arrow_head,line_width,stroke_color,stroke_opacity,stroke_color,stroke_opacity,0,use_dashed,dashtype[0],dashtype[1],use_rotate,angle,flytext,font_size,font_family); |
799 | fprintf(js_include_file,"dragstuff.addShape(new Shape(%d,%d,%d,10,[%.*f,%.*f],[%.*f,%.*f],[%d,%d],[%d,%d],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%.1f,\"%s\",%d,\"%s\",%d,%s));\n",click_cnt,onclick,drag_type,decimals,double_data[0],decimals,double_data[2],decimals,double_data[1],decimals,double_data[3],arrow_head,arrow_head,arrow_head,arrow_head,line_width,stroke_color,stroke_opacity,stroke_color,stroke_opacity,0,use_dashed,dashtype[0],dashtype[1],use_rotate,angle,flytext,font_size,font_family,use_affine,affine_matrix); |
798 | click_cnt++;reset(); |
800 | click_cnt++;reset(); |
799 | break; |
801 | break; |
800 | } |
802 | } |
801 | } |
803 | } |
802 | break; |
804 | break; |
Line 814... | Line 816... | ||
814 | case 4: double_data[4] = xmin + get_real(infile,0);break; /* xv -> x-pixels */ |
816 | case 4: double_data[4] = xmin + get_real(infile,0);break; /* xv -> x-pixels */ |
815 | case 5: double_data[5] = ymax + get_real(infile,0);break; /* yv -> y-pixels */ |
817 | case 5: double_data[5] = ymax + get_real(infile,0);break; /* yv -> y-pixels */ |
816 | case 6: int_data[0] = (int) (get_real(infile,0));break; /* n */ |
818 | case 6: int_data[0] = (int) (get_real(infile,0));break; /* n */ |
817 | case 7: stroke_color=get_color(infile,1);/* name or hex color */ |
819 | case 7: stroke_color=get_color(infile,1);/* name or hex color */ |
818 | decimals = find_number_of_digits(precision); |
820 | decimals = find_number_of_digits(precision); |
819 | fprintf(js_include_file,"dragstuff.addShape(new Shape(%d,%d,%d,11,[%.*f,%.*f,%.*f],[%.*f,%.*f,%.*f],[%d,%d,%d],[%d,%d,%d],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%.1f,\"%s\",%d,\"%s\"));\n",click_cnt,onclick,drag_type,decimals,double_data[0],decimals,double_data[2],decimals,double_data[4],decimals,double_data[1],decimals,double_data[3],decimals,double_data[5],int_data[0],int_data[0],int_data[0],int_data[0],int_data[0],int_data[0],line_width,stroke_color,stroke_opacity,fill_color,fill_opacity,use_filled,use_dashed,dashtype[0],dashtype[1],use_rotate,angle,flytext,font_size,font_family); |
821 | fprintf(js_include_file,"dragstuff.addShape(new Shape(%d,%d,%d,11,[%.*f,%.*f,%.*f],[%.*f,%.*f,%.*f],[%d,%d,%d],[%d,%d,%d],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%.1f,\"%s\",%d,\"%s\",%d,%s));\n",click_cnt,onclick,drag_type,decimals,double_data[0],decimals,double_data[2],decimals,double_data[4],decimals,double_data[1],decimals,double_data[3],decimals,double_data[5],int_data[0],int_data[0],int_data[0],int_data[0],int_data[0],int_data[0],line_width,stroke_color,stroke_opacity,fill_color,fill_opacity,use_filled,use_dashed,dashtype[0],dashtype[1],use_rotate,angle,flytext,font_size,font_family,use_affine,affine_matrix); |
820 | click_cnt++;reset(); |
822 | click_cnt++;reset(); |
821 | break; |
823 | break; |
822 | default: break; |
824 | default: break; |
823 | } |
825 | } |
824 | } |
826 | } |
Line 836... | Line 838... | ||
836 | case 3: double_data[3] = get_real(infile,0);break; /* y */ |
838 | case 3: double_data[3] = get_real(infile,0);break; /* y */ |
837 | case 4: double_data[4] = get_real(infile,0);break; /* x */ |
839 | case 4: double_data[4] = get_real(infile,0);break; /* x */ |
838 | case 5: double_data[5] = get_real(infile,0);break; /* y */ |
840 | case 5: double_data[5] = get_real(infile,0);break; /* y */ |
839 | case 6: stroke_color = get_color(infile,1);/* name or hex color */ |
841 | case 6: stroke_color = get_color(infile,1);/* name or hex color */ |
840 | decimals = find_number_of_digits(precision); |
842 | decimals = find_number_of_digits(precision); |
841 | fprintf(js_include_file,"dragstuff.addShape(new Shape(%d,%d,%d,5,%s,[30],[30],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%.1f,\"%s\",%d,\"%s\"));\n",click_cnt,onclick,drag_type,double_xy2js_array(double_data,6,decimals),line_width,stroke_color,stroke_opacity,stroke_color,fill_opacity,use_filled,use_dashed,dashtype[0],dashtype[1],use_rotate,angle,flytext,font_size,font_family); |
843 | fprintf(js_include_file,"dragstuff.addShape(new Shape(%d,%d,%d,5,%s,[30],[30],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%.1f,\"%s\",%d,\"%s\",%d,%s));\n",click_cnt,onclick,drag_type,double_xy2js_array(double_data,6,decimals),line_width,stroke_color,stroke_opacity,stroke_color,fill_opacity,use_filled,use_dashed,dashtype[0],dashtype[1],use_rotate,angle,flytext,font_size,font_family,use_affine,affine_matrix); |
842 | click_cnt++;reset(); |
844 | click_cnt++;reset(); |
843 | break; |
845 | break; |
844 | default: break; |
846 | default: break; |
845 | } |
847 | } |
846 | } |
848 | } |
Line 1235... | Line 1237... | ||
1235 | stroke_color = get_color(infile,0); |
1237 | stroke_color = get_color(infile,0); |
1236 | char *fun1 = get_string_argument(infile,0); |
1238 | char *fun1 = get_string_argument(infile,0); |
1237 | char *fun2 = get_string_argument(infile,1); |
1239 | char *fun2 = get_string_argument(infile,1); |
1238 | if( strlen(fun1) == 0 || strlen(fun2) == 0 ){canvas_error("parametric functions are NOT OK !");} |
1240 | if( strlen(fun1) == 0 || strlen(fun2) == 0 ){canvas_error("parametric functions are NOT OK !");} |
1239 | use_parametric = FALSE; |
1241 | use_parametric = FALSE; |
1240 | fprintf(js_include_file,"dragstuff.addShape(new Shape(%d,%d,%d,%d,%s,[%d],[%d],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%.1f,\"%s\",%d,\"%s\"));\n",click_cnt,onclick,drag_type,animation_type,eval_parametric(xsize,ysize,fun1,fun2,xmin,xmax,ymin,ymax,tmin,tmax,plot_steps,precision),2*line_width,2*line_width,line_width,stroke_color,stroke_opacity,fill_color,fill_opacity,use_filled,use_dashed,dashtype[0],dashtype[1],use_rotate,angle,flytext,font_size,font_family); |
1242 | fprintf(js_include_file,"dragstuff.addShape(new Shape(%d,%d,%d,%d,%s,[%d],[%d],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%.1f,\"%s\",%d,\"%s\",%d,%s));\n",click_cnt,onclick,drag_type,animation_type,eval_parametric(xsize,ysize,fun1,fun2,xmin,xmax,ymin,ymax,tmin,tmax,plot_steps,precision),2*line_width,2*line_width,line_width,stroke_color,stroke_opacity,fill_color,fill_opacity,use_filled,use_dashed,dashtype[0],dashtype[1],use_rotate,angle,flytext,font_size,font_family,use_affine,affine_matrix); |
1241 | click_cnt++; |
1243 | click_cnt++; |
1242 | } |
1244 | } |
1243 | else |
1245 | else |
1244 | { |
1246 | { |
1245 | stroke_color = get_color(infile,0); |
1247 | stroke_color = get_color(infile,0); |
1246 | char *fun1 = get_string_argument(infile,1); |
1248 | char *fun1 = get_string_argument(infile,1); |
1247 | if( strlen(fun1) == 0 ){canvas_error("function is NOT OK !");} |
1249 | if( strlen(fun1) == 0 ){canvas_error("function is NOT OK !");} |
1248 | fprintf(js_include_file,"dragstuff.addShape(new Shape(%d,%d,%d,%d,%s,[%d],[%d],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%.1f,\"%s\",%d,\"%s\"));\n",click_cnt,onclick,drag_type,animation_type,eval(xsize,ysize,fun1,xmin,xmax,ymin,ymax,plot_steps,precision),line_width,line_width,line_width,stroke_color,stroke_opacity,fill_color,fill_opacity,use_filled,use_dashed,dashtype[0],dashtype[1],use_rotate,angle,flytext,font_size,font_family); |
1250 | fprintf(js_include_file,"dragstuff.addShape(new Shape(%d,%d,%d,%d,%s,[%d],[%d],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%.1f,\"%s\",%d,\"%s\",%d,%s));\n",click_cnt,onclick,drag_type,animation_type,eval(xsize,ysize,fun1,xmin,xmax,ymin,ymax,plot_steps,precision),line_width,line_width,line_width,stroke_color,stroke_opacity,fill_color,fill_opacity,use_filled,use_dashed,dashtype[0],dashtype[1],use_rotate,angle,flytext,font_size,font_family,use_affine,affine_matrix); |
1249 | click_cnt++; |
1251 | click_cnt++; |
1250 | } |
1252 | } |
1251 | animation_type = 9;/* rest to curve plotting without animation */ |
1253 | animation_type = 9;/* rest to curve plotting without animation */ |
1252 | reset(); |
1254 | reset(); |
1253 | break; |
1255 | break; |
Line 1292... | Line 1294... | ||
1292 | } |
1294 | } |
1293 | break; /* font_size ! */ |
1295 | break; /* font_size ! */ |
1294 | case 4: |
1296 | case 4: |
1295 | temp = get_string_argument(infile,1); |
1297 | temp = get_string_argument(infile,1); |
1296 | decimals = find_number_of_digits(precision); |
1298 | decimals = find_number_of_digits(precision); |
1297 | fprintf(js_include_file,"dragstuff.addShape(new Shape(%d,%d,%d,14,[%.*f],[%.*f],[30],[30],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%d,\"%s\",%d,\"%s\"));\n",click_cnt,onclick,drag_type,decimals,double_data[0],decimals,double_data[1],line_width,stroke_color,stroke_opacity,stroke_color,stroke_opacity,0,0,0,0,0,0,temp,font_size,font_family); |
1299 | fprintf(js_include_file,"dragstuff.addShape(new Shape(%d,%d,%d,14,[%.*f],[%.*f],[30],[30],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%d,\"%s\",%d,\"%s\",%d,%s));\n",click_cnt,onclick,drag_type,decimals,double_data[0],decimals,double_data[1],line_width,stroke_color,stroke_opacity,stroke_color,stroke_opacity,0,0,0,0,0,0,temp,font_size,font_family,use_affine,affine_matrix); |
1298 | click_cnt++;reset();break; |
1300 | click_cnt++;reset();break; |
1299 | default:break; |
1301 | default:break; |
1300 | } |
1302 | } |
1301 | } |
1303 | } |
1302 | break; |
1304 | break; |
Line 1404... | Line 1406... | ||
1404 | case 1: double_data[0] = get_real(infile,0);break; /* x in xrange*/ |
1406 | case 1: double_data[0] = get_real(infile,0);break; /* x in xrange*/ |
1405 | case 2: double_data[1] = get_real(infile,0);break; /* y in yrange*/ |
1407 | case 2: double_data[1] = get_real(infile,0);break; /* y in yrange*/ |
1406 | case 3: decimals = find_number_of_digits(precision); |
1408 | case 3: decimals = find_number_of_digits(precision); |
1407 | temp = get_string_argument(infile,1); |
1409 | temp = get_string_argument(infile,1); |
1408 | decimals = find_number_of_digits(precision); |
1410 | decimals = find_number_of_digits(precision); |
1409 | fprintf(js_include_file,"dragstuff.addShape(new Shape(%d,%d,%d,14,[%.*f],[%.*f],[30],[30],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%d,\"%s\",%d,\"%s\"));\n",click_cnt,onclick,drag_type,decimals,double_data[0],decimals,double_data[1],line_width,stroke_color,stroke_opacity,stroke_color,stroke_opacity,0,0,0,0,0,0,temp,font_size,font_family); |
1411 | fprintf(js_include_file,"dragstuff.addShape(new Shape(%d,%d,%d,14,[%.*f],[%.*f],[30],[30],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%d,\"%s\",%d,\"%s\",%d,%s));\n",click_cnt,onclick,drag_type,decimals,double_data[0],decimals,double_data[1],line_width,stroke_color,stroke_opacity,stroke_color,stroke_opacity,0,0,0,0,0,0,temp,font_size,font_family,use_affine,affine_matrix); |
1410 | click_cnt++;reset();break; |
1412 | click_cnt++;reset();break; |
1411 | break; |
1413 | break; |
1412 | default:break; |
1414 | default:break; |
1413 | } |
1415 | } |
1414 | } |
1416 | } |
Line 1633... | Line 1635... | ||
1633 | use_translate = TRUE; |
1635 | use_translate = TRUE; |
1634 | translate_x = x2px(0); |
1636 | translate_x = x2px(0); |
1635 | translate_y = y2px(0); |
1637 | translate_y = y2px(0); |
1636 | angle = get_real(infile,1); |
1638 | angle = get_real(infile,1); |
1637 | break; |
1639 | break; |
- | 1640 | case KILLAFFINE: |
|
- | 1641 | /* |
|
- | 1642 | @ killaffine |
|
- | 1643 | @ keyword : resets the transformation matrix to 1,0,0,1,0,0 |
|
- | 1644 | */ |
|
- | 1645 | use_affine = FALSE; |
|
- | 1646 | snprintf(affine_matrix,14,"[1,0,0,1,0,0]"); |
|
- | 1647 | break; |
|
- | 1648 | case AFFINE: |
|
- | 1649 | /* |
|
- | 1650 | @affine a,b,c,d,tx,ty |
|
- | 1651 | @ defines a transformation matrix for subsequent objects |
|
- | 1652 | @ use keyword 'killaffine' to end the transformation |
|
- | 1653 | @ note 1: only 'draggable' / 'noclick' objects can be transformed. |
|
- | 1654 | @ note 2: do not use 'onclick' or 'drag xy' with tranformation objects : the mouse coordinates do not get transformed (yet) |
|
- | 1655 | @ note 3: no matrix operations on the transformation matrix implemented (yet) |
|
- | 1656 | @ a : Scales the drawings horizontally |
|
- | 1657 | @ b : Skews the drawings horizontally |
|
- | 1658 | @ c : Skews the drawings vertically |
|
- | 1659 | @ d : Scales the drawings vertically |
|
- | 1660 | @ tx: Moves the the drawings horizontally in pixels ! |
|
- | 1661 | @ ty: Moves the the drawings vertically in pixels ! |
|
- | 1662 | */ |
|
- | 1663 | for(i = 0 ; i<6;i++){ |
|
- | 1664 | switch(i){ |
|
- | 1665 | case 0: double_data[0] = get_real(infile,0);break; |
|
- | 1666 | case 1: double_data[1] = get_real(infile,0);break; |
|
- | 1667 | case 2: double_data[2] = get_real(infile,0);break; |
|
- | 1668 | case 3: double_data[3] = get_real(infile,0);break; |
|
- | 1669 | case 4: int_data[0] = (int)(get_real(infile,0));break; |
|
- | 1670 | case 5: int_data[1] = (int)(get_real(infile,1)); |
|
- | 1671 | use_affine = TRUE; |
|
- | 1672 | string_length = snprintf(NULL,0,"[%.2f,%.2f,%.2f,%.2f,%d,%d] ",double_data[0],double_data[1],double_data[2],double_data[3],int_data[0],int_data[1]); |
|
- | 1673 | check_string_length(string_length);affine_matrix = my_newmem(string_length+1); |
|
- | 1674 | snprintf(affine_matrix,string_length,"[%.2f,%.2f,%.2f,%.2f,%d,%d] ",double_data[0],double_data[1],double_data[2],double_data[3],int_data[0],int_data[1]); |
|
- | 1675 | break; |
|
- | 1676 | default: break; |
|
- | 1677 | } |
|
- | 1678 | } |
|
- | 1679 | break; |
|
1638 | case KILLTRANSLATION: |
1680 | case KILLTRANSLATION: |
1639 | /* |
1681 | /* |
1640 | killtranslation |
1682 | killtranslation |
1641 | */ |
1683 | */ |
1642 | break; |
1684 | break; |
Line 3446... | Line 3488... | ||
3446 | function read_canvas(){\ |
3488 | function read_canvas(){\ |
3447 | var reply = new Array();\ |
3489 | var reply = new Array();\ |
3448 | var p = 0;\ |
3490 | var p = 0;\ |
3449 | while(userdraw_x[p]){\ |
3491 | while(userdraw_x[p]){\ |
3450 | reply[p] = px2x(userdraw_x[p]) +\":\" + px2y(userdraw_y[p]);\ |
3492 | reply[p] = px2x(userdraw_x[p]) +\":\" + px2y(userdraw_y[p]);\ |
3451 | p++;\ |
3493 | p++;\ |
3452 | };\ |
3494 | };\ |
3453 | if(p == 0){alert(\"nothing drawn...\");return;};\ |
3495 | if(p == 0){alert(\"nothing drawn...\");return;};\ |
3454 | if( document.getElementById(\"canvas_input0\") || document.getElementById(\"mathml0\") ){\ |
3496 | if( document.getElementById(\"canvas_input0\") || document.getElementById(\"mathml0\") ){\ |
3455 | var p = 0;var input_reply = new Array();\ |
3497 | var p = 0;var input_reply = new Array();\ |
3456 | if( document.getElementById(\"canvas_input0\")){\ |
3498 | if( document.getElementById(\"canvas_input0\")){\ |
3457 | var t = 0;\ |
3499 | var t = 0;\ |
3458 | while(document.getElementById(\"canvas_input\"+t)){\ |
3500 | while(document.getElementById(\"canvas_input\"+t)){\ |
3459 | if( ! document.getElementById(\"canvas_input\"+t).getAttribute(\"readonly\")){\ |
3501 | if( ! document.getElementById(\"canvas_input\"+t).getAttribute(\"readonly\")){\ |
3460 | input_reply[p] = document.getElementById(\"canvas_input\"+t).value;\ |
3502 | input_reply[p] = document.getElementById(\"canvas_input\"+t).value;\ |
3461 | p++;\ |
3503 | p++;\ |
Line 4663... | Line 4705... | ||
4663 | iframe.src = URL;\ |
4705 | iframe.src = URL;\ |
4664 | iframe.setAttribute(\"width\",w);\ |
4706 | iframe.setAttribute(\"width\",w);\ |
4665 | iframe.setAttribute(\"height\",h);\ |
4707 | iframe.setAttribute(\"height\",h);\ |
4666 | return;\ |
4708 | return;\ |
4667 | };"); |
4709 | };"); |
4668 | break; |
4710 | break; |
4669 | 4711 | ||
4670 | case DRAW_XML: |
4712 | case DRAW_XML: |
4671 | fprintf(js_include_file,"\n<!-- draw xml -->\n\ |
4713 | fprintf(js_include_file,"\n<!-- draw xml -->\n\ |
4672 | draw_xml = function(canvas_root_id,x,y,w,h,mathml,onclick){\ |
4714 | draw_xml = function(canvas_root_id,x,y,w,h,mathml,onclick){\ |
4673 | var canvas_div = document.getElementById(\"canvas_div\"+canvas_root_id);\ |
4715 | var canvas_div = document.getElementById(\"canvas_div\"+canvas_root_id);\ |
4674 | var xml_div = document.createElement(\"div\");\ |
4716 | var xml_div = document.createElement(\"div\");\ |
Line 4816... | Line 4858... | ||
4816 | for(var y = zero_y - snor_y ; y > 0; y = y - step_y){\ |
4858 | for(var y = zero_y - snor_y ; y > 0; y = y - step_y){\ |
4817 | ctx.moveTo(zero_x,y);\ |
4859 | ctx.moveTo(zero_x,y);\ |
4818 | ctx.lineTo(xsize,y);\ |
4860 | ctx.lineTo(xsize,y);\ |
4819 | ctx.fillText(num,zero_x - ctx.measureText(num+\" \").width,parseInt(y+0.2*font_size));\ |
4861 | ctx.fillText(num,zero_x - ctx.measureText(num+\" \").width,parseInt(y+0.2*font_size));\ |
4820 | num = num + ymajor;\ |
4862 | num = num + ymajor;\ |
4821 | };\ |
4863 | };\ |
4822 | ctx.stroke();\ |
4864 | ctx.stroke();\ |
4823 | ctx.closePath();\ |
4865 | ctx.closePath();\ |
4824 | if( yminor > 1){\ |
4866 | if( yminor > 1){\ |
4825 | ctx.lineWidth = 0.5;\ |
4867 | ctx.lineWidth = 0.5;\ |
4826 | ctx.beginPath();\ |
4868 | ctx.beginPath();\ |
Line 4968... | Line 5010... | ||
4968 | ctx.moveTo(p,0);\ |
5010 | ctx.moveTo(p,0);\ |
4969 | ctx.lineTo(p,ysize);\ |
5011 | ctx.lineTo(p,ysize);\ |
4970 | };\ |
5012 | };\ |
4971 | for(var p = zero_x ; p > 0; p = p - x2step){\ |
5013 | for(var p = zero_x ; p > 0; p = p - x2step){\ |
4972 | ctx.moveTo(p,0);\ |
5014 | ctx.moveTo(p,0);\ |
4973 | ctx.lineTo(p,ysize);\ |
5015 | ctx.lineTo(p,ysize);\ |
4974 | };\ |
5016 | };\ |
4975 | for(var p = zero_y ; p < ysize; p = p + y2step){\ |
5017 | for(var p = zero_y ; p < ysize; p = p + y2step){\ |
4976 | ctx.moveTo(0,p);\ |
5018 | ctx.moveTo(0,p);\ |
4977 | ctx.lineTo(xsize,p);\ |
5019 | ctx.lineTo(xsize,p);\ |
4978 | };\ |
5020 | };\ |
Line 5270... | Line 5312... | ||
5270 | txt = legend%d[p];\ |
5312 | txt = legend%d[p];\ |
5271 | txt_size = ctx.measureText(txt).width;\ |
5313 | txt_size = ctx.measureText(txt).width;\ |
5272 | if( x_center + radius + txt_size > xsize ){ x_offset = x_center + radius + txt_size - xsize;} else { x_offset = 0; };\ |
5314 | if( x_center + radius + txt_size > xsize ){ x_offset = x_center + radius + txt_size - xsize;} else { x_offset = 0; };\ |
5273 | ctx.fillText(legend%d[p],x_center + radius - x_offset, y_center - radius + y_offset);\ |
5315 | ctx.fillText(legend%d[p],x_center + radius - x_offset, y_center - radius + y_offset);\ |
5274 | y_offset = parseInt(y_offset + 1.5*font_size);\ |
5316 | y_offset = parseInt(y_offset + 1.5*font_size);\ |
5275 | };\ |
5317 | };\ |
5276 | };\ |
5318 | };\ |
5277 | ctx.restore();\ |
5319 | ctx.restore();\ |
5278 | };",canvas_root_id,canvas_root_id,canvas_root_id,canvas_root_id,canvas_root_id,canvas_root_id); |
5320 | };",canvas_root_id,canvas_root_id,canvas_root_id,canvas_root_id,canvas_root_id,canvas_root_id); |
5279 | 5321 | ||
5280 | break; |
5322 | break; |
Line 5344... | Line 5386... | ||
5344 | if(use_translate == 1 ){ctx.translate(vector[0],vector[1]);}\ |
5386 | if(use_translate == 1 ){ctx.translate(vector[0],vector[1]);}\ |
5345 | if(use_rotate == 1 ){ctx.rotate(angle*Math.PI/180);}\ |
5387 | if(use_rotate == 1 ){ctx.rotate(angle*Math.PI/180);}\ |
5346 | };\ |
5388 | };\ |
5347 | if( font_family.indexOf('px') != null ){\ |
5389 | if( font_family.indexOf('px') != null ){\ |
5348 | ctx.font = font_family;\ |
5390 | ctx.font = font_family;\ |
5349 | }\ |
5391 | }\ |
5350 | else\ |
5392 | else\ |
5351 | {\ |
5393 | {\ |
5352 | ctx.font = \"+font_size+'px '+font_family \";\ |
5394 | ctx.font = \"+font_size+'px '+font_family \";\ |
5353 | };\ |
5395 | };\ |
5354 | ctx.fillStyle = \"rgba(\"+stroke_color+\",\"+stroke_opacity+\")\";\ |
5396 | ctx.fillStyle = \"rgba(\"+stroke_color+\",\"+stroke_opacity+\")\";\ |
5355 | if(angle2 != 0){\ |
5397 | if(angle2 != 0){\ |
5356 | ctx.save();\ |
5398 | ctx.save();\ |
Line 5422... | Line 5464... | ||
5422 | textarea.setAttribute(\"style\",\"position:absolute;left:\"+x+\"px;top:\"+y+\"px;\"+style);\ |
5464 | textarea.setAttribute(\"style\",\"position:absolute;left:\"+x+\"px;top:\"+y+\"px;\"+style);\ |
5423 | textarea.setAttribute(\"cols\",cols);\ |
5465 | textarea.setAttribute(\"cols\",cols);\ |
5424 | textarea.setAttribute(\"rows\",rows);\ |
5466 | textarea.setAttribute(\"rows\",rows);\ |
5425 | textarea.innerHTML = value;\ |
5467 | textarea.innerHTML = value;\ |
5426 | canvas_div.appendChild(textarea);};"); |
5468 | canvas_div.appendChild(textarea);};"); |
5427 | break; |
5469 | break; |
5428 | 5470 | ||
5429 | case DRAW_PIXELS: |
5471 | case DRAW_PIXELS: |
5430 | fprintf(js_include_file,"\n<!-- draw pixel -->\n\ |
5472 | fprintf(js_include_file,"\n<!-- draw pixel -->\n\ |
5431 | draw_setpixel = function(x,y,color,opacity,pixelsize){\ |
5473 | draw_setpixel = function(x,y,color,opacity,pixelsize){\ |
5432 | var canvas = create_canvas%d(10,xsize,ysize);\ |
5474 | var canvas = create_canvas%d(10,xsize,ysize);\ |
Line 5711... | Line 5753... | ||
5711 | if(use_axis_numbering == 1){\ |
5753 | if(use_axis_numbering == 1){\ |
5712 | ctx.font = font_family;\n\ |
5754 | ctx.font = font_family;\n\ |
5713 | xmarge = ctx.measureText(ymax.toFixed(prec)+' ').width;\n\ |
5755 | xmarge = ctx.measureText(ymax.toFixed(prec)+' ').width;\n\ |
5714 | ymarge = parseInt(1.5*font_size);\n\ |
5756 | ymarge = parseInt(1.5*font_size);\n\ |
5715 | ctx.save();\n\ |
5757 | ctx.save();\n\ |
5716 | ctx.fillStyle=\"rgba(255,215,0,0.2)\";\n\ |
5758 | ctx.fillStyle=\"rgba(255,215,0,0.2)\";\n\ |
5717 | ctx.rect(0,0,xmarge,ysize);\n\ |
5759 | ctx.rect(0,0,xmarge,ysize);\n\ |
5718 | ctx.rect(0,ysize-ymarge,xsize,ysize);\n\ |
5760 | ctx.rect(0,ysize-ymarge,xsize,ysize);\n\ |
5719 | ctx.fill();\n\ |
5761 | ctx.fill();\n\ |
5720 | ctx.restore();\n\ |
5762 | ctx.restore();\n\ |
5721 | }else{xmarge = 0;ymarge = 0;};\n\ |
5763 | }else{xmarge = 0;ymarge = 0;};\n\ |
5722 | if( typeof xaxislabel !== 'undefined' ){\ |
5764 | if( typeof xaxislabel !== 'undefined' ){\ |
5723 | ctx.save();\n\ |
5765 | ctx.save();\n\ |
5724 | ctx.font = \"italic \"+font_size+\"px Ariel\";\n\ |
5766 | ctx.font = \"italic \"+font_size+\"px Ariel\";\n\ |
5725 | ctx.fillStyle = \"rgba(\"+font_color+\",\"+major_opacity+\")\";\n\ |
5767 | ctx.fillStyle = \"rgba(\"+font_color+\",\"+major_opacity+\")\";\n\ |
5726 | corr = ctx.measureText(xaxislabel).width;\n\ |
5768 | corr = ctx.measureText(xaxislabel).width;\n\ |
5727 | ctx.fillText(xaxislabel,xsize - 1.5*corr,ysize - 2*font_size);\n\ |
5769 | ctx.fillText(xaxislabel,xsize - 1.5*corr,ysize - 2*font_size);\n\ |
5728 | ctx.restore();\n\ |
5770 | ctx.restore();\n\ |
5729 | };\n\ |
5771 | };\n\ |
5730 | if( typeof yaxislabel !== 'undefined' ){\ |
5772 | if( typeof yaxislabel !== 'undefined' ){\ |
5731 | ctx.save();\n\ |
5773 | ctx.save();\n\ |
5732 | ctx.font = \"italic \"+font_size+\"px Ariel\";\n\ |
5774 | ctx.font = \"italic \"+font_size+\"px Ariel\";\n\ |
5733 | ctx.fillStyle = \"rgba(\"+font_color+\",\"+major_opacity+\")\";\n\ |
5775 | ctx.fillStyle = \"rgba(\"+font_color+\",\"+major_opacity+\")\";\n\ |
5734 | corr = ctx.measureText(yaxislabel).width;\n\ |
5776 | corr = ctx.measureText(yaxislabel).width;\n\ |
5735 | ctx.translate(xmarge+font_size,corr+font_size);\n\ |
5777 | ctx.translate(xmarge+font_size,corr+font_size);\n\ |
5736 | ctx.rotate(-0.5*Math.PI);\n\ |
5778 | ctx.rotate(-0.5*Math.PI);\n\ |
Line 5876... | Line 5918... | ||
5876 | if( use_axis_numbering == 1){\ |
5918 | if( use_axis_numbering == 1){\ |
5877 | xtxt = (px2x(x)).toFixed(prec);\ |
5919 | xtxt = (px2x(x)).toFixed(prec);\ |
5878 | corr = 0.5*(ctx.measureText(xtxt).width);\ |
5920 | corr = 0.5*(ctx.measureText(xtxt).width);\ |
5879 | if(flip == 0 ){flip = 1;ctx.fillText( xtxt,x - corr ,ysize - 0.2*font_size );}else{\ |
5921 | if(flip == 0 ){flip = 1;ctx.fillText( xtxt,x - corr ,ysize - 0.2*font_size );}else{\ |
5880 | flip = 0;ctx.fillText( xtxt,x - corr ,ysize - 1.2*font_size );};\ |
5922 | flip = 0;ctx.fillText( xtxt,x - corr ,ysize - 1.2*font_size );};\ |
5881 | };\ |
5923 | };\ |
5882 | for(var dx = 1 ; dx < xminor ; dx++){\ |
5924 | for(var dx = 1 ; dx < xminor ; dx++){\ |
5883 | ctx.strokeStyle=\"rgba(\"+minor_color+\",\"+minor_opacity+\")\";\ |
5925 | ctx.strokeStyle=\"rgba(\"+minor_color+\",\"+minor_opacity+\")\";\ |
5884 | ctx.lineWidth = 0.2*line_width;\n\ |
5926 | ctx.lineWidth = 0.2*line_width;\n\ |
5885 | ctx.beginPath();\n\ |
5927 | ctx.beginPath();\n\ |
5886 | ctx.moveTo(x+dx*minor_step,ysize - ymarge);\ |
5928 | ctx.moveTo(x+dx*minor_step,ysize - ymarge);\ |
Line 6015... | Line 6057... | ||
6015 | *comment="#", |
6057 | *comment="#", |
6016 | *end="end", |
6058 | *end="end", |
6017 | *ellipse="ellipse", |
6059 | *ellipse="ellipse", |
6018 | *fellipse="fellipse", |
6060 | *fellipse="fellipse", |
6019 | *rotate="rotate", |
6061 | *rotate="rotate", |
- | 6062 | *affine="affine", |
|
- | 6063 | *killaffine="killaffine", |
|
6020 | *fontfamily="fontfamily", |
6064 | *fontfamily="fontfamily", |
6021 | *fillcolor="fillcolor", |
6065 | *fillcolor="fillcolor", |
6022 | *clicktile="clicktile", |
6066 | *clicktile="clicktile", |
6023 | *clicktile_colors="clicktile_colors", |
6067 | *clicktile_colors="clicktile_colors", |
6024 | *translation="translation", |
6068 | *translation="translation", |
Line 6104... | Line 6148... | ||
6104 | snprintf(input_type,sizeof(temp),"%s",temp); |
6148 | snprintf(input_type,sizeof(temp),"%s",temp); |
6105 | 6149 | ||
6106 | if( strcmp(input_type, size) == 0 ){ |
6150 | if( strcmp(input_type, size) == 0 ){ |
6107 | free(input_type); |
6151 | free(input_type); |
6108 | return SIZE; |
6152 | return SIZE; |
6109 | } |
6153 | } |
6110 | if( strcmp(input_type, xrange) == 0 ){ |
6154 | if( strcmp(input_type, xrange) == 0 ){ |
6111 | free(input_type); |
6155 | free(input_type); |
6112 | return XRANGE; |
6156 | return XRANGE; |
6113 | } |
6157 | } |
6114 | if( strcmp(input_type, rangex) == 0 ){ |
6158 | if( strcmp(input_type, rangex) == 0 ){ |
Line 6122... | Line 6166... | ||
6122 | if( strcmp(input_type, ranget) == 0 ){ |
6166 | if( strcmp(input_type, ranget) == 0 ){ |
6123 | free(input_type); |
6167 | free(input_type); |
6124 | return TRANGE; |
6168 | return TRANGE; |
6125 | } |
6169 | } |
6126 | if( strcmp(input_type, yrange) == 0 ){ |
6170 | if( strcmp(input_type, yrange) == 0 ){ |
6127 | free(input_type); |
6171 | free(input_type); |
6128 | return YRANGE; |
6172 | return YRANGE; |
6129 | } |
6173 | } |
6130 | if( strcmp(input_type, rangey) == 0 ){ |
6174 | if( strcmp(input_type, rangey) == 0 ){ |
6131 | free(input_type); |
6175 | free(input_type); |
6132 | return YRANGE; |
6176 | return YRANGE; |
Line 6140... | Line 6184... | ||
6140 | return DASHED; |
6184 | return DASHED; |
6141 | } |
6185 | } |
6142 | if( strcmp(input_type, dashtype) == 0 ){ |
6186 | if( strcmp(input_type, dashtype) == 0 ){ |
6143 | free(input_type); |
6187 | free(input_type); |
6144 | return DASHTYPE; |
6188 | return DASHTYPE; |
6145 | } |
6189 | } |
6146 | if( strcmp(input_type, axisnumbering) == 0 ){ |
6190 | if( strcmp(input_type, axisnumbering) == 0 ){ |
6147 | free(input_type); |
6191 | free(input_type); |
6148 | return AXIS_NUMBERING; |
6192 | return AXIS_NUMBERING; |
6149 | } |
6193 | } |
6150 | if( strcmp(input_type, axisnumbers) == 0 ){ |
6194 | if( strcmp(input_type, axisnumbers) == 0 ){ |
6151 | free(input_type); |
6195 | free(input_type); |
6152 | return AXIS_NUMBERING; |
6196 | return AXIS_NUMBERING; |
6153 | } |
6197 | } |
6154 | if( strcmp(input_type, axis) == 0 ){ |
6198 | if( strcmp(input_type, axis) == 0 ){ |
6155 | free(input_type); |
6199 | free(input_type); |
6156 | return AXIS; |
6200 | return AXIS; |
6157 | } |
6201 | } |
6158 | if( strcmp(input_type, grid) == 0 ){ |
6202 | if( strcmp(input_type, grid) == 0 ){ |
6159 | free(input_type); |
6203 | free(input_type); |
6160 | return GRID; |
6204 | return GRID; |
Line 6168... | Line 6212... | ||
6168 | return HLINE; |
6212 | return HLINE; |
6169 | } |
6213 | } |
6170 | if( strcmp(input_type, vline) == 0 || strcmp(input_type, verticalline) == 0 ){ |
6214 | if( strcmp(input_type, vline) == 0 || strcmp(input_type, verticalline) == 0 ){ |
6171 | free(input_type); |
6215 | free(input_type); |
6172 | return VLINE; |
6216 | return VLINE; |
6173 | } |
6217 | } |
6174 | if( strcmp(input_type, line) == 0 ){ |
6218 | if( strcmp(input_type, line) == 0 ){ |
6175 | free(input_type); |
6219 | free(input_type); |
6176 | return LINE; |
6220 | return LINE; |
6177 | } |
6221 | } |
6178 | if( strcmp(input_type, seg) == 0 || strcmp(input_type, segment) == 0 ){ |
6222 | if( strcmp(input_type, seg) == 0 || strcmp(input_type, segment) == 0 ){ |
6179 | free(input_type); |
6223 | free(input_type); |
6180 | return SEGMENT; |
6224 | return SEGMENT; |
6181 | } |
6225 | } |
6182 | if( strcmp(input_type, dsegment) == 0 ){ |
6226 | if( strcmp(input_type, dsegment) == 0 ){ |
6183 | free(input_type); |
6227 | free(input_type); |
6184 | use_dashed = TRUE; |
6228 | use_dashed = TRUE; |
6185 | return SEGMENT; |
6229 | return SEGMENT; |
6186 | } |
6230 | } |
6187 | if( strcmp(input_type, crosshairsize) == 0 ){ |
6231 | if( strcmp(input_type, crosshairsize) == 0 ){ |
6188 | free(input_type); |
6232 | free(input_type); |
6189 | return CROSSHAIRSIZE; |
6233 | return CROSSHAIRSIZE; |
6190 | } |
6234 | } |
6191 | if( strcmp(input_type, arrowhead) == 0 ){ |
6235 | if( strcmp(input_type, arrowhead) == 0 ){ |
6192 | free(input_type); |
6236 | free(input_type); |
6193 | return ARROWHEAD; |
6237 | return ARROWHEAD; |
6194 | } |
6238 | } |
6195 | if( strcmp(input_type, crosshairs) == 0 ){ |
6239 | if( strcmp(input_type, crosshairs) == 0 ){ |
6196 | free(input_type); |
6240 | free(input_type); |
6197 | return CROSSHAIRS; |
6241 | return CROSSHAIRS; |
6198 | } |
6242 | } |
6199 | if( strcmp(input_type, crosshair) == 0 ){ |
6243 | if( strcmp(input_type, crosshair) == 0 ){ |
Line 6217... | Line 6261... | ||
6217 | return STYLE; |
6261 | return STYLE; |
6218 | } |
6262 | } |
6219 | if( strcmp(input_type, fillcolor) == 0 ){ |
6263 | if( strcmp(input_type, fillcolor) == 0 ){ |
6220 | free(input_type); |
6264 | free(input_type); |
6221 | return FILLCOLOR; |
6265 | return FILLCOLOR; |
6222 | } |
6266 | } |
6223 | if( strcmp(input_type, strokecolor) == 0 ){ |
6267 | if( strcmp(input_type, strokecolor) == 0 ){ |
6224 | free(input_type); |
6268 | free(input_type); |
6225 | return STROKECOLOR; |
6269 | return STROKECOLOR; |
6226 | } |
6270 | } |
6227 | if( strcmp(input_type, filled) == 0 ){ |
6271 | if( strcmp(input_type, filled) == 0 ){ |
6228 | free(input_type); |
6272 | free(input_type); |
6229 | return FILLED; |
6273 | return FILLED; |
6230 | } |
6274 | } |
6231 | if( strcmp(input_type, http) == 0 ){ |
6275 | if( strcmp(input_type, http) == 0 ){ |
6232 | free(input_type); |
6276 | free(input_type); |
6233 | return HTTP; |
6277 | return HTTP; |
6234 | } |
6278 | } |
6235 | if( strcmp(input_type, rays) == 0 ){ |
6279 | if( strcmp(input_type, rays) == 0 ){ |
6236 | free(input_type); |
6280 | free(input_type); |
6237 | return RAYS; |
6281 | return RAYS; |
Line 6255... | Line 6299... | ||
6255 | if( strcmp(input_type, text) == 0 ){ |
6299 | if( strcmp(input_type, text) == 0 ){ |
6256 | free(input_type); |
6300 | free(input_type); |
6257 | return FLY_TEXT; |
6301 | return FLY_TEXT; |
6258 | } |
6302 | } |
6259 | if( strcmp(input_type, textup) == 0 ){ |
6303 | if( strcmp(input_type, textup) == 0 ){ |
6260 | free(input_type); |
6304 | free(input_type); |
6261 | return FLY_TEXTUP; |
6305 | return FLY_TEXTUP; |
6262 | } |
6306 | } |
6263 | if( strcmp(input_type, mouse) == 0 ){ |
6307 | if( strcmp(input_type, mouse) == 0 ){ |
6264 | free(input_type); |
6308 | free(input_type); |
6265 | return MOUSE; |
6309 | return MOUSE; |
Line 6483... | Line 6527... | ||
6483 | return KILLTRANSLATION; |
6527 | return KILLTRANSLATION; |
6484 | } |
6528 | } |
6485 | if( strcmp(input_type, rotate) == 0){ |
6529 | if( strcmp(input_type, rotate) == 0){ |
6486 | free(input_type); |
6530 | free(input_type); |
6487 | return ROTATE; |
6531 | return ROTATE; |
- | 6532 | } |
|
- | 6533 | if( strcmp(input_type, affine) == 0){ |
|
- | 6534 | free(input_type); |
|
- | 6535 | return AFFINE; |
|
- | 6536 | } |
|
- | 6537 | if( strcmp(input_type, killaffine) == 0){ |
|
- | 6538 | free(input_type); |
|
- | 6539 | return KILLAFFINE; |
|
6488 | } |
6540 | } |
6489 | if( strcmp(input_type, audio) == 0 ){ |
6541 | if( strcmp(input_type, audio) == 0 ){ |
6490 | free(input_type); |
6542 | free(input_type); |
6491 | return AUDIO; |
6543 | return AUDIO; |
6492 | } |
6544 | } |