| 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 |
|
* |
| 9 |
|
|
| 10 |
|
#include "standard.h" |
| 11 |
|
#include "view.h" |
| 12 |
< |
#include "resolu.h" |
| 16 |
< |
#include "vfork.h" |
| 12 |
> |
#include "paths.h" |
| 13 |
|
#include <signal.h> |
| 14 |
|
#include <X11/Xlib.h> |
| 15 |
|
#include <X11/Xutil.h> |
| 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) { |
| 100 |
|
exit(1); |
| 101 |
|
} |
| 102 |
|
/* find our window */ |
| 103 |
< |
if (wname == NULL) |
| 104 |
< |
wname = pname; |
| 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); |
| 127 |
|
} |
| 128 |
|
do |
| 129 |
|
sleep(8); |
| 130 |
< |
while ((gwind=xfindwind(theDisplay,rwind,pname,4)) == None); |
| 130 |
> |
while ((gwind=xfindwind(theDisplay,rwind,wname,4)) == None); |
| 131 |
|
} else |
| 132 |
|
XMapRaised(theDisplay, gwind); |
| 133 |
|
do { |
| 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 { |