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.2 by greg, Thu Dec 19 14:56:36 1991 UTC vs.
Revision 2.6 by greg, Sat Feb 22 02:07:30 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"
12 < #include "resolu.h"
12 > #include "vfork.h"
13   #include <signal.h>
14   #include <X11/Xlib.h>
15   #include <X11/Xutil.h>
16  
20 #ifndef BSD
21 #define vfork   fork
22 #endif
23
17   #define XIM             "ximage"
18  
19   #define NSEG            30              /* number of segments per circle */
# Line 91 | Line 84 | char   *pname, *wname;
84          XWindowAttributes       wa;
85          XColor  xc;
86          XGCValues       gcv;
87 +        register int    i;
88                                          /* get the viewing parameters */
89          if (viewfile(pname, &ourview, &pres) <= 0 ||
90                          setview(&ourview) != NULL) {
# Line 106 | Line 100 | char   *pname, *wname;
100                  exit(1);
101          }
102                                          /* find our window */
103 <        if (wname == NULL)
104 <                wname = pname;
105 <        gwind = xfindwind(theDisplay, rwind, wname, 2);
103 >        if (wname == NULL) {
104 >                                /* remove directory prefix from name */
105 >                for (i = strlen(pname); i-- > 0; )
106 >                        if (pname[i] == '/')
107 >                                break;
108 >                wname = pname+i+1;
109 >                i = 0;
110 >        } else
111 >                i = 1;
112 >        gwind = xfindwind(theDisplay, rwind, wname, 4);
113          if (gwind == None) {
114 <                if (wname != pname) {
114 >                if (i) {
115                          fprintf(stderr, "%s: cannot find \"%s\" window\n",
116                                          progname, wname);
117                          exit(2);
118                  }
119                                          /* start ximage */
120                  if (vfork() == 0) {
121 <                        execlp(XIM, XIM, pname, 0);
121 >                        execlp(XIM, XIM, "-c", "256", pname, 0);
122                          perror(XIM);
123                          fprintf(stderr, "%s: cannot start %s\n",
124                                          progname, XIM);
# Line 126 | Line 127 | char   *pname, *wname;
127                  }
128                  do
129                          sleep(8);
130 <                while ((gwind=xfindwind(theDisplay,rwind,pname,2)) == None);
130 >                while ((gwind=xfindwind(theDisplay,rwind,wname,4)) == None);
131          } else
132                  XMapRaised(theDisplay, gwind);
133          do {
# Line 137 | Line 138 | char   *pname, *wname;
138                  fprintf(stderr,
139                  "%s: warning -- window seems to be the wrong size!\n",
140                                  progname);
141 <                if (pres.or & YMAJOR) {
141 >                if (pres.rt & YMAJOR) {
142                          pres.xr = wa.width;
143                          pres.yr = wa.height;
144                  } else {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines