22 |
|
#define FEQ(a,b) ((a)-(b) <= FTINY && (a)-(b) >= -FTINY) |
23 |
|
#endif |
24 |
|
|
25 |
– |
#define CTRL(c) ((c)-'@') |
26 |
– |
|
25 |
|
#define GAMMA 2.2 /* default gamma correction */ |
26 |
|
|
27 |
|
#define MOVPCT 7 /* percent distance to move /frame */ |
508 |
|
if (setview(&nv) != NULL) |
509 |
|
return(0); /* illegal view */ |
510 |
|
dev_view(&nv); |
511 |
< |
inpresflags |= DEV_NEWVIEW; |
511 |
> |
inpresflags |= DFL(DC_SETVIEW); |
512 |
|
return(1); |
513 |
|
} |
514 |
|
|
542 |
|
qtUpdate(); |
543 |
|
draw_grids(); |
544 |
|
} |
545 |
< |
if (!(inpresflags & DEV_NEWVIEW)) { /* do final motion */ |
545 |
> |
if (!(inpresflags & DFL(DC_SETVIEW))) { /* do final motion */ |
546 |
|
movdir = MOVDIR(levptr(XButtonReleasedEvent)->button); |
547 |
|
wx = levptr(XButtonReleasedEvent)->x; |
548 |
|
wy = levptr(XButtonReleasedEvent)->y; |
572 |
|
headlocked = 0; |
573 |
|
return; |
574 |
|
case 'l': /* retrieve last view */ |
575 |
< |
inpresflags |= DEV_LASTVIEW; |
575 |
> |
inpresflags |= DFL(DC_LASTVIEW); |
576 |
|
return; |
579 |
– |
case CTRL('S'): |
577 |
|
case 'p': /* pause computation */ |
578 |
< |
inpresflags |= DEV_WAIT; |
578 |
> |
inpresflags |= DFL(DC_PAUSE); |
579 |
|
return; |
580 |
|
case 'v': /* spit out view */ |
581 |
< |
inpresflags |= DEV_PUTVIEW; |
581 |
> |
inpresflags |= DFL(DC_GETVIEW); |
582 |
|
return; |
586 |
– |
case CTRL('Q'): |
583 |
|
case '\n': |
584 |
|
case '\r': /* resume computation */ |
585 |
< |
inpresflags |= DEV_RESUME; |
585 |
> |
inpresflags |= DFL(DC_RESUME); |
586 |
|
return; |
587 |
|
case CTRL('R'): /* redraw screen */ |
588 |
|
if (ncolors > 0) |
590 |
|
qtRedraw(0, 0, odev.hres, odev.vres); |
591 |
|
return; |
592 |
|
case CTRL('L'): /* refresh from server */ |
593 |
< |
if (inpresflags & DEV_REDRAW) |
593 |
> |
if (inpresflags & DFL(DC_REDRAW)) |
594 |
|
return; |
595 |
|
XClearWindow(ourdisplay, gwind); |
596 |
|
draw_grids(); |
598 |
|
qtCompost(100); /* unload the old tree */ |
599 |
|
if (ncolors > 0) |
600 |
|
new_ctab(ncolors); |
601 |
< |
inpresflags |= DEV_REDRAW; /* resend values from server */ |
601 |
> |
inpresflags |= DFL(DC_REDRAW); /* resend values from server */ |
602 |
|
return; |
607 |
– |
case CTRL('D'): |
608 |
– |
case 'Q': |
603 |
|
case 'q': /* quit the program */ |
604 |
< |
inpresflags |= DEV_SHUTDOWN; |
604 |
> |
inpresflags |= DFL(DC_QUIT); |
605 |
|
return; |
606 |
|
default: |
607 |
|
XBell(ourdisplay, 0); |
617 |
|
if (odev.hres == 0 || odev.vres == 0) { /* first exposure */ |
618 |
|
odev.hres = eexp->width; |
619 |
|
odev.vres = eexp->height; |
626 |
– |
inpresflags |= DEV_NEWSIZE; |
620 |
|
} |
621 |
|
qtRedraw(eexp->x, odev.vres - eexp->y - eexp->height, |
622 |
|
eexp->x + eexp->width, odev.vres - eexp->y); |
636 |
|
odev.v.horiz = 2.*180./PI * atan(0.5/VIEWDIST*pwidth*odev.hres); |
637 |
|
odev.v.vert = 2.*180./PI * atan(0.5/VIEWDIST*pheight*odev.vres); |
638 |
|
|
639 |
< |
inpresflags |= DEV_NEWSIZE|DEV_NEWVIEW; |
639 |
> |
inpresflags |= DFL(DC_SETVIEW); |
640 |
|
} |