=================================================================== RCS file: /home/cvs/OpenXM_contrib2/windows/engine2000/plot.c,v retrieving revision 1.2 retrieving revision 1.13 diff -u -p -r1.2 -r1.13 --- OpenXM_contrib2/windows/engine2000/plot.c 2001/10/05 10:23:08 1.2 +++ OpenXM_contrib2/windows/engine2000/plot.c 2019/03/28 07:04:13 1.13 @@ -45,7 +45,7 @@ * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. * - * $OpenXM: OpenXM_contrib2/windows/engine2000/plot.c,v 1.1.1.1 2000/11/22 06:20:13 noro Exp $ + * $OpenXM: OpenXM_contrib2/windows/engine2000/plot.c,v 1.12 2017/08/30 09:40:31 ohara Exp $ */ #include "ca.h" #include "parse.h" @@ -57,8 +57,6 @@ #include "genpari.h" #endif -void ox_usr1_handler(); - extern int asir_OperandStackSize; extern Obj *asir_OperandStack; extern int asir_OperandStackPtr; @@ -71,10 +69,10 @@ extern jmp_buf ox_env; extern MATHCAP my_mathcap; extern char LastError[]; -void create_error(ERR *,unsigned int ,char *); +void create_error(ERR *,unsigned int ,char *,LIST); void ox_io_init(); -void ox_asir_init(int,char **); +void ox_asir_init(int,char **,char *); Obj asir_pop_one(); void asir_push_one(Obj); void asir_end_flush(); @@ -92,6 +90,7 @@ LIST asir_GetErrorList(); static void asir_do_cmd(unsigned int,unsigned int); static void process_ox(); static void asir_executeFunction(); +static void process_resize(struct canvas *can,POINT startp,POINT endp); #if defined(VISUAL) @@ -105,9 +104,11 @@ void ox_plot_main() void ox_plot_main(int argc,char **argv) #endif { +#if !defined(VISUAL) int ds; fd_set r; int n; +#endif int id; Obj obj; unsigned int serial; @@ -117,11 +118,11 @@ void ox_plot_main(int argc,char **argv) extern int plot_argc; extern char **plot_argv; - ox_asir_init(plot_argc,plot_argv); + ox_asir_init(plot_argc,plot_argv,"ox_plot"); /* inform the watch thread of the completion of initialization */ SetEvent(hStreamNotify_Ack); #else - ox_asir_init(argc,argv); + ox_asir_init(argc,argv,"ox_plot"); init_plot_display(argc,argv); ds = ConnectionNumber(display); #endif @@ -183,19 +184,8 @@ static void process_ox(int id, Obj obj, unsigned int s ERR err; int ret; extern char LastError[]; - extern int recv_intr; -#if defined(VISUAL) - if ( recv_intr ) { - if ( recv_intr == 1 ) { - recv_intr = 0; - int_handler(SIGINT); - } else { - recv_intr = 0; - ox_usr1_handler(0); - } - } -#endif + check_intr(); if ( do_message ) fprintf(stderr,"#%d Got %s",serial,name_of_id(id)); switch ( id ) { @@ -207,7 +197,7 @@ static void process_ox(int id, Obj obj, unsigned int s fprintf(stderr," %s\n",name_of_cmd(cmd)); if ( ret = setjmp(main_env) ) { if ( ret == 1 ) { - create_error(&err,serial,LastError); + create_error(&err,serial,LastError,0); asir_push_one((Obj)err); } break; @@ -232,17 +222,19 @@ static void process_ox(int id, Obj obj, unsigned int s fprintf(stderr,"\n"); } -static process_resize(can,startp,endp) -struct canvas *can; -POINT startp,endp; +static void process_resize(struct canvas *can,POINT startp,POINT endp) { - if ( can->mode == MODE_INTERACTIVE ) + if ( can->mode == modeNO(INTERACTIVE) || can->mode == modeNO(POLARPLOT) ) return; - if ( can->mode == MODE_PLOT ) +#if 0 + if ( can->mode == modeNO(PLOT) ) plot_resize(can,startp,endp); else ifplot_resize(can,startp,endp); +#else + plot_resize(can,startp,endp); +#endif } static void asir_do_cmd(unsigned int cmd,unsigned int serial) @@ -250,7 +242,7 @@ static void asir_do_cmd(unsigned int cmd,unsigned int MATHCAP client_mathcap; LIST list; int i; - Q q; + Z q; switch ( cmd ) { case SM_dupErrors: @@ -259,7 +251,7 @@ static void asir_do_cmd(unsigned int cmd,unsigned int break; case SM_getsp: i = asir_OperandStackPtr+1; - STOQ(i,q); + STOZ(i,q); asir_push_one((Obj)q); break; case SM_popSerializedLocalObject: @@ -284,7 +276,8 @@ static void asir_do_cmd(unsigned int cmd,unsigned int asir_executeFunction(); break; case SM_shutdown: - asir_terminate(2); + asir_infile = 0; + asir_terminate(3); break; case SM_pops: asir_pops(); @@ -301,15 +294,12 @@ static void asir_do_cmd(unsigned int cmd,unsigned int } } -static void asir_executeFunction(serial) -int serial; +static void asir_executeFunction(int serial) { char *func; int argc; int id; - FUNC f; - Q ret; - VL vl; + Z ret; ERR err; NODE n,n1; @@ -324,29 +314,37 @@ int serial; NEXT(n1) = 0; id = -1; if ( !strcmp(func,"plot") ) { - id = plot(n); - STOQ(id,ret); asir_push_one((Obj)ret); + id = plot(n,modeNO(PLOT)); + STOZ(id,ret); asir_push_one((Obj)ret); + }else if ( !strcmp(func,"ifplot") ) { + id = plot(n,modeNO(IFPLOT)); + STOZ(id,ret); asir_push_one((Obj)ret); } else if ( !strcmp(func,"arrayplot") ) { id = arrayplot(n); - STOQ(id,ret); asir_push_one((Obj)ret); + STOZ(id,ret); asir_push_one((Obj)ret); } else if ( !strcmp(func,"open_canvas") ) { id = open_canvas(n); - STOQ(id,ret); asir_push_one((Obj)ret); + STOZ(id,ret); asir_push_one((Obj)ret); } else if ( !strcmp(func,"plotover") ) { plotover(n); } else if ( !strcmp(func,"drawcircle") ) { drawcircle(n); } else if ( !strcmp(func,"draw_obj") ) { if ( draw_obj(n) < 0 ) { - create_error(&err,serial,LastError); + create_error(&err,serial,LastError,0); asir_push_one((Obj)err); } + } else if ( !strcmp(func,"draw_string") ) { + if ( draw_string(n) < 0 ) { + create_error(&err,serial,LastError,0); + asir_push_one((Obj)err); + } } else if ( !strcmp(func,"clear_canvas") ) { clear_canvas(n); } } -print_rect(int x, int y, int z, int w) +void print_rect(int x, int y, int z, int w) { extern DWORD MainThread;