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

Comparing ray/src/util/xglaresrc.c (file contents):
Revision 2.1 by greg, Tue Nov 12 17:19:29 1991 UTC vs.
Revision 2.8 by greg, Tue Nov 11 16:24:06 2003 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1991 Regents of the University of California */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ LBL";
2 > static const char       RCSid[] = "$Id$";
3   #endif
6
4   /*
5   *  Circle sources in a displayed image.
6   *
# Line 12 | Line 9 | static char SCCSid[] = "$SunId$ LBL";
9  
10   #include "standard.h"
11   #include "view.h"
15 #include "resolu.h"
12   #include <signal.h>
13   #include <X11/Xlib.h>
14   #include <X11/Xutil.h>
15  
20 #ifndef BSD
21 #define vfork   fork
22 #endif
23
16   #define XIM             "ximage"
17  
18   #define NSEG            30              /* number of segments per circle */
# Line 47 | Line 39 | main(argc, argv)
39   int     argc;
40   char    *argv[];
41   {
50        extern double   atof();
42          char    *windowname = NULL;
43          FILE    *fp;
44  
# Line 92 | Line 83 | char   *pname, *wname;
83          XWindowAttributes       wa;
84          XColor  xc;
85          XGCValues       gcv;
86 +        register int    i;
87                                          /* get the viewing parameters */
88          if (viewfile(pname, &ourview, &pres) <= 0 ||
89                          setview(&ourview) != NULL) {
# Line 107 | Line 99 | char   *pname, *wname;
99                  exit(1);
100          }
101                                          /* find our window */
102 <        if (wname == NULL)
103 <                wname = pname;
104 <        gwind = xfindwind(theDisplay, rwind, wname, 2);
102 >        if (wname == NULL) {
103 >                                /* remove directory prefix from name */
104 >                for (i = strlen(pname); i-- > 0; )
105 >                        if (pname[i] == '/')
106 >                                break;
107 >                wname = pname+i+1;
108 >                i = 0;
109 >        } else
110 >                i = 1;
111 >        gwind = xfindwind(theDisplay, rwind, wname, 4);
112          if (gwind == None) {
113 <                if (wname != pname) {
113 >                if (i) {
114                          fprintf(stderr, "%s: cannot find \"%s\" window\n",
115                                          progname, wname);
116                          exit(2);
117                  }
118                                          /* start ximage */
119 <                if (vfork() == 0) {
120 <                        execlp(XIM, XIM, pname, 0);
119 >                if (fork() == 0) {
120 >                        execlp(XIM, XIM, "-c", "256", pname, 0);
121                          perror(XIM);
122                          fprintf(stderr, "%s: cannot start %s\n",
123                                          progname, XIM);
# Line 127 | Line 126 | char   *pname, *wname;
126                  }
127                  do
128                          sleep(8);
129 <                while ((gwind=xfindwind(theDisplay,rwind,pname,2)) == None);
129 >                while ((gwind=xfindwind(theDisplay,rwind,wname,4)) == None);
130          } else
131                  XMapRaised(theDisplay, gwind);
132          do {
# Line 138 | Line 137 | char   *pname, *wname;
137                  fprintf(stderr,
138                  "%s: warning -- window seems to be the wrong size!\n",
139                                  progname);
140 <                if (pres.or & YMAJOR) {
140 >                if (pres.rt & YMAJOR) {
141                          pres.xr = wa.width;
142                          pres.yr = wa.height;
143                  } else {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines