| 1 |
– |
/* Copyright (c) 1998 Silicon Graphics, Inc. */ |
| 2 |
– |
|
| 1 |
|
#ifndef lint |
| 2 |
< |
static char SCCSid[] = "$SunId$ SGI"; |
| 2 |
> |
static const char RCSid[] = "$Id$"; |
| 3 |
|
#endif |
| 6 |
– |
|
| 4 |
|
/* |
| 5 |
|
* X11 driver for holodeck display. |
| 6 |
|
* Based on rview driver. |
| 10 |
|
#include <X11/Xlib.h> |
| 11 |
|
#include <X11/cursorfont.h> |
| 12 |
|
#include <X11/Xutil.h> |
| 13 |
+ |
#include <time.h> |
| 14 |
|
#include "rhd_qtree.h" |
| 15 |
|
#include "x11icon.h" |
| 16 |
|
|
| 375 |
|
return(ncolors = 0); |
| 376 |
|
if (XAllocColorCells(ourdisplay,ourmap,0,NULL,0,pixval,ncolors)) |
| 377 |
|
break; |
| 378 |
< |
free((char *)pixval); |
| 378 |
> |
free((void *)pixval); |
| 379 |
|
pixval = NULL; |
| 380 |
|
} |
| 381 |
|
if (pixval == NULL) { |
| 410 |
|
if (ncolors == 0) |
| 411 |
|
return; |
| 412 |
|
XFreeColors(ourdisplay,ourmap,pixval,ncolors,0L); |
| 413 |
< |
free((char *)pixval); |
| 413 |
> |
free((void *)pixval); |
| 414 |
|
pixval = NULL; |
| 415 |
|
ncolors = 0; |
| 416 |
|
if (ourmap != DefaultColormap(ourdisplay,ourscreen)) |
| 609 |
|
|
| 610 |
|
|
| 611 |
|
static |
| 612 |
+ |
waitabit() /* pause a moment */ |
| 613 |
+ |
{ |
| 614 |
+ |
struct timespec ts; |
| 615 |
+ |
ts.tv_sec = 0; |
| 616 |
+ |
ts.tv_nsec = 5000000; |
| 617 |
+ |
nanosleep(&ts, NULL); |
| 618 |
+ |
} |
| 619 |
+ |
|
| 620 |
+ |
|
| 621 |
+ |
static |
| 622 |
|
getmove(ebut) /* get view change */ |
| 623 |
|
XButtonPressedEvent *ebut; |
| 624 |
|
{ |
| 634 |
|
|
| 635 |
|
while (!XCheckMaskEvent(ourdisplay, |
| 636 |
|
ButtonReleaseMask, levptr(XEvent))) { |
| 637 |
< |
|
| 637 |
> |
waitabit(); |
| 638 |
|
if (!XQueryPointer(ourdisplay, gwind, &rootw, &childw, |
| 639 |
|
&rootx, &rooty, &wx, &wy, &statemask)) |
| 640 |
|
break; /* on another screen */ |