Subversion Repositories wimsdev

Rev

Rev 15686 | Rev 15711 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 15686 Rev 15690
Line 248... Line 248...
248
         @ angle xc,yc,width,start_angle,end_angle,color
248
         @ angle xc,yc,width,start_angle,end_angle,color
249
         @ width is in x-range
249
         @ width is in x-range
250
         @ angles are in degrees
250
         @ angles are in degrees
251
         @ not compatible with ''flydraw``
251
         @ not compatible with ''flydraw``
252
         @ will zoom in/out
252
         @ will zoom in/out
-
 
253
         @ may be set onclick or drag&drop
253
         @ if angle size is controlled by command <a href='#slider'>slider</a>, use radians to set limits of slider
254
         @ if angle size is controlled by command <a href='#slider'>slider</a>, use radians to set limits of slider
254
         @ ''angle`` and <a href="#arc">arc</a>  are exceptions in case of sliders...they are always active (e.g. not click-activated)
255
         @ ''angle`` and <a href="#arc">arc</a>  are exceptions in case of sliders...they are always active (e.g. not click-activated)
255
         @%angle%size 400,400%xrange -10,10%yrange -10,10%filled%fillcolor orange%angle 0,0,4,10,135,blue
256
         @%angle%size 400,400%xrange -10,10%yrange -10,10%filled%fillcolor orange%angle 0,0,4,10,135,blue
256
         @%angle_slider%size 400,400%xrange -10,10%yrange -10,10%grid 1,1,grey%linewidth 3%strokecolor blue%slider -2*pi,2*pi,260,28,angle active degree,blue arrow%arrow 0,0,8,0,8,blue%fillpattern diamond%angle 0,0,2,0,0,blue%killslider%strokecolor red%slider -2*pi,2*pi,260,28,angle active radian,red arrow%arrow 0,1,8,1,8,red%fillpattern dot%angle 0,1,2,0,0,red
257
         @%angle_slider%size 400,400%xrange -10,10%yrange -10,10%grid 1,1,grey%linewidth 3%strokecolor blue%slider -2*pi,2*pi,260,28,angle active degree,blue arrow%arrow 0,0,8,0,8,blue%fillpattern diamond%angle 0,0,2,0,0,blue%killslider%strokecolor red%slider -2*pi,2*pi,260,28,angle active radian,red arrow%arrow 0,1,8,1,8,red%fillpattern dot%angle 0,1,2,0,0,red
257
        */
258
        */
Line 323... Line 324...
323
            break;
324
            break;
324
 
325
 
325
        case ARC:
326
        case ARC:
326
        /*
327
        /*
327
         @ arc xc,yc,x-width,y-height,start_angle,end_angle,color
328
         @ arc xc,yc,x-width,y-height,start_angle,end_angle,color
328
         @ can not be set ''onclick`` or ''drag xy``
329
         @ may be set ''onclick`` or ''drag xy``
329
         @ compatible with ''flydraw``
330
         @ compatible with ''flydraw``
330
         @ attention: width &amp; height in x/y-range
331
         @ attention: width &amp; height in x/y-range
-
 
332
         @ for arrow hats on an arc, see  command <a href='#arcarrow'>arcarrow or arrowarc</a>
331
         @ better use command <a href='#angle'>angle</a> for use with a <a href='#slider'>slider</a>
333
         @ better use command <a href='#angle'>angle</a> for use with a <a href='#slider'>slider</a>
332
         @%arc%size 400,400%xrange -10,10%yrange -10,10%arc 0,0,4,4,10,135,red
334
         @%arc%size 400,400%xrange -10,10%yrange -10,10%arc 0,0,4,4,10,135,red
333
         @%arc_filled%size 400,400%xrange -10,10%yrange -10,10%opacity 255,60%filled%fillcolor green%arc 0,0,4,4,10,135,red
335
         @%arc_filled%size 400,400%xrange -10,10%yrange -10,10%opacity 255,60%filled%fillcolor green%arc 0,0,4,4,10,135,red
334
        */
336
        */
