#include #include #include #include #include #include #include #include #include #include #include #include isitcolor_(isuncl) int *isuncl; { int fd,depth; struct pixwin *pw; char win_name[WIN_NAMESIZE]; if (we_getgfxwindow(win_name) != 0) { fprintf(stderr,"no graphics window available\n"); *isuncl=-1; return; } if ((fd=open(win_name,O_RDWR,0)) == -1) { fprintf(stderr,"could not open window\n"); *isuncl=-1; return; } if ((pw=pw_open(fd)) != (struct pixwin *) NULL) depth=pw->pw_pixrect->pr_depth; else { fprintf(stderr,"could not open pixwin\n"); *isuncl = -1; return; } close(fd); if(depth != 1 && depth != 8) { *isuncl = -1; return; } if(depth==1) *isuncl=0; else *isuncl=1; return; }