[BACK]Return to ox_plot_xevent.c CVS log [TXT][DIR] Up to [local] / OpenXM_contrib2 / asir2000 / plot

Diff for /OpenXM_contrib2/asir2000/plot/ox_plot_xevent.c between version 1.8 and 1.14

version 1.8, 2000/10/24 01:53:53 version 1.14, 2002/01/30 08:31:34
Line 45 
Line 45 
  * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE,   * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE,
  * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE.   * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE.
  *   *
  * $OpenXM: OpenXM_contrib2/asir2000/plot/ox_plot_xevent.c,v 1.7 2000/10/15 10:58:11 takayama 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 "ca.h"
 #include "parse.h"  #include "parse.h"
Line 55 
Line 55 
 #include <X11/Xaw/MenuButton.h>  #include <X11/Xaw/MenuButton.h>
 #include <X11/Xaw/Paned.h>  #include <X11/Xaw/Paned.h>
   
   /* 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  #ifdef ABS
 #undef ABS  #undef ABS
 #define ABS(a) ((a)>0?(a):-(a))  #define ABS(a) ((a)>0?(a):-(a))
Line 64  static char *dname;
Line 84  static char *dname;
 static int remotes;  static int remotes;
 static int depth,scrn;  static int depth,scrn;
   
 extern jmp_buf ox_env;  extern JMP_BUF ox_env;
 static Widget toplevel;  static Widget toplevel;
 static XtAppContext app_con;  static XtAppContext app_con;
   
Line 149  XButtonEvent *ev;
Line 169  XButtonEvent *ev;
                 case Button1:                  case Button1:
                         e.x = ev->x; e.y = ev->y;                          e.x = ev->x; e.y = ev->y;
                         draw_frame0(can->window,spos,e);                          draw_frame0(can->window,spos,e);
                         if ( !busy ) {                          if ( !busy && can->mode != MODE_INTERACTIVE ) {
                                 if ( can->mode == MODE_PLOT )                                  if ( can->mode == MODE_PLOT )
                                         plot_resize(can,spos,e);                                          plot_resize(can,spos,e);
                                 else                                  else
Line 643  static XtResource resources[] = {
Line 663  static XtResource resources[] = {
         offset(DashPixel),XtRPixel,(XtPointer)&dashPixel},          offset(DashPixel),XtRPixel,(XtPointer)&dashPixel},
 };  };
   
 init_plot_display(argc,argv)  int init_plot_display(argc,argv)
 int argc;  int argc;
 char **argv;  char **argv;
 {  {
Line 652  char **argv;
Line 672  char **argv;
         unsigned int tmp;          unsigned int tmp;
   
         for ( ac = argc, av = argv; ac; ac--, av++ )          for ( ac = argc, av = argv; ac; ac--, av++ )
                 if ( index(*av,':') )                  if ( !strcmp(*av,"nox") )
                           return 0;
                   else if ( index(*av,':') )
                         dname = *av;                          dname = *av;
         XtToolkitInitialize();          XtToolkitInitialize();
         app_con = XtCreateApplicationContext();          app_con = XtCreateApplicationContext();
Line 660  char **argv;
Line 682  char **argv;
                 options,XtNumber(options),&argc,argv);                  options,XtNumber(options),&argc,argv);
         if ( !display ) {          if ( !display ) {
                 fprintf(stderr,"Can't open display\n");                  fprintf(stderr,"Can't open display\n");
                 exit(1);                  return 0;
         }          }
         toplevel = XtAppCreateShell(0,"Plot",applicationShellWidgetClass,          toplevel = XtAppCreateShell(0,"Plot",applicationShellWidgetClass,
                 display,0,0);                  display,0,0);
Line 681  char **argv;
Line 703  char **argv;
         create_gc();          create_gc();
         create_font();          create_font();
         create_cursors();          create_cursors();
           return 1;
 }  }
   
 static char *scalefont = "*-8-80-*";  static char *scalefont = "*-8-80-*";
Line 704  create_gc() {
Line 727  create_gc() {
         scaleGC = XCreateGC(display,rootwin,0,NULL);          scaleGC = XCreateGC(display,rootwin,0,NULL);
         xorGC = XCreateGC(display,rootwin,0,NULL);          xorGC = XCreateGC(display,rootwin,0,NULL);
         colorGC = 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,drawGC);
         XCopyGC(display,DefaultGC(display,scrn),(1L<<(GCLastBit+1))-1,dashGC);          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,clearGC);
         XCopyGC(display,DefaultGC(display,scrn),(1L<<(GCLastBit+1))-1,scaleGC);          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,xorGC);
         XCopyGC(display,DefaultGC(display,scrn),(1L<<(GCLastBit+1))-1,colorGC);          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,drawGC,forePixel);
         XSetForeground(display,scaleGC,forePixel);          XSetForeground(display,scaleGC,forePixel);
         XSetForeground(display,clearGC,backPixel);          XSetForeground(display,clearGC,backPixel);
Line 726  create_gc() {
Line 751  create_gc() {
         XSetForeground(display,colorGC,color.pixel);          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() {  create_cursors() {
         static XColor fg = {0, 0x0, 0x0, 0x0,DoRed|DoGreen|DoBlue,0};          static XColor fg = {0, 0x0, 0x0, 0x0,DoRed|DoGreen|DoBlue,0};
         static XColor bg = {0, 0xffff, 0xffff, 0xffff,DoRed|DoGreen|DoBlue,0};          static XColor bg = {0, 0xffff, 0xffff, 0xffff,DoRed|DoGreen|DoBlue,0};
Line 1120  static void method_is_not_available() {
Line 1157  static void method_is_not_available() {
   strcat(m,Printing_methods[PrintingMethod]);    strcat(m,Printing_methods[PrintingMethod]);
   strcat(m,MSG2);    strcat(m,MSG2);
   warning(Can,m);    warning(Can,m);
   }
   
   clear_pixmap(can)
   struct canvas *can;
   {
           XFillRectangle(display,can->pix,clearGC,0,0,can->width,can->height);
           XFlush(display);
 }  }

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.14

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>