335
            for(i=0;i<7;i++){
337
            for(i=0;i<7;i++){
336
                switch(i){
338
                switch(i){
337
                    case 0:double_data[0] = get_real(infile,0);break; /* x-values */
339
                    case 0:double_data[0] = get_real(infile,0);break; /* x-values */
338
                    case 1:double_data[1] = get_real(infile,0);
340
                    case 1:double_data[1] = get_real(infile,0);
339
                    if(use_rotate == TRUE ){rotate(2,angle,rotationcenter,2);}
341
                    if(use_rotate == TRUE ){rotate(2,angle,rotationcenter,2);}
340
                    if(use_affine == TRUE ){ transform(4,2);}
342
                    if(use_affine == TRUE ){ transform(4,2);}
341
                    break; /* y-values */
343
                    break; /* y-values */
342
                    case 2:double_data[2] = get_real(infile,0);break; /* width x-range no pixels ! */
344
                    case 2:double_data[2] = get_real(infile,0);break; /* width x-range no pixels ! */
343
                    case 3:double_data[3] = get_real(infile,0);
345
                    case 3:double_data[3] = get_real(infile,0);
344
                    break; /* height y-range no pixels ! */
346
                    break; /* height y-range no pixels ! */
345
                    case 4:double_data[4] = get_real(infile,0) - angle ;break; /* start angle in degrees */
347
                    case 4:double_data[4] = get_real(infile,0) - angle ;break; /* start angle in degrees */
346
                    case 5:double_data[5] = get_real(infile,0) - angle;break; /* end angle in degrees */
348
                    case 5:double_data[5] = get_real(infile,0) - angle;break; /* end angle in degrees */
347
                    case 6:stroke_color = get_color(infile,1);/* name or hex color */
349
                    case 6:stroke_color = get_color(infile,1);/* name or hex color */
Line 361... Line 363...
361
                        add_to_buffer(tmp_buffer);reset();
363
                        add_to_buffer(tmp_buffer);reset();
362
                        dragstuff[12] = 1;
364
                        dragstuff[12] = 1;
363
                        if(onclick != 0){object_cnt++;}
365
                        if(onclick != 0){object_cnt++;}
364
                        if(use_dragstuff == 0 ){ use_dragstuff = 1; }
366
                        if(use_dragstuff == 0 ){ use_dragstuff = 1; }
365
                    break;
367
                    break;
-
 
368
                }
-
 
369
            }
-
 
370
            break;
-
 
371
        case ARCARROW:
-
 
372
        /*
-
 
373
         @ arrowarc xc,yc,x-width,y-height,start_angle,end_angle,color,type
-
 
374
         @ alternative: <code>arcarrow</code>
-
 
375
         @ uses same syntax as <a href='#arc'>arc</a>
-
 
376
         @ for arrow hat: type = 1 : right<br />type = 2 : left<br />type = 3 : left&amp;right
-
 
377
         @ if the default arrow hat/head is not satisfactory , the size of the arrow may be set with command <a href='#arrowhead'>arrowhead</a>
-
 
378
         @ no other arrow types are implemented...yet
-
 
379
         @ may be set draggable or onclick
-
 
380
         @ attention: when width ad height are very different, the arrow hat is not drawn correctly. This is a flaw and not a feature...(for now: too much calculations to correct)
-
 
381
         @%arcarrow%size 400,400%xrange -10,10%yrange -10,10%noreset%onclick%arcarrow 0,0,7,7,50,275,blue,3%arcarrow 0,0,8,8,50,275,red,2%arcarrow 0,0,9,9,50,275,green,1
-
 
382
        */
-
 
383
            for(i=0;i<8;i++){
-
 
384
                switch(i){
-
 
385
                    case 0:double_data[0] = get_real(infile,0);break; /* x-values */
-
 
386
                    case 1:double_data[1] = get_real(infile,0);
-
 
387
                    if(use_rotate == TRUE ){rotate(2,angle,rotationcenter,2);}
-
 
388
                    if(use_affine == TRUE ){ transform(4,2);}
-
 
389
                    break; /* y-values */
-
 
390
                    case 2:double_data[2] = get_real(infile,0);break; /* width x-range no pixels ! */
-
 
391
                    case 3:double_data[3] = get_real(infile,0);
-
 
392
                    break; /* height y-range no pixels ! */
-
 
393
                    case 4:double_data[4] = get_real(infile,0) - angle ;break; /* start angle in degrees */
-
 
394
                    case 5:double_data[5] = get_real(infile,0) - angle;break; /* end angle in degrees */
-
 
395
                    case 6:stroke_color = get_color(infile,0);/* name or hex color */
-
 
396
                    break;
-
 
397
                    case 7:int_data[0] = (int) get_real(infile,1);
-
 
398
                        switch(int_data[0]){
-
 
399
                         case 1: int_data[1] = 24;break; /* right */
-
 
400
                         case 2: int_data[1] = 25;break; /* left */
-
 
401
                         case 3: int_data[1] = 26;break; /* left&right */
-
 
402
                         default:int_data[1] = 24;break;
-
 
403
                        }
-
 
404
                        if(int_data[0] == 1 ){int_data[1] = 24;}
-
 
405
                        if( use_slider != -1 && onclick == 0){ onclick = 3; }/* no drag&onclick but slideable */
-
 
406
                        decimals = find_number_of_digits(precision);
-
 
407
                        string_length = 1 + snprintf(NULL,0,"var arrow_head = %d;dragstuff.addShape(new Shape(%d,%d,%d,%d,%d,[%.*f,%.*f],[%.*f,%.*f],[%.*f,%.*f],[%.*f,%.*f],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%.1f,\"%s\",%d,\"%s\",%s,%s,%d));\n",arrow_head,drag_type,object_cnt,onclick,use_snap,int_data[1],decimals,double_data[0],decimals,double_data[0],decimals,double_data[1],decimals,double_data[1],decimals,double_data[2],decimals,double_data[3],decimals,double_data[4],decimals,double_data[5],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,my_sliders,rotation_center,use_offset);
-
 
408
                        check_string_length(string_length);tmp_buffer = my_newmem(string_length);
-
 
409
                        snprintf(tmp_buffer,string_length,"var arrow_head = %d;dragstuff.addShape(new Shape(%d,%d,%d,%d,%d,[%.*f,%.*f],[%.*f,%.*f],[%.*f,%.*f],[%.*f,%.*f],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%.1f,\"%s\",%d,\"%s\",%s,%s,%d));\n",arrow_head,drag_type,object_cnt,onclick,use_snap,int_data[1],decimals,double_data[0],decimals,double_data[0],decimals,double_data[1],decimals,double_data[1],decimals,double_data[2],decimals,double_data[3],decimals,double_data[4],decimals,double_data[5],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,my_sliders,rotation_center,use_offset);
-
 
410
                        add_to_buffer(tmp_buffer);
-
 
411
                        dragstuff[int_data[1]] = 1;
-
 
412
                        if(onclick != 0){object_cnt++;}
-
 
413
                        if(use_dragstuff == 0 ){ use_dragstuff = 1; }
-
 
414
                        js_function[JS_ARROWHEAD] = 1;
-
 
415
                        reset();
366
                }
416
                }
367
            }
417
            }
368
            break;
418
            break;
369
        case ARROW:
419
        case ARROW:
370
        /*
420
        /*
Line 551... Line 601...
551
                    if( strstr(temp,".ogg") != 0 ){ temp = str_replace(temp,".ogg","");}
601
                    if( strstr(temp,".ogg") != 0 ){ temp = str_replace(temp,".ogg","");}
552
                    string_length = 1 + snprintf(NULL,0,  "draw_audio(%d,%d,%d,%d,%d,%d,%d,\"%s.ogg\",\"%s.mp3\");\n",canvas_root_id,int_data[0],int_data[1],int_data[2],int_data[3],int_data[4],int_data[5],temp,temp);
602
                    string_length = 1 + snprintf(NULL,0,  "draw_audio(%d,%d,%d,%d,%d,%d,%d,\"%s.ogg\",\"%s.mp3\");\n",canvas_root_id,int_data[0],int_data[1],int_data[2],int_data[3],int_data[4],int_data[5],temp,temp);
553
                    check_string_length(string_length);tmp_buffer = my_newmem(string_length);
603
                    check_string_length(string_length);tmp_buffer = my_newmem(string_length);
554
                    snprintf(tmp_buffer,string_length,"draw_audio(%d,%d,%d,%d,%d,%d,%d,\"%s.ogg\",\"%s.mp3\");\n",canvas_root_id,int_data[0],int_data[1],int_data[2],int_data[3],int_data[4],int_data[5],temp,temp);
604
                    snprintf(tmp_buffer,string_length,"draw_audio(%d,%d,%d,%d,%d,%d,%d,\"%s.ogg\",\"%s.mp3\");\n",canvas_root_id,int_data[0],int_data[1],int_data[2],int_data[3],int_data[4],int_data[5],temp,temp);
555
                    add_to_buffer(tmp_buffer);
605
                    add_to_buffer(tmp_buffer);
556
                    break;
606
                    break;
557
                    default:break;
607
                    default:break;
558
                }
608
                }
559
            }
609
            }
560
            reset();
610
            reset();
561
            break;
611
            break;
562
 
612
 
563
 
613
 
564
        case AXIS_NUMBERING:
614
        case AXIS_NUMBERING:
565
        /*
615
        /*
566
            @ axisnumbering
616
            @ axisnumbering
567
            @ keyword (no arguments required)
617
            @ keyword (no arguments required)
568
            @ for special numbering of x-axis or y-axis see grid related commands <a href="#axis">axis</a> <a href="#xaxis">xaxis</a>, <a href="#xaxisup">xaxisup</a>, <a href="#noxaxis">noxaxis</a>, <a href="#yaxis">yaxis</a>, <a href="#yaxisup">yaxisup</a>, <a href="#noyaxis">noyaxis</a>
618
            @ for special numbering of x-axis or y-axis see grid related commands <a href="#axis">axis</a> <a href="#xaxis">xaxis</a>, <a href="#xaxisup">xaxisup</a>, <a href="#noxaxis">noxaxis</a>, <a href="#yaxis">yaxis</a>, <a href="#yaxisup">yaxisup</a>, <a href="#noyaxis">noyaxis</a>
Line 789... Line 839...
789
                            /* draw_text = function(canvas_type,y,font_family,stroke_color,stroke_opacity,text) */
