--- ray/src/px/x11image.c 1994/11/21 09:18:48 2.39 +++ ray/src/px/x11image.c 1995/01/25 10:53:02 2.41 @@ -1,4 +1,4 @@ -/* Copyright (c) 1993 Regents of the University of California */ +/* Copyright (c) 1995 Regents of the University of California */ #ifndef lint static char SCCSid[] = "$SunId$ LBL"; @@ -74,6 +74,7 @@ int xoff = 0; /* x image offset */ int yoff = 0; /* y image offset */ int parent = 0; /* number of children, -1 if child */ +int sequential = 0; /* display images in sequence */ VIEW ourview = STDVIEW; /* image view parameters */ int gotview = 0; /* got parameters from file */ @@ -147,6 +148,7 @@ char *argv[]; greyscale = !greyscale; break; case 'm': + greyscale = 1; maxcolors = 2; break; case 'd': @@ -158,6 +160,9 @@ char *argv[]; case 'f': fast = !fast; break; + case 's': + sequential = !sequential; + break; case 'e': if (argv[i+1][0] != '+' && argv[i+1][0] != '-') goto userr; @@ -218,7 +223,7 @@ char *argv[]; getevent(); /* main loop */ userr: fprintf(stderr, -"Usage: %s [-di disp][[-ge] spec][-b][-m][-d][-f][-c nclrs][-e +/-stops][-g gamcor] pic ..\n", +"Usage: %s [-di disp][[-ge] spec][-b][-m][-d][-f][-c nclrs][-e +/-stops][-g gamcor][-s] pic ..\n", progname); exit(1); } @@ -301,17 +306,20 @@ char **argv; } } /* open window */ + i = CWEventMask|CWCursor|CWBackPixel|CWBorderPixel; ourwinattr.border_pixel = ourwhite; ourwinattr.background_pixel = ourblack; - ourwinattr.colormap = XCreateColormap(thedisplay, ourroot, - ourvis.visual, AllocNone); + if (ourvis.visual != DefaultVisual(thedisplay,ourscreen)) { + ourwinattr.colormap = newcmap(thedisplay, ourscreen, ourvis.visual); + i |= CWColormap; + } ourwinattr.event_mask = ExposureMask|KeyPressMask|ButtonPressMask| ButtonReleaseMask|ButtonMotionMask|StructureNotifyMask; ourwinattr.cursor = XCreateFontCursor(thedisplay, XC_diamond_cross); wind = XCreateWindow(thedisplay, ourroot, xszhints.x, xszhints.y, xszhints.width, xszhints.height, BORWIDTH, - ourvis.depth, InputOutput, ourvis.visual, CWEventMask| - CWCursor|CWBackPixel|CWBorderPixel|CWColormap, &ourwinattr); + ourvis.depth, InputOutput, ourvis.visual, + i, &ourwinattr); if (wind == 0) quiterr("cannot create window"); width = xmax; @@ -557,7 +565,7 @@ getevent() /* process the next event */ map_rcolors(ourras, wind); if (fast) make_rpixmap(ourras, wind); - if (parent < 0 & sigrecv == 0) { /* notify parent */ + if (!sequential & parent < 0 & sigrecv == 0) { kill(getppid(), SIGCONT); sigrecv--; }