|
Revision 573, 1.1 kB
(checked in by conrad, 4 years ago)
|
fix compile errors (from GCC updates over past 10 years ;-)
|
| Line | |
|---|
| 1 |
#include <stdio.h> |
|---|
| 2 |
#include <stdlib.h> |
|---|
| 3 |
#include <string.h> |
|---|
| 4 |
#include <time.h> |
|---|
| 5 |
#include <unistd.h> |
|---|
| 6 |
#include <X11/Xlib.h> |
|---|
| 7 |
|
|---|
| 8 |
extern Display *disp; |
|---|
| 9 |
extern Window Root; |
|---|
| 10 |
extern Window win; |
|---|
| 11 |
extern Visual *vis; |
|---|
| 12 |
extern int scr; |
|---|
| 13 |
extern unsigned int depth; |
|---|
| 14 |
extern GC fg,bg; |
|---|
| 15 |
extern int blk,wht; |
|---|
| 16 |
extern int width,height; |
|---|
| 17 |
|
|---|
| 18 |
extern Colormap cmap; |
|---|
| 19 |
extern XColor darkgray; |
|---|
| 20 |
extern XColor yellow; |
|---|
| 21 |
extern XColor blue; |
|---|
| 22 |
extern XColor outlines[32]; |
|---|
| 23 |
|
|---|
| 24 |
void SetupDisplay(void) |
|---|
| 25 |
{ |
|---|
| 26 |
XGCValues gcvals; |
|---|
| 27 |
|
|---|
| 28 |
if(!(disp=XOpenDisplay(NULL))) { |
|---|
| 29 |
perror("Cannot open display\n"); |
|---|
| 30 |
exit(1); |
|---|
| 31 |
} |
|---|
| 32 |
|
|---|
| 33 |
Root=DefaultRootWindow(disp); |
|---|
| 34 |
scr=DefaultScreen(disp); |
|---|
| 35 |
depth=DefaultDepth(disp,scr); |
|---|
| 36 |
blk=BlackPixel(disp,scr); |
|---|
| 37 |
wht=WhitePixel(disp,scr); |
|---|
| 38 |
vis=DefaultVisual(disp,scr); |
|---|
| 39 |
fg=XCreateGC(disp,Root,(unsigned long)0,&gcvals); |
|---|
| 40 |
bg=XCreateGC(disp,Root,(unsigned long)0,&gcvals); |
|---|
| 41 |
XSetForeground(disp,fg,wht); |
|---|
| 42 |
XSetBackground(disp,bg,blk); |
|---|
| 43 |
} |
|---|
| 44 |
|
|---|
| 45 |
void OpenWindow(void) |
|---|
| 46 |
{ |
|---|
| 47 |
win=XCreateSimpleWindow(disp,Root,0,0,width,height,0,blk,blk); |
|---|
| 48 |
XSelectInput(disp,win, ButtonPressMask | ButtonMotionMask | ButtonReleaseMask); |
|---|
| 49 |
XMapWindow(disp,win); |
|---|
| 50 |
XSync(disp,False); |
|---|
| 51 |
} |
|---|
| 52 |
|
|---|