839
                            /* draw_text = function(canvas_type,y,font_family,stroke_color,stroke_opacity,text) */
790
                            decimals = find_number_of_digits(precision);
840
                            decimals = find_number_of_digits(precision);
791
                            string_length = 1 + snprintf(NULL,0,"draw_centerstring(%d,%.*f,\"%s\",\"%s\",%.2f,\"%s\");\n",canvas_root_id,decimals,double_data[0],font_family,stroke_color,stroke_opacity,temp);
841
                            string_length = 1 + snprintf(NULL,0,"draw_centerstring(%d,%.*f,\"%s\",\"%s\",%.2f,\"%s\");\n",canvas_root_id,decimals,double_data[0],font_family,stroke_color,stroke_opacity,temp);
792
                            check_string_length(string_length);tmp_buffer = my_newmem(string_length);
842
                            check_string_length(string_length);tmp_buffer = my_newmem(string_length);
793
                            snprintf(tmp_buffer,string_length,"draw_centerstring(%d,%.*f,\"%s\",\"%s\",%.2f,\"%s\");\n",canvas_root_id,decimals,double_data[0],font_family,stroke_color,stroke_opacity,temp);
843
                            snprintf(tmp_buffer,string_length,"draw_centerstring(%d,%.*f,\"%s\",\"%s\",%.2f,\"%s\");\n",canvas_root_id,decimals,double_data[0],font_family,stroke_color,stroke_opacity,temp);
794
                            add_to_buffer(tmp_buffer);
844
                            add_to_buffer(tmp_buffer);
795
                            break;
845
                            break;
796
                    default:break;
846
                    default:break;
797
                }
847
                }
798
            }
848
            }
799
            break;
849
            break;
800
        case CHEMTEX:
850
        case CHEMTEX:
801
        /*
851
        /*
802
        chemtex
852
        chemtex
Line 1260... Line 1310...
1260
        @ choose from these types:<br />alias,all-scroll,auto,cell,context-menu,col-resize,copy,crosshair,default,e-resize,<br />ew-resize,grab,grabbing,help,move,n-resize,ne-resize,nesw-resize,ns-resize,nw-resize,<br />nwse-resize,no-drop,none,not-allowed,pointer,progress,row-resize,s-resize,se-resize,<br />sw-resize,text,url(myBall.cur),auto,vertical-text,w-resize,wait,zoom-in,zoom-out,initial
1310
        @ choose from these types:<br />alias,all-scroll,auto,cell,context-menu,col-resize,copy,crosshair,default,e-resize,<br />ew-resize,grab,grabbing,help,move,n-resize,ne-resize,nesw-resize,ns-resize,nw-resize,<br />nwse-resize,no-drop,none,not-allowed,pointer,progress,row-resize,s-resize,se-resize,<br />sw-resize,text,url(myBall.cur),auto,vertical-text,w-resize,wait,zoom-in,zoom-out,initial
1261
        @ note: wims will not check the validity of your cursor declaration
1311
        @ note: wims will not check the validity of your cursor declaration
1262
        @%cursor_css%size 400,400%xrange -10,10%yrange -10,10%cursor move%linewidth 3%drag xy%opacity 200,75%fcircles blue,-5,5,3,-4,-2,6,0,0,5,3,4,2,4,-5,4
1312
        @%cursor_css%size 400,400%xrange -10,10%yrange -10,10%cursor move%linewidth 3%drag xy%opacity 200,75%fcircles blue,-5,5,3,-4,-2,6,0,0,5,3,4,2,4,-5,4
1263
        */
1313
        */
1264
            fprintf(js_include_file,"canvas_div%d.style.cursor = \"%s\";",canvas_root_id,get_string(infile,1));
1314
            fprintf(js_include_file,"canvas_div%d.style.cursor = \"%s\";",canvas_root_id,get_string(infile,1));
1265
            break;
1315
            break;
1266
 
1316
 
1267
        case CURVE:
1317
        case CURVE:
1268
        /*
1318
        /*
1269
         @ curve color,formula(x)
1319
         @ curve color,formula(x)
1270
         @ alternative: <code>plot color,formula(x)</code>
1320
         @ alternative: <code>plot color,formula(x)</code>
1271
         @ use command <a href="#trange">trange</a> in parametric functions before <b>every</b> command curve / plot <code>trange -pi,pi<br />curve color,formula1(t),formula2(t)</code><br />A next parametric curve will only be correctly plot when trange is set again !<br/>this is a design flaw and not a feature...
1321
         @ use command <a href="#trange">trange</a> in parametric functions before <b>every</b> command curve / plot <code>trange -pi,pi<br />curve color,formula1(t),formula2(t)</code><br />A next parametric curve will only be correctly plot when trange is set again !<br/>this is a design flaw and not a feature...
Line 1611... Line 1661...
1611
        @ ellipses with center xc/yc and radius in x/y-range etc (this differs from flydraw syntax!)
1661
        @ ellipses with center xc/yc and radius in x/y-range etc (this differs from flydraw syntax!)
1612
        @ radius_x and radius_y are in pixels
1662
        @ radius_x and radius_y are in pixels
1613
        @ may be set <a href="#drag">draggable</a> / <a href="#onclick">onclick</a>
1663
        @ may be set <a href="#drag">draggable</a> / <a href="#onclick">onclick</a>
1614
        @ will shrink / expand on zoom out / zoom in
1664
        @ will shrink / expand on zoom out / zoom in
1615
        @%ellipse%size 400,400%xrange -10,10%yrange -10,10%filled%fillcolor orange%opacity 200,40%linewidth 3%drag xy%ellipse 0,0,6,4,green%zoom blue
1665
        @%ellipse%size 400,400%xrange -10,10%yrange -10,10%filled%fillcolor orange%opacity 200,40%linewidth 3%drag xy%ellipse 0,0,6,4,green%zoom blue
1616
        */
1666
        */
