=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/plot/if.c,v retrieving revision 1.7 retrieving revision 1.11 diff -u -p -r1.7 -r1.11 --- OpenXM_contrib2/asir2000/plot/if.c 2001/10/09 01:36:27 1.7 +++ OpenXM_contrib2/asir2000/plot/if.c 2002/08/02 02:57:48 1.11 @@ -45,14 +45,14 @@ * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. * - * $OpenXM: OpenXM_contrib2/asir2000/plot/if.c,v 1.6 2001/08/22 09:19:21 noro Exp $ + * $OpenXM: OpenXM_contrib2/asir2000/plot/if.c,v 1.10 2002/07/29 03:08:16 noro Exp $ */ #include "ca.h" #include "parse.h" #include "ox.h" #include "ifplot.h" -extern jmp_buf ox_env; +extern JMP_BUF ox_env; int open_canvas(NODE arg) { @@ -270,7 +270,13 @@ int draw_obj(NODE arg) index = QTOS((Q)ARG0(arg)); can = canvas[index]; - if ( !can || !can->window ) { + if ( !can && closed_canvas[index] ) { + canvas[index] = closed_canvas[index]; + closed_canvas[index] = 0; + can = canvas[index]; + popup_canvas(index); + current_can = can; + } else if ( !can || (can && !can->window) ) { set_lasterror("draw_obj : canvas does not exist"); return -1; } @@ -304,6 +310,39 @@ int draw_obj(NODE arg) return 0; } +int draw_string(NODE arg) +{ + int index,x,y; + char *str; + NODE pos; + struct canvas *can; + int color; + + index = QTOS((Q)ARG0(arg)); + can = canvas[index]; + if ( !can && closed_canvas[index] ) { + canvas[index] = closed_canvas[index]; + closed_canvas[index] = 0; + can = canvas[index]; + popup_canvas(index); + current_can = can; + } else if ( !can || (can && !can->window) ) { + set_lasterror("draw_obj : canvas does not exist"); + return -1; + } + + pos = BDY((LIST)ARG1(arg)); + str = BDY((STRING)ARG2(arg)); + if ( argc(arg) == 4 ) + color = QTOS((Q)ARG3(arg)); + else + color = 0; /* black */ + x = (int)ToReal((Q)ARG0(pos)); + y = (int)ToReal((Q)ARG1(pos)); + draw_character_string(display,can,x,y,str,color); + return 0; +} + int clear_canvas(NODE arg) { int index; @@ -542,7 +581,7 @@ void qifplotmain(struct canvas *can) width = can->width; height = can->height; tabe = (char **)ALLOCA(width*sizeof(char *)+width*height*sizeof(char)); - bzero(tabe,width*sizeof(char *)+width*height*sizeof(char)); + bzero((void *)tabe,width*sizeof(char *)+width*height*sizeof(char)); for ( i = 0, tabeb = (char *)(tabe+width); i < width; i++ ) tabe[i] = tabeb + height*i; define_cursor(can->window,runningcur);