--- ray/src/hd/rhd_x11.c 1998/12/10 10:45:54 3.30 +++ ray/src/hd/rhd_x11.c 2003/07/27 22:12:02 3.35 @@ -1,9 +1,6 @@ -/* Copyright (c) 1998 Silicon Graphics, Inc. */ - #ifndef lint -static char SCCSid[] = "$SunId$ SGI"; +static const char RCSid[] = "$Id: rhd_x11.c,v 3.35 2003/07/27 22:12:02 schorsch Exp $"; #endif - /* * X11 driver for holodeck display. * Based on rview driver. @@ -13,6 +10,7 @@ static char SCCSid[] = "$SunId$ SGI"; #include #include #include +#include #include "rhd_qtree.h" #include "x11icon.h" @@ -178,7 +176,7 @@ char *id; DisplayWidth(ourdisplay, ourscreen); pheight = (double)DisplayHeightMM(ourdisplay, ourscreen) / DisplayHeight(ourdisplay, ourscreen); - copystruct(&odev.v, &stdview); + odev.v = stdview; odev.v.type = VT_PER; /* map the window and get its size */ XMapWindow(ourdisplay, gwind); @@ -260,13 +258,20 @@ VIEW *nv; XResizeWindow(ourdisplay, gwind, odev.hres, odev.vres); dev_input(); /* wait for resize event */ } - copystruct(&odev.v, nv); + odev.v = *nv; } qtReplant(); return(1); } +dev_section(ofn) /* add octree for geometry rendering */ +char *ofn; +{ + /* unimplemented */ +} + + dev_auxcom(cmd, args) /* process an auxiliary command */ char *cmd, *args; { @@ -370,7 +375,7 @@ loop: return(ncolors = 0); if (XAllocColorCells(ourdisplay,ourmap,0,NULL,0,pixval,ncolors)) break; - free((char *)pixval); + free((void *)pixval); pixval = NULL; } if (pixval == NULL) { @@ -405,7 +410,7 @@ freepixels() /* free our pixels */ if (ncolors == 0) return; XFreeColors(ourdisplay,ourmap,pixval,ncolors,0L); - free((char *)pixval); + free((void *)pixval); pixval = NULL; ncolors = 0; if (ourmap != DefaultColormap(ourdisplay,ourscreen)) @@ -541,7 +546,7 @@ int dx, dy, mov, orb; double d; register int li; /* start with old view */ - copystruct(&nv, &odev.v); + nv = odev.v; /* change view direction */ if (mov | orb) { if ((li = qtFindLeaf(dx, dy)) < 0) @@ -590,7 +595,7 @@ XButtonPressedEvent *ebut; XMaskEvent(ourdisplay, ButtonReleaseMask, levptr(XEvent)); endx = levptr(XButtonReleasedEvent)->x; endy = levptr(XButtonReleasedEvent)->y; - if (endx == startx | endy == starty) { + if ((endx == startx) | (endy == starty)) { XBell(ourdisplay, 0); return; } @@ -604,6 +609,16 @@ XButtonPressedEvent *ebut; static +waitabit() /* pause a moment */ +{ + struct timespec ts; + ts.tv_sec = 0; + ts.tv_nsec = 50000000; + nanosleep(&ts, NULL); +} + + +static getmove(ebut) /* get view change */ XButtonPressedEvent *ebut; { @@ -619,7 +634,7 @@ XButtonPressedEvent *ebut; while (!XCheckMaskEvent(ourdisplay, ButtonReleaseMask, levptr(XEvent))) { - + waitabit(); if (!XQueryPointer(ourdisplay, gwind, &rootw, &childw, &rootx, &rooty, &wx, &wy, &statemask)) break; /* on another screen */