1617
            for(i=0;i<5;i++){
1667
            for(i=0;i<5;i++){
1618
                switch(i){
1668
                switch(i){
1619
                    case 0:double_data[0] = get_real(infile,0);break; /* x-values */
1669
                    case 0:double_data[0] = get_real(infile,0);break; /* x-values */
1620
                    case 1:double_data[1] = get_real(infile,0);break; /* y-values */
1670
                    case 1:double_data[1] = get_real(infile,0);break; /* y-values */
1621
                    case 2:double_data[2] = get_real(infile,0);break; /* rx -> px */
1671
                    case 2:double_data[2] = get_real(infile,0);break; /* rx -> px */
Line 1845... Line 1895...
1845
            }
1895
            }
1846
            reset();
1896
            reset();
1847
        break;
1897
        break;
1848
 
1898
 
1849
        case FONTCOLOR:
1899
        case FONTCOLOR:
1850
        /*
1900
        /*
1851
         @ fontcolor color
1901
         @ fontcolor color
1852
         @ color: hexcolor or colorname
1902
         @ color: hexcolor or colorname
1853
         @ default: black
1903
         @ default: black
1854
         @ use command <a href="#fontfamily">fontfamily</a> to deviate from default font type
1904
         @ use command <a href="#fontfamily">fontfamily</a> to deviate from default font type
1855
         @%fontcolor%size 400,400%xrange -10,10%yrange -10,10%fontcolor red%#note: use command fontfamily to change size and shape%axis%axisnumbering%grid 2,2,grey,2,2,4,grey
1905
         @%fontcolor%size 400,400%xrange -10,10%yrange -10,10%fontcolor red%#note: use command fontfamily to change size and shape%axis%axisnumbering%grid 2,2,grey,2,2,4,grey
Line 1961... Line 2011...
1961
             add_js_filltoborder(canvas_type);
2011
             add_js_filltoborder(canvas_type);
1962
            }
2012
            }
1963
            for(i=0;i<5;i++){
2013
            for(i=0;i<5;i++){
1964
                switch(i){
2014
                switch(i){
1965
                    case 0: double_data[0] = get_real(infile,0); break; /* x  */
2015
                    case 0: double_data[0] = get_real(infile,0); break; /* x  */
1966
                    case 1: double_data[1] = get_real(infile,0); break; /* y  */
2016
                    case 1: double_data[1] = get_real(infile,0); break; /* y  */
1967
                    case 2: int_data[0] = (int) (get_real(infile,0)); break; /* dx pixel */
2017
                    case 2: int_data[0] = (int) (get_real(infile,0)); break; /* dx pixel */
1968
                    case 3: int_data[1] = (int) (get_real(infile,0)); break; /* dy pixel*/
2018
                    case 3: int_data[1] = (int) (get_real(infile,0)); break; /* dy pixel*/
1969
                    case 4: stroke_color = get_color(infile,1);
2019
                    case 4: stroke_color = get_color(infile,1);
1970
                    string_length = 1 + snprintf(NULL,0,  "draw_gridfill(%d,%.*f,%.*f,%d,%d,%d,\"%s\",%.2f,%d,%d);\n",STATIC_CANVAS+fill_cnt,decimals,double_data[0],decimals,double_data[1],int_data[0],int_data[1],line_width,stroke_color,stroke_opacity,xsize,ysize);
2020
                    string_length = 1 + snprintf(NULL,0,  "draw_gridfill(%d,%.*f,%.*f,%d,%d,%d,\"%s\",%.2f,%d,%d);\n",STATIC_CANVAS+fill_cnt,decimals,double_data[0],decimals,double_data[1],int_data[0],int_data[1],line_width,stroke_color,stroke_opacity,xsize,ysize);
1971
                    check_string_length(string_length);tmp_buffer = my_newmem(string_length);
2021
                    check_string_length(string_length);tmp_buffer = my_newmem(string_length);
1972
                    snprintf(tmp_buffer,string_length,"draw_gridfill(%d,%.*f,%.*f,%d,%d,%d,\"%s\",%.2f,%d,%d);\n",STATIC_CANVAS+fill_cnt,decimals,double_data[0],decimals,double_data[1],int_data[0],int_data[1],line_width,stroke_color,stroke_opacity,xsize,ysize);
2022
                    snprintf(tmp_buffer,string_length,"draw_gridfill(%d,%.*f,%.*f,%d,%d,%d,\"%s\",%.2f,%d,%d);\n",STATIC_CANVAS+fill_cnt,decimals,double_data[0],decimals,double_data[1],int_data[0],int_data[1],line_width,stroke_color,stroke_opacity,xsize,ysize);
Line 2197... Line 2247...
2197
        @ hlines color,x1,y1,x2,y2,...
2247
        @ hlines color,x1,y1,x2,y2,...
2198
        @ alternative: <code>horizontallines</code>
2248
        @ alternative: <code>horizontallines</code>
2199
        @ draw horizontal lines through points (x1:y1)...(xn:yn) in color 'color'
2249
        @ draw horizontal lines through points (x1:y1)...(xn:yn) in color 'color'
2200
        @ may be set <a href="#drag">draggable</a> / <a href="#onclick">onclick</a> individually
2250
        @ may be set <a href="#drag">draggable</a> / <a href="#onclick">onclick</a> individually
2201
        @%hlines%size 400,400%xrange -10,10%yrange -10,10%linewidth 2%hlines red,0,0,0,5,0,-5
2251
        @%hlines%size 400,400%xrange -10,10%yrange -10,10%linewidth 2%hlines red,0,0,0,5,0,-5
2202
        */
2252
        */
2203
            stroke_color=get_color(infile,0); /* how nice: now the color comes first...*/
2253
            stroke_color=get_color(infile,0); /* how nice: now the color comes first...*/
2204
            fill_color = stroke_color;
2254
            fill_color = stroke_color;
2205
            i=0;
2255
            i=0;
2206
            while( ! done ){     /* get next item until EOL*/
2256
            while( ! done ){     /* get next item until EOL*/
2207
                if(i > MAX_INT - 1){canvas_error("too many points in argument: repeat command multiple times to fit");}
2257
                if(i > MAX_INT - 1){canvas_error("too many points in argument: repeat command multiple times to fit");}
2208
                if(i%2 == 0 ){
2258
                if(i%2 == 0 ){
2209
                    double_data[i] = get_real(infile,0); /* x */
2259
                    double_data[i] = get_real(infile,0); /* x */
Line 4075... Line 4125...
4075
        @%roundrects%size 400,400%xrange -10,10%yrange -10,10%roundrects blue,5,0,0,4,-4,5,4,1,2
4125
        @%roundrects%size 400,400%xrange -10,10%yrange -10,10%roundrects blue,5,0,0,4,-4,5,4,1,2
4076
        */
4126
        */
4077
 
4127
 
4078
            stroke_color=get_color(infile,0); /* how nice: now the color comes first...*/
4128
            stroke_color=get_color(infile,0); /* how nice: now the color comes first...*/
4079
            int_data[0] = (int) (get_real(infile,0)); /* radius value in pixels */
4129
            int_data[0] = (int) (get_real(infile,0)); /* radius value in pixels */
4080
            fill_color = stroke_color;
4130
            fill_color = stroke_color;
4081
            i=0;
4131
            i=0;
4082
            while( ! done ){     /* get next item until EOL*/
4132
            while( ! done ){     /* get next item until EOL*/
4083
                if(i > MAX_INT - 1){canvas_error("too many points in argument: repeat command multiple times to fit");}
4133
                if(i > MAX_INT - 1){canvas_error("too many points in argument: repeat command multiple times to fit");}
4084
                if(i%2 == 0 ){
4134
                if(i%2 == 0 ){
4085
                    double_data[i] = get_real(infile,0); /* x */
4135
                    double_data[i] = get_real(infile,0); /* x */
Line 4192... Line 4242...
4192
                }
4242
                }
4193
                string_length = 1 + snprintf(NULL,0,"[%f,%f ]",rotationcenter[0],rotationcenter[1]);
4243
                string_length = 1 + snprintf(NULL,0,"[%f,%f ]",rotationcenter[0],rotationcenter[1]);
4194
                check_string_length(string_length);
4244
                check_string_length(string_length);
4195
                rotation_center = my_newmem(string_length);
4245
                rotation_center = my_newmem(string_length);
4196
                snprintf(rotation_center,string_length,"[%f,%f]",rotationcenter[0],rotationcenter[1]);
4246
                snprintf(rotation_center,string_length,"[%f,%f]",rotationcenter[0],rotationcenter[1]);
4197
            }
4247
            }
4198
            break;
4248
            break;
4199
 
4249
 
4200
        case SIZE:
4250
        case SIZE:
4201
            /*
4251
            /*
4202
            @ size width,height
4252
            @ size width,height
Line 4767... Line 4817...
4767
            for(i = 0; i < 5 ;i++){
4817
            for(i = 0; i < 5 ;i++){
4768
                switch(i){
4818
                switch(i){
4769
                    case 0: stroke_color = get_color(infile,0);break;/* font_color == stroke_color name or hex color */
4819
                    case 0: stroke_color = get_color(infile,0);break;/* font_color == stroke_color name or hex color */
4770
                    case 1: double_data[0] = get_real(infile,0);break; /* x */
4820
                    case 1: double_data[0] = get_real(infile,0);break; /* x */
4771
                    case 2: double_data[1] = get_real(infile,0);break; /* y */
4821
                    case 2: double_data[1] = get_real(infile,0);break; /* y */
4772
                    case 3: fly_font = get_string_argument(infile,0);
4822
                    case 3: fly_font = get_string_argument(infile,0);
4773
                            if(strcmp(fly_font,"giant") == 0){
4823
                            if(strcmp(fly_font,"giant") == 0){
4774
                                fly_font_size = (int)(font_size + 24);
4824
                                fly_font_size = (int)(font_size + 24);
4775
                            }
4825
                            }
4776
                            else
4826
                            else
4777
                            {
4827
                            {
4778
                                if(strcmp(fly_font,"huge") == 0){
4828
                                if(strcmp(fly_font,"huge") == 0){
4779
                                    fly_font_size = (int)(font_size + 14);
4829
                                    fly_font_size = (int)(font_size + 14);
4780
                                }
4830
                                }
4781
                                else
4831
                                else
4782
                                {
4832
                                {
4783
                                    if(strcmp(fly_font,"large") == 0){
4833
                                    if(strcmp(fly_font,"large") == 0){
4784
                                        fly_font_size = (int)(font_size + 6);
4834
                                        fly_font_size = (int)(font_size + 6);
4785
                                        }
4835
                                        }
4786
                                        else
4836
                                        else
4787
                                        {
4837
                                        {
Line 5012... Line 5062...
5012
                        if( use_affine == TRUE ){ transform(6,2);}
5062
                        if( use_affine == TRUE ){ transform(6,2);}
5013
                        if( use_slider != -1 && onclick == 0){ onclick = 3; }/* no drag&onclick but slideable */
5063
                        if( use_slider != -1 && onclick == 0){ onclick = 3; }/* no drag&onclick but slideable */
5014
                        string_length = 1 + snprintf(NULL,0,"dragstuff.addShape(new Shape(%d,%d,%d,%d,5,%s,[0],[0],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%.1f,\"%s\",%d,\"%s\",%s,%s,%d));\n",drag_type,object_cnt,onclick,use_snap,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,my_sliders,rotation_center,use_offset);
5064
                        string_length = 1 + snprintf(NULL,0,"dragstuff.addShape(new Shape(%d,%d,%d,%d,5,%s,[0],[0],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%.1f,\"%s\",%d,\"%s\",%s,%s,%d));\n",drag_type,object_cnt,onclick,use_snap,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,my_sliders,rotation_center,use_offset);
5015
                        check_string_length(string_length);tmp_buffer = my_newmem(string_length);
5065
                        check_string_length(string_length);tmp_buffer = my_newmem(string_length);
5016
                        snprintf(tmp_buffer,string_length,"dragstuff.addShape(new Shape(%d,%d,%d,%d,5,%s,[0],[0],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%.1f,\"%s\",%d,\"%s\",%s,%s,%d));\n",drag_type,object_cnt,onclick,use_snap,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,my_sliders,rotation_center,use_offset);
5066
                        snprintf(tmp_buffer,string_length,"dragstuff.addShape(new Shape(%d,%d,%d,%d,5,%s,[0],[0],%d,\"%s\",%.2f,\"%s\",%.2f,%d,%d,%d,%d,%d,%.1f,\"%s\",%d,\"%s\",%s,%s,%d));\n",drag_type,object_cnt,onclick,use_snap,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,my_sliders,rotation_center,use_offset);
5017
                        add_to_buffer(tmp_buffer);
5067
                        add_to_buffer(tmp_buffer);
5018
                        if(onclick != 0){object_cnt++;}
5068
                        if(onclick != 0){object_cnt++;}
5019
                        /* object_cnt++;*/
5069
                        /* object_cnt++;*/
5020
                        reset();
5070
                        reset();
5021
                        break;
5071
                        break;
5022
                    default: break;
5072
                    default: break;
5023
                }
5073
                }
Line 6853... Line 6903...
6853
        *linear="linear",
6903
        *linear="linear",
6854
        *obabel="obabel",
6904
        *obabel="obabel",
6855
        *chemtex="chemtex",
6905
        *chemtex="chemtex",
6856
        *noreset="noreset",
6906
        *noreset="noreset",
6857
        *killreset="killreset",
6907
        *killreset="killreset",
-
 
6908
        *arrowarc="arrowarc",
-
 
6909
        *arcarrow="arcarrow",
6858
        *canvastype="canvastype";
6910
        *canvastype="canvastype";
6859
 
6911
 
6860
        while(((c = getc(infile)) != EOF)&&(c!='\n')&&(c!=',')&&(c!='=')&&(c!='\r')&&(c!='\t')){
6912
        while(((c = getc(infile)) != EOF)&&(c!='\n')&&(c!=',')&&(c!='=')&&(c!='\r')&&(c!='\t')){
6861
         if( i == 0 && (c == ' ') ){ continue; /* white spaces or tabs allowed before first command identifier */
6913
         if( i == 0 && (c == ' ') ){ continue; /* white spaces or tabs allowed before first command identifier */
6862
         }else{
6914
         }else{
Line 6888... Line 6940...
6888
        if( strcmp(input_type, rangex) == 0 ){
6940
        if( strcmp(input_type, rangex) == 0 ){
6889
        free(input_type);
6941
        free(input_type);
6890
        return XRANGE;
6942
        return XRANGE;
6891
        }
6943
        }
6892
        if( strcmp(input_type, trange) == 0 ){
6944
        if( strcmp(input_type, trange) == 0 ){
6893
        free(input_type);
6945
        free(input_type);
6894
        return TRANGE;
6946
        return TRANGE;
6895
        }
6947
        }
6896
        if( strcmp(input_type, ranget) == 0 ){
6948
        if( strcmp(input_type, ranget) == 0 ){
6897
        free(input_type);
6949
        free(input_type);
6898
        return TRANGE;
6950
        return TRANGE;
6899
        }
6951
        }
Line 7241... Line 7293...
7241
        free(input_type);
7293
        free(input_type);
7242
        use_filled = TRUE;
7294
        use_filled = TRUE;
7243
        return ROUNDRECT;
7295
        return ROUNDRECT;
7244
        }
7296
        }
7245
        if( strcmp(input_type, dline) == 0 ){
7297
        if( strcmp(input_type, dline) == 0 ){
7246
        use_dashed = TRUE;
7298
        use_dashed = TRUE;
7247
        free(input_type);
7299
        free(input_type);
7248
        return LINE;
7300
        return LINE;
7249
        }
7301
        }
7250
        if( strcmp(input_type, dvline) == 0 ){
7302
        if( strcmp(input_type, dvline) == 0 ){
7251
        use_dashed = TRUE;
7303
        use_dashed = TRUE;
7252
        free(input_type);
7304
        free(input_type);
7253
        return VLINE;
7305
        return VLINE;
7254
        }
7306
        }
7255
        if( strcmp(input_type, dhline) == 0 ){
7307
        if( strcmp(input_type, dhline) == 0 ){
7256
        use_dashed = TRUE;
7308
        use_dashed = TRUE;
7257
        free(input_type);
7309
        free(input_type);
7258
        return HLINE;
7310
        return HLINE;
7259
        }
7311
        }
7260
        if( strcmp(input_type, halflines) == 0 || strcmp(input_type, demilines) == 0  ){
7312
        if( strcmp(input_type, halflines) == 0 || strcmp(input_type, demilines) == 0  ){
7261
        free(input_type);
7313
        free(input_type);
7262
        return HALFLINES;
7314
        return HALFLINES;
7263
        }
7315
        }
7264
        if( strcmp(input_type, halfline) == 0 || strcmp(input_type, demiline) == 0  ){
7316
        if( strcmp(input_type, halfline) == 0 || strcmp(input_type, demiline) == 0  ){
7265
        free(input_type);
7317
        free(input_type);
7266
        return HALFLINE;
7318
        return HALFLINE;
7267
        }
7319
        }
7268
        if( strcmp(input_type, frect) == 0 || strcmp(input_type, frectangle) == 0 ){
7320
        if( strcmp(input_type, frect) == 0 || strcmp(input_type, frectangle) == 0 ){
7269
        use_filled = TRUE;
7321
        use_filled = TRUE;
7270
        free(input_type);
7322
        free(input_type);
7271
        return RECT;
7323
        return RECT;
7272
        }
7324
        }
7273
        if( strcmp(input_type, circles) == 0 ){
7325
        if( strcmp(input_type, circles) == 0 ){
7274
        free(input_type);
7326
        free(input_type);
7275
        return CIRCLES;
7327
        return CIRCLES;
7276
        }
7328
        }
7277
        if( strcmp(input_type, fcircle) == 0  ||  strcmp(input_type, disk) == 0 ){
7329
        if( strcmp(input_type, fcircle) == 0  ||  strcmp(input_type, disk) == 0 ){
7278
        use_filled = TRUE;
7330
        use_filled = TRUE;
7279
        free(input_type);
7331
        free(input_type);
7280
        return CIRCLE;
7332
        return CIRCLE;
7281
        }
7333
        }
7282
        if( strcmp(input_type, fcircles) == 0  ||  strcmp(input_type, disks) == 0 ){
7334
        if( strcmp(input_type, fcircles) == 0  ||  strcmp(input_type, disks) == 0 ){
7283
        use_filled = TRUE;
7335
        use_filled = TRUE;
7284
        free(input_type);
7336
        free(input_type);
7285
        return CIRCLES;
7337
        return CIRCLES;
7286
        }
7338
        }
7287
        if( strcmp(input_type, circle) == 0 ){
7339
        if( strcmp(input_type, circle) == 0 ){
7288
        free(input_type);
7340
        free(input_type);
7289
        return CIRCLE;
7341
        return CIRCLE;
7290
        }
7342
        }
7291
        if( strcmp(input_type, point) == 0 ){
7343
        if( strcmp(input_type, point) == 0 ){
7292
        free(input_type);
7344
        free(input_type);
7293
        return POINT;
7345
        return POINT;
7294
        }
7346
        }
7295
        if( strcmp(input_type, points) == 0 ){
7347
        if( strcmp(input_type, points) == 0 ){
7296
        free(input_type);
7348
        free(input_type);
7297
        return POINTS;
7349
        return POINTS;
7298
        }
7350
        }
7299
        if( strcmp(input_type, filledarc) == 0 || strcmp(input_type, farc) == 0 ){
7351
        if( strcmp(input_type, filledarc) == 0 || strcmp(input_type, farc) == 0 ){
7300
        use_filled = TRUE;
7352
        use_filled = TRUE;
7301
        free(input_type);
7353
        free(input_type);
7302
        return ARC;
7354
        return ARC;
7303
        }
7355
        }
7304
        if( strcmp(input_type, arc) == 0 ){
7356
        if( strcmp(input_type, arc) == 0 ){
7305
        free(input_type);
7357
        free(input_type);
7306
        return ARC;
7358
        return ARC;
7307
        }
7359
        }
7308
        if( strcmp(input_type, poly) == 0 ||  strcmp(input_type, polygon) == 0 ){
7360
        if( strcmp(input_type, poly) == 0 ||  strcmp(input_type, polygon) == 0 ){
7309
        free(input_type);
7361
        free(input_type);
7310
        return POLY;
7362
        return POLY;
7311
        }
7363
        }
7312
        if( strcmp(input_type, fpoly) == 0 ||  strcmp(input_type, filledpoly) == 0 || strcmp(input_type,filledpolygon) == 0  || strcmp(input_type,fpolygon) == 0  ){
7364
        if( strcmp(input_type, fpoly) == 0 ||  strcmp(input_type, filledpoly) == 0 || strcmp(input_type,filledpolygon) == 0  || strcmp(input_type,fpolygon) == 0  ){
7313
        use_filled = TRUE;
7365
        use_filled = TRUE;
7314
        free(input_type);
7366
        free(input_type);
7315
        return POLY;
7367
        return POLY;
7316
        }
7368
        }
7317
        if( strcmp(input_type, ellipse) == 0){
7369
        if( strcmp(input_type, ellipse) == 0){
7318
        free(input_type);
7370
        free(input_type);
7319
        return ELLIPSE;
7371
        return ELLIPSE;
7320
        }
7372
        }
7321
        if( strcmp(input_type, ellipses) == 0){
7373
        if( strcmp(input_type, ellipses) == 0){
7322
        free(input_type);
7374
        free(input_type);
7323
        return ELLIPSES;
7375
        return ELLIPSES;
7324
        }
7376
        }
7325
        if( strcmp(input_type, string) == 0 ){
7377
        if( strcmp(input_type, string) == 0 ){
7326
        free(input_type);
7378
        free(input_type);
7327
        return STRING;
7379
        return STRING;
7328
        }
7380
        }
7329
        if( strcmp(input_type, stringup) == 0 ){
7381
        if( strcmp(input_type, stringup) == 0 ){
7330
        free(input_type);
7382
        free(input_type);
7331
        return STRINGUP;
7383
        return STRINGUP;
7332
        }
7384
        }
7333
        if( strcmp(input_type, opacity) == 0 || strcmp(input_type, transparent) == 0 ){
7385
        if( strcmp(input_type, opacity) == 0 || strcmp(input_type, transparent) == 0 ){
7334
        free(input_type);
7386
        free(input_type);
7335
        return OPACITY;
7387
        return OPACITY;
7336
        }
7388
        }
7337
        if( strcmp(input_type, comment) == 0){
7389
        if( strcmp(input_type, comment) == 0){
7338
        free(input_type);
7390
        free(input_type);
7339
        return COMMENT;
7391
        return COMMENT;
7340
        }
7392
        }
7341
        if( strcmp(input_type, fellipse) == 0){
7393
        if( strcmp(input_type, fellipse) == 0){
7342
        free(input_type);
7394
        free(input_type);
7343
        use_filled = TRUE;
7395
        use_filled = TRUE;
7344
        return ELLIPSE;
7396
        return ELLIPSE;
7345
        }
7397
        }
7346
        if( strcmp(input_type, clearbutton) == 0 || strcmp(input_type, erase) == 0 || strcmp(input_type, delete) == 0){
7398
        if( strcmp(input_type, clearbutton) == 0 || strcmp(input_type, erase) == 0 || strcmp(input_type, delete) == 0){
7347
        free(input_type);
7399
        free(input_type);
7348
        return CLEARBUTTON;
7400
        return CLEARBUTTON;
7349
        }
7401
        }
7350
        if( strcmp(input_type, translation) == 0 ||  strcmp(input_type, translate) == 0  ){
7402
        if( strcmp(input_type, translation) == 0 ||  strcmp(input_type, translate) == 0  ){
7351
        free(input_type);
7403
        free(input_type);
7352
        return TRANSLATION;
7404
        return TRANSLATION;
7353
        }
7405
        }
7354
        if( strcmp(input_type, killtranslation) == 0 ||  strcmp(input_type, killtranslate) == 0){
7406
        if( strcmp(input_type, killtranslation) == 0 ||  strcmp(input_type, killtranslate) == 0){
7355
        free(input_type);
7407
        free(input_type);
7356
        return KILLTRANSLATION;
7408
        return KILLTRANSLATION;
7357
        }
7409
        }
7358
        if( strcmp(input_type, rotate) == 0){
7410
        if( strcmp(input_type, rotate) == 0){
7359
        free(input_type);
7411
        free(input_type);
7360
        return ROTATE;
7412
        return ROTATE;
7361
        }
7413
        }
7362
        if( strcmp(input_type, killrotate) == 0){
7414
        if( strcmp(input_type, killrotate) == 0){
7363
        free(input_type);
7415
        free(input_type);
7364
        return KILLROTATE;
7416
        return KILLROTATE;
7365
        }
7417
        }
7366
        if( strcmp(input_type, rotationcenter) == 0){
7418
        if( strcmp(input_type, rotationcenter) == 0){
7367
        free(input_type);
7419
        free(input_type);
7368
        return ROTATION_CENTER;
7420
        return ROTATION_CENTER;
Line 7388... Line 7440...
7388
        return SLIDER;
7440
        return SLIDER;
7389
        }
7441
        }
7390
        if( strcmp(input_type, killslider) == 0 ){
7442
        if( strcmp(input_type, killslider) == 0 ){
7391
        free(input_type);
7443
        free(input_type);
7392
        return KILLSLIDER;
7444
        return KILLSLIDER;
7393
        }
7445
        }
7394
        if( strcmp(input_type, copy) == 0 ){
7446
        if( strcmp(input_type, copy) == 0 ){
7395
        free(input_type);
7447
        free(input_type);
7396
        return COPY;
7448
        return COPY;
7397
        }
7449
        }
7398
        if( strcmp(input_type, copyresized) == 0 ){
7450
        if( strcmp(input_type, copyresized) == 0 ){
7399
        free(input_type);
7451
        free(input_type);
7400
        return COPYRESIZED;
7452
        return COPYRESIZED;
7401
        }
7453
        }
7402
        if( strcmp(input_type, xlogscale) == 0 ){
7454
        if( strcmp(input_type, xlogscale) == 0 ){
7403
        free(input_type);
7455
        free(input_type);
7404
        return XLOGSCALE;
7456
        return XLOGSCALE;
7405
        }
7457
        }
7406
        if( strcmp(input_type, ylogscale) == 0 ){
7458
        if( strcmp(input_type, ylogscale) == 0 ){
7407
        free(input_type);
7459
        free(input_type);
7408
        return YLOGSCALE;
7460
        return YLOGSCALE;
7409
        }
7461
        }
7410
        if( strcmp(input_type, xylogscale) == 0 ){
7462
        if( strcmp(input_type, xylogscale) == 0 ){
7411
        free(input_type);
7463
        free(input_type);
7412
        return XYLOGSCALE;
7464
        return XYLOGSCALE;
7413
        }
7465
        }
7414
        if( strcmp(input_type, ylogscale) == 0 ){
7466
        if( strcmp(input_type, ylogscale) == 0 ){
Line 7432... Line 7484...
7432
        return POPUP;
7484
        return POPUP;
7433
        }
7485
        }
7434
        if( strcmp(input_type,video) == 0 ){
7486
        if( strcmp(input_type,video) == 0 ){
7435
        free(input_type);
7487
        free(input_type);
7436
        return VIDEO;
7488
        return VIDEO;
7437
        }
7489
        }
7438
        if( strcmp(input_type,math) == 0 || strcmp(input_type,latex) == 0 ||  strcmp(input_type,katex) == 0 ){
7490
        if( strcmp(input_type,math) == 0 || strcmp(input_type,latex) == 0 ||  strcmp(input_type,katex) == 0 ){
7439
        free(input_type);
7491
        free(input_type);
7440
#ifdef KATEX_INSTALLED
7492
#ifdef KATEX_INSTALLED
7441
        return KATEX;
7493
        return KATEX;
7442
#else
7494
#else
Line 7462... Line 7514...
7462
        if( strcmp(input_type, curvedarrow) == 0 ){
7514
        if( strcmp(input_type, curvedarrow) == 0 ){
7463
        free(input_type);
7515
        free(input_type);
7464
        return CURVEDARROW;
7516
        return CURVEDARROW;
7465
        }
7517
        }
7466
        if( strcmp(input_type, curvedarrows) == 0 ){
7518
        if( strcmp(input_type, curvedarrows) == 0 ){
7467
        free(input_type);
7519
        free(input_type);
7468
        return CURVEDARROWS;
7520
        return CURVEDARROWS;
7469
        }
7521
        }
7470
        if( strcmp(input_type, curvedarrows2) == 0 ){
7522
        if( strcmp(input_type, curvedarrows2) == 0 ){
7471
        free(input_type);
7523
        free(input_type);
7472
        return CURVEDARROWS2;
7524
        return CURVEDARROWS2;
7473
        }
7525
        }
7474
        if( strcmp(input_type, replyformat) == 0 ){
7526
        if( strcmp(input_type, replyformat) == 0 ){
7475
        free(input_type);
7527
        free(input_type);
7476
        return REPLYFORMAT;
7528
        return REPLYFORMAT;
7477
        }
7529
        }
7478
        if( strcmp(input_type, pixelsize) == 0 ){
7530
        if( strcmp(input_type, pixelsize) == 0 ){
7479
        free(input_type);
7531
        free(input_type);
7480
        return PIXELSIZE;
7532
        return PIXELSIZE;
7481
        }
7533
        }
7482
        if( strcmp(input_type, setpixel) == 0 ){
7534
        if( strcmp(input_type, setpixel) == 0 ){
7483
        free(input_type);
7535
        free(input_type);
7484
        return SETPIXEL;
7536
        return SETPIXEL;
7485
        }
7537
        }
7486
        if( strcmp(input_type, pixels) == 0 ){
7538
        if( strcmp(input_type, pixels) == 0 ){
Line 7506... Line 7558...
7506
        if( strcmp(input_type, legendcolors) == 0  ){
7558
        if( strcmp(input_type, legendcolors) == 0  ){
7507
        free(input_type);
7559
        free(input_type);
7508
        return LEGENDCOLORS;
7560
        return LEGENDCOLORS;
7509
        }
7561
        }
7510
        if( strcmp(input_type, xlabel) == 0  ){
7562
        if( strcmp(input_type, xlabel) == 0  ){
7511
        free(input_type);
7563
        free(input_type);
7512
        return XLABEL;
7564
        return XLABEL;
7513
        }
7565
        }
7514
        if( strcmp(input_type, ylabel) == 0  ){
7566
        if( strcmp(input_type, ylabel) == 0  ){
7515
        free(input_type);
7567
        free(input_type);
7516
        return YLABEL;
7568
        return YLABEL;
7517
        }
7569
        }
7518
        if( strcmp(input_type, bezier) == 0  ){
7570
        if( strcmp(input_type, bezier) == 0  ){
7519
        free(input_type);
7571
        free(input_type);
7520
        return BEZIER;
7572
        return BEZIER;
7521
        }
7573
        }
7522
        if( strcmp(input_type, animate) == 0  ){
7574
        if( strcmp(input_type, animate) == 0  ){
7523
        free(input_type);
7575
        free(input_type);
7524
        return ANIMATE;
7576
        return ANIMATE;
7525
        }
7577
        }
7526
        /* these are bitmap related flydraw commands...must be removed. eventually */
7578
        /* these are bitmap related flydraw commands...must be removed. eventually */
7527
        if( strcmp(input_type, transparent) == 0 ){
7579
        if( strcmp(input_type, transparent) == 0 ){
7528
        free(input_type);
7580
        free(input_type);
7529
        return TRANSPARENT;
7581
        return TRANSPARENT;
7530
        }
7582
        }
Line 7535... Line 7587...
7535
        if( strcmp(input_type, xsnaptogrid) == 0 ){
7587
        if( strcmp(input_type, xsnaptogrid) == 0 ){
7536
        free(input_type);
7588
        free(input_type);
7537
        return XSNAPTOGRID;
7589
        return XSNAPTOGRID;
7538
        }
7590
        }
7539
        if( strcmp(input_type, ysnaptogrid) == 0 ){
7591
        if( strcmp(input_type, ysnaptogrid) == 0 ){
7540
        free(input_type);
7592
        free(input_type);
7541
        return YSNAPTOGRID;
7593
        return YSNAPTOGRID;
7542
        }
7594
        }
7543
        if( strcmp(input_type, snaptogrid) == 0 ){
7595
        if( strcmp(input_type, snaptogrid) == 0 ){
7544
        free(input_type);
7596
        free(input_type);
7545
        return SNAPTOGRID;
7597
        return SNAPTOGRID;
Line 7579... Line 7631...
7579
        if( strcmp(input_type, sliderfunction_y) == 0 ){
7631
        if( strcmp(input_type, sliderfunction_y) == 0 ){
7580
        free(input_type);
7632
        free(input_type);
7581
        return SLIDER_Y;
7633
        return SLIDER_Y;
7582
        }
7634
        }
7583
        if( strcmp(input_type, multidraw) == 0 ){
7635
        if( strcmp(input_type, multidraw) == 0 ){
7584
        free(input_type);
7636
        free(input_type);
7585
        return MULTIDRAW;
7637
        return MULTIDRAW;
7586
        }
7638
        }
7587
        if( strcmp(input_type, multistrokeopacity) == 0 ){
7639
        if( strcmp(input_type, multistrokeopacity) == 0 ){
7588
        free(input_type);
7640
        free(input_type);
7589
        return MULTISTROKEOPACITY;
7641
        return MULTISTROKEOPACITY;
7590
        }
7642
        }
7591
        if( strcmp(input_type, multifillopacity) == 0 ){
7643
        if( strcmp(input_type, multifillopacity) == 0 ){
7592
        free(input_type);
7644
        free(input_type);
7593
        return MULTIFILLOPACITY;
7645
        return MULTIFILLOPACITY;
7594
        }
7646
        }
7595
        if( strcmp(input_type, multilinewidth) == 0 || strcmp(input_type, linewidths) == 0 ){
7647
        if( strcmp(input_type, multilinewidth) == 0 || strcmp(input_type, linewidths) == 0 ){
7596
        free(input_type);
7648
        free(input_type);
7597
        return MULTILINEWIDTH;
7649
        return MULTILINEWIDTH;
7598
        }
7650
        }
7599
        if( strcmp(input_type, multistrokecolors) == 0 || strcmp(input_type,multicolors) == 0  || strcmp(input_type,strokecolors) == 0 ||  strcmp(input_type,colors) == 0 ){
7651
        if( strcmp(input_type, multistrokecolors) == 0 || strcmp(input_type,multicolors) == 0  || strcmp(input_type,strokecolors) == 0 ||  strcmp(input_type,colors) == 0 ){
7600
        free(input_type);
7652
        free(input_type);
7601
        return MULTISTROKECOLORS;
7653
        return MULTISTROKECOLORS;
7602
        }
7654
        }
7603
        if( strcmp(input_type, multifill) == 0 ){
7655
        if( strcmp(input_type, multifill) == 0 ){
Line 7828... Line 7880...
7828
         return NORESET;
7880
         return NORESET;
7829
        }
7881
        }
7830
        if( strcmp(input_type, duplicates) == 0 || strcmp(input_type, allowdups) == 0 ){
7882
        if( strcmp(input_type, duplicates) == 0 || strcmp(input_type, allowdups) == 0 ){
7831
        free(input_type);
7883
        free(input_type);
7832
        return ALLOW_DUPLICATES;
7884
        return ALLOW_DUPLICATES;
-
 
7885
        }
-
 
7886
        if( strcmp(input_type, arrowarc) == 0 || strcmp(input_type, arcarrow) == 0 ){
-
 
7887
        free(input_type);
-
 
7888
        return ARCARROW;
7833
        }
7889
        }
7834
        free(input_type);
7890
        free(input_type);
7835
        ungetc(c,infile);
7891
        ungetc(c,infile);
7836
        return 0;
7892
        return 0;
7837
}
7893
}