Rev 18160 | Rev 18165 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 18160 | Rev 18164 | ||
---|---|---|---|
Line 2068... | Line 2068... | ||
2068 | @ draws a halfline starting in (x1:y1) and through (x2:y2) in color 'color' (colorname or hex) |
2068 | @ draws a halfline starting in (x1:y1) and through (x2:y2) in color 'color' (colorname or hex) |
2069 | @ may be set <a href="#drag">draggable</a> / <a href="#onclick">onclick</a> |
2069 | @ may be set <a href="#drag">draggable</a> / <a href="#onclick">onclick</a> |
2070 | @%halfline%size 400,400%xrange -10,10%yrange -10,10%halfline -5,5,0,0,red%halfline -5,-5,0,0,blue |
2070 | @%halfline%size 400,400%xrange -10,10%yrange -10,10%halfline -5,5,0,0,red%halfline -5,-5,0,0,blue |
2071 | */ |
2071 | */ |
2072 | for(i=0; i<13;i++){double_data[i]=0;} |
2072 | for(i=0; i<13;i++){double_data[i]=0;} |
2073 | 2073 | ||
2074 | for(i=0;i<5;i++){ |
2074 | for(i=0;i<5;i++){ |
2075 | switch(i){ |
2075 | switch(i){ |
2076 | case 0: double_data[0]= get_real(infile,0);break; /* x-values */ |
2076 | case 0: double_data[0]= get_real(infile,0);break; /* x-values */ |
2077 | case 1: double_data[1]= get_real(infile,0);break; /* y-values */ |
2077 | case 1: double_data[1]= get_real(infile,0);break; /* y-values */ |
2078 | case 2: double_data[10]= get_real(infile,0);break; /* x-values */ |
2078 | case 2: double_data[10]= get_real(infile,0);break; /* x-values */ |
Line 2340... | Line 2340... | ||
2340 | } |
2340 | } |
2341 | } |
2341 | } |
2342 | reset(); |
2342 | reset(); |
2343 | break; |
2343 | break; |
2344 | case HTML: |
2344 | case HTML: |
2345 | /* |
2345 | /* |
2346 | @ html x1,y1,html_string |
2346 | @ html x1,y1,html_string |
2347 | @ all tags are allowed, html code using inputfields could be read using your own javascript code. Do not use ids like 'canvas_input0' etc. |
2347 | @ all tags are allowed, html code using inputfields could be read using your own javascript code. Do not use ids like 'canvas_input0' etc. |
2348 | @ can be set <a href='#onclick'>onclick</a> and <a href='#drag'>drag&drop</a> |
2348 | @ can be set <a href='#onclick'>onclick</a> and <a href='#drag'>drag&drop</a> |
2349 | @ command <a href='#affine'>affine</a> will produce CSS3 matrix transformations |
2349 | @ command <a href='#affine'>affine</a> will produce CSS3 matrix transformations |
2350 | @ command <a href='#rotate'>rotate</a> will rotate the object |
2350 | @ command <a href='#rotate'>rotate</a> will rotate the object |
Line 2796... | Line 2796... | ||
2796 | @ draw multiple lines through points (x1:y1)--(x2:y2) ...(x_n-1:y_n-1)--(x_n:y_n) in color 'color' |
2796 | @ draw multiple lines through points (x1:y1)--(x2:y2) ...(x_n-1:y_n-1)--(x_n:y_n) in color 'color' |
2797 | @ or use multiple commands ''curve color,formula`` or ''jscurve color,formule`` to draw the line <br>(uses more points to draw the line; is however better draggable) |
2797 | @ or use multiple commands ''curve color,formula`` or ''jscurve color,formule`` to draw the line <br>(uses more points to draw the line; is however better draggable) |
2798 | @ may be set <a href="#drag">draggable</a> / <a href="#onclick">onclick</a> |
2798 | @ may be set <a href="#drag">draggable</a> / <a href="#onclick">onclick</a> |
2799 | @ <b>attention</b>: the flydraw command ''lines`` is equivalent to canvasdraw command <a href="#polyline">polyline</a> |
2799 | @ <b>attention</b>: the flydraw command ''lines`` is equivalent to canvasdraw command <a href="#polyline">polyline</a> |
2800 | @%lines%size 400,400%xrange -10,10%yrange -10,10%lines green,0,1,1,3,0,0,1,3,0,0,-2,1 |
2800 | @%lines%size 400,400%xrange -10,10%yrange -10,10%lines green,0,1,1,3,0,0,1,3,0,0,-2,1 |
2801 | */ |
2801 | */ |
2802 | stroke_color=get_color(infile,0); /* how nice: now the color comes first...*/ |
2802 | stroke_color=get_color(infile,0); /* how nice: now the color comes first...*/ |
2803 | fill_color = stroke_color; |
2803 | fill_color = stroke_color; |
2804 | i=0; |
2804 | i=0; |
2805 | while( ! done ){ /* get next item until EOL*/ |
2805 | while( ! done ){ /* get next item until EOL*/ |
2806 | if(i > MAX_INT - 1){canvas_error("too many points in argument: repeat command multiple times to fit");} |
2806 | if(i > MAX_INT - 1){canvas_error("too many points in argument: repeat command multiple times to fit");} |
2807 | if(i%2 == 0 ){ |
2807 | if(i%2 == 0 ){ |
2808 | double_data[i] = get_real(infile,0); /* x */ |
2808 | double_data[i] = get_real(infile,0); /* x */ |
2809 | } |
2809 | } |
2810 | else |
2810 | else |
2811 | { |
2811 | { |
2812 | double_data[i] = get_real(infile,1); /* y */ |
2812 | double_data[i] = get_real(infile,1); /* y */ |
2813 | } |
2813 | } |
2814 | i++; |
2814 | i++; |
2815 | } |
2815 | } |
Line 2990... | Line 2990... | ||
2990 | temp = get_string(infile,1); |
2990 | temp = get_string(infile,1); |
2991 | if( strstr(temp,"\"") != 0 ){ temp = str_replace(temp,"\"","'"); } |
2991 | if( strstr(temp,"\"") != 0 ){ temp = str_replace(temp,"\"","'"); } |
2992 | string_length = 1 + snprintf(NULL,0,"var draw_xml%d = {id:%d,type:'mathml',x:[%d],y:[%d],mathml:\"%s\",drag_type:%d,onclick:%d,object_cnt:%d,stroke_color:\"%s\",stroke_opacity:%.2f,fill_color:\"%s\",fill_opacity:%.2f,use_center:%d,use_snap:%d,angle:%f,fontfamily:\"%s\",transform:%s,use_affine:%d,offset:[0,0],use_slider:%d,rotation_center:%s,once:true};draw_xml(draw_xml%d);slidergroup[%d] = null;\n",drawxml_cnt,drawxml_cnt,int_data[0],int_data[1],temp,drag_type,onclick,object_cnt,stroke_color,stroke_opacity,fill_color,fill_opacity,int_data[2],use_snap,angle,font_family,doubledata2js_array(affine_matrix,6,decimals),use_affine,use_slider,rotation_center,drawxml_cnt,object_cnt); |
2992 | string_length = 1 + snprintf(NULL,0,"var draw_xml%d = {id:%d,type:'mathml',x:[%d],y:[%d],mathml:\"%s\",drag_type:%d,onclick:%d,object_cnt:%d,stroke_color:\"%s\",stroke_opacity:%.2f,fill_color:\"%s\",fill_opacity:%.2f,use_center:%d,use_snap:%d,angle:%f,fontfamily:\"%s\",transform:%s,use_affine:%d,offset:[0,0],use_slider:%d,rotation_center:%s,once:true};draw_xml(draw_xml%d);slidergroup[%d] = null;\n",drawxml_cnt,drawxml_cnt,int_data[0],int_data[1],temp,drag_type,onclick,object_cnt,stroke_color,stroke_opacity,fill_color,fill_opacity,int_data[2],use_snap,angle,font_family,doubledata2js_array(affine_matrix,6,decimals),use_affine,use_slider,rotation_center,drawxml_cnt,object_cnt); |
2993 | check_string_length(string_length);tmp_buffer = my_newmem(string_length); |
2993 | check_string_length(string_length);tmp_buffer = my_newmem(string_length); |
2994 | snprintf(tmp_buffer,string_length, "var draw_xml%d = {id:%d,type:'mathml',x:[%d],y:[%d],mathml:\"%s\",drag_type:%d,onclick:%d,object_cnt:%d,stroke_color:\"%s\",stroke_opacity:%.2f,fill_color:\"%s\",fill_opacity:%.2f,use_center:%d,use_snap:%d,angle:%f,fontfamily:\"%s\",transform:%s,use_affine:%d,offset:[0,0],use_slider:%d,rotation_center:%s,once:true};draw_xml(draw_xml%d);slidergroup[%d] = null;\n",drawxml_cnt,drawxml_cnt,int_data[0],int_data[1],temp,drag_type,onclick,object_cnt,stroke_color,stroke_opacity,fill_color,fill_opacity,int_data[2],use_snap,angle,font_family,doubledata2js_array(affine_matrix,6,decimals),use_affine,use_slider,rotation_center,drawxml_cnt,object_cnt); |
2994 | snprintf(tmp_buffer,string_length, "var draw_xml%d = {id:%d,type:'mathml',x:[%d],y:[%d],mathml:\"%s\",drag_type:%d,onclick:%d,object_cnt:%d,stroke_color:\"%s\",stroke_opacity:%.2f,fill_color:\"%s\",fill_opacity:%.2f,use_center:%d,use_snap:%d,angle:%f,fontfamily:\"%s\",transform:%s,use_affine:%d,offset:[0,0],use_slider:%d,rotation_center:%s,once:true};draw_xml(draw_xml%d);slidergroup[%d] = null;\n",drawxml_cnt,drawxml_cnt,int_data[0],int_data[1],temp,drag_type,onclick,object_cnt,stroke_color,stroke_opacity,fill_color,fill_opacity,int_data[2],use_snap,angle,font_family,doubledata2js_array(affine_matrix,6,decimals),use_affine,use_slider,rotation_center,drawxml_cnt,object_cnt); |
2995 | add_to_buffer(tmp_buffer); |
2995 | add_to_buffer(tmp_buffer); |
2996 | if(onclick != 0 ){object_cnt++;} |
2996 | if(onclick != 0 ){object_cnt++;} |
2997 | drawxml_cnt++;/* keeps track on imported img,div,p,span,mathml,svg */ |
2997 | drawxml_cnt++;/* keeps track on imported img,div,p,span,mathml,svg */ |
2998 | /* |
2998 | /* |
2999 | in case inputs are present, trigger adding the read_mathml() |
2999 | in case inputs are present, trigger adding the read_mathml() |
3000 | if no other reply_format is defined |
3000 | if no other reply_format is defined |
Line 3174... | Line 3174... | ||
3174 | @%multidraw_demo%size 800,800%xrange -10,10%yrange -10,10%axis%axisnumbering%precision 1%grid 2,2,grey,2,2,5,grey%css color:blue;%fontfamily Italic 42pt Arial%precision 1%opacity 200,50%snaptogrid%linewidth 3%filled%multistrokecolors red,green,blue,orange,yellow,purple,black,cyan,red,green,blue,orange,green,purple,black,cyan%multifillcolors red,green,blue,orange,yellow,purple,black,cyan,red,green,blue,orange,brown,purple%imagepalette gifs/ca.gif,gifs/en.gif,gifs/nl.gif,gifs/fr.gif,gifs/cn.gif,gifs/de.gif,gifs/kh.gif,gifs/it.gif%multidraw closedpoly,segments,rect,parallelogram,triangles,poly5,points,lines,arrows,circles,text,curvedarrows,curvedarrows2,images |
3174 | @%multidraw_demo%size 800,800%xrange -10,10%yrange -10,10%axis%axisnumbering%precision 1%grid 2,2,grey,2,2,5,grey%css color:blue;%fontfamily Italic 42pt Arial%precision 1%opacity 200,50%snaptogrid%linewidth 3%filled%multistrokecolors red,green,blue,orange,yellow,purple,black,cyan,red,green,blue,orange,green,purple,black,cyan%multifillcolors red,green,blue,orange,yellow,purple,black,cyan,red,green,blue,orange,brown,purple%imagepalette gifs/ca.gif,gifs/en.gif,gifs/nl.gif,gifs/fr.gif,gifs/cn.gif,gifs/de.gif,gifs/kh.gif,gifs/it.gif%multidraw closedpoly,segments,rect,parallelogram,triangles,poly5,points,lines,arrows,circles,text,curvedarrows,curvedarrows2,images |
3175 | @%multidraw_NOCONTROLS%size 400,400%xrange -10,10%yrange -10,10%grid 2,2,grey%linewidth 3%strokecolor green%fillcolor blue%filled%opacity 255,60%multilabel NOCONTROLS%multidraw circles%# RIGHT MOUSE CLICK REMOVES LAST OBJECT |
3175 | @%multidraw_NOCONTROLS%size 400,400%xrange -10,10%yrange -10,10%grid 2,2,grey%linewidth 3%strokecolor green%fillcolor blue%filled%opacity 255,60%multilabel NOCONTROLS%multidraw circles%# RIGHT MOUSE CLICK REMOVES LAST OBJECT |
3176 | */ |
3176 | */ |
3177 | js_function[INTERACTIVE] = 1; |
3177 | js_function[INTERACTIVE] = 1; |
3178 | if(js_function[JS_ZOOM] == 1){use_zoom = 1;} /* use noisy zoom_code, when command zoom is given before command 'multidraw' */ |
3178 | if(js_function[JS_ZOOM] == 1){use_zoom = 1;} /* use noisy zoom_code, when command zoom is given before command 'multidraw' */ |
3179 | if( use_tooltip == 1 ){canvas_error("command 'multidraw' is incompatible with command 'intooltip tip_text'");} |
3179 | if( use_tooltip == 1 ){canvas_error("command 'multidraw' is incompatible with command 'intooltip tip_text'");} |
3180 | if( use_userdraw == 1 ){canvas_error("Only one userdraw primitive may be used in command 'userdraw' use command 'multidraw' for this...");} |
3180 | if( use_userdraw == 1 ){canvas_error("Only one userdraw primitive may be used in command 'userdraw' use command 'multidraw' for this...");} |
3181 | use_userdraw = 2; |
3181 | use_userdraw = 2; |
3182 | temp = get_string(infile,1); |
3182 | temp = get_string(infile,1); |
3183 | fprintf(js_include_file,"\ |
3183 | fprintf(js_include_file,"\ |
3184 | var MMP = %d;\ |
3184 | var MMP = %d;\ |
Line 3208... | Line 3208... | ||
3208 | /* no_controls == int_data[MAX_MULTI_PRIMITIVES+1] */ |
3208 | /* no_controls == int_data[MAX_MULTI_PRIMITIVES+1] */ |
3209 | reply_precision = precision; |
3209 | reply_precision = precision; |
3210 | if(strstr(temp,"text") != NULL){ |
3210 | if(strstr(temp,"text") != NULL){ |
3211 | js_function[JS_SAFE_EVAL] = 1; |
3211 | js_function[JS_SAFE_EVAL] = 1; |
3212 | js_function[DRAW_SUBSUP] = 1; |
3212 | js_function[DRAW_SUBSUP] = 1; |
3213 | } |
3213 | } |
3214 | if(strstr(temp,"function") != NULL){ |
3214 | if(strstr(temp,"function") != NULL){ |
3215 | int pp, funs = count_substring(temp, "function"); |
3215 | int pp, funs = count_substring(temp, "function"); |
3216 | js_function[JS_SAFE_EVAL] = 1; |
3216 | js_function[JS_SAFE_EVAL] = 1; |
3217 | js_function[JS_RAWMATH] = 1; |
3217 | js_function[JS_RAWMATH] = 1; |
3218 | js_function[DRAW_JSFUNCTION] = 1; |
3218 | js_function[DRAW_JSFUNCTION] = 1; |
Line 3266... | Line 3266... | ||
3266 | temp = get_string(infile,1); |
3266 | temp = get_string(infile,1); |
3267 | temp = str_replace(temp,",","\",\""); |
3267 | temp = str_replace(temp,",","\",\""); |
3268 | fprintf(js_include_file,"var multilinewidth = [\"%s\"];",temp); |
3268 | fprintf(js_include_file,"var multilinewidth = [\"%s\"];",temp); |
3269 | break; |
3269 | break; |
3270 | case MULTIFILL: |
3270 | case MULTIFILL: |
3271 | /* |
3271 | /* |
3272 | @ multifill 0,0,1,0,1,0,0 |
3272 | @ multifill 0,0,1,0,1,0,0 |
3273 | @ meaning draw objects no. 3 and 5, in the list of command ''multifill``, are filled (if the object is fillable...and not a line,segment,arrow or point...) |
3273 | @ meaning draw objects no. 3 and 5, in the list of command ''multifill``, are filled (if the object is fillable...and not a line,segment,arrow or point...) |
3274 | @ using a fillpattern: multifill 0,1,2,5,3,4<br>meaning: first object is not filled...second object is solid color filled...2=grid | 3=hatch | 4=diamond | 5=dot |
3274 | @ using a fillpattern: multifill 0,1,2,5,3,4<br>meaning: first object is not filled...second object is solid color filled...2=grid | 3=hatch | 4=diamond | 5=dot |
3275 | @ use before command <a href='#multidraw'>multidraw</a> |
3275 | @ use before command <a href='#multidraw'>multidraw</a> |
3276 | @ if not set all objects -except point|points- will be set ''not filled``... unless a command <code>filled</code> was given before command <code>multifill</code> |
3276 | @ if not set all objects -except point|points- will be set ''not filled``... unless a command <code>filled</code> was given before command <code>multifill</code> |
Line 3300... | Line 3300... | ||
3300 | @ always use the same sequence as is used for ''multidraw`` |
3300 | @ always use the same sequence as is used for ''multidraw`` |
3301 | @ can also be used with command <a href='#userdraw'>userdraw clickfill,color</a> when more than one fillcolor is wanted.<br>in that case use for example <a href='#replyformat'>replyformat 10</a> ... reply=x1:y1:color1,x2:y2:color2...<br>the colors will restart at the first color, when there are more fill-clicks than multi-fill-colors<br>if more control over the used colours is wanted, see command <a href='#colorpalette'>colorpalette color1,color2...</a> |
3301 | @ can also be used with command <a href='#userdraw'>userdraw clickfill,color</a> when more than one fillcolor is wanted.<br>in that case use for example <a href='#replyformat'>replyformat 10</a> ... reply=x1:y1:color1,x2:y2:color2...<br>the colors will restart at the first color, when there are more fill-clicks than multi-fill-colors<br>if more control over the used colours is wanted, see command <a href='#colorpalette'>colorpalette color1,color2...</a> |
3302 | */ |
3302 | */ |
3303 | if( use_tooltip == 1 ){canvas_error("command 'multidraw' is incompatible with command 'intooltip tip_text'");} |
3303 | if( use_tooltip == 1 ){canvas_error("command 'multidraw' is incompatible with command 'intooltip tip_text'");} |
3304 | fprintf(js_include_file,"var multifillcolors = ["); |
3304 | fprintf(js_include_file,"var multifillcolors = ["); |
3305 | while( ! done ){ |
3305 | while( ! done ){ |
3306 | temp = get_color(infile,1); |
3306 | temp = get_color(infile,1); |
3307 | fprintf(js_include_file,"\"%s\",",temp); |
3307 | fprintf(js_include_file,"\"%s\",",temp); |
3308 | } |
3308 | } |
3309 | fprintf(js_include_file,"\"0,0,0\"];");/* add black to avoid trouble with dangling comma... */ |
3309 | fprintf(js_include_file,"\"0,0,0\"];");/* add black to avoid trouble with dangling comma... */ |
3310 | break; |
3310 | break; |
3311 | 3311 | ||
3312 | case MULTIFILLOPACITY: |
3312 | case MULTIFILLOPACITY: |
3313 | /* |
3313 | /* |
3314 | @ multifillopacity fill_opacity_1,fill_opacity_2,...,fill_opacity_8 |
3314 | @ multifillopacity fill_opacity_1,fill_opacity_2,...,fill_opacity_8 |
3315 | @ float values 0 - 1 or integer values 0 - 255 |
3315 | @ float values 0 - 1 or integer values 0 - 255 |
3316 | @ use before command <a href='#multidraw'>multidraw</a> |
3316 | @ use before command <a href='#multidraw'>multidraw</a> |
3317 | @ if not set all fill opacity_ will be set by previous command <code>opacity int,int</code> and keyword ''filled`` |
3317 | @ if not set all fill opacity_ will be set by previous command <code>opacity int,int</code> and keyword ''filled`` |
3318 | @ use these up to 7 different stroke opacities for the draw primitives used by command <code>multidraw obj_type_1,obj_type_2...obj_type_y</code> |
3318 | @ use these up to 7 different stroke opacities for the draw primitives used by command <code>multidraw obj_type_1,obj_type_2...obj_type_y</code> |
3319 | @ wims will not check the amount or validity of your input |
3319 | @ wims will not check the amount or validity of your input |
3320 | @ always use the same sequence as is used for ''multidraw`` |
3320 | @ always use the same sequence as is used for ''multidraw`` |
3321 | */ |
3321 | */ |
Line 3323... | Line 3323... | ||
3323 | temp = get_string(infile,1); |
3323 | temp = get_string(infile,1); |
3324 | temp = str_replace(temp,",","\",\""); |
3324 | temp = str_replace(temp,",","\",\""); |
3325 | fprintf(js_include_file,"var multifillopacity = [\"%s\"];",temp); |
3325 | fprintf(js_include_file,"var multifillopacity = [\"%s\"];",temp); |
3326 | break; |
3326 | break; |
3327 | case MULTISNAPTOGRID: |
3327 | case MULTISNAPTOGRID: |
3328 | /* |
3328 | /* |
3329 | @ multisnaptogrid 0,1,1 |
3329 | @ multisnaptogrid 0,1,1 |
3330 | @ alternative: multisnap |
3330 | @ alternative: multisnap |
3331 | @ meaning draw objects no. 2 (circle) and 3 (segments), in the list of command like <code>multifill points,circle,segments</code>, will snap to the xy-grid (default 1 in x/y-coordinate system: see command <a href='#snaptogrid'>snaptogrid</a>) |
3331 | @ meaning draw objects no. 2 (circle) and 3 (segments), in the list of command like <code>multifill points,circle,segments</code>, will snap to the xy-grid (default 1 in x/y-coordinate system: see command <a href='#snaptogrid'>snaptogrid</a>) |
3332 | @ freehand drawing...specify precision for reply: all objects snap to grid <code>multisnaptogrid 1,1,1,...</code> |
3332 | @ freehand drawing...specify precision for reply: all objects snap to grid <code>multisnaptogrid 1,1,1,...</code> |
3333 | @ only the xy-values snap_to_grid: all objects snap to grid <code>multisnaptogrid 1,1,1,...</code> |
3333 | @ only the xy-values snap_to_grid: all objects snap to grid <code>multisnaptogrid 1,1,1,...</code> |
Line 3358... | Line 3358... | ||
3358 | if( use_tooltip == 1 ){canvas_error("command 'multidraw' is incompatible with command 'intooltip tip_text'");} |
3358 | if( use_tooltip == 1 ){canvas_error("command 'multidraw' is incompatible with command 'intooltip tip_text'");} |
3359 | fprintf(js_include_file,"var multistrokecolors = ["); |
3359 | fprintf(js_include_file,"var multistrokecolors = ["); |
3360 | while( ! done ){ |
3360 | while( ! done ){ |
3361 | temp = get_color(infile,1); |
3361 | temp = get_color(infile,1); |
3362 | fprintf(js_include_file,"\"%s\",",temp); |
3362 | fprintf(js_include_file,"\"%s\",",temp); |
3363 | } |
3363 | } |
3364 | fprintf(js_include_file,"\"0,0,0\"];");/* add black to avoid trouble with dangling comma... */ |
3364 | fprintf(js_include_file,"\"0,0,0\"];");/* add black to avoid trouble with dangling comma... */ |
3365 | break; |
3365 | break; |
3366 | case MULTISTROKEOPACITY: |
3366 | case MULTISTROKEOPACITY: |
3367 | /* |
3367 | /* |
3368 | @ multistrokeopacity stroke_opacity_1,stroke_opacity_2,...,stroke_opacity_7 |
3368 | @ multistrokeopacity stroke_opacity_1,stroke_opacity_2,...,stroke_opacity_7 |
Line 3540... | Line 3540... | ||
3540 | */ |
3540 | */ |
3541 | for(i = 0 ; i<2;i++){ |
3541 | for(i = 0 ; i<2;i++){ |
3542 | switch(i){ |
3542 | switch(i){ |
3543 | case 0: double_data[0]= get_real(infile,0);break; |
3543 | case 0: double_data[0]= get_real(infile,0);break; |
3544 | case 1: double_data[1]= get_real(infile,1);break; |
3544 | case 1: double_data[1]= get_real(infile,1);break; |
3545 | default: break; |
3545 | default: break; |
3546 | } |
3546 | } |
3547 | } |
3547 | } |
3548 | if( double_data[0] > 255 || double_data[1] > 255 || double_data[0] < 0 || double_data[1] < 0 ){ canvas_error("opacity [0 - 255], [0 - 255] ");}/* typo or non-RGB ? */ |
3548 | if( double_data[0] > 255 || double_data[1] > 255 || double_data[0] < 0 || double_data[1] < 0 ){ canvas_error("opacity [0 - 255], [0 - 255] ");}/* typo or non-RGB ? */ |
3549 | if( double_data[0] > 1 ){ stroke_opacity = (double) (0.0039215*double_data[0]); }else{ stroke_opacity = 0.0;} /* 0.0 - 1.0 */ |
3549 | if( double_data[0] > 1 ){ stroke_opacity = (double) (0.0039215*double_data[0]); }else{ stroke_opacity = 0.0;} /* 0.0 - 1.0 */ |
3550 | if( double_data[1] > 1 ){ fill_opacity = (double) (0.0039215*double_data[1]); }else{ fill_opacity = 0.0;} /* 0.0 - 1.0 */ |
3550 | if( double_data[1] > 1 ){ fill_opacity = (double) (0.0039215*double_data[1]); }else{ fill_opacity = 0.0;} /* 0.0 - 1.0 */ |
3551 | break; |
3551 | break; |
3552 | 3552 | ||
Line 4126... | Line 4126... | ||
4126 | @ choose<ul><li>replyformat 1: <code>x1,x2,x3,x4....x_n<br>y1,y2,y3,y4....y_n</code> x/y in pixels</li><li>replyformat 2: <code> x1,x2,x3,x4....x_n<br> y1,y2,y3,y4....y_n</code> x/y in xrange / yrange coordinate system</li><li>replyformat 3: <code> x1,x2,x3,x4....x_n<br> y1,y2,y3,y4....y_n<br> r1,r2,r3,r4....r_n</code> x/y in pixels, r in pixels</li><li>replyformat 4: <code> x1,x2,x3,x4....x_n<br> y1,y2,y3,y4....y_n<br> r1,r2,r3,r4....r_n</code> x/y in xrange / yrange coordinate system, r in pixels</li><li>replyformat 5: <code> Ax1,Ax2,Ax3,Ax4....Ax_n<br> Ay1,Ay2,Ay3,Ay4....Ay_n<br> Bx1,Bx2,Bx3,Bx4....Bx_n<br> By1,By2,By3,By4....By_n<br> Cx1,Cx2,Cx3,Cx4....Cx_n<br> Cy1,Cy2,Cy3,Cy4....Cy_n<br> ....<br> Zx1,Zx2,Zx3,Zx4....Zx_n<br> Zy1,Zy2,Zy3,Zy4....Zy_n</code> x/y in pixels</li><li>replyformat 6: <code> Ax1,Ax2,Ax3,Ax4....Ax_n<br> Ay1,Ay2,Ay3,Ay4....Ay_n<br> Bx1,Bx2,Bx3,Bx4....Bx_n<br> By1,By2,By3,By4....By_n<br> Cx1,Cx2,Cx3,Cx4....Cx_n<br> Cy1,Cy2,Cy3,Cy4....Cy_n<br> ....<br> Zx1,Zx2,Zx3,Zx4....Zx_n<br> Zy1,Zy2,Zy3,Zy4....Zy_n</code> x/y in xrange / yrange coordinate system</li><li>replyformat 7: <code> x1:y1,x2:y2,x3:y3,x4:y4...x_n:y_n</code> x/y in pixels</li><li>replyformat 8: <code> x1:y1,x2:y2,x3:y3,x4:y4...x_n:y_n</code> x/y in xrange / yrange coordinate system</li><li>replyformat 9: <code> x1:y1:r1,x2:y2:r2,x3:y3:r3,x4:y4:r3...x_n:y_n:r_n</code> x/y in pixels</li><li>replyformat 10: <code> x1:y1:r1,x2:y2:r2,x3:y3:r3,x4:y4:r3...x_n:y_n:r_n</code> x/y in xrange / yrange coordinate system</li><li>replyformat 11: <code> Ax1,Ay1,Ax2,Ay2<br>Bx1,By1,Bx2,By2<br> Cx1,Cy1,Cx2,Cy2<br> Dx1,Dy1,Dx2,Dy2<br> ......<br> Zx1,Zy1,Zx2,Zy2</code> x/y in xrange / yrange coordinate system</li><li>replyformat 12: <code> Ax1,Ay1,Ax2,Ay2<br> Bx1,By1,Bx2,By2<br>Cx1,Cy1,Cx2,Cy2<br> Dx1,Dy1,Dx2,Dy2<br> ......<br> Zx1,Zy1,Zx2,Zy2</code> x/y in pixels</li><li>replyformat 13: <code> Ax1:Ay1:Ax2:Ay2,Bx1:By1:Bx2:By2,Cx1:Cy1:Cx2:Cy2,Dx1:Dy1:Dx2:Dy2, ... ,Zx1:Zy1:Zx2:Zy2</code> x/y in xrange / yrange coordinate system</li><li>replyformat 14: <code> Ax1:Ay1:Ax2:Ay2,Bx1:By1:Bx2:By2....Zx1:Zy1:Zx2:Zy2</code> x/y in pixels</li><li>replyformat 15: reply from inputfields,textareas <code>reply1,reply2,reply3,...,reply_n</code></li><li>replyformat 16: mathml input fields</li><li>replyformat 17: read ''userdraw text,color`` only <code>x1,y1,text1 \\n x2,y2,text2...\\n...x_n,y_n,text_n </code> x/y-values are in xrange/yrange</li><li>replyformat 18: read_canvas() will read all interactive clocks in <code>H1:M1:S1,H2:M2:S2...Hn:Mn:Sn</code></li><li>replyformat 19: read_canvas() will return the object number of marked / clicked object (clock), analogue to (shape library) onclick command</li><li>replyformat 20: read_canvas() will reply "object_number:x:y" of external images: object_number of the first draggable external image in the fly-script starts with 0, e.g. expect something like 0:-5:4,1:6:2,2:-2:-5, the first image position is (-5:4), the second image position is (6:2) and the third image position is (-2:-5) <li>replyformat 21: <code> (x1:y1) (x2:y2) ... (x_n:y_n)</code> verbatim coordinate return</li><li>replyformat 22: returns an array .... <code>reply[0]=x1 reply[1]=y1 reply[2]=x2 reply[3]=y2 ... reply[n-1]=x_n reply[n]=y_n</code> x/y in xrange / yrange coordinate system</li><li>replyformat 23: can only be used for drawtype ''polyline``. A typical click sequence in drawtype polyline is x1,y1,x2,y2,x2,y2,x3,y3,x3,y3.....,x(n-1),y(n-1),x(n-1),y(n-1),xn,yn --replyformat 23 gives <code>x1,y1,x2,y2,x3,y3,.....x(n-1),y(n-1),xn,yn</code>; multiple occurences will be filtered out. The reply will be in x-y-range (xreply \\n yreply)</li><li>replyformat 24: read all inputfield values: even those set ''readonly``</li><li>replyformat 25: <code> angle1,angle2;...;angle_n</code> will return the radius (one or many) of the user drawn circle segment in degrees</li><li>replyformat 26: <code> rad1,rad2,...rad_n</code> will return the radius (one or many) of the user drawn circle segment in radians</li><li>replyformat 27: return (only) userdraw inputfields <code>x1,y1,text1<br> x2,y2,text2...<br>...x_n,y_n,textn</code></li><li>replyformat 28: <code> x1,y1,r1,x2,y2,r2...x_n,y_n,r_n</code> x / y / r in xrange / yrange coordinate system: may be used to reinput into command <code>circles color,x1,y1,r1,x2,y2,r2...x_n,y_n,r_n</code> will not return anything else (e.g. no inputfields, text etc)</li><li>replyformat 34: a special for OEF and dragging external images -included via commands <a href='#copy'>copy</a> or <a href='#copyresized'>copyresized</a> there will be an extra function <code>read_canvas_images()</code> for reading the coordinates of the images.<br>for now this is a unique function, e.g. there is no ''canvas id`` linked to it. (TO DO !!! 18/5/2019)</li></ul> |
4126 | @ choose<ul><li>replyformat 1: <code>x1,x2,x3,x4....x_n<br>y1,y2,y3,y4....y_n</code> x/y in pixels</li><li>replyformat 2: <code> x1,x2,x3,x4....x_n<br> y1,y2,y3,y4....y_n</code> x/y in xrange / yrange coordinate system</li><li>replyformat 3: <code> x1,x2,x3,x4....x_n<br> y1,y2,y3,y4....y_n<br> r1,r2,r3,r4....r_n</code> x/y in pixels, r in pixels</li><li>replyformat 4: <code> x1,x2,x3,x4....x_n<br> y1,y2,y3,y4....y_n<br> r1,r2,r3,r4....r_n</code> x/y in xrange / yrange coordinate system, r in pixels</li><li>replyformat 5: <code> Ax1,Ax2,Ax3,Ax4....Ax_n<br> Ay1,Ay2,Ay3,Ay4....Ay_n<br> Bx1,Bx2,Bx3,Bx4....Bx_n<br> By1,By2,By3,By4....By_n<br> Cx1,Cx2,Cx3,Cx4....Cx_n<br> Cy1,Cy2,Cy3,Cy4....Cy_n<br> ....<br> Zx1,Zx2,Zx3,Zx4....Zx_n<br> Zy1,Zy2,Zy3,Zy4....Zy_n</code> x/y in pixels</li><li>replyformat 6: <code> Ax1,Ax2,Ax3,Ax4....Ax_n<br> Ay1,Ay2,Ay3,Ay4....Ay_n<br> Bx1,Bx2,Bx3,Bx4....Bx_n<br> By1,By2,By3,By4....By_n<br> Cx1,Cx2,Cx3,Cx4....Cx_n<br> Cy1,Cy2,Cy3,Cy4....Cy_n<br> ....<br> Zx1,Zx2,Zx3,Zx4....Zx_n<br> Zy1,Zy2,Zy3,Zy4....Zy_n</code> x/y in xrange / yrange coordinate system</li><li>replyformat 7: <code> x1:y1,x2:y2,x3:y3,x4:y4...x_n:y_n</code> x/y in pixels</li><li>replyformat 8: <code> x1:y1,x2:y2,x3:y3,x4:y4...x_n:y_n</code> x/y in xrange / yrange coordinate system</li><li>replyformat 9: <code> x1:y1:r1,x2:y2:r2,x3:y3:r3,x4:y4:r3...x_n:y_n:r_n</code> x/y in pixels</li><li>replyformat 10: <code> x1:y1:r1,x2:y2:r2,x3:y3:r3,x4:y4:r3...x_n:y_n:r_n</code> x/y in xrange / yrange coordinate system</li><li>replyformat 11: <code> Ax1,Ay1,Ax2,Ay2<br>Bx1,By1,Bx2,By2<br> Cx1,Cy1,Cx2,Cy2<br> Dx1,Dy1,Dx2,Dy2<br> ......<br> Zx1,Zy1,Zx2,Zy2</code> x/y in xrange / yrange coordinate system</li><li>replyformat 12: <code> Ax1,Ay1,Ax2,Ay2<br> Bx1,By1,Bx2,By2<br>Cx1,Cy1,Cx2,Cy2<br> Dx1,Dy1,Dx2,Dy2<br> ......<br> Zx1,Zy1,Zx2,Zy2</code> x/y in pixels</li><li>replyformat 13: <code> Ax1:Ay1:Ax2:Ay2,Bx1:By1:Bx2:By2,Cx1:Cy1:Cx2:Cy2,Dx1:Dy1:Dx2:Dy2, ... ,Zx1:Zy1:Zx2:Zy2</code> x/y in xrange / yrange coordinate system</li><li>replyformat 14: <code> Ax1:Ay1:Ax2:Ay2,Bx1:By1:Bx2:By2....Zx1:Zy1:Zx2:Zy2</code> x/y in pixels</li><li>replyformat 15: reply from inputfields,textareas <code>reply1,reply2,reply3,...,reply_n</code></li><li>replyformat 16: mathml input fields</li><li>replyformat 17: read ''userdraw text,color`` only <code>x1,y1,text1 \\n x2,y2,text2...\\n...x_n,y_n,text_n </code> x/y-values are in xrange/yrange</li><li>replyformat 18: read_canvas() will read all interactive clocks in <code>H1:M1:S1,H2:M2:S2...Hn:Mn:Sn</code></li><li>replyformat 19: read_canvas() will return the object number of marked / clicked object (clock), analogue to (shape library) onclick command</li><li>replyformat 20: read_canvas() will reply "object_number:x:y" of external images: object_number of the first draggable external image in the fly-script starts with 0, e.g. expect something like 0:-5:4,1:6:2,2:-2:-5, the first image position is (-5:4), the second image position is (6:2) and the third image position is (-2:-5) <li>replyformat 21: <code> (x1:y1) (x2:y2) ... (x_n:y_n)</code> verbatim coordinate return</li><li>replyformat 22: returns an array .... <code>reply[0]=x1 reply[1]=y1 reply[2]=x2 reply[3]=y2 ... reply[n-1]=x_n reply[n]=y_n</code> x/y in xrange / yrange coordinate system</li><li>replyformat 23: can only be used for drawtype ''polyline``. A typical click sequence in drawtype polyline is x1,y1,x2,y2,x2,y2,x3,y3,x3,y3.....,x(n-1),y(n-1),x(n-1),y(n-1),xn,yn --replyformat 23 gives <code>x1,y1,x2,y2,x3,y3,.....x(n-1),y(n-1),xn,yn</code>; multiple occurences will be filtered out. The reply will be in x-y-range (xreply \\n yreply)</li><li>replyformat 24: read all inputfield values: even those set ''readonly``</li><li>replyformat 25: <code> angle1,angle2;...;angle_n</code> will return the radius (one or many) of the user drawn circle segment in degrees</li><li>replyformat 26: <code> rad1,rad2,...rad_n</code> will return the radius (one or many) of the user drawn circle segment in radians</li><li>replyformat 27: return (only) userdraw inputfields <code>x1,y1,text1<br> x2,y2,text2...<br>...x_n,y_n,textn</code></li><li>replyformat 28: <code> x1,y1,r1,x2,y2,r2...x_n,y_n,r_n</code> x / y / r in xrange / yrange coordinate system: may be used to reinput into command <code>circles color,x1,y1,r1,x2,y2,r2...x_n,y_n,r_n</code> will not return anything else (e.g. no inputfields, text etc)</li><li>replyformat 34: a special for OEF and dragging external images -included via commands <a href='#copy'>copy</a> or <a href='#copyresized'>copyresized</a> there will be an extra function <code>read_canvas_images()</code> for reading the coordinates of the images.<br>for now this is a unique function, e.g. there is no ''canvas id`` linked to it. (TO DO !!! 18/5/2019)</li></ul> |
4127 | @ special replyformat = 100 ; will access to the raw javascript object data...use: read_dragdrop([property,property,...])<br>for example properies like 'clicked','text', 'angle' , 'x' |
4127 | @ special replyformat = 100 ; will access to the raw javascript object data...use: read_dragdrop([property,property,...])<br>for example properies like 'clicked','text', 'angle' , 'x' |
4128 | */ |
4128 | */ |
4129 | reply_format = (int) get_real(infile,1); |
4129 | reply_format = (int) get_real(infile,1); |
4130 | reply_precision = precision; |
4130 | reply_precision = precision; |
4131 | break; |
- | |
4132 | - | ||
4133 | case RESET: |
- | |
4134 | no_reset=FALSE; |
- | |
4135 | reset(); |
- | |
4136 | break; |
4131 | break; |
4137 | 4132 | ||
4138 | case ROUNDRECT: |
4133 | case ROUNDRECT: |
4139 | /* |
4134 | /* |
4140 | @ roundrect x1,y1,x2,y2,radius in px,color |
4135 | @ roundrect x1,y1,x2,y2,radius in px,color |
Line 5757... | Line 5752... | ||
5757 | break; |
5752 | break; |
5758 | 5753 | ||
5759 | case XYLOGSCALE: |
5754 | case XYLOGSCALE: |
5760 | /* |
5755 | /* |
5761 | @ xylogscale majorcolor,minorcolor |
5756 | @ xylogscale majorcolor,minorcolor |
5762 | @ the x/y-range are set using commands ''xrange xmin,xmax`` and ''yrange ymin,ymax`` |
5757 | @ the x/y-range are set using commands ''xrange xmin,xmax`` and ''yrange ymin,ymax`` |
5763 | @ the linewidth is set using command ''linewidth int`` |
5758 | @ the linewidth is set using command ''linewidth int`` |
5764 | @ the opacity of major / minor grid lines is set by command ''opacity [0-255],[0-255]`` |
5759 | @ the opacity of major / minor grid lines is set by command ''opacity [0-255],[0-255]`` |
5765 | @ default logbase number = 10 ... when needed, set the logbase number with command ''xlogbase number`` and/or ''ylogbase number`` |
5760 | @ default logbase number = 10 ... when needed, set the logbase number with command ''xlogbase number`` and/or ''ylogbase number`` |
5766 | @ the x/y- axis numbering is triggered by keyword ''axisnumbering``<ul><li>use commands ''xlabel some_text`` and/or ''ylabel some_text`` for text on axis: use command ''fontsize int`` to set the fontsize (default 12px)</li><li>use command ''fontfamily fnt_family_string`` to set the fonts for axis-numbering</li><li>use command ''fontcolor`` to set the colour</li></ul> |
5761 | @ the x/y- axis numbering is triggered by keyword ''axisnumbering``<ul><li>use commands ''xlabel some_text`` and/or ''ylabel some_text`` for text on axis: use command ''fontsize int`` to set the fontsize (default 12px)</li><li>use command ''fontfamily fnt_family_string`` to set the fonts for axis-numbering</li><li>use command ''fontcolor`` to set the colour</li></ul> |
5767 | @ note: the complete canvas will be used for the ''log paper`` |
5762 | @ note: the complete canvas will be used for the ''log paper`` |
5768 | @ note: userdrawings are done in the log paper, e.g. javascript:read_canvas() will return the real values |
5763 | @ note: userdrawings are done in the log paper, e.g. javascript:read_canvas() will return the real values |
Line 6039... | Line 6034... | ||
6039 | } |
6034 | } |
6040 | /* end main() */ |
6035 | /* end main() */ |
6041 | 6036 | ||
6042 | 6037 | ||
6043 | /****************************************************************************** |
6038 | /****************************************************************************** |
6044 | ** |
6039 | ** |
6045 | ** sync_input |
6040 | ** sync_input |
6046 | ** |
6041 | ** |
6047 | ** synchronises input line - reads to end of line, leaving file pointer |
6042 | ** synchronises input line - reads to end of line, leaving file pointer |
6048 | ** at first character of next line. |
6043 | ** at first character of next line. |
6049 | ** |
6044 | ** |
Line 6179... | Line 6174... | ||
6179 | int b = (int) strtol(blue, NULL, 16); |
6174 | int b = (int) strtol(blue, NULL, 16); |
6180 | int L0 = 1+snprintf(NULL,0,"%d,%d,%d",r,g,b); |
6175 | int L0 = 1+snprintf(NULL,0,"%d,%d,%d",r,g,b); |
6181 | string = my_newmem(L0); |
6176 | string = my_newmem(L0); |
6182 | snprintf(string,L0,"%d,%d,%d",r,g,b); |
6177 | snprintf(string,L0,"%d,%d,%d",r,g,b); |
6183 | return string; |
6178 | return string; |
6184 | } |
6179 | } |
6185 | else |
6180 | else |
6186 | { |
6181 | { |
6187 | string = (char *)my_newmem(sizeof(temp)); |
6182 | string = (char *)my_newmem(sizeof(temp)); |
6188 | snprintf(string,sizeof(temp),"%s",temp); |
6183 | snprintf(string,sizeof(temp),"%s",temp); |
6189 | for( i = 0; i < NUMBER_OF_COLORNAMES ; i++ ){ |
6184 | for( i = 0; i < NUMBER_OF_COLORNAMES ; i++ ){ |
Line 6320... | Line 6315... | ||
6320 | canvas_error("your memory buffer is too big<br>simplify your script...it produces too many lines "); |
6315 | canvas_error("your memory buffer is too big<br>simplify your script...it produces too many lines "); |
6321 | } |
6316 | } |
6322 | tmp = NULL;free(tmp); |
6317 | tmp = NULL;free(tmp); |
6323 | return; |
6318 | return; |
6324 | } |
6319 | } |
6325 | - | ||
6326 | 6320 | ||
6327 | void reset(){ |
6321 | void reset(){ |
6328 | if(no_reset == FALSE){ /* 8/5/2020 */ |
6322 | if(no_reset == FALSE){ /* 8/5/2020 */ |
6329 | use_filled = FALSE; |
6323 | use_filled = FALSE; |
6330 | use_dashed = FALSE; |
6324 | use_dashed = FALSE; |
Line 6395... | Line 6389... | ||
6395 | read(link[0],buffer, sizeof(buffer)); |
6389 | read(link[0],buffer, sizeof(buffer)); |
6396 | close(link[0]); |
6390 | close(link[0]); |
6397 | /* need to remover newline from svg-string on freebsd */ |
6391 | /* need to remover newline from svg-string on freebsd */ |
6398 | char *pch = strstr(buffer, "\n"); |
6392 | char *pch = strstr(buffer, "\n"); |
6399 | while(pch != NULL){ |
6393 | while(pch != NULL){ |
6400 |
|
6394 | strncpy(pch, " ", 1); |
6401 | pch = strstr(buffer, "\n"); |
6395 | pch = strstr(buffer, "\n"); |
6402 | } |
6396 | } |
6403 | string_length = 1 + snprintf(NULL,0,"%s",buffer); |
6397 | string_length = 1 + snprintf(NULL,0,"%s",buffer); |
6404 | svgmol= my_newmem(string_length); |
6398 | svgmol= my_newmem(string_length); |
6405 | snprintf(svgmol,string_length,"%s",buffer); |
6399 | snprintf(svgmol,string_length,"%s",buffer); |
Line 6685... | Line 6679... | ||
6685 | } |
6679 | } |
6686 | return digits; |
6680 | return digits; |
6687 | } |
6681 | } |
6688 | 6682 | ||
6689 | int count_substring(char* string, char* substring) { |
6683 | int count_substring(char* string, char* substring) { |
6690 | int i, l1, l2; |
6684 | int i, j, l1, l2; |
6691 | int count = 0; |
6685 | int count = 0; |
6692 | l1 = strlen(string); |
6686 | l1 = strlen(string); |
6693 | l2 = strlen(substring); |
6687 | l2 = strlen(substring); |
6694 | for(i = 0; i < l1 - l2 + 1; i++) { |
6688 | for(i = 0; i < l1 - l2 + 1; i++) { |
6695 | if(strstr(string + i, substring) == string + i) { |
6689 | if(strstr(string + i, substring) == string + i) { |
Line 6992... | Line 6986... | ||
6992 | *allowdups="allowdups", |
6986 | *allowdups="allowdups", |
6993 | *linear="linear", |
6987 | *linear="linear", |
6994 | *obabel="obabel", |
6988 | *obabel="obabel", |
6995 | *chemtex="chemtex", |
6989 | *chemtex="chemtex", |
6996 | *noreset="noreset", |
6990 | *noreset="noreset", |
6997 | *reset="reset", |
- | |
6998 | *killreset="killreset", |
6991 | *killreset="killreset", |
6999 | *arrowarc="arrowarc", |
6992 | *arrowarc="arrowarc", |
7000 | *arcarrow="arcarrow", |
6993 | *arcarrow="arcarrow", |
7001 | *newrange="newrange", |
6994 | *newrange="newrange", |
7002 | *canvastype="canvastype"; |
6995 | *canvastype="canvastype"; |
Line 7016... | Line 7009... | ||
7016 | } |
7009 | } |
7017 | if (c == '\n' || c == '\r' || c == '\t' ){ line_number++; } |
7010 | if (c == '\n' || c == '\r' || c == '\t' ){ line_number++; } |
7018 | if (c == EOF) {finished=1;return 0;} |
7011 | if (c == EOF) {finished=1;return 0;} |
7019 | 7012 | ||
7020 | temp[i]='\0'; |
7013 | temp[i]='\0'; |
7021 | if(strstr(temp,"dash") !=0 && strlen(temp) > 4 ){ |
7014 | if(strstr(temp,"dash") !=0 && strlen(temp) > 4 && strstr(temp,"dashtype") == 0 ){ |
7022 | int p; |
- | |
7023 | /* 4/2024 adapt to Flydraw's dashing syntax for all objects with prefix "dash" */ |
7015 | /* 4/2024 adapt to Flydraw's dashing syntax for all objects with prefix "dash" */ |
7024 | use_dashed = TRUE;int idx=0; |
7016 | use_dashed = TRUE;int idx=0; |
7025 | for(p = 4; p < strlen(temp); p++){temp[idx] = temp[p];idx++;} |
7017 | for(int p = 4; p < strlen(temp); p++){temp[idx] = temp[p];idx++;} |
- | 7018 | input_type = (char*)my_newmem(idx); snprintf(input_type,idx+1,"%s",temp); |
|
- | 7019 | }else{ |
|
- | 7020 | input_type=(char*)my_newmem(strlen(temp)); |
|
- | 7021 | snprintf(input_type,sizeof(temp),"%s",temp); |
|
7026 | } |
7022 | } |
7027 | input_type=(char*)my_newmem(strlen(temp)); |
- | |
7028 | snprintf(input_type,sizeof(temp),"%s",temp); |
- | |
7029 | - | ||
7030 | /* fprintf(stdout,"input_type = %s<br/>",input_type);*/ |
7023 | /* fprintf(stdout,"input_type = %s<br/>",input_type);*/ |
7031 | if( strcmp(input_type, size) == 0 ){ |
7024 | if( strcmp(input_type, size) == 0 ){ |
7032 | free(input_type); |
7025 | free(input_type); |
7033 | return SIZE; |
7026 | return SIZE; |
7034 | } |
7027 | } |
Line 7347... | Line 7340... | ||
7347 | if( strcmp(input_type, fontfamily) == 0 ){ |
7340 | if( strcmp(input_type, fontfamily) == 0 ){ |
7348 | free(input_type); |
7341 | free(input_type); |
7349 | return FONTFAMILY; |
7342 | return FONTFAMILY; |
7350 | } |
7343 | } |
7351 | if( strcmp(input_type, polyline) == 0 || strcmp(input_type, dpolyline) == 0 || strcmp(input_type, path) == 0 || strcmp(input_type, brokenline) == 0 ){ |
7344 | if( strcmp(input_type, polyline) == 0 || strcmp(input_type, dpolyline) == 0 || strcmp(input_type, path) == 0 || strcmp(input_type, brokenline) == 0 ){ |
7352 | if(strcmp(input_type, dpolyline) == 0 ){use_dashed = TRUE;} |
7345 | if(strcmp(input_type, dpolyline) == 0 ){use_dashed = TRUE;} |
7353 | free(input_type); |
7346 | free(input_type); |
7354 | return POLYLINE; |
7347 | return POLYLINE; |
7355 | } |
7348 | } |
7356 | if( strcmp(input_type, lines) == 0 ){ |
7349 | if( strcmp(input_type, lines) == 0 ){ |
7357 | free(input_type); |
7350 | free(input_type); |
Line 7979... | Line 7972... | ||
7979 | if( strcmp(input_type, chemtex) == 0 ){ |
7972 | if( strcmp(input_type, chemtex) == 0 ){ |
7980 | free(input_type); |
7973 | free(input_type); |
7981 | return CHEMTEX; |
7974 | return CHEMTEX; |
7982 | } |
7975 | } |
7983 | if( strcmp(input_type, noreset) == 0 || strcmp(input_type, killreset) == 0 ){ |
7976 | if( strcmp(input_type, noreset) == 0 || strcmp(input_type, killreset) == 0 ){ |
7984 | free(input_type); |
- | |
7985 | return NORESET; |
7977 | return NORESET; |
7986 | } |
- | |
7987 | if( strcmp(input_type, reset) == 0 ){ |
- | |
7988 | free(input_type); |
- | |
7989 | return RESET; |
- | |
7990 | } |
7978 | } |
7991 | if( strcmp(input_type, duplicates) == 0 || strcmp(input_type, allowdups) == 0 ){ |
7979 | if( strcmp(input_type, duplicates) == 0 || strcmp(input_type, allowdups) == 0 ){ |
7992 | free(input_type); |
7980 | free(input_type); |
7993 | return ALLOW_DUPLICATES; |
7981 | return ALLOW_DUPLICATES; |
7994 | } |
7982 | } |