| 1 |
< |
/* Copyright (c) 1995 Regents of the University of California */ |
| 1 |
> |
/* Copyright (c) 1997 Regents of the University of California */ |
| 2 |
|
|
| 3 |
|
#ifndef lint |
| 4 |
|
static char SCCSid[] = "$SunId$ LBL"; |
| 77 |
|
int sequential = 0; /* display images in sequence */ |
| 78 |
|
|
| 79 |
|
char *tout = "od"; /* output of 't' command */ |
| 80 |
+ |
int tinterv = 0; /* interval between mouse reports */ |
| 81 |
|
|
| 82 |
|
VIEW ourview = STDVIEW; /* image view parameters */ |
| 83 |
|
int gotview = 0; /* got parameters from file */ |
| 169 |
|
case 'o': /* 't' output */ |
| 170 |
|
tout = argv[i]+2; |
| 171 |
|
break; |
| 172 |
+ |
case 't': /* msec interval */ |
| 173 |
+ |
tinterv = atoi(argv[++i]); |
| 174 |
+ |
break; |
| 175 |
|
case 'e': /* exposure comp. */ |
| 176 |
|
if (argv[i+1][0] != '+' && argv[i+1][0] != '-') |
| 177 |
|
goto userr; |
| 232 |
|
getevent(); /* main loop */ |
| 233 |
|
userr: |
| 234 |
|
fprintf(stderr, |
| 235 |
< |
"Usage: %s [-di disp][[-ge] spec][-b][-m][-d][-f][-c nclrs][-e +/-stops][-g gamcor][-s] pic ..\n", |
| 235 |
> |
"Usage: %s [-di disp][[-ge] spec][-b][-m][-d][-f][-c nclrs][-e +/-stops][-g gamcor][-s][-ospec][-t intvl] pic ..\n", |
| 236 |
|
progname); |
| 237 |
|
exit(1); |
| 238 |
|
} |
| 590 |
|
case ButtonPress: |
| 591 |
|
if (xev.xbutton.state & (ShiftMask|ControlMask)) |
| 592 |
|
moveimage(&xev.xbutton); |
| 589 |
– |
else if (xev.xbutton.button == Button2) |
| 590 |
– |
traceray(xev.xbutton.x, xev.xbutton.y); |
| 593 |
|
else |
| 594 |
< |
getbox(&xev.xbutton); |
| 594 |
> |
switch (xev.xbutton.button) { |
| 595 |
> |
case Button1: |
| 596 |
> |
getbox(&xev.xbutton); |
| 597 |
> |
break; |
| 598 |
> |
case Button2: |
| 599 |
> |
traceray(xev.xbutton.x, xev.xbutton.y); |
| 600 |
> |
break; |
| 601 |
> |
case Button3: |
| 602 |
> |
trackrays(&xev.xbutton); |
| 603 |
> |
break; |
| 604 |
> |
} |
| 605 |
|
break; |
| 606 |
|
case ClientMessage: |
| 607 |
|
if ((xev.xclient.message_type == wmProtocolsAtom) && |
| 832 |
|
box.ymin = ebut->y; |
| 833 |
|
} else { |
| 834 |
|
box.ysiz = ebut->y - box.ymin + 1; |
| 835 |
+ |
} |
| 836 |
+ |
} |
| 837 |
+ |
|
| 838 |
+ |
|
| 839 |
+ |
trackrays(ebut) /* trace rays as mouse moves */ |
| 840 |
+ |
XButtonPressedEvent *ebut; |
| 841 |
+ |
{ |
| 842 |
+ |
XEvent e; |
| 843 |
+ |
unsigned long lastrept; |
| 844 |
+ |
|
| 845 |
+ |
traceray(ebut->x, ebut->y); |
| 846 |
+ |
lastrept = ebut->time; |
| 847 |
+ |
XMaskEvent(thedisplay, ButtonReleaseMask|ButtonMotionMask, &e); |
| 848 |
+ |
while (e.type == MotionNotify) { |
| 849 |
+ |
if (e.xmotion.time >= lastrept + tinterv) { |
| 850 |
+ |
traceray(e.xmotion.x, e.xmotion.y); |
| 851 |
+ |
lastrept = e.xmotion.time; |
| 852 |
+ |
} |
| 853 |
+ |
XMaskEvent(thedisplay,ButtonReleaseMask|ButtonMotionMask,&e); |
| 854 |
|
} |
| 855 |
|
} |
| 856 |
|
|