Rev 7833 | Rev 7839 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7833 | Rev 7838 | ||
---|---|---|---|
Line 2001... | Line 2001... | ||
2001 | @ precision int |
2001 | @ precision int |
2002 | @ 10 = 1 decimal ; 100 = 2 decimals etc |
2002 | @ 10 = 1 decimal ; 100 = 2 decimals etc |
2003 | @ may be used / changed before every object |
2003 | @ may be used / changed before every object |
2004 | */ |
2004 | */ |
2005 | precision = (int) (get_real(infile,1)); |
2005 | precision = (int) (get_real(infile,1)); |
- | 2006 | break; |
|
- | 2007 | case SETLIMITS: |
|
- | 2008 | /* |
|
- | 2009 | @setlimits |
|
- | 2010 | @keyword : if set, it will produce 4 inputfields for 'xmin,xmax,ymin,ymax' and an 'ok' button |
|
- | 2011 | @may be used for inputfield based zooming / panning |
|
- | 2012 | @note:the input value will not be checked on validity |
|
- | 2013 | */ |
|
- | 2014 | add_setlimits(js_include_file,canvas_root_id); |
|
- | 2015 | /* add_setlimits provides 'fprintf(js_include_file,"use_pan_and_zoom = 1;");' */ |
|
- | 2016 | use_pan_and_zoom = TRUE; |
|
- | 2017 | done = TRUE; |
|
2006 | break; |
2018 | break; |
2007 | case ZOOM: |
2019 | case ZOOM: |
2008 | /* |
2020 | /* |
2009 | @ zoom button_color |
2021 | @ zoom button_color |
2010 | @ introduce a controlpanel at the lower right corner |
2022 | @ introduce a controlpanel at the lower right corner |
Line 3765... | Line 3777... | ||
3765 | function read_canvas(){\ |
3777 | function read_canvas(){\ |
3766 | var reply = new Array();\ |
3778 | var reply = new Array();\ |
3767 | var p = 0;var i = 0;\ |
3779 | var p = 0;var i = 0;\ |
3768 | while(userdraw_x[p]){\ |
3780 | while(userdraw_x[p]){\ |
3769 | reply[i] = userdraw_x[p] +\":\" + userdraw_y[p] +\":\" + userdraw_x[p+1] +\":\" + userdraw_y[p+1];\ |
3781 | reply[i] = userdraw_x[p] +\":\" + userdraw_y[p] +\":\" + userdraw_x[p+1] +\":\" + userdraw_y[p+1];\ |
3770 | p = p+2;i++;\ |
3782 | p = p+2;i++;\ |
3771 | };\ |
3783 | };\ |
3772 | if(p == 0){alert(\"nothing drawn...\");return;};\ |
3784 | if(p == 0){alert(\"nothing drawn...\");return;};\ |
3773 | if( document.getElementById(\"canvas_input0\") ){\ |
3785 | if( document.getElementById(\"canvas_input0\") ){\ |
3774 | var p = 0;var input_reply = new Array();\ |
3786 | var p = 0;var input_reply = new Array();\ |
3775 | if( document.getElementById(\"canvas_input0\")){\ |
3787 | if( document.getElementById(\"canvas_input0\")){\ |
3776 | var t = 0;\ |
3788 | var t = 0;\ |
3777 | while(document.getElementById(\"canvas_input\"+t)){\ |
3789 | while(document.getElementById(\"canvas_input\"+t)){\ |
3778 | if( ! document.getElementById(\"canvas_input\"+t).getAttribute(\"readonly\")){\ |
3790 | if( ! document.getElementById(\"canvas_input\"+t).getAttribute(\"readonly\")){\ |
3779 | input_reply[p] = document.getElementById(\"canvas_input\"+t).value;\ |
3791 | input_reply[p] = document.getElementById(\"canvas_input\"+t).value;\ |
3780 | p++;\ |
3792 | p++;\ |
3781 | };\ |
3793 | };\ |
3782 | t++;\ |
3794 | t++;\ |
3783 | };\ |
3795 | };\ |
3784 | };\ |
3796 | };\ |
3785 | if( typeof userdraw_text != 'undefined' ){\ |
3797 | if( typeof userdraw_text != 'undefined' ){\ |
3786 | return reply +\"\\n\"+input_reply+\"\\n\"+userdraw_text;\ |
3798 | return reply +\"\\n\"+input_reply+\"\\n\"+userdraw_text;\ |
3787 | }\ |
3799 | }\ |
3788 | else\ |
3800 | else\ |
3789 | {\ |
3801 | {\ |
3790 | return reply +\"\\n\"+input_reply;\ |
3802 | return reply +\"\\n\"+input_reply;\ |
3791 | }\ |
3803 | }\ |
3792 | }\ |
3804 | }\ |
3793 | else\ |
3805 | else\ |
3794 | {\ |
3806 | {\ |
3795 | if( typeof userdraw_text != 'undefined' ){\ |
3807 | if( typeof userdraw_text != 'undefined' ){\ |
3796 | return reply +\"\\n\"+userdraw_text;\ |
3808 | return reply +\"\\n\"+userdraw_text;\ |
3797 | }\ |
3809 | }\ |
3798 | else\ |
3810 | else\ |
3799 | {\ |
3811 | {\ |
Line 4087... | Line 4099... | ||
4087 | function dragstop(evt){\ |
4099 | function dragstop(evt){\ |
4088 | selected_image = null;return;\ |
4100 | selected_image = null;return;\ |
4089 | };\ |
4101 | };\ |
4090 | function dragxy(evt){\ |
4102 | function dragxy(evt){\ |
4091 | if( selected_image != null ){\ |
4103 | if( selected_image != null ){\ |
4092 | var xoff = (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);\ |
4104 | var xoff = (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);\ |
4093 | var yoff = (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);\ |
4105 | var yoff = (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);\ |
4094 | var s_img = ext_drag_images[selected_image];\ |
4106 | var s_img = ext_drag_images[selected_image];\ |
4095 | s_img[6] = evt.clientX - external_canvas_rect.left + xoff;\ |
4107 | s_img[6] = evt.clientX - external_canvas_rect.left + xoff;\ |
4096 | s_img[7] = evt.clientY - external_canvas_rect.top + yoff;\ |
4108 | s_img[7] = evt.clientY - external_canvas_rect.top + yoff;\ |
4097 | ext_drag_images[selected_image] = s_img;\ |
4109 | ext_drag_images[selected_image] = s_img;\ |
Line 4122... | Line 4134... | ||
4122 | dragxy(evt);\ |
4134 | dragxy(evt);\ |
4123 | };\ |
4135 | };\ |
4124 | };\ |
4136 | };\ |
4125 | };\ |
4137 | };\ |
4126 | };\ |
4138 | };\ |
4127 | }\ |
4139 | }\ |
4128 | else\ |
4140 | else\ |
4129 | {\ |
4141 | {\ |
4130 | selected_image = null;\ |
4142 | selected_image = null;\ |
4131 | };\ |
4143 | };\ |
4132 | };",canvas_root_id); |
4144 | };",canvas_root_id); |
Line 4159... | Line 4171... | ||
4159 | break; |
4171 | break; |
4160 | 4172 | ||
4161 | case DRAW_ZOOM_BUTTONS: /* 6 rectangles 15x15 px forbidden zone for drawing : y < ysize - 15*/ |
4173 | case DRAW_ZOOM_BUTTONS: /* 6 rectangles 15x15 px forbidden zone for drawing : y < ysize - 15*/ |
4162 | fprintf(js_include_file,"\n<!-- draw zoom buttons -->\n\ |
4174 | fprintf(js_include_file,"\n<!-- draw zoom buttons -->\n\ |
4163 | draw_zoom_buttons = function(canvas_type,color,opacity){\ |
4175 | draw_zoom_buttons = function(canvas_type,color,opacity){\ |
4164 | var obj;\ |
4176 | var obj;\ |
4165 | if( document.getElementById(\"wims_canvas%d\"+canvas_type) ){\ |
4177 | if( document.getElementById(\"wims_canvas%d\"+canvas_type) ){\ |
4166 | obj = document.getElementById(\"wims_canvas%d\"+canvas_type);\ |
4178 | obj = document.getElementById(\"wims_canvas%d\"+canvas_type);\ |
4167 | }\ |
4179 | }\ |
4168 | else\ |
4180 | else\ |
4169 | {\ |
4181 | {\ |
4170 | obj = create_canvas%d(canvas_type,xsize,ysize);\ |
4182 | obj = create_canvas%d(canvas_type,xsize,ysize);\ |
4171 | };\ |
4183 | };\ |
4172 | var ctx = obj.getContext(\"2d\");\ |
4184 | var ctx = obj.getContext(\"2d\");\ |
Line 4385... | Line 4397... | ||
4385 | };"); |
4397 | };"); |
4386 | break; |
4398 | break; |
4387 | case DRAW_POLYLINE:/* user for userdraw : draw lines through points */ |
4399 | case DRAW_POLYLINE:/* user for userdraw : draw lines through points */ |
4388 | fprintf(js_include_file,"\n<!-- draw polyline -->\n\ |
4400 | fprintf(js_include_file,"\n<!-- draw polyline -->\n\ |
4389 | draw_polyline = function(ctx,x_points,y_points,line_width,stroke_color,stroke_opacity,use_dashed,dashtype0,dashtype1,use_rotate,angle,use_translate,vector){\ |
4401 | draw_polyline = function(ctx,x_points,y_points,line_width,stroke_color,stroke_opacity,use_dashed,dashtype0,dashtype1,use_rotate,angle,use_translate,vector){\ |
4390 | ctx.save();\ |
4402 | ctx.save();\ |
4391 | if(use_translate == 1 ){ctx.translate(vector[0],vector[1]);}\ |
4403 | if(use_translate == 1 ){ctx.translate(vector[0],vector[1]);}\ |
4392 | if(use_rotate == 1 ){ctx.rotate(angle*Math.PI/180);}\ |
4404 | if(use_rotate == 1 ){ctx.rotate(angle*Math.PI/180);}\ |
4393 | ctx.lineWidth = line_width;\ |
4405 | ctx.lineWidth = line_width;\ |
4394 | ctx.strokeStyle=\"rgba(\"+stroke_color+\",\"+stroke_opacity+\")\";\ |
4406 | ctx.strokeStyle=\"rgba(\"+stroke_color+\",\"+stroke_opacity+\")\";\ |
4395 | if(use_dashed == 1){if(ctx.setLineDash){ctx.setLineDash([dashtype0,dashtype1]);}else{ctx.mozDash = [dashtype0,dashtype1];};};\ |
4407 | if(use_dashed == 1){if(ctx.setLineDash){ctx.setLineDash([dashtype0,dashtype1]);}else{ctx.mozDash = [dashtype0,dashtype1];};};\ |
4396 | ctx.clearRect(0,0,xsize,ysize);\ |
4408 | ctx.clearRect(0,0,xsize,ysize);\ |
4397 | ctx.beginPath();\ |
4409 | ctx.beginPath();\ |
4398 | for(var p = 0 ; p < x_points.length-1 ; p++ ){\ |
4410 | for(var p = 0 ; p < x_points.length-1 ; p++ ){\ |
4399 | ctx.moveTo(x_points[p],y_points[p]);\ |
4411 | ctx.moveTo(x_points[p],y_points[p]);\ |
4400 | ctx.lineTo(x_points[p+1],y_points[p+1]);\ |
4412 | ctx.lineTo(x_points[p+1],y_points[p+1]);\ |
4401 | }\ |
4413 | }\ |
4402 | ctx.closePath();\ |
4414 | ctx.closePath();\ |
4403 | ctx.stroke();\ |
4415 | ctx.stroke();\ |
4404 | ctx.fillStyle =\"rgba(\"+stroke_color+\",\"+stroke_opacity+\")\";\ |
4416 | ctx.fillStyle =\"rgba(\"+stroke_color+\",\"+stroke_opacity+\")\";\ |
Line 4458... | Line 4470... | ||
4458 | for(var p = 0 ; p < x_points.length ; p = p+2 ){\ |
4470 | for(var p = 0 ; p < x_points.length ; p = p+2 ){\ |
4459 | line = calc_line(x_points[p],x_points[p+1],y_points[p],y_points[p+1]);\ |
4471 | line = calc_line(x_points[p],x_points[p+1],y_points[p],y_points[p+1]);\ |
4460 | ctx.beginPath();\ |
4472 | ctx.beginPath();\ |
4461 | ctx.moveTo(line[0],line[1]);\ |
4473 | ctx.moveTo(line[0],line[1]);\ |
4462 | ctx.lineTo(line[2],line[3]);\ |
4474 | ctx.lineTo(line[2],line[3]);\ |
4463 | ctx.closePath();\ |
4475 | ctx.closePath();\ |
4464 | ctx.stroke();\ |
4476 | ctx.stroke();\ |
4465 | }\ |
4477 | }\ |
4466 | ctx.restore();\ |
4478 | ctx.restore();\ |
4467 | return;\ |
4479 | return;\ |
4468 | };"); |
4480 | };"); |
4469 | break; |
4481 | break; |
Line 4824... | Line 4836... | ||
4824 | num = 1;\ |
4836 | num = 1;\ |
4825 | for(var p = 1 ; p < xminor ; p++){\ |
4837 | for(var p = 1 ; p < xminor ; p++){\ |
4826 | nx = x + num*minor_step_x;\ |
4838 | nx = x + num*minor_step_x;\ |
4827 | ctx.moveTo(nx,zero_y);\ |
4839 | ctx.moveTo(nx,zero_y);\ |
4828 | ctx.lineTo(nx,0);\ |
4840 | ctx.lineTo(nx,0);\ |
4829 | num++;\ |
4841 | num++;\ |
4830 | };\ |
4842 | };\ |
4831 | };\ |
4843 | };\ |
4832 | ctx.stroke();\ |
4844 | ctx.stroke();\ |
4833 | ctx.closePath();\ |
4845 | ctx.closePath();\ |
4834 | ctx.beginPath();\ |
4846 | ctx.beginPath();\ |
4835 | ctx.lineWidth = 2;\ |
4847 | ctx.lineWidth = 2;\ |
4836 | ctx.strokeStyle = \"rgba(\"+majorcolor+\",\"+opacity+\")\";\ |
4848 | ctx.strokeStyle = \"rgba(\"+majorcolor+\",\"+opacity+\")\";\ |
4837 | for(var x = zero_x+snor_x ; x < xsize;x = x + step_x){\ |
4849 | for(var x = zero_x+snor_x ; x < xsize;x = x + step_x){\ |
4838 | ctx.moveTo(x,zero_y);ctx.lineTo(x,zero_y - 12);\ |
4850 | ctx.moveTo(x,zero_y);ctx.lineTo(x,zero_y - 12);\ |
4839 | };\ |
4851 | };\ |
4840 | for(var x = zero_x+snor_x ; x < xsize;x = x + minor_step_x){\ |
4852 | for(var x = zero_x+snor_x ; x < xsize;x = x + minor_step_x){\ |
Line 4979... | Line 4991... | ||
4979 | if(ymin < 0 ){zero_y = y2px(0);f_y = 1;}else{zero_y = y2px(ymin);f_y = -1;}\ |
4991 | if(ymin < 0 ){zero_y = y2px(0);f_y = 1;}else{zero_y = y2px(ymin);f_y = -1;}\ |
4980 | ctx.beginPath();\ |
4992 | ctx.beginPath();\ |
4981 | ctx.lineWidth = line_width;\ |
4993 | ctx.lineWidth = line_width;\ |
4982 | ctx.strokeStyle = stroke_color;\ |
4994 | ctx.strokeStyle = stroke_color;\ |
4983 | for(var p = zero_x ; p < xsize; p = p + xstep){\ |
4995 | for(var p = zero_x ; p < xsize; p = p + xstep){\ |
4984 | ctx.moveTo(p,0);\ |
4996 | ctx.moveTo(p,0);\ |
4985 | ctx.lineTo(p,ysize);\ |
4997 | ctx.lineTo(p,ysize);\ |
4986 | };\ |
4998 | };\ |
4987 | for(var p = zero_x ; p > 0; p = p - xstep){\ |
4999 | for(var p = zero_x ; p > 0; p = p - xstep){\ |
4988 | ctx.moveTo(p,0);\ |
5000 | ctx.moveTo(p,0);\ |
4989 | ctx.lineTo(p,ysize);\ |
5001 | ctx.lineTo(p,ysize);\ |
4990 | };\ |
5002 | };\ |
4991 | for(var p = zero_y ; p < ysize; p = p + ystep){\ |
5003 | for(var p = zero_y ; p < ysize; p = p + ystep){\ |
Line 6129... | Line 6141... | ||
6129 | *ysnaptogrid="ysnaptogrid", |
6141 | *ysnaptogrid="ysnaptogrid", |
6130 | *userinput_xy="userinput_xy", |
6142 | *userinput_xy="userinput_xy", |
6131 | *usertextarea_xy="usertextarea_xy", |
6143 | *usertextarea_xy="usertextarea_xy", |
6132 | *jsmath="jsmath", |
6144 | *jsmath="jsmath", |
6133 | *trace_jsmath="trace_jsmath", |
6145 | *trace_jsmath="trace_jsmath", |
- | 6146 | *setlimits="setlimits", |
|
6134 | *sgraph="sgraph"; |
6147 | *sgraph="sgraph"; |
6135 | 6148 | ||
6136 | while(((c = getc(infile)) != EOF)&&(c!='\n')&&(c!=',')&&(c!='=')&&(c!='\r')){ |
6149 | while(((c = getc(infile)) != EOF)&&(c!='\n')&&(c!=',')&&(c!='=')&&(c!='\r')){ |
6137 | if( i == 0 && (c == ' ' || c == '\t') ){ |
6150 | if( i == 0 && (c == ' ' || c == '\t') ){ |
6138 | continue; /* white spaces or tabs allowed before first command identifier */ |
6151 | continue; /* white spaces or tabs allowed before first command identifier */ |
Line 6173... | Line 6186... | ||
6173 | return XRANGE; |
6186 | return XRANGE; |
6174 | } |
6187 | } |
6175 | if( strcmp(input_type, rangex) == 0 ){ |
6188 | if( strcmp(input_type, rangex) == 0 ){ |
6176 | free(input_type); |
6189 | free(input_type); |
6177 | return XRANGE; |
6190 | return XRANGE; |
6178 | } |
6191 | } |
6179 | if( strcmp(input_type, trange) == 0 ){ |
6192 | if( strcmp(input_type, trange) == 0 ){ |
6180 | free(input_type); |
6193 | free(input_type); |
6181 | return TRANGE; |
6194 | return TRANGE; |
6182 | } |
6195 | } |
6183 | if( strcmp(input_type, ranget) == 0 ){ |
6196 | if( strcmp(input_type, ranget) == 0 ){ |
6184 | free(input_type); |
6197 | free(input_type); |
6185 | return TRANGE; |
6198 | return TRANGE; |
6186 | } |
6199 | } |
6187 | if( strcmp(input_type, yrange) == 0 ){ |
6200 | if( strcmp(input_type, yrange) == 0 ){ |
6188 | free(input_type); |
6201 | free(input_type); |
6189 | return YRANGE; |
6202 | return YRANGE; |
6190 | } |
6203 | } |
6191 | if( strcmp(input_type, rangey) == 0 ){ |
6204 | if( strcmp(input_type, rangey) == 0 ){ |
6192 | free(input_type); |
6205 | free(input_type); |
6193 | return YRANGE; |
6206 | return YRANGE; |
Line 6211... | Line 6224... | ||
6211 | if( strcmp(input_type, axisnumbers) == 0 ){ |
6224 | if( strcmp(input_type, axisnumbers) == 0 ){ |
6212 | free(input_type); |
6225 | free(input_type); |
6213 | return AXIS_NUMBERING; |
6226 | return AXIS_NUMBERING; |
6214 | } |
6227 | } |
6215 | if( strcmp(input_type, axis) == 0 ){ |
6228 | if( strcmp(input_type, axis) == 0 ){ |
6216 | free(input_type); |
6229 | free(input_type); |
6217 | return AXIS; |
6230 | return AXIS; |
6218 | } |
6231 | } |
6219 | if( strcmp(input_type, grid) == 0 ){ |
6232 | if( strcmp(input_type, grid) == 0 ){ |
6220 | free(input_type); |
6233 | free(input_type); |
6221 | return GRID; |
6234 | return GRID; |
Line 6239... | Line 6252... | ||
6239 | if( strcmp(input_type, seg) == 0 || strcmp(input_type, segment) == 0 ){ |
6252 | if( strcmp(input_type, seg) == 0 || strcmp(input_type, segment) == 0 ){ |
6240 | free(input_type); |
6253 | free(input_type); |
6241 | return SEGMENT; |
6254 | return SEGMENT; |
6242 | } |
6255 | } |
6243 | if( strcmp(input_type, dsegment) == 0 ){ |
6256 | if( strcmp(input_type, dsegment) == 0 ){ |
6244 | free(input_type); |
6257 | free(input_type); |
6245 | use_dashed = TRUE; |
6258 | use_dashed = TRUE; |
6246 | return SEGMENT; |
6259 | return SEGMENT; |
6247 | } |
6260 | } |
6248 | if( strcmp(input_type, crosshairsize) == 0 ){ |
6261 | if( strcmp(input_type, crosshairsize) == 0 ){ |
6249 | free(input_type); |
6262 | free(input_type); |
6250 | return CROSSHAIRSIZE; |
6263 | return CROSSHAIRSIZE; |
6251 | } |
6264 | } |
6252 | if( strcmp(input_type, arrowhead) == 0 ){ |
6265 | if( strcmp(input_type, arrowhead) == 0 ){ |
6253 | free(input_type); |
6266 | free(input_type); |
6254 | return ARROWHEAD; |
6267 | return ARROWHEAD; |
6255 | } |
6268 | } |
6256 | if( strcmp(input_type, crosshairs) == 0 ){ |
6269 | if( strcmp(input_type, crosshairs) == 0 ){ |
6257 | free(input_type); |
6270 | free(input_type); |
6258 | return CROSSHAIRS; |
6271 | return CROSSHAIRS; |
6259 | } |
6272 | } |
6260 | if( strcmp(input_type, crosshair) == 0 ){ |
6273 | if( strcmp(input_type, crosshair) == 0 ){ |
6261 | free(input_type); |
6274 | free(input_type); |
6262 | return CROSSHAIR; |
6275 | return CROSSHAIR; |
6263 | } |
6276 | } |
6264 | if( strcmp(input_type, onclick) == 0 ){ |
6277 | if( strcmp(input_type, onclick) == 0 ){ |
6265 | free(input_type); |
6278 | free(input_type); |
6266 | return ONCLICK; |
6279 | return ONCLICK; |
6267 | } |
6280 | } |
6268 | if( strcmp(input_type, drag) == 0 ){ |
6281 | if( strcmp(input_type, drag) == 0 ){ |
Line 6276... | Line 6289... | ||
6276 | if( strcmp(input_type, highlight) == 0 || strcmp(input_type, style) == 0 ){ |
6289 | if( strcmp(input_type, highlight) == 0 || strcmp(input_type, style) == 0 ){ |
6277 | free(input_type); |
6290 | free(input_type); |
6278 | return STYLE; |
6291 | return STYLE; |
6279 | } |
6292 | } |
6280 | if( strcmp(input_type, fillcolor) == 0 ){ |
6293 | if( strcmp(input_type, fillcolor) == 0 ){ |
6281 | free(input_type); |
6294 | free(input_type); |
6282 | return FILLCOLOR; |
6295 | return FILLCOLOR; |
6283 | } |
6296 | } |
6284 | if( strcmp(input_type, strokecolor) == 0 ){ |
6297 | if( strcmp(input_type, strokecolor) == 0 ){ |
6285 | free(input_type); |
6298 | free(input_type); |
6286 | return STROKECOLOR; |
6299 | return STROKECOLOR; |
Line 6304... | Line 6317... | ||
6304 | if( strcmp(input_type, bgimage) == 0 ){ |
6317 | if( strcmp(input_type, bgimage) == 0 ){ |
6305 | free(input_type); |
6318 | free(input_type); |
6306 | return BGIMAGE; |
6319 | return BGIMAGE; |
6307 | } |
6320 | } |
6308 | if( strcmp(input_type, bgcolor) == 0 ){ |
6321 | if( strcmp(input_type, bgcolor) == 0 ){ |
6309 | free(input_type); |
6322 | free(input_type); |
6310 | return BGCOLOR; |
6323 | return BGCOLOR; |
6311 | } |
6324 | } |
6312 | if( strcmp(input_type, backgroundimage) == 0 ){ |
6325 | if( strcmp(input_type, backgroundimage) == 0 ){ |
6313 | free(input_type); |
6326 | free(input_type); |
6314 | return BGIMAGE; |
6327 | return BGIMAGE; |
Line 6322... | Line 6335... | ||
6322 | return FLY_TEXTUP; |
6335 | return FLY_TEXTUP; |
6323 | } |
6336 | } |
6324 | if( strcmp(input_type, mouse) == 0 ){ |
6337 | if( strcmp(input_type, mouse) == 0 ){ |
6325 | free(input_type); |
6338 | free(input_type); |
6326 | return MOUSE; |
6339 | return MOUSE; |
6327 | } |
6340 | } |
6328 | if( strcmp(input_type, mouseprecision) == 0 ){ |
6341 | if( strcmp(input_type, mouseprecision) == 0 ){ |
6329 | free(input_type); |
6342 | free(input_type); |
6330 | return MOUSE_PRECISION; |
6343 | return MOUSE_PRECISION; |
6331 | } |
6344 | } |
6332 | if( strcmp(input_type, precision) == 0 ){ |
6345 | if( strcmp(input_type, precision) == 0 ){ |
Line 6336... | Line 6349... | ||
6336 | if( strcmp(input_type, curve) == 0 ){ |
6349 | if( strcmp(input_type, curve) == 0 ){ |
6337 | free(input_type); |
6350 | free(input_type); |
6338 | return CURVE; |
6351 | return CURVE; |
6339 | } |
6352 | } |
6340 | if( strcmp(input_type, dcurve) == 0 ){ |
6353 | if( strcmp(input_type, dcurve) == 0 ){ |
6341 | use_dashed = TRUE; |
6354 | use_dashed = TRUE; |
6342 | free(input_type); |
6355 | free(input_type); |
6343 | return CURVE; |
6356 | return CURVE; |
6344 | } |
6357 | } |
6345 | if( strcmp(input_type, plot) == 0 ){ |
6358 | if( strcmp(input_type, plot) == 0 ){ |
6346 | free(input_type); |
6359 | free(input_type); |
6347 | return CURVE; |
6360 | return CURVE; |
6348 | } |
6361 | } |
6349 | if( strcmp(input_type, dplot) == 0 ){ |
6362 | if( strcmp(input_type, dplot) == 0 ){ |
6350 | use_dashed = TRUE; |
6363 | use_dashed = TRUE; |
Line 6358... | Line 6371... | ||
6358 | if( strcmp(input_type, plotsteps) == 0 ){ |
6371 | if( strcmp(input_type, plotsteps) == 0 ){ |
6359 | free(input_type); |
6372 | free(input_type); |
6360 | return PLOTSTEPS; |
6373 | return PLOTSTEPS; |
6361 | } |
6374 | } |
6362 | if( strcmp(input_type, plotstep) == 0 ){ |
6375 | if( strcmp(input_type, plotstep) == 0 ){ |
6363 | free(input_type); |
6376 | free(input_type); |
6364 | return PLOTSTEPS; |
6377 | return PLOTSTEPS; |
6365 | } |
6378 | } |
6366 | if( strcmp(input_type, tsteps) == 0 ){ |
6379 | if( strcmp(input_type, tsteps) == 0 ){ |
6367 | free(input_type); |
6380 | free(input_type); |
6368 | return PLOTSTEPS; |
6381 | return PLOTSTEPS; |
Line 6374... | Line 6387... | ||
6374 | if( strcmp(input_type, fontcolor) == 0 ){ |
6387 | if( strcmp(input_type, fontcolor) == 0 ){ |
6375 | free(input_type); |
6388 | free(input_type); |
6376 | return FONTCOLOR; |
6389 | return FONTCOLOR; |
6377 | } |
6390 | } |
6378 | if( strcmp(input_type, arrow) == 0 ){ |
6391 | if( strcmp(input_type, arrow) == 0 ){ |
6379 | free(input_type); |
6392 | free(input_type); |
6380 | return ARROW; |
6393 | return ARROW; |
6381 | } |
6394 | } |
6382 | if( strcmp(input_type, arrow2) == 0 ){ |
6395 | if( strcmp(input_type, arrow2) == 0 ){ |
6383 | free(input_type); |
6396 | free(input_type); |
6384 | return ARROW2; |
6397 | return ARROW2; |
6385 | } |
6398 | } |
6386 | if( strcmp(input_type, darrow) == 0 ){ |
6399 | if( strcmp(input_type, darrow) == 0 ){ |
Line 6395... | Line 6408... | ||
6395 | if( strcmp(input_type, zoom) == 0 ){ |
6408 | if( strcmp(input_type, zoom) == 0 ){ |
6396 | free(input_type); |
6409 | free(input_type); |
6397 | return ZOOM; |
6410 | return ZOOM; |
6398 | } |
6411 | } |
6399 | if( strcmp(input_type, triangle) == 0 ){ |
6412 | if( strcmp(input_type, triangle) == 0 ){ |
6400 | free(input_type); |
6413 | free(input_type); |
6401 | return TRIANGLE; |
6414 | return TRIANGLE; |
6402 | } |
6415 | } |
6403 | if( strcmp(input_type, ftriangle) == 0 ){ |
6416 | if( strcmp(input_type, ftriangle) == 0 ){ |
6404 | free(input_type); |
6417 | free(input_type); |
6405 | use_filled = TRUE; |
6418 | use_filled = TRUE; |
6406 | return TRIANGLE; |
6419 | return TRIANGLE; |
6407 | } |
6420 | } |
Line 6620... | Line 6633... | ||
6620 | return CLICKTILE_COLORS; |
6633 | return CLICKTILE_COLORS; |
6621 | } |
6634 | } |
6622 | if( strcmp(input_type, clicktile) == 0 ){ |
6635 | if( strcmp(input_type, clicktile) == 0 ){ |
6623 | free(input_type); |
6636 | free(input_type); |
6624 | return CLICKTILE; |
6637 | return CLICKTILE; |
6625 | } |
6638 | } |
6626 | if( strcmp(input_type, xlogscale) == 0 ){ |
6639 | if( strcmp(input_type, xlogscale) == 0 ){ |
6627 | free(input_type); |
6640 | free(input_type); |
6628 | return XLOGSCALE; |
6641 | return XLOGSCALE; |
6629 | } |
6642 | } |
6630 | if( strcmp(input_type, ylogscale) == 0 ){ |
6643 | if( strcmp(input_type, ylogscale) == 0 ){ |
6631 | free(input_type); |
6644 | free(input_type); |
6632 | return YLOGSCALE; |
6645 | return YLOGSCALE; |
6633 | } |
6646 | } |
6634 | if( strcmp(input_type, xylogscale) == 0 ){ |
6647 | if( strcmp(input_type, xylogscale) == 0 ){ |
6635 | free(input_type); |
6648 | free(input_type); |
6636 | return XYLOGSCALE; |
6649 | return XYLOGSCALE; |
6637 | } |
6650 | } |
6638 | if( strcmp(input_type, ylogscale) == 0 ){ |
6651 | if( strcmp(input_type, ylogscale) == 0 ){ |
6639 | free(input_type); |
6652 | free(input_type); |
6640 | return YLOGSCALE; |
6653 | return YLOGSCALE; |
Line 6648... | Line 6661... | ||
6648 | return YLOGBASE; |
6661 | return YLOGBASE; |
6649 | } |
6662 | } |
6650 | if( strcmp(input_type, intooltip) == 0 ){ |
6663 | if( strcmp(input_type, intooltip) == 0 ){ |
6651 | free(input_type); |
6664 | free(input_type); |
6652 | return INTOOLTIP; |
6665 | return INTOOLTIP; |
6653 | } |
6666 | } |
6654 | if( strcmp(input_type,video) == 0 ){ |
6667 | if( strcmp(input_type,video) == 0 ){ |
6655 | free(input_type); |
6668 | free(input_type); |
6656 | return VIDEO; |
6669 | return VIDEO; |
6657 | } |
6670 | } |
6658 | if( strcmp(input_type,floodfill) == 0 || strcmp(input_type,fill) == 0 ){ |
6671 | if( strcmp(input_type,floodfill) == 0 || strcmp(input_type,fill) == 0 ){ |
Line 6676... | Line 6689... | ||
6676 | return PIXELSIZE; |
6689 | return PIXELSIZE; |
6677 | } |
6690 | } |
6678 | if( strcmp(input_type, setpixel) == 0 ){ |
6691 | if( strcmp(input_type, setpixel) == 0 ){ |
6679 | free(input_type); |
6692 | free(input_type); |
6680 | return SETPIXEL; |
6693 | return SETPIXEL; |
6681 | } |
6694 | } |
6682 | if( strcmp(input_type, pixels) == 0 ){ |
6695 | if( strcmp(input_type, pixels) == 0 ){ |
6683 | free(input_type); |
6696 | free(input_type); |
6684 | return PIXELS; |
6697 | return PIXELS; |
6685 | } |
6698 | } |
6686 | if( strcmp(input_type, clickfillmarge) == 0 ){ |
6699 | if( strcmp(input_type, clickfillmarge) == 0 ){ |
Line 6694... | Line 6707... | ||
6694 | if( strcmp(input_type, yaxis) == 0 || strcmp(input_type, yaxistext) == 0 ){ |
6707 | if( strcmp(input_type, yaxis) == 0 || strcmp(input_type, yaxistext) == 0 ){ |
6695 | free(input_type); |
6708 | free(input_type); |
6696 | return Y_AXIS_STRINGS; |
6709 | return Y_AXIS_STRINGS; |
6697 | } |
6710 | } |
6698 | if( strcmp(input_type, piechart) == 0 ){ |
6711 | if( strcmp(input_type, piechart) == 0 ){ |
6699 | free(input_type); |
6712 | free(input_type); |
6700 | return PIECHART; |
6713 | return PIECHART; |
6701 | } |
6714 | } |
6702 | if( strcmp(input_type, barchart) == 0 ){ |
6715 | if( strcmp(input_type, barchart) == 0 ){ |
6703 | free(input_type); |
6716 | free(input_type); |
6704 | return BARCHART; |
6717 | return BARCHART; |
6705 | } |
6718 | } |
6706 | if( strcmp(input_type, linegraph) == 0 ){ |
6719 | if( strcmp(input_type, linegraph) == 0 ){ |
6707 | free(input_type); |
6720 | free(input_type); |
6708 | return LINEGRAPH; |
6721 | return LINEGRAPH; |
6709 | } |
6722 | } |
6710 | if( strcmp(input_type, clock) == 0 ){ |
6723 | if( strcmp(input_type, clock) == 0 ){ |
6711 | free(input_type); |
6724 | free(input_type); |
6712 | return CLOCK; |
6725 | return CLOCK; |
6713 | } |
6726 | } |
6714 | if( strcmp(input_type, legend) == 0 ){ |
6727 | if( strcmp(input_type, legend) == 0 ){ |
Line 6722... | Line 6735... | ||
6722 | if( strcmp(input_type, xlabel) == 0 ){ |
6735 | if( strcmp(input_type, xlabel) == 0 ){ |
6723 | free(input_type); |
6736 | free(input_type); |
6724 | return XLABEL; |
6737 | return XLABEL; |
6725 | } |
6738 | } |
6726 | if( strcmp(input_type, ylabel) == 0 ){ |
6739 | if( strcmp(input_type, ylabel) == 0 ){ |
6727 | free(input_type); |
6740 | free(input_type); |
6728 | return YLABEL; |
6741 | return YLABEL; |
6729 | } |
6742 | } |
6730 | if( strcmp(input_type, animate) == 0 ){ |
6743 | if( strcmp(input_type, animate) == 0 ){ |
6731 | free(input_type); |
6744 | free(input_type); |
6732 | return ANIMATE; |
6745 | return ANIMATE; |
6733 | } |
6746 | } |
6734 | /* these are bitmap related flydraw commmands...must be removed. eventually */ |
6747 | /* these are bitmap related flydraw commmands...must be removed. eventually */ |
6735 | if( strcmp(input_type, transparent) == 0 ){ |
6748 | if( strcmp(input_type, transparent) == 0 ){ |
6736 | free(input_type); |
6749 | free(input_type); |
6737 | return TRANSPARENT; |
6750 | return TRANSPARENT; |
6738 | } |
6751 | } |
6739 | if( strcmp(input_type, status) == 0 ){ |
6752 | if( strcmp(input_type, status) == 0 ){ |
6740 | free(input_type); |
6753 | free(input_type); |
6741 | return STATUS; |
6754 | return STATUS; |
6742 | } |
6755 | } |
6743 | if( strcmp(input_type, snaptogrid) == 0 ){ |
6756 | if( strcmp(input_type, snaptogrid) == 0 ){ |
6744 | free(input_type); |
6757 | free(input_type); |
6745 | return SNAPTOGRID; |
6758 | return SNAPTOGRID; |
6746 | } |
6759 | } |
6747 | if( strcmp(input_type, xsnaptogrid) == 0 ){ |
6760 | if( strcmp(input_type, xsnaptogrid) == 0 ){ |
6748 | free(input_type); |
6761 | free(input_type); |
6749 | return XSNAPTOGRID; |
6762 | return XSNAPTOGRID; |
6750 | } |
6763 | } |
6751 | if( strcmp(input_type, ysnaptogrid) == 0 ){ |
6764 | if( strcmp(input_type, ysnaptogrid) == 0 ){ |
Line 6759... | Line 6772... | ||
6759 | if( strcmp(input_type, usertextarea_xy) == 0 ){ |
6772 | if( strcmp(input_type, usertextarea_xy) == 0 ){ |
6760 | free(input_type); |
6773 | free(input_type); |
6761 | return USERTEXTAREA_XY; |
6774 | return USERTEXTAREA_XY; |
6762 | } |
6775 | } |
6763 | if( strcmp(input_type, sgraph) == 0 ){ |
6776 | if( strcmp(input_type, sgraph) == 0 ){ |
6764 | free(input_type); |
6777 | free(input_type); |
6765 | return SGRAPH; |
6778 | return SGRAPH; |
6766 | } |
6779 | } |
6767 | if( strcmp(input_type, jsmath) == 0 ){ |
6780 | if( strcmp(input_type, jsmath) == 0 ){ |
6768 | free(input_type); |
6781 | free(input_type); |
6769 | return JSMATH; |
6782 | return JSMATH; |
6770 | } |
6783 | } |
6771 | if( strcmp(input_type, trace_jsmath) == 0 ){ |
6784 | if( strcmp(input_type, trace_jsmath) == 0 ){ |
6772 | free(input_type); |
6785 | free(input_type); |
6773 | return TRACE_JSMATH; |
6786 | return TRACE_JSMATH; |
- | 6787 | } |
|
- | 6788 | if( strcmp(input_type, setlimits) == 0 ){ |
|
- | 6789 | free(input_type); |
|
- | 6790 | return SETLIMITS; |
|
6774 | } |
6791 | } |
6775 | free(input_type); |
6792 | free(input_type); |
6776 | ungetc(c,infile); |
6793 | ungetc(c,infile); |
6777 | return 0; |
6794 | return 0; |
6778 | } |
6795 | } |