ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/x10.c
(Generate patch)

Comparing ray/src/rt/x10.c (file contents):
Revision 1.7 by greg, Sat May 27 09:18:45 1989 UTC vs.
Revision 1.11 by greg, Fri Sep 29 13:23:59 1989 UTC

# Line 41 | Line 41 | static char SCCSid[] = "$SunId$ LBL";
41  
42   #define  hashcolr(c)    ((67*(c)[RED]+59*(c)[GRN]+71*(c)[BLU])%ncolors)
43  
44 < #define  flush()        XFlush()
44 > #define  checkinp()     while (XPending() > 0) getevent()
45  
46 #define  checkinp()     while (QLength() > 0) getevent()
47
46   #define  levptr(etype)  ((etype *)&thisevent)
47  
48   static char  *clientname;               /* calling client's name */
# Line 69 | Line 67 | static int  gheight = 0;               /* graphics window height */
67  
68   static TEXTWIND  *comline = NULL;       /* our command line */
69  
72 static int  c_erase, c_kill;            /* erase and kill characters */
73
70   static char  c_queue[64];               /* input queue */
71   static int  c_first = 0;                /* first character in queue */
72   static int  c_last = 0;                 /* last character in queue */
# Line 91 | Line 87 | struct driver *
87   x_init(name)                    /* initialize driver */
88   char  *name;
89   {
94        struct sgttyb  ttymode;
95        
96        if (isatty(0)) {
97                ioctl(0, TIOCGETP, &ttymode);
98                c_erase = ttymode.sg_erase;
99                c_kill = ttymode.sg_kill;
100        } else {
101                c_erase = 'H'-'@';
102                c_kill = 'U'-'@';
103        }
90          ourdisplay = XOpenDisplay(NULL);
91          if (ourdisplay == NULL) {
92                  stderr_v("cannot open X-windows; DISPLAY variable set?\n");
# Line 176 | Line 162 | int  xres, yres;
162          } else                                          /* just clear */
163                  XClear(gwind);
164          newmap();
165 <        flush();
165 >        checkinp();
166          return;
167   fail:
168          stderr_v("Failure opening window in x_clear\n");
# Line 203 | Line 189 | int  xmin, ymin, xmax, ymax;
189                                  pixval[ndx]);
190          }
191          if (nrays - lastflush >= WFLUSH) {
192 <                flush();
192 >                if (ncolors <= 0)       /* output necessary for death */
193 >                        XPixSet(gwind,0,0,1,1,BlackPixel);
194 >                checkinp();
195                  lastflush = nrays;
196          }
209        checkinp();
197   }
198  
199  
# Line 217 | Line 204 | char  *inp;
204          int  x_getc(), x_comout();
205  
206          xt_cursor(comline, TBLKCURS);
207 <        editline(inp, x_getc, x_comout, c_erase, c_kill);
207 >        editline(inp, x_getc, x_comout);
208          xt_cursor(comline, TNOCURS);
209   }
210  
# Line 228 | Line 215 | char  *out;
215   {
216          if (comline != NULL)
217                  xt_puts(out, comline);
218 <        flush();
218 >        XFlush();
219   }
220  
221  
# Line 255 | Line 242 | int  *xp, *yp;
242          *yp = gheight-1 - levptr(XKeyOrButtonEvent)->y;
243          XFocusKeyboard(RootWindow);
244          XUngrabMouse();
245 <        flush();                                /* insure release */
245 >        XFlush();                               /* insure release */
246          if (c_last > c_first)                   /* key pressed */
247                  return(x_getc());
248                                                  /* button pressed */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines