=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/plot/ox_plot_xevent.c,v retrieving revision 1.10 retrieving revision 1.14 diff -u -p -r1.10 -r1.14 --- OpenXM_contrib2/asir2000/plot/ox_plot_xevent.c 2000/11/09 01:51:12 1.10 +++ OpenXM_contrib2/asir2000/plot/ox_plot_xevent.c 2002/01/30 08:31:34 1.14 @@ -45,7 +45,7 @@ * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. * - * $OpenXM: OpenXM_contrib2/asir2000/plot/ox_plot_xevent.c,v 1.9 2000/11/07 06:06:40 noro Exp $ + * $OpenXM: OpenXM_contrib2/asir2000/plot/ox_plot_xevent.c,v 1.13 2001/12/25 02:39:07 noro Exp $ */ #include "ca.h" #include "parse.h" @@ -55,6 +55,26 @@ #include #include +/* XXX : these lines are in plotg.c, but ld says they are not defined */ +#if __DARWIN__ +int stream; + +DISPLAY *display; +CURSOR normalcur,runningcur,errorcur; + +#if defined(VISUAL) +POINT start_point, end_point; +SIZE cansize; +#else +Window rootwin; +GC drawGC,dashGC,hlGC,scaleGC,clearGC,xorGC,colorGC,cdrawGC; +XFontStruct *sffs; +#endif + +struct canvas *canvas[MAXCANVAS]; +struct canvas *current_can; +#endif /* __DARWIN__ */ + #ifdef ABS #undef ABS #define ABS(a) ((a)>0?(a):-(a)) @@ -64,7 +84,7 @@ static char *dname; static int remotes; static int depth,scrn; -extern jmp_buf ox_env; +extern JMP_BUF ox_env; static Widget toplevel; static XtAppContext app_con; @@ -643,7 +663,7 @@ static XtResource resources[] = { offset(DashPixel),XtRPixel,(XtPointer)&dashPixel}, }; -init_plot_display(argc,argv) +int init_plot_display(argc,argv) int argc; char **argv; { @@ -652,7 +672,9 @@ char **argv; unsigned int tmp; for ( ac = argc, av = argv; ac; ac--, av++ ) - if ( index(*av,':') ) + if ( !strcmp(*av,"nox") ) + return 0; + else if ( index(*av,':') ) dname = *av; XtToolkitInitialize(); app_con = XtCreateApplicationContext(); @@ -660,7 +682,7 @@ char **argv; options,XtNumber(options),&argc,argv); if ( !display ) { fprintf(stderr,"Can't open display\n"); - exit(1); + return 0; } toplevel = XtAppCreateShell(0,"Plot",applicationShellWidgetClass, display,0,0); @@ -681,6 +703,7 @@ char **argv; create_gc(); create_font(); create_cursors(); + return 1; } static char *scalefont = "*-8-80-*"; @@ -704,12 +727,14 @@ create_gc() { scaleGC = XCreateGC(display,rootwin,0,NULL); xorGC = XCreateGC(display,rootwin,0,NULL); colorGC = XCreateGC(display,rootwin,0,NULL); + cdrawGC = XCreateGC(display,rootwin,0,NULL); XCopyGC(display,DefaultGC(display,scrn),(1L<<(GCLastBit+1))-1,drawGC); XCopyGC(display,DefaultGC(display,scrn),(1L<<(GCLastBit+1))-1,dashGC); XCopyGC(display,DefaultGC(display,scrn),(1L<<(GCLastBit+1))-1,clearGC); XCopyGC(display,DefaultGC(display,scrn),(1L<<(GCLastBit+1))-1,scaleGC); XCopyGC(display,DefaultGC(display,scrn),(1L<<(GCLastBit+1))-1,xorGC); XCopyGC(display,DefaultGC(display,scrn),(1L<<(GCLastBit+1))-1,colorGC); + XCopyGC(display,DefaultGC(display,scrn),(1L<<(GCLastBit+1))-1,cdrawGC); XSetForeground(display,drawGC,forePixel); XSetForeground(display,scaleGC,forePixel); XSetForeground(display,clearGC,backPixel); @@ -724,6 +749,18 @@ create_gc() { color.red = 0xffff; color.green = color.blue = 0; XAllocColor(display,DefaultColormap(display,scrn),&color); XSetForeground(display,colorGC,color.pixel); +} + +set_drawcolor(c) +unsigned int c; +{ + XColor color = {0,0x0,0x0,0x0,DoRed|DoGreen|DoBlue,0}; + + color.red = (c&0xff0000)>>8; + color.green = (c&0xff00); + color.blue = (c&0xff)<<8; + XAllocColor(display,DefaultColormap(display,scrn),&color); + XSetForeground(display,cdrawGC,color.pixel); } create_cursors() {