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

Comparing ray/src/px/x11image.c (file contents):
Revision 2.42 by greg, Wed Dec 13 09:52:38 1995 UTC vs.
Revision 2.43 by greg, Mon Jan 27 15:07:03 1997 UTC

# Line 1 | Line 1
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";
# Line 77 | Line 77 | int  parent = 0;                       /* number of children, -1 if child
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 */
# Line 168 | Line 169 | char  *argv[];
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;
# Line 228 | Line 232 | char  *argv[];
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   }
# Line 586 | Line 590 | getevent()                             /* process the next event */
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) &&
# Line 820 | Line 832 | XButtonPressedEvent  *ebut;
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  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines